jview
Class JSkyCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jview.JNormalizedCanvas
                  extended by jview.JViewportCanvas
                      extended by jview.JFrameCanvas
                          extended by jview.JFitsCanvas
                              extended by jview.JSkyCanvas
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, NormalizedCoordinates, NormalizedShapes, UserCoordinates, Zoomable, Initializable, ResourceAware, ResourceComposed, Savable
Direct Known Subclasses:
JSkyGrid

public class JSkyCanvas
extends JFitsCanvas

A class that shows a finding chart. StarCatalogs can be added to the sky chart, and a fits-image can be applied as a background.

See Also:
Serialized Form

Nested Class Summary
static class JSkyCanvas.Display
          Test the functionality.
 
Nested classes/interfaces inherited from class jview.JFitsCanvas
JFitsCanvas.Show
 
Nested classes/interfaces inherited from class jview.JFrameCanvas
JFrameCanvas.Test
 
Nested classes/interfaces inherited from class jview.JViewportCanvas
JViewportCanvas.ViewportKey
 
Nested classes/interfaces inherited from class jview.JNormalizedCanvas
JNormalizedCanvas.ShowImage
 
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
static String A0
          Set name for stars later than .
static String A5
          Set name for stars later than .
static String B0
          Set name for stars later than .
static String B5
          Set name for stars later than .
private static SortedMap<Float,String> BVSPECTRUM
          A lookup-table for converting B-V to spectral class names.
private static String CATALOGCOLOR
          The action name for toggling the use of catalog colors.
static String CENTRAL
          Set name for center.
private static Color DEFBACKGROUND
          Default background color.
private static Color DEFCENTRALCOLOR
          Default central color.
private static boolean DEFFIXEDSTARSIZE
          Default B&W drawing.
private static Color DEFFOREGROUND
          Default foreground color, if no catalog color was retrieved.
private static boolean DEFMARKCENTER
          Default marking of center.
private static int DEFPREFERREDHEIGHT
          Default preferred height.
private static int DEFPREFERREDWIDTH
          Default preferred width.
private static boolean DEFUSECATALOGCOLOR
          Default B&W drawing.
static String F0
          Set name for stars later than .
static String F5
          Set name for stars later than .
static String G0
          Set name for stars later than .
static String G5
          Set name for stars later than .
static String K0
          Set name for stars later than .
static String K5
          Set name for stars later than .
static String KEY_CENTRALCOLOR
          The key to central source color.
static String KEY_FIXEDSTARSIZE
          True, if the stars should remain at their size at zooming.
static String KEY_MAGLIMIT
          The maximum mag to show.
static String KEY_MARKCENTER
          True, if the center of the chart should be marked.
static String KEY_USECATALOGCOLOR
          True, if the chart should be displayed in catalog colors only.
static String M0
          Set name for stars later than .
static String M5
          Set name for stars later than .
static String M8
          Set name for stars later than .
private static String MARKCENTER
          The action name for toggling the center marking.
static String MX
          Set name for the very red stars.
static String O
          Set name for stars later than .
private  Map<String,List<PointDraw>> pntcats
          The list of catalogs.
private static Map<String,Color> SPECTRALSETS
          A lookup-table for converting spectral sets names to drawing infos.
private  Map<String,List<ShapeDraw>> strcats
          The list of catalogs.
 
Fields inherited from class jview.JFitsCanvas
ARRAY, KEY_FORMATWCS, KEY_HIGHMODE, KEY_KEEP, KEY_LOWKEEP, KEY_LOWMODE, KEY_MAXMAGNIFY, KEY_NEVERESTIMATESIZE, KEY_RGBGRAY, KEY_SCALING, KEY_SMARTKEEP, KEY_XTENSION, KEY_XTENSIONFLIP, WCS
 
Fields inherited from class jview.JFrameCanvas
KEY_ABSOLUTEHEIGHT, KEY_ABSOLUTEWIDTH, KEY_DRAWBOX, KEY_RELATIVEHEIGHT, KEY_RELATIVEWIDTH, KEY_TITLECOLOR, KEY_TITLEFONT, KEY_TITLEJUSTIFY, KEY_TITLEOFFSET, KEY_TITLETEXT, KEY_TOPCOLOR, KEY_TOPFONT, KEY_TOPJUSTIFY, KEY_TOPOFFSET, KEY_TOPSEPARATOR, KEY_TOPTEXT, KEY_XFRAME, KEY_XINSETABSOLUTE, KEY_XINSETRELATIVE, KEY_YFRAME, KEY_YINSETABSOLUTE, KEY_YINSETRELATIVE
 
Fields inherited from class jview.JViewportCanvas
MAXVIEW, VIEWPORTIMAGEPROPERTY, VIEWPORTPROPERTY
 
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
JSkyCanvas(ResourceSupplying prop)
          Calls the superconstructor with no arguments.
 
Method Summary
 void addCatalog(StarCatalog cat, boolean usebv)
          Adds a catalog.
private  void addMark()
          Adds the central mark.
protected  void drawShapes(Graphics2D g2d, AffineTransform af)
          We draw ourselfes by also showing the catalogs.
 void init()
          Adds the grid and constellation drawing info.
 boolean isEmpty()
          Returns true if all drawable objects have no entries.
 boolean removeCatalog(String name)
          Removes a catalog by name.
private  boolean removeFrom(String name, Map<String,?> catalogs)
          Removes a catalog by name.
 void setComposedProperties(ResourceSupplying prop)
          Sets the composed properties of this component.
 void setSection(double ra, double de, double xs, double ys)
          Sets a new center of the sky chart.
 Action toggleCenterDraw()
          Toggles black&white drawing.
 Action toggleUseCatalogColor()
          Toggles black&white drawing.
 
Methods inherited from class jview.JFitsCanvas
clearHistogram, getArrayTransformation, getBinning, getDisplay, getDisplayDivide, getDisplayMap, getFits, getFITSImageBits, getFITSImageData, getFITSImageSize, getFITSImageValue, getFraction, getHdu, getHistogram, getHistogramBounds, getOffset, getPreferredSize, getScaling, getSkyTransformation, getTotalSize, getUserTransformation, getUserTransformation, getXtensionCount, reconstructHdu, revertFromFits, revertImage, scanFits, setFits, setFraction, setHistogramBounds, setScaling, setTotalSize, setUserTransformation, setUserTransformation, silentlySelectViewport
 
Methods inherited from class jview.JFrameCanvas
calculateActiveCanvas, calculateShapeTransform, getArea, isScreenInNormalized, paintObjects, prepareCanvas, wasReshaped
 
Methods inherited from class jview.JViewportCanvas
addAttachedViewport, addZoom, getViewport, getViewportImage, isMaximalViewport, isNormalizedOnScreen, removeAttachedViewport, resetViewport, selectArea, selectViewport, setViewportImage, transferView
 
Methods inherited from class jview.JNormalizedCanvas
addCrossCursor, addDrawable, addDrawable, addDrawable, addDrawingInfo, addLink, addLink, addPoint, addPoint, addText, addText, allInside, applyDrawingInfo, assignCursorLabel, clearAllDrawable, clearAllText, clearDrawable, clearText, createCanvasCursor, disabledCanvas, drawPoints, drawPointsMap, drawShapesMap, drawText, drawTextMap, firePropertyChange, getActions, getAllCanvasCursors, getAnimationInfo, getBackground, getBackgroundImage, getCanvasCursor, getClosest, getClosest, getClosest, getClosestShape, getComposedProperties, getFromName, getImageOperation, getInside, getInsideShapes, getInverseTransform, getLink, getLinkedTo, getMaximumSize, getMinimumSize, getNormalized, getNormalizedRect, getSaveBuffer, getScreen, getScreenRect, getShapeTransform, isFlipX, isFlipY, paintComponent, paintPointsList, paintShapesList, paintTextList, printComponent, removeDrawable, removeDrawable, removeLink, removeText, removeText, repaintLater, repaintNow, setBackgroundImage, setBounds, setComplete, setCursor, setCursor, setDrawable, setImageOperation, setLink, setPrepare, startAnimation, stopAnimation
 
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
 
Methods inherited from interface jview.NormalizedCoordinates
getArea, getNormalized, getNormalizedRect, getScreen, getScreenRect, getViewport, isNormalizedOnScreen, isScreenInNormalized
 

Field Detail

MX

public static final String MX
Set name for the very red stars.

See Also:
Constant Field Values

M8

public static final String M8
Set name for stars later than .

See Also:
Constant Field Values

M5

public static final String M5
Set name for stars later than .

See Also:
Constant Field Values

M0

public static final String M0
Set name for stars later than .

See Also:
Constant Field Values

K5

public static final String K5
Set name for stars later than .

See Also:
Constant Field Values

K0

public static final String K0
Set name for stars later than .

See Also:
Constant Field Values

G5

public static final String G5
Set name for stars later than .

See Also:
Constant Field Values

G0

public static final String G0
Set name for stars later than .

See Also:
Constant Field Values

F5

public static final String F5
Set name for stars later than .

See Also:
Constant Field Values

F0

public static final String F0
Set name for stars later than .

See Also:
Constant Field Values

A5

public static final String A5
Set name for stars later than .

See Also:
Constant Field Values

A0

public static final String A0
Set name for stars later than .

See Also:
Constant Field Values

B5

public static final String B5
Set name for stars later than .

See Also:
Constant Field Values

B0

public static final String B0
Set name for stars later than .

See Also:
Constant Field Values

O

public static final String O
Set name for stars later than .

See Also:
Constant Field Values

CENTRAL

public static final String CENTRAL
Set name for center.

See Also:
Constant Field Values

KEY_MAGLIMIT

public static final String KEY_MAGLIMIT
The maximum mag to show.

See Also:
Constant Field Values

KEY_MARKCENTER

public static final String KEY_MARKCENTER
True, if the center of the chart should be marked.

See Also:
Constant Field Values

KEY_USECATALOGCOLOR

public static final String KEY_USECATALOGCOLOR
True, if the chart should be displayed in catalog colors only.

See Also:
Constant Field Values

KEY_FIXEDSTARSIZE

public static final String KEY_FIXEDSTARSIZE
True, if the stars should remain at their size at zooming.

See Also:
Constant Field Values

KEY_CENTRALCOLOR

public static final String KEY_CENTRALCOLOR
The key to central source color.

See Also:
Constant Field Values

CATALOGCOLOR

private static final String CATALOGCOLOR
The action name for toggling the use of catalog colors.

See Also:
Constant Field Values

MARKCENTER

private static final String MARKCENTER
The action name for toggling the center marking.

See Also:
Constant Field Values

DEFPREFERREDWIDTH

private static final int DEFPREFERREDWIDTH
Default preferred width.

See Also:
Constant Field Values

DEFPREFERREDHEIGHT

private static final int DEFPREFERREDHEIGHT
Default preferred height.

See Also:
Constant Field Values

DEFMARKCENTER

private static final boolean DEFMARKCENTER
Default marking of center.

See Also:
Constant Field Values

DEFUSECATALOGCOLOR

private static final boolean DEFUSECATALOGCOLOR
Default B&W drawing.

See Also:
Constant Field Values

DEFFIXEDSTARSIZE

private static final boolean DEFFIXEDSTARSIZE
Default B&W drawing.

See Also:
Constant Field Values

DEFFOREGROUND

private static final Color DEFFOREGROUND
Default foreground color, if no catalog color was retrieved.


DEFBACKGROUND

private static final Color DEFBACKGROUND
Default background color.


DEFCENTRALCOLOR

private static final Color DEFCENTRALCOLOR
Default central color.


BVSPECTRUM

private static final SortedMap<Float,String> BVSPECTRUM
A lookup-table for converting B-V to spectral class names.


SPECTRALSETS

private static final Map<String,Color> SPECTRALSETS
A lookup-table for converting spectral sets names to drawing infos.


pntcats

private Map<String,List<PointDraw>> pntcats
The list of catalogs. Each entry maps catalog name to shapes list.


strcats

private Map<String,List<ShapeDraw>> strcats
The list of catalogs. Each entry maps catalog name to shapes list.

Constructor Detail

JSkyCanvas

public JSkyCanvas(ResourceSupplying prop)
Calls the superconstructor with no arguments.

Parameters:
ra - Right ascension of the center of projection, degrees.
de - Declination of the center of projection, degrees.
width - Field-of-view width in degrees.
height - Field-of-view height in degrees.
Method Detail

setComposedProperties

public void setComposedProperties(ResourceSupplying prop)
Sets the composed properties of this component. Defaults the preferred size, the centerdraw toggle, the field-of-view and the B&W drawing.

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

init

public void init()
Adds the grid and constellation drawing info.

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

addMark

private void addMark()
Adds the central mark.


toggleUseCatalogColor

public Action toggleUseCatalogColor()
Toggles black&white drawing.


toggleCenterDraw

public Action toggleCenterDraw()
Toggles black&white drawing.


setSection

public void setSection(double ra,
                       double de,
                       double xs,
                       double ys)
Sets a new center of the sky chart. Catalogs are not updated, but all entries are deleted.

Parameters:
ra - Right ascension of center, degrees.
de - Declination of center, degrees.
xs - Field width in degrees.
ys - Field height in degrees.

addCatalog

public void addCatalog(StarCatalog cat,
                       boolean usebv)
Adds a catalog. Additionally, the shapes list is prepared to allow fast painting of the component. The star list had to be added prior to a call to this method.

Parameters:
cat - The catalog to add
usebv - If true, the catalog is split into different colors using the b-v of the stars.

removeCatalog

public boolean removeCatalog(String name)
Removes a catalog by name. Each shapes catalog that has a starting value like the catalog name is removed.

Returns:
True if the catalog was present.

removeFrom

private boolean removeFrom(String name,
                           Map<String,?> catalogs)
Removes a catalog by name. Each shapes catalog that has a starting value like the catalog name is removed.

Returns:
True if the catalog was present.

isEmpty

public boolean isEmpty()
Returns true if all drawable objects have no entries.

Overrides:
isEmpty in class JNormalizedCanvas

drawShapes

protected void drawShapes(Graphics2D g2d,
                          AffineTransform af)
We draw ourselfes by also showing the catalogs.

Overrides:
drawShapes in class JNormalizedCanvas