wt.clients.scheduler
Class GenericSchedTimeFrame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended bywt.clients.scheduler.GenericSchedTimeFrame
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class GenericSchedTimeFrame
extends Frame

See Also:
Serialized Form

Nested Class Summary
private  class GenericSchedTimeFrame.RememberMe
          Remember the state of all the widgets at startup.
private  class GenericSchedTimeFrame.SpinnerStates
           
(package private)  class GenericSchedTimeFrame.SymAction
           
(package private)  class GenericSchedTimeFrame.SymItem
           
(package private)  class GenericSchedTimeFrame.SymKey
           
(package private)  class GenericSchedTimeFrame.SymWindow
           
 
Nested classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  String _argClass
           
private  int _argCount
           
private  Class[] _args
           
private  boolean _bCreate
           
private  boolean _bFirstRunDone
           
private  boolean _bFromApp
           
private  boolean _bImmediate
           
private  boolean _bPeriodic
           
private  boolean _bUpdate
           
private  boolean _bView
           
private  ThreadGroup _contextGroup
           
(package private)  ResourceBundle _custRB
           
private  boolean _dateUpdateFlag
           
(package private)  HelpContext _helpContext
           
(package private)  HelpSystem _helpSystem
           
private  boolean _localObj
           
private  Vector _objList
           
private  Hashtable _objTable
           
private  String _oldDates
           
private  Timestamp _oldNextTime
           
private  long _origFreq
           
(package private)  ResourceBundle _rb
           
private  GenericSchedTimeFrame.RememberMe _recorder
           
private  SchedInfo _schedInfo
           
private  GenericSchedTimeFrame.SpinnerStates _spinRecord
           
(package private)  Button cancelButt
           
(package private)  Button clearButt
           
static int CREATE_MODE
           
(package private)  Label dateLab
           
(package private)  Label dayLab
           
(package private)  LongSpinner daySpin
           
(package private)  Label everyLab
           
(package private)  boolean fComponentsAdjusted
           
private  String format
           
(package private)  symantec.itools.awt.BorderPanel freqPanel
           
(package private)  CheckboxGroup Group1
           
(package private)  CheckboxGroup Group2
           
(package private)  Button helpButt
           
(package private)  Label hourLab
           
(package private)  LongSpinner hourSpin
           
(package private)  Checkbox immedButt
           
private  boolean isPDMLinkInstalled
          booleans to store the status of installed components
private  boolean isProjectLinkInstalled
           
(package private)  Label minLab
           
(package private)  LongSpinner minSpin
           
(package private)  Choice objectChoice
           
private  TextField objectField
           
(package private)  Label objNameLab
           
(package private)  Button okButt
           
(package private)  Checkbox onceButt
           
(package private)  Checkbox onTimeButt
           
(package private)  Panel panel1
           
(package private)  Panel panel2
           
(package private)  Checkbox periodButt
           
private static String RESOURCE
           
(package private)  Label startLab
           
(package private)  TextField startTimeField
           
(package private)  symantec.itools.awt.StatusBar statusBar1
           
(package private)  symantec.itools.awt.BorderPanel timeBorderPanel
           
static int UPDATE_MODE
           
static int VIEW_MODE
           
 
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.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
  GenericSchedTimeFrame()
           
  GenericSchedTimeFrame(int mode, SchedInfo info, String timeFormat)
           
  GenericSchedTimeFrame(int mode, SchedInfo info, WTObject theObj)
           
private GenericSchedTimeFrame(String title)
           
 
Method Summary
 void addNotify()
           
(package private)  void applyButt_ActionPerformed(ActionEvent event)
          Creates a new schedule item in case it was not an update.
private  boolean argIsWTObject()
           
(package private)  void cancelButt_ActionPerformed(ActionEvent event)
           
private  boolean checkForArgs()
           
(package private)  void clearButt_ActionPerformed(ActionEvent event)
           
private  long computePeriodicity()
           
private  Timestamp computeStartDate()
           
private  void computeUpdateWidgets()
           
private  void computeViewWidgets()
           
private  void createScheduleItem()
          Create the new schedule item.
(package private)  void daySpin_actionPerformed(ActionEvent event)
           
private  void enableWidgets()
           
private  void fillObjectChoice()
           
(package private)  void GenericSchedTimeFrame_WindowClosing(WindowEvent event)
           
private  WTContext getContext()
          Returns the appropriate WTContext which corresponds to this frame.
 HelpContext getHelpContext()
          Gets the HelpContext instance associated with this screen., This method is public by Windchill convention
 HelpSystem getHelpSystem()
          Gets the HelpSystem instance associated with this screen.
(package private)  void helpButt_ActionPerformed(ActionEvent event)
           
(package private)  void helpButt_MouseReleased(MouseEvent event)
           
private  boolean IHaveRun(Timestamp startDate)
           
