org.bibalex.daf.managers.admin
Class GeneralSettingsGUI

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.GeneralSettingsGUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class GeneralSettingsGUI
extends BaseManagerGUI

This class manages operations over Devices, Languages, Operation Systems External Types, Job Conditions and Media Types like add, remove, Update,...

Author:
Mohammed.Abuouda
See Also:
Serialized Form

Nested Class Summary
private static class GeneralSettingsGUI.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.JLabel AbbLabel
           
private  javax.swing.JTextField AbbTextField
          AbbTextField is a text field shows the abbreviation of selectd element
private  javax.swing.JList attachedGeneralList
          attachedGeneralList conatines element of selected setting
private  javax.swing.JLabel availableCollectionsLabel
           
private  javax.swing.JScrollPane availableSettingScrollPane
          availableSettingScrollPane is the container of attachedGeneralList
private  javax.swing.JLabel barcodeLabel
           
private  javax.swing.JTextField barCodeTextField
          barCodeTextField is a text field shows the starting barcode of selected media type
private  javax.swing.JButton createNewCollectionButton
          createNewCollectionButton is the button to create new element related to the selected setting
private  javax.swing.JButton deleteCollectionButton
          deleteCollectionButton is the button to delete selected element of attachedGeneralList
private  javax.swing.JLabel DescLabel
           
private  javax.swing.JTextField DescTextField
          DescTextField is a text field shows the description of selectd element
private  javax.swing.JPanel detailsPanel
          detailsPanel is the panel that carry the derived components which are relevant to the selected element from the attachedGeneralList
private  javax.swing.JLabel ftpPathLabel
           
private  javax.swing.JComboBox generalComboBox
          generalComboBox conatines general setting types
private  int generalComboBoxSelectedIndex
          generalComboBoxSelectedIndex used to indicate to the last selected element of generalComboBox
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master and details panels
private  int lastBarcode
          the value of last starting barcode (for media types only)
private  int lastSelectedIndex
          lastSelectedIndex used to indicate to the last selected element of attachedGeneralList
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are the drop down list having the setting types, deleteCollectionButton and createNewCollectionButton
private  javax.swing.JLabel NameLabel
           
private  javax.swing.JTextField NameTextField
          NameTextField is a text field shows the name of selectd element
private  javax.swing.JPanel onlineMediaCredentialPanel
          onlineMediaCredentialPanelholds 3 text boxes representing ftp ip, user name and password.
private  boolean recordModified
          recordModified used to check if there are updates or modifications applied but not saved yet to the selected element
private  javax.swing.JButton saveButton
          saveButton is the button to save the changes of selected element these changes could be updates or even new data
private  javax.swing.JLabel sizeLabel
           
private  javax.swing.JTextField sizeTextField
          sizeTextField is a text field shows the size of selectd media type element
private  javax.swing.JComboBox storageComboBox
          storageComboBox conatinessystem storages
private  GeneralSettingsGUI.UIStates uiState
           
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.
 
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
GeneralSettingsGUI()
          This is the default constructor
 
Method Summary
private  void adjustDetailsPanel()
          Adjusts the details panel (fields) with the current selected collection
private  void clearDetailsPanel()
          clears the details Panel, mostly used in the Create Mode
private  boolean confirmDiscardChanges()
          Displays a confirmation regading discarding changes
private  void displayErrorMessage(java.lang.String errorMessage)
          Displays an error message to the User
private  javax.swing.JTextField getAbbTextField()
          This method initializes AbbTextField
private  javax.swing.JList getAvailableList()
          This method initializes attachedGeneralList
private  javax.swing.JScrollPane getAvailableSettingsScrollPane()
          Initializes availableSettingScrollPane
private  javax.swing.JTextField getBarCodeTextField()
          This method initializes barCodeTextField
private  javax.swing.JButton getCreateNewCollectionButton()
          This method initializes createNewCollectionButton
private  javax.swing.JButton getDeleteCollectionButton()
          This method initializes deleteCollectionButton
private  javax.swing.JTextField getDescTextFieldTextField()
          This method initializes DescTextField
private  javax.swing.JPanel getDetailsPanel()
          This method initializes detailsPanel
private  javax.swing.JComboBox getGeneralComboBox()
          This method initializes generalComboBox
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JTextField getNameTextField()
          This method initializes NameTextField
private  javax.swing.JPanel getOnlineMediaCredentialPanel()
          This method initializes jPanonlineMediaCredentialPanelel
private  javax.swing.JButton getSaveButton()
          This method initializes saveButton
private  javax.swing.JTextField getSizeTextField()
          This method initializes sizeTextField
private  javax.swing.JComboBox getStorageComboBox()
           
private  void initialize()
          Initiliazes the Component
private  void loadAvailableList()
          Load attachedGeneralList
 void reloadManager()
          Reset controls when general setting tab change
private  void setCreateMode()
          Sets the component to Create Mode
private  void setEditMode()
          Set the components to the Edit Mode
private  boolean validateValues()
          Validates the UI Fields 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 the drop down list having the setting types, deleteCollectionButton and createNewCollectionButton


detailsPanel

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


onlineMediaCredentialPanel

private javax.swing.JPanel onlineMediaCredentialPanel
onlineMediaCredentialPanelholds 3 text boxes representing ftp ip, user name and password. These field used only with online media type storage which is fixed entry in media type data


