APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.jvm.hotspot.ui

public Class AnnotatedMemoryPanel

extends JPanel
Class Inheritance
Imports
java.math.*, java.awt.*, java.awt.font.*, java.awt.geom.*, java.awt.event.*, java.io.*, javax.swing.*, javax.swing.event.*, java.util.*, sun.jvm.hotspot.debugger.*, sun.jvm.hotspot.debugger.dummy.*, sun.jvm.hotspot.utilities.*

A subclass of JPanel which displays a hex dump of memory along with annotations describing the significance of various pieces. This can be used to implement either a stack or heap inspector.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private long
private IntervalTree
private int
private static Color[]
private Debugger
private Font
private boolean
private Address
private int
private HighPrecisionJScrollBar
private String
private List<Annotation>

Constructor Summary

AccessConstructor and Description
public
AnnotatedMemoryPanel(Debugger debugger)

Default is 32-bit mode

public
AnnotatedMemoryPanel(Debugger debugger, boolean is64Bit, Address addrValue, Address addrLow, Address addrHigh)

public
AnnotatedMemoryPanel(Debugger debugger, boolean is64Bit)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
addAnnotation(Annotation annotation)

Add an annotation covering the address range [annotation.lowAddress, annotation.highAddress); that is, it includes the low address and does not include the high address.

private BigInteger
private String
private Address
private String
private static BigInteger
defaultMemoryHigh(boolean is64Bit)

private static BigInteger
defaultMemoryLocation(boolean is64Bit)

private static BigInteger
defaultMemoryLow(boolean is64Bit)

private int
private void
init(Debugger debugger, boolean is64Bit, BigInteger addrValue, BigInteger addrLow, BigInteger addrHigh)

private void
layoutAfter(Annotation anno, Annotation constraintAnno, Graphics g, int x, Address startAddr, int lineHeight)

Lays out the given annotation after the optional constraint annotation, obeying constraints imposed by that annotation if it is specified.

private void
layoutAnnotations(List<IntervalNode> va, Graphics g, int x, Address startAddr, int lineHeight)

Takes the list of currently-visible annotations (in the form of a List<intervalnode>) and lays them out given the current visible position and the already-visible annotations.

private void
layoutBefore(Annotation anno, Annotation constraintAnno, Graphics g, int x, Address startAddr, int lineHeight)

Lays out the given annotation before the optional constraint annotation, obeying constraints imposed by that annotation if it is specified.

public static void
main(String[] args)

public synchronized void
makeVisible(Address addr)

Makes the given address visible somewhere in the window

private Color
nextColor(Color c)

Returns next color in our color palette

public synchronized void
paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

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

private Color
prevColor(Color c)

Returns previous color in our color palette

public void
private void
scrollAnnotations(int y)

Scrolls the visible annotations by the given Y amount

private void
private void
Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Field Detail

addressSizeback to summary
private long addressSize
annotationsback to summary
private IntervalTree annotations
bytesPerLineback to summary
private int bytesPerLine
colorsback to summary
private static Color[] colors
debuggerback to summary
private Debugger debugger
fontback to summary
private Font font

Hides java.awt.Component.font.

is64Bitback to summary
private boolean is64Bit
lastStartAddrback to summary
private Address lastStartAddr
paintCountback to summary
private int paintCount
scrollBarback to summary
private HighPrecisionJScrollBar scrollBar
unmappedAddrStringback to summary
private String unmappedAddrString
visibleAnnotationsback to summary
private List<Annotation> visibleAnnotations

Constructor Detail

AnnotatedMemoryPanelback to summary
public AnnotatedMemoryPanel(Debugger debugger)

Default is 32-bit mode

AnnotatedMemoryPanelback to summary
public AnnotatedMemoryPanel(Debugger debugger, boolean is64Bit, Address addrValue, Address addrLow, Address addrHigh)
AnnotatedMemoryPanelback to summary
public AnnotatedMemoryPanel(Debugger debugger, boolean is64Bit)

Method Detail

addAnnotationback to summary
public synchronized void addAnnotation(Annotation annotation)

Add an annotation covering the address range [annotation.lowAddress, annotation.highAddress); that is, it includes the low address and does not include the high address.

addressToBigIntback to summary
private BigInteger addressToBigInt(Address a)
addressToStringback to summary
private String addressToString(Address a)
bigIntToAddressback to summary
private Address bigIntToAddress(BigInteger i)
bigIntToHexStringback to summary
private String bigIntToHexString(BigInteger bi)
defaultMemoryHighback to summary
private static BigInteger defaultMemoryHigh(boolean is64Bit)
defaultMemoryLocationback to summary
private static BigInteger defaultMemoryLocation(boolean is64Bit)
defaultMemoryLowback to summary
private static BigInteger defaultMemoryLow(boolean is64Bit)
findColorIndexback to summary
private int findColorIndex(Color c)
initback to summary
private void init(Debugger debugger, boolean is64Bit, BigInteger addrValue, BigInteger addrLow, BigInteger addrHigh)
layoutAfterback to summary
private void layoutAfter(Annotation anno, Annotation constraintAnno, Graphics g, int x, Address startAddr, int lineHeight)

Lays out the given annotation after the optional constraint annotation, obeying constraints imposed by that annotation if it is specified.

layoutAnnotationsback to summary
private void layoutAnnotations(List<IntervalNode> va, Graphics g, int x, Address startAddr, int lineHeight)

Takes the list of currently-visible annotations (in the form of a List) and lays them out given the current visible position and the already-visible annotations. Does not perturb the layouts of the currently-visible annotations.

layoutBeforeback to summary
private void layoutBefore(Annotation anno, Annotation constraintAnno, Graphics g, int x, Address startAddr, int lineHeight)

Lays out the given annotation before the optional constraint annotation, obeying constraints imposed by that annotation if it is specified.

mainback to summary
public static void main(String[] args)
makeVisibleback to summary
public synchronized void makeVisible(Address addr)

Makes the given address visible somewhere in the window

nextColorback to summary
private Color nextColor(Color c)

Returns next color in our color palette

paintComponentback to summary
public synchronized 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.

prevColorback to summary
private Color prevColor(Color c)

Returns previous color in our color palette

printOnback to summary
public void printOn(PrintStream tty)
scrollAnnotationsback to summary
private void scrollAnnotations(int y)

Scrolls the visible annotations by the given Y amount

setupScrollBarback to summary
private void setupScrollBar(BigInteger value, BigInteger min, BigInteger max)
setupScrollBarback to summary
private void setupScrollBar()
sun.jvm.hotspot.ui back to summary

pack-priv Class AnnotatedMemoryPanel.AnnoX

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Address
pack-priv int

Constructor Summary

AccessConstructor and Description
public
AnnoX(int lineX, Address highBound)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

highBoundback to summary
pack-priv Address highBound
lineXback to summary
pack-priv int lineX

Constructor Detail

AnnoXback to summary
public AnnoX(int lineX, Address highBound)