(package private)  void immedButt_ItemStateChanged(ItemEvent event)
           
private  void initHelpSystem()
          Initializes the help system.
private  void initializeHelp()
          This function should be the last thing called in the ctor.
private  boolean isArgWTObject()
           
private  void localize()
           
private  void localizeCustomerData()
           
static void main(String[] args)
           
private  PropertyChangeListener newHelpListener()
          newHelpListener This function adds a listener to respond to the component mouse over events.
(package private)  void okButt_ActionPerformed(ActionEvent event)
          Create a new ScheduleItem based on the information from the screen and the mode we are in.
(package private)  void onceButt_ItemStateChanged(ItemEvent event)
           
(package private)  void onTimeButt_ItemStateChanged(ItemEvent event)
           
(package private)  void periodButt_ItemStateChanged(ItemEvent event)
           
private  void setArgField()
           
private  void setContext(boolean contextOn)
           
private  void setDateFields(Timestamp date)
           
private  void setDateInfo(ScheduleItem theItem)
           
private  void setDefaultStartDate()
           
private  void setEnabledFlag()
          A schedule Item is enabled when the runcount is equal to its toberun flag.
private  void setPeriodicityWidgets(long period)
           
private  void setupCreateMode()
           
private  void setupUpdateMode()
           
private  void setupViewMode()
           
 void setVisible(boolean b)
          Shows or hides the component depending on the boolean flag b.
private  void stopHelp()
          stopHelp should be called every time the window gets closed.
private  void toggleAllSpinners(boolean mode)
           
private  void updateDateWidgets()
           
private  void updateScheduleItem()
          Update a schedule item.
private  void verifySpinners()
           
 
Methods inherited from class java.awt.Frame
finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, 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, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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

VIEW_MODE

public static final int VIEW_MODE
See Also:
Constant Field Values

UPDATE_MODE

public static final int UPDATE_MODE
See Also:
Constant Field Values

CREATE_MODE

public static final int CREATE_MODE
See Also:
Constant Field Values

_bCreate

private boolean _bCreate

_bView

private boolean _bView

_bUpdate

private boolean _bUpdate

_bImmediate

private boolean _bImmediate

_bPeriodic

private boolean _bPeriodic

_bFirstRunDone

private boolean _bFirstRunDone

_dateUpdateFlag

private boolean _dateUpdateFlag

_bFromApp

private boolean _bFromApp

_contextGroup

private ThreadGroup _contextGroup

_schedInfo

private SchedInfo _schedInfo

objectField

private TextField objectField

_argClass

private String _argClass

_argCount

private int _argCount

_args

private Class[] _args

_custRB

ResourceBundle _custRB

_rb

ResourceBundle _rb

format

private String format

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

_objTable

private Hashtable _objTable

_objList

private Vector _objList

_oldDates

private String _oldDates

_oldNextTime

private Timestamp _oldNextTime

_helpSystem

HelpSystem _helpSystem

_helpContext

HelpContext _helpContext

_recorder

private GenericSchedTimeFrame.RememberMe _recorder

_origFreq

private long _origFreq

_spinRecord

private GenericSchedTimeFrame.SpinnerStates _spinRecord

_localObj

private boolean _localObj

isPDMLinkInstalled

private boolean isPDMLinkInstalled
booleans to store the status of installed components


isProjectLinkInstalled

private boolean isProjectLinkInstalled

fComponentsAdjusted

boolean fComponentsAdjusted

objNameLab

Label objNameLab

objectChoice

Choice objectChoice

statusBar1

symantec.itools.awt.StatusBar statusBar1

panel1

Panel panel1

okButt

Button okButt

clearButt

Button clearButt

cancelButt

Button cancelButt

helpButt

Button helpButt

panel2

Panel panel2

timeBorderPanel

symantec.itools.awt.BorderPanel timeBorderPanel

immedButt

Checkbox immedButt

Group2

CheckboxGroup Group2

onTimeButt

Checkbox onTimeButt

startLab

Label startLab

startTimeField

TextField startTimeField

dateLab

Label dateLab

freqPanel

symantec.itools.awt.BorderPanel freqPanel

onceButt

Checkbox onceButt

Group1

CheckboxGroup Group1

periodButt

Checkbox periodButt

everyLab

Label everyLab

dayLab

Label dayLab

hourLab

Label hourLab

minLab

Label minLab

daySpin

LongSpinner daySpin

hourSpin

LongSpinner hourSpin

minSpin

LongSpinner minSpin
Constructor Detail

GenericSchedTimeFrame

public GenericSchedTimeFrame()

GenericSchedTimeFrame

private GenericSchedTimeFrame(String title)

GenericSchedTimeFrame

public GenericSchedTimeFrame(int mode,
                             SchedInfo info,
                             WTObject theObj)

GenericSchedTimeFrame

public GenericSchedTimeFrame(int mode,
                             SchedInfo info,
                             String timeFormat)
