gui
Class TableBean

java.lang.Object
  |
  +--java.awt.Component
        |
        +--gui.TableBean
Direct Known Subclasses:
ColumnHeader, RowHeader

public class TableBean
extends java.awt.Component
implements java.io.Serializable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
TableBean()
          Constructs a TableBean
TableBean(int cols, int rows)
          Constructs a TableBean
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          The specified PropertyChangeListeners propertyChange method will be called each time the value of any bound property is changed.
 void addTableListener(TableListener tl)
          Adds a new TableListener.
 void clearTableValue()
          Clear all values in the Table.
 java.awt.event.ComponentAdapter getAdapter()
           
 java.awt.Color getBackground()
          Returns the background color for the Bean
 int getColumnWidth()
          Returns the width of a table Column
 java.awt.Font getFont()
          Returns the current font.
 java.awt.Color getForeground()
          Returns the foreground color for the bean
 int getNumColumns()
          Return the number of columns
 int getNumRows()
          Return the number of rows
 java.awt.Dimension getPreferredSize()
          Detetermines the base size of this component when shown on the screen.
 int getRowHeight()
          Returns the height of a table Row
 TableRegion getSelectedRegion()
          Returns the selected TableRegion
 java.lang.String getTableValue(int viewCol, int viewRow)
          Retrieves the value for a particular table entry
 void mouseClicked(java.awt.event.MouseEvent evt)
          Ignore mouseClicked events.
 void mouseDragged(java.awt.event.MouseEvent evt)
          Process mouseDragged events.
 void mouseEntered(java.awt.event.MouseEvent evt)
          Ignore mouseEntered events.
 void mouseExited(java.awt.event.MouseEvent evt)
          Ignore mouseExited events.
 void mouseMoved(java.awt.event.MouseEvent evt)
          Ignore mouseMoved events.
 void mousePressed(java.awt.event.MouseEvent evt)
          Process mousePressed events.
 void mouseReleased(java.awt.event.MouseEvent evt)
          Process mouseReleased events.
 void paint(java.awt.Graphics g)
          Paint the Table Bean.
protected  void redraw(java.awt.Graphics g, int viewCol, int viewRow)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove this PropertyChangeListener from the buttons internal list.
 void removeTableListener(TableListener tl)
          Removes an existing TableListener
 void setAdapter(java.awt.event.ComponentAdapter ca)
           
 void setBackground(java.awt.Color c)
          Set the background color of the table.
 void setColumnWidth(int newWidth)
          Set the width of a table Column.
 void setFont(java.awt.Font f)
          Set the current font.
 void setForeground(java.awt.Color c)
          Set the color the table is drawn with.
 void setNumColumns(int newCols)
          Set the number of columns to table.
 void setNumRows(int newRows)
          Set the number of rows to table.
 void setRowHeight(int newHeight)
          Set the height of a table Row.
 void setSelectedRegion(TableElement sTE, TableElement eTE)
          Select an invertedRegion; If unchanged, return false, otherwise true.
 void setSelectedRegion(TableRegion tr)
          Sets the selected region to be the specified TableRegion.
 void setTableValue(int viewCol, int viewRow, java.lang.String val)
          Sets the value for a particular table entry
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableBean

public TableBean()
Constructs a TableBean

TableBean

public TableBean(int cols,
                 int rows)
Constructs a TableBean
Parameters:
#cols - the width
#rows - the height
Method Detail

setTableValue

public void setTableValue(int viewCol,
                          int viewRow,
                          java.lang.String val)
Sets the value for a particular table entry
Parameters:
viewCol - the column location
viewRow - the row location
val - the value
See Also:
getTableValue(int, int)

getTableValue

public java.lang.String getTableValue(int viewCol,
                                      int viewRow)
Retrieves the value for a particular table entry
Parameters:
viewCol - the column location
viewRow - the row location
See Also:
setTableValue(int, int, java.lang.String)

clearTableValue

public void clearTableValue()
Clear all values in the Table.
See Also:
setTableValue(int, int, java.lang.String), getTableValue(int, int)

getRowHeight

public int getRowHeight()
Returns the height of a table Row
See Also:
setRowHeight(int)

setRowHeight

