stella.jview
Class JMasterFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jview.JExitFrame
                          extended by jview.JConfirmExitFrame
                              extended by jview.JBorderFrame
                                  extended by jview.JOpenFrame
                                      extended by jview.JClientFrame
                                          extended by stella.jview.JMasterFrame
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, Remote, EventListener, Accessible, RootPaneContainer, WindowConstants, BorderLabels, ClientLabels, Displayable, RmiAcknowledgeListener, RmiCommandListener, RmiDataCollecting, RmiDataListener, RmiDoneListener, RmiErrorListener, RmiWeatherListener, ClientObject, ExitCleaning, Initializable, LocalizedAware, LocalizedComposed, RmiEventListener, RmiListener
Direct Known Subclasses:
JAdapter, JEnvironment

public class JMasterFrame
extends JClientFrame
implements RmiCommandListener, RmiAcknowledgeListener, RmiDoneListener, RmiErrorListener, RmiDataListener, RmiWeatherListener, RmiDataCollecting

A generic class that allows display of information messages 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 allows connecting to a underlying CommandReceiver and shows the status of the connection in the lower left part of its display. A JStatusSave panel is provided, as well as a menu bar that might be populated by subclasses. A general help menu item is provided. The AIP logo is displayed. The generic periheral looks like

JGenericPeripheral

.

See Also:
Serialized Form

Nested Class Summary
static class JMasterFrame.Show
          Class to create the frame and display it.
static class JMasterFrame.Signal
          We grab the unique-ID from the command line and signal it to a bound pick listener, after augmenting it to a 'real' pick event.
 
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private static long DEFINTERVAL
          The default notification interval.
static String KEY_ACKNOWLEDGECASTER
          The acknowledge caster name we listener to, if any
static String KEY_COMMANDCASTER
          The command caster name we listener to, if any
static String KEY_DATACASTER
          The data caster name we listener to, if any
static String KEY_DONECASTER
          The done caster name we listener to, if any
static String KEY_ERRORCASTER
          The error caster name we listener to, if any
static String KEY_INTERVAL
          The interval at which we should get data from the repository.
static String KEY_REPOSITORY
          The repository generating weather data events.
static String KEY_WEATHERCASTER
          The weather caster name we listener to, if any
private  MasterListener listener
          The listener checking connections to my master casters.
 
Fields inherited from class jview.JClientFrame
CONNECTACTION, DISCONNECTACTION, KEY_CONNECTONINIT, KEY_ICONCONNECT, KEY_ICONDISCONNECT
 
Fields inherited from class jview.JOpenFrame
EMPTYACTION, EXITACTION, EXPORTACTION, 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_FITTERTIPS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NOLOGO, 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
JMasterFrame(LocalizedSupplying prop)
          Constructs a generic peripheral from a property container.
JMasterFrame(Map<String,String> prop)
          Constructs a generic peripheral from a property container.
 
Method Summary
 boolean accepts(CommandEvent cmd)
          Accepts no command events.
 boolean connect()
          Called when connection to the casters is required.
protected  JStatusField createStatus()
          Creates the status field or a subclass of it.
 boolean disconnect()
          Called when deregistering from the casters is required.
 void disconnect(RmiCaster name)
          Diverts to listener.
 String getListenerName()
          Returns the listener name.
 void init()
          Initializes the frame.
 boolean isConnected()
          Diverts to listener.
protected  boolean openFile(File f)
          Per default, we cannot open a file.
 void rmiCommand(CommandEvent ce)
          The receiving edge of the command listener.
 void rmiDataAvailable(DataEvent de)
          The receiving edge of the data listener.
 void rmiErrorOccured(ErrorEvent ee)
          The receiving edge of the error listener.
 long rmiGetInterval()
          Returns the previously set sampling period.
 void rmiGotAcknowledge(AcknowledgeEvent ae)
          The receiving edge of the acknowledge listener.
 void rmiGotDone(DoneEvent de)
          The receiving edge of the done listener.
 void rmiProcessData(Map readings, boolean weather)
          This method is per default empty.
 void rmiWeatherChanged(WeatherEvent we)
          The receiving edge of weather events.
 void setComposedProperties(LocalizedSupplying prop)
          Adds a default interval.
 
