public interface IChartObject
Modifier and Type | Interface and Description |
---|---|
static class |
IChartObject.ATTR_BOOLEAN
Deprecated.
|
static class |
IChartObject.ATTR_COLOR
Deprecated.
|
static class |
IChartObject.ATTR_DOUBLE
Deprecated.
|
static class |
IChartObject.ATTR_INT
Deprecated.
|
static class |
IChartObject.ATTR_LONG
Deprecated.
|
static class |
IChartObject.ATTR_TEXT
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_FONT
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_FOREGROUND_ALPHA
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_FOREGROUND_COLOR
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_POINT_PRICE
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_POINT_TIME
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_STICKY
String constant to be used in PropertyChangeListener.
|
static java.lang.String |
PROPERTY_STROKE
String constant to be used in PropertyChangeListener.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a
PropertyChangeListener to the listener list. |
IChartObject |
clone()
Clones the chart object with a random key
|
boolean |
getAttrBoolean(IChartObject.ATTR_BOOLEAN field)
Deprecated.
|
java.awt.Color |
getAttrColor(IChartObject.ATTR_COLOR field)
Deprecated.
|
double |
getAttrDouble(IChartObject.ATTR_DOUBLE field)
Deprecated.
|
int |
getAttrInt(IChartObject.ATTR_INT field)
Deprecated.
|
long |
getAttrLong(IChartObject.ATTR_LONG field)
Deprecated.
|
java.lang.String |
getAttrText(IChartObject.ATTR_TEXT field)
Deprecated.
|
java.awt.Color |
getColor()
Returns color of the object
|
IFinancialInstrument |
getFinancialInstrument()
Deprecated.
|
Instrument |
getInstrument()
Returns instrument used for drawing chart object or
null for using primary chart instrument. |
java.lang.String |
getKey() |
int |
getLineStyle()
Gets stroke style
|
float |
getLineWidth()
Returns stroke width
|
float |
getOpacity()
Returns opacity alpha of the object
|
int |
getPointsCount() |
double |
getPrice(int pointIndex) |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the
PropertyChangeListener s added
to this ChartObject with addPropertyChangeListener(). |
java.awt.Stroke |
getStroke()
Returns stroke that is used for object rendering
|
java.lang.String |
getText()
Returns object's text
|
int |
getTextTruncation()
Returns object text's maximum displayable character count.
|
long |
getTime(int pointIndex) |
IChart.Type |
getType()
Returns type of the graphical object
|
boolean |
isLabelEnabled()
If false then text value is never shown on chart for this drawing, if true - the label can be added/updated for this drawing object
|
boolean |
isLabelShown()
Returns show label option.
|
boolean |
isLocked()
Returns chart object lock state.
|
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
|
boolean |
isVisibleInWorkspaceTree()
Returns chart object whether is visible or hidden in Workspace Tree.
|
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(java.beans.PropertyChangeListener listener)
Removes a
PropertyChangeListener from the listener list. |
void |
setAttrBoolean(IChartObject.ATTR_BOOLEAN field,
boolean value)
Deprecated.
|
void |
setAttrColor(IChartObject.ATTR_COLOR field,
java.awt.Color value)
Deprecated.
|
void |
setAttrDouble(IChartObject.ATTR_DOUBLE field,
double value)
Deprecated.
|
void |
setAttrInt(IChartObject.ATTR_INT field,
int value)
Deprecated.
|
void |
setAttrLong(IChartObject.ATTR_LONG field,
long value)
Deprecated.
|
void |
setAttrText(IChartObject.ATTR_TEXT field,
java.lang.String value)
Deprecated.
|
void |
setChartObjectListener(ChartObjectListener listener)
Adds listener to receive events about user changes on the object.
|
void |
setColor(java.awt.Color color)
Sets color of the object
|
void |
setFinancialInstrument(IFinancialInstrument financialInstrument)
Deprecated.
|
void |
setInstrument(Instrument instrument)
Sets instrument used for drawing chart object or
null for using primary chart instrument. |
void |
setLineStyle(int lineStyle)
Sets stroke style
|
void |
setLineWidth(float width)
Sets stroke width
|
void |
setLocked(boolean locked)
Sets chart object lock state.
|
void |
setMenuEnabled(boolean menuEnabled) |
void |
setOpacity(float alpha)
Sets alpha of the object
|
void |
setShowLabel(boolean showLabel)
Sets show label option.
|
void |
setSticky(boolean sticky)
Controls drawing stickiness.
|
void |
setStroke(java.awt.Stroke stroke)
Sets stroke for object rendering
|
void |
setText(java.lang.String text)
Sets text to show with the object.
|
void |
setText(java.lang.String text,
java.awt.Font font)
Sets text to show with the object.
|
void |
setText(java.lang.String text,
java.awt.Font font,
int horizontalAlignment)
Sets text to show with the object.
|
void |
setText(java.lang.String text,
int horizontalAlignment)
Sets text to show with the object.
|
void |
setTextTruncation(int charCount)
Sets object text's maximum displayable character count.
|
void |
setTooltip(java.lang.String tooltip)
Deprecated.
use
setText(String) instead |
void |
setVisibleInWorkspaceTree(boolean visible)
Make chart object visible or hidden in Workspace Tree.
|
static final java.lang.String PROPERTY_FOREGROUND_COLOR
static final java.lang.String PROPERTY_FOREGROUND_ALPHA
static final java.lang.String PROPERTY_STROKE
static final java.lang.String PROPERTY_FONT
static final java.lang.String PROPERTY_STICKY
static final java.lang.String PROPERTY_POINT_TIME
PropertyChangeListener
fires IndexedPropertyChangeEvent
with index of modified pointstatic final java.lang.String PROPERTY_POINT_PRICE
PropertyChangeListener
fires IndexedPropertyChangeEvent
with index of modified pointvoid setChartObjectListener(ChartObjectListener listener)
listener
- listener for eventsvoid addPropertyChangeListener(java.beans.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(java.beans.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)
java.beans.PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListener
s added
to this ChartObject with addPropertyChangeListener().PropertyChangeListener
s added or an empty
array if no listeners have been addedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
@Deprecated void setAttrLong(IChartObject.ATTR_LONG field, long value)
long
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated long getAttrLong(IChartObject.ATTR_LONG field)
field
- chart object field@Deprecated void setAttrDouble(IChartObject.ATTR_DOUBLE field, double value)
double
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated double getAttrDouble(IChartObject.ATTR_DOUBLE field)
field
- chart object field@Deprecated void setAttrInt(IChartObject.ATTR_INT field, int value)
int
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated int getAttrInt(IChartObject.ATTR_INT field)
field
- chart object field@Deprecated void setAttrBoolean(IChartObject.ATTR_BOOLEAN field, boolean value)
boolean
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated boolean getAttrBoolean(IChartObject.ATTR_BOOLEAN field)
field
- chart object field@Deprecated void setAttrColor(IChartObject.ATTR_COLOR field, java.awt.Color value)
Color
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated java.awt.Color getAttrColor(IChartObject.ATTR_COLOR field)
field
- chart object field@Deprecated void setAttrText(IChartObject.ATTR_TEXT field, java.lang.String value)
String
to fieldfield
- chart object fieldvalue
- to be assigned@Deprecated java.lang.String getAttrText(IChartObject.ATTR_TEXT field)
field
- chart object fieldvoid move(long time, double price)
time
- new time of the first pointprice
- new price of the first pointjava.lang.String getText()
void setText(java.lang.String text)
text
- text to showvoid setText(java.lang.String text, java.awt.Font font)
text
- text to showfont
- font to use for text renderingvoid setText(java.lang.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.LEFTvoid setText(java.lang.String text, java.awt.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.LEFTint getTextTruncation()
getText()
length exceeds the count, the string on chart gets truncated according to this parameter value
and gets postfixed by "...".
For ISignalDownChartObject
, ISignalUpChartObject
and all IHorizontalLineChartObject
implementations
the default is 30, for the rest it is -1. The parameter does not apply to ITextChartObject
.
void setTextTruncation(int charCount)
getText()
length exceeds the count, the string on chart gets truncated according to this parameter value
and gets postfixed by "...".
The parameter does not apply to ITextChartObject
.charCount
- maximum displayable character countjava.awt.Color getColor()
void setColor(java.awt.Color color)
color
- color to use for object renderingfloat getOpacity()
void setOpacity(float alpha)
alpha
- values: 0-1 (0: transparent; 1: opaque)java.awt.Stroke getStroke()
void setStroke(java.awt.Stroke stroke)
stroke
- stroke to use for object renderingint getLineStyle()
LineStyle
void setLineStyle(int lineStyle)
lineStyle
- one of LineStyle constantLineStyle
float getLineWidth()
void setLineWidth(float width)
width
- width of stroke lineIChart.Type getType()
java.lang.String getKey()
Instrument getInstrument()
null
for using primary chart instrument.void setInstrument(Instrument instrument)
null
for using primary chart instrument.instrument
- instrument for drawing chart object@Deprecated IFinancialInstrument getFinancialInstrument()
null
for using primary chart instrument.@Deprecated void setFinancialInstrument(IFinancialInstrument financialInstrument)
null
for using primary chart instrument.financialInstrument
- instrument for drawing chart objectlong getTime(int pointIndex)
pointIndex
- which determines which coordinate should be used to obtain timedouble getPrice(int pointIndex)
pointIndex
- which determines which coordinate should be used to obtain priceint 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 drawingboolean isLabelEnabled()
void setShowLabel(boolean showLabel)
showLabel
- show label optionboolean isLabelShown()
@Deprecated void setTooltip(java.lang.String tooltip)
setText(String)
insteadtooltip
- tooltip textboolean isVisibleInWorkspaceTree()
isLocked()
,
setLocked(boolean)
void setVisibleInWorkspaceTree(boolean visible)
visible
- is visibleisLocked()
,
setLocked(boolean)
boolean isLocked()
void setLocked(boolean locked)
locked
- chart object lock stateIChartObject clone()
Copyright © 2024. All rights reserved.