public abstract class PMILineChartPanel extends PMIChartPanel implements LoadingMonitor
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
antialias |
protected java.awt.Color |
gridlineColor |
protected java.lang.String |
gridlineDashPattern |
protected java.awt.Stroke |
gridlineStroke |
protected float |
gridlineWidth |
protected boolean |
legend |
protected int |
mode
Controls the mouse-mode of the graph, such as panning and zooming
|
protected static int |
MODE_MARK |
protected static int |
MODE_PAN |
protected static int |
MODE_XTRACE |
protected static int |
MODE_ZOOM |
protected java.awt.geom.Line2D |
panLine |
protected java.awt.Stroke |
panLineStroke |
protected java.awt.geom.Point2D |
panStartPoint |
protected java.awt.Color |
plotBackground |
protected int |
propertiesLoading |
protected java.lang.String |
selectedXValue |
protected java.beans.PropertyChangeListener |
selectedXValueListener |
protected java.lang.String |
title |
protected java.awt.Font |
titleFont |
protected boolean |
tooltips |
context, cursorCode, print, properties, save, showPopup, zoom
DEFAULT_BUFFER_USED, DEFAULT_HEIGHT, DEFAULT_MAXIMUM_DRAW_HEIGHT, DEFAULT_MAXIMUM_DRAW_WIDTH, DEFAULT_MINIMUM_DRAW_HEIGHT, DEFAULT_MINIMUM_DRAW_WIDTH, DEFAULT_WIDTH, DEFAULT_ZOOM_TRIGGER_DISTANCE, localizationResources, PRINT_COMMAND, PROPERTIES_COMMAND, SAVE_COMMAND, ZOOM_IN_BOTH_COMMAND, ZOOM_IN_DOMAIN_COMMAND, ZOOM_IN_RANGE_COMMAND, ZOOM_OUT_BOTH_COMMAND, ZOOM_OUT_DOMAIN_COMMAND, ZOOM_OUT_RANGE_COMMAND, ZOOM_RESET_BOTH_COMMAND, ZOOM_RESET_DOMAIN_COMMAND, ZOOM_RESET_RANGE_COMMAND
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
COMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONS
COMPONENT_RUNNING
Constructor and Description |
---|
PMILineChartPanel() |
Modifier and Type | Method and Description |
---|---|
protected void |
_setSelectedXValue(java.lang.String domainAnchor) |
void |
actionPerformed(java.awt.event.ActionEvent event)
This function ONLY overrides the ZOOM_RESET_BOTH_COMMAND, to route it to the correct version of the overridden
restoreAutoBounds() function
|
void |
createChart() |
protected abstract org.jfree.chart.JFreeChart |
createChartImpl() |
protected static org.jfree.chart.JFreeChart |
createEmptyChart(java.lang.String title,
java.awt.Color bg,
java.awt.Color plot) |
protected javax.swing.JPopupMenu |
createPopupMenu(boolean properties,
boolean save,
boolean print,
boolean zoom)
Creates a popup menu for the panel.
|
protected org.jfree.chart.title.TextTitle |
createTitle() |
void |
doSaveAs()
Opens a file chooser and gives the user an opportunity to save the chart in PNG format.
|
java.awt.Color |
getGridlineColor() |
java.lang.String |
getGridlineDashPattern() |
java.awt.Stroke |
getGridlineStroke() |
float |
getGridlineWidth() |
java.awt.Color |
getPlotBackground() |
protected abstract AutoAnnotateXYPlot[] |
getPlots() |
byte[] |
getPNGBytes(int width,
int height) |
static java.awt.geom.Point2D |
getPointInRectangle(double x,
double y,
java.awt.geom.Rectangle2D area) |
int |
getPropertiesLoading() |
java.lang.String |
getSelectedXValue() |
java.lang.String |
getTitle() |
java.awt.Font |
getTitleFont() |
boolean |
getXTraceTrackMouse() |
boolean |
isAntialias() |
boolean |
isLegend() |
boolean |
isOpaque() |
boolean |
isTooltips() |
void |
mouseDragged(java.awt.event.MouseEvent event)
Handles a mouse dragged event to perform panning & interactive marking/xtracing
|
void |
mouseMoved(java.awt.event.MouseEvent event) |
void |
mousePressed(java.awt.event.MouseEvent event)
Handles a mouse pressed event (to start panning).
|
void |
mouseReleased(java.awt.event.MouseEvent event)
Handles a mouse released event (stops panning).
|
void |
paintComponent(java.awt.Graphics g) |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
Overridden to correctly adjust the anchor point for the printed size of the chart
|
protected void |
redrawAtEventPoint(java.awt.event.MouseEvent event) |
protected void |
resetAxes()
Default implementation simply calls createChart()
|
protected boolean |
respectDomainRangeOnPan()
Determines whether or not the X-axis panning respects the axis's range.
|
void |
restoreAutoBounds()
This is overridden so that when it is called because of zooming a negative rectangle, the chart is totally reset,
instead of restoring auto-bounds, because restoring auto-bounds assumes that the axes were set to auto-range in
the first place, which isn't necessarilly true
|
java.lang.String |
saveAsImage() |
java.lang.String |
saveAsImage(int width,
int height) |
void |
setAntialias(boolean antialias) |
protected void |
setAutoAnnotationMode(int mode) |
void |
setBackground(java.awt.Color bg) |
void |
setBounds(java.awt.Rectangle bounds) |
void |
setFont(java.awt.Font font) |
void |
setForeground(java.awt.Color fg) |
void |
setGridlineColor(java.awt.Color gridlineColor) |
void |
setGridlineDashPattern(java.lang.String gridlineDashPattern) |
void |
setGridlineWidth(float gridlineWidth) |
void |
setLegend(boolean b) |
void |
setMode(int newMode)
Sets the current mode to ZOOM, PAN, MARK, or XTRACE
|
void |
setPlotBackground(java.awt.Color color) |
void |
setPropertiesLoading(int i) |
void |
setSelectedXValue(java.lang.String domainAnchor) |
void |
setTitle(java.lang.String string) |
void |
setTitleFont(java.awt.Font font) |
void |
setTooltips(boolean b) |
void |
setXTraceTrackMouse(boolean value) |
createChartPrintJob, displayPopupMenu, getAppContext, getCursorCode, getDataQuality, getScientificNumberFormat, getToolTipText, getToolTipText, isShowPopup, localeChanged, onShutdown, onStartup, paintChildren, print, setCursorCode, setDataQuality, setName, setShowPopup, setVisible, shutdownComponent, startupComponent, translate, translateTerm, updateQuality
addChartMouseListener, chartChanged, chartProgress, doEditChartProperties, getAnchor, getChart, getChartRenderingInfo, getDefaultDirectoryForSaveAs, getDismissDelay, getEntityForPoint, getFillZoomRectangle, getHorizontalAxisTrace, getHorizontalTraceLine, getInitialDelay, getListeners, getMaximumDrawHeight, getMaximumDrawWidth, getMinimumDrawHeight, getMinimumDrawWidth, getPopupMenu, getRefreshBuffer, getReshowDelay, getScaleX, getScaleY, getScreenDataArea, getScreenDataArea, getVerticalAxisTrace, getVerticalTraceLine, getZoomAroundAnchor, getZoomInFactor, getZoomOutFactor, getZoomTriggerDistance, isDomainZoomable, isEnforceFileExtensions, isRangeZoomable, mouseClicked, mouseEntered, mouseExited, removeChartMouseListener, restoreAutoDomainBounds, restoreAutoRangeBounds, scale, setAnchor, setChart, setDefaultDirectoryForSaveAs, setDismissDelay, setDisplayToolTips, setDomainZoomable, setEnforceFileExtensions, setFillZoomRectangle, setHorizontalAxisTrace, setHorizontalTraceLine, setInitialDelay, setMaximumDrawHeight, setMaximumDrawWidth, setMinimumDrawHeight, setMinimumDrawWidth, setMouseZoomable, setMouseZoomable, setPopupMenu, setRangeZoomable, setRefreshBuffer, setReshowDelay, setVerticalAxisTrace, setVerticalTraceLine, setZoomAroundAnchor, setZoomInFactor, setZoomOutFactor, setZoomTriggerDistance, translateJava2DToScreen, translateScreenToJava2D, updateUI, zoom, zoomInBoth, zoomInDomain, zoomInRange, zoomOutBoth, zoomOutDomain, zoomOutRange
getAccessibleContext, getUI, getUIClassID, paramString, setUI
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, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
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
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, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected static final int MODE_ZOOM
protected static final int MODE_PAN
protected static final int MODE_MARK
protected static final int MODE_XTRACE
protected java.awt.Color plotBackground
protected java.awt.Color gridlineColor
protected java.awt.Stroke gridlineStroke
protected java.lang.String gridlineDashPattern
protected float gridlineWidth
protected java.lang.String title
protected java.awt.Font titleFont
protected boolean legend
protected boolean tooltips
protected int propertiesLoading
protected java.lang.String selectedXValue
protected boolean antialias
protected java.beans.PropertyChangeListener selectedXValueListener
protected int mode
protected java.awt.geom.Point2D panStartPoint
protected java.awt.geom.Line2D panLine
protected final java.awt.Stroke panLineStroke
protected static org.jfree.chart.JFreeChart createEmptyChart(java.lang.String title, java.awt.Color bg, java.awt.Color plot)
protected abstract AutoAnnotateXYPlot[] getPlots()
public final void createChart()
protected abstract org.jfree.chart.JFreeChart createChartImpl()
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
print
in interface java.awt.print.Printable
print
in class org.jfree.chart.ChartPanel
public void doSaveAs() throws java.io.IOException
PMIChartPanel
doSaveAs
in class PMIChartPanel
java.io.IOException
- if there is an I/O error.public java.lang.String saveAsImage() throws java.io.IOException
java.io.IOException
public java.lang.String saveAsImage(int width, int height) throws java.io.IOException
java.io.IOException
public byte[] getPNGBytes(int width, int height) throws java.io.IOException
java.io.IOException
public void paintComponent(java.awt.Graphics g)
paintComponent
in class org.jfree.chart.ChartPanel
protected javax.swing.JPopupMenu createPopupMenu(boolean properties, boolean save, boolean print, boolean zoom)
PMIChartPanel
createPopupMenu
in class PMIChartPanel
properties
- include a menu item for the chart property editor.save
- include a menu item for saving the chart.print
- include a menu item for printing the chart.zoom
- include menu items for zooming.protected void resetAxes()
public java.awt.Color getPlotBackground()
public void setPlotBackground(java.awt.Color color)
public java.lang.String getTitle()
public void setTitle(java.lang.String string)
public boolean isLegend()
public boolean isTooltips()
public void setLegend(boolean b)
public void setTooltips(boolean b)
public boolean isOpaque()
isOpaque
in class javax.swing.JComponent
public int getPropertiesLoading()
getPropertiesLoading
in interface LoadingMonitor
public void setPropertiesLoading(int i)
setPropertiesLoading
in interface LoadingMonitor
public void setBackground(java.awt.Color bg)
setBackground
in class javax.swing.JComponent
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
public void setTitleFont(java.awt.Font font)
public java.awt.Font getTitleFont()
public void setForeground(java.awt.Color fg)
setForeground
in class javax.swing.JComponent
protected org.jfree.chart.title.TextTitle createTitle()
public boolean isAntialias()
isAntialias
in class PMIChartPanel
public void setAntialias(boolean antialias)
setAntialias
in class PMIChartPanel
public void setMode(int newMode)
protected void setAutoAnnotationMode(int mode)
public void mousePressed(java.awt.event.MouseEvent event)
Overridden to support PAN mode
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class org.jfree.chart.ChartPanel
event
- the event.public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class org.jfree.chart.ChartPanel
public void mouseReleased(java.awt.event.MouseEvent event)
Overridden to support PAN mode
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class org.jfree.chart.ChartPanel
event
- the event.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class org.jfree.chart.ChartPanel
event
- the event.protected void redrawAtEventPoint(java.awt.event.MouseEvent event)
protected boolean respectDomainRangeOnPan()
public void setBounds(java.awt.Rectangle bounds)
setBounds
in class java.awt.Component
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class org.jfree.chart.ChartPanel
public void restoreAutoBounds()
restoreAutoBounds
in class org.jfree.chart.ChartPanel
public static java.awt.geom.Point2D getPointInRectangle(double x, double y, java.awt.geom.Rectangle2D area)
public boolean getXTraceTrackMouse()
public void setXTraceTrackMouse(boolean value)
public java.awt.Color getGridlineColor()
public void setGridlineColor(java.awt.Color gridlineColor)
public java.lang.String getGridlineDashPattern()
public void setGridlineDashPattern(java.lang.String gridlineDashPattern)
public float getGridlineWidth()
public void setGridlineWidth(float gridlineWidth)
public java.awt.Stroke getGridlineStroke()
public java.lang.String getSelectedXValue()
protected void _setSelectedXValue(java.lang.String domainAnchor)
public void setSelectedXValue(java.lang.String domainAnchor)