|
||||||||
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.ALDNativeArray1DDataIOSwing.ArrayConfigWindow
private class ALDNativeArray1DDataIOSwing.ArrayConfigWindow
Graphical user interface window for displaying
objects of class ALDTableModel
.
Nested Class Summary | |
---|---|
protected class |
ALDNativeArray1DDataIOSwing.ArrayConfigWindow.DataTabFileFilter
Internal class that realizes a java.swing.filechooser.FileFilter
for text files where MiToBo table data is stored. |
protected class |
ALDNativeArray1DDataIOSwing.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 boolean |
disableValueChecks
Flag to disable entry validation checks. |
private java.lang.Class<?> |
elementClass
Class that table entries should represent. |
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 frame. |
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 | |
---|---|
ALDNativeArray1DDataIOSwing.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<java.lang.Integer> 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 newSize)
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,
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)
Fills the table with specified values. |
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 boolean disableValueChecks
Note that this flag is only valid for next event appearing. While processing the event the flag is reset to false.
private java.lang.Class<?> elementClass
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 ALDNativeArray1DDataIOSwing.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<java.lang.Integer> 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 newSize)
Existing entries are preserved as far as possible.
newSize
- New size 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, java.lang.Class<?> cl)
row
- Row to set.cl
- Class of table elements.private void setupTable()
public void setValue(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object value)
field
- Field specifying type of data.cl
- Class of array entries.value
- Value to set.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 |