|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jview.JExitFrame
jview.JConfirmExitFrame
jview.JBorderFrame
jview.JOpenFrame
jview.JClientFrame
stella.jview.JMasterDisplay
public abstract class JMasterDisplay
A generic class that allows display of information from periheral
devices of STELLA. A JEnvironment may display the status of the
roof and some senor data, a JTelescope displays status information
of the telescope etc.
This class provides a generic frame that might be populated with a single
additional component provided by the subclass. It also acts as a
PickListener, meaning that it is able to receive single
HistoryAware.Pick events to update its display.
The connect/disconnect action binds/unbinds this listening ability to the
registry using the KEY_BINDNAME property. This reversal allows
publisher of pick events to scan entire registries and funnel picks to
all listeners found.
| Nested Class Summary | |
|---|---|
static class |
JMasterDisplay.Show
Class to create the frame and display it. |
| Nested classes/interfaces inherited from class jview.JClientFrame |
|---|
JClientFrame.ClientListener |
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private static long |
DEFREFRESH
Default refresh interval. |
static String |
KEY_BINDNAME
The command caster name we listener to, if any |
static String |
KEY_REFRESH
The refresh intervall in ms. |
static String |
KEY_SWITCHMONITOR
The command to switch the monitor. |
private static String |
OFF
Python-script for on. |
private static String |
ON
Python-script for on. |
private long |
switched
Last time monitor was switched. |
| Fields inherited from class jview.JClientFrame |
|---|
CONNECTACTION, DISCONNECTACTION, KEY_CONNECTONINIT, KEY_ICONCONNECT, KEY_ICONDISCONNECT |
| Fields inherited from class jview.JOpenFrame |
|---|
EMPTYACTION, EXITACTION, KEY_FILEACTIONS, KEY_FILEHOME, OPENACTION, PRINTACTION, SAVEACTION |
| Fields inherited from class jview.JBorderFrame |
|---|
DATACLEANSE, KEY_ABOUTURL, KEY_ACTIONCLASS, KEY_AIPLOGO, KEY_BIGGERSTRUT, KEY_DATAANALYSER, KEY_EASTALIGNMENT, KEY_FITTERS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NORTHALIGNMENT, KEY_SOUTHALIGNMENT, KEY_WESTALIGNMENT, MODELFITTER |
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface jview.ClientLabels |
|---|
KEY_CONNECTERROR, KEY_CONNECTTITLE, KEY_DISCONNECTERROR |
| Fields inherited from interface jview.BorderLabels |
|---|
KEY_ABOUT, KEY_ABOUTACC, KEY_FILEACCS, KEY_FILEITEMS, KEY_FILEMENU, KEY_FILEMNEMONIC, KEY_HELPMENU, KEY_HELPMNEMONIC, KEY_HELPTITLE, KEY_NOHELP, KEY_NOURLACCESS, KEY_TITLE |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
protected |
JMasterDisplay(Map<String,String> prop)
Constructs a generic peripheral from a property container. |
protected |
JMasterDisplay(PropertyBearing prop)
Constructs a generic peripheral from a property container. |
| Method Summary | |
|---|---|
boolean |
connect()
Called when connection to the registry is required. |
boolean |
disconnect()
Called when deregistering from the casters is required. |
protected boolean |
execute(String command)
Subclasses that need a system process to be executed can use this method. |
protected boolean |
execute(String command,
boolean waitfor)
Subclasses that need a system process to be executed can use this method. |
Icon |
getIcon()
Might return an icon, if one was stated in the properties |
long |
getRefreshInterval()
The refresh intervall. |
void |
init()
We set our default close operation to nothing, allowing confirmed exit. |
boolean |
isFixedRate()
True. |
protected void |
openFile(File f)
Per default, we cannot open a file. |
protected abstract boolean |
processExternally(HistoryAware.Pick pick)
If data was not available on the local resources, but should be retrieved using external storage, processLocally(stella.HistoryAware.Pick) should return
false, in which turn we end up here. |
protected abstract boolean |
processLocally(HistoryAware.Pick pick)
This method is called firstly when a pick event is received. |
boolean |
processPick(HistoryAware.Pick pick)
We receive a pick event here. |
void |
refresh()
Refresh only if NEC, plasma is on and the last toggle time is big. |
void |
setComposedProperties(PropertyBearing info)
Defaults the display. |
private boolean |
tryLocalAndRemote(HistoryAware.Pick pick)
Method the pick event is relayed to. |
| Methods inherited from class jview.JClientFrame |
|---|
abolishConnection, actionPerformed, createConnect, establishConnection, exit, getBottomItems |
| Methods inherited from class jview.JOpenFrame |
|---|
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, getHelpActions, getMenus, getOpenFilter, getPrintRepresentation, getSaveFilter, getSaveRepresentation, populateMenu, printCenter, saveFile |
| Methods inherited from class jview.JConfirmExitFrame |
|---|
disposeAndExit |
| Methods inherited from class jview.JExitFrame |
|---|
setVisible |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.PropertyComposed |
|---|
getComposedProperties |
| Methods inherited from interface jview.Displayable |
|---|
getRepresentation |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final String KEY_BINDNAME
public static final String KEY_SWITCHMONITOR
public static final String KEY_REFRESH
private static final long DEFREFRESH
private static final String ON
private static final String OFF
private long switched
| Constructor Detail |
|---|
protected JMasterDisplay(Map<String,String> prop)
throws RemoteException
RemoteException
protected JMasterDisplay(PropertyBearing prop)
throws RemoteException
RemoteException| Method Detail |
|---|
public void setComposedProperties(PropertyBearing info)
setComposedProperties in interface PropertyComposedsetComposedProperties in class JClientFramepublic void init()
init in interface Initializableinit in class JOpenFramepublic Icon getIcon()
getIcon in interface DisplayablegetIcon in class JBorderFramepublic long getRefreshInterval()
getRefreshInterval in interface Refreshingpublic boolean isFixedRate()
isFixedRate in interface RefreshingTimerpublic void refresh()
refresh in interface Refreshingpublic boolean connect()
KEY_BINDNAME property.
connect in interface ClientObjectconnect in class JClientFramepublic boolean disconnect()
disconnect in interface ClientObjectdisconnect in class JClientFrameprotected boolean execute(String command)
protected boolean execute(String command,
boolean waitfor)
protected void openFile(File f)
openFile in class JOpenFrame
public boolean processPick(HistoryAware.Pick pick)
throws RemoteException
processLocally(stella.HistoryAware.Pick). If this method returns false,
we issue an info message on the status bar and call
processExternally(stella.HistoryAware.Pick). If this method also returns false, we issue
a warning to the status bar and return.
processPick in interface PickListenerRemoteExceptionprivate boolean tryLocalAndRemote(HistoryAware.Pick pick)
protected abstract boolean processLocally(HistoryAware.Pick pick)
processExternally(stella.HistoryAware.Pick) will be called.
protected abstract boolean processExternally(HistoryAware.Pick pick)
processLocally(stella.HistoryAware.Pick) should return
false, in which turn we end up here. The implemnting class should
retrieve the external data, display it and eventually place a copy
into the local resources for later retrieval.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||