kcl.waterloo.graphics
Class GJAbstractGraph0
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.jdesktop.swingx.JXPanel
-
- kcl.waterloo.graphics.GJBasicPanel
-
- kcl.waterloo.graphics.GJAbstractGraph0
-
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, GJAxisSupportInterface, GJGraphInterface, GJLayerInterface<GJGraphInterface>, GJLinkableInterface, GJObservableInterface
- Direct Known Subclasses:
- GJAbstractGraph1
public abstract class GJAbstractGraph0 extends GJBasicPanel implements GJGraphInterface
This class is extended by the GJAbstractGraph class. Its presence as a separate class is cosmetic: it serves only to encapsulate methods that that serve to convert between pixels and axis coordinates.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class kcl.waterloo.graphics.GJBasicPanel
GJBasicPanel.LocalTransferable
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description GJAbstractGraph0()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.geom.Rectangle2DconvertPixelsToPosition(java.awt.geom.Rectangle2D r1)Returns a rectangle defined in axes units from a rectangle defined in pixels.java.awt.geom.Point2DgetOrigin()Gets the origin coordinates of the graph.doublegetOriginX()Returns the origin for the y-dimensiondoublegetOriginY()Returns the origin for the x-dimensiondoublegetPixelHeight()Returns the height of a pixel in graph coordinates.doublegetPixelWidth()Returns the width of a pixel in graph coordinates.doublegetXLeft()Returns the value displayed at the left of the x-axisdoublegetXMax()Returns the maximum value for the x-axis displaydoublegetXMin()Returns the minimum value for the x-axis displaydoublegetXRight()Returns the value displayed at the right of the x-axisdoublegetYBottom()Returns the value displayed at the bottom of the y-axisdoublegetYMax()Returns the maximum value for the x-axis displaydoublegetYMin()Returns the minimum value for the y-axis displaydoublegetYTop()Returns the value displayed at the top of the y-axisvoidsetOrigin(java.awt.geom.Point2D origin)Sets the origin of the graph.voidsetOriginX(double v)Sets the origin for the x-dimensionvoidsetOriginY(double v)Sets the origin for the y-dimensionvoidsetXLeft(double v)Sets the value displayed at the left of the x-axisvoidsetXRight(double v)Sets the value displayed at the right of the x-axisvoidsetYBottom(double v)Sets the value displayed at the bottom of the y-axisvoidsetYTop(double v)Sets the value displayed at the top of the y-axisdoublexPixelToPosition(double pixel)Convert a pixel location to a graph coordinate on the x-axis.double[]xPixelToPosition(double[] pixel)Convert an array of pixel locations to graph coordinates on the x-axis.double[]xPixelToPositioni(double[] pixel)Convert an array of pixel locations to graph coordinates on the x-axis.doublexPositionToPixel(double position)Convert an axis location to a pixel value This method does not compensate for rotation or zoom.double[]xPositionToPixel(double[] position)Convert an array of axis locations to a pixel values.double[]xPositionToPixeli(double[] position)Convert an array of axis locations to a pixel values.doubleyPixelToPosition(double pixel)Convert a pixel location to a graph coordinate on the y-axis.double[]yPixelToPosition(double[] pixel)Convert an array of pixel locations to graph coordinates on the y-axis.double[]yPixelToPositioni(double[] pixel)Convert an array of pixel locations to graph coordinates on the y-axis.doubleyPositionToPixel(double position)Convert an array of axis locations to a pixel values.double[]yPositionToPixel(double[] position)Convert an array of axis locations to a pixel values.double[]yPositionToPixeli(double[] position)Convert an array of axis locations to a pixel values.-
Methods inherited from class kcl.waterloo.graphics.GJBasicPanel
componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, getAllComponents, getID, getImage, getTransferable, getTransferable, isBackgroundPainted, isOnEDT, paintComponent, print, print, setBackgroundPainted, setID
-
Methods inherited from class org.jdesktop.swingx.JXPanel
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, isInheritAlpha, isPaintBorderInsets, paint, setAlpha, setBackgroundPainter, setInheritAlpha, setOpaque, setPaintBorderInsets, setScrollableHeightHint, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth, setScrollableWidthHint
-
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, hide, 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, 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, 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, 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, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface kcl.waterloo.graphics.GJGraphInterface
add, add, add, add, add, addListeners, autoScale, createAxes, fetchEditor, getGraphContainer, getMouseHandler, getMousePositionTextField, getPlots, getSelectedPlots, getXTransform, getYTransform, isPolar, isTextAsInverse, remove, saveAsXML, setBackgroundPainted, setEditor, setGraphContainer, setGraphContainer, setKeyAntialiasing, setMousePositionTextField, setPlots, setSelectedPlots, setTextAntialiasing, setTextAsInverse, setXTransform, setYTransform
-
Methods inherited from interface kcl.waterloo.graphics.GJLayerInterface
add, getAncestorGraph, getCurrentLayer, getCurrentLayerIndex, getLayer, getLayers, indexOf, setCurrentLayer, setCurrentLayerIndex
-
Methods inherited from interface kcl.waterloo.graphics.GJAxisSupportInterface
format, formatXAxisLabel, formatYAxisLabel, getAxesBounds, getAxisColor, getAxisMouseHandler, getAxisStrokeWeight, getBottomAxisPanel, getCategoricalLabels, getLeftAxisPanel, getMajorGridColor, getMajorGridStrokeWeight, getMajorXHint, getMajorYHint, getMinorCountXHint, getMinorCountYHint, getMinorGridColor, getMinorGridStrokeWeight, getRightAxisPanel, getTopAxisPanel, getXAxisLabelRotation, getXLabel, getYAxisLabelRotation, getYLabel, isBottomAxisLabelled, isBottomAxisPainted, isCategorical, isInnerAxisLabelled, isInnerAxisPainted, isLeftAxisLabelled, isLeftAxisPainted, isMajorGridPainted, isMinorGridPainted, isRightAxisLabelled, isRightAxisPainted, isTopAxisLabelled, isTopAxisPainted, isXReversed, isYReversed, setAxesBounds, setAxisColor, setAxisStrokeWeight, setBottomAxisLabelled, setBottomAxisPainted, setInnerAxisLabelled, setInnerAxisPainted, setLeftAxisLabelled, setLeftAxisPainted, setMajorGridColor, setMajorGridPainted, setMajorGridStrokeWeight, setMajorXHint, setMajorXHint, setMajorYHint, setMajorYHint, setMinorCountXHint, setMinorCountYHint, setMinorGridColor, setMinorGridPainted, setMinorGridStrokeWeight, setReverseX, setReverseY, setRightAxisLabelled, setRightAxisPainted, setTopAxisLabelled, setTopAxisPainted, setXLabel, setYLabel
-
Methods inherited from interface kcl.waterloo.observable.GJObservableInterface
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface kcl.waterloo.observable.GJLinkableInterface
addLink, getLinks, removeLink, setLinks
-
-
-
-
Method Detail
-
yPositionToPixel
public final double yPositionToPixel(double position)
Description copied from interface:GJGraphInterfaceConvert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.- Specified by:
yPositionToPixelin interfaceGJGraphInterface- Parameters:
position- on y-axis- Returns:
- pixel locations on y
-
yPositionToPixel
public final double[] yPositionToPixel(double[] position)
Description copied from interface:GJGraphInterfaceConvert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.- Specified by:
yPositionToPixelin interfaceGJGraphInterface- Parameters:
position- on y-axis- Returns:
- pixel locations on y
-
yPositionToPixeli
public final double[] yPositionToPixeli(double[] position)
Description copied from interface:GJGraphInterfaceConvert an array of axis locations to a pixel values. The conversion may be done in-place, thus destroying the input values. This method does not compensate for rotation or zoom.- Specified by:
yPositionToPixeliin interfaceGJGraphInterface- Parameters:
position- on y-axis- Returns:
- pixel locations on y
-
xPositionToPixel
public final double xPositionToPixel(double position)
Description copied from interface:GJGraphInterfaceConvert an axis location to a pixel value This method does not compensate for rotation or zoom.- Specified by:
xPositionToPixelin interfaceGJGraphInterface- Parameters:
position- on x-axis- Returns:
- pixel location on x
-
xPositionToPixel
public final double[] xPositionToPixel(double[] position)
Description copied from interface:GJGraphInterfaceConvert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.- Specified by:
xPositionToPixelin interfaceGJGraphInterface- Parameters:
position- on x-axis- Returns:
- pixel locations on x
-
xPositionToPixeli
public final double[] xPositionToPixeli(double[] position)
Description copied from interface:GJGraphInterfaceConvert an array of axis locations to a pixel values. The conversion may be done in-place, thus destroying the input values. This method does not compensate for rotation or zoom.- Specified by:
xPositionToPixeliin interfaceGJGraphInterface- Parameters:
position- on x-axis- Returns:
- pixel locations on x
-
xPixelToPosition
public final double xPixelToPosition(double pixel)
Description copied from interface:GJGraphInterfaceConvert a pixel location to a graph coordinate on the x-axis. This method does not compensate for rotation or zoom.- Specified by:
xPixelToPositionin interfaceGJGraphInterface- Parameters:
pixel- location on x- Returns:
- the position on the x-axis
-
xPixelToPosition
public final double[] xPixelToPosition(double[] pixel)
Description copied from interface:GJGraphInterfaceConvert an array of pixel locations to graph coordinates on the x-axis. This method does not compensate for rotation or zoom.- Specified by:
xPixelToPositionin interfaceGJGraphInterface- Parameters:
pixel- location on x- Returns:
- the positions on the x-axis
-
xPixelToPositioni
public final double[] xPixelToPositioni(double[] pixel)
Description copied from interface:GJGraphInterfaceConvert an array of pixel locations to graph coordinates on the x-axis. The conversion may be done in-place, so the input data are destroyed in the process. This method does not compensate for rotation or zoom.- Specified by:
xPixelToPositioniin interfaceGJGraphInterface- Parameters:
pixel- location on x- Returns:
- the positions on the x-axis
-
getPixelWidth
public final double getPixelWidth()
Description copied from interface:GJGraphInterfaceReturns the width of a pixel in graph coordinates. This method does not compensate for rotation or zoom.- Specified by:
getPixelWidthin interfaceGJGraphInterface- Returns:
- the value
-
convertPixelsToPosition
public final java.awt.geom.Rectangle2D convertPixelsToPosition(java.awt.geom.Rectangle2D r1)
Description copied from interface:GJGraphInterfaceReturns a rectangle defined in axes units from a rectangle defined in pixels.- Specified by:
convertPixelsToPositionin interfaceGJGraphInterface- Parameters:
r1- a Rectangle2D in pixels- Returns:
- a Rectangle2D in axes units
-
yPixelToPosition
public final double yPixelToPosition(double pixel)
Description copied from interface:GJGraphInterfaceConvert a pixel location to a graph coordinate on the y-axis. This method does not compensate for rotation or zoom.- Specified by:
yPixelToPositionin interfaceGJGraphInterface- Parameters:
pixel- location on y- Returns:
- the position on the y-axis
-
yPixelToPosition
public final double[] yPixelToPosition(double[] pixel)
Description copied from interface:GJGraphInterfaceConvert an array of pixel locations to graph coordinates on the y-axis. This method does not compensate for rotation or zoom.- Specified by:
yPixelToPositionin interfaceGJGraphInterface- Parameters:
pixel- location on y- Returns:
- the positions on the y-axis
-
yPixelToPositioni
public final double[] yPixelToPositioni(double[] pixel)
Description copied from interface:GJGraphInterfaceConvert an array of pixel locations to graph coordinates on the y-axis. The conversion may be done in-place, so the input data are destroyed in the process. This method does not compensate for rotation or zoom.- Specified by:
yPixelToPositioniin interfaceGJGraphInterface- Parameters:
pixel- location on y- Returns:
- the positions on the y-axis
-
getPixelHeight
public final double getPixelHeight()
Description copied from interface:GJGraphInterfaceReturns the height of a pixel in graph coordinates. This method does not compensate for rotation or zoom.- Specified by:
getPixelHeightin interfaceGJGraphInterface- Returns:
- the value
-
getXLeft
public final double getXLeft()
Description copied from interface:GJAxisSupportInterfaceReturns the value displayed at the left of the x-axis- Specified by:
getXLeftin interfaceGJAxisSupportInterface- Returns:
- the value
-
setXLeft
public final void setXLeft(double v)
Description copied from interface:GJAxisSupportInterfaceSets the value displayed at the left of the x-axis- Specified by:
setXLeftin interfaceGJAxisSupportInterface- Parameters:
v- the value
-
getXRight
public final double getXRight()
Description copied from interface:GJAxisSupportInterfaceReturns the value displayed at the right of the x-axis- Specified by:
getXRightin interfaceGJAxisSupportInterface- Returns:
- the value
-
setXRight
public final void setXRight(double v)
Description copied from interface:GJAxisSupportInterfaceSets the value displayed at the right of the x-axis- Specified by:
setXRightin interfaceGJAxisSupportInterface- Parameters:
v- the value
-
getYBottom
public final double getYBottom()
Description copied from interface:GJAxisSupportInterfaceReturns the value displayed at the bottom of the y-axis- Specified by:
getYBottomin interfaceGJAxisSupportInterface- Returns:
- the value
-
setYBottom
public final void setYBottom(double v)
Description copied from interface:GJAxisSupportInterfaceSets the value displayed at the bottom of the y-axis- Specified by:
setYBottomin interfaceGJAxisSupportInterface- Parameters:
v- the value
-
getYTop
public final double getYTop()
Description copied from interface:GJAxisSupportInterfaceReturns the value displayed at the top of the y-axis- Specified by:
getYTopin interfaceGJAxisSupportInterface- Returns:
- the value
-
setYTop
public final void setYTop(double v)
Description copied from interface:GJAxisSupportInterfaceSets the value displayed at the top of the y-axis- Specified by:
setYTopin interfaceGJAxisSupportInterface- Parameters:
v- the value
-
getXMin
public final double getXMin()
Description copied from interface:GJAxisSupportInterfaceReturns the minimum value for the x-axis display- Specified by:
getXMinin interfaceGJAxisSupportInterface- Returns:
- the value
-
getXMax
public final double getXMax()
Description copied from interface:GJAxisSupportInterfaceReturns the maximum value for the x-axis display- Specified by:
getXMaxin interfaceGJAxisSupportInterface- Returns:
- the value
-
getYMin
public final double getYMin()
Description copied from interface:GJAxisSupportInterfaceReturns the minimum value for the y-axis display- Specified by:
getYMinin interfaceGJAxisSupportInterface- Returns:
- the value
-
getYMax
public final double getYMax()
Description copied from interface:GJAxisSupportInterfaceReturns the maximum value for the x-axis display- Specified by:
getYMaxin interfaceGJAxisSupportInterface- Returns:
- the value
-
getOriginX
public final double getOriginX()
Description copied from interface:GJAxisSupportInterfaceReturns the origin for the y-dimension- Specified by:
getOriginXin interfaceGJAxisSupportInterface- Returns:
- a double
-
getOriginY
public final double getOriginY()
Description copied from interface:GJAxisSupportInterfaceReturns the origin for the x-dimension- Specified by:
getOriginYin interfaceGJAxisSupportInterface- Returns:
- a double
-
getOrigin
public final java.awt.geom.Point2D getOrigin()
Gets the origin coordinates of the graph. The coordinates are represented as an instance of
Point2Dand stored indoubleformat.- Specified by:
getOriginin interfaceGJAxisSupportInterface- Returns:
- the origin coordinates in double format
- See Also:
setOrigin(Point2D),#setAxesBoundsAndOrigin(Rectangle2D)
-
setOrigin
public final void setOrigin(java.awt.geom.Point2D origin)
Sets the origin of the graph. The coordinates of the origin are defined by the coordinates of the point passed as parameter.
If the specified view is null, nothing happens.
Calling this method leaves the view intact.
- Specified by:
setOriginin interfaceGJAxisSupportInterface- Parameters:
origin- the coordinates of the new origin- See Also:
getOrigin(),#setAxesBoundsAndOrigin(Rectangle2D)
-
setOriginX
public final void setOriginX(double v)
Description copied from interface:GJAxisSupportInterfaceSets the origin for the x-dimension- Specified by:
setOriginXin interfaceGJAxisSupportInterface- Parameters:
v- a double
-
setOriginY
public final void setOriginY(double v)
Description copied from interface:GJAxisSupportInterfaceSets the origin for the y-dimension- Specified by:
setOriginYin interfaceGJAxisSupportInterface- Parameters:
v- a double
-
-
DMelt 3.0 © DataMelt by jWork.ORG