APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.tools.jconsole

public Class Plotter

extends JComponent
implements Accessible, ActionListener, PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener, java.awt.event.ActionListener, javax.accessibility.Accessible
Known Direct Subclasses
sun.tools.jconsole.inspector.XPlotter, sun.tools.jconsole.MemoryTab.PoolPlotter
Annotations
@SuppressWarnings:serial
Imports
java.awt.*, java.awt.event.*, java.beans.*, java.io.*, java.lang.reflect.Array, java.util.*, javax.accessibility.*, javax.swing.*, javax.swing.border.*, javax.swing.filechooser.*, .FileFilter, com.sun.tools.jconsole.JConsoleContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
private static class
private static class
private static class
public static enum

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final Color
private Border
private int
private static Stroke
pack-priv static final long
private int
private double
pack-priv static final Color
private final boolean
pack-priv static final long
private int
pack-priv static final long
private JPopupMenu
private Rectangle
r

pack-priv static final String[]
pack-priv static final int[]
private int
private JMenuItem
private JFileChooser
pack-priv static final long
private ArrayList<Plotter.Sequence>
private Font
private JMenu
private Plotter.TimeStamps
private int
private Plotter.Unit
private int
Inherited from javax.swing.JComponent:
listenerListTOOL_TIP_TEXT_KEYuiUNDEFINED_CONDITIONWHEN_ANCESTOR_OF_FOCUSED_COMPONENTWHEN_FOCUSEDWHEN_IN_FOCUSED_WINDOW

Constructor Summary

AccessConstructor and Description
public
public
public
Plotter(Plotter.Unit unit, int decimals)

public
Plotter(Plotter.Unit unit, int decimals, boolean displayLegend)

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent ev)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

public synchronized void
addValues(long time, long... values)

private long
calculateTickInterval(int w, int hGap, long viewRangeMS)

private boolean
private boolean
public void
createSequence(String key, String name, Color color, boolean isPlotted)

private static Object
public AccessibleContext
getAccessibleContext()

Overrides java.awt.Component.getAccessibleContext.

Implements javax.accessibility.Accessible.getAccessibleContext.

Returns the AccessibleContext associated with this object.

public JPopupMenu
getComponentPopupMenu()

Overrides javax.swing.JComponent.getComponentPopupMenu.

Returns JPopupMenu that assigned for this component.

private static synchronized Stroke
private String
getFormattedValue(long v, boolean groupDigits)

pack-priv long
pack-priv long
private Plotter.Sequence
private String
getSizeString(long v, long vMax)

pack-priv long
private int
getValueStringSlot(int[] slots, int y, int h, int i)

public int
getViewRange()

Returns: the displayed time range in minutes, or -1 for all data

private long
normalizeMax(long l)

private long
normalizeMin(long l)

public void
paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

public void
propertyChange(PropertyChangeEvent ev)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

private void
private void
public void
setDecimals(int decimals)

public void
setIsPlotted(String key, boolean isPlotted)

public void
public void
public void
setViewRange(int
the displayed time range in minutes, or -1 to display all data
minutes
)

Inherited from javax.swing.JComponent:
addAncestorListeneraddNotifyaddVetoableChangeListenercomputeVisibleRectcontainscreateToolTipdisableenablefirePropertyChangefirePropertyChangefirePropertyChangefireVetoableChangegetActionForKeyStrokegetActionMapgetAlignmentXgetAlignmentYgetAncestorListenersgetAutoscrollsgetBaselinegetBaselineResizeBehaviorgetBordergetBoundsgetClientPropertygetComponentGraphicsgetConditionForKeyStrokegetDebugGraphicsOptionsgetDefaultLocalegetFontMetricsgetGraphicsgetHeightgetInheritsPopupMenugetInputMapgetInputMapgetInputVerifiergetInsetsgetInsetsgetListenersgetLocationgetMaximumSizegetMinimumSizegetNextFocusableComponentgetPopupLocationgetPreferredSizegetRegisteredKeyStrokesgetRootPanegetSizegetToolTipLocationgetToolTipTextgetToolTipTextgetTopLevelAncestorgetTransferHandlergetUIgetUIClassIDgetVerifyInputWhenFocusTargetgetVetoableChangeListenersgetVisibleRectgetWidthgetXgetYgrabFocushideisDoubleBufferedisLightweightComponentisManagingFocusisOpaqueisOptimizedDrawingEnabledisPaintingForPrintisPaintingOriginisPaintingTileisRequestFocusEnabledisValidateRootpaintpaintBorderpaintChildrenpaintImmediatelypaintImmediatelyparamStringprintprintAllprintBorderprintChildrenprintComponentprocessComponentKeyEventprocessKeyBindingprocessKeyEventprocessMouseEventprocessMouseMotionEventputClientPropertyregisterKeyboardActionregisterKeyboardActionremoveAncestorListenerremoveNotifyremoveVetoableChangeListenerrepaintrepaintrequestDefaultFocusrequestFocusrequestFocusrequestFocusInWindowrequestFocusInWindowresetKeyboardActionsreshaperevalidatescrollRectToVisiblesetActionMapsetAlignmentXsetAlignmentYsetAutoscrollssetBackgroundsetBordersetComponentPopupMenusetDebugGraphicsOptionssetDefaultLocalesetDoubleBufferedsetEnabledsetFocusTraversalKeyssetFontsetForegroundsetInheritsPopupMenusetInputMapsetInputVerifiersetMaximumSizesetMinimumSizesetNextFocusableComponentsetOpaquesetPreferredSizesetRequestFocusEnabledsetToolTipTextsetTransferHandlersetUIsetVerifyInputWhenFocusTargetsetVisibleunregisterKeyboardActionupdateupdateUI