Methods inherited from class jview.JClientFrame
abolishConnection, actionPerformed, createConnect, establishConnection, exit, getBottomItems
 
Methods inherited from class jview.JOpenFrame
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, createLocalizedMenu, createLocalizedMenuItem, createLocalizedRadioButtonMenuItem, createMenu, createMenuItem, createRadioButtonMenuItem, exportCenter, getExportRepresentation, getHelpActions, getMenus, getOpenFilter, getPrintRepresentation, getSaveFilter, getSaveRepresentation, populateMenu, printCenter, saveFile
 
Methods inherited from class jview.JBorderFrame
analyserListenTo, createButton, createCheckBox, createDataAnalysers, createFitters, createHelp, createLabel, createLocalizedButton, createLocalizedCheckBox, createLocalizedHelp, createLocalizedLabel, createLocalizedRadioButton, createRadioButton, getAboutAction, getActiveFit, getBiggerStrut, getComposedProperties, getDataAnalysers, getFitterButtonGroup, getFitterComboBox, getIcon, getLeftItems, getLesserStrut, getModelFittings, getRepresentation, getRightItems, getStatusField, getTopItems, hasFired, printAlignment, setAlignment, setFired
 
Methods inherited from class jview.JConfirmExitFrame
disposeAndExit, disposeImmediately
 
Methods inherited from class jview.JExitFrame
setVisible
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, 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.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.LocalizedComposed
getComposedProperties
 
Methods inherited from interface jview.Displayable
getIcon, getRepresentation
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

KEY_COMMANDCASTER

public static final String KEY_COMMANDCASTER
The command caster name we listener to, if any

See Also:
Constant Field Values

KEY_ACKNOWLEDGECASTER

public static final String KEY_ACKNOWLEDGECASTER
The acknowledge caster name we listener to, if any

See Also:
Constant Field Values

KEY_ERRORCASTER

public static final String KEY_ERRORCASTER
The error caster name we listener to, if any

See Also:
Constant Field Values

KEY_DONECASTER

public static final String KEY_DONECASTER
The done caster name we listener to, if any

See Also:
Constant Field Values

KEY_DATACASTER

public static final String KEY_DATACASTER
The data caster name we listener to, if any

See Also:
Constant Field Values

KEY_WEATHERCASTER

public static final String KEY_WEATHERCASTER
The weather caster name we listener to, if any

See Also:
Constant Field Values

KEY_REPOSITORY

public static final String KEY_REPOSITORY
The repository generating weather data events. Rmi access.

See Also:
Constant Field Values

KEY_INTERVAL

public static final String KEY_INTERVAL
The interval at which we should get data from the repository.

See Also:
Constant Field Values

DEFINTERVAL

private static final long DEFINTERVAL
The default notification interval.

See Also:
Constant Field Values

listener

private MasterListener listener
The listener checking connections to my master casters.

Constructor Detail

JMasterFrame

public JMasterFrame(Map<String,String> prop)
             throws RemoteException
Constructs a generic peripheral from a property container.

Throws:
RemoteException

JMasterFrame

public JMasterFrame(LocalizedSupplying prop)
             throws RemoteException
Constructs a generic peripheral from a property container.

Throws:
RemoteException
Method Detail

setComposedProperties

public void setComposedProperties(LocalizedSupplying prop)
Adds a default interval.

Specified by:
setComposedProperties in interface LocalizedAware
Overrides:
setComposedProperties in class JClientFrame

init

