|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IChartObject
Represents graphical object on the chart
| Nested Class Summary | |
|---|---|
static class |
IChartObject.ATTR_BOOLEAN
|
static class |
IChartObject.ATTR_COLOR
|
static class |
IChartObject.ATTR_DOUBLE
|
static class |
IChartObject.ATTR_INT
|
static class |
IChartObject.ATTR_LONG
|
static class |
IChartObject.ATTR_TEXT
|
| Field Summary | |
|---|---|
static String |
PROPERTY_FONT
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_FOREGROUND_ALPHA
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_FOREGROUND_COLOR
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_POINT_PRICE
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_POINT_TIME
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_STICKY
String constant to be used in PropertyChangeListener. |
static String |
PROPERTY_STROKE
String constant to be used in PropertyChangeListener. |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
boolean |
getAttrBoolean(IChartObject.ATTR_BOOLEAN field)
Retrieves value of field |
Color |
getAttrColor(IChartObject.ATTR_COLOR field)
Retrieves value of field |
double |
getAttrDouble(IChartObject.ATTR_DOUBLE field)
Retrieves value of field |
int |
getAttrInt(IChartObject.ATTR_INT field)
Retrieves value of field |
long |
getAttrLong(IChartObject.ATTR_LONG field)
Retrieves value of field |
String |
getAttrText(IChartObject.ATTR_TEXT field)
Retrieves value of field |
Color |
getColor()
Returns color of the object |
String |
getKey()
|
float |
getOpacity()
Returns opacity alpha of the object |
int |
getPointsCount()
|
double |
getPrice(int pointIndex)
|
PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the PropertyChangeListeners added
to this ChartObject with addPropertyChangeListener(). |
Stroke |
getStroke()
Returns stroke that is used for object rendering |
String |
getText()
Returns object's text |
long |
getTime(int pointIndex)
|
IChart.Type |
getType()
Returns type of the graphical object |
boolean |
isMenuEnabled()
If false then the menu is never shown on chart for this drawing, if true - menu will be shown on right button click |
boolean |
isSticky()
If true then drawing will adjust itself to closest high/low value for candle under cursor |
void |
move(long time,
double price)
Moves first point of the object to the new position dragging whole object with all other points. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
setAttrBoolean(IChartObject.ATTR_BOOLEAN field,
boolean value)
Assigns value of type boolean to field |
void |
setAttrColor(IChartObject.ATTR_COLOR field,
Color value)
Assigns value of type Color to field |
void |
setAttrDouble(IChartObject.ATTR_DOUBLE field,
double value)
Assigns value of type double to field |
void |
setAttrInt(IChartObject.ATTR_INT field,
int value)
Assigns value of type int to field |
void |
setAttrLong(IChartObject.ATTR_LONG field,
long value)
Assigns value of type long to field |
void |
setAttrText(IChartObject.ATTR_TEXT field,
String value)
Assigns value of type String to field |
void |
setChartObjectListener(ChartObjectListener listener)
Adds listener to receive events about user changes on the object. |
void |
setColor(Color color)
Sets color of the object |
void |
setMenuEnabled(boolean menuEnabled)
|
void |
setOpacity(float alpha)
Sets alpha of the object |
void |
setSticky(boolean sticky)
Controls drawing stickines. |
void |
setStroke(Stroke stroke)
Sets stroke for object rendering |
void |
setText(String text)
Sets text to show with the object. |
void |
setText(String text,
Font font)
Sets text to show with the object. |
void |
setText(String text,
Font font,
int horizontalAlignment)
Sets text to show with the object. |
void |
setText(String text,
int horizontalAlignment)
Sets text to show with the object. |
| Field Detail |
|---|
static final String PROPERTY_FOREGROUND_COLOR
static final String PROPERTY_FOREGROUND_ALPHA
static final String PROPERTY_STROKE
static final String PROPERTY_FONT
static final String PROPERTY_STICKY
static final String PROPERTY_POINT_TIME
PropertyChangeListener fires IndexedPropertyChangeEvent with index of modified point
static final String PROPERTY_POINT_PRICE
PropertyChangeListener fires IndexedPropertyChangeEvent with index of modified point
| Method Detail |
|---|
void setChartObjectListener(ChartObjectListener listener)
listener - listener for eventsvoid addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener to the listener list.
The listener is registered for all properties.
A PropertyChangeEvent will get fired in response to setting
a bound property, e.g. setColor, setOpacity,
or setStroke.
Note that if the current component is inheriting its property
from its container, then no event will be
fired in response to a change in the inherited property.
listener - The PropertyChangeListener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener),
getPropertyChangeListeners()void removePropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all properties.
listener - the PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListeners added
to this ChartObject with addPropertyChangeListener().
PropertyChangeListeners added or an empty
array if no listeners have been addedaddPropertyChangeListener(java.beans.PropertyChangeListener),
removePropertyChangeListener(java.beans.PropertyChangeListener)
void setAttrLong(IChartObject.ATTR_LONG field,
long value)
long to field
field - chart object fieldvalue - to be assignedlong getAttrLong(IChartObject.ATTR_LONG field)
field - chart object field
void setAttrDouble(IChartObject.ATTR_DOUBLE field,
double value)
double to field
field - chart object fieldvalue - to be assigneddouble getAttrDouble(IChartObject.ATTR_DOUBLE field)
field - chart object field
void setAttrInt(IChartObject.ATTR_INT field,
int value)
int to field
field - chart object fieldvalue - to be assignedint getAttrInt(IChartObject.ATTR_INT field)
field - chart object field
void setAttrBoolean(IChartObject.ATTR_BOOLEAN field,
boolean value)
boolean to field
field - chart object fieldvalue - to be assignedboolean getAttrBoolean(IChartObject.ATTR_BOOLEAN field)
field - chart object field
void setAttrColor(IChartObject.ATTR_COLOR field,
Color value)
Color to field
field - chart object fieldvalue - to be assignedColor getAttrColor(IChartObject.ATTR_COLOR field)
field - chart object field
void setAttrText(IChartObject.ATTR_TEXT field,
String value)
String to field
field - chart object fieldvalue - to be assignedString getAttrText(IChartObject.ATTR_TEXT field)
field - chart object field
void move(long time,
double price)
time - new time of the first pointprice - new price of the first pointString getText()
void setText(String text)
text - text to show
void setText(String text,
Font font)
text - text to showfont - font to use for text rendering
void setText(String text,
int horizontalAlignment)
text - text to showhorizontalAlignment - text horizontal position according to specified time.
Available options for horizontalAlignment = {SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.RIGHT}
Default value is SwingConstants.LEFT
void setText(String text,
Font font,
int horizontalAlignment)
text - text to showfont - font to use for text renderinghorizontalAlignment - text horizontal position according to specified time.
Available options for horizontalAlignment = {SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.RIGHT}
Default value is SwingConstants.LEFTColor getColor()
void setColor(Color color)
color - color to use for object renderingfloat getOpacity()
void setOpacity(float alpha)
alpha - values: 0-1 (0: transparent; 1: opaque)Stroke getStroke()
void setStroke(Stroke stroke)
stroke - stroke to use for object renderingIChart.Type getType()
String getKey()
long getTime(int pointIndex)
pointIndex - which determines which coordinate should be used to obtain time
double getPrice(int pointIndex)
pointIndex - which determines which coordinate should be used to obtain price
int getPointsCount()
void setSticky(boolean sticky)
sticky - if true then drawing will adjust itself to closest high/low value for candle under cursorboolean isSticky()
boolean isMenuEnabled()
void setMenuEnabled(boolean menuEnabled)
menuEnabled - which determines show or not show the menu for the drawing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||