JEphem site
tig API
Build classes

jephem.tools
Class Curve

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--jephem.tools.Curve
All Implemented Interfaces:
javax.accessibility.Accessible, GeneralConstants, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, SpaceConstants

public class Curve
extends javax.swing.JPanel
implements SpaceConstants, GeneralConstants

Visual representation of curve plotting.
A Curve is a JPanel, so it can be used directly, but CurveViewer, contains the controls surrounding a Curve.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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 jephem.astro.spacetime.SpaceConstants
CARTESIAN, COORD_V0, COORD_V1, COORD_V2, COORD_X0, COORD_X1, COORD_X2, COORDGROUP_DELTA_BETA_LAMBDA, COORDGROUP_DIST_ALPHA_DELTA, COORDGROUP_RLB, COORDGROUP_XYZ, FRAME_EC_HELIO_GEOMETRIC, FRAME_ECLIPTIC, FRAME_EQUATORIAL, FRAME_GALACTIC, FRAME_HORIZONTAL_TOPOCENTRIC, FRAME_THEORY, LIGHT_VELOCITY, NB_COORDS, SPHERICAL
 
Fields inherited from interface tig.GeneralConstants
BLANK, FS, LS, NO_SPECIF, SPACE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Curve(double[][] data)
          Constructor from an array containing at the same time X and Y values.
 
Method Summary
 double[][] getAllY()
          Returns the values of the Y axis, for all the curves.
 double[][] getData()
          Returns the data displayed by this curve.
 double getNbX()
          Returns the number of X values.
 double getNbY()
          Returns the number of curves held by this Curve .
 double[] getXValues()
          Returns the values of the X axis.
 double[] getY(int whichY)
          Returns the values of the Y axis for the requested curve.
 double getY(int whichY, double x)
          Returns the values of the Y axis for the requested curve.
 void paintComponent(java.awt.Graphics g)
          Paints the curve on its display area.
 void setData(double[][] data)
          Sets the data displayed by this curve.
 java.lang.String toString()
          Returns a String representation of this curve.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Curve

public Curve(double[][] data)
Constructor from an array containing at the same time X and Y values.
Meaning of parameter 'data' :
data[0] contains the values of the X axis ;
data[1] contains the values of the first quantity on the Y axis ;
data[2] contains the values of the second quantity on the Y axis ;
etc...

Throws:
java.lang.IllegalArgumentException - if the arrays data[0], data[1] etc... are not all of the same length (for all represented curves, a y value must correspond to a x value).
Method Detail

getAllY

public double[][] getAllY()
Returns the values of the Y axis, for all the curves.


getData

public double[][] getData()
Returns the data displayed by this curve.
If the returned value is called 'data' :
data[0] contains the values of the X axis ;
data[1] contains the values of the first curve on the Y axis ;
data[2] contains the values of the second curve on the Y axis ;
etc...


getNbX

public double getNbX()
Returns the number of X values.


getNbY

public double getNbY()
Returns the number of curves held by this Curve .


getXValues

public double[] getXValues()
Returns the values of the X axis.


getY

public double[] getY(int whichY)
Returns the values of the Y axis for the requested curve.

Parameters:
whichY - index of the requested curve, starting to 1.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the whichYth curve does not exist.

getY

public double getY(int whichY,
                   double x)
Returns the values of the Y axis for the requested curve. A Lagrange polynom is used to interpolate.

Parameters:
whichY - index of the requested curve, starting to 1.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the whichYth curve does not exist.

paintComponent

public void paintComponent(java.awt.Graphics g)
Paints the curve on its display area.

Overrides:
paintComponent in class javax.swing.JComponent

setData

public void setData(double[][] data)
Sets the data displayed by this curve.


toString

public java.lang.String toString()
Returns a String representation of this curve.

Overrides:
toString in class java.awt.Component

JEphem site
tig API
Build classes