com.ptc.windchill.upgrade.tool
Class UpgradeManager

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended bycom.ptc.windchill.upgrade.tool.UpgradeManager
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants, WTAttributeNameIfc

public class UpgradeManager
extends JFrame
implements WTAttributeNameIfc

See Also:
Serialized Form

Nested Class Summary
private  class UpgradeManager.ExitListener
           
private  class UpgradeManager.GuiUpdater
           
private  class UpgradeManager.PreventResizeToSmallerThanMinSize
           
private  class UpgradeManager.StateMachineStarter
           
 
Nested classes inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
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  JPanel buttonBar_
           
private  JButton cancelButton_
           
private static String className_
           
private static String COMPARE_SCHEMA_ONLY_OPTION_NAME
           
private static JButton continueButton_
           
private  JLabel currentStateDescLabel_
           
private static String DEBUG
           
(package private) static String ENABLE_PRE_CERTIFIED_UPGRADE_SUPPORT_PROPERTY
          Constant to control whether or not we support upgrade.
private static String EXPORT_DB_IUHISTORY_OPTION_NAME
           
private static String HELP
           
private static String IMPORT_DB_IUHISTORY_OPTION_NAME
           
private static boolean isCompareSchemaOnly_
           
private static String LIST_IUS_OPTION_NAME
           
private static String logFileName
           
private  String modeAndTitle_
           
private static String NEW_IU_OPTION_NAME
           
private static int propDumpIteration
           
private static String PROPERTIES_FILE_NAME
           
private static String RENDER_DEPS_OPTION_NAME
           
private  JButton restartButton_
           
private static boolean restarted_
           
private  PhaseTitleSideBanner sideBanner_
           
private  JComponent stateComponent_
           
private static StateMachine stateMachine_
           
private  JLabel statusLabel_
           
private  JButton stopButton_
           
private  UpgradeManager theApplication_
           
private static String TITLE_ICON
           
private static String TITLE_ICON_PATH
           
private  UpgradeContextListener upgListener_
           
private static JList upgradeToolPhaseJList_
           
private static String[] upgradeToolPhaseList_
           
private static String VERBOSE
           
 
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.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 wt.util.WTAttributeNameIfc
CREATE_STAMP_NAME, ID_NAME, LATEST_ITERATION, LINK_REFA, LINK_REFB, MODIFY_STAMP_NAME, OBJECT_IDENTIFIER, OID_CLASSNAME, PERSIST_INFO, REF_CLASSNAME, REF_OBJECT_ID, REF_SUFFIX, ROLE_AOBJECT_ROLE, ROLE_BOBJECT_ROLE, ROLEA_CLASSNAME, ROLEA_OBJECT_ID, ROLEA_VERSION_ID, ROLEB_CLASSNAME, ROLEB_OBJECT_ID, ROLEB_VERSION_ID, UPDATE_COUNT_NAME, UPDATE_STAMP_NAME
 
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
UpgradeManager()
          Creates a new UpgradeManager object.
 
Method Summary
 void addUpgradeContextListener(UpgradeContextListener new_listener)
          Adding the UpgradeContextListener to the UpgradeManager, to be used with changing the icons before, during, and after each step.
private  void checkThatUpgradeIsSupported()
           
private  void clearContents()
          Clears the existing component inside that section to be replaced by a new one.
 void clearStatus()
          Clears out the value in the status label
private  JPanel createButtonBar()
           
private  ArrayList createStepList()
          Creates the list to be seen on the left-hand side list
private static void displayUsage()
          Message displayed to the screen when typing UpgradeManager -h or an incorrect argument is added to the end of the command.
private  void doEnablings()
           
static void dumpProps(String extension)
           
private static void exportDataBaseIUhistoryOption(Object opt_value)
           
private static String getLogFileName()
          Creates the log file for the Upgrade Manager called UpgradeManager.logs which is located under the Windchill/logs directory.
 int getMinimumHeight()
          User will not be able to reduce the height of the UpgradeManager below 440.
 int getMinimumWidth()
          User will not be able to reduce the height of the UpgradeManager below 600.
private static File getPropertiesFile()
           
 PhaseTitleSideBanner getSideBanner()
          A getter method of the left hand side list
private static WTProperties getWtProperties()
           
private static void importDataBaseIUhistoryOption(Object opt_value)
           
protected  void init(String[] args)
          Initializes all the necessary areas of the Upgrade Manager.