Method Detail

IHaveRun

private boolean IHaveRun(Timestamp startDate)

setEnabledFlag

private void setEnabledFlag()
A schedule Item is enabled when the runcount is equal to its toberun flag.


localize

private void localize()

localizeCustomerData

private void localizeCustomerData()

setPeriodicityWidgets

private void setPeriodicityWidgets(long period)
                            throws PropertyVetoException
Throws:
PropertyVetoException

setupViewMode

private void setupViewMode()

computeViewWidgets

private void computeViewWidgets()

setDateInfo

private void setDateInfo(ScheduleItem theItem)

updateDateWidgets

private void updateDateWidgets()

setDateFields

private void setDateFields(Timestamp date)

checkForArgs

private boolean checkForArgs()

setupUpdateMode

private void setupUpdateMode()

computeUpdateWidgets

private void computeUpdateWidgets()

setArgField

private void setArgField()

setupCreateMode

private void setupCreateMode()

setDefaultStartDate

private void setDefaultStartDate()

fillObjectChoice

private void fillObjectChoice()

isArgWTObject

private boolean isArgWTObject()

enableWidgets

private void enableWidgets()

verifySpinners

private void verifySpinners()

setVisible

public void setVisible(boolean b)
Shows or hides the component depending on the boolean flag b.

Parameters:
b - if true, show the component; otherwise, hide the component.
See Also:
Component.isVisible()

main

public static void main(String[] args)

addNotify

public void addNotify()

GenericSchedTimeFrame_WindowClosing

void GenericSchedTimeFrame_WindowClosing(WindowEvent event)

cancelButt_ActionPerformed

void cancelButt_ActionPerformed(ActionEvent event)

getContext

private WTContext getContext()
Returns the appropriate WTContext which corresponds to this frame. This method first tries to retrieve the WTContext by using the ThreadGroup saved when this frame was constructed. If the ThreadGroup is null, this method uses the default getContext() method to retrieve a WTContext.

Returns:
the WTContext object associated with this frame
See Also:
WTContext

setContext

private void setContext(boolean contextOn)

initializeHelp

private void initializeHelp()
This function should be the last thing called in the ctor. It initializes the help system, and adds the components the help system will listen for mouse over events to.


getHelpContext

public HelpContext getHelpContext()
Gets the HelpContext instance associated with this screen., This method is public by Windchill convention


getHelpSystem

public HelpSystem getHelpSystem()
Gets the HelpSystem instance associated with this screen. Windchill convention says that this function should be public.


initHelpSystem

private void initHelpSystem()
Initializes the help system.


newHelpListener

private PropertyChangeListener newHelpListener()
newHelpListener This function adds a listener to respond to the component mouse over events. It updates the status bar everytime the mouse passes over one of the buttons.


stopHelp

private void stopHelp()
stopHelp should be called every time the window gets closed.


helpButt_MouseReleased

void helpButt_MouseReleased(MouseEvent event)

toggleAllSpinners

private void toggleAllSpinners(boolean mode)

onceButt_ItemStateChanged

void onceButt_ItemStateChanged(ItemEvent event)

clearButt_ActionPerformed

void clearButt_ActionPerformed(ActionEvent event)

applyButt_ActionPerformed

void applyButt_ActionPerformed(ActionEvent event)
Creates a new schedule item in case it was not an update. Once it has created one, only updates it, not changing the screen, keeping this new/updated item information.


okButt_ActionPerformed

void okButt_ActionPerformed(ActionEvent event)
Create a new ScheduleItem based on the information from the screen and the mode we are in. (Create and Update are the two modes which we are interested in.)


updateScheduleItem

private void updateScheduleItem()
                         throws WTException,
                                ParseException
Update a schedule item.

Returns:
void
Throws:
WTException
ParseException

createScheduleItem

private void createScheduleItem()
                         throws WTException,
                                WTPropertyVetoException,
                                IllegalAccessException,
                                InstantiationException,
                                ParseException
Create the new schedule item.

Returns:
void
Throws:
WTException, - WTPropertyVetoException
WTException
WTPropertyVetoException
IllegalAccessException
InstantiationException
ParseException

computePeriodicity

private long computePeriodicity()

computeStartDate

private Timestamp computeStartDate()
                            throws ParseException,
                                   WTException
Throws:
ParseException
WTException

argIsWTObject

private boolean argIsWTObject()

periodButt_ItemStateChanged

void periodButt_ItemStateChanged(ItemEvent event)

onTimeButt_ItemStateChanged

void onTimeButt_ItemStateChanged(ItemEvent event)

immedButt_ItemStateChanged

void immedButt_ItemStateChanged(ItemEvent event)

helpButt_ActionPerformed

void helpButt_ActionPerformed(ActionEvent event)

daySpin_actionPerformed

void daySpin_actionPerformed(ActionEvent event)