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 DecimalFormat
protected DecimalFormat
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateStringBuilder
Creates the default builder for cartesian coordiantes.static CoordinateStringBuilder
Creates the default builder for polar coordinates.static CoordinateStringBuilder
createPolar
(String rLabel, String phiLabel, double phiOffset) Creates the default builder for polar coordinates.abstract String
getCoordinateString
(DrawingPanel panel, MouseEvent e) Converts a the pixel coordinates in a mouse event into world coordinates and return these coordinates in a string.void
setCoordinateLabels
(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
-