jET
1.0beta1


org.jet.tracks
Class LeftSwitchButtonModel

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

public class LeftSwitchButtonModel
extends PaletteButtonModel

Model for right switch palette button.

Indexes are in range from 0 to count-1.


Field Summary
 
Fields inherited from class org.jet.PaletteButtonModel
listenerList
 
Constructor Summary
LeftSwitchButtonModel(double l, double r, java.lang.String s)
          Creates button model for left switch.
 
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

LeftSwitchButtonModel

public LeftSwitchButtonModel(double l,
                             double r,
                             java.lang.String s)
Creates button model for left switch.

Parameters:
l - Length of the switch.
r - Radius of the switch.
s - Skos of switch
Method Detail

getHandlerCount

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

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

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