stella.jview
Class JStella

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 stella.jview.JStella
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, BorderLabels, Displayable, StellaLabels, Initializable, PropertyAware, PropertyComposed, Refreshing

public class JStella
extends JOpenFrame
implements Refreshing, StellaLabels

This class launches the main STELLA control console. It shows the target history, which can be used to funnel HistoryAware.Picks to device displays.

See Also:
Serialized Form

Nested Class Summary
static class JStella.Show
          Class to create the frame and display it.
 
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 String DEFDATEFORMAT
          Default date format that is displayed on spinners.
private static String DEFFITSDB
          The default database properties.
private static String DEFHISTORYDB
          The default database properties.
private static String DEFHISTORYPROP
          The default database properties.
private static String DEFHOSTS
          The list of hosts that should be scanned to radiate pick events.
private static int DEFMAXSPAN
          Maximum span for history.
private static String DEFPLOTPROP
          The default database properties.
private static long DEFREFRESH
           
private static String DEFRESOURCEBUNDLES
          The resource bundles for localized labels and text.
private static String DEFSHOWCOMMENTS
          The comments to the values to plot.
private static String DEFSHOWFORMATS
          The formats to the values to plot.
private static String DEFSHOWVALUES
          The allowed values to plot.
private static String DEFSTELLA
          The list of hosts that should be scanned to radiate pick events.
private static String DEFTARGETLIST
          The default target list properties.
private static String DEFTIMEZONE
          The default database properties.
private static String DEFURLRESOURCES
          The default resources.
private static String DEFUSERLIST
          The default users.
private  JTargetHistory history
          My component.
private  HistorySql hsql
          History db.
private  JComboBox inclined
          The combo box of fits key to plot inclined.
static String KEY_DATEFORMAT
          The format how dates are displayed.
static String KEY_FITSDB
          The properties of the observational database.
static String KEY_HISTORYDB
          The properties of the history data base.
static String KEY_HISTORYPROP
          The properties of the target list.
static String KEY_HOSTS
          The list of hosts that should be scanned to radiate pick events.
static String KEY_MAXSPAN
          The maximum days that can be spanned.
static String KEY_REFRESH
          The properties of the fits list.
static String KEY_RISETWILIGHT
          The key to the good-weather toggle height of the sun.
static String KEY_SETTWILIGHT
          The key to the good-weather toggle height of the sun.
static String KEY_SHOWCOMMENTS
          The allowed fits-keys to plot.
static String KEY_SHOWFORMATS
          The allowed fits-keys to plot.
static String KEY_SHOWVALUES
          The allowed fits-keys to plot.
static String KEY_STELLA
          The telescope id we work on.
static String KEY_TARGETLIST
          The target-list parameter to initialize the target history.
static String KEY_TIMEZONE
          The timezone
static String KEY_USERLIST
          The user properties as a comma-separated file list..
private  Date lastpress
          If the update was pressed recently, we do not update.
private  Date oldfrom
          If the date have not changed, we do not update.
private  Date oldto
          If the date have not changed, we do not update.
private  ObserveSql osql
          Observations sql.
static String PLOTACTION
          The action identifying plot events to plot fits-keys.
private  JComboBox plotx
          The combo box of fits key to plot in x-axis.
private  JComboBox ploty
          The combo box of fits key to plot in y-axis.
private  List<Registry> registries
          A list of registries on hosts that might contain pick event listeners.
private  SolHeight sol
          To know, when we have to update the display.
private  JSpinner span
          The spinner that displays the span of the history in days.
private  JSpinner start
          The spinner that displays the end date of the history.
private  SettableTime time
          We need a time to calculate the solar height.
static String UPDATEACTION
          The action identifying update events to update the history.
private  Map<String,Format> valuemap
          A mapping of inclined parameters to their formats.
 
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 stella.jview.StellaLabels
KEY_DATELABEL, KEY_DATETIP, KEY_PLOTBUTTON, KEY_PLOTTIP, KEY_SPANLABEL, KEY_SPANTIP, KEY_UPDATEBUTTON, KEY_UPDATETIP, KEY_VALUELABEL, KEY_VALUETIP, KEY_XLABEL, KEY_XTIP, KEY_YLABEL, KEY_YTIP
 
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
JStella(Map<String,String> prop)
          Constructs a generic peripheral from a property container.
