gui
Class SingleRecord

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 gui.SingleRecord
All Implemented Interfaces:
GuiConstants, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class SingleRecord
extends javax.swing.JPanel
implements GuiConstants, java.awt.event.ActionListener

The single record class is the viewing panel for the data

See Also:
Serialized Form

Nested Class Summary
private  class SingleRecord.JXPanel
          The JXPanel, is required to allow the single record pane to be scrollable.
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.util.ArrayList<javax.swing.JButton> buttons
           
private  java.util.LinkedList<javax.swing.JPanel> columns
           
private  java.util.LinkedList<javax.swing.JComboBox> comboBoxFields
           
private static java.text.DecimalFormat FORMAT
           
private  int index
           
private  javax.swing.JPanel pnlPosition
           
private static long serialVersionUID
           
private  java.util.LinkedList<javax.swing.JTextField> textFields
           
 
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 gui.GuiConstants
ABOUT_FILE_FORMAT_CONVERTER, ABOUT_NOT_FOUND, BAD_URL, BROWSER_NOT_INSTALLED, buttonNames, CHANGE_DATA_TYPE, COLUMN_NAME_TOOLTIP, DATA_HEADING, DATA_TABLE, EMPTY, FIELD_HEADING, FILE_FORMAT_CONVERTER, HTML_ABOUT, IMAGE_PATH, LS, MAIN_HEADING, MENU_DATA, MENU_FILE, MENU_HELP, MENU_ITEM_DATA_COLUMN, MENU_ITEM_DATA_COLUMN_ADD, MENU_ITEM_DATA_COLUMN_DELETE, MENU_ITEM_DATA_RECORD, MENU_ITEM_DATA_RECORD_ADD, MENU_ITEM_DATA_RECORD_DELETE, MENU_ITEM_FILE_EXIT, MENU_ITEM_FILE_EXPORT, MENU_ITEM_FILE_EXPORT_DB, MENU_ITEM_FILE_EXPORT_TEXT, MENU_ITEM_FILE_IMPORT, MENU_ITEM_HELP_ABOUT, MENU_ITEM_HELP_MANUAL, MENU_ITEM_SETTINGS_LOOK, MENU_ITEM_SETTINGS_LOOK_1, MENU_ITEM_SETTINGS_LOOK_2, MENU_ITEM_SETTINGS_LOOK_3, MENU_ITEM_SETTINGS_LOOK_4, MENU_SETTINGS, OF, OK, RECORD, SINGLE_RECORD, SITE_NAME, SPACE, SPLASH_SCREEN, TYPE_HEADING, WEBSITE_NOT_EXIST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SingleRecord()
          JPanel which shows a single record at a time.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          The actionPerformed method is used for the internal navigation of the single record pane.
private  void decrement()
          Decrements the index, and sets the fields.
private  void increment()
          Increments the index, and sets the fields.
private  void setFields()
          The method sets the JTextField values with the corresponding element from the selected record based upon the index value.
private  void setIndex(int index)
          The setIndex method is used to change the currently selected record; which sets the Fields with the new values.
private  void showField(java.lang.Object object)
          This method is used to show the JTextField on the column name cardlayout.
private  void updateDataType(java.lang.Object obj)
          This changes the dataType to what the user wants.
private  void updateHeader(java.lang.Object object)
          The update header method is used to update the changed column name value.
private  void updateText(java.lang.Object object)
          The method updates the assoicated value in the data structure with the value from the JTextField.
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

FORMAT

private static final java.text.DecimalFormat FORMAT

buttons

private java.util.ArrayList<javax.swing.JButton> buttons

columns

private java.util.LinkedList<javax.swing.JPanel> columns

textFields

private java.util.LinkedList<javax.swing.JTextField> textFields

comboBoxFields

private java.util.LinkedList<javax.swing.JComboBox> comboBoxFields

index

private int index

pnlPosition

private javax.swing.JPanel pnlPosition
Constructor Detail

SingleRecord

public SingleRecord()
JPanel which shows a single record at a time.

Method Detail

updateDataType

private void updateDataType(java.lang.Object obj)
This changes the dataType to what the user wants.

Parameters:
obj -

updateText

private void updateText(java.lang.Object object)
The method updates the assoicated value in the data structure with the value from the JTextField. The method validates the data, and also changes the background colour of the JTextField if its invalid.

Parameters:
object -

updateHeader

private void updateHeader(java.lang.Object object)
The update header method is used to update the changed column name value. It first checks whether the value has actually changed, by comparing the JTextField with the label.

Parameters:
object -

showField

private void showField(java.lang.Object object)
This method is used to show the JTextField on the column name cardlayout. It receives the JPanel of the cardlayout, and shows the next card (which has the JTextField in it, and requests focus.

Parameters:
object - - The shown card.

setIndex

private void setIndex(int index)
The setIndex method is used to change the currently selected record; which sets the Fields with the new values. If the index received is greater than the size of the data structure; then it will reset the index back to 0 - therefore creating a cycling effect when navigated through the records.

Parameters:
index - - The desired index in the datastructure which will get viewed.

increment

private void increment()
Increments the index, and sets the fields.


decrement

private void decrement()
Decrements the index, and sets the fields.


setFields

private void setFields()
The method sets the JTextField values with the corresponding element from the selected record based upon the index value.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
The actionPerformed method is used for the internal navigation of the single record pane. The method matches the action event source, with the different JButtons from the internal List of JButton and performs the corresponding action.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e -