com.dukascopy.api
Interface IChartPanel

All Known Subinterfaces:
IChart, IIndicatorPanel

public interface IChartPanel

Chart panel container for objects of corresponding type.


Method Summary
 void add(IChartObject chartObject)
          Adds object of IChartObject type to current panel.
 IChartPanel add(IIndicator indicator)
          Adds indicator to the current panel.
 IChartPanel add(IIndicator indicator, java.lang.Object[] optParams)
          Adds indicator to the current panel by specifying initial optional parameters values If optParams equals to null - default ones will be taken instead
 IChartPanel add(IIndicator indicator, java.lang.Object[] optParams, java.awt.Color[] outputColors, OutputParameterInfo.DrawingStyle[] outputDrawingStyles, int[] outputWidths)
          Adds indicator to the current panel by specifying initial optional parameters values, curves colors, drawing styles and line widths If output params are nulls - default ones will be taken instead
 void addMouseListener(boolean asynchronous, IChartPanelMouseListener chartMouseListener)
          Adds the specified mouse listener to receive mouse events from this chart panel.
 IChartObject get(java.lang.String chartObjectKey)
          Returns IChartObject instance by key if any exist on this panel.
 java.util.List<IChartObject> getAll()
          Returns all graphical objects on this panel.
 java.util.List<IIndicator> getIndicators()
          Returns all indicators on chart (including sub panels)
 double getMaxPrice()
          Returns maximal value of price scale
 double getMinPrice()
          Returns minimal value of price scale
 java.util.List<IChartPanelMouseListener> getMouseListeners()
          Returns an array of all the mouse listeners registered on this component.
 void remove(IChartObject chartObject)
          Deletes specified graphical object from this panel.
 IChartObject remove(java.lang.String chartObjectKey)
          Deletes graphical object from this panel by key.
 void removeAll()
          Removes all graphical objects from this panel.
 void removeIndicator(IIndicator indicator)
          Remove specified indicator from this panel.
 void removeMouseListener(IChartPanelMouseListener chartMouseListener)
          Removes the specified mouse listener so that it no longer receives mouse events from this component.
 

Method Detail

add

void add(IChartObject chartObject)
Adds object of IChartObject type to current panel. Please note that only one instance of object can be added per chart.

Parameters:
chartObject - - instance of IChartObject super type.
Throws:
java.lang.IllegalArgumentException - - if object is already present on chart.

add

IChartPanel add(IIndicator indicator)
Adds indicator to the current panel.

Parameters:
indicator - as IIndicator
Returns:
IChartPanel instance where indicator is put on.
Throws:
java.lang.IllegalStateException - trying to apply to main panel indicator designed for sub panel.

add

IChartPanel add(IIndicator indicator,
                java.lang.Object[] optParams)
Adds indicator to the current panel by specifying initial optional parameters values If optParams equals to null - default ones will be taken instead

Parameters:
indicator - as IIndicator
optParams - as Object[]
Returns:
IChartPanel instance where indicator is put on.
Throws:
java.lang.IllegalStateException - trying to apply indicator designed for main panel to sub panel and vice versa.

add

IChartPanel add(IIndicator indicator,
                java.lang.Object[] optParams,
                java.awt.Color[] outputColors,
                OutputParameterInfo.DrawingStyle[] outputDrawingStyles,
                int[] outputWidths)
Adds indicator to the current panel by specifying initial optional parameters values, curves colors, drawing styles and line widths If output params are nulls - default ones will be taken instead

Parameters:
indicator - as IIndicator
optParams - as Object[]
outputColors - as Color[]
outputDrawingStyles - as DrawingStyle[]
outputWidths - as int[]
Returns:
IChartPanel instance where indicator is put on.
Throws:
java.lang.IllegalStateException - trying to apply indicator designed for main panel to sub panel and vice versa.

getIndicators

java.util.List<IIndicator> getIndicators()
Returns all indicators on chart (including sub panels)

Returns:
List

get

IChartObject get(java.lang.String chartObjectKey)
Returns IChartObject instance by key if any exist on this panel.

Parameters:
chartObjectKey - unique id
Returns:
IChartObject or null if no object was found by specified key

getAll

java.util.List<IChartObject> getAll()
Returns all graphical objects on this panel.

Returns:
list of all graphical objects on the chart

getMinPrice

double getMinPrice()
Returns minimal value of price scale

Returns:
minimal value of the vertical scale

getMaxPrice

double getMaxPrice()
Returns maximal value of price scale

Returns:
maximal value of the vertical scale

removeIndicator

void removeIndicator(IIndicator indicator)
Remove specified indicator from this panel.

Parameters:
indicator - instance of IIndicator interface

remove

IChartObject remove(java.lang.String chartObjectKey)
Deletes graphical object from this panel by key.

Parameters:
chartObjectKey -

remove

void remove(IChartObject chartObject)
Deletes specified graphical object from this panel.

Parameters:
chartObject -

removeAll

void removeAll()
Removes all graphical objects from this panel.


addMouseListener

void addMouseListener(boolean asynchronous,
                      IChartPanelMouseListener chartMouseListener)
Adds the specified mouse listener to receive mouse events from this chart panel. If chartMouseListener is null, no exception is thrown and no action is performed.

Parameters:
asynchronous - if true listener will be triggered in AWT thread asynchronously with strategy thread, otherwise will be synchronized. Use false as default if not sure.
chartMouseListener - the mouse listener
See Also:
removeMouseListener(com.dukascopy.api.chart.mouse.IChartPanelMouseListener), getMouseListeners()

removeMouseListener

void removeMouseListener(IChartPanelMouseListener chartMouseListener)
Removes the specified mouse listener so that it no longer receives mouse events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If chartMouseListener is null, no exception is thrown and no action is performed.

Parameters:
chartMouseListener - the mouse listener
See Also:
addMouseListener(boolean, com.dukascopy.api.chart.mouse.IChartPanelMouseListener), getMouseListeners()

getMouseListeners

java.util.List<IChartPanelMouseListener> getMouseListeners()
Returns an array of all the mouse listeners registered on this component.

Returns:
all of this component's MouseListeners or an empty array if no mouse listeners are currently registered
See Also:
addMouseListener(boolean, com.dukascopy.api.chart.mouse.IChartPanelMouseListener), removeMouseListener(com.dukascopy.api.chart.mouse.IChartPanelMouseListener)