http://www.jpicedt.org

jpicedt.graphic.toolkit
Class PEToggleAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by jpicedt.graphic.toolkit.PEAbstractAction<Element>
          extended by jpicedt.graphic.toolkit.PEAction
              extended by jpicedt.graphic.toolkit.PEToggleAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
EditorKit.ActivateSnapAction, EditorKit.ShowGridAction

public abstract class PEToggleAction
extends PEAction

A subclass of PEAction suited for toggle-able AbstractButton's, e.g. JToggleButton, JCheckBox, JCheckBoxMenuItem and JRadioButton.
The main point is that PEMenu and PEToolBar know how to add a PEToggleAction and to create the adequate widget (either JCheckBoxMenuItem or JToggleButton).
Concrete implementation of the actionPerformed should use ((AbstractButton)e.getSource()).isSelected() to fetch the current widget state.

Since:
jPicEdt
Author:
Sylvain Reynal
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jpicedt.graphic.toolkit.PEAbstractAction
targetElement
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
PEToggleAction(ActionDispatcher actionDispatcher, String actionName, ActionLocalizer localizer)
           
 
Method Summary
 
Methods inherited from class jpicedt.graphic.toolkit.PEAction
getIterator, setAttribute
 
Methods inherited from class jpicedt.graphic.toolkit.PEAbstractAction
actionPerformed, getCanvas, getDrawing, getEditorKit, getSelectedObject, setSelectedObject, undoableActionPerformed
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PEToggleAction

public PEToggleAction(ActionDispatcher actionDispatcher,
                      String actionName,
                      ActionLocalizer localizer)
Parameters:
actionDispatcher - the ActionDispatcher that provide a target when this Action gets invoked.
actionName - the actionName of this Action that serve to build this Action's properties
localizer - (can be null) the ActionLocalizer that feeds this Action with localized properties ; if null, the Action's NAME property is set to actionName, but other properties are not set (this allow a subclass to set properties manually).
Since:
jPicEdt 1.3.2

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org