|
||||||||||
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
A Drawing Panel that has an X axis, a Y axis, and a title.
Nested Class Summary |
Nested classes inherited from class org.opensourcephysics.display.InteractivePanel |
InteractivePanel.IADMouseController |
Nested classes inherited from class org.opensourcephysics.display.DrawingPanel |
DrawingPanel.ZoomBox |
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 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 org.opensourcephysics.display.DrawingPanel |
antialiasShapeOn, antialiasTextOn, autoscaleMargin, autoscaleX, autoscaleY, bgColor, blMessageBox, BOTTOM_LEFT, BOTTOM_RIGHT, bottomGutter, brMessageBox, clipAtGutter, coordinateStrBuilder, customInspector, decimalFormat, dimensionSetter, drawableList, enableZoom, fixedPixelPerUnit, glassPanel, glassPanelLayout, height, leftGutter, mouseController, offscreenImage, optionController, pixelMatrix, pixelTransform, popupmenu, propertiesItem, rightGutter, scientificFormat, showCoordinates, squareAspect, tlMessageBox, TOP_LEFT, TOP_RIGHT, topGutter, trMessageBox, validImage, viewRect, width, workingImage, xceil, xfloor, xmax, xmaxPreferred, xmin, xminPreferred, xPixPerUnit, yceil, yfloor, ymax, ymaxPreferred, ymin, yminPreferred, yPixPerUnit, zoomBox, zoomMode |
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.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
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. |
static PlottingPanel |
createPolarType1(java.lang.String plotTitle,
double deltaR)
Constructs a new PlottingPanel with polar type 1 axes using the given title. |
static PlottingPanel |
createPolarType2(java.lang.String plotTitle,
double deltaR)
Constructs a new PlottingPanel with polar type 2 axes using the given title. |
static PlottingPanel |
createType1(java.lang.String xlabel,
java.lang.String ylabel,
java.lang.String plotTitle)
Constructs a new PlottingPanel with cartesian type 1 axes using the given X axis label, Y axis label, and plot title. |
static PlottingPanel |
createType2(java.lang.String xlabel,
java.lang.String ylabel,
java.lang.String plotTitle)
Constructs a new PlottingPanel with cartesian type 2 axes using the given X axis label, Y axis label, and plot title. |
static PlottingPanel |
createType3(java.lang.String xlabel,
java.lang.String ylabel,
java.lang.String plotTitle)
Constructs a new PlottingPanel with cartesian type 3 axes using the given X axis label, Y axis label, and plot title. |
org.opensourcephysics.display.axes.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 |
setAxes(org.opensourcephysics.display.axes.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, 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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, 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 static PlottingPanel createType1(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 static PlottingPanel createType2(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 static PlottingPanel createPolarType1(java.lang.String plotTitle, double deltaR)
plotTitle
- the plot title.public static PlottingPanel createPolarType2(java.lang.String plotTitle, double deltaR)
plotTitle
- the plot title.public static PlottingPanel createType3(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 Interactive getInteractive()
getInteractive
in class InteractivePanel
public org.opensourcephysics.display.axes.DrawableAxes getAxes()
public void setAxes(org.opensourcephysics.display.axes.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 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 |