jview
Class JSightInfo

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.Box
                  extended by jview.JSightInfo
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Initializable

public class JSightInfo
extends Box
implements Initializable

A small panel that shows information on star visibility. This includes culmination height, time span of above-horizon, date of opposition to the sun and dates of heliacal rise and set.

See Also:
Serialized Form

Nested Class Summary
static class JSightInfo.Display
          A class to test the layout of the sight info panel.
 
Nested classes/interfaces inherited from class javax.swing.Box
Box.AccessibleBox, Box.Filler
 
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
private  JLabel culmlabel
          The label holding the target culmination hight.
private static String CULMPREPEND
          Prepend this to culmination height.
private  double h
          The target elevation it must have at heliacal rise/set.
private static String HELRISE
          Prepend this to heliacal rise.
private static String HELSET
          Prepend this to heliacal set.
private  double hsol
          The sun elevation for which we calculate the heliacal rise/set.
private static String INVISIBLE
          Placeholder for invalid dates (never rises/sets).
private  Double latitude
          The latitude of the observer.
private  JLabel namelabel
          The label holding the target name or position.
private static String NAMEPREPEND
          Prepend this to star name.
private  JLabel opplabel
          The label holding the target opposition date.
private static String OPPOSITION
          Prepend this to opposition date.
private  StarDescription radec
          The star the panel is drawn for.
private  JLabel riselabel
          The label holding the target helical rise date.
private  JLabel setlabel
          The label holding the target helical set date.
private  JLabel spanlabel
          The label holding the nightly target visibility span.
private static String UNKNOWN
          Placeholder for invalid target names.
private static String VISPREPEND
          Prepend this to visibility duration.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JSightInfo()
          Constructs a new sight info for the specified star at the given latitude.
 
Method Summary
 void init()
          Lays out the panel.
 void setHeliacalHeight(double htarget)
          Sets the heliacal target height on rise and set.
 void setHeliacalSunHeight(double h)
          Sets the heliacal sun height on rise and set.
 void setLatitude(double lat)
          Sets the latitude of the sight info.
 void setObject(StarDescription star)
          Sets the object of the sight info.
private  void update()
          Updates relevant labels.
 
Methods inherited from class javax.swing.Box
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, paintComponent, setLayout
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAMEPREPEND

private static final String NAMEPREPEND
Prepend this to star name.

See Also:
Constant Field Values

CULMPREPEND

private static final String CULMPREPEND
Prepend this to culmination height.

See Also:
Constant Field Values

VISPREPEND

private static final String VISPREPEND
Prepend this to visibility duration.

See Also:
Constant Field Values

HELRISE

private static final String HELRISE
Prepend this to heliacal rise.

See Also:
Constant Field Values

OPPOSITION

private static final String OPPOSITION
Prepend this to opposition date.

See Also:
Constant Field Values

HELSET

private static final String HELSET
Prepend this to heliacal set.

See Also:
Constant Field Values

UNKNOWN

private static final String UNKNOWN
Placeholder for invalid target names.

See Also:
Constant Field Values

INVISIBLE

private static final String INVISIBLE
Placeholder for invalid dates (never rises/sets).

See Also:
Constant Field Values

radec

private StarDescription radec
The star the panel is drawn for.


hsol

private double hsol
The sun elevation for which we calculate the heliacal rise/set.


h

private double h
The target elevation it must have at heliacal rise/set.


latitude

private Double latitude
The latitude of the observer.


namelabel

private JLabel namelabel
The label holding the target name or position.


culmlabel

private JLabel culmlabel
The label holding the target culmination hight.


spanlabel

private JLabel spanlabel
The label holding the nightly target visibility span.


riselabel

private JLabel riselabel
The label holding the target helical rise date.


opplabel

private JLabel opplabel
The label holding the target opposition date.


setlabel

private JLabel setlabel
The label holding the target helical set date.

Constructor Detail

JSightInfo

public JSightInfo()
Constructs a new sight info for the specified star at the given latitude. After construction, the layout is done with the init() method.

Parameters:
star - A star with at least right ascension and declination, both in degrees.
latitude - The observer's latitude, in degrees.
Method Detail

setLatitude

public void setLatitude(double lat)
Sets the latitude of the sight info. Updates the relevant labels.


setObject

public void setObject(StarDescription star)
Sets the object of the sight info. Updates the relevant labels.


setHeliacalSunHeight

public void setHeliacalSunHeight(double h)
Sets the heliacal sun height on rise and set.


setHeliacalHeight

public void setHeliacalHeight(double htarget)
Sets the heliacal target height on rise and set.


update

private void update()
Updates relevant labels.


init

public void init()
Lays out the panel. Setting position and latitude will only affect displayed values.

Specified by:
init in interface Initializable