JStella(PropertyBearing prop)
          Constructs a the stella panel.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Actions fired when a button is pressed.
private  HistoryAware.Pick getEntireNight(Date today, int days)
          Returns the length of the last night as a history aware pick.
private  Date getMidnight(Date later)
          Returns a date that represents midnight at the given time zone.
 long getRefreshInterval()
          The refresh interval.
 Component getRepresentation()
          Retruns the JTargetHistory.
protected  List<Object> getTopItems()
          Returns the list of items to add to the north box.
 void init()
          Constructs my solar height parameter.
 boolean isFixedRate()
          We return true here.
protected  boolean openFile(File f)
          We cannot open a file.
 void refresh()
          We update the history, if we are showing.
protected static List<Registry> retrieveRegistries(List<String> hostnames)
          From a list of host names, we scan for their registries.
 void setComposedProperties(PropertyBearing info)
          Sets a PropertyBearing object as a composite of the canvas.
private  void treatPick(HistoryAware.Pick click)
          This pick is selected.
private  void updateHistory()
          Updates the history plot.
 
Methods inherited from class jview.JOpenFrame
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, 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, createStatus, getAboutAction, getActiveFit, getBiggerStrut, getBottomItems, getComposedProperties, getDataAnalysers, getFitterButtonGroup, getFitterComboBox, getIcon, getLeftItems, getLesserStrut, getModelFittings, getRightItems, getStatusField, 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
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

UPDATEACTION

public static final String UPDATEACTION
The action identifying update events to update the history.

See Also:
Constant Field Values

PLOTACTION

public static final String PLOTACTION
The action identifying plot events to plot fits-keys.

See Also:
Constant Field Values

KEY_HOSTS

public static final String KEY_HOSTS
The list of hosts that should be scanned to radiate pick events.

See Also:
Constant Field Values

KEY_STELLA

public static final String KEY_STELLA
The telescope id we work on.

See Also:
Constant Field Values

KEY_FITSDB

public static final String KEY_FITSDB
The properties of the observational database.

See Also:
Constant Field Values

KEY_DATEFORMAT

public static final String KEY_DATEFORMAT
The format how dates are displayed.

See Also:
Constant Field Values

KEY_MAXSPAN

public static final String KEY_MAXSPAN
The maximum days that can be spanned.

See Also:
Constant Field Values

KEY_SHOWVALUES

public static final String KEY_SHOWVALUES
The allowed fits-keys to plot.

See Also:
Constant Field Values

KEY_SHOWFORMATS

public static final String KEY_SHOWFORMATS
The allowed fits-keys to plot.

See Also:
Constant Field Values

KEY_SHOWCOMMENTS

public static final String KEY_SHOWCOMMENTS
The allowed fits-keys to plot.

See Also:
Constant Field Values

KEY_TARGETLIST

public static final String KEY_TARGETLIST
The target-list parameter to initialize the target history.

See Also:
Constant Field Values

KEY_USERLIST

public static final String KEY_USERLIST
The user properties as a comma-separated file list..

See Also:
Constant Field Values

KEY_SETTWILIGHT

public static final String KEY_SETTWILIGHT
The key to the good-weather toggle height of the sun.

See Also:
Constant Field Values

KEY_RISETWILIGHT

public static final String KEY_RISETWILIGHT
The key to the good-weather toggle height of the sun.

See Also:
Constant Field Values

KEY_HISTORYDB

public static final String KEY_HISTORYDB
The properties of the history data base.

See Also:
Constant Field Values

KEY_HISTORYPROP

public static final String KEY_HISTORYPROP
The properties of the target list.

See Also:
Constant Field Values

KEY_REFRESH

public static final String KEY_REFRESH
The properties of the fits list.

See Also:
Constant Field Values

KEY_TIMEZONE

public static final String KEY_TIMEZONE
The timezone

See Also:
Constant Field Values

DEFURLRESOURCES

private static final String DEFURLRESOURCES
The default resources.

See Also:
Constant Field Values

DEFRESOURCEBUNDLES

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

See Also:
Constant Field Values

DEFHOSTS

private static final String DEFHOSTS
The list of hosts that should be scanned to radiate pick events.

See Also:
Constant Field Values

DEFSTELLA

private static final String DEFSTELLA
The list of hosts that should be scanned to radiate pick events.

See Also:
Constant Field Values

DEFDATEFORMAT

