org.bibalex.daf.managers.admin
Class PhasesManagerGUI

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.bibalex.daf.managers.BaseManagerGUI
                      extended by org.bibalex.daf.managers.admin.PhasesManagerGUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PhasesManagerGUI
extends BaseManagerGUI

This class manages operations over Phases like add, remove, update sequence,...

Author:
Mohammed.Abuouda
See Also:
Serialized Form

Nested Class Summary
private static class PhasesManagerGUI.UIStates
          UIStates is enum indicates to the state of the selected row (Add for new , Edit for update)
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JButton addPhaseButton
          addPhaseButton is the button to add phase from avilable phases list to assigned phases list
private  javax.swing.JList assignedPhasesList
          assignedPhasesList holds assigned Phases List for the selected job type
private  javax.swing.JScrollPane AssignedPhasesScrollPane
          AssignedPhasesScrollPane is the container of Assigned Phases List
private  javax.swing.JLabel assignedSequenceLabel
           
private  javax.swing.JLabel availablePhasesLabel
           
private  javax.swing.JList availablePhasesList
          availablePhasesList holds available Phases List for the selected job type
private  javax.swing.JScrollPane AvailablePhasesScrollPane
          AvailablePhasesScrollPane is the container of Available Phases List
private  javax.swing.JButton createNewPhaseButton
          createNewPhaseButton is the button to craete new phase
private  javax.swing.JLabel daysLabel
           
private  javax.swing.JButton deletePhaseButton
          deletePhaseButton is the button to delete phase
private  javax.swing.JPanel detailsPanel
          detailsPanel is the panel that carry the derived components which are relevant to the selected Phase from the availablePhaseList
private  javax.swing.JButton downPhaseButton
          downPhaseButton is the button to move the phase downward
private  javax.swing.JButton editReasonsButton
          editReasons open edit reason dialog
private  javax.swing.JComboBox jobTypesComboBox
          jobTypesComboBox holds system job types
private  javax.swing.JLabel jobTypesLabel
           
private  javax.swing.JPanel jobTypesPanel
          jobTypesPanel is the panel that carry job types combo box ,available phases list and sequence phases list
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master and details panels
private  int lastSelectedPhaseIndex
          lastSelectedPhaseIndex used to indicate to the last selected row of available Phases
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are Phases Lists,delete Phase Button and create New Phase Button
private  javax.swing.JLabel maximumPeriodLabel
           
private  javax.swing.JTextField maximumPeriodTextField
          maximumPeriodTextField is showing selected Phase max period
private  javax.swing.JLabel phaseNameLabel
           
private  javax.swing.JTextField phaseNameTextField
          phaseNameTextField is showing selected Phase name
private  boolean recordModified
          recordModified used to check if there are updates or modifications applied but not saved yet to the selected phase
private  javax.swing.JButton removePhaseButton
          removePhaseButton is the button to remove phase from assigned phases list to avilable phases list
private  javax.swing.JButton saveButton
          saveButton is the button to save the changes of phase these changes could be updates or even new data
private  PhasesManagerGUI.UIStates uiState
           
private  javax.swing.JButton updateSequenceButton
          updateSequenceButton is the button to update the job type phases sequence
private  java.awt.event.KeyAdapter updatesKeyAdapter
          key listener handles the events of change the text of text fields, chnage the selected index of combo boxes and check boxes.
private  javax.swing.JButton upPhaseButton
          upPhaseButton is the button to move the phase upward
private  javax.swing.JLabel xmlDescriptionLabel
           
private  javax.swing.JScrollPane XMLDescriptionScrollPane
          XMLDescriptionScrollPane is the container of XMLDescription text area
private  javax.swing.JTextArea xmlDescriptionTextArea
          xmlDescriptionTextArea is showing selected Phase xml description
 
Fields inherited from class org.bibalex.daf.managers.BaseManagerGUI
currentInstance, resourceManager
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
PhasesManagerGUI()
          This is the default constructor
 
Method Summary
private  void adjustDetailsPanel()
          Extract the data of the selected phase and fill up the correspondence fileds
