JHotDraw 7.0.9

org.jhotdraw.application.action
Class AbstractApplicationAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jhotdraw.application.action.AbstractApplicationAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
AboutAction, AbstractDocumentViewAction, ArrangeAction, ClearRecentFilesAction, CopyAction, CutAction, DeleteAction, DuplicateAction, ExitAction, FocusAction, NewAction, OpenAction, OpenRecentAction, OSXDropOnDockAction, PasteAction, SelectAllAction

public abstract class AbstractApplicationAction
extends javax.swing.AbstractAction

An Action that acts on an DocumentOrientedApplication object. If the DocumentOrientedApplication object is disabled, the AbstractApplicationAction is disabled as well.

Version:
1.0 June 15, 2006 Created.
Author:
Werner Randelshofer.
See Also:
DocumentOrientedApplication, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractApplicationAction()
          Creates a new instance.
 
Method Summary
 DocumentOrientedApplication getApplication()
           
 ResourceMap getFrameworkResourceMap()
           
 ResourceMap getResourceMap()
           
 void initActionProperties(ResourceMap resourceMap, java.lang.String baseName)
           
 void initActionProperties(java.lang.String baseName)
           
protected  void installApplicationListeners(DocumentOrientedApplication application)
          Installs listeners on the application object.
 boolean isEnabled()
          Returns true if the action is enabled.
 void setEnabled(boolean newValue)
          Enables or disables the action.
protected  void uninstallApplicationListeners(DocumentOrientedApplication application)
          Installs listeners on the application object.
protected  void updateApplicationEnabled()
          Updates the enabled state of this action depending on the new enabled state of the application.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Constructor Detail

AbstractApplicationAction

public AbstractApplicationAction()
Creates a new instance.

Method Detail

installApplicationListeners

protected void installApplicationListeners(DocumentOrientedApplication application)
Installs listeners on the application object.


uninstallApplicationListeners

protected void uninstallApplicationListeners(DocumentOrientedApplication application)
Installs listeners on the application object.


getApplication

public DocumentOrientedApplication getApplication()

getResourceMap

public ResourceMap getResourceMap()

updateApplicationEnabled

protected void updateApplicationEnabled()
Updates the enabled state of this action depending on the new enabled state of the application.


isEnabled

public boolean isEnabled()
Returns true if the action is enabled. The enabled state of the action depends on the state that has been set using setEnabled() and on the enabled state of the application.

Specified by:
isEnabled in interface javax.swing.Action
Overrides:
isEnabled in class javax.swing.AbstractAction
Returns:
true if the action is enabled, false otherwise
See Also:
Action.isEnabled()

setEnabled

public void setEnabled(boolean newValue)
Enables or disables the action. The enabled state of the action depends on the value that is set here and on the enabled state of the application.

Specified by:
setEnabled in interface javax.swing.Action
Overrides:
setEnabled in class javax.swing.AbstractAction
Parameters:
newValue - true to enable the action, false to disable it
See Also:
Action.setEnabled(boolean)

initActionProperties

public void initActionProperties(java.lang.String baseName)

initActionProperties

public void initActionProperties(ResourceMap resourceMap,
                                 java.lang.String baseName)

getFrameworkResourceMap

public ResourceMap getFrameworkResourceMap()

Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.