Field Detail

ARRAY_SIZE_INCREMENTback to summary
pack-priv static final int ARRAY_SIZE_INCREMENT
bgColorback to summary
pack-priv static final Color bgColor
borderback to summary
private Border border

Hides javax.swing.JComponent.border.

bottomMarginback to summary
private int bottomMargin
dashedStrokeback to summary
private static Stroke dashedStroke
DAYback to summary
pack-priv static final long DAY
decimalsback to summary
private int decimals
decimalsMultiplierback to summary
private double decimalsMultiplier
defaultColorback to summary
pack-priv static final Color defaultColor
displayLegendback to summary
private final boolean displayLegend
HOURback to summary
pack-priv static final long HOUR
leftMarginback to summary
private int leftMargin
MINUTEback to summary
pack-priv static final long MINUTE
popupMenuback to summary
private JPopupMenu popupMenu

Hides javax.swing.JComponent.popupMenu.

rback to summary
private Rectangle r
rangeNamesback to summary
pack-priv static final String[] rangeNames
rangeValuesback to summary
pack-priv static final int[] rangeValues
rightMarginback to summary
private int rightMargin
saveAsMIback to summary
private JMenuItem saveAsMI
saveFCback to summary
private JFileChooser saveFC
SECONDback to summary
pack-priv static final long SECOND
seqsback to summary
private ArrayList<Plotter.Sequence> seqs
smallFontback to summary
private Font smallFont
timeRangeMenuback to summary
private JMenu timeRangeMenu
timesback to summary
private Plotter.TimeStamps times
topMarginback to summary
private int topMargin
unitback to summary
private Plotter.Unit unit
viewRangeback to summary
private int viewRange

Constructor Detail

Plotterback to summary
public Plotter()
Plotterback to summary
public Plotter(Plotter.Unit unit)
Plotterback to summary
public Plotter(Plotter.Unit unit, int decimals)
Plotterback to summary
public Plotter(Plotter.Unit unit, int decimals, boolean displayLegend)

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent ev)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

addValuesback to summary
public synchronized void addValues(long time, long... values)
calculateTickIntervalback to summary
private long calculateTickInterval(int w, int hGap, long viewRangeMS)
checkLeftMarginback to summary
private boolean checkLeftMargin(int x)
checkRightMarginback to summary
private boolean checkRightMargin(int w)
createSequenceback to summary
public void createSequence(String key, String name, Color color, boolean isPlotted)
extendArrayback to summary
private static Object extendArray(Object a1)
getAccessibleContextback to summary
public AccessibleContext getAccessibleContext()

Overrides java.awt.Component.getAccessibleContext.

Implements javax.accessibility.Accessible.getAccessibleContext.

Doc from javax.accessibility.Accessible.getAccessibleContext.

Returns the AccessibleContext associated with this object. In most cases, the return value should not be null if the object implements interface Accessible. If a component developer creates a subclass of an object that implements Accessible, and that subclass is not Accessible, the developer should override the getAccessibleContext method to return null.

Annotations
@Override
getComponentPopupMenuback to summary
public JPopupMenu getComponentPopupMenu()

Overrides javax.swing.JComponent.getComponentPopupMenu.

Doc from javax.swing.JComponent.getComponentPopupMenu.

Returns JPopupMenu that assigned for this component. If this component does not have a JPopupMenu assigned to it and getInheritsPopupMenu is true, this will return getParent().getComponentPopupMenu() (assuming the parent is valid.)

