public abstract class BasicPresentationListView extends PresentationView<PresentationView.Settings>
Modifier and Type | Class and Description |
---|---|
static class |
BasicPresentationListView.ElementData
Per-element data class.
|
static class |
BasicPresentationListView.GuiState
State data for the gui.
|
PresentationView.MainRoot, PresentationView.Settings, PresentationView.SizeLimitDialog
Modifier and Type | Field and Description |
---|---|
static int |
BACK_LINKS
Constructor flag indicating that the linked list type being viewed has
back links (is doubly linked).
|
static int |
CONTAINER
Selection type indicating that some element of the container that
contains a value, such as one element of the array in an ArrayList or an
Entry in a HashMap, is selected.
|
static int |
END_LINK_TO_START
Constructor flag indicating that the linked list type being viewed has a
link from the last element to the first, or if present, the header
element.
|
static int |
HEADER
Constructor flag indicating that the linked list type being viewed has a
header element.
|
static int |
LINK_IGNORE
Link target constant indicating link should be assumed good.
|
static int |
LINK_NULL
Link target constant indicating null link.
|
static int |
LINKED
Constructor flag indicating that a linked list will be viewed.
|
static int |
START_LINK_TO_END
Constructor flag indicating that the linked list type being viewed has a
back links from the header element to the last element.
|
static int |
VALUE
Selection type indicating that the value in the container is
selected.
|
ANIMATE, CCW, REVERSIBLE, ROUND, VERTICAL
Constructor and Description |
---|
BasicPresentationListView(ViewerCreateData vcd)
Creates a new BasicPresentationHashView for viewing arrays or vectors.
|
BasicPresentationListView(ViewerCreateData vcd,
int flags)
Creates a new BasicPresentationListView.
|
Modifier and Type | Method and Description |
---|---|
void |
build(ViewerInitData vid,
Element initDataIn)
Builds the viewer non-gui internals.
|
void |
center(int index)
Centers a particular item.
|
void |
configure()
Called when settings that may affect the layout of nodes in the view
have changed.
|
PresentationView.Settings |
createGlobalSettings()
Creates a global settings object for the viewer.
|
JPanel |
createGui() |
void |
destroy()
Called when the viewer is closed or frozen.
|
BasicPresentationListView.GuiState |
getGuiState()
Gets the gui state.
|
abstract 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.
|
abstract String |
getViewName()
Gets the display name of the viewer.
|
boolean |
hasHeader()
Determines if the list has a header node.
|
boolean |
noSimpleForPrimitives()
Determines if the simple toggle should be shown when values are
primitives.
|
boolean |
setItemCount(int countIn)
Sets the number of items in the list, array, or vector.
|
void |
setLinkage(boolean startToEndIn,
boolean endToStartIn,
boolean headerIn)
Initializes the start-to-end and end-to-start links.
|
void |
setSelection(int index,
int type)
Sets the selected item.
|
void |
setSelectionViewValue(int selectionViewIndex,
Value value,
DebugContext context,
String name,
String label,
boolean reset)
Sets the value in the selection sub-view.
|
boolean |
showLinked()
Gets the type of list.
|
void |
updateGui() |
void |
updateGui(int updateOffset,
BasicPresentationListView.ElementData[] elements,
List<IndexItem> markersIn,
int numElements,
boolean isObjectList)
Updates the gui.
|
void |
updateView()
Repaints the view.
|
addToolBarButton, animate, changeSizeLimit, getAnimateDelay, getCurrentSettings, getElementChars, getElementWidth, getNewSizeLimit, getPerClassSettings, getRefSettings, init, isEmbedded, isReversed, isRound, isSimple, isVertical, isViewerTransparent, scaleFont, setError, setLabelLocation, setSizeLabelText, setValuesAreObjects, showEmbedded, showReversed, showRound, showSimple, showVertical, sizeLimitExceeded, toXML, valuesAreObjects
public static final int VALUE
public static final int CONTAINER
public static final int LINK_NULL
public static final int LINK_IGNORE
public static final int LINKED
public static final int BACK_LINKS
public static final int HEADER
public static final int END_LINK_TO_START
public static final int START_LINK_TO_END
public BasicPresentationListView(ViewerCreateData vcd)
vcd
- creation data.public BasicPresentationListView(ViewerCreateData vcd, int flags)
vcd
- creation data.flags
- constructor flags. A combination of LINKED
,
BACK_LINKS
, HEADER
, END_LINK_TO_START
, and
START_LINK_TO_END
.public void build(ViewerInitData vid, Element initDataIn)
build
in interface Viewer
build
in class PresentationView<PresentationView.Settings>
vid
- initialization and control element for the viewer.initDataIn
- XML initialization data for the viewer.public void center(int index)
index
- the item.public void configure()
PresentationView
configure
in class PresentationView<PresentationView.Settings>
public PresentationView.Settings createGlobalSettings()
createGlobalSettings
in class PresentationView<PresentationView.Settings>
public JPanel createGui()
createGui
in class PresentationView<PresentationView.Settings>
public void destroy()
Viewer
public BasicPresentationListView.GuiState getGuiState()
public abstract 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 abstract String getViewName()
Viewer
public boolean hasHeader()
public boolean noSimpleForPrimitives()
Overridden to return false for non-linked lists.
noSimpleForPrimitives
in class PresentationView<PresentationView.Settings>
public boolean setItemCount(int countIn)
countIn
- the number of items.public void setLinkage(boolean startToEndIn, boolean endToStartIn, boolean headerIn)
startToEndIn
- true if first back link of linked list is to last
node, false otherwise.endToStartIn
- true if linked list ends with a link to the header or
first node, false otherwise.headerIn
- true if the list has a header node, false otherwise.public void setSelection(int index, int type)
index
- the selected item. Set this to -1 to remove the selection.type
- the type of selection. This can be either CONTAINER or VALUE,
to select the entire item, or the value it contains.public void setSelectionViewValue(int selectionViewIndex, Value value, DebugContext context, String name, String label, boolean reset)
setSelectionViewValue
in class PresentationView<PresentationView.Settings>
selectionViewIndex
- index of the selection sub-view for which the
value will be set.value
- the new value. A null value will pop the selection sub-view
closed (if it was popped open) and make it invisible. A non-null value
will do the opposite.context
- the current debugger context.name
- display name to give the value. This will be shown by the
"basic" viewer.label
- string to display at the top of the sub-viewer.reset
- true if this value should not be considered the "same
variable" as the previous value, false otherwise. If this is true and the
viewer shows an indication of changes to the value, it should display
this value as it would the initial value.public boolean showLinked()
public void updateGui()
updateGui
in class PresentationView<PresentationView.Settings>
public void updateGui(int updateOffset, BasicPresentationListView.ElementData[] elements, List<IndexItem> markersIn, int numElements, boolean isObjectList)
updateOffset
- offset of the first element visible on the screen.elements
- the data for each visible node.numElements
- the number of elements that are significant.markersIn
- list of index markers. This may be null.isObjectList
- true if the values are objects, false if they are
primitives.public void updateView()