Package com.motivewave.platform.sdk.draw
Class Figure
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
- Direct Known Subclasses:
Box
,ColorRange
,Line
,Polygon
,ResizePoint
,SinglePointFigure
Base Class for all figures that can be added to a study.
-
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.void
draw
(Graphics2D gc, DrawContext ctx) This method draws the figure on the graph (using the given Graphics2D).Gets the bounds of this figure.getPopupMessage
(double x, double y, DrawContext ctx) Gets the popup message for the given (x,y) coordinate.boolean
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
layout
(DrawContext ctx) This method is called to translate any real values in the figure to the graph (represented by the DrawContext).protected void
setBounds
(Rectangle2D bounds) Sets the bounds for this figure.void
setPopupMessage
(String msg) Sets the message to display when the mouse cursor is over this figure.void
setUnderlay
(boolean b) Sets the underlay property.
-
Constructor Details
-
Figure
public Figure()
-
-
Method Details
-
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.- Returns:
- true if this figure is visible within the given DrawContext.
-
contains
This method is called by the study framework to determine if the figure contains the x and y coordinates.- Returns:
- true if this figure contains the (x,y) coordinates.
-
getPopupMessage
Gets the popup message for the given (x,y) coordinate. By default, this will return the message that is set by calling the setPopupMessage(msg) method. Override to return different messages using the x,y coordinate.- Parameters:
x
- x coordinatey
- y coordinatectx
- Draw Context- Returns:
- popup message to display for the given (x,y) coordinate
-
setPopupMessage
Sets the message to display when the mouse cursor is over this figure.- Parameters:
msg
- message to display when the mouse cursor is over this figure
-
layout
This method is called to translate any real values in the figure to the graph (represented by the DrawContext).- Parameters:
ctx
- draw context
-
draw
This method draws the figure on the graph (using the given Graphics2D). This method is called by the study framework to display the figure on the graph.- Parameters:
gc
- graphics contextctx
- draw context
-
getBounds
Gets the bounds of this figure.- Returns:
- the bounds of this figure
-
setBounds
Sets the bounds for this figure.- Parameters:
bounds
- bounds of this figure
-
isUnderlay
public boolean isUnderlay()- Returns:
- true if this figure should be drawn below paths, shaded, guides etc.
-
setUnderlay
public void setUnderlay(boolean b) Sets the underlay property. If true the figure will be drawn below the paths, shades guides etc.- Parameters:
b
- true to draw below paths
-