de.unihalle.informatik.Alida.dataio.provider.swing
Class ALDParametrizedClassDataIOSwing

java.lang.Object
  extended by de.unihalle.informatik.Alida.dataio.provider.swing.ALDParametrizedClassDataIOSwing
All Implemented Interfaces:
ALDDataIO, ALDDataIOSwing

@ALDDataIOProvider
public class ALDParametrizedClassDataIOSwing
extends java.lang.Object
implements ALDDataIOSwing

Class for generic handling of parameterized classes in GUI.

This class implements the ALDDataIOSwing interface for parametrized classes. It provides a button linked to a configuration window that subsumes all parameters of the class to configure.

Author:
moeller

Constructor Summary
ALDParametrizedClassDataIOSwing()
          Default constructor.
 
Method Summary
 de.unihalle.informatik.Alida.dataio.provider.swing.ALDParametrizedClassDataIOSwing.ParametrizedClassPanel createGUIElement(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object obj, ALDParameterDescriptor descr)
          Interface method to create a GUI element for data input.
 java.util.Collection<java.lang.Class<?>> providedClasses()
          Interface method to announce class for which IO is provided for.
 java.lang.Object readData(java.lang.reflect.Field field, java.lang.Class<?> cl, ALDSwingComponent guiElement)
          Interface method for getting parameter values via a GUI element.
 void setValue(java.lang.reflect.Field field, java.lang.Class<?> cl, ALDSwingComponent guiElement, java.lang.Object value)
          Interface method for setting new parameter values in GUI.
 javax.swing.JComponent writeData(java.lang.Object obj, ALDParameterDescriptor descr)
          Interface method for displaying an object in the GUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALDParametrizedClassDataIOSwing

public ALDParametrizedClassDataIOSwing()
Default constructor.

Method Detail

providedClasses

public java.util.Collection<java.lang.Class<?>> providedClasses()
Interface method to announce class for which IO is provided for.

Specified by:
providedClasses in interface ALDDataIO
Returns:
Collection of classes provided.

createGUIElement

public de.unihalle.informatik.Alida.dataio.provider.swing.ALDParametrizedClassDataIOSwing.ParametrizedClassPanel createGUIElement(java.lang.reflect.Field field,
                                                                                                                                  java.lang.Class<?> cl,
                                                                                                                                  java.lang.Object obj,
                                                                                                                                  ALDParameterDescriptor descr)
                                                                                                                           throws ALDDataIOProviderException
Description copied from interface: ALDDataIOSwing
Interface method to create a GUI element for data input.

Optionally an object may be supplied which is assumed to be of type cl and used as default.

Specified by:
createGUIElement in interface ALDDataIOSwing
cl - Class of object to be returned.
obj - The value of this object to be set as inital value.
descr - Optional descriptor to hand over additional information.
Returns:
Alida GUI component to input values.
Throws:
ALDDataIOProviderException

setValue

public void setValue(java.lang.reflect.Field field,
                     java.lang.Class<?> cl,
                     ALDSwingComponent guiElement,
                     java.lang.Object value)
              throws ALDDataIOProviderException
Description copied from interface: ALDDataIOSwing
Interface method for setting new parameter values in GUI.

Specified by:
setValue in interface ALDDataIOSwing
Parameters:
field - Field of parameter object to be handled.
cl - Class of parameter object to be handled.
guiElement - Corresponding GUI element.
value - New value of the parameter.
Throws:
ALDDataIOProviderException

readData

public java.lang.Object readData(java.lang.reflect.Field field,
                                 java.lang.Class<?> cl,
                                 ALDSwingComponent guiElement)
                          throws ALDDataIOProviderException
Description copied from interface: ALDDataIOSwing
Interface method for getting parameter values via a GUI element.

Specified by:
readData in interface ALDDataIOSwing
Parameters:
field - Field associated with object to be returned.
cl - Class of object to be returned.
guiElement - Component from where to read data.
Returns:
Object read from source, might be null.
Throws:
ALDDataIOProviderException

writeData

public javax.swing.JComponent writeData(java.lang.Object obj,
                                        ALDParameterDescriptor descr)
Description copied from interface: ALDDataIOSwing
Interface method for displaying an object in the GUI.

Specified by:
writeData in interface ALDDataIOSwing
Parameters:
obj - Object to be displayed or saved.
descr - Optional descriptor to hand over additional information.


Copyright © 2010-2014 Martin Luther University Halle-Wittenberg. All Rights Reserved.