de.unihalle.informatik.Alida.dataio.provider.swing
Class ALDCollectionDataIOSwing.CollectionConfigWindow

java.lang.Object
  extended by de.unihalle.informatik.Alida.dataio.provider.swing.ALDCollectionDataIOSwing.CollectionConfigWindow
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Enclosing class:
ALDCollectionDataIOSwing

 class ALDCollectionDataIOSwing.CollectionConfigWindow
extends java.lang.Object
implements java.awt.event.ActionListener

Collection configuration window.

Author:
moeller

Field Summary
private  java.lang.Object defObject
          Default collection object.
private  java.lang.Class<?> elemClass
          Collection element class.
private  java.util.LinkedList<javax.swing.JComponent> elemComps
          List of current GUI components in window.
private  int elemCounter
          Number of elements.
private  java.lang.reflect.Field elemField
          Collection element field.
private  java.lang.reflect.Type elemFieldType
          Collection element type.
private  int frameWidth
          Fixed width of window.
private  int lastAdded
          Stores the index of last element added (may vary due to element swaps).
private  javax.swing.JPanel mainPanel
          Main panel of main frame.
private  javax.swing.JFrame window
          Main frame.
 
Constructor Summary
ALDCollectionDataIOSwing.CollectionConfigWindow(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object obj)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 java.util.Collection<?> readData(java.lang.reflect.Field field, java.lang.Class<?> cl)
          Extracts current collection data.
 void setValue(java.lang.Object value)
          Updates current collection data.
private  void updateWindow()
          Updates the collection in the window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defObject

private java.lang.Object defObject
Default collection object.


elemClass

private java.lang.Class<?> elemClass
Collection element class.


elemComps

private java.util.LinkedList<javax.swing.JComponent> elemComps
List of current GUI components in window.


elemCounter

private int elemCounter
Number of elements.


elemField

private java.lang.reflect.Field elemField
Collection element field.


elemFieldType

private java.lang.reflect.Type elemFieldType
Collection element type.


frameWidth

private final int frameWidth
Fixed width of window.

See Also:
Constant Field Values

lastAdded

private int lastAdded
Stores the index of last element added (may vary due to element swaps).


mainPanel

private javax.swing.JPanel mainPanel
Main panel of main frame.


window

private javax.swing.JFrame window
Main frame.

Constructor Detail

ALDCollectionDataIOSwing.CollectionConfigWindow

public ALDCollectionDataIOSwing.CollectionConfigWindow(java.lang.reflect.Field field,
                                                       java.lang.Class<?> cl,
                                                       java.lang.Object obj)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

readData

public java.util.Collection<?> readData(java.lang.reflect.Field field,
                                        java.lang.Class<?> cl)
Extracts current collection data.

Parameters:
field - Field of collection elements.
cl - Class of collection elements.
Returns:
Current collection.

setValue

public void setValue(java.lang.Object value)
Updates current collection data.

Parameters:
value - New value.

updateWindow

private void updateWindow()
Updates the collection in the window.

This function is called each time an element is added or removed or if two elements have been swapped.