|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel PIRL.Viewers.Memory_Chart_Panel
public class Memory_Chart_Panel
A Memory_Chart_Panel provides panel for a Memory_Chart.
The panel may optionally be provided with a popup menu that includes Memory_Chart controls that are also bound to accelerator keys. In addition to basic Memory_Chart controls, a Save History action is provided that will save the current memory sampling history to a file in comma separated value (CSV) format.
Memory_Chart
,
Serialized FormNested Class Summary |
---|
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 | |
---|---|
static int |
ANNOTATION_KEY
Menu mnemonic and keyboard accellerator keys. |
static int |
DEFAULT_SAMPLING_RATE
The default Memory_Chart sampling rate. |
static String |
ID
Class identification name with source code version and date. |
static int |
SAMPLING_RATE_KEY
Menu mnemonic and keyboard accellerator keys. |
static int |
SAVE_HISTORY_KEY
Menu mnemonic and keyboard accellerator keys. |
static int |
SECONDS_SCALE_KEY
Menu mnemonic and keyboard accellerator keys. |
static int |
STOP_START_KEY
Menu mnemonic and keyboard accellerator keys. |
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 | |
---|---|
Memory_Chart_Panel()
Construct a Memory_Chart_Panel with a popup menu and using the DEFAULT_SAMPLING_RATE . |
|
Memory_Chart_Panel(boolean provide_menu)
Construct a Memory_Chart_Panel with an optional popup menu. |
|
Memory_Chart_Panel(int rate)
Construct a Memory_Chart_Panel using a sampling rate. |
|
Memory_Chart_Panel(int rate,
boolean provide_menu)
Construct a Memory_Chart_Panel using a sampling rate and optional popup menu. |
Method Summary | |
---|---|
static long |
Allocated_Memory()
Get the amount of memory currently in use by the Java runtime environment. |
boolean |
Annotation()
Test if the Memory_Chart annotation is enabled. |
Memory_Chart_Panel |
Annotation(boolean enabled)
Enable or disable the Memory_Chart annotations. |
static long |
Available_Memory()
Get the total amount of memory available to the Java runtime environment. |
Memory_Chart_Panel |
CWD(File file)
Sets the current working directory for finding parameter files. |
static long |
Free_Memory()
Get the amount of memory allocated by the Java runtime environment but not currently in use. |
JPopupMenu |
Menu()
Get a popup menu with Memory_Chart controls. |
int |
Previous_Rate()
Get the previous memory sampling rate. |
int |
Rate()
Get the memory sampling rate. |
Memory_Chart_Panel |
Rate(int rate)
Set the memory sampling rate. |
Memory_Chart_Panel |
Run(boolean run)
Enable or disable the operation of the Memory_Chart. |
boolean |
Seconds_Scale()
Test if the Memory_Chart seconds scale is enabled. |
Memory_Chart_Panel |
Seconds_Scale(boolean enabled)
Enable or disable the Memory_Chart seconds scale. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ID
public static final int DEFAULT_SAMPLING_RATE
Memory_Chart
sampling rate.
public static final int STOP_START_KEY
When the menu
is visible, each key combined with the
ALT key will select the corresponding menu item. When the component
has focus, each key combined with the CTL (control) key will cause
the corresponding action to occur.
public static final int SAMPLING_RATE_KEY
When the menu
is visible, each key combined with the
ALT key will select the corresponding menu item. When the component
has focus, each key combined with the CTL (control) key will cause
the corresponding action to occur.
public static final int ANNOTATION_KEY
When the menu
is visible, each key combined with the
ALT key will select the corresponding menu item. When the component
has focus, each key combined with the CTL (control) key will cause
the corresponding action to occur.
public static final int SECONDS_SCALE_KEY
When the menu
is visible, each key combined with the
ALT key will select the corresponding menu item. When the component
has focus, each key combined with the CTL (control) key will cause
the corresponding action to occur.
public static final int SAVE_HISTORY_KEY
When the menu
is visible, each key combined with the
ALT key will select the corresponding menu item. When the component
has focus, each key combined with the CTL (control) key will cause
the corresponding action to occur.
Constructor Detail |
---|
public Memory_Chart_Panel(int rate, boolean provide_menu)
A border with the title "Memory Use" is placed around a Memory_Chart
that uses the specified sampling rate. A popup menu
is provided if requested.
rate
- The memory sampling rate for the Memory_Chart.provide_menu
- If true, a popup menu is provided.public Memory_Chart_Panel(int rate)
A popup menu
is provided.
rate
- The memory sampling rate for the Memory_Chart.public Memory_Chart_Panel(boolean provide_menu)
The Memory_Chart will use the DEFAULT_SAMPLING_RATE
.
provide_menu
- If true, a popup menu is provided.public Memory_Chart_Panel()
DEFAULT_SAMPLING_RATE
.
Method Detail |
---|
public boolean Annotation()
annotation
is enabled.
public boolean Seconds_Scale()
seconds scale
is enabled.
public int Rate()
Memory_Chart.Rate(int)
public int Previous_Rate()
Memory_Chart.Previous_Rate()
public static long Free_Memory()
Memory_History.Available_Memory()
public static long Allocated_Memory()
Memory_History.Available_Memory()
public static long Available_Memory()
Memory_History.Available_Memory()
public JPopupMenu Menu()
Controls to stop
and start
memory sampling, set the
sampling rate
, enable and
disable the annotations
and seconds scale
,
and save the current sampling
history
to a file are provided.
The menu actions are also bound to keyboard accelerators.
The Save History action will use a file chooser to select a file in
which the current memory sampling history will be written in comma
separated values (CSV) format. The first line provides the names of
the values on the following lines (one line per sample): "Sample" is
the sample index, starting with zero; "Allocated" followed by a
slash characater ('/') and the total amount of memory available is
the amount of allocated
memory
; and "Free" is the amount of free memory
in the allocated pool.
public Memory_Chart_Panel Run(boolean run)
run
- If true, memory sampling will be started
if it is not already running. If false, sampling will be
stopped
.
public Memory_Chart_Panel Rate(int rate)
rate
- The memory sampling
rate
.
public Memory_Chart_Panel Annotation(boolean enabled)
enabled
- If true, chart annotations
will be shown. If
false they will not be shown.
public Memory_Chart_Panel Seconds_Scale(boolean enabled)
enabled
- If true, chart seconds scale
will be
shown. If false it will not be shown.
public Memory_Chart_Panel CWD(File file) throws FileNotFoundException
file
- A File to which to set the CWD. If null, the
"user.dir" System property will be used. If the file does not
refer to an existing directory, the file's parent will be used.
FileNotFoundException
- If neither the file nor the file's
parent refers to an existing directory.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |