edu.sc.seis.gee.task
Class TaskAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byedu.sc.seis.gee.task.TaskAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, DefaultParamNames, java.util.EventListener, java.io.Serializable

public class TaskAction
extends javax.swing.AbstractAction
implements DefaultParamNames

TaskAction.java Created: Thu Nov 29 22:47:44 2001

Version:
$Id: TaskAction.java 15750 2006-01-11 21:19:30Z fenner $
Author:
Philip Crotwell
See Also:
Serialized Form

Field Summary
static boolean CHILDREN_GET_MENUBAR
           
static java.awt.Dimension MIN_SIZE
           
protected  boolean toolBarHandlerAdded
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface edu.sc.seis.gee.configurator.DefaultParamNames
BUTTON_GROUP_ID, BUTTON_MODEL, DISPLAY_LOCATION, EAST, FALSE, FRAME, HEIGHT, HEIGHTPER, HORIZONTAL, JUSTIFY, JUSTIFY_BOTTOMLEFT, JUSTIFY_BOTTOMRIGHT, JUSTIFY_CENTER, JUSTIFY_TOPLEFT, JUSTIFY_TOPRIGHT, MAIN, NONE, NORTH, ORIENTATION, PALETTE, PREFIX, PRESELECTED, SERVER_DNS, SERVER_NAME, TASK_ACTION, TASK_CLASSNAME, TASK_ID, TASK_INSTANCE, TASK_NAME, TOOLTIP, TRUE, VERTICAL, WIDTH, WIDTHPER
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
TaskAction(java.lang.String id, java.lang.String classname, java.lang.String name, java.util.HashMap configParam, ToolBarHandler tbh, boolean toggle)
           
TaskAction(java.lang.String id, java.lang.String classname, java.lang.String name, java.util.HashMap configParam, ToolBarHandler tbh, boolean toggle, java.lang.String iconName)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent act)
           
 void addToToolBar(javax.swing.Action act)
           
 void addToToolBar(javax.swing.JComponent comp)
           
 void addToToolBar(javax.swing.JToolBar jtb, javax.swing.Action act)
           
 void addToToolBar(javax.swing.JToolBar jtb, javax.swing.JComponent comp)
           
 void checkDisplayLocation()
          Calls check display location with a default setSize and tabbed value of false
 void checkDisplayLocation(boolean tabbed)
          This method takes the config paramater DISPLAY_LOCATION and if the task is a GUITask or is a Component it puts it in that DISPLAY_LOCATION and initializes its graphical elements
 javax.swing.JToolBar copyToolBar()
          creates a copy of the toolbar, fir cases where a task has multiple windows and needs for each window to have its own toolbar.
 void destroyJFrame()
           
 java.lang.Object getConfigParam(java.lang.String key)
           
 java.util.HashMap getConfigParams()
           
 javax.swing.Icon getIcon()
           
 java.lang.String getIconLoc()
           
 java.lang.String getId()
           
 javax.swing.JFrame getJFrame()
          returns the JFrame for this task, or null if there is not a frame.
 javax.swing.JPanel getJPanel()
           
 java.lang.String getName()
           
 StatusIndicator getStatusIndicator()
           
 Task getTask()
           
 javax.swing.JToolBar getToolBar()
          Gets the main tool bar for this task.
 ToolBarHandler getToolBarHandler()
           
 void invoke(boolean tabbed)
           
 void invoke(boolean tabbed, boolean bringToFront)
           
 boolean isToggle()
           
 void putConfigParam(java.lang.String key, java.lang.Object value)
           
 void reset()
          resets this taskaction and its task to a pre invoked state and destroys the JFrame associated with it
 void reset(boolean destroyFrame)
          resets this TaskAction and its task to a pre invoked state
 void reset(boolean destroyFrame, boolean nullifyTask)
          resets this TaskAction and its task to a pre invoked state
 
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
 

Field Detail

toolBarHandlerAdded

protected boolean toolBarHandlerAdded

CHILDREN_GET_MENUBAR

public static boolean CHILDREN_GET_MENUBAR

MIN_SIZE

public static final java.awt.Dimension MIN_SIZE
Constructor Detail

TaskAction

public TaskAction(java.lang.String id,
                  java.lang.String classname,
                  java.lang.String name,
                  java.util.HashMap configParam,
                  ToolBarHandler tbh,
                  boolean toggle,
                  java.lang.String iconName)

TaskAction

public TaskAction(java.lang.String id,
                  java.lang.String classname,
                  java.lang.String name,
                  java.util.HashMap configParam,
                  ToolBarHandler tbh,
                  boolean toggle)
Method Detail

getId

public java.lang.String getId()

getName

public java.lang.String getName()

isToggle

public boolean isToggle()

getIcon

public javax.swing.Icon getIcon()

getIconLoc

public java.lang.String getIconLoc()

getToolBarHandler

public ToolBarHandler getToolBarHandler()

getToolBar

public javax.swing.JToolBar getToolBar()
Gets the main tool bar for this task. There may be other copies of the toolbar for use in child windows, but this is the original.


copyToolBar

public javax.swing.JToolBar copyToolBar()
                                 throws ConfigurationException
creates a copy of the toolbar, fir cases where a task has multiple windows and needs for each window to have its own toolbar.

Throws:
ConfigurationException

getJFrame

public javax.swing.JFrame getJFrame()
returns the JFrame for this task, or null if there is not a frame.


destroyJFrame

public void destroyJFrame()

getJPanel

public javax.swing.JPanel getJPanel()

checkDisplayLocation

public void checkDisplayLocation()
                          throws ConfigurationException
Calls check display location with a default setSize and tabbed value of false

Throws:
ConfigurationException

checkDisplayLocation

public void checkDisplayLocation(boolean tabbed)
                          throws ConfigurationException
This method takes the config paramater DISPLAY_LOCATION and if the task is a GUITask or is a Component it puts it in that DISPLAY_LOCATION and initializes its graphical elements

Throws:
ConfigurationException

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent act)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

invoke

public void invoke(boolean tabbed)

invoke

public void invoke(boolean tabbed,
                   boolean bringToFront)

addToToolBar

public void addToToolBar(javax.swing.JComponent comp)

addToToolBar

public void addToToolBar(javax.swing.JToolBar jtb,
                         javax.swing.JComponent comp)

addToToolBar

public void addToToolBar(javax.swing.Action act)

addToToolBar

public void addToToolBar(javax.swing.JToolBar jtb,
                         javax.swing.Action act)

getStatusIndicator

public StatusIndicator getStatusIndicator()

getTask

public Task getTask()
             throws ConfigurationException
Throws:
ConfigurationException

getConfigParam

public java.lang.Object getConfigParam(java.lang.String key)

putConfigParam

public void putConfigParam(java.lang.String key,
                           java.lang.Object value)

getConfigParams

public java.util.HashMap getConfigParams()

reset

public void reset()
resets this taskaction and its task to a pre invoked state and destroys the JFrame associated with it


reset

public void reset(boolean destroyFrame)
resets this TaskAction and its task to a pre invoked state

Parameters:
destroyFrame - - if true, the frame associated with this taskAction is destroyed else it is only set to null in this TaskAction

reset

public void reset(boolean destroyFrame,
                  boolean nullifyTask)
resets this TaskAction and its task to a pre invoked state

Parameters:
destroyFrame - - if true, the frame associated with this taskAction is destroyed else it is only set to null in this TaskAction.
nullifyTask - sets the task object reference to null so that it will be recreated from scratch on next invocation.


Copyright © 2002-2006 Seismology at the University of South Carolina. All Rights Reserved.