stella.jview
Class JAltAzTelescope

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jview.JNormalizedCanvas
                  extended by stella.jview.JAltAzTelescope
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, NormalizedCoordinates, NormalizedShapes, Initializable, ResourceAware, ResourceComposed, Savable
Direct Known Subclasses:
JQuadrants

public class JAltAzTelescope
extends JNormalizedCanvas

A class that displays the current alt/az position of the telescope in polar coordinates. The position of the derotator, iof applicable, is shown like a counter-clockwise clockarm.

See Also:
Serialized Form

Nested Class Summary
static class JAltAzTelescope.Show
          Tests the class.
 
Nested classes/interfaces inherited from class jview.JNormalizedCanvas
JNormalizedCanvas.ShowImage, JNormalizedCanvas.Test
 
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  Double altitudecur
          The last altitude of the telescope assigned to the canvas.
private  Double altitudedes
          The desired altitude of the telescope assigned to the canvas.
private  Double azimuthcur
          The last azimuth of the telescope assigned to the canvas.
private  Double azimuthdes
          The desired azimuth of the telescope assigned to the canvas.
private static int DEFALTITUDEGRID
          Default azimuth steps.
private static int DEFAZIMUTHGRID
          Default azimuth steps.
private static Color DEFBACKGROUND
          We paint white on black.
private static double DEFDEROTATORSIZE
          The normalized length of the derotator locator line.
private static Color DEFDESIREDCOLOR
          The color the telescope is drawn in.
private static Color DEFFOREGROUND
          We paint white on black.
private static int DEFPREFERREDHEIGHT
          Default preferred size.
private static int DEFPREFERREDWIDTH
          Default preferred size.
private static Color DEFTELESCOPECOLOR
          The color the telescope is drawn in.
private static double DEFTELESCOPESIZE
          The normalized diameter of the telescope locator ellipse.
private  Double derotcur
          The last derotator position assigned to the canvas.
private  Double derotdes
          The desired derotator position assigned to the canvas.
static String KEY_ALTITUDEGRID
          A key to the altitude steps in degrees.
static String KEY_AZIMUTHGRID
          A key to the azimuth steps in degrees.
static String KEY_DEROTATORSIZE
          A key to the normalized size of the derotator locator.
static String KEY_DESIREDCOLOR
          A key to the desired location color.
static String KEY_TELESCOPECOLOR
          A key to the telescope location color.
static String KEY_TELESCOPESIZE
          A key to the normalized size of the telescope locator.
 
Fields inherited from class jview.JNormalizedCanvas
BACKGROUNDIMAGEPROPERTY, EXPORTACTION, GENERIC, inverse, KEY_BACKGROUND, KEY_CANVASNAME, KEY_CANVASTIP, KEY_CURSORCLASSES, KEY_CURSORPROPS, KEY_DRAWINGSETS, KEY_FOREGROUND, KEY_MAXIMUMHEIGHT, KEY_MAXIMUMWIDTH, KEY_MINIMUMHEIGHT, KEY_MINIMUMWIDTH, KEY_PREFERREDHEIGHT, KEY_PREFERREDWIDTH, KEY_PRINTFONT, KEY_PRINTFONTSCALE, KEY_PRINTSHAPESCALE, KEY_RESTORESHAPES, KEY_XFLIPIMAGE, KEY_YFLIPIMAGE, PRINTACTION, SAVEACTION, transform
 
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
JAltAzTelescope(ResourceSupplying prop)
          Use a property bering for construction.
 
Method Summary
 void init()
          After init, we add the azimuth/altitude grid.
protected  void paintObjects(Graphics g, AffineTransform af)
          After painting the objects, we draw the location of the telescope, if we have it.
private  void paintTelescope(Graphics2D g2d, Double azimuth, Double altitude, Double derot, Color telcol, double tsize, double dsize, AffineTransform af)
          Draw the telescope
 void setComposedProperties(ResourceSupplying prop)
          Defaults the grid steps and the prefereed size.
 void setTelescopeCurrent(double az, double alt)
          Sets a new position of the telescope.
 void setTelescopeCurrent(double az, double alt, double derotator)
          Sets a new position of the telescope and the derotator value.
 void setTelescopeDesired(double az, double alt)
          Sets a new desired position of the telescope.
 void setTelescopeDesired(double az, double alt, double derotator)
          Sets a new desired position of the telescope and the derotator value.
 
Methods inherited from class jview.JNormalizedCanvas
addCrossCursor, addDrawable, addDrawable, addDrawable, addDrawingInfo, addLink, addLink, addPoint, addPoint, addText, addText, allInside, applyDrawingInfo, assignCursorLabel, calculateShapeTransform, clearAllDrawable, clearAllText, clearDrawable, clearText, createCanvasCursor, disabledCanvas, drawPoints, drawPointsMap, drawShapes, drawShapesMap, drawText, drawTextMap, firePropertyChange, getActions, getAllCanvasCursors, getAnimationInfo, getArea, getBackground, getBackgroundImage, getCanvasCursor, getClosest, getClosest, getClosest, getClosestShape, getComposedProperties, getFromName, getImageOperation, getInside, getInsideShapes, getInverseTransform, getLink, getLinkedTo, getMaximumSize, getMinimumSize, getNormalized, getNormalizedRect, getPreferredSize, getSaveBuffer, getScreen, getScreenRect, getShapeTransform, getViewport, isEmpty, isFlipX, isFlipY, isNormalizedOnScreen, isScreenInNormalized, paintComponent, paintPointsList, paintShapesList, paintTextList, prepareCanvas, printComponent, removeDrawable, removeDrawable, removeLink, removeText, removeText, repaintLater, repaintNow, setBackgroundImage, setBounds, setComplete, setCursor, setCursor, setDrawable, setImageOperation, setLink, setPrepare, startAnimation, stopAnimation, wasReshaped
 
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, 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, 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, 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, setComponentOrientation, 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_AZIMUTHGRID

public static final String KEY_AZIMUTHGRID
A key to the azimuth steps in degrees.

See Also:
Constant Field Values

KEY_ALTITUDEGRID

public static final String KEY_ALTITUDEGRID
A key to the altitude steps in degrees.

See Also:
Constant Field Values

KEY_DESIREDCOLOR

public static final String KEY_DESIREDCOLOR
A key to the desired location color.

See Also:
Constant Field Values

KEY_TELESCOPECOLOR

public static final String KEY_TELESCOPECOLOR
A key to the telescope location color.

See Also:
Constant Field Values

KEY_TELESCOPESIZE

public static final String KEY_TELESCOPESIZE
A key to the normalized size of the telescope locator.

See Also:
Constant Field Values

KEY_DEROTATORSIZE

public static final String KEY_DEROTATORSIZE
A key to the normalized size of the derotator locator.

See Also:
Constant Field Values

DEFAZIMUTHGRID

private static final int DEFAZIMUTHGRID
Default azimuth steps.

See Also:
Constant Field Values

DEFALTITUDEGRID

private static final int DEFALTITUDEGRID
Default azimuth steps.

See Also:
Constant Field Values

DEFPREFERREDWIDTH

private static final int DEFPREFERREDWIDTH
Default preferred size.

See Also:
Constant Field Values

DEFPREFERREDHEIGHT

private static final int DEFPREFERREDHEIGHT
Default preferred size.

See Also:
Constant Field Values

DEFFOREGROUND

private static final Color DEFFOREGROUND
We paint white on black.


DEFBACKGROUND

private static final Color DEFBACKGROUND
We paint white on black.


DEFDESIREDCOLOR

private static final Color DEFDESIREDCOLOR
The color the telescope is drawn in.


DEFTELESCOPECOLOR

private static final Color DEFTELESCOPECOLOR
The color the telescope is drawn in.


DEFTELESCOPESIZE

private static final double DEFTELESCOPESIZE
The normalized diameter of the telescope locator ellipse.

See Also:
Constant Field Values

DEFDEROTATORSIZE

private static final double DEFDEROTATORSIZE
The normalized length of the derotator locator line.

See Also:
Constant Field Values

azimuthcur

private Double azimuthcur
The last azimuth of the telescope assigned to the canvas.


altitudecur

private Double altitudecur
The last altitude of the telescope assigned to the canvas.


derotcur

private Double derotcur
The last derotator position assigned to the canvas.


azimuthdes

private Double azimuthdes
The desired azimuth of the telescope assigned to the canvas.


altitudedes

private Double altitudedes
The desired altitude of the telescope assigned to the canvas.


derotdes

private Double derotdes
The desired derotator position assigned to the canvas.

Constructor Detail

JAltAzTelescope

public JAltAzTelescope(ResourceSupplying prop)
Use a property bering for construction.

Method Detail

setComposedProperties

public void setComposedProperties(ResourceSupplying prop)
Defaults the grid steps and the prefereed size.

Specified by:
setComposedProperties in interface ResourceAware
Overrides:
setComposedProperties in class JNormalizedCanvas

init

public void init()
After init, we add the azimuth/altitude grid.

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

paintObjects

protected void paintObjects(Graphics g,
                            AffineTransform af)
After painting the objects, we draw the location of the telescope, if we have it.

Overrides:
paintObjects in class JNormalizedCanvas

paintTelescope

private void paintTelescope(Graphics2D g2d,
                            Double azimuth,
                            Double altitude,
                            Double derot,
                            Color telcol,
                            double tsize,
                            double dsize,
                            AffineTransform af)
Draw the telescope


setTelescopeCurrent

public void setTelescopeCurrent(double az,
                                double alt)
Sets a new position of the telescope.


setTelescopeCurrent

public void setTelescopeCurrent(double az,
                                double alt,
                                double derotator)
Sets a new position of the telescope and the derotator value.


setTelescopeDesired

public void setTelescopeDesired(double az,
                                double alt)
Sets a new desired position of the telescope.


setTelescopeDesired

public void setTelescopeDesired(double az,
                                double alt,
                                double derotator)
Sets a new desired position of the telescope and the derotator value.