public interface IChart
Allows to draw graphical objects on the chart
| Nested Class Summary | |
|---|---|
static class |
IChart.Type
Type of the graphical object |
| Method Summary | |
|---|---|
void |
addIndicator(IIndicator indicator)
Deprecated. please use IChartPanel.add(IIndicator) method |
void |
addIndicator(IIndicator indicator,
java.lang.Object[] optParams)
Deprecated. Please use IChartPanel.add(IIndicator, Object[]) method |
void |
addIndicator(IIndicator indicator,
java.lang.Object[] optParams,
java.awt.Color[] outputColors,
OutputParameterInfo.DrawingStyle[] outputDrawingStyles,
int[] outputWidths)
Deprecated. Please use #add(IIndicator, Object[], Color[], DrawingStyle[], int[]) method |
void |
addSubIndicator(IIndicator indicator)
Deprecated. use IChartPanel.add(IIndicator) |
void |
addSubIndicator(java.lang.Integer subChartId,
IIndicator indicator)
Deprecated. use getIndicatorPanels() and IChartPanel.add(IIndicator) methods. |
void |
addSubIndicatorByPanelIndex(java.lang.Integer subPanelIndex,
IIndicator indicator)
Deprecated. use getIndicatorPanels() and IChartPanel.add(IIndicator) methods |
void |
addToMainChart(IChartObject object)
Deprecated. Please use IChartPanel.add(IChartObject) method |
void |
addToMainChartUnlocked(IChartObject object)
Deprecated. Please, use method @link addToMainChart(IChartObject) There is no objects division onto locked and unlocked anymore |
void |
addToSubChart(java.lang.Integer subChartId,
int indicatorId,
IChartObject object)
Deprecated. use getIndicatorPanels() and IIndicatorPanel.add(IChartObject) methods |
void |
addToSubChart(int subPanelIndex,
IChartObject chartObject)
Deprecated. use getIndicatorPanels() and IIndicatorPanel.add(IChartObject) methods |
void |
comment(java.lang.String comment)
Writes a comment in the upper left corner. |
IChartObject |
draw(java.lang.String key,
IChart.Type type,
long time1,
double price1)
Deprecated. - this method is deprecated. please use IChartObjectFactory create() method() instead. |
IChartObject |
draw(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2)
Deprecated. - this method is deprecated. please use IChartObjectFactory create() method() instead. |
IChartObject |
draw(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2,
long time3,
double price3)
Deprecated. - this method is deprecated. please use IChartObjectFactory create() method() instead. |
IChartObject |
drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1)
Deprecated. - this method is deprecated. please use addToMainChartUnlocked() method instead. |
IChartObject |
drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2)
Deprecated. - this method is deprecated. please use addToMainChartUnlocked() method instead.
Draws graphical object that requires up to 2 points. Object can be selected, moved and changed by the user |
IChartObject |
drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2,
long time3,
double price3)
Deprecated. - this method is deprecated. please use addToMainChartUnlocked() method instead.
Draws graphical object that requires up to 3 points. Object can be selected, moved and changed by the user |
IChartObject |
get(java.lang.String key)
Returns IChartObject instance by key if any exist on this panel. |
java.util.List<IChartObject> |
getAll()
Returns all graphical objects on this panel. |
int |
getBarsCount()
Returns amount of bars visible on the screen |
IChartObjectFactory |
getChartObjectFactory()
Returns IChartObjectFactory instance. |
java.awt.Color |
getCommentColor()
Gets the foreground color of comment. |
java.awt.Font |
getCommentFont()
Gets the comment's font. |
int |
getCommentHorizontalPosition()
Returns the horizontal position of the comment's text. |
int |
getCommentVerticalPosition()
Returns the vertical position of the comment's text. |
DataType.DataPresentationType |
getDataPresentationType()
Returns charts' current DataType.DataPresentationType. |
DataType |
getDataType()
Returns selected Data Type |
IFeedDescriptor |
getFeedDescriptor()
Returns chart state described by bean IFeedDescriptor |
Filter |
getFilter()
Returns current filter |
java.awt.image.BufferedImage |
getImage()
Creates a BufferedImage snapshot of this chart at the given moment. |
java.util.List<IIndicatorPanel> |
getIndicatorPanels()
Returns current chart active sub panels. |
java.util.List<IIndicator> |
getIndicators()
Returns all indicators on chart (including sub panels) |
Instrument |
getInstrument()
Returns instrument of the chart |
java.util.Map<IIndicator,java.lang.Object[]> |
getLastCalculatedIndicatorOutputs()
Returns outputs of the indicators that are plotted on the chart at the given moment. |
ITimedData[] |
getLastRequestedData()
Returns data feed objects that are plotted on the chart at the given moment. |
long |
getMaxTime()
Returns the maximal time axis value. |
long |
getMinTime()
Returns the minimal time axis value. |
PriceRange |
getPriceRange()
The method returns currently selected Price Range on chart |
ReversalAmount |
getReversalAmount()
The method returns currently selected Reversal Amount on the Point And Figure chart For non P&F charts null will be returned |
OfferSide |
getSelectedOfferSide()
Returns selected offer side |
Period |
getSelectedPeriod()
Returns selected period |
java.util.List<IChartObject> |
getStrategyChartObjects()
The method returns List of chart objects created by current strategy Empty list is returned if no objects were created Null is never returned |
TickBarSize |
getTickBarSize()
The method returns currently selected Trade Bar Size on Tick Bar chart For non Tick Bar charts null might be returned |
java.lang.Boolean |
isChartObjectUnlocked(IChartObject chartObject)
Deprecated. There is no objects division onto locked and unlocked anymore, so this method will always return false |
void |
move(IChartObject objectToMove,
long newTime,
double newPrice)
Moves graphical object to new coordinates. |
void |
move(java.lang.String chartObjectKey,
long newTime,
double newPrice)
Moves graphical object to new coordinates. |
void |
navigateAndSelectDrawing(IChartObject chartObject)
Navigates to and selects specified drawing. |
void |
navigateAndSelectDrawing(java.lang.String key)
Navigates to and selects specified drawing by key. |
double |
priceMax(int index)
Deprecated. use IChartPanel.getMaxPrice() |
double |
priceMin(int index)
Deprecated. use IChartPanel.getMinPrice() |
void |
remove(IChartObject chartObject)
Deletes specified graphical object from this panel. |
java.util.List<IChartObject> |
remove(java.util.List<IChartObject> chartObjects)
Deletes graphical objects |
IChartObject |
remove(java.lang.String key)
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 |
repaint()
Refresh and repaint chart |
void |
selectDrawing(IChartObject chartObject)
Select specified drawing. |
void |
selectDrawing(java.lang.String key)
Select specified drawing by key. |
void |
setCommentColor(java.awt.Color color)
Sets the foreground color of comment. |
void |
setCommentFont(java.awt.Font font)
Sets the comment's font. |
void |
setCommentHorizontalPosition(int position)
Sets the horizontal position of the comment's text. |
void |
setCommentVerticalPosition(int position)
Sets the vertical position of the comment's text. |
void |
setDataPresentationType(DataType.DataPresentationType presentationType)
Applies DataPresentationType to current chart. |
void |
setInstrument(Instrument instrument)
Deprecated. |
void |
setVerticalAutoscale(boolean autoscale)
Switches on/off chart vertical autoscale mode. |
void |
setVerticalAxisScale(double minPriceValue,
double maxPriceValue)
Sets minimal and maximal value of the vertical scale of the current chart when it is maximally expanded. |
int |
size()
Returns number of the graphical objects on the chart |
int |
windowsTotal()
Returns count of indicator windows on the chart (including main chart). |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface com.dukascopy.api.IChartPanel |
|---|
add, add, add, add, addMouseListener, getMaxPrice, getMinPrice, getMouseListeners, removeMouseListener |
| Method Detail |
|---|
@Deprecated
IChartObject draw(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2,
long time3,
double price3)
IChartObjectFactory create() method() instead.
key - unique id of the objecttype - type of the objecttime1 - time of first pointprice1 - price of first pointtime2 - time of second pointprice2 - price of second pointtime3 - time of third pointprice3 - price of third point
@Deprecated
IChartObject draw(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2)
IChartObjectFactory create() method() instead.
key - unique id of the objecttype - type of the objecttime1 - time of first pointprice1 - price of first pointtime2 - time of second pointprice2 - price of second point
@Deprecated
IChartObject draw(java.lang.String key,
IChart.Type type,
long time1,
double price1)
IChartObjectFactory create() method() instead.
key - unique id of the objecttype - type of the objecttime1 - time of the pointprice1 - price of the point
@Deprecated
IChartObject drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2,
long time3,
double price3)
addToMainChartUnlocked() method instead.
Draws graphical object that requires up to 3 points. Object can be selected, moved and changed by the user
key - unique id of the objecttype - type of the objecttime1 - time of first pointprice1 - price of first pointtime2 - time of second pointprice2 - price of second pointtime3 - time of third pointprice3 - price of third point
@Deprecated
IChartObject drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1,
long time2,
double price2)
addToMainChartUnlocked() method instead.
Draws graphical object that requires up to 2 points. Object can be selected, moved and changed by the user
key - unique id of the objecttype - type of the objecttime1 - time of first pointprice1 - price of first pointtime2 - time of second pointprice2 - price of second point
@Deprecated
IChartObject drawUnlocked(java.lang.String key,
IChart.Type type,
long time1,
double price1)
addToMainChartUnlocked() method instead.
key - unique id of the objecttype - type of the objecttime1 - time of the pointprice1 - price of the point
void move(IChartObject objectToMove,
long newTime,
double newPrice)
objectToMove - chart object to movenewTime - new time coordinatenewPrice - new price coordinate
void move(java.lang.String chartObjectKey,
long newTime,
double newPrice)
chartObjectKey - key of the chart object to movenewTime - new time coordinatenewPrice - new price coordinatevoid comment(java.lang.String comment)
comment - string to displayvoid setCommentHorizontalPosition(int position)
position - One of the following constants
defined in SwingConstants:
LEFT,
CENTER,
RIGHT
java.lang.IllegalArgumentException#getCommentHorizontalPosition()},
java.swing.SwingConstantsint getCommentHorizontalPosition()
SwingConstants:
LEFT,
CENTER,
RIGHT.setCommentHorizontalPosition(int)void setCommentVerticalPosition(int position)
position - One of the following constants
defined in SwingConstants:
TOP,
CENTER,
BOTTM
java.lang.IllegalArgumentExceptiongetCommentVerticalPosition(),
SwingConstantsint getCommentVerticalPosition()
SwingConstants:
TOP,
CENTER,
BOTTOM.setCommentVerticalPosition(int)void setCommentFont(java.awt.Font font)
font - the desired Font for commentComponent.getFont()java.awt.Font getCommentFont()
setCommentFont(Font)void setCommentColor(java.awt.Color color)
color - the color to become comment's foreground color
if this parameter is null, then used default text font defined in chart's themegetCommentColor()java.awt.Color getCommentColor()
setCommentColor(Color)IChartObject get(java.lang.String key)
IChartObject instance by key if any exist on this panel.
get in interface IChartPanelkey - unique id
IChartObject remove(java.lang.String key)
remove in interface IChartPanelvoid remove(IChartObject chartObject)
remove in interface IChartPaneljava.util.List<IChartObject> remove(java.util.List<IChartObject> chartObjects)
chartObjects -
java.util.List<IChartObject> getAll()
getAll in interface IChartPanelvoid removeAll()
removeAll in interface IChartPanelint size()
@Deprecated double priceMin(int index)
IChartPanel.getMinPrice()
index - of the (sub-)window
@Deprecated double priceMax(int index)
IChartPanel.getMaxPrice()
index - of the (sub-)window
void setVerticalAxisScale(double minPriceValue,
double maxPriceValue)
minPriceValue - minimal value of the vertical scalemaxpriceValue - maximal value of the vertical scalevoid setVerticalAutoscale(boolean autoscale)
autoscale - int getBarsCount()
int windowsTotal()
Instrument getInstrument()
getFeedDescriptor()void setInstrument(Instrument instrument)
instrument - Period getSelectedPeriod()
getFeedDescriptor()OfferSide getSelectedOfferSide()
getFeedDescriptor()@Deprecated void addIndicator(IIndicator indicator)
IChartPanel.add(IIndicator) method
indicator - as IIndicator
@Deprecated
void addIndicator(IIndicator indicator,
java.lang.Object[] optParams)
IChartPanel.add(IIndicator, Object[]) method
indicator - as IIndicatoroptParams - as Object[]
@Deprecated
void addIndicator(IIndicator indicator,
java.lang.Object[] optParams,
java.awt.Color[] outputColors,
OutputParameterInfo.DrawingStyle[] outputDrawingStyles,
int[] outputWidths)
#add(IIndicator, Object[], Color[], DrawingStyle[], int[]) method
indicator - as IIndicatoroptParams - as Object[]outputColors - as Color[]outputDrawingStyles - as DrawingStyle[]outputWidths - as int[]
@Deprecated
void addSubIndicator(java.lang.Integer subChartId,
IIndicator indicator)
getIndicatorPanels() and IChartPanel.add(IIndicator) methods.
subChartId - indicator - as IIndicatorvoid removeIndicator(IIndicator indicator)
removeIndicator in interface IChartPanelindicator - instance of IIndicator interfacejava.util.List<IIndicator> getIndicators()
getIndicators in interface IChartPanelDataType getDataType()
getFeedDescriptor()PriceRange getPriceRange()
getFeedDescriptor()ReversalAmount getReversalAmount()
getFeedDescriptor()Filter getFilter()
getFeedDescriptor()IFeedDescriptor getFeedDescriptor()
IFeedDescriptor
IFeedDescriptorvoid repaint()
IChartObjectFactory getChartObjectFactory()
IChartObjectFactory instance. This factory provides convenience methods to create
various graphics objects.
IChartObjectFactory instance.@Deprecated void addToMainChart(IChartObject object)
IChartPanel.add(IChartObject) method
IChartObject super type to main chart window.
Please note that only one instance of object can be added per main chart window.
object - - instance of IChartObject super type.
java.lang.IllegalArgumentException - - if object is already present on any of main charts.
@Deprecated
void addToSubChart(java.lang.Integer subChartId,
int indicatorId,
IChartObject object)
getIndicatorPanels() and IIndicatorPanel.add(IChartObject) methods
IChartObject super type to sub chart window with specified subChartId and indicatorId.
Please note that only one instance of object can be added per sub chart window.
subChartId - - sub chart id.indicatorId - - indicator function id.object - - instance of IChartObject super type.
java.lang.IllegalArgumentException - - if object is already present on any of sub charts.@Deprecated void addToMainChartUnlocked(IChartObject object)
addToMainChart(IChartObject) There is no objects division onto locked and unlocked anymore
IChartObject super type to unlocked objects pool of main chart window.
Please note that only one instance of object can be added to unlocked objects pool per main chart window.
object - - instance of IChartObject super type.
java.lang.IllegalArgumentException - - if object is already present on any of main charts unlocked objects pool.@Deprecated java.lang.Boolean isChartObjectUnlocked(IChartObject chartObject)
chartObject is unlocked or not. Returns null if chart does not contain specified chartObject
chartObject -
true - chartObject is unlocked, false - if not, null - chartObject does not belong to this chart.TickBarSize getTickBarSize()
getFeedDescriptor()java.util.List<IChartObject> getStrategyChartObjects()
java.awt.image.BufferedImage getImage()
BufferedImage snapshot of this chart at the given moment.
BufferedImage snapshot of current chart at the method invocation moment.void setDataPresentationType(DataType.DataPresentationType presentationType)
getDataType().getSupportedPresentationTypes() to get all allowed values.
Use getDataType().isPresentationTypeSupported(DataPresentationType presentationType)
to check whether current DataType supports presentationType or not.
presentationType - one of DataPresentationType constants, supported by current DataType
java.lang.IllegalArgumentException - if DataPresentationType is not supported by current DataTypegetDataType()DataType.DataPresentationType getDataPresentationType()
DataType.DataPresentationType.
Depends on current DataType value
getDataType()void selectDrawing(java.lang.String key)
key - IChartObject.isLocked(),
IChartObject.setLocked(boolean)void selectDrawing(IChartObject chartObject)
chartObject - IChartObject.isLocked(),
IChartObject.setLocked(boolean)void navigateAndSelectDrawing(java.lang.String key)
key - IChartObject.isLocked(),
IChartObject.setLocked(boolean)void navigateAndSelectDrawing(IChartObject chartObject)
chartObject - IChartObject.isLocked(),
IChartObject.setLocked(boolean)java.util.List<IIndicatorPanel> getIndicatorPanels()
@Deprecated void addSubIndicator(IIndicator indicator)
IChartPanel.add(IIndicator)
indicator -
@Deprecated
void addSubIndicatorByPanelIndex(java.lang.Integer subPanelIndex,
IIndicator indicator)
getIndicatorPanels() and IChartPanel.add(IIndicator) methods
subPanelIndex - indicator -
java.lang.IllegalStateException - in case of incorrect subPanelIndex or indicator is not designed for sub panel.
@Deprecated
void addToSubChart(int subPanelIndex,
IChartObject chartObject)
getIndicatorPanels() and IIndicatorPanel.add(IChartObject) methods
IChartObject type to sub chart panel with specified index.
Please note that only one instance of object can be added on chart.
subPanelIndex - chartObject -
java.lang.IllegalArgumentException - in case of incorrect indexITimedData[] getLastRequestedData()
Object type depends on getDataType()
java.util.Map<IIndicator,java.lang.Object[]> getLastCalculatedIndicatorOutputs()
Object in Object[] stands for an output array of an indicator.
In each output array that is represented by an Object (of Object[]),
the 0th element stands for the first visible data feed object on the chart,
and the last element - for the data feed object element on the chart.
long getMinTime()
long getMaxTime()
DataType
other than DataType.TICKS or DataType.TIME_PERIOD_AGGREGATION,
the maximal time value is the one of the last feed data element.