Annotations
@Override
getDashedStrokeback to summary
private static synchronized Stroke getDashedStroke()
getFormattedValueback to summary
private String getFormattedValue(long v, boolean groupDigits)
getLastTimeStampback to summary
pack-priv long getLastTimeStamp()
getLastValueback to summary
pack-priv long getLastValue(String key)
getSequenceback to summary
private Plotter.Sequence getSequence(String key)
getSizeStringback to summary
private String getSizeString(long v, long vMax)
getValueback to summary
pack-priv long getValue()
getValueStringSlotback to summary
private int getValueStringSlot(int[] slots, int y, int h, int i)
getViewRangeback to summary
public int getViewRange()
Returns:int

the displayed time range in minutes, or -1 for all data

normalizeMaxback to summary
private long normalizeMax(long l)
normalizeMinback to summary
private long normalizeMin(long l)
paintComponentback to summary
public void paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent ev)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

saveAsback to summary
private void saveAs()
saveDataToFileback to summary
private void saveDataToFile(File file)
setDecimalsback to summary
public void setDecimals(int decimals)
setIsPlottedback to summary
public void setIsPlotted(String key, boolean isPlotted)
setUnitback to summary
public void setUnit(Plotter.Unit unit)
setUseDashedTransitionsback to summary
public void setUseDashedTransitions(String key, boolean b)
setViewRangeback to summary
public void setViewRange(int minutes)
Parameters
minutes:int

the displayed time range in minutes, or -1 to display all data

sun.tools.jconsole back to summary

protected Class Plotter.AccessiblePlotter

extends AccessibleJComponent
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from javax.swing.JComponent.AccessibleJComponent:
accessibleFocusHandler

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public String
getAccessibleName()

Overrides javax.swing.JComponent.AccessibleJComponent.getAccessibleName.

Gets the accessible name of this object.

public AccessibleRole
Inherited from javax.swing.JComponent.AccessibleJComponent:
addPropertyChangeListenergetAccessibleChildgetAccessibleChildrenCountgetAccessibleDescriptiongetAccessibleKeyBindinggetAccessibleStateSetgetBorderTitlegetTitledBorderTextgetToolTipTextremovePropertyChangeListener

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.AccessibleAWTContainer.serialVersionUID.

Constructor Detail

AccessiblePlotterback to summary
protected AccessiblePlotter()

Method Detail

getAccessibleNameback to summary
public String getAccessibleName()

Overrides javax.swing.JComponent.AccessibleJComponent.getAccessibleName.

Doc from javax.swing.JComponent.AccessibleJComponent.getAccessibleName.

Gets the accessible name of this object. This should almost never return java.awt.Component.getName(), as that generally isn't a localized name, and doesn't have meaning for the user. If the object is fundamentally a text object (such as a menu item), the accessible name should be the text of the object (for example, "save"). If the object has a tooltip, the tooltip text may also be an appropriate String to return.

Annotations
@Override
getAccessibleRoleback to summary
public AccessibleRole getAccessibleRole()

Overrides javax.swing.JComponent.AccessibleJComponent.getAccessibleRole.

Doc from javax.swing.JComponent.AccessibleJComponent.getAccessibleRole.

Gets the role of this object.

Annotations
@Override
sun.tools.jconsole back to summary

private Class Plotter.SaveDataFileChooser

extends JFileChooser
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from javax.swing.JFileChooser:
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTYaccessibleContextACCESSORY_CHANGED_PROPERTYAPPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTYAPPROVE_BUTTON_TEXT_CHANGED_PROPERTYAPPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTYAPPROVE_OPTIONAPPROVE_SELECTIONCANCEL_OPTIONCANCEL_SELECTIONCHOOSABLE_FILE_FILTER_CHANGED_PROPERTYCONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTYCUSTOM_DIALOGDIALOG_TITLE_CHANGED_PROPERTYDIALOG_TYPE_CHANGED_PROPERTYDIRECTORIES_ONLYDIRECTORY_CHANGED_PROPERTYERROR_OPTIONFILE_FILTER_CHANGED_PROPERTYFILE_HIDING_CHANGED_PROPERTYFILE_SELECTION_MODE_CHANGED_PROPERTYFILE_SYSTEM_VIEW_CHANGED_PROPERTYFILE_VIEW_CHANGED_PROPERTYFILES_AND_DIRECTORIESFILES_ONLYMULTI_SELECTION_ENABLED_CHANGED_PROPERTYOPEN_DIALOGSAVE_DIALOGSELECTED_FILE_CHANGED_PROPERTYSELECTED_FILES_CHANGED_PROPERTY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
approveSelection()

