private class ALDCollectionDataIOSwing.CollectionConfigWindow extends ALDSwingValueChangeReporter implements ActionListener, ALDSwingValueChangeListener
Modifier and Type | Field and Description |
---|---|
private JButton |
addButton
Button to add an element.
|
private JButton |
closeButton
Button to close the configuration window.
|
private Object |
defObject
Default collection object.
|
private JButton |
delButton
Button to delete an element;
|
private JButton |
downButton
Button to move an element downwards.
|
private Class<?> |
elemClass
Collection element class.
|
private LinkedList<ALDSwingComponent> |
elemComps
List of current GUI components in window.
|
private int |
elemCounter
Number of elements.
|
private Field |
elemField
Collection element field.
|
private Type |
elemFieldType
Collection element type.
|
private static int |
frameHeightMin
Fixed minimal height of the configuration window.
|
private static int |
frameWidthMin
Fixed minimal width of window.
|
private boolean |
isEnabled
Flag to remember if window is enabled or disabled.
|
private int |
lastAdded
Stores the index of last element added (may vary due to element swaps).
|
private JPanel |
mainPanel
Main panel of main frame.
|
private ALDParameterDescriptor |
paramDescriptor
Parameter descriptor of associated parameter.
|
private JScrollPane |
scroller
Scroller element for collection elements.
|
private JButton |
upButton
Button to move an element upwards.
|
private JFrame |
window
Main frame.
|
listenerList
Constructor and Description |
---|
CollectionConfigWindow(Field field,
Class<?> cl,
Object obj,
ALDParameterDescriptor descr)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
disableComponent()
Deactivates the configuration window to prohibit value changes.
|
void |
dispose()
Disposes this window and all sub-components.
|
void |
enableComponent()
Reactivates the configuration window to allow for value changes.
|
void |
handleValueChangeEvent(ALDSwingValueChangeEvent event)
Method which is called on event occurence.
|
Collection<?> |
readData(Field field,
Class<?> cl)
Extracts current collection data.
|
void |
setValue(Object value)
Updates current collection data.
|
private void |
updateWindow()
Updates the collection in the window.
|
addValueChangeEventListener, fireALDSwingValueChangeEvent, removeValueChangeEventListener
private static final int frameWidthMin
private static final int frameHeightMin
private JFrame window
private JPanel mainPanel
private JScrollPane scroller
private JButton addButton
private JButton delButton
private JButton upButton
private JButton downButton
private JButton closeButton
private boolean isEnabled
private int lastAdded
private Field elemField
private Type elemFieldType
private Class<?> elemClass
private Object defObject
private ALDParameterDescriptor paramDescriptor
private LinkedList<ALDSwingComponent> elemComps
private int elemCounter
public CollectionConfigWindow(Field field, Class<?> cl, Object obj, ALDParameterDescriptor descr)
field
- Field to specify input data objects.cl
- Class of collection elements.obj
- Initial value of collection.descr
- Optional descriptor for additional information.public Collection<?> readData(Field field, Class<?> cl)
field
- Field of collection elements.cl
- Class of collection elements.public void setValue(Object value)
value
- New value.public void disableComponent()
public void enableComponent()
public void dispose()
private void updateWindow()
This function is called each time an element is added or removed or if two elements have been swapped.
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void handleValueChangeEvent(ALDSwingValueChangeEvent event)
ALDSwingValueChangeListener
handleValueChangeEvent
in interface ALDSwingValueChangeListener
event
- Event to be handled.Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.