Package com.motivewave.platform.sdk.draw
Class SinglePointFigure
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
com.motivewave.platform.sdk.draw.SinglePointFigure
Instances of this class represent objects that are anchored by a single point.
These object may either be positioned absolutely (by a specific time and value) or
relative to a price bar (top or bottom). When positioned relatively other figures
that are at the same location will be stacked vertically.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double x, double y, DrawContext ctx) This method is called by the study framework to determine if the figure contains the x and y coordinates.Gets the location where this figure will be drawn on the graph.Gets the location of this marker.int
Gets the offset in pixels to display the figure from the location.Gets the relative position of the figure to its location.Sets the policy for stacking figures that share the same coordinates (above or below).long
getTime()
Gets the time location (x coordinate).double
getValue()
Gets the real value location (y coordinate).boolean
isVisible
(DrawContext ctx) This method is called by the study framework and is used to improve the performance of the study by only working figures that are currently visible.void
setGraphLocation
(Point2D location) Sets the location where this figure will be drawn on the graph.void
setLocation
(long time, double value) Sets the absolute location of this figure.void
setLocation
(Coordinate coord) Sets the location of the marker.void
setOffsetPixels
(int pixels) Sets the offset in pixels to display the figure from the location.void
setPosition
(Enums.Position position) Sets the relative position of the marker to its location.void
setStackPolicy
(Enums.StackPolicy stackPolicy) Sets the policy for stacking figures that share the same coordinates (above or below).Methods inherited from class com.motivewave.platform.sdk.draw.Figure
draw, getBounds, getPopupMessage, isUnderlay, layout, setBounds, setPopupMessage, setUnderlay
-
Constructor Details
-
SinglePointFigure
public SinglePointFigure()
-
-
Method Details
-
contains
This method is called by the study framework to determine if the figure contains the x and y coordinates. This implementation considers the use of the relative location to determine if the figure contains x and y. -
isVisible
This method is called by the study framework and is used to improve the performance of the study by only working figures that are currently visible. -
getLocation
Gets the location of this marker.- Returns:
- the location of this marker.
-
setLocation
Sets the location of the marker.- Parameters:
coord
- coordinate for the location of the marker
-
setLocation
public void setLocation(long time, double value) Sets the absolute location of this figure.- Parameters:
time
- time value (in milliseconds)value
- y axis value
-
getTime
public long getTime()Gets the time location (x coordinate).- Returns:
- time x coordinate in milliseconds since 1970
-
getValue
public double getValue()Gets the real value location (y coordinate).- Returns:
- real value (y coordinate)
-
getPosition
Gets the relative position of the figure to its location.- Returns:
- the relative position of the figure to its location
-
setPosition
Sets the relative position of the marker to its location.- Parameters:
position
- position of the marker
-
setStackPolicy
Sets the policy for stacking figures that share the same coordinates (above or below).- Parameters:
stackPolicy
-
-
getStackPolicy
Sets the policy for stacking figures that share the same coordinates (above or below).- Returns:
- the policy for stacking figures that share the same coordinates.
-
setGraphLocation
Sets the location where this figure will be drawn on the graph. This location will be the translated version of the real location (Coordinate) unless the figure is stacked (see stack policy). This is called by the study framework.- Parameters:
location
-
-
getGraphLocation
Gets the location where this figure will be drawn on the graph. This location will be the translated version of the real location (Coordinate) unless the figure is stacked (see stack policy).- Returns:
- graph location of this figure
-
setOffsetPixels
public void setOffsetPixels(int pixels) Sets the offset in pixels to display the figure from the location. The direction of this offset will depend on the position.- Parameters:
pixels
- offset in pixels
-
getOffsetPixels
public int getOffsetPixels()Gets the offset in pixels to display the figure from the location. The direction of this offset will depend on the position.- Returns:
- offset in pixels
-