private  void clearDetailsPanel()
          Reset GUI controls
private  void clearFields()
          Reset GUI controls
private  boolean confirmDiscardChanges()
          Confirm discard User changes message
private  javax.swing.JButton getAddPhaseButton()
          This method initializes addPhaseButton which moves selected phases from available phases list to assigned phases list
 javax.swing.JScrollPane getAssignedPhasesScrollPane()
          This method initializes AssignedPhasesScrollPane
private  javax.swing.JList getAssignedSequenceList()
          This method initializes assignedSequenceList
private  javax.swing.JList getAvailablePhasesList()
          This method initializes availablePhasesList
 javax.swing.JScrollPane getAvailablePhasesScrollPane()
          This method initializes AvailablePhasesScrollPane
private  javax.swing.JButton getCreateNewPhaseButton()
          This method initializes createNewPhaseButton
private  javax.swing.JButton getDeletePhaseButton()
          This method initializes deletePhaseButton
private  javax.swing.JPanel getDetailsPanel()
          This method initializes detailsPanel
private  javax.swing.JButton getDownPhaseButton()
          This method initializes downPhaseButton which change the order of assigned phases list by moving the phase downward
private  javax.swing.JButton getEditReasons()
          This method initializes jButton
private  javax.swing.JComboBox getJobTypesComboBox()
          This method initializes jobTypesComboBox
private  javax.swing.JPanel getJobTypesPanel()
          This method initializes jobTypesPanel
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JTextField getMaximumPeriodTextField()
          This method initializes maximumPeriodTextField
private  javax.swing.JTextField getPhaseNameTextField()
          This method initializes phaseNameTextField
private  javax.swing.JButton getRemovePhaseButton()
          This method initializes removePhaseButton which moves selected phases from assigned phases list to available phases list
private  javax.swing.JButton getSaveButton()
          This method initializes saveButton
private  javax.swing.JButton getUpdateSequenceButton()
          This method initializes updateSequenceButton which update the sequence of phases assigned to selected job type
private  javax.swing.JButton getUpPhaseButton()
          This method initializes upPhaseButton which change the order of assigned phases list by moving the phase upward
 javax.swing.JScrollPane getXMLDescriptionScrollPane()
          This method initializes XMLDescriptionScrollPane
private  javax.swing.JTextArea getXmlDescriptionTextArea()
          This method initializes xmlDescriptionTextArea
private  void initialize()
          This method initializes layout
private  void loadAssignedPhasesList()
          This method loads assignedPhasesList
private  void loadAvailablePhasesList()
          This method loads availablePhasesList
 void reloadManager()
          Reset controls when Phase tab change
private  void setCreateMode()
          Clear the GUI and set mode to Add
private  void setEditMode()
          Set GUI mode to Edit
private  void showMsg(java.lang.String msg)
          Show message box
private  boolean validateValues()
          Validate filed values
 
Methods inherited from class org.bibalex.daf.managers.BaseManagerGUI
setFocus, updateTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jPanel

private javax.swing.JPanel jPanel
jPanel is Main panel which containes master and details panels


masterPanel

private javax.swing.JPanel masterPanel
masterPanel is the panel that carry the basic components which are Phases Lists,delete Phase Button and create New Phase Button


detailsPanel

private javax.swing.JPanel detailsPanel
detailsPanel is the panel that carry the derived components which are relevant to the selected Phase from the availablePhaseList


jobTypesPanel

private javax.swing.JPanel jobTypesPanel
jobTypesPanel is the panel that carry job types combo box ,available phases list and sequence phases list


AvailablePhasesScrollPane

private javax.swing.JScrollPane AvailablePhasesScrollPane
AvailablePhasesScrollPane is the container of Available Phases List


AssignedPhasesScrollPane

private javax.swing.JScrollPane AssignedPhasesScrollPane
AssignedPhasesScrollPane is the container of Assigned Phases List


XMLDescriptionScrollPane

private javax.swing.JScrollPane XMLDescriptionScrollPane
XMLDescriptionScrollPane is the container of XMLDescription text area


