|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter
de.unihalle.informatik.Alida.dataio.provider.swing.ALDNativeArray2DDataIOSwing.ArrayConfigWindow
private class ALDNativeArray2DDataIOSwing.ArrayConfigWindow
Graphical user interface window for displaying
objects of class DefaultTableModel
.
Nested Class Summary | |
---|---|
protected class |
ALDNativeArray2DDataIOSwing.ArrayConfigWindow.DataTabFileFilter
Internal class that realizes a FileFilter for text files where MiToBo table data is stored. |
protected class |
ALDNativeArray2DDataIOSwing.ArrayConfigWindow.TableFocusListener
Focus listener to commit edits if table looses the focus. |
Field Summary | |
---|---|
protected javax.swing.JTable |
dataTab
Data table (swing tables are nicer than imageJ tables). |
private javax.swing.table.DefaultTableModel |
dataTabModel
Reference object to the data. |
private ALDParameterDescriptor |
descriptor
Optional descriptor for additional information on parameter. |
private java.lang.Class<?> |
entryClass
Class of objects to be filled in the table. |
private java.lang.Object[][] |
entryRefList
List of currently specified values (to restore entry if check fails). |
private java.io.File |
lastDir
For convenience: always open last directory for saving. |
private javax.swing.JScrollPane |
tableScroller
Scrollpane for table panel; |
private javax.swing.JPanel |
tabPanel
Table component in window. |
private javax.swing.JFrame |
window
Main window. |
protected boolean |
windowHasFocus
Flag to indicate the table window has the focus. |
Fields inherited from class de.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter |
---|
listenerList |
Constructor Summary | |
---|---|
ALDNativeArray2DDataIOSwing.ArrayConfigWindow(java.lang.reflect.Field field,
java.lang.Class<?> cl,
java.lang.Object obj,
ALDParameterDescriptor descr)
Default constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
private void |
errorListToMessage(java.util.LinkedList<int[]> errorList)
Error function displaying an error message box. |
java.lang.Object |
readData(java.lang.reflect.Field field,
java.lang.Class<?> cl)
|
protected void |
resizeTableEntries(int newRows,
int newCols)
Method to resize the reference entry list. |
protected void |
saveTable()
Saves the contents of the table to a user-specified file. |
protected void |
setTabEntryToDefault(int row,
int col,
java.lang.Class<?> cl)
Sets the specified table entry to the class default. |
private void |
setupTable()
Initializes the data table window. |
void |
setValue(java.lang.reflect.Field field,
java.lang.Class<?> cl,
java.lang.Object value)
|
void |
tableChanged(javax.swing.event.TableModelEvent e)
|
protected boolean |
validateEntry(java.lang.Class<?> cl,
java.lang.String entry)
Checks if a string can be cast to the desired class. |
Methods inherited from class de.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter |
---|
addValueChangeEventListener, fireALDSwingValueChangeEvent, removeValueChangeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.swing.JTable dataTab
private javax.swing.table.DefaultTableModel dataTabModel
private ALDParameterDescriptor descriptor
private java.lang.Class<?> entryClass
private java.lang.Object[][] entryRefList
private java.io.File lastDir
private javax.swing.JScrollPane tableScroller
private javax.swing.JPanel tabPanel
private javax.swing.JFrame window
protected boolean windowHasFocus
By this multiple warnings on the same issue should be avoided. They might happen due to table change events and focus change events being triggered at the same time.
Constructor Detail |
---|
public ALDNativeArray2DDataIOSwing.ArrayConfigWindow(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object obj, ALDParameterDescriptor descr)
field
- Field of array.cl
- Class of array elements.obj
- Default values.Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
private void errorListToMessage(java.util.LinkedList<int[]> errorList) throws ALDDataIOProviderException
r
- Row of table where error occured.c
- Column of table where error occured.
ALDDataIOProviderException
public java.lang.Object readData(java.lang.reflect.Field field, java.lang.Class<?> cl) throws ALDDataIOProviderException
ALDDataIOProviderException
protected void resizeTableEntries(int newRows, int newCols)
Existing entries are preserved as far as possible.
newRows
- New number of rows for the table.newCols
- New number of cols for the table.protected void saveTable()
The file format is TSV, i.e. tabulator-separated values. The default ending is '.txt'. The user can select the file name through a file open dialog which pops-up on call of the function.
protected void setTabEntryToDefault(int row, int col, java.lang.Class<?> cl)
row
- Row index.col
- Column index.cl
- Class of table elements.private void setupTable()
public void setValue(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object value)
public void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged
in interface javax.swing.event.TableModelListener
protected boolean validateEntry(java.lang.Class<?> cl, java.lang.String entry)
cl
- Target class.entry
- String under consideration.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |