|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
com.tivoli.uif.controls.UFFrame
com.tivoli.twg.console.TWGTaskFrame
This is the base class for all Director Top-level task frames. This abstract class provides the base implementation for several of the the necessary interfaces for activating and deactivating a task frame. In Director, executing tasks can have several pieces, including a server side piece, a client side piece and a console piece. Task frames are used to implement the console side piece. The property file for a task includes a tag that indicates the task is interactive. The "GUI" tag will include the name of the class to load for the console piece. The TWGTaskFrame provides a base implementation of this interface to make it easier to interact with the engine.
When a task is launched that contains an interactive portion, Director will load the class specified by the "GUI" attribute of the task's property file on a separate thread. This class is loaded as a bean, which means that it runs the class' default constructor (meaning you must have a default constructor defined in the derived class). When a TWGTaskFrame derived class is created, it will set default color information up for the frame and will automatically add a status panel at the bottom of the frame if requested.
After the constructor has completed, Director will then call the setTaskActivator method, passing in the TWGTaskActivator that corresponds to this task. This method internally calls the pInit method to allow the derived class to initialize itself after the task frame has been initialized. A derived class overrides this method and returns true if initialization is successful.
Finally, Director will call the consoleStart method to build the rest of the GUI, position the frame and show it. This method internally calls the buildView method, which derived classes override and provide their client GUI code. The top-level container for the client area is returned from this method and is added to the frame. A help context is also automatically created if a help topics mapping attribute was specified in the tasks property file. The setInitialFocusedComponent method may be used to have TWGTaskFrame set the initial focus on a particular component when the window is shown.
TWGTaskFrame will automatically cache away the size and position of the task frame so that the next time the frame is brought up it is restored to its previous location and dimension. This is either cached away as a serialized preference object, or it can be saved away using the TWGTaskFrameGUIAttributes class which reduces the size of the data cached.
When the task frame is closed (via the consoleCancel method), the verifyOnClose method is called to allow derived classes the opportunity to prompt the user to save data that may not yet be saved. If the close will proceed, then the pCleanUp method is called to allow derived classes to clean up anything they may have setup during initialization or execution of the task.
Nested Class Summary |
---|
Nested classes inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
ATTR_GROUP
|
java.awt.Font |
boldFont
|
static int |
INITIAL_HEIGHT
|
static int |
INITIAL_WIDTH
|
protected AnimationPanel |
ivAnimationPanel
|
protected java.awt.Point |
ivLastLoc
|
protected java.awt.Dimension |
ivLastSize
|
protected TWGStatusField |
ivStatusMsg
|
protected TWGStatusPanel |
ivStatusPanel
|
static java.lang.String |
LAST_LOC
|
static java.lang.String |
LAST_SIZE
|
static int |
MAIN_CONSOLE_SHUTDOWN
|
static java.lang.String |
PREF_GROUP
|
static int |
SERVER_REQUESTED_CLOSE
|
static int |
USER_REQUESTED_CLOSE
Parameters passed on consoleCancel() requests. |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.tivoli.uif.core.BeanContextChild |
---|
COPYRIGHT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TWGTaskFrame()
This is the default constructor for the task frame. |
|
TWGTaskFrame(boolean createStatusPanel)
Use this constructor to create a task frame that will automatically contain a status panel and a status indicator. |
Method Summary | |
---|---|
void |
addCloseHandler(javax.swing.JComponent obj)
Attach an ALT-F4 key handler to close the frame to the object |
java.awt.Container |
buildView()
Create the client pane and return it. |
void |
childStateChanged(com.tivoli.uif.core.ChildStateEvent cse)
Implements BeanContextChild Interface |
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
Implements Component Listener for caching movement of the window. |
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
void |
consoleCancel()
Default method called internally whenever the user closes the task frame by pressing the close button or closing from a menu option. |
void |
consoleCancel(int cancelType)
Called by the console when this instance of the task frame is being cancelled. |
void |
consoleStart()
Start the console and display the frame (if okay to start). |
void |
doSetStatusText(java.lang.String text)
Use this method to specify the text that should appear in the status field message area of the status panel. |
com.tivoli.uif.core.BeanContext |
getBeanContext()
Returns the BeanContext in which the Bean is operating. |
java.awt.Dimension |
getFrameSize()
Returns the default frame size that is used when the frame is initially created. |
TWGHelpContext |
getHelpContext()
Returns the help instance created during initialization. |
com.tivoli.uif.core.UFPrefGroup |
getPreferenceGroup()
Returns the name of the preference group for the task to allow derived classes to store their own preferences as well. |
java.lang.String |
getPreferenceKey()
Sets up and returns the name of the unique key that preferences will be stored (and retrieved) by at the server level for this task frame. |
AnimationPanel |
getStatusIndicator()
Use this method to get the status indicator the frame uses (if any). |
UFStatusPanel |
getStatusPanel()
Deprecated. - This method will be removed in framework5. It has been replaced by getTaskStatusPanel(). |
java.lang.String |
getStatusText()
Use this method to retrieve the current text that appears in the status field message area of the status panel. |
TWGTaskActivator |
getTaskActivator()
Retrieve the task activation object for this task frame. |
com.tivoli.twg.console.TWGTaskFrameGUIAttributes |
getTaskFrameGUIAttributes()
Retrieve the current task frame gui attributes block for this task frame. |
ServiceNode |
getTaskFrameServiceNode()
Get reference to the task frame's ServiceNode for sending commands. |
TWGStatusPanel |
getTaskStatusPanel()
Use this method to return the instance of the status panel for the task frame. |
void |
launchTask(TWGSubtask subTask,
LongValueSet moset,
LongValueSet foset,
java.lang.Object data)
Launch the subtask passed, with the target parameters provided. |
com.tivoli.twg.console.TWGTaskFrameGUIAttributes |
loadTaskFrameGUIAttributes()
Load the attributes cached away. |
void |
pCleanUp()
Clean up routine to allow derived task frame classes to clean up after themselves. |
boolean |
pInit()
Initialization routine for setting up non-gui items. |
void |
positionAndShow()
Routine which sizes, locates, and shows the frame. |
void |
removeCloseHandler(javax.swing.JComponent obj)
Detach the ALT-F4 key handler from the object |
void |
removeStatusField()
Use this method to remove the default status field message area of the status panel. |
void |
replaceStatusPanel(TWGStatusPanel statusPanel)
Use this method to set the status panel the task frame displays to the bottom of the content pane. |
void |
saveTaskFrameGUIAttributes(com.tivoli.twg.console.TWGTaskFrameGUIAttributes tfga)
Cache away the task frame gui attributes. |
void |
serverTaskEnded(int endingType)
Called by the console when the server task activation for this instance of the task frame has ended. |
void |
setInitialFocusedComponent(java.awt.Component comp)
Set the component that will initially receive the focus. |
void |
setStatusIndicator(AnimationPanel animationPanel)
Use this method to set the status indicator the frame uses. |
void |
setStatusPanel(boolean useStatusPanel)
Use this method to add/remove the status panel on the bottom of the content pane. |
void |
setStatusText(java.lang.String text)
Use this method to specify the text that should appear in the status field message area of the status panel. |
void |
setTaskActivator(TWGTaskActivator activator)
Context parameters are passed to this tasks frame, based on how this frame was invoked. |
void |
setToTaskFrameGUIAttributes(boolean setForTFGA)
Changes the task frame so that it uses the task frame gui attributes class for caching information away instead of the user preference groups that was used previously. |
void |
startStatusIndicator()
Use this method to start animating the frames contained in the task frames TWGStatusIndicator class. |
void |
stopStatusIndicator()
Use this method to stop animating the frames contained in the task frames TWGStatusIndicator class. |
void |
update()
Routine which adds the client panel to the frame, adds any close handlers to it and shows the frame. |
boolean |
verifyOnClose(int cancelType)
Routine to allow derived task frames to prompt the user if they should close or not. |
void |
windowAttributesChanged(com.tivoli.twg.guilibs.WindowAttributeEvent windowAttributeEvent)
This function is called when the window attributes for the application have changed. |
void |
windowClosing(java.awt.event.WindowEvent evt)
Implements WindowListener Interface support so we can catch dialog kills. |
Methods inherited from class com.tivoli.uif.controls.UFFrame |
---|
center, center, dispose, dragBegin, dragCancel, dragEnd, dragOver, focusGained, focusLost, getParentWindow, getTopLevelParent, ignoreSetCursor, isBusy, locateDropTarget, locateOnScreen, makeManaged, makeUnmanaged, registerDropTarget, setBusy, setIconImage, show, unregisterDropTarget, updateComponentPaneUI, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
public static final int USER_REQUESTED_CLOSE
public static final int SERVER_REQUESTED_CLOSE
public static final int MAIN_CONSOLE_SHUTDOWN
public static final java.lang.String PREF_GROUP
public static final java.lang.String ATTR_GROUP
public static final java.lang.String LAST_LOC
public static final java.lang.String LAST_SIZE
public static final int INITIAL_WIDTH
public static final int INITIAL_HEIGHT
public java.awt.Font boldFont
protected java.awt.Dimension ivLastSize
protected java.awt.Point ivLastLoc
protected TWGStatusPanel ivStatusPanel
protected TWGStatusField ivStatusMsg
protected AnimationPanel ivAnimationPanel
Constructor Detail |
public TWGTaskFrame()
public TWGTaskFrame(boolean createStatusPanel)
createStatusPanel
- - If true, the task frame is automatically
created with a status panel. The status panel will by default contain
a status indicator as its left most child. Otherwise, the task frame
will not have a status panel.Method Detail |
public void setStatusPanel(boolean useStatusPanel)
useStatusPanel
- - If true, a status panel will be added
below the content pane. Otherwise any
existing panel will be removed.public void replaceStatusPanel(TWGStatusPanel statusPanel)
statusPanel
- - The new status panel to display below the
content pane.public UFStatusPanel getStatusPanel()
public TWGStatusPanel getTaskStatusPanel()
public void setStatusIndicator(AnimationPanel animationPanel)
animationPanel
- - The animation panel to be placed at the
leftmost position of the status panel and
will be accessed by the convenience methods
provided. If null, then remove any existing
animation panel.public AnimationPanel getStatusIndicator()
public void startStatusIndicator()
public void stopStatusIndicator()
public void setStatusText(java.lang.String text)
text
- The message string to display in the status field.public void doSetStatusText(java.lang.String text)
text
- The message string to display in the status field.public java.lang.String getStatusText()
public void removeStatusField()
public final ServiceNode getTaskFrameServiceNode() throws ServiceNodeException
ServiceNodeException
- if unable to open ServiceNodepublic boolean pInit()
public void pCleanUp()
public boolean verifyOnClose(int cancelType)
public void setTaskActivator(TWGTaskActivator activator)
setTaskActivator
in interface TWGTaskFrameImplementor
activator
- The TWGTaskActivator object that corresponds to this
task request.public TWGTaskActivator getTaskActivator()
getTaskActivator
in interface TWGTaskFrameImplementor
public void serverTaskEnded(int endingType)
serverTaskEnded
in interface TWGTaskFrameImplementor
endingType
- This indicates why the server task ended (i.e. completed
successfully, error occurred, etc.public void consoleCancel(int cancelType)
consoleCancel
in interface TWGTaskFrameImplementor
cancelType
- This indicates which type of cancellation is occurring.public void consoleCancel()
public void consoleStart()
consoleStart
in interface TWGTaskFrameImplementor
public void windowAttributesChanged(com.tivoli.twg.guilibs.WindowAttributeEvent windowAttributeEvent)
windowAttributesChanged
in interface com.tivoli.twg.guilibs.WindowAttributeListener
windowAttributeEvent
- The attribute event sent that contains the
latest attribute information to be processed.
NOTE: Derived classes need to call this superclass version to get
the status panel to update its colors correctly.public java.awt.Dimension getFrameSize()
public java.awt.Container buildView()
public void setInitialFocusedComponent(java.awt.Component comp)
comp
- - the Component which should initially receive the focus.public void windowClosing(java.awt.event.WindowEvent evt)
windowClosing
in interface java.awt.event.WindowListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void launchTask(TWGSubtask subTask, LongValueSet moset, LongValueSet foset, java.lang.Object data)
public void update()
public void positionAndShow()
public void childStateChanged(com.tivoli.uif.core.ChildStateEvent cse) throws com.tivoli.uif.core.ChildVetoException
childStateChanged
in interface com.tivoli.uif.core.ChildStateListener
com.tivoli.uif.core.ChildVetoException
public com.tivoli.uif.core.BeanContext getBeanContext()
getBeanContext
in interface com.tivoli.uif.core.BeanContextChild
public TWGHelpContext getHelpContext()
public void setToTaskFrameGUIAttributes(boolean setForTFGA)
public com.tivoli.twg.console.TWGTaskFrameGUIAttributes loadTaskFrameGUIAttributes()
public com.tivoli.twg.console.TWGTaskFrameGUIAttributes getTaskFrameGUIAttributes()
public void saveTaskFrameGUIAttributes(com.tivoli.twg.console.TWGTaskFrameGUIAttributes tfga)
public com.tivoli.uif.core.UFPrefGroup getPreferenceGroup()
public java.lang.String getPreferenceKey()
public void addCloseHandler(javax.swing.JComponent obj)
public void removeCloseHandler(javax.swing.JComponent obj)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |