public class ASTCharts
extends javax.swing.JComponent
Copyright (c) 2018
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static boolean |
BLACK_BKG
Draw black background for chart
|
static boolean |
EQ_CHART
Draw equatorial coordinates chart
|
static boolean |
HORIZ_CHART
Draw horizon coordinates chart
|
static boolean |
WHITE_BKG
Draw white background for chart
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ASTCharts(javax.swing.JComponent canvas)
This constructor creates a Star Chart instance and saves the component that
the calling routine sent to be used as the drawing canvas.
|
Modifier and Type | Method and Description |
---|---|
void |
drawLabelAltAz(java.lang.String txt,
double Alt,
double Az,
java.awt.Color penColor)
This method labels an object located at Alt, Az.
|
void |
drawLabelRADecl(java.lang.String txt,
double RA,
double Decl,
java.awt.Color penColor)
This method labels an object located at RA, Decl.
|
java.awt.Graphics2D |
initDrawingCanvas(java.awt.Dimension d,
boolean bkgWhite,
boolean eqChart)
Initialize a drawing canvas area for a star chart.
|
void |
paintComponent(java.awt.Graphics g)
This method renders the buffered image to the screen in the screen area
given when an instance of this class was created.
|
void |
plotAltAz(double Alt,
double Az,
double mV)
Plot an object, given its horizon coordinates, on a
circular plotting surface.
|
void |
plotAltAz(double Alt,
double Az,
double mV,
java.awt.Color penColor)
Plot an object, given its horizon coordinates, on a
circular plotting surface.
|
void |
plotRADecl(double RA,
double Decl,
double mV)
Plot an object, given its equatorial coordinates, on
a rectangular plotting surface.
|
void |
plotRADecl(double RA,
double Decl,
double mV,
java.awt.Color penColor)
Plot an object, given its equatorial coordinates, on
a rectangular plotting surface.
|
void |
refreshChart()
Refresh a star chart.
|
void |
releaseChart()
When a star chart is no longer to be displayed, this method releases all
resources associated with the star chart to avoid memory leaks.
|
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCycle
public static final boolean EQ_CHART
public static final boolean HORIZ_CHART
public static final boolean WHITE_BKG
public static final boolean BLACK_BKG
public ASTCharts(javax.swing.JComponent canvas)
canvas
- area in GUI to use for a drawing canvaspublic void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void drawLabelAltAz(java.lang.String txt, double Alt, double Az, java.awt.Color penColor)
txt
- label to displayAlt
- altitude for the objectAz
- azimuth for the objectpenColor
- color to use for the text
Note: This method does not attempt to draw
a label if the coordinates are below the
observer's horizon.public void drawLabelRADecl(java.lang.String txt, double RA, double Decl, java.awt.Color penColor)
txt
- label to displayRA
- right ascension for the objectDecl
- declination for the objectpenColor
- color to use for the textpublic java.awt.Graphics2D initDrawingCanvas(java.awt.Dimension d, boolean bkgWhite, boolean eqChart)
d
- size of the drawing canvas areabkgWhite
- WHITE_BKG if user wants a white background, else
use a black backgroundeqChart
- EQ_CHART if doing an equatorial coordinates chart,
otherwise do a horizon coordinates chartpublic void plotAltAz(double Alt, double Az, double mV)
Alt
- altitude to plotAz
- azimuth to plotmV
- visual magnitude of the objectpublic void plotAltAz(double Alt, double Az, double mV, java.awt.Color penColor)
Alt
- altitude to plotAz
- azimuth to plotmV
- visual magnitude of the objectpenColor
- color to use for plottingpublic void plotRADecl(double RA, double Decl, double mV, java.awt.Color penColor)
RA
- right ascension to plotDecl
- declination to plotmV
- visual magnitude of the objectpenColor
- color to use for plottingpublic void plotRADecl(double RA, double Decl, double mV)
RA
- right ascension to plotDecl
- declination to plotmV
- visual magnitude of the objectpublic void releaseChart()
public void refreshChart()