|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
ciips.animation.TableCanvas
This class creates a panel to display a table. It is only called from
the TablePanel
class which adds a scrollbar to the east of the
table canvas.
This TableCanvas
class should not have to be used manually.
All its methods are redirected from the TablePanel
class.
Nested Class Summary |
Nested classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
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 | |
TableCanvas(TablePanel parent)
Constructor method of the TableCanvas class. |
Method Summary | |
void |
addTableEntry(java.lang.Object obj,
int posn)
Add an entry to the table and push the existing entries after this newly added object one position down. |
boolean |
contains(java.lang.Object obj)
Check if the table contains a certain object specified by the parameter. |
void |
drawBox(java.awt.Graphics g,
int x,
int y,
java.lang.String str,
java.awt.Color fg,
java.awt.Color bg,
int max_length)
This method is only called by the paint() method to draw
each entry of the table as a box. |
void |
drawClusters(java.awt.Graphics g,
int x,
int y)
Display a status summary of the table regarding the percentage of the table being occupied, the number of clusters in the table, and a rough idea of the location of the table being occupied. |
boolean |
full()
Check if the table has been fully filled up. |
java.lang.Object |
getTableEntryAt(int posn)
Obtain the object placed at the table row specified by the parameter. |
void |
highlightRow(int i)
Highlight the table entry with the row specified by the parameter. |
int |
indexOf(java.lang.Object obj)
Get the location of an object in the table. |
void |
init()
Initialize the table and set all entries to null. |
int |
numOccupied()
Get the number of rows in the table where the contents are non-null object. |
boolean |
occupied(int i)
Check if a particular row in the table has a non-null object. |
void |
paint(java.awt.Graphics g)
Method to draw the table canvas. |
java.awt.Dimension |
preferredSize()
Define the default size of the table. |
void |
restoreRow()
This method is used to restore any highlighted row. |
void |
setStart(int start)
Set the starting row, which will be displayed by the table. |
void |
setTableEntry(java.lang.Object obj,
int posn)
Set the object specified by the first parameter to the table row defined by the second parameter. |
void |
setTableSize(int size)
This method is called to set the size of the table and hence rescale the scrollbar on the panel it resides in. |
int |
tableSize()
Get the maximum size of the table (including all null and non-null objects). |
void |
update(java.awt.Graphics g)
This method is invoked by the display manager when the repaint() method of the panel is called. |
Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, 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, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TableCanvas(TablePanel parent)
TableCanvas
class.
parent
- The panel with a scrollbar where this table canvas
is going to reside.Method Detail |
public void init()
public void setStart(int start)
start
- The first row to be shown at any one time.public void highlightRow(int i)
highlightRow
method is called on another different row, the previously highlighted
row will be restored and the new row will be highlighted.
i
- The row to be highlighted.public void restoreRow()
public void setTableSize(int size)
size
- The new size of this table.public void setTableEntry(java.lang.Object obj, int posn)
obj
- The object to be added to the table.posn
- The row number where the object is going to be added.public java.lang.Object getTableEntryAt(int posn)
posn
- Table row where the object is to be obtained.
public boolean full()
public int numOccupied()
public boolean occupied(int i)
i
- The row number of the table to be checked.
public void drawClusters(java.awt.Graphics g, int x, int y)
g
- Graphical context of the drawing panel where the status
information is going to be shown.x
- The left most position of the status information display.y
- The top most position of the status information display.public void addTableEntry(java.lang.Object obj, int posn)
obj
- The new object to be added to the table.posn
- The position in the table (row) where the new object is to
be added.public int tableSize()
public boolean contains(java.lang.Object obj)
obj
- The object which is going to be checked for existence.
public int indexOf(java.lang.Object obj)
obj
- The object which location is being checked.
public java.awt.Dimension preferredSize()
public void update(java.awt.Graphics g)
repaint()
method of the panel is called. This method
is overridden here to eliminate the flashing characteristic during
the panel update.
public void paint(java.awt.Graphics g)
public void drawBox(java.awt.Graphics g, int x, int y, java.lang.String str, java.awt.Color fg, java.awt.Color bg, int max_length)
paint()
method to draw
each entry of the table as a box.
g
- Graphical context.x
- The left most position of the box.y
- The top most position of the box.str
- The String object to be drawn inside the box.fg
- Foreground color (i.e. the text color) of the box.bg
- Background color of the box.max_length
- The max_length of the string to be displayed in
the box.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |