public abstract class ViewerRoot extends Object implements Viewer
Modifier and Type | Class and Description |
---|---|
static class |
ViewerRoot.CreationFlags
Creation flags.
|
Constructor and Description |
---|
ViewerRoot(boolean scrollable)
Creates a new ViewerRoot.
|
ViewerRoot(boolean trackWidthIn,
boolean trackHeightIn)
Creates a new ViewerRoot with a scrollable main panel.
|
ViewerRoot(boolean trackWidthIn,
boolean trackHeightIn,
EnumSet<ViewerRoot.CreationFlags> flags)
Creates a new ViewerRoot with a scrollable main panel.
|
ViewerRoot(boolean scrollable,
EnumSet<ViewerRoot.CreationFlags> flags)
Creates a new ViewerRoot.
|
Modifier and Type | Method and Description |
---|---|
void |
build(ViewerInitData vid,
Element initDataIn)
Builds the viewer non-gui internals.
|
void |
buildGui(JPanel main)
Builds the user interface.
|
void |
configure()
Configures the viewer.
|
boolean |
contains(JComponent comp,
int x,
int y)
Determines if a point on the view is clickable.
|
Border |
createBorder()
Creates a black line border that is invisible when the viewer is
transparent.
|
Border |
createBorder(int space)
Creates a compound black line around space border that is invisible when
the viewer is transparent.
|
Border |
createFixedBorder()
Creates a black line border that is always visible.
|
Border |
createFixedBorder(int space)
Creates a compound line around space border that is always visible.
|
JComponent |
getColumnHeader()
Gets the column header.
|
JPanel |
getMainPanel()
Gets the root viewer panel.
|
Dimension |
getMainSize()
Gets the default size for the main panel when on the canvas, if this
needs to be different from the preferred size.
|
String |
getMainToolTipText(MouseEvent e)
Gets the tool tip text for the main window.
|
JComponent |
getRowHeader()
Gets the row header.
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Gets the block increment when there is a scrollable main without a
single scrollable child.
|
boolean |
getScrollableTracksViewportHeight()
Determines if the height of the viewport should match the height of the
main panel when there is a scrollable main.
|
boolean |
getScrollableTracksViewportWidth()
Determines if the width of the viewport should match the width of the
main panel when there is a scrollable main.
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Gets the unit increment when there is a scrollable main without a single
scrollable child.
|
ViewerInitData |
getVIData()
Gets the viewer data and control object.
|
boolean |
isViewerTransparent()
Determines if the viewer is transparent.
|
void |
paintMainView(Graphics2D graphics,
JPanel paintPanel)
Paints the root viewer panel.
|
boolean |
toXML(Document doc,
Element e)
Stores the state of the viewer in an XML dom element.
|
void |
update(ViewerValueData valueData,
ViewerUpdateData data,
DebugContext context)
Updates the viewer.
|
void |
updateGui()
Updates the gui.
|
abstract void |
updateState(ViewerValueData valueData,
ViewerUpdateData data,
DebugContext context)
Updates the view state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, getInfo, getPriority, getViewName
public ViewerRoot(boolean scrollable)
scrollable
- true if the main panel should implement
Scrollable
, false if it should not.public ViewerRoot(boolean trackWidthIn, boolean trackHeightIn)
trackWidthIn
- true if the main panel should track the scrollport
width, false otherwise. Note that if the main panel contains exactly one
child and if that child implements Scrollable
, this value will be
ignored and the behavior will be inherited from the child.trackHeightIn
- true if the main panel should track the scrollport
width, false otherwise. Note that if the main panel contains exactly one
child and if that child implements Scrollable
, this value will be
ignored and the behavior will be inherited from the child.public ViewerRoot(boolean trackWidthIn, boolean trackHeightIn, EnumSet<ViewerRoot.CreationFlags> flags)
trackWidthIn
- true if the main panel should track the scrollport
width, false otherwise. Note that if the main panel contains exactly one
child and if that child implements Scrollable
, this value will be
ignored and the behavior will be inherited from the child.trackHeightIn
- true if the main panel should track the scrollport
width, false otherwise. Note that if the main panel contains exactly one
child and if that child implements Scrollable
, this value will be
ignored and the behavior will be inherited from the child.flags
- creation flags.public ViewerRoot(boolean scrollable, EnumSet<ViewerRoot.CreationFlags> flags)
scrollable
- true if the main panel should implement
Scrollable
, false if it should not.flags
- creation flags.public void build(ViewerInitData vid, Element initDataIn)
public void buildGui(JPanel main)
main
- the root panel for the UI. This will be an empty JPanel with
no layout manager set.public void configure()
public boolean contains(JComponent comp, int x, int y)
comp
- the main panel. This method is only called if
comp.super.contains(x, y) returned true.x
- x position of the point of interest.y
- y position of the point of interest.public Border createBorder()
public Border createBorder(int space)
space
- the spacing for the space border, in units of "thin border
width".public Border createFixedBorder()
public Border createFixedBorder(int space)
space
- the pixel spacing for the space border.public JComponent getColumnHeader()
public JPanel getMainPanel()
public Dimension getMainSize()
public String getMainToolTipText(MouseEvent e)
e
- the event which triggered the tool tip.public JComponent getRowHeader()
public int getScrollableBlockIncrement(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 boolean getScrollableTracksViewportHeight()
public boolean getScrollableTracksViewportWidth()
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 ViewerInitData getVIData()
public boolean isViewerTransparent()
public void paintMainView(Graphics2D graphics, JPanel paintPanel)
graphics
- the graphics to be used for painting.paintPanel
- the panel to be painted.public boolean toXML(Document doc, Element e)
public void update(ViewerValueData valueData, ViewerUpdateData data, DebugContext context) throws ViewerException
update
in interface Viewer
valueData
- the new value and associated information, such as
declared type. This will be null for animation updates.data
- information about this update, such as why it was triggered,
and if it was triggered by a flagged method entry, the method argument
values.context
- debugger context that is necessary for working with
values, and provides some global debugger access. This will be null for
animation updates.ViewerException
- if an exception is encountered.public void updateGui()
public abstract void updateState(ViewerValueData valueData, ViewerUpdateData data, DebugContext context) throws ViewerException
valueData
- the new value and associated information, such as
declared type. This will be null for animation updates.data
- information about this update, such as why it was triggered,
and if it was triggered by a flagged method entry, the method argument
values.context
- debugger context that is necessary for working with
values, and provides some global debugger access. This will be null for
animation updates.ViewerException
- if an exception is encountered.