|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
stella.jview.JSwitchButton
public class JSwitchButton
A button that attaches itself to a rmi-enabled switch.
| Nested Class Summary | |
|---|---|
static class |
JSwitchButton.Test
We test the button by binding to the given RMI switch. |
| Nested classes/interfaces inherited from class javax.swing.JButton |
|---|
JButton.AccessibleJButton |
| Nested classes/interfaces inherited from class javax.swing.AbstractButton |
|---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
DEFINVALID
The string to display in the undetermined state. |
static long |
DEFREFRESH
The default refresh interval. |
private Boolean |
exitstate
If false, we switxh off on exit. |
private String |
invalid
The string to display in the undetermined state. |
private long |
maxon
The on-interval. |
private Color |
offcol
The background color in the off state. |
private Icon |
officon
The default icon to display in the "off" state. |
private String |
offtext
The default string to display in "off" state. |
private Color |
oncol
The backgound color in the on state. |
private Icon |
onicon
The default icon to display in the "on" state. |
private String |
ontext
The default string to display in "on" state. |
private long |
refresh
The actual refresh interval. |
private SwitchStub |
stub
The switch we are attached to. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JSwitchButton(String bind)
On construct, we initiate binding to the remote switch. |
|
JSwitchButton(String bind,
long interval)
On construct, we initiate binding to the remote switch. |
|
| Method Summary | |
|---|---|
void |
exit()
On exit, we switch off, if applicabale. |
long |
getRefreshInterval()
The refresh interval. |
boolean |
isFixedRate()
Fixed delay. |
void |
refresh()
On refresh, we query the remote state of the switch and update our display accordingly. |
void |
setBackground(Color jc)
Setting the backgound color toggles the foreground color, if we are too dark. |
void |
setOnOffColor(Color ont,
Color offt)
Sets the on off color. |
void |
setOnOffIcon(Icon ont,
Icon offt)
Sets the on/off icon |
void |
setOnOffText(String ont,
String offt)
Sets the on/off text. |
| Methods inherited from class javax.swing.JButton |
|---|
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFREFRESH
public static final String DEFINVALID
private SwitchStub stub
private Icon onicon
private Icon officon
private String ontext
private String offtext
private String invalid
private Color oncol
private Color offcol
private long maxon
private Boolean exitstate
private long refresh
| Constructor Detail |
|---|
public JSwitchButton(String bind)
public JSwitchButton(String bind,
long interval)
| Method Detail |
|---|
public void setBackground(Color jc)
setBackground in class JComponent
public void setOnOffText(String ont,
String offt)
public void setOnOffIcon(Icon ont,
Icon offt)
public void setOnOffColor(Color ont,
Color offt)
public void refresh()
refresh in interface Refreshingpublic boolean isFixedRate()
isFixedRate in interface RefreshingTimerpublic long getRefreshInterval()
getRefreshInterval in interface Refreshingpublic void exit()
exit in interface ExitCleaning
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||