Class Panel3D

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--Panel3D

public class Panel3D
extends java.awt.Panel
implements java.awt.event.MouseMotionListener, java.lang.Runnable, java.awt.event.ItemListener

Panel3D uses a pseudo 3d projection (no perspective) to display 3d points on its 2D canvas

See Also:
Serialized Form

Field Summary
 double phi
          The value of phi for the spherical coordinates (declination from the positive Z axis)
 double ro
          The value of ro for the spherical coordinates (radius) - Since perspective is unused this variable is unused
static double[] sat
          Array for the state vector of the satellite - will point to Cannibal class' array
static double[][] stars
          Array to hold all of the stars - will point to Cannibal class' array
static double[][] starsC
          Array to hold all of the stars centered about the satellite to avoid synchronization issues.
 double theta
          The value of theta for the spherical coordinates (right-ascension)
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Panel3D(boolean centered)
          Get a new Panel3D - either centered or not
 
Method Summary
static double[] coordXform(double x, double y, double z, double u, double v, double w, double theta, double phi, double psi)
          Get the positions of x,y,z defined in an inertial in a new frame centered at u,v,w of the intertial frame with the following roations:
angle psi about the z axis
angle theta about the transformed x axis
angle phi about the transformed y axis
 java.awt.Point data3DToScreen(double x, double y, double z)
          Get a point in the screens coordinates from a 3D point in world coordinates
 java.awt.Point dataToScreen(double x, double y)
          Scale a 2D point to the plotting plane
 void itemStateChanged(java.awt.event.ItemEvent e)
          Receive a change in item state - calls a repaint
 void mouseDragged(java.awt.event.MouseEvent e)
          receive mouseDragged event
 void mouseMoved(java.awt.event.MouseEvent e)
          receive mouseMoved event
 void paint(java.awt.Graphics g)
          Repaint method, calls update
 void run()
          The runnable method for this Panel3D, will simply update its graphics 10times per second until Cannibal's STOPFLAG is true
 void setDataBounds(double xmin, double xmax, double ymin, double ymax)
          Set the data bounds of this panel
 void update(java.awt.Graphics h)
          Renders graphics in a buffered image and draws it to the screen
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ro

public double ro
The value of ro for the spherical coordinates (radius) - Since perspective is unused this variable is unused

phi

public double phi
The value of phi for the spherical coordinates (declination from the positive Z axis)

theta

public double theta
The value of theta for the spherical coordinates (right-ascension)

stars

public static double[][] stars
Array to hold all of the stars - will point to Cannibal class' array

starsC

public static double[][] starsC
Array to hold all of the stars centered about the satellite to avoid synchronization issues. - will point to Cannibal class' array

sat

public static double[] sat
Array for the state vector of the satellite - will point to Cannibal class' array
Constructor Detail

Panel3D

public Panel3D(boolean centered)
Get a new Panel3D - either centered or not
Method Detail

run

public void run()
The runnable method for this Panel3D, will simply update its graphics 10times per second until Cannibal's STOPFLAG is true
Specified by:
run in interface java.lang.Runnable

paint

public void paint(java.awt.Graphics g)
Repaint method, calls update
Overrides:
paint in class java.awt.Container

update

public void update(java.awt.Graphics h)
Renders graphics in a buffered image and draws it to the screen
Overrides:
update in class java.awt.Container

dataToScreen

public java.awt.Point dataToScreen(double x,
                                   double y)
Scale a 2D point to the plotting plane

data3DToScreen

public java.awt.Point data3DToScreen(double x,
                                     double y,
                                     double z)
Get a point in the screens coordinates from a 3D point in world coordinates

coordXform

public static double[] coordXform(double x,
                                  double y,
                                  double z,
                                  double u,
                                  double v,
                                  double w,
                                  double theta,
                                  double phi,
                                  double psi)
Get the positions of x,y,z defined in an inertial in a new frame centered at u,v,w of the intertial frame with the following roations:
angle psi about the z axis
angle theta about the transformed x axis
angle phi about the transformed y axis

setDataBounds

public void setDataBounds(double xmin,
                          double xmax,
                          double ymin,
                          double ymax)
Set the data bounds of this panel

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
receive mouseMoved event
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
receive mouseDragged event
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Receive a change in item state - calls a repaint
Specified by:
itemStateChanged in interface java.awt.event.ItemListener