All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class benno.awt.TableLabel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----benno.awt.TableLabel

public final class TableLabel
extends Panel
implements MouseListener, AdjustmentListener, ItemSelectable
This Component presents a horizontally scrollable table component.
The user may select a row.
A row may have an associated Object. The associated Object of the currently selected row can be determined using getCurrentObject().
The ItemSelectable interface is implemented to allow allow an ItemListener to detect when the selected row is changed.
This is based on ColumnLabel, and indeed much of the code of ColumnLabel is included at the end - some of this will be reused and the rest will be eventually tidied.

Version:
$Revision: 1.16 $
Author:
Ben Clifford

Constructor Index

 o TableLabel(int[])

Method Index

 o addActionListener(ActionListener)
 o addItemListener(ItemListener)
 o adjustmentValueChanged(AdjustmentEvent)
public Dimension getPreferredSize() { return getMinimumSize(); }
 o appendRow(String[])
Appends a row to the end of the table, without associating an object with that row.
 o appendRow(String[], Object)
Appends a row to the end of the table, associating an object with that row.
 o clearRows()
removes all the rows from the table
 o getCurrentObject()
 o getMaximumSize()
 o getMinimumSize()
 o getPreferredSize()
 o getSelectedObjects()
This thunks getCurrentObject into the appropriate format for ItemSelectable.
 o mouseClicked(MouseEvent)
 o mouseEntered(MouseEvent)
 o mouseExited(MouseEvent)
 o mousePressed(MouseEvent)
 o mouseReleased(MouseEvent)
 o old_getPreferredSize()
 o old_paint(Graphics)
 o paint(Graphics)
 o removeItemListener(ItemListener)
 o set(int, int, String)
 o setOutline(boolean)
 o setSize(Dimension)
 o setSize(int, int)

Constructors

 o TableLabel
 public TableLabel(int c[])

Methods

 o setSize
 public void setSize(int w,
                     int h)
Overrides:
setSize in class Component
 o setSize
 public void setSize(Dimension d)
Overrides:
setSize in class Component
 o clearRows
 public void clearRows()
removes all the rows from the table

 o appendRow
 public void appendRow(String s[])
Appends a row to the end of the table, without associating an object with that row.

Parameters:
s - The column entries for the row
 o appendRow
 public void appendRow(String s[],
                       Object o)
Appends a row to the end of the table, associating an object with that row.

Parameters:
s - The column entries for the row
o - The object to associate with the row
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Container
 o getMaximumSize
 public Dimension getMaximumSize()
Overrides:
getMaximumSize in class Container
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Container
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)
public Dimension getPreferredSize() { return getMinimumSize(); }

 o getCurrentObject
 public Object getCurrentObject()
 o getSelectedObjects
 public Object[] getSelectedObjects()
This thunks getCurrentObject into the appropriate format for ItemSelectable.

 o mouseClicked
 public void mouseClicked(MouseEvent e)
 o mouseEntered
 public void mouseEntered(MouseEvent e)
 o mouseExited
 public void mouseExited(MouseEvent e)
 o mousePressed
 public void mousePressed(MouseEvent e)
 o mouseReleased
 public void mouseReleased(MouseEvent e)
 o set
 public void set(int r,
                 int c,
                 String s)
 o addActionListener
 public void addActionListener(ActionListener a)
 o addItemListener
 public void addItemListener(ItemListener i)
 o removeItemListener
 public void removeItemListener(ItemListener i)
 o setOutline
 public void setOutline(boolean b)
 o old_paint
 public void old_paint(Graphics g)
 o old_getPreferredSize
 public Dimension old_getPreferredSize()

All Packages  Class Hierarchy  This Package  Previous  Next  Index