etomica.graphics
Class DeviceTable

java.lang.Object
  extended by etomica.graphics.Device
      extended by etomica.graphics.DeviceTable
All Implemented Interfaces:
GraphicalElement, Dimensioned

public class DeviceTable
extends Device

Presents a table of numeric properties that can be edited by typing in values.


Nested Class Summary
 
Nested classes/interfaces inherited from class etomica.graphics.Device
Device.ActionSet
 
Field Summary
 
Fields inherited from class etomica.graphics.Device
controller, unit
 
Constructor Summary
DeviceTable(String[] columnNames)
           
DeviceTable(TableModel tableModel)
           
 
Method Summary
 int[] getSelectedRows()
          Returns the indices of all the selected rows on the table.
 Component graphic(Object obj)
          Returns the top level panel that the table components sit on.
 void initCellEditor(TableModel tableModel)
           
static void main(String[] args)
          main method to demonstrate and test this class.
 void setPreferredSize(int width, int height)
          Set the preferred size attribute of the scrolled window the table sits on.
 void setSize(int width, int height)
          Set the size attribute of the scrolled window the table sits on.
 void setTitle(String title)
          Set the title of the border surrounding the table.
 
Methods inherited from class etomica.graphics.Device
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, graphic, setController, setPostAction, setPreAction, setUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceTable

public DeviceTable(String[] columnNames)

DeviceTable

public DeviceTable(TableModel tableModel)
Method Detail

initCellEditor

public void initCellEditor(TableModel tableModel)

setPreferredSize

public void setPreferredSize(int width,
                             int height)
Set the preferred size attribute of the scrolled window the table sits on.

Parameters:
width -
height -

setSize

public void setSize(int width,
                    int height)
Set the size attribute of the scrolled window the table sits on.

Parameters:
width -
height -

setTitle

public void setTitle(String title)
Set the title of the border surrounding the table.

Parameters:
title -

getSelectedRows

public int[] getSelectedRows()
Returns the indices of all the selected rows on the table.

Returns:
an array of integers containing the indices of all selected rows, or an empty array if no row is selected

graphic

public Component graphic(Object obj)
Returns the top level panel that the table components sit on.

Specified by:
graphic in interface GraphicalElement
Specified by:
graphic in class Device
Parameters:
obj - An object that might be used to specify the graphic that the GraphicalElement is to return. In most cases the GraphicalElement ignores this parameter, and it can be set to null.
Returns:
A Component that can be used in the GUI of a graphical simulation
See Also:
Device, Display

main

public static void main(String[] args)
main method to demonstrate and test this class.