jpicedt.graphic.toolkit
Class PEAction
java.lang.Object
javax.swing.AbstractAction
jpicedt.graphic.toolkit.PEAbstractAction<Element>
jpicedt.graphic.toolkit.PEAction
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
- Direct Known Subclasses:
- EditorKit.CopyAction, EditorKit.CutAction, EditorKit.DeleteAction, EditorKit.EditBoundingBoxAction, EditorKit.EditDispositionAction, EditorKit.EditGeometryAction, EditorKit.EditTextModeAction, EditorKit.GroupAction, EditorKit.JoinCurvesAction, EditorKit.PasteAction, EditorKit.SelectAllAction, EditorKit.SelectMouseToolAction, EditorKit.ToggleEditPointsModeAction, EditorKit.ZoomInAction, EditorKit.ZoomOutAction, JPicEdt.AboutAction, JPicEdt.ContentTypeAction, JPicEdt.ExitAction, JPicEdt.FileCloseAction, JPicEdt.FileNewAction, JPicEdt.FileOpenAction, JPicEdt.FileReloadAction, JPicEdt.FileSaveAction, JPicEdt.FileSaveAllAction, JPicEdt.FileSaveAsAction, JPicEdt.FragmentInsertAction, JPicEdt.FragmentSaveAction, JPicEdt.MemoryMonitorAction, JPicEdt.OpenBSHConsoleAction, JPicEdt.PageFormatAction, JPicEdt.PreferencesAction, JPicEdt.RedoAction, JPicEdt.RedrawAction, JPicEdt.RunExternalCommandAction, JPicEdt.ShowErrorLogAction, JPicEdt.ShowHelpAction, JPicEdt.ShowLicenseAction, JPicEdt.ToggleAttributesPanelAction, JPicEdt.ToggleConvexZonePanelAction, JPicEdt.ToggleToolkitPanelAction, JPicEdt.UndoAction, JPicEdt.ViewLaTeXFileAction, JPicEdt.WindowCascadeAction, JPicEdt.WindowTileHorAction, JPicEdt.WindowTileVertAction, PEScrollPane.CenterViewportAction, PEToggleAction
public abstract class PEAction
- extends PEAbstractAction<Element>
An abstract subclass of Swing's AbstractAction that can (but may as well not)
be shared across multiple PECanvas.
This implementation uses the same set of properties as AbstractAction.
The constructor gives a convenient way of automatically building localized properties
associated with this PEAction from a simple String (the "actionName" parameter), using a
user-provided ActionLocalizer.
Note : if an ActionLocalizer is provided to the constructor, and some of its methods return null values,
the corresponding properties are set to null. However, all jPicEdt components (e.g. PEMenu, PEToolBar,...),
like Swing components, are guaranteed to handle this case properly w/o throwing an exception.
For instance, simply setting the NAME property to null and filling the SMALL_ICON property
create a JButton without text under the component's Icon (this is the standard Swing behaviour).
Example of use : [todo]
- Since:
- jPicEdt 1.3.2
- Version:
- $Id: PEAction.java,v 1.14 2013/03/27 06:57:01 vincentb1 Exp $
- Author:
- Sylvain Reynal
- See Also:
- Serialized Form
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 |
PEAction
public PEAction(ActionDispatcher actionDispatcher,
String actionName,
ActionLocalizer localizer)
getIterator
protected Iterator<Element> getIterator()
- Specified by:
getIterator
in class PEAbstractAction<Element>
setAttribute
protected final <T> void setAttribute(PicAttributeName<T> name,
T value)
- Applies the given attribute to the drawing content. If there is a selection, the attribute
is applied to each element in the selection. If there is no selection, the attribute
is applied to the input attribute set of the EditorKit (this specifies the attributes
to be used for any new Element that gets added to the underlying Drawing).
If there's a selected element, we add an UndoableEdit (hence PEAction that explicitly call
setAttribute() must not override undoableActionPerformed
, but simply actionPerformed
).
Submit a bug : syd@jpicedt.org