jET
1.0beta1


org.jet.tracks
Class ArcTrackButtonModel

java.lang.Object
  |
  +--org.jet.PaletteButtonModel
        |
        +--org.jet.tracks.ArcTrackButtonModel

public class ArcTrackButtonModel
extends PaletteButtonModel

Model for arc track button.

Indexes are in range from 0 to count-1.


Field Summary
 
Fields inherited from class org.jet.PaletteButtonModel
listenerList
 
Constructor Summary
ArcTrackButtonModel(double l, double r)
          Constructs new model for arc track.
 
Method Summary
 int getHandlerCount()
          Gets handlers count in this model.
 javax.swing.Icon getIcon()
          Gets an icon of this model.
 java.lang.String getToolTipText()
          Gets tooltip text.
 java.awt.Point handlerToPoint(int i)
          Returns point of handler with specified index.
 int pointToHandler(java.awt.Point p)
          Returns index of handler with specified point.
 
Methods inherited from class org.jet.PaletteButtonModel
addChangeListener, clearSelection, fireStateChanged, getSelectedHandler, isSelectionEmpty, removeChangeListener, setSelectedHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcTrackButtonModel

public ArcTrackButtonModel(double l,
                           double r)
Constructs new model for arc track.

Parameters:
l - Length of the track in meters.
r - Radius of the track in meters.
Method Detail

getHandlerCount

public int getHandlerCount()
Gets handlers count in this model.

Specified by:
getHandlerCount in class PaletteButtonModel
Returns:
Always returns 2.

handlerToPoint

public java.awt.Point handlerToPoint(int i)
Returns point of handler with specified index. Returned point is in the icon coordinates.

Specified by:
handlerToPoint in class PaletteButtonModel
Parameters:
i - Index of the handler.
Returns:
Point in icon coordinates.

pointToHandler

public int pointToHandler(java.awt.Point p)
Returns index of handler with specified point. If there is no handler at this point, it returns -1.

Specified by:
pointToHandler in class PaletteButtonModel
Parameters:
p - Point in icon coordiantes.
Returns:
Index of handler or -1 when ther is no handler.

getIcon

public javax.swing.Icon getIcon()
Gets an icon of this model.

Specified by:
getIcon in class PaletteButtonModel

getToolTipText

public java.lang.String getToolTipText()
Gets tooltip text.

Specified by:
getToolTipText in class PaletteButtonModel

jET
1.0beta1