jview
Class JClientFrame

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
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, BorderLabels, ClientLabels, Displayable, ClientObject, ExitCleaning, Initializable, PropertyAware, PropertyComposed
Direct Known Subclasses:
JMasterDisplay, JMasterFrame

public abstract class JClientFrame
extends JOpenFrame
implements ClientObject, ExitCleaning, ClientLabels

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
protected static class JClientFrame.ClientListener
          A helper class to listen to connect events.
 
Nested classes/interfaces inherited from class jview.JOpenFrame
JOpenFrame.Show
 
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
static String CONNECTACTION
          The connect action.
private  JToggleButton connected
          The label changing its icon according to the connection status.
private static boolean DEFCONNECTONINIT
          If true, the connection is established on start-up.
private static String DEFFILEACTIONS
          The action commands used for identfiying file menu actions.
private static String DEFICONCONNECT
          The default connect resource.
private static String DEFICONDISCONNECT
          The default connect resource.
private static String DEFRESOURCEBUNDLES
          The resource bundles for localized labels and text.
static String DISCONNECTACTION
          The disconnect action.
static String KEY_CONNECTONINIT
          If true, the connection is established on start-up.
static String KEY_ICONCONNECT
          The connected icon as an image file.
static String KEY_ICONDISCONNECT
          The disconnected icon as an image file.
 
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
JClientFrame(Map<String,String> prop)
          Constructs a generic peripheral from a property container.
JClientFrame(PropertyBearing prop)
          Constructs a generic peripheral from a property container.
 
Method Summary
static boolean abolishConnection(JToggleButton connected, ClientObject client)
          Tries to abolish a connection.
 void actionPerformed(ActionEvent ae)
          Trace actions delivered to this component.
 boolean connect()
          Called when connection to the casters is required.
static JToggleButton createConnect(URL active, URL passive, ClientObject client)
          Creates a connected/disconnected toggle button.
 boolean disconnect()
          Called when deregistering from the casters is required.
static boolean establishConnection(JToggleButton connected, ClientObject client)
          Tries to establish a connection.
 void exit()
          On exit, we deregister from the casters.
protected  List getBottomItems()
          Returns the list of bottom items, which is the status panel plus the connect button.
 void setComposedProperties(PropertyBearing prop)
          Sets a PropertyBearing object as a composite of the canvas.
 
Methods inherited from class jview.JOpenFrame
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, exportCenter, getExportRepresentation, getHelpActions, getMenus, getOpenFilter, getPrintRepresentation, getSaveFilter, getSaveRepresentation, init, openFile, populateMenu, printCenter, saveFile
 
Methods inherited from class jview.JBorderFrame
analyserListenTo, createButton, createCheckBox, createDataAnalysers, createFitters, createHelp, createLabel, createLocalizedButton, createLocalizedCheckBox, createLocalizedHelp, createLocalizedLabel, createStatus, 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
 
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.PropertyComposed
getComposedProperties
 
Methods inherited from interface jview.Displayable
getIcon, getRepresentation
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

CONNECTACTION

public static final String CONNECTACTION
The connect action.

See Also:
Constant Field Values

DISCONNECTACTION

public static final String DISCONNECTACTION
The disconnect action.

See Also:
Constant Field Values

KEY_CONNECTONINIT

public static final String KEY_CONNECTONINIT
If true, the connection is established on start-up.

See Also:
Constant Field Values

KEY_ICONCONNECT

public static final String KEY_ICONCONNECT
The connected icon as an image file.

See Also:
Constant Field Values

KEY_ICONDISCONNECT

public static final String KEY_ICONDISCONNECT
The disconnected icon as an image file.

See Also:
Constant Field Values

DEFRESOURCEBUNDLES

private static final String DEFRESOURCEBUNDLES
The resource bundles for localized labels and text.

See Also:
Constant Field Values

DEFCONNECTONINIT

private static final boolean DEFCONNECTONINIT
If true, the connection is established on start-up.

See Also:
Constant Field Values

DEFICONCONNECT

private static final String DEFICONCONNECT
The default connect resource.

See Also:
Constant Field Values

DEFICONDISCONNECT

private static final String DEFICONDISCONNECT
The default connect resource.

See Also:
Constant Field Values

DEFFILEACTIONS

private static final String DEFFILEACTIONS
The action commands used for identfiying file menu actions.

See Also:
Constant Field Values

connected

private JToggleButton connected
The label changing its icon according to the connection status.

Constructor Detail

JClientFrame

public JClientFrame(PropertyBearing prop)
Constructs a generic peripheral from a property container.


JClientFrame

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

Method Detail

setComposedProperties

public void setComposedProperties(PropertyBearing prop)
Sets a PropertyBearing object as a composite of the canvas. Defaults the necessary parameter.

Specified by:
setComposedProperties in interface PropertyAware
Overrides:
setComposedProperties in class JOpenFrame

exit

public void exit()
On exit, we deregister from the casters.

Specified by:
exit in interface ExitCleaning

actionPerformed

public void actionPerformed(ActionEvent ae)
Trace actions delivered to this component. If dialogs are displayed, they are modal, thus we can act on the event queue.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class JOpenFrame

getBottomItems

protected List getBottomItems()
Returns the list of bottom items, which is the status panel plus the connect button.

Overrides:
getBottomItems in class JBorderFrame

connect

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

Specified by:
connect in interface ClientObject

disconnect

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

Specified by:
disconnect in interface ClientObject

createConnect

public static JToggleButton createConnect(URL active,
                                          URL passive,
                                          ClientObject client)
Creates a connected/disconnected toggle button.


establishConnection

public static boolean establishConnection(JToggleButton connected,
                                          ClientObject client)
Tries to establish a connection. Calls the abstract connect() method which should return fast, as we are in the event queue. If connection fails, i.e. if connect() returns false, an error dialog is displayed.


abolishConnection

public static boolean abolishConnection(JToggleButton connected,
                                        ClientObject client)
Tries to abolish a connection. Calls the abstract disconnect() method which should return fast, as we are in the event queue. If disconnection fails, i.e. if disconnect() returns false, an error dialog is displayed.