public void init()
Initializes the frame. At this stage, daughter classes must be able to deliver the central component they want to display. Additionally, subclasses that want to add menus to the menubar, should override the JOpenFrame.getMenus() method that in the basic version delivers a 'File' menu that allows connecting/disconnecting/save/print/exit. If additional help is needed, the JOpenFrame.getHelpActions() method must be overridn which delivers an empty list in the basic version. Right to the main area, where the #deliverComponent return is placed, the AIP-logo is displayed. Underneath the buttons are placed delivered by the #getRightActions method, which in the basic version returns an empty list.

Specified by:
init in interface Initializable
Overrides:
init in class JOpenFrame

isConnected

public boolean isConnected()
                    throws RemoteException
Diverts to listener.

Specified by:
isConnected in interface RmiListener
Throws:
RemoteException

disconnect

public void disconnect(RmiCaster name)
                throws RemoteException
Diverts to listener.

Specified by:
disconnect in interface RmiListener
Throws:
RemoteException

getListenerName

public String getListenerName()
                       throws RemoteException
Returns the listener name. Diverts to listener.

Specified by:
getListenerName in interface RmiEventListener
Throws:
RemoteException

accepts

public boolean accepts(CommandEvent cmd)
                throws RemoteException
Accepts no command events. Subclasses may override.

Specified by:
accepts in interface RmiCommandListener
Throws:
RemoteException

rmiCommand

public void rmiCommand(CommandEvent ce)
                throws RemoteException
The receiving edge of the command listener. Passes the command message received to the status field.

Specified by:
rmiCommand in interface RmiCommandListener
Throws:
RemoteException

rmiGotAcknowledge

public void rmiGotAcknowledge(AcknowledgeEvent ae)
                       throws RemoteException
The receiving edge of the acknowledge listener. Passes the acknowledge message received to the status field.

Specified by:
rmiGotAcknowledge in interface RmiAcknowledgeListener
Throws:
RemoteException

rmiGotDone

public void rmiGotDone(DoneEvent de)
                throws RemoteException
The receiving edge of the done listener. Passes the done message received to the status field.

Specified by:
rmiGotDone in interface RmiDoneListener
Throws:
RemoteException

rmiErrorOccured

public void rmiErrorOccured(ErrorEvent ee)
                     throws RemoteException
The receiving edge of the error listener. Passes the error/status message received to the status field's error channel.

Specified by:
rmiErrorOccured in interface RmiErrorListener
Throws:
RemoteException

rmiDataAvailable

public void rmiDataAvailable(DataEvent de)
                      throws RemoteException
The receiving edge of the data listener. Passes the data event to the status field's message channel.

Specified by:
rmiDataAvailable in interface RmiDataListener
Throws:
RemoteException

rmiWeatherChanged

public void rmiWeatherChanged(WeatherEvent we)
                       throws RemoteException
The receiving edge of weather events. They are passed to the serial's error channel.

Specified by:
rmiWeatherChanged in interface RmiWeatherListener
Throws:
RemoteException

rmiGetInterval

public long rmiGetInterval()
                    throws RemoteException
Returns the previously set sampling period.

Specified by:
rmiGetInterval in interface RmiDataCollecting
Throws:
RemoteException

rmiProcessData

public void rmiProcessData(Map readings,
                           boolean weather)
                    throws RemoteException
This method is per default empty.

Specified by:
rmiProcessData in interface RmiDataCollecting
Throws:
RemoteException

createStatus

protected JStatusField createStatus()
Creates the status field or a subclass of it.

Overrides:
createStatus in class JBorderFrame

connect

public boolean connect()
Called when connection to the casters is required.

Specified by:
connect in interface ClientObject
Overrides:
connect in class JClientFrame

disconnect

public boolean disconnect()
Called when deregistering from the casters is required.

Specified by:
disconnect in interface ClientObject
Overrides:
disconnect in class JClientFrame

openFile

protected boolean openFile(File f)
Per default, we cannot open a file.

Specified by:
openFile in class JOpenFrame