com.dukascopy.api
Interface IChartObject

All Known Subinterfaces:
IAndrewsPitchforkChartObject, IChannelChartObject, IChartDependentChartObject, ICyclesChartObject, IEllipseChartObject, IFiboArcChartObject, IFiboExpansionChartObject, IFiboFanChartObject, IFiboRetracementChartObject, IFiboTimeZonesChartObject, IFillableChartObject, IGannAnglesChartObject, IHorizontalLineChartObject, ILabelChartObject, ILeveledChartObject, ILongLineChartObject, IOhlcChartObject, IOrderLineChartObject, IPercentChartObject, IPolyLineChartObject, IPriceMarkerChartObject, IRayLineChartObject, IRectangleChartObject, IShortLineChartObject, ISignalDownChartObject, ISignalUpChartObject, ITextChartObject, ITimeMarkerChartObject, ITriangleChartObject, IVerticalLineChartObject, IVerticalRetracementChartObject

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

PROPERTY_FOREGROUND_COLOR

static final String PROPERTY_FOREGROUND_COLOR
String constant to be used in PropertyChangeListener.

See Also:
Constant Field Values

PROPERTY_FOREGROUND_ALPHA

static final String PROPERTY_FOREGROUND_ALPHA
String constant to be used in PropertyChangeListener.

See Also:
Constant Field Values

PROPERTY_STROKE

static final String PROPERTY_STROKE
String constant to be used in PropertyChangeListener.

See Also:
Constant Field Values

PROPERTY_FONT

static final String PROPERTY_FONT
String constant to be used in PropertyChangeListener.

See Also:
Constant Field Values

PROPERTY_STICKY

static final String PROPERTY_STICKY
String constant to be used in PropertyChangeListener.

See Also:
Constant Field Values

PROPERTY_POINT_TIME

static final String PROPERTY_POINT_TIME
String constant to be used in PropertyChangeListener. PropertyChangeListener fires IndexedPropertyChangeEvent with index of modified point

See Also:
Constant Field Values

PROPERTY_POINT_PRICE

static final String PROPERTY_POINT_PRICE
String constant to be used in PropertyChangeListener. PropertyChangeListener fires IndexedPropertyChangeEvent with index of modified point

See Also:
Constant Field Values
Method Detail

setChartObjectListener

void setChartObjectListener(ChartObjectListener listener)
Adds listener to receive events about user changes on the object. Works only with unlocked objects

Parameters:
listener - listener for events

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener listener)
Adds a 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.

Parameters:
listener - The PropertyChangeListener to be added
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners()

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

getPropertyChangeListeners

PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the PropertyChangeListeners added to this ChartObject with addPropertyChangeListener().

Returns:
all of the PropertyChangeListeners added or an empty array if no listeners have been added
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(java.beans.PropertyChangeListener)

setAttrLong

void setAttrLong(IChartObject.ATTR_LONG field,
                 long value)
Assigns value of type long to field

Parameters:
field - chart object field
value - to be assigned

getAttrLong

long getAttrLong(IChartObject.ATTR_LONG field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

setAttrDouble

void setAttrDouble(IChartObject.ATTR_DOUBLE field,
                   double value)
Assigns value of type double to field

Parameters:
field - chart object field
value - to be assigned

getAttrDouble

double getAttrDouble(IChartObject.ATTR_DOUBLE field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

setAttrInt

void setAttrInt(IChartObject.ATTR_INT field,
                int value)
Assigns value of type int to field

Parameters:
field - chart object field
value - to be assigned

getAttrInt

int getAttrInt(IChartObject.ATTR_INT field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

setAttrBoolean

void setAttrBoolean(IChartObject.ATTR_BOOLEAN field,
                    boolean value)
Assigns value of type boolean to field

Parameters:
field - chart object field
value - to be assigned

getAttrBoolean

boolean getAttrBoolean(IChartObject.ATTR_BOOLEAN field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

setAttrColor

void setAttrColor(IChartObject.ATTR_COLOR field,
                  Color value)
Assigns value of type Color to field

Parameters:
field - chart object field
value - to be assigned

getAttrColor

Color getAttrColor(IChartObject.ATTR_COLOR field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

setAttrText

void setAttrText(IChartObject.ATTR_TEXT field,
                 String value)
Assigns value of type String to field

Parameters:
field - chart object field
value - to be assigned

getAttrText

String getAttrText(IChartObject.ATTR_TEXT field)
Retrieves value of field

Parameters:
field - chart object field
Returns:
value of field

move

void move(long time,
          double price)
Moves first point of the object to the new position dragging whole object with all other points. Do not initiate chart repaint immediately, use IChart.repaint() method if necessary.

Parameters:
time - new time of the first point
price - new price of the first point

getText

String getText()
Returns object's text

Returns:
text

setText

void setText(String text)
Sets text to show with the object. Ignored if object doesn't support text

Parameters:
text - text to show

setText

void setText(String text,
             Font font)
Sets text to show with the object. Ignored if object doesn't support text

Parameters:
text - text to show
font - font to use for text rendering

setText

void setText(String text,
             int horizontalAlignment)
Sets text to show with the object. Ignored if object doesn't support text

Parameters:
text - text to show
horizontalAlignment - text horizontal position according to specified time. Available options for horizontalAlignment = {SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.RIGHT} Default value is SwingConstants.LEFT

setText

void setText(String text,
             Font font,
             int horizontalAlignment)
Sets text to show with the object. Ignored if object doesn't support text

Parameters:
text - text to show
font - font to use for text rendering
horizontalAlignment - text horizontal position according to specified time. Available options for horizontalAlignment = {SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.RIGHT} Default value is SwingConstants.LEFT

getColor

Color getColor()
Returns color of the object

Returns:
color

setColor

void setColor(Color color)
Sets color of the object

Parameters:
color - color to use for object rendering

getOpacity

float getOpacity()
Returns opacity alpha of the object

Returns:
alpha 0-1 (0: transparent; 1: opaque)

setOpacity

void setOpacity(float alpha)
Sets alpha of the object

Parameters:
alpha - values: 0-1 (0: transparent; 1: opaque)

getStroke

Stroke getStroke()
Returns stroke that is used for object rendering

Returns:
stroke

setStroke

void setStroke(Stroke stroke)
Sets stroke for object rendering

Parameters:
stroke - stroke to use for object rendering

getType

IChart.Type getType()
Returns type of the graphical object

Returns:
type of the graphical object

getKey

String getKey()
Returns:
unique key of this object

getTime

long getTime(int pointIndex)
Parameters:
pointIndex - which determines which coordinate should be used to obtain time
Returns:
time of the coordinate

getPrice

double getPrice(int pointIndex)
Parameters:
pointIndex - which determines which coordinate should be used to obtain price
Returns:
price of the coordinate

getPointsCount

int getPointsCount()
Returns:
minimal count of points which are used to set this chart object

setSticky

void setSticky(boolean sticky)
Controls drawing stickines. True by default

Parameters:
sticky - if true then drawing will adjust itself to closest high/low value for candle under cursor

isSticky

boolean isSticky()
If true then drawing will adjust itself to closest high/low value for candle under cursor

Returns:
true when drawing is sticky

isMenuEnabled

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

Returns:
true when menu is enabled for the drawing

setMenuEnabled

void setMenuEnabled(boolean menuEnabled)
Parameters:
menuEnabled - which determines show or not show the menu for the drawing


Copyright © 2011. All Rights Reserved.