|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.dataio.ALDDataIOManager
de.unihalle.informatik.Alida.dataio.ALDDataIOManagerSwing
public class ALDDataIOManagerSwing
This class implements a DataIO mangager for reading/writing from a graphical user interface.
For IO, it essentially looks up the correct provider for GUI-based execution using the method of its super class and invokes its method.
It does its work in collaboration with
ALDDataIOSwing
.
Nested Class Summary | |
---|---|
static class |
ALDDataIOManagerSwing.ProviderInteractionLevel
Levels to enable/disable interactive provider behaviour. |
Field Summary | |
---|---|
(package private) static ALDDataIOManagerSwing |
instance
The singleton instance of this class |
private ALDDataIOManagerSwing.ProviderInteractionLevel |
provInterLevel
Interaction level the providers should obey. |
private boolean |
triggerValueChangeEvents
Flag to indicate if change value events should be triggered or not. |
Fields inherited from class de.unihalle.informatik.Alida.dataio.ALDDataIOManager |
---|
debug, mapTable |
Constructor Summary | |
---|---|
private |
ALDDataIOManagerSwing()
private constructor |
Method Summary | |
---|---|
ALDSwingComponent |
createGUIElement(java.lang.reflect.Field field,
java.lang.Class<?> cl,
java.lang.Object obj,
ALDParameterDescriptor descr)
Create a gui element which may be used to request the user to input data of class cl . |
static ALDDataIOManagerSwing |
getInstance()
Return the single instance of this class |
ALDDataIOManagerSwing.ProviderInteractionLevel |
getProviderInteractionLevel()
Returns the current level of provider interaction. |
boolean |
isTriggerValueChangeEvents()
Returns value of event trigger flag. |
java.lang.Object |
readData(java.lang.reflect.Field field,
java.lang.Class<?> cl,
ALDSwingComponent guiElement)
Reads data of given class from a specified source. |
void |
setProviderInteractionLevel(ALDDataIOManagerSwing.ProviderInteractionLevel level)
Set the level of provider interaction which is allowed. |
void |
setTriggerValueChangeEvents(boolean b)
Set the value change event trigger flag. |
void |
setValue(java.lang.reflect.Field field,
java.lang.Class<?> cl,
ALDSwingComponent guiElement,
java.lang.Object value)
Update the value of a parameter in the GUI component. |
javax.swing.JComponent |
writeData(java.lang.Object obj,
ALDParameterDescriptor descr)
Return a gui element displaying the obj or null. |
Methods inherited from class de.unihalle.informatik.Alida.dataio.ALDDataIOManager |
---|
getProvider, getProviderMap, initMapTable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final ALDDataIOManagerSwing instance
private ALDDataIOManagerSwing.ProviderInteractionLevel provInterLevel
private boolean triggerValueChangeEvents
Constructor Detail |
---|
private ALDDataIOManagerSwing()
Method Detail |
---|
public ALDSwingComponent createGUIElement(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.Object obj, ALDParameterDescriptor descr) throws ALDDataIOException
cl
.
This element may later be forwarded to readData
to
extract an object representig this data.
Null may be returned if no provider was found.
Additionally an object may be supplied which is assumed to be of type cl
.
If it is non-null its value may be used to set up an inital value in the gui element.
cl
- Class of data to be read.obj
- The value of this object to set as inital value.descr
- Optional descriptor to hand over additional information.
ALDDataIOException
public static ALDDataIOManagerSwing getInstance()
public ALDDataIOManagerSwing.ProviderInteractionLevel getProviderInteractionLevel()
public boolean isTriggerValueChangeEvents()
public java.lang.Object readData(java.lang.reflect.Field field, java.lang.Class<?> cl, ALDSwingComponent guiElement) throws ALDDataIOException
cl
- Class of data to be read.guiElement
- gui element from where to read data.
ALDDataIOException
public void setProviderInteractionLevel(ALDDataIOManagerSwing.ProviderInteractionLevel level)
level
- New level of interaction providers have to obey.public void setTriggerValueChangeEvents(boolean b)
b
- New value of the event trigger flag.public void setValue(java.lang.reflect.Field field, java.lang.Class<?> cl, ALDSwingComponent guiElement, java.lang.Object value) throws ALDDataIOException
field
- Related field of parameter to be updated.cl
- Class of object to be handled.guiElement
- Corresponding GUI element.value
- New value to be set.
ALDDataIOException
- TODO BM: Rückgabe-Wert der Provider sollte bei Fehler nicht Null sein!public javax.swing.JComponent writeData(java.lang.Object obj, ALDParameterDescriptor descr) throws ALDDataIOException
obj
or null.
In the latter case the obj may have been shown otherwise, e.g. in an
own window.
obj
- Object to write.descr
- Optional descriptor to hand over additional information.
ALDDataIOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |