SORTIE Java Interface
1
|
Provides extensions and customizations for JTable. More...
Public Member Functions | |
EnhancedTable (Object[][] p_oData, Object[] p_oHeader, EnhancedTableWindow oWindow, int iFirstColumnWidth, int iColumnWidth, int iLabelRows, String sTitle) | |
Constructor. More... | |
EnhancedTable (Object[][] p_oData, Object[] p_oHeader, EnhancedTableWindow oWindow, String sTitle) | |
Constructor. More... | |
String | getTitle () |
Gets the title for this table. More... | |
void | setLastTouched (boolean bTouched) |
Sets whether or not this was the last table touched by the user. More... | |
boolean | getLastTouched () |
Gets whether or not this was the last table touched by the user. More... | |
TableData | getData () |
void | actionPerformed (ActionEvent e) |
Responds to our designated action events. More... | |
void | focusGained (FocusEvent e) |
Sets this table as the last one focused. More... | |
void | focusLost (FocusEvent e) |
This removes focus highlighting. More... | |
int | copy () |
Copies selected data to the clipboard. More... | |
void | cut () |
Cuts selected data. More... | |
void | paste () |
Pastes data to the table. More... | |
Static Public Member Functions | |
static String | getComboValue (String sComboBoxVal) |
Extracts the value from a combo box format string. More... | |
Protected Member Functions | |
void | makeTable (Object[][] p_oData, Object[] p_oHeader) |
Performs all table formatting. More... | |
Private Attributes | |
Clipboard | m_jClipboard |
For clipboard controls. More... | |
String | m_sRowString |
For clipboard operations. More... | |
String | m_sValue |
For clipboard operations. More... | |
String | m_sTitle |
Title. More... | |
StringSelection | m_sStringSel |
For clipboard operations. More... | |
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. More... | |
EnhancedTableWindow | m_oWindow |
The parent window. More... | |
int | m_iFirstColumnWidth = 200 |
Preferred width of the first column (row labels) More... | |
int | m_iColumnWidth = 100 |
Preferred width of the data columns. More... | |
int | m_iLabelRows = 2 |
Lines of text allowed in the first column (row labels) More... | |
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: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
sortie.gui.behaviorsetup.EnhancedTable.EnhancedTable | ( | Object | p_oData[][], |
Object [] | p_oHeader, | ||
EnhancedTableWindow | oWindow, | ||
int | iFirstColumnWidth, | ||
int | iColumnWidth, | ||
int | iLabelRows, | ||
String | sTitle | ||
) |
Constructor.
This allows more control over table formatting.
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 |
sortie.gui.behaviorsetup.EnhancedTable.EnhancedTable | ( | Object | p_oData[][], |
Object [] | p_oHeader, | ||
EnhancedTableWindow | oWindow, | ||
String | sTitle | ||
) |
Constructor.
p_oData | Table data. |
p_oHeader | Header data. |
oWindow | Parent window. |
sTitle | The title of the "owning" behavior group. |
void sortie.gui.behaviorsetup.EnhancedTable.actionPerformed | ( | ActionEvent | e | ) |
Responds to our designated action events.
e | The event which triggered the action listener. |
int sortie.gui.behaviorsetup.EnhancedTable.copy | ( | ) |
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 code from a now-defunct website, and then modified it a bit.
void sortie.gui.behaviorsetup.EnhancedTable.cut | ( | ) |
Cuts selected data.
The data is copied to the clipboard and then erased from editable cells. Combo boxes are left alone.
void sortie.gui.behaviorsetup.EnhancedTable.focusGained | ( | FocusEvent | e | ) |
Sets this table as the last one focused.
e | FocusEvent object. Ignored. |
void sortie.gui.behaviorsetup.EnhancedTable.focusLost | ( | FocusEvent | e | ) |
This removes focus highlighting.
e | FocusEvent object. Ignored. |
|
static |
Extracts the value from a combo box format string.
sComboBoxVal | String in combo box format code. |
TableData sortie.gui.behaviorsetup.EnhancedTable.getData | ( | ) |
boolean sortie.gui.behaviorsetup.EnhancedTable.getLastTouched | ( | ) |
Gets whether or not this was the last table touched by the user.
String sortie.gui.behaviorsetup.EnhancedTable.getTitle | ( | ) |
Gets the title for this table.
|
protected |
Performs all table formatting.
p_oData | Object[][] Table data. |
p_oHeader | Object[] Header data. |
void sortie.gui.behaviorsetup.EnhancedTable.paste | ( | ) |
Pastes data to the table.
Combo boxes are validated against allowed values. 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 a now-defunct website, and then modified it a bit.
void sortie.gui.behaviorsetup.EnhancedTable.setLastTouched | ( | boolean | bTouched | ) |
Sets whether or not this was the last table touched by the user.
bTouched | Last touched status. |
|
private |
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.
|
private |
Preferred width of the data columns.
|
private |
Preferred width of the first column (row labels)
|
private |
Lines of text allowed in the first column (row labels)
|
private |
For clipboard controls.
|
private |
The parent window.
|
private |
For clipboard operations.
|
private |
For clipboard operations.
|
private |
Title.
|
private |
For clipboard operations.