Class CoordinateStringBuilder
java.lang.Object
org.opensourcephysics.display.axes.CoordinateStringBuilder
- Direct Known Subclasses:
CartesianCoordinateStringBuilder,PolarCoordinateStringBuilder,TCoordinateStringBuilder
Builds a coordinate string from a mouse event for an axis type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DecimalFormatprotected DecimalFormatprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateStringBuilderCreates the default builder for cartesian coordiantes.static CoordinateStringBuilderCreates the default builder for polar coordinates.static CoordinateStringBuildercreatePolar(String rLabel, String phiLabel, double phiOffset) Creates the default builder for polar coordinates.abstract StringgetCoordinateString(DrawingPanel panel, MouseEvent e) Converts a the pixel coordinates in a mouse event into world coordinates and return these coordinates in a string.voidsetCoordinateLabels(String xLabel, String yLabel)
-
Field Details
-
scientificFormat
-
decimalFormat
-
xLabel
-
yLabel
-
-
Constructor Details
-
CoordinateStringBuilder
public CoordinateStringBuilder()
-
-
Method Details
-
setCoordinateLabels
-
getCoordinateString
Converts a the pixel coordinates in a mouse event into world coordinates and return these coordinates in a string.- Parameters:
e- the mouse event- Returns:
- the coordinate string
-
createCartesian
Creates the default builder for cartesian coordiantes.- Returns:
- CoordinateStringBuilder
-
createPolar
Creates the default builder for polar coordinates.- Returns:
- CoordinateStringBuilder
-
createPolar
Creates the default builder for polar coordinates.- Parameters:
rLabel- StringphiLabel- StringphiOffset- double- Returns:
- CoordinateStringBuilder
-