com.dukascopy.api
Class ChartObjectEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.dukascopy.api.ChartObjectEvent
All Implemented Interfaces:
Serializable

public class ChartObjectEvent
extends EventObject

Event used to pass parameters of chart object change

See Also:
Serialized Form

Nested Class Summary
static class ChartObjectEvent.AttrType
          Type of the attribute change event
 
Constructor Summary
ChartObjectEvent(Object source)
          Constructor for highlighted, selected and deleted events
ChartObjectEvent(Object source, IChartObject.ATTR_BOOLEAN booleanAttrType, boolean oldBoolean, boolean newBoolean, boolean isAdjusting)
          Constructor for attribute change event
ChartObjectEvent(Object source, IChartObject.ATTR_COLOR colorAttrType, Color oldColor, Color newColor, boolean isAdjusting)
          Constructor for attribute change event
ChartObjectEvent(Object source, IChartObject.ATTR_DOUBLE doubleAttrType, double oldDouble, double newDouble, boolean isAdjusting)
          Constructor for attribute change event
ChartObjectEvent(Object source, IChartObject.ATTR_INT intAttrType, int oldInt, int newInt, boolean isAdjusting)
          Constructor for attribute change event
ChartObjectEvent(Object source, IChartObject.ATTR_LONG longAttrType, long oldLong, long newLong, boolean isAdjusting)
          Constructor for attribute change event
ChartObjectEvent(Object source, long oldLong, long newLong, double oldDouble, double newDouble, boolean isAdjusting)
          Constructor for moved event
 
Method Summary
 void cancel()
          Allows to cancel changes made by this event.
 IChartObject.ATTR_BOOLEAN getBooleanAttrType()
          Returns name of the attribute
 IChartObject.ATTR_COLOR getColorAttrType()
          Returns name of the attribute
 IChartObject.ATTR_DOUBLE getDoubleAttrType()
          Returns name of the attribute
 IChartObject.ATTR_INT getIntAttrType()
          Returns name of the attribute
 IChartObject.ATTR_LONG getLongAttrType()
          Returns name of the attribute
 boolean getNewBoolean()
          Returns new value
 Color getNewColor()
          Returns new value
 double getNewDouble()
          Returns new value
 int getNewInt()
          Returns new value
 long getNewLong()
          Returns new value
 boolean getOldBoolean()
          Returns old value
 Color getOldColor()
          Returns old value
 double getOldDouble()
          Returns old value
 int getOldInt()
          Returns old value
 long getOldLong()
          Returns old value
 ChartObjectEvent.AttrType getType()
          Returns type of the attribute changed event
 boolean isAdjusting()
          Returns true if current event is for ajusting action.
 boolean isCanceled()
          Returns true if event was canceled.
 void setNewBoolean(boolean newBoolean)
          Sets new attribute value
 void setNewColor(Color newColor)
          Sets new attribute value
 void setNewDouble(double newDouble)
          Sets new attribute value
 void setNewInt(int newInt)
          Sets new attribute value
 void setNewLong(long newLong)
          Sets new attribute value
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChartObjectEvent

public ChartObjectEvent(Object source)
Constructor for highlighted, selected and deleted events

Parameters:
source - related IChartObject

ChartObjectEvent

public ChartObjectEvent(Object source,
                        long oldLong,
                        long newLong,
                        double oldDouble,
                        double newDouble,
                        boolean isAdjusting)
Constructor for moved event

Parameters:
source - related IChartObject
oldLong - old long
newLong - new long
oldDouble - old double
newDouble - new double
isAdjusting - true if event is not about final action

ChartObjectEvent

public ChartObjectEvent(Object source,
                        IChartObject.ATTR_LONG longAttrType,
                        long oldLong,
                        long newLong,
                        boolean isAdjusting)
Constructor for attribute change event

Parameters:
source - related IChartObject
longAttrType - type of the attribute
oldLong - old value
newLong - new value
isAdjusting - true if event is not about final action

ChartObjectEvent

public ChartObjectEvent(Object source,
                        IChartObject.ATTR_DOUBLE doubleAttrType,
                        double oldDouble,
                        double newDouble,
                        boolean isAdjusting)
