stella.jview
Class JAntarcticaNight

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jview.JImageComponent
                  extended by jview.JAntarctica
                      extended by stella.jview.JAntarcticaNight
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, ConditionalRefreshing, Initializable, PropertyAware, PropertyComposed, Refreshing

public class JAntarcticaNight
extends JAntarctica
implements ConditionalRefreshing

We display an image of the earth with the current day-night boundary overlayed.

See Also:
Serialized Form

Nested Class Summary
static class JAntarcticaNight.Show
          Shows the earth in a mercator projection with the current day/night terminator.
 
Nested classes/interfaces inherited from class jview.JImageComponent
JImageComponent.Display
 
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 static double DEFDAYTWILIGHT
          The default twilight border for bright twilight.
private static double DEFNIGHTTWILIGHT
          The default twilight border for pitch black.
private static long DEFREFRESH
          The default refresh interval in ms.
static String KEY_ACCELERATE
          If artificial advances desired, use this multiplier.
static String KEY_DAYTWILIGHT
          The sol-height border between night and twilight.
static String KEY_FORDATE
          If not for current time, but for specific.
static String KEY_MERIDIAN
          If the central meridian is different than zero.
static String KEY_NIGHTTWILIGHT
          The sol-height border between night and twilight.
static String KEY_PROJECTION
          The cylindrical projection of the map, class name.
static String KEY_REFRESH
          The refresh interval in ms.
static String KEY_WORLD
          The map resource to display, an image of the earth.
private  Longitude lambda
          Longitude in antarctica.
private  Time now
          Time instance for artificial advances.
private  Latitude phi
          Latititude in antarctica.
private  SolHeight solh
          Solar position.
 
Fields inherited from class jview.JAntarctica
KEY_ANTARCTICA, KEY_RADIUS, KEY_XORIGIN, KEY_YORIGIN
 
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
JAntarcticaNight(PropertyBearing info)
          Constructs a new night earth giving its properties.
 
Method Summary
 long getRefreshInterval()
          The refresh interval is a property.
 void init()
          Initializes additionally the parameters needed.
 boolean isFixedRate()
          We do not want fixed rate, merely act like a cursor.
 boolean isRefreshNeeded()
          We only want updates if we are visible.
 void paintComponent(Graphics g)
          Paints the individual bars of twilight and night onto the component using x-or mode.
 void refresh()
          On refresh, we repaint.
 void setComposedProperties(PropertyBearing prop)
          Sets the proberties of the earth and defailts colors.
 
Methods inherited from class jview.JAntarctica
getComposedProperties, getGeography, getPixel
 
Methods inherited from class jview.JImageComponent
createBufferedImage, getImage, getPreferredSize, setImage
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, 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, setLayout, 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

KEY_WORLD

public static final String KEY_WORLD
The map resource to display, an image of the earth.

See Also:
Constant Field Values

KEY_PROJECTION

public static final String KEY_PROJECTION
The cylindrical projection of the map, class name.

See Also:
Constant Field Values

KEY_MERIDIAN

public static final String KEY_MERIDIAN
If the central meridian is different than zero.

See Also:
Constant Field Values

KEY_NIGHTTWILIGHT

public static final String KEY_NIGHTTWILIGHT
The sol-height border between night and twilight.

See Also:
Constant Field Values

KEY_DAYTWILIGHT

public static final String KEY_DAYTWILIGHT
The sol-height border between night and twilight.

See Also:
Constant Field Values

KEY_REFRESH

public static final String KEY_REFRESH
The refresh interval in ms.

See Also:
Constant Field Values

KEY_FORDATE

public static final String KEY_FORDATE
If not for current time, but for specific.

See Also:
Constant Field Values

KEY_ACCELERATE

public static final String KEY_ACCELERATE
If artificial advances desired, use this multiplier.

See Also:
Constant Field Values

DEFNIGHTTWILIGHT

private static final double DEFNIGHTTWILIGHT
The default twilight border for pitch black.

See Also:
Constant Field Values

DEFDAYTWILIGHT

private static final double DEFDAYTWILIGHT
The default twilight border for bright twilight.

See Also:
Constant Field Values

DEFREFRESH

private static final long DEFREFRESH
The default refresh interval in ms.

See Also:
Constant Field Values

solh

private SolHeight solh
Solar position.


lambda

private Longitude lambda
Longitude in antarctica.


phi

private Latitude phi
Latititude in antarctica.


now

private Time now
Time instance for artificial advances.

Constructor Detail

JAntarcticaNight

public JAntarcticaNight(PropertyBearing info)
Constructs a new night earth giving its properties.

Method Detail

setComposedProperties

public void setComposedProperties(PropertyBearing prop)
Sets the proberties of the earth and defailts colors.

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

init

public void init()
Initializes additionally the parameters needed.

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

paintComponent

public void paintComponent(Graphics g)
Paints the individual bars of twilight and night onto the component using x-or mode.

Overrides:
paintComponent in class JImageComponent

isRefreshNeeded

public boolean isRefreshNeeded()
We only want updates if we are visible.

Specified by:
isRefreshNeeded in interface ConditionalRefreshing

getRefreshInterval

public long getRefreshInterval()
The refresh interval is a property.

Specified by:
getRefreshInterval in interface Refreshing

refresh

public void refresh()
On refresh, we repaint.

Specified by:
refresh in interface Refreshing

isFixedRate

public boolean isFixedRate()
We do not want fixed rate, merely act like a cursor.

Specified by:
isFixedRate in interface Refreshing
See Also:
Timer