org.opensourcephysics.display.axes
Class PolarCoordinateStringBuilder

java.lang.Object
  extended by org.opensourcephysics.display.axes.CoordinateStringBuilder
      extended by org.opensourcephysics.display.axes.PolarCoordinateStringBuilder

public class PolarCoordinateStringBuilder
extends CoordinateStringBuilder

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


Field Summary
protected  double cos
           
protected  java.lang.String phiLabel
           
protected  java.lang.String rLabel
           
protected  double sin
           
 
Fields inherited from class org.opensourcephysics.display.axes.CoordinateStringBuilder
decimalFormat, scientificFormat, xLabel, yLabel
 
Constructor Summary
PolarCoordinateStringBuilder()
          Constructor PolarCoordinateStringBuilder
PolarCoordinateStringBuilder(java.lang.String rLabel, java.lang.String phiLabel)
          Constructor PolarCoordinateStringBuilder
PolarCoordinateStringBuilder(java.lang.String rLabel, java.lang.String phiLabel, double phiZero)
          Constructor PolarCoordinateStringBuilder
 
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 rLabel, java.lang.String phiLabel)
           
 
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

rLabel

protected java.lang.String rLabel

phiLabel

protected java.lang.String phiLabel

sin

protected double sin

cos

protected double cos
Constructor Detail

PolarCoordinateStringBuilder

public PolarCoordinateStringBuilder()
Constructor PolarCoordinateStringBuilder


PolarCoordinateStringBuilder

public PolarCoordinateStringBuilder(java.lang.String rLabel,
                                    java.lang.String phiLabel,
                                    double phiZero)
Constructor PolarCoordinateStringBuilder

Parameters:
rLabel -
phiLabel -
phiZero -

PolarCoordinateStringBuilder

public PolarCoordinateStringBuilder(java.lang.String rLabel,
                                    java.lang.String phiLabel)
Constructor PolarCoordinateStringBuilder

Parameters:
rLabel -
phiLabel -
Method Detail

setCoordinateLabels

public void setCoordinateLabels(java.lang.String rLabel,
                                java.lang.String phiLabel)
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