public void setRowHeight(int newHeight)
Set the height of a table Row. This is a bound property
Parameters:
newHeight - the height
See Also:
getRowHeight()

getColumnWidth

public int getColumnWidth()
Returns the width of a table Column
See Also:
setColumnWidth(int)

setColumnWidth

public void setColumnWidth(int newWidth)
Set the width of a table Column. This is a bound property
Parameters:
newWidth - the new width
See Also:
getColumnWidth()

getForeground

public java.awt.Color getForeground()
Returns the foreground color for the bean
Overrides:
getForeground in class java.awt.Component
See Also:
setForeground(java.awt.Color)

setForeground

public void setForeground(java.awt.Color c)
Set the color the table is drawn with. This is a bound property.
Overrides:
setForeground in class java.awt.Component
See Also:
getForeground()

getBackground

public java.awt.Color getBackground()
Returns the background color for the Bean
Overrides:
getBackground in class java.awt.Component
See Also:
setBackground(java.awt.Color)

setBackground

public void setBackground(java.awt.Color c)
Set the background color of the table. This is a bound property.
Overrides:
setBackground in class java.awt.Component
See Also:
getBackground()

setFont

public void setFont(java.awt.Font f)
Set the current font. This is a bound property.
Overrides:
setFont in class java.awt.Component
See Also:
getFont()

getFont

public java.awt.Font getFont()
Returns the current font. This is a bound property.
Overrides:
getFont in class java.awt.Component
See Also:
setFont(java.awt.Font)

paint

public void paint(java.awt.Graphics g)
Paint the Table Bean.
Overrides:
paint in class java.awt.Component

redraw

protected void redraw(java.awt.Graphics g,
                      int viewCol,
                      int viewRow)

getSelectedRegion

public TableRegion getSelectedRegion()
Returns the selected TableRegion
See Also:
setSelectedRegion(gui.TableRegion)

setSelectedRegion

public void setSelectedRegion(TableRegion tr)
Sets the selected region to be the specified TableRegion.
See Also:
getSelectedRegion()

setSelectedRegion

public void setSelectedRegion(TableElement sTE,
                              TableElement eTE)
Select an invertedRegion; If unchanged, return false, otherwise true.
Parameters:
sTE - start TableElement
eTE - end TableElement

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Ignore mouseClicked events.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Process mousePressed events. Every mousePressed event turns into a TableEventObject of type MOUSE_PRESS.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - the MouseEvent object.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Process mouseReleased events. Every mouseReleased event turns into a TableEventObject of type MOUSE_RELEASE.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
evt - the MouseEvent object.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Ignore mouseEntered events.
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Ignore mouseExited events.
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Process mouseDragged events. Every mouseDragged event turns into a TableEventObject of type MOUSE_DOWN.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
evt - the MouseEvent object.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Ignore mouseMoved events.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

addTableListener

public void addTableListener(TableListener tl)
Adds a new TableListener.
Parameters:
tl - The TableListener
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removeTableListener

public void removeTableListener(TableListener tl)
Removes an existing TableListener
Parameters:
tl - The TableListener
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
The specified PropertyChangeListeners propertyChange method will be called each time the value of any bound property is changed.
Parameters:
l - the PropertyChangeListener
Overrides:
addPropertyChangeListener in class java.awt.Component
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove this PropertyChangeListener from the buttons internal list. If the PropertyChangeListener isn't on the list, silently do nothing.
Parameters:
l - the PropertyChangeListener
Overrides:
removePropertyChangeListener in class java.awt.Component
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setNumColumns

public void setNumColumns(int newCols)
Set the number of columns to table. This is a bound property.
See Also:
getNumColumns()

getNumColumns

public int getNumColumns()
Return the number of columns
See Also:
setNumColumns(int)

setNumRows

public void setNumRows(int newRows)
Set the number of rows to table. This is a bound property.
See Also:
getNumRows()

getNumRows

public int getNumRows()
Return the number of rows
See Also:
setNumRows(int)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Detetermines the base size of this component when shown on the screen.
Overrides:
getPreferredSize in class java.awt.Component

setAdapter

public void setAdapter(java.awt.event.ComponentAdapter ca)

getAdapter

public java.awt.event.ComponentAdapter getAdapter()