Class Figure
java.lang.Object
com.motivewave.platform.sdk.draw.Figure
- Direct Known Subclasses:
Box,ColorRange,Line,Polygon,ResizePoint,SinglePointFigure,VolumeProfileStudy.LoadingLabel,VolumeProfileStudy.VPSummary
Base Class for all figures that can be added to a study.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(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.voiddraw(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.booleanbooleanisVisible(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.voidlayout(DrawContext ctx) This method is called to translate any real values in the figure to the graph (represented by the DrawContext).protected voidsetBounds(Rectangle2D bounds) Sets the bounds for this figure.voidsetPopupMessage(String msg) Sets the message to display when the mouse cursor is over this figure.voidsetUnderlay(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
-
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
-