fr.emn.reactiveinput
Class OpenContext

java.lang.Object
  extended byfr.emn.reactiveinput.OpenContext

public class OpenContext
extends java.lang.Object

Some devices may need a context to open. For example, devices that display themselves on a swing window will need a JFrame as context. OpenContexts are set in Configuration constructor.

example: myconfig = new Configuration(new OpenContext("JFrame", myframe));


Field Summary
static java.lang.String KEY_JFRAME
           
 
Constructor Summary
OpenContext()
          Creates an empty context
OpenContext(javax.swing.JFrame frameValue)
          Creates a context and sets its KEY_JFRAME value
OpenContext(java.lang.String key, java.lang.Object value)
          Creates a context and sets a value
 
Method Summary
 void add(OpenContext context)
          Concatenates an OpenContext to this context.
 javax.swing.JFrame getJFrameValue()
          Returns the value of KEY_JFRAME
 java.lang.Object getValue(java.lang.String key)
          Returns a value, null if no value is assigned to the key
 void setValue(java.lang.String key, java.lang.Object value)
          Sets a value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_JFRAME

public static final java.lang.String KEY_JFRAME
See Also:
Constant Field Values
Constructor Detail

OpenContext

public OpenContext()
Creates an empty context


OpenContext

public OpenContext(java.lang.String key,
                   java.lang.Object value)
Creates a context and sets a value


OpenContext

public OpenContext(javax.swing.JFrame frameValue)
Creates a context and sets its KEY_JFRAME value

Method Detail

setValue

public void setValue(java.lang.String key,
                     java.lang.Object value)
Sets a value


getValue

public java.lang.Object getValue(java.lang.String key)
Returns a value, null if no value is assigned to the key


getJFrameValue

public javax.swing.JFrame getJFrameValue()
Returns the value of KEY_JFRAME


add

public void add(OpenContext context)
Concatenates an OpenContext to this context. Values with the same key are replaced.