visualmodeler
Class UserProperty

Object
  |
  +--Component
        |
        +--Container
              |
              +--Window
                    |
                    +--Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--visualmodeler.UserProperty
All Implemented Interfaces:
javax.accessibility.Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, javax.swing.RootPaneContainer, Serializable, javax.swing.WindowConstants, WindowListener

public class UserProperty
extends javax.swing.JDialog
implements ActionListener, WindowListener

UserProperty stores the values needed for each grid user

Version:
1.1
Author:
Anthony Sulistio and Chee Shin Yeo
See Also:
Serialized Form
Invariant:
$none

Field Summary
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class Dialog
 
Fields inherited from class Window
 
Fields inherited from class Container
 
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
UserProperty(int id, String name, boolean random, Random r)
          Allocates a new UserProperty object
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Performs a certain task when an action occurs
 String generateCode(String indent)
          Generates a Java code regarding to grid users properties
 String getUserName()
          Gets the grid user name
 boolean hasLoadXml()
          Checks whether XML file has been loaded or not
 void loadXml(org.w3c.dom.NodeList nodeList)
          Loads a XML code regarding to grid users
 String saveFile(String spaces)
          Generates a XML code regarding to grid users properties
 void showDialog()
          Shows a grid user dialog
 void windowActivated(WindowEvent evt)
          An event that occurs when the window dialog is activated
 void windowClosed(WindowEvent evt)
          An event that occurs when the window dialog is closed
 void windowClosing(WindowEvent evt)
          An event that occurs when the window dialog is closing
 void windowDeactivated(WindowEvent evt)
          An event that occurs when the window dialog is deactivated
 void windowDeiconified(WindowEvent evt)
          An event that occurs when the window dialog is deiconified
 void windowIconified(WindowEvent evt)
          An event that occurs when the window dialog is iconified
 void windowOpened(WindowEvent evt)
          An event that occurs when the window dialog is opened
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, 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 Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class 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, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class 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, remove, 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 Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserProperty

public UserProperty(int id,
                    String name,
                    boolean random,
                    Random r)
Allocates a new UserProperty object

Parameters:
id - a grid user id
name - a grid user name
random - a flag to determine whether using random values to create a grid user's properties or not
r - a Random object
Pre Condition:
id >= 0, name != null, r != null
Post Condition:
$none
Method Detail

getUserName

public String getUserName()
Gets the grid user name

Returns:
user name
Pre Condition:
$none
Post Condition:
$result != null

actionPerformed

public void actionPerformed(ActionEvent evt)
Performs a certain task when an action occurs

Specified by:
actionPerformed in interface ActionListener
Parameters:
evt - an ActionEvent object
Pre Condition:
evt != null
Post Condition:
$none

showDialog

public void showDialog()
Shows a grid user dialog

Pre Condition:
$none
Post Condition:
$none

generateCode

public String generateCode(String indent)
Generates a Java code regarding to grid users properties

Parameters:
indent - indentation
Returns:
a Java code in String object
Pre Condition:
indent != null
Post Condition:
$result != null

saveFile

public String saveFile(String spaces)
Generates a XML code regarding to grid users properties

Parameters:
spaces - number of spaces
Returns:
a XML code in String object
Pre Condition:
spaces != null
Post Condition:
$result != null

hasLoadXml

public boolean hasLoadXml()
Checks whether XML file has been loaded or not

Returns:
true if it has been loaded, false otherwise
Pre Condition:
$none
Post Condition:
$none

loadXml

public void loadXml(org.w3c.dom.NodeList nodeList)
Loads a XML code regarding to grid users

Parameters:
nodeList - a NodeList object
Pre Condition:
nodeList != null
Post Condition:
$none

windowClosing

public void windowClosing(WindowEvent evt)
An event that occurs when the window dialog is closing

Specified by:
windowClosing in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowClosed

public void windowClosed(WindowEvent evt)
An event that occurs when the window dialog is closed

Specified by:
windowClosed in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowOpened

public void windowOpened(WindowEvent evt)
An event that occurs when the window dialog is opened

Specified by:
windowOpened in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowIconified

public void windowIconified(WindowEvent evt)
An event that occurs when the window dialog is iconified

Specified by:
windowIconified in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowDeiconified

public void windowDeiconified(WindowEvent evt)
An event that occurs when the window dialog is deiconified

Specified by:
windowDeiconified in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowActivated

public void windowActivated(WindowEvent evt)
An event that occurs when the window dialog is activated

Specified by:
windowActivated in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none

windowDeactivated

public void windowDeactivated(WindowEvent evt)
An event that occurs when the window dialog is deactivated

Specified by:
windowDeactivated in interface WindowListener
Parameters:
evt - a WindowEvent object
Pre Condition:
evt != null
Post Condition:
$none