|
################################################################## EnvInfo v1.1 Copyright (C) 2009 Frederic Roudaut This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ################################################################### |
|||||||
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
com.envInfo.AbstractChartPanel
com.envInfo.MemoryChartPanel
public class MemoryChartPanel
Class used to draw the JVM Memory status charts.
This class is an adaption of the one done by Nicolas Richasse for his
Java Iperf frontend.
Nested Class Summary | |
---|---|
private class |
MemoryChartPanel.SeriesData
Class representing a single series of Memory data. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private java.awt.Color |
backgroundColor
|
private double |
delayInSeconds
|
private java.awt.Color |
foregroundColor
|
private org.jfree.chart.plot.CombinedDomainXYPlot |
graphSet
|
private java.awt.Color |
gridColor
|
private javax.swing.JLabel |
labelDate
|
private org.jfree.data.xy.XYSeriesCollection |
memoryCollection
|
private org.jfree.chart.renderer.xy.XYItemRenderer |
memoryRenderer
|
private java.lang.String |
memoryUnit
|
private javax.swing.JPanel |
panelTextStats
|
private int |
proportion
|
private java.text.SimpleDateFormat |
sdf
|
private static long |
serialVersionUID
|
private java.util.HashMap<java.lang.String,MemoryChartPanel.SeriesData> |
seriesData
|
private java.lang.Thread |
timeThread
|
private double |
timeWindow
|
Fields inherited from class com.envInfo.AbstractChartPanel |
---|
chartPanel, jFreeChart |
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.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MemoryChartPanel(java.lang.String title,
java.lang.String memoryUnit,
java.lang.String timeAxisLabel,
java.lang.String memoryValueAxisLabel,
double delayInSeconds,
double timeWindow,
java.awt.Color backgroundColor,
java.awt.Color foregroundColor,
java.awt.Color gridColor)
Constructor for a set of Memory Charts (ie a set of memory series). |
Method Summary | |
---|---|
void |
addSeriesMemoryMeasurement(java.lang.String seriesId,
MemoryMeasurement measurement)
Add a new measurement to an existing memory data serie. |
void |
maybeAddNewSeries(java.lang.String seriesId,
java.lang.String seriesLegend,
java.awt.Color seriesColor)
Add a Memory Data Series. |
void |
maybeAddNewSeries(java.lang.String seriesId,
java.lang.String seriesLegend,
java.awt.Color seriesColor,
java.lang.String printfMemoryValueExpression)
Add a Memory Data Series. |
void |
reconfigure(java.lang.String title,
java.lang.String memoryUnit,
java.lang.String timeAxisLabel,
java.lang.String memoryValueAxisLabel,
double timeWindow)
Reconfigure a Memory Data Charts set. |
void |
run()
Start a Thread to update the date. |
private boolean |
seriesExists(java.lang.String seriesId)
Check if a Memory Data Series Exists. |
void |
start()
Start a Time Thread. |
Methods inherited from class com.envInfo.AbstractChartPanel |
---|
getChartPanel, getJFreeChart, setLowQuality |
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, 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, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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, 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, 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, hide, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, 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 |
Field Detail |
---|
private static final long serialVersionUID
private int proportion
private org.jfree.chart.plot.CombinedDomainXYPlot graphSet
private org.jfree.chart.renderer.xy.XYItemRenderer memoryRenderer
private org.jfree.data.xy.XYSeriesCollection memoryCollection
private javax.swing.JPanel panelTextStats
private javax.swing.JLabel labelDate
private double delayInSeconds
private java.text.SimpleDateFormat sdf
private java.util.HashMap<java.lang.String,MemoryChartPanel.SeriesData> seriesData
private java.lang.Thread timeThread
private java.awt.Color backgroundColor
private java.awt.Color foregroundColor
private java.awt.Color gridColor
private java.lang.String memoryUnit
private double timeWindow
Constructor Detail |
---|
public MemoryChartPanel(java.lang.String title, java.lang.String memoryUnit, java.lang.String timeAxisLabel, java.lang.String memoryValueAxisLabel, double delayInSeconds, double timeWindow, java.awt.Color backgroundColor, java.awt.Color foregroundColor, java.awt.Color gridColor)
title
- Title of the Memory Charts set.memoryUnit
- Memory Unit.timeAxisLabel
- Time Axis Label (X axis).memoryValueAxisLabel
- Memory Value Axis Label (Y Axis).delayInSeconds
- Delay between the date printing above the charts set.timeWindow
- Time Windows for the charts.backgroundColor
- BackgroundColor.foregroundColor
- ForegroundColor.gridColor
- GridColor.Method Detail |
---|
public void start()
private boolean seriesExists(java.lang.String seriesId)
seriesId
- A serie ID.
public void maybeAddNewSeries(java.lang.String seriesId, java.lang.String seriesLegend, java.awt.Color seriesColor)
seriesId
- A serie ID.seriesLegend
- the Serie LegendseriesColor
- a color for the associated chart.public void maybeAddNewSeries(java.lang.String seriesId, java.lang.String seriesLegend, java.awt.Color seriesColor, java.lang.String printfMemoryValueExpression)
seriesId
- A serie ID.seriesLegend
- the Serie LegendseriesColor
- a color for the associated chart.printfMemoryValueExpression
- Content to print under the Charts.public void reconfigure(java.lang.String title, java.lang.String memoryUnit, java.lang.String timeAxisLabel, java.lang.String memoryValueAxisLabel, double timeWindow)
title
- Title of the Memory Charts set.memoryUnit
- Memory Unit.timeAxisLabel
- Time Axis Label.memoryValueAxisLabel
- Memory Value Axis Label.timeWindow
- Time windows for the charts.public void addSeriesMemoryMeasurement(java.lang.String seriesId, MemoryMeasurement measurement)
seriesId
- the sery ID.measurement
- the measurement to add.public void run()
run
in interface java.lang.Runnable
|
################################################################## EnvInfo v1.1 Copyright (C) 2009 Frederic Roudaut This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ################################################################### |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |