public abstract class SimpleLinkedHashView extends AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
Modifier and Type | Class and Description |
---|---|
static class |
SimpleLinkedHashView.Chain
Class for holding a chain wrapper or chain node.
|
protected static class |
SimpleLinkedHashView.LHNodeLoc
Class for holding a node location within the entire view.
|
protected static class |
SimpleLinkedHashView.LHStructData
Structure data from an update.
|
AnimatingLinkedView.State
PresentationView.MainRoot, PresentationView.Settings, PresentationView.SizeLimitDialog
ANIMATE, CCW, REVERSIBLE, ROUND, VERTICAL
Constructor and Description |
---|
SimpleLinkedHashView(ViewerCreateData vcd,
int numValuesPerNode,
boolean linkedIn,
boolean wrappersIn)
Creates a new SimpleLinkedHashView.
|
Modifier and Type | Method and Description |
---|---|
void |
build(ViewerInitData vid,
Element initDataIn)
Builds the viewer non-gui internals.
|
void |
changeSizeLimit()
Changes a structure size limit imposed by the PresentationView subclass.
|
void |
configure(boolean update,
JPanel paintPanel,
AnimatingLinkedView.State s)
Configures the viewer based on the current state.
|
PresentationView.Settings |
createGlobalSettings()
Creates a global settings object for the viewer.
|
abstract Value |
getElement(Value table,
int nodeIndex,
DebugContext context)
Gets an element in the hash table.
|
abstract int |
getElementCount(Value value,
DebugContext context)
Gets the element count for the hash table.
|
Value |
getFirstNode(Value table,
Value element,
DebugContext context)
Gets the first node in a chain.
|
protected Rectangle |
getLabelBounds(int row,
Rectangle2D textBounds,
AnimatingLinkedView.State s)
Gets the bounds rectangle for a row label.
|
Point2D.Double |
getLinkTarget(int sourceRow,
NodeData<SimpleLinkedHashView.LHNodeLoc> nd,
AnimatingLinkedView.State s,
double edgeAdjust) |
protected Point2D.Double |
getLVLinkSource(int row,
AnimatingLinkedView.State s) |
abstract Value |
getNextNode(Value table,
Value node,
DebugContext context)
Gets the next node for a specified node.
|
String |
getNodeArrayField()
Gets the name of the field that contains the node list array, if there
is one.
|
Rectangle |
getNodeRect(NodeData<SimpleLinkedHashView.LHNodeLoc> nd,
AnimatingLinkedView.State s)
Gets the display rectangle for a node.
|
abstract Value |
getNodeValue(Value list,
Value node,
int valueIndex,
DebugContext context)
Gets the value contained in a node.
|
String |
getNodeValueText(Value list,
Value node,
Value value,
int valueIndex,
DebugContext context)
Gets the display text for a node value.
|
PresentationElement |
getPe(NodeData<SimpleLinkedHashView.LHNodeLoc> nd)
Gets the presentation element corresponding to a node.
|
int |
getPriority(ViewerPriorityData vpd)
Gets the viewer priority.
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Gets the unit increment when there is a scrollable main without a single
scrollable child.
|
PresentationView.Settings |
getSettingsCopy(PresentationView.Settings settingsIn)
Creates a copy of settings.
|
int |
getSizeLimit()
Gets the node size limit.
|
String |
getViewName()
Gets the display name of the viewer.
|
protected boolean |
horizontalRows()
Determines if rows are stacked horizontally or vertically.
|
protected NodeData<SimpleLinkedHashView.LHNodeLoc> |
nodeLocationToData(SimpleLinkedHashView.LHNodeLoc location,
SimpleLinkedHashView.LHStructData currentData)
Gets the node data at a specified node location.
|
void |
paintMainView(Graphics graphics,
JPanel paintPanel,
AnimatingLinkedView.State s)
Paints the view.
|
void |
setCollectionState(SimpleLinkedHashView.LHStructData data,
boolean enableCollection)
Protects the recorded structure from garbage collection, or removes that
protection.
|
SimpleLinkedHashView.LHStructData |
update(Value value,
ViewerUpdateData data,
DebugContext context)
Gets the structure data.
|
configure, createGui, destroy, getBlendComposite, getDisplayFields, getMainSize, getNodeColor, getNodeType, getNumValuesPerNode, matchesLocal, paintArray, paintHashArrayElement, paintLabels, paintNodes, rightLabels, setSubViewValue, update, updateGui
addToolBarButton, animate, getAnimateDelay, getCurrentSettings, getElementChars, getElementWidth, getNewSizeLimit, getPerClassSettings, getRefSettings, init, isEmbedded, isReversed, isRound, isSimple, isVertical, isViewerTransparent, noSimpleForPrimitives, scaleFont, setError, setLabelLocation, setSelectionViewValue, setSizeLabelText, setValuesAreObjects, showEmbedded, showReversed, showRound, showSimple, showVertical, sizeLimitExceeded, toXML, valuesAreObjects
public SimpleLinkedHashView(ViewerCreateData vcd, int numValuesPerNode, boolean linkedIn, boolean wrappersIn)
vcd
- creation data.numValuesPerNode
- the number of values to be displayed for each
node.linkedIn
- true if the nodes are chained, false otherwise.wrappersIn
- true if the node chains start with a wrapper node,
false if they start with the first element in the chain.public void build(ViewerInitData vid, Element initDataIn)
build
in interface Viewer
build
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
vid
- initialization and control element for the viewer.initDataIn
- XML initialization data for the viewer.public void changeSizeLimit()
PresentationView
sizeLimitExceeded()
is called, this
method must be overridden.changeSizeLimit
in class PresentationView<PresentationView.Settings>
public void configure(boolean update, JPanel paintPanel, AnimatingLinkedView.State s)
configure
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
update
- true if the viewer panel should be resized (if necessary)
and repainted, false if it should not.paintPanel
- the panel on which the view will be displayed.s
- the current viewer state.public PresentationView.Settings createGlobalSettings()
createGlobalSettings
in class PresentationView<PresentationView.Settings>
public abstract Value getElement(Value table, int nodeIndex, DebugContext context) throws ViewerException
table
- the current hashtable being viewed.context
- the current debugger context.nodeIndex
- index of the root node of interest.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public abstract int getElementCount(Value value, DebugContext context) throws ViewerException
value
- the current value being viewed.context
- the current debugger context.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public Value getFirstNode(Value table, Value element, DebugContext context) throws ViewerException
table
- the current hashtable being viewed.element
- the element at the root of the chain.context
- the current debugger context.element
. If
there is no wrapper, this will be element. The default implementation
returns element.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public Point2D.Double getLinkTarget(int sourceRow, NodeData<SimpleLinkedHashView.LHNodeLoc> nd, AnimatingLinkedView.State s, double edgeAdjust)
public abstract Value getNextNode(Value table, Value node, DebugContext context) throws ViewerException
table
- the current hashtable. This will be a null value for local
variable nodes. If a table is required to follow the link and it can not
be obtained from the node, then return a null Value and local nodes will
show up without linked nodes.node
- the node of interest.context
- the current debugger context.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public String getNodeArrayField()
public Rectangle getNodeRect(NodeData<SimpleLinkedHashView.LHNodeLoc> nd, AnimatingLinkedView.State s)
getNodeRect
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
nd
- the node data.s
- the structure state.public abstract Value getNodeValue(Value list, Value node, int valueIndex, DebugContext context) throws ViewerException
list
- the list object. This will be a null value for local variable
nodes. If a list is required to follow the link and it can not be
obtained from the node, then return a null Value and selecting local
variable nodes will not display the actual value.node
- the node of interest.valueIndex
- index of the value of interest.context
- the current debugger context.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public String getNodeValueText(Value list, Value node, Value value, int valueIndex, DebugContext context) throws ViewerException
list
- the list object. This will be a null value for local variable
nodes. If a list is required to follow the link and it can not be
obtained from the node, then return any arbitrary value ("?" suggested)
for local variable nodes to display.node
- the node of interest.value
- the value of interest.valueIndex
- index of the value of interest.context
- the current debugger context.ViewerException
- if any exceptions are occur and are not caught
while using jgrdi.public PresentationElement getPe(NodeData<SimpleLinkedHashView.LHNodeLoc> nd)
getPe
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
nd
- node data for the node, or null if the presentation element for
field nodes should be returned.nd
, or if nd
is null, the
presentation element used to layout and paint field nodes.public int getPriority(ViewerPriorityData vpd)
Viewer
vpd
- data about how the viewer will be used.Integer.MIN_VALUE
indicates that the viewer
dialog or canvas should change viewers.public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in class PresentationView<PresentationView.Settings>
visibleRect
- the main panel visible rect.orientation
- the scroll direction, one of
SwingConstants.VERTICAL
and SwingConstants.HORIZONTAL
.direction
- negative for a left or up scroll, positive for a right
or down scroll.public PresentationView.Settings getSettingsCopy(PresentationView.Settings settingsIn)
getSettingsCopy
in class PresentationView<PresentationView.Settings>
settingsIn
- the settings to be copied.public int getSizeLimit()
getSizeLimit
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
public String getViewName()
Viewer
public void paintMainView(Graphics graphics, JPanel paintPanel, AnimatingLinkedView.State s)
AnimatingLinkedView
paintMainView
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
graphics
- the graphics to which the view will be rendered.paintPanel
- the panel on which the view will be rendered.s
- the current viewer state.public void setCollectionState(SimpleLinkedHashView.LHStructData data, boolean enableCollection)
setCollectionState
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
data
- the structure data to be protected or freed.enableCollection
- if true, garbage collection protection will be
removed, if false it will be enabled.public SimpleLinkedHashView.LHStructData update(Value value, ViewerUpdateData data, DebugContext context) throws ViewerException
update
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
value
- the current structure value.data
- viewer update data.context
- the current debugger context.ViewerException
- if an error occurs while updating the viewer.protected Rectangle getLabelBounds(int row, Rectangle2D textBounds, AnimatingLinkedView.State s)
getLabelBounds
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
row
- the row.textBounds
- bounds (size) of the label text.s
- the structure state.protected Point2D.Double getLVLinkSource(int row, AnimatingLinkedView.State s)
protected boolean horizontalRows()
horizontalRows
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
PresentationView.showVertical()
.protected NodeData<SimpleLinkedHashView.LHNodeLoc> nodeLocationToData(SimpleLinkedHashView.LHNodeLoc location, SimpleLinkedHashView.LHStructData currentData)
nodeLocationToData
in class AnimatingLinkedView<PresentationView.Settings,SimpleLinkedHashView.LHNodeLoc,SimpleLinkedHashView.LHStructData>
location
- the node location of interest.currentData
- current structure data.