private  void initControls()
          Adding the UpgradeContextListener to the UpgradeManager, to be used with changing the icons for each step.
private  void initGuiListeners()
           
private  void initOtherListeners()
           
private  void initStateMachine()
          Initializes the correct StateMachine and intializes debugging if the correct argument was provided.
private  boolean isCompareSchemaOnly()
           
private  void layoutControls()
           
private static void listIUsOption()
           
private  void loadPreferences()
           
static void main(String[] args)
          Initializes the start of the Upgrade Manager
private static void newIUOption()
           
private static boolean remainingArgsLookLikeInvalidOptions(String[] unprocessed_args)
           
private static void renderDepsOption(Object opt_value, String[] unprocessed_args)
           
private  void savePreferences()
           
private  void setContents(String title, JComponent new_component, boolean to_scroll)
          Sets the component for the new step.
private  void setContentsAndRefresh(String title, JComponent new_component, boolean enclose)
           
private  void setIsCompareSchemaOnly(boolean is_cs_only)
           
 void setSideBanner()
          Creates the list of steps to be completed
 void setStatus(String status_message)
          Displays the message in the statusLabel_.
private  void showUnexpectedErrorMessage(Throwable throwable)
           
 
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, 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, 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, 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

NEW_IU_OPTION_NAME

private static final String NEW_IU_OPTION_NAME
See Also:
Constant Field Values

LIST_IUS_OPTION_NAME

private static final String LIST_IUS_OPTION_NAME
See Also:
Constant Field Values

RENDER_DEPS_OPTION_NAME

private static final String RENDER_DEPS_OPTION_NAME
See Also:
Constant Field Values

EXPORT_DB_IUHISTORY_OPTION_NAME

private static final String EXPORT_DB_IUHISTORY_OPTION_NAME
See Also:
Constant Field Values

COMPARE_SCHEMA_ONLY_OPTION_NAME

private static final String COMPARE_SCHEMA_ONLY_OPTION_NAME
See Also:
Constant Field Values

IMPORT_DB_IUHISTORY_OPTION_NAME

private static final String IMPORT_DB_IUHISTORY_OPTION_NAME
See Also:
Constant Field Values

PROPERTIES_FILE_NAME

private static final String PROPERTIES_FILE_NAME
See Also:
Constant Field Values

DEBUG

private static final String DEBUG
See Also:
Constant Field Values

HELP

private static final String HELP
See Also:
Constant Field Values

VERBOSE

private static final String VERBOSE
See Also:
Constant Field Values

TITLE_ICON_PATH

private static final String TITLE_ICON_PATH
See Also:
Constant Field Values

TITLE_ICON

private static final String TITLE_ICON
See Also:
Constant Field Values

stateMachine_

private static StateMachine stateMachine_

restarted_

private static boolean restarted_

currentStateDescLabel_

private JLabel currentStateDescLabel_

continueButton_

private static JButton continueButton_

restartButton_

private JButton restartButton_

cancelButton_

private JButton cancelButton_

stopButton_

private JButton stopButton_

buttonBar_

private JPanel buttonBar_

sideBanner_

private PhaseTitleSideBanner sideBanner_

upgListener_

private UpgradeContextListener upgListener_

isCompareSchemaOnly_

private static boolean isCompareSchemaOnly_

modeAndTitle_

private String modeAndTitle_

className_

private static String className_

logFileName

private static String logFileName

upgradeToolPhaseList_

private static String[] upgradeToolPhaseList_

upgradeToolPhaseJList_

private static JList upgradeToolPhaseJList_

statusLabel_

private JLabel statusLabel_

stateComponent_

private JComponent stateComponent_

ENABLE_PRE_CERTIFIED_UPGRADE_SUPPORT_PROPERTY

static final String ENABLE_PRE_CERTIFIED_UPGRADE_SUPPORT_PROPERTY
Constant to control whether or not we support upgrade.

See Also:
Constant Field Values

theApplication_

private UpgradeManager theApplication_

propDumpIteration

private static int propDumpIteration
Constructor Detail

UpgradeManager

public UpgradeManager()
Creates a new UpgradeManager object.

Method Detail

setIsCompareSchemaOnly

private void setIsCompareSchemaOnly(boolean is_cs_only)

isCompareSchemaOnly

private boolean isCompareSchemaOnly()

init

protected void init(String[] args)
             throws UpgradeContextException
Initializes all the necessary areas of the Upgrade Manager.

Parameters:
args - The arguments that are passed in when starting the UpgradeManager
Throws:
UpgradeContextException - initStateMachine is called

initStateMachine

private void initStateMachine()
Initializes the correct StateMachine and intializes debugging if the correct argument was provided.


addUpgradeContextListener

public void addUpgradeContextListener(UpgradeContextListener new_listener)
Adding the UpgradeContextListener to the UpgradeManager, to be used with changing the icons before, during, and after each step.

Parameters:
new_listener - An instance of PhaseTitleSideBanner that implements UpgradeContextListener

initControls

private void initControls()
                   throws UpgradeContextException
Adding the UpgradeContextListener to the UpgradeManager, to be used with changing the icons for each step.

Throws:
UpgradeContextException

layoutControls

private void layoutControls()

setContents

private void setContents(String title,
                         JComponent new_component,
                         boolean to_scroll)
Sets the component for the new step. The subclasses of AbstractState can over-write the method shouldBeEnclosed() to inform the UpgradeManager if the screen should be enclosed in a scroll pane or not If to_scroll is true the new_component will be placed within an scroll pane. If it is false it will just be a stateComponent_.

Parameters:
title - String
new_component - JComponent
to_scroll - boolean
Throws:
RuntimeException - When a state occurs that it does not know how to handle

setContentsAndRefresh

private void setContentsAndRefresh(String title,
                                   JComponent new_component,
                                   boolean enclose)

clearContents

private void clearContents()
Clears the existing component inside that section to be replaced by a new one.


initGuiListeners

private void initGuiListeners()

initOtherListeners

private void initOtherListeners()
                         throws UpgradeContextException
Throws:
UpgradeContextException

createButtonBar

private JPanel createButtonBar()

doEnablings

private void doEnablings()

showUnexpectedErrorMessage

private void showUnexpectedErrorMessage(Throwable throwable)

getMinimumWidth

public int getMinimumWidth()
User will not be able to reduce the height of the UpgradeManager below 600.

Returns:
int

getMinimumHeight

public int getMinimumHeight()
User will not be able to reduce the height of the UpgradeManager below 440.

Returns:
int

main

public static void main(String[] args)
Initializes the start of the Upgrade Manager

Parameters:
args - arguments passed in when UpgradeManager is started

newIUOption

private static void newIUOption()

listIUsOption

private static void listIUsOption()

renderDepsOption

private static void renderDepsOption(Object opt_value,
                                     String[] unprocessed_args)

importDataBaseIUhistoryOption

private static void importDataBaseIUhistoryOption(Object opt_value)

exportDataBaseIUhistoryOption

private static void exportDataBaseIUhistoryOption(Object opt_value)

checkThatUpgradeIsSupported

private void checkThatUpgradeIsSupported()
                                  throws IOException
Throws:
IOException

remainingArgsLookLikeInvalidOptions

private static boolean remainingArgsLookLikeInvalidOptions(String[] unprocessed_args)

getWtProperties

private static WTProperties getWtProperties()
                                     throws IOException
Throws:
IOException

getLogFileName

private static String getLogFileName()
                              throws IOException
Creates the log file for the Upgrade Manager called UpgradeManager.logs which is located under the Windchill/logs directory.

Throws:
IOException

displayUsage

private static void displayUsage()
Message displayed to the screen when typing UpgradeManager -h or an incorrect argument is added to the end of the command.


setStatus

public void setStatus(String status_message)
Displays the message in the statusLabel_. Need the SwingUtilities.invokeLater in both setStatus methods It just works better. More likelihood of the messages showing up.


createStepList

private ArrayList createStepList()
Creates the list to be seen on the left-hand side list


setSideBanner

public void setSideBanner()
                   throws UpgradeContextException
Creates the list of steps to be completed

Throws:
UpgradeContextException - thrown if an UpgradeContext instance does not already exist

getSideBanner

public PhaseTitleSideBanner getSideBanner()
A getter method of the left hand side list

Returns:
sideBanner_ PhaseTitleSideBanner

clearStatus

public void clearStatus()
Clears out the value in the status label


loadPreferences

private void loadPreferences()

savePreferences

private void savePreferences()

getPropertiesFile

private static File getPropertiesFile()

dumpProps

public static void dumpProps(String extension)