context.arch.generator
Class PositionIButton
java.lang.Object
|
+--context.arch.generator.PositionIButton
- public class PositionIButton
- extends java.lang.Object
- implements com.ibutton.oc.JibMultiListener
This class acts as a wrapper around a Java iButton reader. Whenever
an iButton docks with the reader, the location of the reader, the
iButton id and the docking timestamp are stored and made available
to the context-aware infrastructure for polling, and can notify
context widgets when data changes.
- See Also:
JibMultiListener
,
Widget
Constructor Summary |
PositionIButton(java.lang.String location)
Constructor that allows this object to handle iButton events and
starts listening to the iButton reader. |
PositionIButton(Widget widget,
java.lang.String location)
Constructor that allows this object to handle iButton events and
starts listening to the iButton reader. |
Method Summary |
void |
iButtonInserted(com.ibutton.oc.JibMultiEvent event)
This method is called by the card terminal driver to let us know that a
Button insertion has been detected. |
void |
iButtonRemoved(com.ibutton.oc.JibMultiEvent event)
This method is called by the card terminal driver to let us know that a
Button removal has been detected. |
IButtonData |
pollData()
This method supports polling of the IButton data. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PositionIButton
public PositionIButton(Widget widget,
java.lang.String location)
- Constructor that allows this object to handle iButton events and
starts listening to the iButton reader. It sets the location of
the IButton reader and sets the context widget to notify when an
IButton docks.
- Parameters:
widget
- Widget to notify when an IButton dockslocation
- Place where this iButton reader is installed- See Also:
JibMultiFactory
,
com.ibutton.oc.JibMultiFactory#addJiBListener(com.ibutton.oc.terminal.jib.JibMultiListener)
,
JibMultiFactory.startPolling(boolean)
PositionIButton
public PositionIButton(java.lang.String location)
- Constructor that allows this object to handle iButton events and
starts listening to the iButton reader. It sets the location of the
IButton reader.
- Parameters:
location
- Place where this iButton reader is installed
iButtonInserted
public void iButtonInserted(com.ibutton.oc.JibMultiEvent event)
- This method is called by the card terminal driver to let us know that a
Button insertion has been detected. It stores the information locally
and notifies the registered Widget object, if available, of the
new data.
- Specified by:
- iButtonInserted in interface com.ibutton.oc.JibMultiListener
- Parameters:
event
- Event that indicates an iButton has been inserted- See Also:
Widget.notify(java.lang.String,java.lang.Object)
,
com.ibutton.oc.terminal.jib.JibMultiEvent
iButtonRemoved
public void iButtonRemoved(com.ibutton.oc.JibMultiEvent event)
- This method is called by the card terminal driver to let us know that a
Button removal has been detected. It just prints a message to
the screen.
- Specified by:
- iButtonRemoved in interface com.ibutton.oc.JibMultiListener
- Parameters:
event
- Event that indicates an iButton has been removed- See Also:
com.ibutton.oc.terminal.jib.JibMultiEvent
pollData
public IButtonData pollData()
- This method supports polling of the IButton data. It returns an IButtonData object
containing the most recent docking information.
- Returns:
- IButtonData object containing the most recent docking information