stsci.sky
Class HTMPanel
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--stsci.sky.HTMPanel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable
- public class HTMPanel
- extends javax.swing.JPanel
- implements java.awt.event.MouseMotionListener, java.awt.event.ItemListener, java.awt.event.ActionListener, java.awt.event.MouseListener
Disply htm segment number for mouse click
- See Also:
- Serialized Form
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
component, containerListener, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
static double |
checkEdge(SpatialVector[] vert,
boolean oneEighty)
this code was to check the out lying points to stop wrap round
i.e a point at 180 could be -180 !
also convert to Galactic coordinates if needed |
void |
drawName(java.awt.Graphics g,
int id,
int[] xpoints,
int[] ypoints)
draw the name of the given triangle on the screen in an appropriate place |
protected void |
fix(java.awt.Point p,
double alpha,
double delta)
|
javax.swing.JPanel |
getHTMnum()
|
protected void |
getPlates()
|
protected void |
getPlateSizes()
|
void |
itemStateChanged(java.awt.event.ItemEvent evt)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Use translator to get list of HTMs crossed by drag motion
Then write em to the HTM panel - user may save them from there. |
void |
mouseEntered(java.awt.event.MouseEvent arg0)
|
void |
mouseExited(java.awt.event.MouseEvent arg0)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Use the translator to get a position for the x,y where the mouse is. |
void |
mousePressed(java.awt.event.MouseEvent arg0)
|
void |
mouseReleased(java.awt.event.MouseEvent arg0)
|
protected void |
plotFullHTM(java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
just plot all triangles |
protected void |
plotHTM(java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
|
void |
plotPlate(java.awt.Graphics g,
double dim,
double alpha,
double delta,
java.lang.String id)
|
void |
plotPlate(java.awt.Graphics g,
double dim,
java.lang.String id)
|
void |
plotPlates(java.awt.Graphics g)
|
void |
plotTriangle(java.awt.Graphics g,
int leafnum,
int id,
boolean oneEighty,
boolean galactic)
|
void |
plotTriangle(java.awt.Graphics g,
int id,
SpatialVector[] vert,
boolean oneEighty,
boolean galactic)
|
protected void |
plotTriangles(java.util.List l,
java.awt.Color c,
java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
|
protected void |
plotZoom(java.awt.Graphics g)
plot a box for the are which was zoomed out of
use alph delta and width to do it |
void |
refresh()
|
void |
setDepth(int d)
|
static int |
transposeEquitorial(SpatialVector[] vert,
SpatialIndex ind)
which leaf id would be at this galictic triangle |
static int |
transposeGalactic(SpatialVector[] vert,
SpatialIndex ind)
really this just means find a different triangle in the
other coordinate system - tried converting each vertex
but that does not work out well. |
int |
whichX(double somealpha)
|
int |
whichY(double somedelta)
|
Methods inherited from class javax.swing.JPanel |
, getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
epsilon
public static final double epsilon
plates
protected java.util.List plates
HTMnumber
protected javax.swing.JLabel HTMnumber
trans
protected PlotArea trans
index
protected SpatialIndex index
mkup
protected SpatialMarkup mkup
depth
protected int depth
save
protected int save
htmPan
protected javax.swing.JPanel htmPan
text
protected javax.swing.JTextArea text
wrapField
protected javax.swing.JTextField wrapField
plotHTM
protected boolean plotHTM
plotZoom
protected boolean plotZoom
plotNames
protected boolean plotNames
plotPlates
protected boolean plotPlates
plotAllPlates
protected boolean plotAllPlates
full
protected java.util.List full
part
protected java.util.List part
segNameList
protected java.util.List segNameList
selectedPoint
protected SpatialVector selectedPoint
selectedHTM
protected int selectedHTM
selectedHTMl
protected javax.swing.JLabel selectedHTMl
plate1
protected double plate1
plate2
protected double plate2
plotN
protected javax.swing.JCheckBox plotN
plotZ
protected javax.swing.JCheckBox plotZ
plotP
protected javax.swing.JCheckBox plotP
plotAP
protected javax.swing.JCheckBox plotAP
plot
protected javax.swing.JCheckBox plot
previousHTM
protected long previousHTM
dragList
protected java.lang.StringBuffer dragList
draged
protected boolean draged
galactic
protected boolean galactic
HTMPanel
public HTMPanel(PlotArea p)
getHTMnum
public javax.swing.JPanel getHTMnum()
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Use translator to get list of HTMs crossed by drag motion
Then write em to the HTM panel - user may save them from there.
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
- Parameters:
e
- - Returns:
- void
- Throws:
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Use the translator to get a position for the x,y where the mouse is. Display this in the labels. * @param e
- Specified by:
mouseMoved
in interface java.awt.event.MouseMotionListener
- Returns:
- void
- Throws:
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent evt)
- Specified by:
itemStateChanged
in interface java.awt.event.ItemListener
setDepth
public void setDepth(int d)
refresh
public void refresh()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
getPlates
protected void getPlates()
plotHTM
protected void plotHTM(java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
plotZoom
protected void plotZoom(java.awt.Graphics g)
- plot a box for the are which was zoomed out of
use alph delta and width to do it
plotTriangles
protected void plotTriangles(java.util.List l,
java.awt.Color c,
java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
plotTriangle
public void plotTriangle(java.awt.Graphics g,
int leafnum,
int id,
boolean oneEighty,
boolean galactic)
checkEdge
public static double checkEdge(SpatialVector[] vert,
boolean oneEighty)
- this code was to check the out lying points to stop wrap round
i.e a point at 180 could be -180 !
also convert to Galactic coordinates if needed
plotTriangle
public void plotTriangle(java.awt.Graphics g,
int id,
SpatialVector[] vert,
boolean oneEighty,
boolean galactic)
drawName
public void drawName(java.awt.Graphics g,
int id,
int[] xpoints,
int[] ypoints)
- draw the name of the given triangle on the screen in an appropriate place
whichX
public int whichX(double somealpha)
whichY
public int whichY(double somedelta)
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interface java.awt.event.MouseListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent arg0)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent arg0)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent arg0)
- Specified by:
mouseEntered
in interface java.awt.event.MouseListener
mouseExited
public void mouseExited(java.awt.event.MouseEvent arg0)
- Specified by:
mouseExited
in interface java.awt.event.MouseListener
plotPlates
public void plotPlates(java.awt.Graphics g)
getPlateSizes
protected void getPlateSizes()
plotPlate
public void plotPlate(java.awt.Graphics g,
double dim,
java.lang.String id)
plotPlate
public void plotPlate(java.awt.Graphics g,
double dim,
double alpha,
double delta,
java.lang.String id)
fix
protected void fix(java.awt.Point p,
double alpha,
double delta)
plotFullHTM
protected void plotFullHTM(java.awt.Graphics g,
boolean oneEighty,
boolean galactic)
- just plot all triangles
transposeGalactic
public static int transposeGalactic(SpatialVector[] vert,
SpatialIndex ind)
- really this just means find a different triangle in the
other coordinate system - tried converting each vertex
but that does not work out well.
Here we average the verteces to find an approximate center
then transpose that to galactic coords and find which htm is at that pos.
return the leaf number;
transposeEquitorial
public static int transposeEquitorial(SpatialVector[] vert,
SpatialIndex ind)
- which leaf id would be at this galictic triangle