sdm.apps
Class CTableUtility

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--sdm.apps.CTableUtility

public class CTableUtility
extends javax.swing.JFrame
implements java.awt.print.Printable, java.awt.event.ActionListener, java.beans.PropertyChangeListener

This class is a utility class for CTable. It is so that you can use the table and be able to store the configuration and be able to view multiple monitors at the same time with one utility. This class also implements PropertyChangeListener that can detect if a property has changed in another class.

See Also:
Serialized Form

Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, 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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
CTableUtility(java.lang.String fileName)
          Creates a frame with file management capabilities
CTableUtility(java.lang.String host, java.lang.String port)
          Creates a frame with file management capabilities
CTableUtility(java.lang.String host, java.lang.String port, java.lang.String fileName)
          Creates a frame with file management capabilities
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
static void main(java.lang.String[] args)
          main function
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
           This method is used to print the table.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          This is a function for preopertyChangelistener
 void repaint(long l, int x, int y, int w, int h)
          due to a probable error in swing we needed to add this function to repaint the table header of CTable when things are updated.
 
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFont, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CTableUtility

public CTableUtility(java.lang.String fileName)
Creates a frame with file management capabilities
Parameters:
fileName - The name of the file to be read in

CTableUtility

public CTableUtility(java.lang.String host,
                     java.lang.String port)
Creates a frame with file management capabilities
Parameters:
host - The name of the host to be connected to.
port - The port number to connect to.

CTableUtility

public CTableUtility(java.lang.String host,
                     java.lang.String port,
                     java.lang.String fileName)
Creates a frame with file management capabilities
Parameters:
host - The name of the host to be connected to.
port - The port number to connect to.
fileName - The name of the file to be read in.
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
This is a function for preopertyChangelistener
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
evt - catches the PropertyChangeEvent

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
This method is used to print the table.
Specified by:
print in interface java.awt.print.Printable
Parameters:
g - gets the graphics for the table
pageFormat - gets the page format for the printed page
pageIndex - gets the index of the page to be printed

repaint

public void repaint(long l,
                    int x,
                    int y,
                    int w,
                    int h)
due to a probable error in swing we needed to add this function to repaint the table header of CTable when things are updated.
Overrides:
repaint in class java.awt.Component

main

public static void main(java.lang.String[] args)
main function
Parameters:
args - String array that contains the command line arguments This String array can have 0 to 3 string. args = null create a empty table and connect to localhost at default port. args = String fileName create a table using infomation in configuration file fileName and connect to localhost at default port. args = String hostName, String portNum create a empty table and connect to host hostName at port portNum. args = String hostName, String portNum, String fileName create a table using infomation in configuration file fileName and connect to host hostName at port portNum.