public class Visualizer extends MultiLayerRenderer
MultiLayerRenderer
class to provide a base instance of a StateRenderLayer
in its render list
and provides methods to directly access and interface with the StateRenderLayer
instance.
The StateRenderLayer
instance provides 2D visualization of states by being provided a set of classes that can paint
ObjectInstnaces to the canvas as well as classes that can paint general domain information. Painters
for object classes as well as specific object instances can be provided. If there is a painter
for an object class and a painter for a specific object instance of that same class, then the specific object instance
painter will be used to pain that object instead of the painter for that instnace's OO-MDP class.Modifier and Type | Field and Description |
---|---|
protected StateRenderLayer |
srender
The
StateRenderLayer instance for visualizing OO-MDP states. |
bgColor, bufferedGraphics, offscreen, renderLayers
Constructor and Description |
---|
Visualizer() |
Visualizer(StateRenderLayer srender) |
Modifier and Type | Method and Description |
---|---|
void |
addObjectClassPainter(java.lang.String className,
ObjectPainter op)
Adds a class that will paint objects that belong to a given OO-MDPclass.
|
void |
addSpecificObjectPainter(java.lang.String objectName,
ObjectPainter op)
Adds a painter that will be used to paint a specific object in states
|
void |
addStaticPainter(StaticPainter sp)
Adds a static painter for the domain.
|
StateRenderLayer |
getStateRenderLayer()
Returns the
StateRenderLayer instance for visualizing OO-MDP states. |
void |
setBGColor(java.awt.Color c)
Sets the background color of the canvas
|
void |
setSetRenderLayer(StateRenderLayer srender) |
void |
updateState(State s)
Updates the state that needs to be painted and repaints.
|
addRenderLayer, getBgColor, initializeOffscreen, insertRenderLayerTo, numRenderLayers, paint, removeRenderLayer
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
protected StateRenderLayer srender
StateRenderLayer
instance for visualizing OO-MDP states.public Visualizer()
public Visualizer(StateRenderLayer srender)
public void setSetRenderLayer(StateRenderLayer srender)
public void setBGColor(java.awt.Color c)
setBGColor
in class MultiLayerRenderer
c
- the background color of the canvaspublic void addStaticPainter(StaticPainter sp)
sp
- the static painter to add.public void addObjectClassPainter(java.lang.String className, ObjectPainter op)
className
- the name of the class that the provided painter can paintop
- the painterpublic void addSpecificObjectPainter(java.lang.String objectName, ObjectPainter op)
objectName
- the name of the object this painter is used to paintop
- the painterpublic StateRenderLayer getStateRenderLayer()
StateRenderLayer
instance for visualizing OO-MDP states.StateRenderLayer
instance for visualizing OO-MDP states.public void updateState(State s)
s
- the state to paint