org.opensourcephysics.display.axes
Class CartesianCoordinateStringBuilder

java.lang.Object
  extended by org.opensourcephysics.display.axes.CoordinateStringBuilder
      extended by org.opensourcephysics.display.axes.CartesianCoordinateStringBuilder
Direct Known Subclasses:
VidCartesianCoordinateStringBuilder

public class CartesianCoordinateStringBuilder
extends CoordinateStringBuilder

Builds a coordinate string from a mouse event for an axis type.


Field Summary
protected  java.text.DecimalFormat decimalFormat
           
protected  java.text.DecimalFormat scientificFormat
           
protected  java.lang.String xLabel
           
protected  java.lang.String yLabel
           
 
Constructor Summary
CartesianCoordinateStringBuilder()
           
CartesianCoordinateStringBuilder(java.lang.String xLabel, java.lang.String yLabel)
           
 
Method Summary
 java.lang.String getCoordinateString(DrawingPanel panel, java.awt.event.MouseEvent e)
          Converts a the pixel coordinates in a mouse event into world coordinates and return these coordinates in a string.
 void setCoordinateLabels(java.lang.String xLabel, java.lang.String yLabel)
           
 
Methods inherited from class org.opensourcephysics.display.axes.CoordinateStringBuilder
createCartesian, createPolar, createPolar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scientificFormat

protected java.text.DecimalFormat scientificFormat

decimalFormat

protected java.text.DecimalFormat decimalFormat

xLabel

protected java.lang.String xLabel

yLabel

protected java.lang.String yLabel
Constructor Detail

CartesianCoordinateStringBuilder

public CartesianCoordinateStringBuilder()

CartesianCoordinateStringBuilder

public CartesianCoordinateStringBuilder(java.lang.String xLabel,
                                        java.lang.String yLabel)
Method Detail

setCoordinateLabels

public void setCoordinateLabels(java.lang.String xLabel,
                                java.lang.String yLabel)
Overrides:
setCoordinateLabels in class CoordinateStringBuilder

getCoordinateString

public java.lang.String getCoordinateString(DrawingPanel panel,
                                            java.awt.event.MouseEvent e)
Converts a the pixel coordinates in a mouse event into world coordinates and return these coordinates in a string.

Specified by:
getCoordinateString in class CoordinateStringBuilder
Parameters:
e - the mouse event
Returns:
the coordinate string