artisynth.core.gui
Class NumericProbePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by artisynth.core.gui.NumericProbePanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class NumericProbePanel
extends javax.swing.JPanel

Author:
Chad Added to display a thin line for outputprobes, and not to display datapoints per John's request
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.awt.Color BlueViolet
           
static java.awt.Color[] colorList
           
static java.awt.Color DARK_GREEN
           
static java.awt.Color DarkOliveGreen
           
static java.awt.Color DarkOrange
           
static java.awt.Color IndianRed
           
 java.awt.Color[] myColorList
           
static java.awt.Color NavajoWhite
           
static java.awt.Color PeachPuff
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
NumericProbePanel(Probe probe)
           
 
Method Summary
 void adjustRangeIfNecessary()
           
 void decreaseRange()
          Decrease the range that is being viewed.
 void determineTimePerPixel()
           
 void determineYValuePerPixel()
           
 double[] getAutoRange()
           
 double[] getDefaultDomain()
           
 double[] getDefaultRange()
           
 double[] getDisplayDomain()
           
 double[] getDisplayRange()
           
 int getVectorSize()
           
 void increaseRange()
          Increase the range that is being viewed without any zooming constraints.
 boolean isAutoRanging()
           
 boolean isLargeDisplay()
           
 void moveDisplay(long xDistance, long yDistance)
          Move the display around when it is zoomed in on.
 void paint(java.awt.Graphics g)
           
 void repaint()
           
 void repaintForPropertyChanges()
          Repaint if probe property changes require it.
 void repaintWithoutAutoRanging()
           
 void resetColors()
           
 void resetDisplay()
           
 void resetDrawOrder(int size)
           
static double round(double d, int decimalPlace)
           
 double roundDouble(double value)
           
 void setAutoRange()
           
 void setAutoRanging(boolean enable)
           
 void setDefaultDomain()
           
 void setDefaultRange(double min, double max)
          Sets the default range to the desired value The default range is the range the probe display returns to after zooming.
 void setDisplayDomain(double min, double max)
           
 void setDisplayRange(double min, double max)
           
 void setDisplayRangeManually(double min, double max)
           
 void setDisplaySize(int width, int height)
           
 void setLargeDisplay(boolean isLargeDisplay)
           
 void setLineColor(int index, java.awt.Color color)
           
 void setSkipIndicies(boolean[] skip)
           
 void swapDrawIndicies(int a, int b)
           
 void toggleMoveDisplay()
           
 void toggleZoomIn()
           
 void toggleZoomOut()
           
 int virtualTimeToXpixel(double t)
          Returns the x pixel value corresponding to a particular virtual time.
 double xpixelToVirtualTime(int x)
          Returns the virtual time corresponding to a particular x pixel value.
 void zoomIn(java.awt.Point zoomPoint)
          Zoom in on a particular point on the numeric probe display.
 void zoomOut(java.awt.Point zoomPoint)
          Zoom out on a particular point on the numeric probe display.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DARK_GREEN

public static java.awt.Color DARK_GREEN

DarkOliveGreen

public static java.awt.Color DarkOliveGreen

IndianRed

public static java.awt.Color IndianRed

DarkOrange

public static java.awt.Color DarkOrange

BlueViolet

public static java.awt.Color BlueViolet

NavajoWhite

public static java.awt.Color NavajoWhite

PeachPuff

public static java.awt.Color PeachPuff

colorList

public static java.awt.Color[] colorList

myColorList

public java.awt.Color[] myColorList
Constructor Detail

NumericProbePanel

public NumericProbePanel(Probe probe)
Method Detail

isAutoRanging

public boolean isAutoRanging()

setAutoRanging

public void setAutoRanging(boolean enable)

setDisplaySize

public void setDisplaySize(int width,
                           int height)

toggleZoomIn

public void toggleZoomIn()

toggleZoomOut

public void toggleZoomOut()

toggleMoveDisplay

public void toggleMoveDisplay()

setAutoRange

public void setAutoRange()

getAutoRange

public double[] getAutoRange()

setDefaultRange

public void setDefaultRange(double min,
                            double max)
Sets the default range to the desired value The default range is the range the probe display returns to after zooming. Also sets the default range of the small probe display through the probe info.

Parameters:
min -
max -

getDefaultRange

public double[] getDefaultRange()

getDefaultDomain

public double[] getDefaultDomain()

setDefaultDomain

public void setDefaultDomain()

setDisplayRange

public void setDisplayRange(double min,
                            double max)

setDisplayRangeManually

public void setDisplayRangeManually(double min,
                                    double max)

getDisplayRange

public double[] getDisplayRange()

setDisplayDomain

public void setDisplayDomain(double min,
                             double max)

getDisplayDomain

public double[] getDisplayDomain()

resetDisplay

public void resetDisplay()

determineTimePerPixel

public void determineTimePerPixel()

determineYValuePerPixel

public void determineYValuePerPixel()

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

repaintWithoutAutoRanging

public void repaintWithoutAutoRanging()

repaintForPropertyChanges

public void repaintForPropertyChanges()
Repaint if probe property changes require it.


adjustRangeIfNecessary

public void adjustRangeIfNecessary()

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

round

public static double round(double d,
                           int decimalPlace)

roundDouble

public double roundDouble(double value)

swapDrawIndicies

public void swapDrawIndicies(int a,
                             int b)

zoomIn

public void zoomIn(java.awt.Point zoomPoint)
Zoom in on a particular point on the numeric probe display.

Parameters:
zoomPoint - The point to zoom in on.

zoomOut

public void zoomOut(java.awt.Point zoomPoint)
Zoom out on a particular point on the numeric probe display. Only zoom out as far as the original display range.

Parameters:
zoomPoint - The point to zoom out on.

moveDisplay

public void moveDisplay(long xDistance,
                        long yDistance)
Move the display around when it is zoomed in on. Constrain the movement to where the probe is displayed.

Parameters:
xDistance - The distance to move the display in pixels.
yDistance - The distance to move the display in pixels.

increaseRange

public void increaseRange()
Increase the range that is being viewed without any zooming constraints. This is different from zooming because we can increase the range past the original display range.


decreaseRange

public void decreaseRange()
Decrease the range that is being viewed. When the range is increased this function undoes those increases.


xpixelToVirtualTime

public double xpixelToVirtualTime(int x)
Returns the virtual time corresponding to a particular x pixel value.


virtualTimeToXpixel

public int virtualTimeToXpixel(double t)
Returns the x pixel value corresponding to a particular virtual time.


resetDrawOrder

public void resetDrawOrder(int size)

resetColors

public void resetColors()

setSkipIndicies

public void setSkipIndicies(boolean[] skip)

setLineColor

public void setLineColor(int index,
                         java.awt.Color color)

isLargeDisplay

public boolean isLargeDisplay()

setLargeDisplay

public void setLargeDisplay(boolean isLargeDisplay)

getVectorSize

public int getVectorSize()