Overrides javax.swing.JFileChooser.approveSelection.

Called by the UI when the user hits the Approve button (labeled "Open" or "Save", by default).

Inherited from javax.swing.JFileChooser:
acceptaddActionListeneraddChoosableFileFiltercancelSelectionchangeToParentDirectorycreateDialogensureFileIsVisiblefireActionPerformedgetAcceptAllFileFiltergetAccessibleContextgetAccessorygetActionListenersgetApproveButtonMnemonicgetApproveButtonTextgetApproveButtonToolTipTextgetChoosableFileFiltersgetControlButtonsAreShowngetCurrentDirectorygetDescriptiongetDialogTitlegetDialogTypegetDragEnabledgetFileFiltergetFileSelectionModegetFileSystemViewgetFileViewgetIcongetNamegetSelectedFilegetSelectedFilesgetTypeDescriptiongetUIgetUIClassIDisAcceptAllFileFilterUsedisDirectorySelectionEnabledisFileHidingEnabledisFileSelectionEnabledisMultiSelectionEnabledisTraversableparamStringremoveActionListenerremoveChoosableFileFilterrescanCurrentDirectoryresetChoosableFileFilterssetAcceptAllFileFilterUsedsetAccessorysetApproveButtonMnemonicsetApproveButtonMnemonicsetApproveButtonTextsetApproveButtonToolTipTextsetControlButtonsAreShownsetCurrentDirectorysetDialogTitlesetDialogTypesetDragEnabledsetEnabledsetFileFiltersetFileHidingEnabledsetFileSelectionModesetFileSystemViewsetFileViewsetMultiSelectionEnabledsetSelectedFilesetSelectedFilessetupshowDialogshowOpenDialogshowSaveDialogupdateUI

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

Constructor Detail

SaveDataFileChooserback to summary
pack-priv SaveDataFileChooser()

Method Detail

approveSelectionback to summary
public void approveSelection()

Overrides javax.swing.JFileChooser.approveSelection.

Doc from javax.swing.JFileChooser.approveSelection.

Called by the UI when the user hits the Approve button (labeled "Open" or "Save", by default). This can also be called by the programmer. This method causes an action event to fire with the command string equal to APPROVE_SELECTION.

Annotations
@Override
sun.tools.jconsole back to summary

private Class Plotter.Sequence

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Color
pack-priv boolean
pack-priv String
pack-priv String
pack-priv int
pack-priv Stroke
pack-priv Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(long value)

public long
value(int i)

Returns the value at index i

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorback to summary
pack-priv Color color
isPlottedback to summary
pack-priv boolean isPlotted
keyback to summary
pack-priv String key
nameback to summary
pack-priv String name
sizeback to summary
pack-priv int size
transitionStrokeback to summary
pack-priv Stroke transitionStroke
valuesback to summary
pack-priv Object values

Constructor Detail

Sequenceback to summary
public Sequence(String key)

Method Detail

addback to summary
public void add(long value)
valueback to summary
public long value(int i)

Returns the value at index i

sun.tools.jconsole back to summary

private Class Plotter.TimeStamps

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int[]
pack-priv long[]
pack-priv int[]
pack-priv int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
add(long time)

public long
time(int i)

Returns the time stamp for index i

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indicesback to summary
pack-priv int[] indices
offsetsback to summary
pack-priv long[] offsets
rtimesback to summary
pack-priv int[] rtimes
sizeback to summary
pack-priv int size

Constructor Detail

TimeStampsback to summary
private TimeStamps()

Method Detail

addback to summary
public void add(long time)
timeback to summary
public long time(int i)

Returns the time stamp for index i

sun.tools.jconsole back to summary

public final Enum Plotter.Unit

extends Enum<Plotter.Unit>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Plotter.Unit
public static final Plotter.Unit
public static final Plotter.Unit

Constructor Summary

AccessConstructor and Description
private
Unit()

Method Summary

Modifier and TypeMethod and Description
public static Plotter.Unit
public static Plotter.Unit[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BYTESback to summary
public static final Plotter.Unit BYTES
NONEback to summary
public static final Plotter.Unit NONE
PERCENTback to summary
public static final Plotter.Unit PERCENT

Constructor Detail

Unitback to summary
private Unit()

Method Detail

valueOfback to summary
public static Plotter.Unit valueOf(String name)
valuesback to summary
public static Plotter.Unit[] values()