jET
1.0beta1


org.jet
Class PaletteButtonModel

java.lang.Object
  |
  +--org.jet.PaletteButtonModel
Direct Known Subclasses:
ArcTrackButtonModel, FlexTrackButtonModel, LeftSwitchButtonModel, RightSwitchButtonModel, StraightTrackButtonModel

public abstract class PaletteButtonModel
extends java.lang.Object

Model for palette buttons.


Field Summary
protected  javax.swing.event.EventListenerList listenerList
          Listeners registered with this object.
 
Constructor Summary
PaletteButtonModel()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Registers change listener with this object.
 void clearSelection()
          Clears selection.
protected  void fireStateChanged()
          Fires change event to all registered change listeners.
abstract  int getHandlerCount()
          Gets handlers count in this model.
abstract  javax.swing.Icon getIcon()
          Gets an icon of this model.
 int getSelectedHandler()
          Get index of selected handler.
abstract  java.lang.String getToolTipText()
          Gets tool tip text.
abstract  java.awt.Point handlerToPoint(int i)
          Returns point of handler with specified index.
 boolean isSelectionEmpty()
          Returns true if selection is empty.
abstract  int pointToHandler(java.awt.Point p)
          Returns index of handler with specified point.
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          Unregisters change listener.
 void setSelectedHandler(int i)
          Sets selected handler by its index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
Listeners registered with this object.

Constructor Detail

PaletteButtonModel

public PaletteButtonModel()
Method Detail

getHandlerCount

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


handlerToPoint

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

Parameters:
i - Index of the handler.
Returns:
Point in icon coordinates.

pointToHandler

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

Parameters:
p - Point in icon coordiantes.
Returns:
Index of handler or -1 when ther is no handler.

getIcon

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


getToolTipText

public abstract java.lang.String getToolTipText()
Gets tool tip text.


setSelectedHandler

public void setSelectedHandler(int i)
Sets selected handler by its index.


getSelectedHandler

public int getSelectedHandler()
Get index of selected handler.


clearSelection

public void clearSelection()
Clears selection.


isSelectionEmpty

public boolean isSelectionEmpty()
Returns true if selection is empty.


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)
Registers change listener with this object. Listener will be notified each time when selection state changes.


removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)
Unregisters change listener.


fireStateChanged

protected void fireStateChanged()
Fires change event to all registered change listeners.


jET
1.0beta1