|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensourcephysics.display.DrawingPanel
org.opensourcephysics.display.InteractivePanel
org.opensourcephysics.display.PlottingPanel
public class PlottingPanel
A Drawing Panel that has an X axis, a Y axis, and a title.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.opensourcephysics.display.InteractivePanel |
---|
InteractivePanel.IADMouseController |
Nested classes/interfaces inherited from class org.opensourcephysics.display.DrawingPanel |
---|
DrawingPanel.ZoomBox |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class org.opensourcephysics.display.InteractivePanel |
---|
containsInteractive, interactive, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, mouseAction, mouseEvent |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PlottingPanel(int _xAxisType,
int _yAxisType)
Constructs a new PlottingPanel that uses the given X axis type and Y axis type. |
|
PlottingPanel(java.lang.String xlabel,
java.lang.String ylabel,
java.lang.String plotTitle)
Constructs a new PlottingPanel that uses the given X axis label, Y axis label, and plot title. |
|
PlottingPanel(java.lang.String xlabel,
java.lang.String ylabel,
java.lang.String plotTitle,
int xAxisType,
int yAxisType)
Constructs a new PlottingPanel with cartesian axes that use the given X axis label, Y axis label, and plot title. |
Method Summary | |
---|---|
protected void |
computeGutters()
Computes the size of the gutters using a Dimensioned object. |
DrawableAxes |
getAxes()
Gets the axes. |
Interactive |
getInteractive()
Gets the interactive drawable that was accessed by the last mouse event. |
static XML.ObjectLoader |
getLoader()
Returns an XML.ObjectLoader to save and load object data. |
java.awt.geom.AffineTransform |
getPixelTransform()
Gets the affine transformation that converts from world to pixel coordinates. |
boolean |
isLogScaleX()
Gets the logScaleX value. |
boolean |
isLogScaleY()
Gets the logScaleY value. |
protected void |
paintFirst(java.awt.Graphics g)
Paints before the panel iterates through its list of Drawables. |
double |
pixToX(int pix)
Converts pixel to x world units. |
double |
pixToY(int pix)
Converts pixel to x world units. |
void |
recomputeTransform()
Recomputes the pixel transforamtion based on the current minimum and maximum values and the gutters. |
void |
setAxes(DrawableAxes _axes)
Sets the axes. |
void |
setAxesVisible(boolean isVisible)
Sets the visibility of the axes. |
void |
setCartesian(java.lang.String xLabel,
java.lang.String yLabel,
java.lang.String plotTitle)
Converts this panel to cartesian coordinates. |
void |
setLogScale(boolean _logScaleX,
boolean _logScaleY)
Sets Cartesian axes to log scale. |
void |
setLogScaleX(boolean _logScaleX)
Sets Cartesian x-axes to log scale. |
void |
setLogScaleY(boolean _logScaleY)
Sets Cartesian axes to log scale. |
void |
setPixelScale()
Calculates min and max values and the affine transformation based on the current size of the panel and the squareAspect boolean. |
void |
setPolar(java.lang.String plotTitle,
double deltaR)
Converts this panel to polar coordinates |
void |
setTitle(java.lang.String title)
Sets the title. |
void |
setTitle(java.lang.String title,
java.lang.String font_name)
Sets the title and font. |
void |
setXLabel(java.lang.String label)
Sets the label for the X (horizontal) axis. |
void |
setXLabel(java.lang.String label,
java.lang.String font_name)
Sets the label and font for the X (horizontal) axis. |
void |
setYLabel(java.lang.String label)
Sets the label for the Y (vertical) axis. |
void |
setYLabel(java.lang.String label,
java.lang.String font_name)
Sets the label and font for the Y (vertical) axis. |
int |
xToPix(double x)
Converts x from world to pixel units. |
int |
yToPix(double y)
Converts y from world to pixel units. |
Methods inherited from class org.opensourcephysics.display.InteractivePanel |
---|
addDrawable, clear, getCurrentDraggable, getMouseAction, getMouseButton, getMouseClickCount, getMouseIntX, getMouseIntY, getMouseX, getMouseY, handleMouseAction, saveMouseEvent, setInteractiveMouseHandler, setShowCoordinates |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, 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, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
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 |
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, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PlottingPanel(java.lang.String xlabel, java.lang.String ylabel, java.lang.String plotTitle)
xlabel
- The X axis label.ylabel
- The Y axis label.plotTitle
- The plot title.public PlottingPanel(int _xAxisType, int _yAxisType)
_xAxisType
- The X axis type._yAxisType
- The Y axis type.public PlottingPanel(java.lang.String xlabel, java.lang.String ylabel, java.lang.String plotTitle, int xAxisType, int yAxisType)
xlabel
- The X axis label.ylabel
- The Y axis label.plotTitle
- The plot title.xAxisType
- Description of ParameteryAxisType
- Description of ParameterMethod Detail |
---|
public Interactive getInteractive()
getInteractive
in class InteractivePanel
public DrawableAxes getAxes()
public void setAxes(DrawableAxes _axes)
_axes
- the new axespublic void setPolar(java.lang.String plotTitle, double deltaR)
plotTitle
- StringdeltaR
- doublepublic void setCartesian(java.lang.String xLabel, java.lang.String yLabel, java.lang.String plotTitle)
xLabel
- StringyLabel
- StringplotTitle
- Stringpublic void setXLabel(java.lang.String label)
label
- the labelpublic void setYLabel(java.lang.String label)
label
- the labelpublic void setTitle(java.lang.String title)
title
- the titlepublic void setXLabel(java.lang.String label, java.lang.String font_name)
label
- the labelfont_name
- the optional new fontpublic void setYLabel(java.lang.String label, java.lang.String font_name)
label
- the labelfont_name
- the optional new fontpublic void setTitle(java.lang.String title, java.lang.String font_name)
title
- font_name
- the optional new fontpublic void setAxesVisible(boolean isVisible)
isVisible
- public void setLogScale(boolean _logScaleX, boolean _logScaleY)
_logScaleX
- The new logScale value_logScaleY
- The new logScale valuepublic void setLogScaleX(boolean _logScaleX)
_logScaleX
- The new logScale valuepublic boolean isLogScaleX()
public void setLogScaleY(boolean _logScaleY)
_logScaleY
- The new logScale valuepublic boolean isLogScaleY()
protected void computeGutters()
computeGutters
in class DrawingPanel
protected void paintFirst(java.awt.Graphics g)
paintFirst
in class DrawingPanel
g
- Graphicspublic double pixToX(int pix)
pixToX
in class DrawingPanel
pix
-
public int xToPix(double x)
xToPix
in class DrawingPanel
x
-
public double pixToY(int pix)
pixToY
in class DrawingPanel
pix
-
public int yToPix(double y)
yToPix
in class DrawingPanel
y
-
public void setPixelScale()
setPixelScale
in class DrawingPanel
public void recomputeTransform()
recomputeTransform
in class DrawingPanel
public java.awt.geom.AffineTransform getPixelTransform()
getPixelTransform
in class DrawingPanel
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |