javawrapper::EnhancedTable Class Reference

Provides extensions and customizations for JTable. More...

List of all members.

Public Member Functions

String GetTitle ()
 Gets the title for this table.
void SetLastTouched (boolean bTouched)
 Sets whether or not this was the last table touched by the user.
boolean GetLastTouched ()
 Gets whether or not this was the last table touched by the user.
void actionPerformed (ActionEvent e)
 Responds to our designated action events.
void focusGained (FocusEvent e)
 Sets this table as the last one focused.
void focusLost (FocusEvent e)
 This removes focus highlighting.
int Copy ()
 Copies selected data to the clipboard.
void Cut ()
 Cuts selected data.
void Paste ()
 Pastes data to the table.

Protected Member Functions

void MakeTable (Object[][] p_oData, Object[] p_oHeader)
 Performs all table formatting.

Package Functions

 EnhancedTable (Object[][] p_oData, Object[] p_oHeader, EnhancedTableWindow oWindow, int iFirstColumnWidth, int iColumnWidth, int iLabelRows, String sTitle)
 Constructor.
 EnhancedTable (Object[][] p_oData, Object[] p_oHeader, EnhancedTableWindow oWindow, String sTitle)
 Constructor.

Static Package Functions

static String GetComboValue (String sComboBoxVal)
 Extracts the value from a combo box format string.

Private Attributes

Clipboard m_jClipboard
 For clipboard controls.
String m_sRowString
 For clipboard operations.
String m_sValue
 For clipboard operations.
String m_sTitle
 Title.
StringSelection m_sStringSel
 For clipboard operations.
boolean m_bLastTouched
 Whether or not this was the last table brought into focus by the user - needed when trying to decipher intent when implementing menu copy/paste commands.
EnhancedTableWindow m_oWindow
 The parent window.
int m_iFirstColumnWidth = 200
 Preferred width of the first column (row labels).
int m_iColumnWidth = 100
 Preferred width of the data columns.
int m_iLabelRows = 2
 Lines of text allowed in the first column (row labels).


Detailed Description

Provides extensions and customizations for JTable.

These include copy/paste and cut controls, like Excel, special formatting, and support for drop-down combo boxes for editing cells.

This table assumes that it will not be displayed in a scroll pane. Copyright: Copyright (c) Charles D. Canham 2003 Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Constructor & Destructor Documentation

javawrapper::EnhancedTable::EnhancedTable ( Object  p_oData[][],
Object[]  p_oHeader,
EnhancedTableWindow  oWindow,
int  iFirstColumnWidth,
int  iColumnWidth,
int  iLabelRows,
String  sTitle 
) [inline, package]

Constructor.

This allows more control over table formatting.

Parameters:
p_oData Object[][] Table data.
p_oHeader Object[] Header data.
oWindow EnhancedTableWindow Parent window.
iFirstColumnWidth int Width of first column (the row labels).
iColumnWidth int Width of all data columns.
iLabelRows int Number of rows for the first column row labels.
sTitle The title of the "owning" behavior group

javawrapper::EnhancedTable::EnhancedTable ( Object  p_oData[][],
Object[]  p_oHeader,
EnhancedTableWindow  oWindow,
String  sTitle 
) [inline, package]

Constructor.

Parameters:
p_oData Table data.
p_oHeader Header data.
oWindow Parent window.
sTitle The title of the "owning" behavior group.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Function Documentation

void javawrapper::EnhancedTable::actionPerformed ( ActionEvent  e  )  [inline]

Responds to our designated action events.

Parameters:
e The event which triggered the action listener.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

int javawrapper::EnhancedTable::Copy (  )  [inline]

Copies selected data to the clipboard.

Selections comprising non-adjacent cells result in invalid selection and then copy action cannot be performed.

I got this from http://www.javaworld.com/javaworld/javatips/jw-javatip77.html, and then modified it a bit.

Returns:
-1 if an error occurred.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::EnhancedTable::Cut (  )  [inline]

Cuts selected data.

The data is copied to the clipboard and then erased from editable cells. Combo boxes are left alone.


Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::EnhancedTable::focusGained ( FocusEvent  e  )  [inline]

Sets this table as the last one focused.

Parameters:
e FocusEvent object. Ignored.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::EnhancedTable::focusLost ( FocusEvent  e  )  [inline]

This removes focus highlighting.

Parameters:
e FocusEvent object. Ignored.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

static String javawrapper::EnhancedTable::GetComboValue ( String  sComboBoxVal  )  [inline, static, package]

Extracts the value from a combo box format string.

Parameters:
sComboBoxVal String in combo box format code.
Returns:
The currently selected value.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

boolean javawrapper::EnhancedTable::GetLastTouched (  )  [inline]

Gets whether or not this was the last table touched by the user.

Returns:
Last touched status.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

String javawrapper::EnhancedTable::GetTitle (  )  [inline]

Gets the title for this table.

Returns:
String Title for this table

void javawrapper::EnhancedTable::MakeTable ( Object  p_oData[][],
Object[]  p_oHeader 
) [inline, protected]

Performs all table formatting.

Parameters:
p_oData Object[][] Table data.
p_oHeader Object[] Header data.

void javawrapper::EnhancedTable::Paste (  )  [inline]

Pastes data to the table.

Combo boxes and uneditable cells are left alone. Paste is done by aligning the upper left corner of the clipboard selection with the 1st element in the current selection of the JTable.

I got this from http://www.javaworld.com/javaworld/javatips/jw-javatip77.html, and then modified it a bit.


Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::EnhancedTable::SetLastTouched ( boolean  bTouched  )  [inline]

Sets whether or not this was the last table touched by the user.

Parameters:
bTouched Last touched status.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


The documentation for this class was generated from the following file:
Generated on Wed Nov 29 08:45:03 2006 for SORTIE Java Interface by  doxygen 1.4.7