deletePhaseButton

private javax.swing.JButton deletePhaseButton
deletePhaseButton is the button to delete phase


createNewPhaseButton

private javax.swing.JButton createNewPhaseButton
createNewPhaseButton is the button to craete new phase


saveButton

private javax.swing.JButton saveButton
saveButton is the button to save the changes of phase these changes could be updates or even new data


addPhaseButton

private javax.swing.JButton addPhaseButton
addPhaseButton is the button to add phase from avilable phases list to assigned phases list


removePhaseButton

private javax.swing.JButton removePhaseButton
removePhaseButton is the button to remove phase from assigned phases list to avilable phases list


upPhaseButton

private javax.swing.JButton upPhaseButton
upPhaseButton is the button to move the phase upward


downPhaseButton

private javax.swing.JButton downPhaseButton
downPhaseButton is the button to move the phase downward


updateSequenceButton

private javax.swing.JButton updateSequenceButton
updateSequenceButton is the button to update the job type phases sequence


editReasonsButton

private javax.swing.JButton editReasonsButton
editReasons open edit reason dialog


phaseNameTextField

private javax.swing.JTextField phaseNameTextField
phaseNameTextField is showing selected Phase name


maximumPeriodTextField

private javax.swing.JTextField maximumPeriodTextField
maximumPeriodTextField is showing selected Phase max period


xmlDescriptionTextArea

private javax.swing.JTextArea xmlDescriptionTextArea
xmlDescriptionTextArea is showing selected Phase xml description


jobTypesComboBox

private javax.swing.JComboBox jobTypesComboBox
jobTypesComboBox holds system job types


availablePhasesList

private javax.swing.JList availablePhasesList
availablePhasesList holds available Phases List for the selected job type


assignedPhasesList

private javax.swing.JList assignedPhasesList
assignedPhasesList holds assigned Phases List for the selected job type


jobTypesLabel

private javax.swing.JLabel jobTypesLabel

availablePhasesLabel

private javax.swing.JLabel availablePhasesLabel

assignedSequenceLabel

private javax.swing.JLabel assignedSequenceLabel

phaseNameLabel

private javax.swing.JLabel phaseNameLabel

maximumPeriodLabel

private javax.swing.JLabel maximumPeriodLabel

daysLabel

private javax.swing.JLabel daysLabel

xmlDescriptionLabel

private javax.swing.JLabel xmlDescriptionLabel

lastSelectedPhaseIndex

private int lastSelectedPhaseIndex
lastSelectedPhaseIndex used to indicate to the last selected row of available Phases


recordModified

private boolean recordModified
recordModified used to check if there are updates or modifications applied but not saved yet to the selected phase


uiState

private PhasesManagerGUI.UIStates uiState

updatesKeyAdapter

private java.awt.event.KeyAdapter updatesKeyAdapter
key listener handles the events of change the text of text fields, chnage the selected index of combo boxes and check boxes. Once the event fired, the key adapter enables the saveButton and set recordModified to true. The value of recordModified utilized when the user decides to change to selected Phase to another one, here the system generates a confirmation message that asks the user to discared the changes he done or to commit them.

Constructor Detail

PhasesManagerGUI

public PhasesManagerGUI()
This is the default constructor

Method Detail

initialize

private void initialize()
This method initializes layout


getJPanel

private javax.swing.JPanel getJPanel()
This method initializes jPanel

Returns:
javax.swing.JPanel

getMasterPanel

private javax.swing.JPanel getMasterPanel()
This method initializes masterPanel

Returns:
javax.swing.JPanel

getDetailsPanel

private javax.swing.JPanel getDetailsPanel()
This method initializes detailsPanel

Returns:
javax.swing.JPanel

getJobTypesPanel

private javax.swing.JPanel getJobTypesPanel()
This method initializes jobTypesPanel

Returns:
javax.swing.JPanel

getAvailablePhasesScrollPane

public javax.swing.JScrollPane getAvailablePhasesScrollPane()
This method initializes AvailablePhasesScrollPane

Returns:
javax.swing.JScrollPane

getAssignedPhasesScrollPane

public javax.swing.JScrollPane getAssignedPhasesScrollPane()
This method initializes AssignedPhasesScrollPane

Returns:
javax.swing.JScrollPane

getXMLDescriptionScrollPane

public javax.swing.JScrollPane getXMLDescriptionScrollPane()
This method initializes XMLDescriptionScrollPane

Returns:
javax.swing.JScrollPane

getDeletePhaseButton

private javax.swing.JButton getDeletePhaseButton()
This method initializes deletePhaseButton

Returns:
javax.swing.JButton

getCreateNewPhaseButton

private javax.swing.JButton getCreateNewPhaseButton()
This method initializes createNewPhaseButton

Returns:
javax.swing.JButton

getSaveButton

private javax.swing.JButton getSaveButton()
This method initializes saveButton

Returns:
javax.swing.JButton

getAddPhaseButton

private javax.swing.JButton getAddPhaseButton()
This method initializes addPhaseButton which moves selected phases from available phases list to assigned phases list

Returns:
javax.swing.JButton

getRemovePhaseButton

private javax.swing.JButton getRemovePhaseButton()
This method initializes removePhaseButton which moves selected phases from assigned phases list to available phases list

Returns:
javax.swing.JButton

getUpPhaseButton

private javax.swing.JButton getUpPhaseButton()
This method initializes upPhaseButton which change the order of assigned phases list by moving the phase upward

Returns:
javax.swing.JButton

getDownPhaseButton

private javax.swing.JButton getDownPhaseButton()
This method initializes downPhaseButton which change the order of assigned phases list by moving the phase downward

Returns:
javax.swing.JButton

getUpdateSequenceButton

private javax.swing.JButton getUpdateSequenceButton()
This method initializes updateSequenceButton which update the sequence of phases assigned to selected job type

Returns:
javax.swing.JButton

getEditReasons

private javax.swing.JButton getEditReasons()
This method initializes jButton

Returns:
javax.swing.JButton

getPhaseNameTextField

private javax.swing.JTextField getPhaseNameTextField()
This method initializes phaseNameTextField

Returns:
javax.swing.JTextField

getMaximumPeriodTextField

private javax.swing.JTextField getMaximumPeriodTextField()
This method initializes maximumPeriodTextField

Returns:
javax.swing.JTextField

getXmlDescriptionTextArea

private javax.swing.JTextArea getXmlDescriptionTextArea()
This method initializes xmlDescriptionTextArea

Returns:
javax.swing.JTextArea

getJobTypesComboBox

private javax.swing.JComboBox getJobTypesComboBox()
This method initializes jobTypesComboBox

Returns:
javax.swing.JComboBox

validateValues

private boolean validateValues()
Validate filed values

Returns:
true if all values are valid , false other wise

showMsg

private void showMsg(java.lang.String msg)
Show message box

Parameters:
msg - string in Resource File

confirmDiscardChanges

private boolean confirmDiscardChanges()
Confirm discard User changes message

Returns:
true if confirmed and false otherwise

setEditMode

private void setEditMode()
Set GUI mode to Edit


setCreateMode

private void setCreateMode()
Clear the GUI and set mode to Add


adjustDetailsPanel

private void adjustDetailsPanel()
Extract the data of the selected phase and fill up the correspondence fileds


clearFields

private void clearFields()
Reset GUI controls


clearDetailsPanel

private void clearDetailsPanel()
Reset GUI controls


getAvailablePhasesList

private javax.swing.JList getAvailablePhasesList()
This method initializes availablePhasesList

Returns:
javax.swing.JList

loadAvailablePhasesList

private void loadAvailablePhasesList()
This method loads availablePhasesList


getAssignedSequenceList

private javax.swing.JList getAssignedSequenceList()
This method initializes assignedSequenceList

Returns:
javax.swing.JList

loadAssignedPhasesList

private void loadAssignedPhasesList()
This method loads assignedPhasesList


reloadManager

public void reloadManager()
Reset controls when Phase tab change

Specified by:
reloadManager in class BaseManagerGUI