Package info.monitorenter.gui.chart
Class ZoomableChart
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
info.monitorenter.gui.chart.Chart2D
info.monitorenter.gui.chart.ZoomableChart
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,ImageObserver
,MenuContainer
,Printable
,PropertyChangeListener
,Serializable
,Iterable<ITrace2D>
,EventListener
,Accessible
Chart2D
enriched by a
zoom-functionality in the x and y dimension.
- Version:
- $Revision: 1.19 $
- Author:
- Alessio Sambarino (Contributor), Klaus Pesendorfer (Bugfix contributor), Anadi Mishra (Bugfix contributor)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class info.monitorenter.gui.chart.Chart2D
Chart2D.PointFinder, Chart2D.ToolTipType
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class info.monitorenter.gui.chart.Chart2D
AXIX_CONSTANT_NAMES, CHART_POSITION_BOTTOM, CHART_POSITION_LEFT, CHART_POSITION_RIGHT, CHART_POSITION_TOP, DEBUG_HIGHLIGHTING, DEBUG_SCALING, DEBUG_THREADING, m_minPaintLatency, PROPERTY_ADD_REMOVE_TRACE, PROPERTY_ANTIALIASING_ENABLED, PROPERTY_AXIS_X, PROPERTY_AXIS_X_BOTTOM_REPLACE, PROPERTY_AXIS_X_TOP_REPLACE, PROPERTY_AXIS_Y, PROPERTY_AXIS_Y_LEFT_REPLACE, PROPERTY_AXIS_Y_RIGHT_REPLACE, PROPERTY_BACKGROUND_COLOR, PROPERTY_FONT, PROPERTY_FOREGROUND_COLOR, PROPERTY_GRID_COLOR, PROPERTY_PAINTLABELS, PROPERTY_POINT_HIGHLIGHTING_ENABLED, PROPERTY_POINTFINDER, PROPERTY_TOOLTIP_TYPE, X, X_Y, Y
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
void
void
protected void
A basic rule of a JComponent is:
Never invoke this method directly.void
zoom
(double xmin, double xmax) Zooms to the selected bounds in x-axis.void
zoom
(double xmin, double xmax, double ymin, double ymax) Zooms to the selected bounds in both directions.void
Zooms the axis to the pixel value of start and end points.void
zoomAll()
Resets the zooming area to a range that displays all data.Methods inherited from class info.monitorenter.gui.chart.Chart2D
addAxisXBottom, addAxisXTop, addAxisYLeft, addAxisYRight, addTrace, addTrace, createToolTip, destroy, enablePointHighlighting, finalize, findAxesOfTrace, getAxes, getAxesXBottom, getAxesXTop, getAxesYLeft, getAxesYRight, getAxisTickPainter, getAxisX, getAxisX, getAxisY, getAxisY, getGridColor, getHeight, getMinPaintLatency, getNearestPointEuclid, getNearestPointEuclid, getNearestPointManhattan, getNearestPointManhattan, getPointFinder, getPreferredSize, getSize, getSynchronizedXStartChart, getToolTipText, getToolTipType, getTracePointProvider, getTraces, getWidth, getXAxisWidth, getXChartEnd, getXChartStart, getYChartEnd, getYChartStart, isEnabledPointHighlighting, isPaintLabels, isRequestedRepaint, isToolTipCoords, isUseAntialiasing, isVisible, iterator, paint, print, propertyChange, removeAllTraces, removeAxisXBottom, removeAxisXTop, removeAxisYLeft, removeAxisYRight, removeTrace, repaint, repaint, repaint, repaint, repaint, resetPrintMode, setAxisTickPainter, setAxisX, setAxisXBottom, setAxisXTop, setAxisY, setAxisYLeft, setAxisYRight, setGridColor, setMinPaintLatency, setPaintLabels, setPointFinder, setRequestedRepaint, setSynchronizedXStartChart, setToolTipCoords, setToolTipType, setTracePointProvider, setUseAntialiasing, snapShot, snapShot, toString, translateMousePosition
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, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, 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, setVisible, 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, getPropertyChangeListeners, getPropertyChangeListeners, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ZoomableChart
public ZoomableChart()Defcon.
-
-
Method Details
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
- See Also:
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
- See Also:
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
- See Also:
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
- See Also:
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
- See Also:
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
- See Also:
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
- See Also:
-
paintComponent
Description copied from class:Chart2D
A basic rule of a JComponent is:
Never invoke this method directly.
See the description ofJComponent.paintComponent(java.awt.Graphics)
If you do invoke this method you may encounter performance issues, flickering UI and even deadlocks.
- Overrides:
paintComponent
in classChart2D
- Parameters:
g
- the graphics context to use.- See Also:
-
zoom
public void zoom(double xmin, double xmax) Zooms to the selected bounds in x-axis.- Parameters:
xmin
- the lower x bound.xmax
- the upper x bound.
-
zoom
Zooms the axis to the pixel value of start and end points.Does not check for the position of axis so the caller must take care to provide start x and end x for horizontal and start y and end y for vertical axes.
- Parameters:
axis
- the axis to zoom.startP
- the start coordinate in the dimension of the given axis in pixel coords.endP
- the end coordinate in the dimension of the given axis in pixel coords.
-
zoom
public void zoom(double xmin, double xmax, double ymin, double ymax) Zooms to the selected bounds in both directions.- Parameters:
xmin
- the lower x bound (value of chart (vs. pixel of screen)).xmax
- the upper x bound (value of chart (vs. pixel of screen)).ymin
- the lower y bound (value of chart (vs. pixel of screen)).ymax
- the upper y bound (value of chart (vs. pixel of screen)).
-
zoomAll
public void zoomAll()Resets the zooming area to a range that displays all data.
-