|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.channel.oob.ButtonChannelImpl
public abstract class ButtonChannelImpl
This class defines a broad interface which allows
to implement the different button channels. Each
platform that supports button channels should derive
and implement a platform specific variant of this class.
If a platform can't implement a specific method (e.g.
vibrate), it should do nothing (empty method body)
and shouldn't be called by an application.
For all graphical operations (displaying a signal or a
progress bar etc.) the usage of this class works as follows:
All operations just manipulate the internal state and have no
immediate effect on the screen. The changes become visible on screen
after the next call to the repaint method.
| Field Summary | |
|---|---|
protected IntervalList |
intervalList
An IntervalList used to draw
the progress bar. |
protected Log |
logger
Logger instance. |
protected boolean |
prepareSignal
Should a hint to a following signal currently be displayed? |
protected float |
progress
Progress of the progress bar in %. |
protected boolean |
showCount
Should the signalCount be displayed on screen? |
protected boolean |
showSignal
Should the signal currently be displayed? |
protected int |
signalCount
Number of already processed (sent or received) signals/button inputs. |
protected int |
transmissionMode
transmissionMode is one of the
TRANSMIT_* constants defined in this class. |
static int |
TRANSMIT_BAR
Transmission mode: progress bar. |
static int |
TRANSMIT_PLAIN
Transmission mode: plain (simply display text). |
static int |
TRANSMIT_SIGNAL
Transmission mode: signal. |
static int |
TRANSMIT_TRAFFIC_LIGHT
Transmission mode: traffic light. |
static int |
TRANSMIT_VERT_BARS
Transmission mode: power bar. |
| Constructor Summary | |
|---|---|
ButtonChannelImpl()
|
|
| Method Summary | |
|---|---|
abstract void |
repaint()
Repaints the currently displayed gui element. |
void |
setInterval(IntervalList list)
Before transmitting in the modes TRANSMIT_BAR
or TRANSMIT_VERT_BARS, an IntervalList
must be set. |
void |
setPrepareSignal(boolean enabled)
Should a hint to a following signal currently be displayed? |
void |
setProgress(float progress)
Sets the progress of the progress bar in %. |
void |
setShowCount(boolean enabled)
Should the signalCount be displayed on screen? |
void |
setSignal(boolean enabled)
Should the signal currently be displayed? |
void |
setSignalCount(int signalCount)
Sets the number of already processed signals. |
abstract void |
showCaptureGui(java.lang.String text,
ButtonInputHandler inputHandler)
Starts the capturing process by launching a gui element that listens to button inputs. |
abstract void |
showTransmitGui(java.lang.String text,
int type)
Starts the transmitting process. |
abstract void |
vibrate(int milliseconds)
Vibrates for milliseconds ms. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TRANSMIT_PLAIN
public static final int TRANSMIT_SIGNAL
public static final int TRANSMIT_TRAFFIC_LIGHT
public static final int TRANSMIT_BAR
public static final int TRANSMIT_VERT_BARS
protected int transmissionMode
transmissionMode is one of the
TRANSMIT_* constants defined in this class.
protected int signalCount
protected boolean showCount
signalCount be displayed on screen? It's more
convenient for the user, but use with care: it may leak information to
an attacker (a secure channel should not display this information
on screen).
protected boolean showSignal
protected boolean prepareSignal
protected IntervalList intervalList
IntervalList used to draw
the progress bar.
protected float progress
protected Log logger
| Constructor Detail |
|---|
public ButtonChannelImpl()
| Method Detail |
|---|
public abstract void showCaptureGui(java.lang.String text,
ButtonInputHandler inputHandler)
text should be an instructive
and/or informative text that helps the user to perform his task.
text - Is displayed on screen while capturing.inputHandler - Button inputs are delegated to inputHandler.
public abstract void showTransmitGui(java.lang.String text,
int type)
text - Is displayed on screen before transmitting starts.type - Defines the transmission type.public abstract void vibrate(int milliseconds)
milliseconds ms.
milliseconds - The vibration duration.public abstract void repaint()
public void setSignalCount(int signalCount)
signalCount is not within the boundaries
0 <= signalCount <= TOTAL_SIGNAL_COUNT its
value will be automatically truncated to the respective
boundary.
signalCount - The current signal count.public void setShowCount(boolean enabled)
signalCount be displayed on screen?
enabled - Enable or disable the signal count on screen.public void setSignal(boolean enabled)
repaint.
enabled - Enable or disable the signal.public void setPrepareSignal(boolean enabled)
repaint.TRANSMIT_SIGNAL mode:
To enable the preparatory signal, the 'real' signal
must be disabled first (setSignal(false)).
If the signal is active, it always has precedence over the
preparatory signal.
enabled - Enable or disable the preparatory signal.public void setInterval(IntervalList list)
TRANSMIT_BAR
or TRANSMIT_VERT_BARS, an IntervalList
must be set.
list - An IntervalList.public void setProgress(float progress)
repaint.
progress - Progress of the progress bar in %.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||