T
- the settings class.public abstract class PresentationView<T extends PresentationView.Settings> extends Object implements Viewer
Modifier and Type | Class and Description |
---|---|
class |
PresentationView.MainRoot
Root class for main panel.
|
protected static class |
PresentationView.Settings
Settings that track the last viewer choice.
|
static class |
PresentationView.SizeLimitDialog
A dialog that queries the user for a new size limit.
|
Modifier and Type | Field and Description |
---|---|
static int |
ANIMATE
Flag indicating that the viewer will support animation.
|
static int |
CCW
Flag indicating that rotation should be counter-clockwise rather than
clockwise.
|
static int |
REVERSIBLE
Flag indicating that the viewer will support reversed.
|
static int |
ROUND
Flag indicating that the viewer will support round nodes.
|
static int |
VERTICAL
Flag indicating that the viewer will support vertical orientation.
|
Constructor and Description |
---|
PresentationView(ViewerCreateData vcd,
int flags,
int numSubViewersIn)
Creates a PresentationView.
|
PresentationView(ViewerCreateData vcd,
int flags,
int numSubViewersIn,
boolean trackWidthIn,
boolean trackHeightIn)
Creates a PresentationView.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToolBarButton(AbstractButton tbButton)
Supplies an additional button to be added to the viewer toolbar.
|
boolean |
animate()
Determines if animation is on.
|
void |
build(ViewerInitData vid,
Element initDataIn)
Builds the viewer non-gui internals.
|
void |
changeSizeLimit()
Changes a structure size limit imposed by the PresentationView subclass.
|
abstract void |
configure()
Called when settings that may affect the layout of nodes in the view
have changed.
|
abstract T |
createGlobalSettings()
Creates a global settings object for the viewer.
|
abstract JPanel |
createGui() |
int |
getAnimateDelay()
Gets the time that an animation sequence should take.
|
protected T |
getCurrentSettings()
Gets the current settings for this viewer.
|
int |
getElementChars()
Gets the width of the text in any node.
|
int |
getElementWidth()
Gets the initial element width for the viewer.
|
int |
getNewSizeLimit(String message,
int high,
int low)
Queries the user for a new size limit.
|
abstract T |
getPerClassSettings()
Retrieves a per-class settings object for the viewer.
|
protected T |
getRefSettings()
Gets reference settings.
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Gets the unit increment when there is a scrollable main without a single
scrollable child.
|
abstract T |
getSettingsCopy(T settingsIn)
Creates a copy of settings.
|
protected void |
init(Element e)
Initializes the viewer.
|
boolean |
isEmbedded()
Gets the initial embedded state for the viewer.
|
boolean |
isReversed()
Gets the initial reversed state for the viewer.
|
boolean |
isRound()
Gets the initial shape state for the viewer.
|
boolean |
isSimple()
Gets the initial simple state for the viewer.
|
boolean |
isVertical()
Gets the initial vertical state for the viewer.
|
boolean |
isViewerTransparent()
Determines if the viewer is transparent.
|
boolean |
noSimpleForPrimitives()
Determines if the simple toggle should be shown when values are
primitives.
|
protected Font |
scaleFont(Font f)
Scales a font based on the current view scale.
|
void |
setError(String message)
Displays an error message in place of the view, or replaces the current
error message with the view.
|
void |
setLabelLocation(Point loc,
LabelHorzPosition hPos,
LabelVertPosition vPos,
Point tLoc,
LabelHorzPosition thPos,
LabelVertPosition tvPos)
Sets the label location.
|
void |
setSelectionViewValue(int selectionViewIndex,
Value value,
DebugContext context,
String name,
String label,
boolean reset)
Sets the value in the selection sub-view.
|
void |
setSizeLabelText(String text)
Sets the text of the size label.
|
boolean |
setValuesAreObjects(boolean valuesAreObjectsIn)
Sets values in the structure to be objects or primitives.
|
boolean |
showEmbedded()
Determines if values should be shown embedded in the node.
|
boolean |
showReversed()
Determines if the reversed orientation is on.
|
boolean |
showRound()
Determines if the round node view is on.
|
boolean |
showSimple()
Determines if the view should be simple.
|
boolean |
showVertical()
Determines if the vertical orientation is on.
|
void |
sizeLimitExceeded(String message)
Displays a size limit error message in place of the view, and a button
that allows the user to change the size limit.
|
boolean |
toXML(Document doc,
Element e)
Stores the state of the viewer in an XML dom element.
|
void |
updateGui() |
boolean |
valuesAreObjects()
Determines if the values in the structure are objects.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, getInfo, getPriority, getViewName, update
public static final int ANIMATE
public static final int ROUND
public static final int VERTICAL
public static final int REVERSIBLE
public static final int CCW
public PresentationView(ViewerCreateData vcd, int flags, int numSubViewersIn)
vcd
- creation data.flags
- creation flags. A combination of ANIMATE
,
ROUND
, VERTICAL
, REVERSIBLE
, and CCW
.numSubViewersIn
- the number of subviewers to display. Currently
this must be 2 or fewer.public PresentationView(ViewerCreateData vcd, int flags, int numSubViewersIn, boolean trackWidthIn, boolean trackHeightIn)
vcd
- creation data.flags
- creation flags. A combination of ANIMATE
,
ROUND
, VERTICAL
, REVERSIBLE
, and CCW
.numSubViewersIn
- the number of subviewers to display. Currently
this must be 2 or fewer.trackWidthIn
- true if the width should conform to the scroll pane
width when in a scroll pane, false if the width should always be the
preferred width.trackHeightIn
- true if the height should conform to the scroll pane
height when in a scroll pane, false if the height should always be the
preferred height.public boolean animate()
public void build(ViewerInitData vid, Element initDataIn)
public void changeSizeLimit()
sizeLimitExceeded()
is called, this
method must be overridden.public abstract void configure()
public abstract T createGlobalSettings()
public abstract JPanel createGui()
public int getAnimateDelay()
public int getElementChars()
public int getElementWidth()
public int getNewSizeLimit(String message, int high, int low)
message
- a message to display.low
- lower limit for new size limit.high
- high limit for new size limit that will cause a warning if
exceeded.public abstract T getPerClassSettings()
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
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 abstract T getSettingsCopy(T settingsIn)
settingsIn
- the settings to be copied.public boolean isEmbedded()
public boolean isReversed()
public boolean isRound()
public boolean isSimple()
public boolean isVertical()
public boolean isViewerTransparent()
public boolean noSimpleForPrimitives()
public void setError(String message)
message
- the error message to display. If this is null, the normal
value view will be displayed.public void setLabelLocation(Point loc, LabelHorzPosition hPos, LabelVertPosition vPos, Point tLoc, LabelHorzPosition thPos, LabelVertPosition tvPos)
loc
- the label location reference point relative to the main panel
when opaque.hPos
- the horizontal alignment for the label when opaque.vPos
- the vertical alignment for the label when opaque.tLoc
- the label location reference point relative to the main panel
when transparent.thPos
- the horizontal alignment for the label when transparent.tvPos
- the vertical alignment for the label when transparent.public void setSelectionViewValue(int selectionViewIndex, Value value, DebugContext context, String name, String label, boolean reset)
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 void setSizeLabelText(String text)
text
- text for the size label.public boolean setValuesAreObjects(boolean valuesAreObjectsIn)
valuesAreObjectsIn
- if true, the values in the structure will be
treated as objects, otherwise they will be treated as primitives.public boolean showEmbedded()
public boolean showReversed()
public boolean showRound()
public boolean showSimple()
public boolean showVertical()
public void sizeLimitExceeded(String message)
message
- the error message to display. If this is null, no size
limit message will be displayed.public boolean toXML(Document doc, Element e)
public void updateGui()
public boolean valuesAreObjects()
protected void addToolBarButton(AbstractButton tbButton)
tbButton
- the additional toolbar button.protected T getCurrentSettings()
protected T getRefSettings()
protected void init(Element e)
e
- XML initialization data.