private static final String DEFDATEFORMAT
Default date format that is displayed on spinners.

See Also:
Constant Field Values

DEFMAXSPAN

private static final int DEFMAXSPAN
Maximum span for history.

See Also:
Constant Field Values

DEFSHOWVALUES

private static final String DEFSHOWVALUES
The allowed values to plot.

See Also:
Constant Field Values

DEFSHOWFORMATS

private static final String DEFSHOWFORMATS
The formats to the values to plot.

See Also:
Constant Field Values

DEFSHOWCOMMENTS

private static final String DEFSHOWCOMMENTS
The comments to the values to plot.

See Also:
Constant Field Values

DEFTARGETLIST

private static final String DEFTARGETLIST
The default target list properties.

See Also:
Constant Field Values

DEFHISTORYDB

private static final String DEFHISTORYDB
The default database properties.

See Also:
Constant Field Values

DEFHISTORYPROP

private static final String DEFHISTORYPROP
The default database properties.

See Also:
Constant Field Values

DEFPLOTPROP

private static final String DEFPLOTPROP
The default database properties.

See Also:
Constant Field Values

DEFFITSDB

private static final String DEFFITSDB
The default database properties.

See Also:
Constant Field Values

DEFUSERLIST

private static final String DEFUSERLIST
The default users.

See Also:
Constant Field Values

DEFTIMEZONE

private static final String DEFTIMEZONE
The default database properties.

See Also:
Constant Field Values

DEFREFRESH

private static final long DEFREFRESH
See Also:
Constant Field Values

start

private JSpinner start
The spinner that displays the end date of the history.


span

private JSpinner span
The spinner that displays the span of the history in days.


inclined

private JComboBox inclined
The combo box of fits key to plot inclined.


plotx

private JComboBox plotx
The combo box of fits key to plot in x-axis.


ploty

private JComboBox ploty
The combo box of fits key to plot in y-axis.


valuemap

private Map<String,Format> valuemap
A mapping of inclined parameters to their formats.


history

private JTargetHistory history
My component.


oldfrom

private Date oldfrom
If the date have not changed, we do not update.


oldto

private Date oldto
If the date have not changed, we do not update.


lastpress

private Date lastpress
If the update was pressed recently, we do not update.


time

private SettableTime time
We need a time to calculate the solar height.


sol

private SolHeight sol
To know, when we have to update the display.


registries

private List<Registry> registries
A list of registries on hosts that might contain pick event listeners.


hsql

private HistorySql hsql
History db.


osql

private ObserveSql osql
Observations sql.

Constructor Detail

JStella

public JStella(PropertyBearing prop)
Constructs a the stella panel.


JStella

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

Method Detail

setComposedProperties

public void setComposedProperties(PropertyBearing info)
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

init

public void init()
Constructs my solar height parameter.

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

getRepresentation

public Component getRepresentation()
Retruns the JTargetHistory.

Specified by:
getRepresentation in interface Displayable
Overrides:
getRepresentation in class JBorderFrame

getTopItems

protected List<Object> getTopItems()
Returns the list of items to add to the north box. These are the fields that allow the user to change the history display dates.

Overrides:
getTopItems in class JBorderFrame

openFile

protected boolean openFile(File f)
We cannot open a file.

Specified by:
openFile in class JOpenFrame

refresh

public void refresh()
We update the history, if we are showing. This method is called periodically to show a correct history, or if the user hits the update button.

Specified by:
refresh in interface Refreshing

isFixedRate

public boolean isFixedRate()
We return true here.

Specified by:
isFixedRate in interface Refreshing
See Also:
Timer

getRefreshInterval

public long getRefreshInterval()
The refresh interval.

Specified by:
getRefreshInterval in interface Refreshing

actionPerformed

public void actionPerformed(ActionEvent ae)
Actions fired when a button is pressed.

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

treatPick

private void treatPick(HistoryAware.Pick click)
This pick is selected.


getMidnight

private Date getMidnight(Date later)
Returns a date that represents midnight at the given time zone.


getEntireNight

private HistoryAware.Pick getEntireNight(Date today,
                                         int days)
Returns the length of the last night as a history aware pick.


updateHistory

private void updateHistory()
Updates the history plot.


retrieveRegistries

protected static List<Registry> retrieveRegistries(List<String> hostnames)
From a list of host names, we scan for their registries. Only if all registries have been successfully retrieved, a non-null list is returned.