org.apache.batik.util.gui

Class MemoryMonitor.Usage

public static class MemoryMonitor.Usage extends JPanel implements MemoryMonitor.MemoryChangeListener

Displays the current memory usage.
Field Summary
protected static intBLOCKS
The number of blocks.
protected static doubleBLOCK_HEIGHT
The blocks height.
protected static intBLOCK_MARGIN
The blocks margin.
protected static int[]BLOCK_TYPE
The blocks type.
protected static doubleBLOCK_WIDTH
The blocks width.
protected Fontfont
The font used to draw the strings.
protected Color[]freeColors
The color of the free blocks for each block type.
protected longfreeMemory
The free memory.
protected static intFONT_SIZE
The font size.
protected static booleanPOSTFIX
The text position.
static intPREFERRED_HEIGHT
The preferred height.
static intPREFERRED_WIDTH
The preferred width.
protected ColortextColor
The text color.
protected longtotalMemory
The total memory.
protected static StringTOTAL
The total string.
protected Color[]usedColors
The color of the used blocks for each block type.
protected static StringUNITS
The units string.
protected static StringUSED
The used string.
Constructor Summary
Usage()
Creates a new Usage object.
Method Summary
voidmemoryStateChanged(long total, long free)
Indicates that the memory state has changed.
protected voidpaintComponent(Graphics g)
To paint the component.
voidsetHighFreeMemoryColor(Color c)
Sets the high free memory block color.
voidsetHighUsedMemoryColor(Color c)
Sets the high used memory block color.
voidsetLowFreeMemoryColor(Color c)
Sets the low free memory block color.
voidsetLowUsedMemoryColor(Color c)
Sets the low used memory block color.
voidsetMediumFreeMemoryColor(Color c)
Sets the medium free memory block color.
voidsetMediumUsedMemoryColor(Color c)
Sets the medium used memory block color.
voidsetTextColor(Color c)
Sets the text color.

Field Detail

BLOCKS

protected static final int BLOCKS
The number of blocks.

BLOCK_HEIGHT

protected static final double BLOCK_HEIGHT
The blocks height.

BLOCK_MARGIN

protected static final int BLOCK_MARGIN
The blocks margin.

BLOCK_TYPE

protected static final int[] BLOCK_TYPE
The blocks type.

BLOCK_WIDTH

protected static final double BLOCK_WIDTH
The blocks width.

font

protected Font font
The font used to draw the strings.

freeColors

protected Color[] freeColors
The color of the free blocks for each block type.

freeMemory

protected long freeMemory
The free memory.

FONT_SIZE

protected static final int FONT_SIZE
The font size.

POSTFIX

protected static final boolean POSTFIX
The text position.

PREFERRED_HEIGHT

public static final int PREFERRED_HEIGHT
The preferred height.

PREFERRED_WIDTH

public static final int PREFERRED_WIDTH
The preferred width.

textColor

protected Color textColor
The text color.

totalMemory

protected long totalMemory
The total memory.

TOTAL

protected static final String TOTAL
The total string.

usedColors

protected Color[] usedColors
The color of the used blocks for each block type.

UNITS

protected static final String UNITS
The units string.

USED

protected static final String USED
The used string.

Constructor Detail

Usage

public Usage()
Creates a new Usage object.

Method Detail

memoryStateChanged

public void memoryStateChanged(long total, long free)
Indicates that the memory state has changed.

Parameters: total The total amount of memory. free The free memory.

paintComponent

protected void paintComponent(Graphics g)
To paint the component.

setHighFreeMemoryColor

public void setHighFreeMemoryColor(Color c)
Sets the high free memory block color.

setHighUsedMemoryColor

public void setHighUsedMemoryColor(Color c)
Sets the high used memory block color.

setLowFreeMemoryColor

public void setLowFreeMemoryColor(Color c)
Sets the low free memory block color.

setLowUsedMemoryColor

public void setLowUsedMemoryColor(Color c)
Sets the low used memory block color.

setMediumFreeMemoryColor

public void setMediumFreeMemoryColor(Color c)
Sets the medium free memory block color.

setMediumUsedMemoryColor

public void setMediumUsedMemoryColor(Color c)
Sets the medium used memory block color.

setTextColor

public void setTextColor(Color c)
Sets the text color.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.