availableSettingScrollPane

private javax.swing.JScrollPane availableSettingScrollPane
availableSettingScrollPane is the container of attachedGeneralList


deleteCollectionButton

private javax.swing.JButton deleteCollectionButton
deleteCollectionButton is the button to delete selected element of attachedGeneralList


createNewCollectionButton

private javax.swing.JButton createNewCollectionButton
createNewCollectionButton is the button to create new element related to the selected setting


saveButton

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


NameTextField

private javax.swing.JTextField NameTextField
NameTextField is a text field shows the name of selectd element


DescTextField

private javax.swing.JTextField DescTextField
DescTextField is a text field shows the description of selectd element


AbbTextField

private javax.swing.JTextField AbbTextField
AbbTextField is a text field shows the abbreviation of selectd element


sizeTextField

private javax.swing.JTextField sizeTextField
sizeTextField is a text field shows the size of selectd media type element


barCodeTextField

private javax.swing.JTextField barCodeTextField
barCodeTextField is a text field shows the starting barcode of selected media type


generalComboBox

private javax.swing.JComboBox generalComboBox
generalComboBox conatines general setting types


storageComboBox

private javax.swing.JComboBox storageComboBox
storageComboBox conatinessystem storages


attachedGeneralList

private javax.swing.JList attachedGeneralList
attachedGeneralList conatines element of selected setting


NameLabel

private javax.swing.JLabel NameLabel

DescLabel

private javax.swing.JLabel DescLabel

AbbLabel

private javax.swing.JLabel AbbLabel

sizeLabel

private javax.swing.JLabel sizeLabel

barcodeLabel

private javax.swing.JLabel barcodeLabel

availableCollectionsLabel

private javax.swing.JLabel availableCollectionsLabel

ftpPathLabel

private javax.swing.JLabel ftpPathLabel

lastBarcode

private int lastBarcode
the value of last starting barcode (for media types only)


lastSelectedIndex

private int lastSelectedIndex
lastSelectedIndex used to indicate to the last selected element of attachedGeneralList


generalComboBoxSelectedIndex

private int generalComboBoxSelectedIndex
generalComboBoxSelectedIndex used to indicate to the last selected element of generalComboBox


recordModified

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


uiState

private GeneralSettingsGUI.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 element 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

GeneralSettingsGUI

public GeneralSettingsGUI()
This is the default constructor

Method Detail

initialize

private void initialize()
Initiliazes the Component


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

getOnlineMediaCredentialPanel

private javax.swing.JPanel getOnlineMediaCredentialPanel()
This method initializes jPanonlineMediaCredentialPanelel

Returns:
javax.swing.JPanel

getAvailableSettingsScrollPane

private javax.swing.JScrollPane getAvailableSettingsScrollPane()
Initializes availableSettingScrollPane

Returns:
JScrollPane

getDeleteCollectionButton

private javax.swing.JButton getDeleteCollectionButton()
This method initializes deleteCollectionButton

Returns:
javax.swing.JButton

getCreateNewCollectionButton

private javax.swing.JButton getCreateNewCollectionButton()
This method initializes createNewCollectionButton

Returns:
javax.swing.JButton

getSaveButton

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

Returns:
javax.swing.JButton

getNameTextField

private javax.swing.JTextField getNameTextField()
This method initializes NameTextField

Returns:
javax.swing.JTextField

getDescTextFieldTextField

private javax.swing.JTextField getDescTextFieldTextField()
This method initializes DescTextField

Returns:
javax.swing.JTextField

getAbbTextField

private javax.swing.JTextField getAbbTextField()
This method initializes AbbTextField

Returns:
javax.swing.JTextField

getSizeTextField

private javax.swing.JTextField getSizeTextField()
This method initializes sizeTextField

Returns:
javax.swing.JTextField

getBarCodeTextField

private javax.swing.JTextField getBarCodeTextField()
This method initializes barCodeTextField

Returns:
javax.swing.JTextField

getGeneralComboBox

private javax.swing.JComboBox getGeneralComboBox()
This method initializes generalComboBox

Returns:
javax.swing.JComboBox

getStorageComboBox

private javax.swing.JComboBox getStorageComboBox()

getAvailableList

private javax.swing.JList getAvailableList()
This method initializes attachedGeneralList

Returns:
JList

loadAvailableList

private void loadAvailableList()
Load attachedGeneralList


validateValues

private boolean validateValues()
Validates the UI Fields Values

Returns:
true if all fields are valid and false otherwise

displayErrorMessage

private void displayErrorMessage(java.lang.String errorMessage)
Displays an error message to the User

Parameters:
errorMessage - The message to be displayed

confirmDiscardChanges

private boolean confirmDiscardChanges()
Displays a confirmation regading discarding changes

Returns:
true if confirmed and false if not

setEditMode

private void setEditMode()
Set the components to the Edit Mode


setCreateMode

private void setCreateMode()
Sets the component to Create Mode


adjustDetailsPanel

private void adjustDetailsPanel()
Adjusts the details panel (fields) with the current selected collection


clearDetailsPanel

private void clearDetailsPanel()
clears the details Panel, mostly used in the Create Mode


reloadManager

public void reloadManager()
Reset controls when general setting tab change

Specified by:
reloadManager in class BaseManagerGUI