Constructor for attribute change event

Parameters:
source - related IChartObject
doubleAttrType - type of the attribute
oldDouble - old value
newDouble - new value
isAdjusting - true if event is not about final action

ChartObjectEvent

public ChartObjectEvent(Object source,
                        IChartObject.ATTR_INT intAttrType,
                        int oldInt,
                        int newInt,
                        boolean isAdjusting)
Constructor for attribute change event

Parameters:
source - related IChartObject
intAttrType - type of the attribute
oldInt - old value
newInt - new value
isAdjusting - true if event is not about final action

ChartObjectEvent

public ChartObjectEvent(Object source,
                        IChartObject.ATTR_COLOR colorAttrType,
                        Color oldColor,
                        Color newColor,
                        boolean isAdjusting)
Constructor for attribute change event

Parameters:
source - related IChartObject
colorAttrType - type of the attribute
oldColor - old value
newColor - new value
isAdjusting - true if event is not about final action

ChartObjectEvent

public ChartObjectEvent(Object source,
                        IChartObject.ATTR_BOOLEAN booleanAttrType,
                        boolean oldBoolean,
                        boolean newBoolean,
                        boolean isAdjusting)
Constructor for attribute change event

Parameters:
source - related IChartObject
booleanAttrType - type of the attribute
oldBoolean - old value
newBoolean - new value
isAdjusting - true if event is not about final action
Method Detail

isCanceled

public boolean isCanceled()
Returns true if event was canceled. New events always arrive with this parameter set to false

Returns:
true if event was canceled

cancel

public void cancel()
Allows to cancel changes made by this event. Not all events can be canceled


getType

public ChartObjectEvent.AttrType getType()
Returns type of the attribute changed event

Returns:
type

isAdjusting

public boolean isAdjusting()
Returns true if current event is for ajusting action. For example there will be many events with this attribute set to true while user moves the drawing and only one final event with isAdjusting == false when user releases drawing at the end. Changes in attribute or cancel methods are ignored when isAdjusting is true

Returns:
true if event is not about final position

getLongAttrType

public IChartObject.ATTR_LONG getLongAttrType()
Returns name of the attribute

Returns:
name of the attribute

getOldLong

public long getOldLong()
Returns old value

Returns:
old value

getNewLong

public long getNewLong()
Returns new value

Returns:
new value

setNewLong

public void setNewLong(long newLong)
Sets new attribute value

Parameters:
newLong - new attribute value

getDoubleAttrType

public IChartObject.ATTR_DOUBLE getDoubleAttrType()
Returns name of the attribute

Returns:
name of the attribute

getOldDouble

public double getOldDouble()
Returns old value

Returns:
old value

getNewDouble

public double getNewDouble()
Returns new value

Returns:
new value

setNewDouble

public void setNewDouble(double newDouble)
Sets new attribute value

Parameters:
newDouble - new attribute value

getIntAttrType

public IChartObject.ATTR_INT getIntAttrType()
Returns name of the attribute

Returns:
name of the attribute

getOldInt

public int getOldInt()
Returns old value

Returns:
old value

getNewInt

public int getNewInt()
Returns new value

Returns:
new value

setNewInt

public void setNewInt(int newInt)
Sets new attribute value

Parameters:
newInt - new attribute value

getColorAttrType

public IChartObject.ATTR_COLOR getColorAttrType()
Returns name of the attribute

Returns:
name of the attribute

getOldColor

public Color getOldColor()
Returns old value

Returns:
old value

getNewColor

public Color getNewColor()
Returns new value

Returns:
new value

setNewColor

public void setNewColor(Color newColor)
Sets new attribute value

Parameters:
newColor - new attribute value

getBooleanAttrType

public IChartObject.ATTR_BOOLEAN getBooleanAttrType()
Returns name of the attribute

Returns:
name of the attribute

getOldBoolean

public boolean getOldBoolean()
Returns old value

Returns:
old value

getNewBoolean

public boolean getNewBoolean()
Returns new value

Returns:
new value

setNewBoolean

public void setNewBoolean(boolean newBoolean)
Sets new attribute value

Parameters:
newBoolean - new attribute value


Copyright © 2011. All Rights Reserved.