|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.ascape.view.vis.PanelView
public class PanelView
A base class for a panel that acts as an observer of scapes. Provides notification of scape updates.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ComponentViewDelegate |
delegate
The delegate. |
protected int |
iterationsPerRedraw
Specifies the number of updates that occur between each draw. |
protected java.lang.String |
name
The name of the view. |
protected Scape |
scape
The scape being viewed. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PanelView()
Constructs a panel view. |
|
PanelView(java.lang.String name)
Constructs a panel view. |
Method Summary | |
---|---|
void |
build()
Called to create and layout the components of the component view, once the view's scape has been created. |
java.lang.Object |
clone()
Clones this object. |
void |
environmentQuiting(ScapeEvent scapeEvent)
Method called when the environment quits. |
void |
forceScapeNotify()
Forces the view to notify its scape. |
ComponentViewDelegate |
getDelegate()
Gets the delegate. |
javax.swing.ImageIcon |
getIcon()
Return an icon that can be used to represent this frame. |
int |
getIterationsPerRedraw()
Returns the number of iterations that occur before the view is updated. |
java.lang.String |
getName()
Returns a name for the view as defined by set name. |
java.awt.Dimension |
getPreferredSizeWithin(java.awt.Dimension d)
Default behavior for a component. |
Scape |
getScape()
Returns the scape this canvas views. |
ViewFrameBridge |
getViewFrame()
Returns the frame this view occupies, null if none. |
void |
iconUpdated()
Should be called when the view has updated itself in a way that changes icon. |
boolean |
isGraphic()
Returns true; this is a GUI view. |
boolean |
isLifeOfScape()
Returns true (default) if the listener is intended to be used only for the current scape; typical of all but control related listeners. |
void |
notifyScapeUpdated()
Called to notify the parent scape that the view has been updated. |
void |
onChangeIterationsPerRedraw()
Called when the scape requests a change to iterations per redraw. |
void |
paintComponent(java.awt.Graphics g)
Paints the panel. |
void |
readExternal(java.io.ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
void |
scapeAdded(ScapeEvent scapeEvent)
Notifies the listener that the scape has added it. |
void |
scapeClosing(ScapeEvent scapeEvent)
Method called when the scape is closed. |
void |
scapeDeserialized(ScapeEvent scapeEvent)
Method called once a model is deserialized. |
void |
scapeInitialized(ScapeEvent scapeEvent)
Method called when the scape is initialized. |
void |
scapeIterated(ScapeEvent scapeEvent)
Called when scape is iterated. |
void |
scapeNotification(ScapeEvent scapeEvent)
Notifies this view that something has happened on the scape. |
void |
scapeRemoved(ScapeEvent scapeEvent)
Notifies the listener that the scape has removed it. |
void |
scapeSetup(ScapeEvent scapeEvent)
Method called when the scape is ready for setup. |
void |
scapeStarted(ScapeEvent scapeEvent)
Method called when the scape is started. |
void |
scapeStopped(ScapeEvent scapeEvent)
Method called when the scape is stopped. |
void |
setDelegate(ComponentViewDelegate delegate)
Sets the delegate. |
void |
setIterationsPerRedraw(int iterationsPerRedraw)
Sets the number of iterations that occur before the view is updated. |
void |
setMovieRecorder(MovieRecorder recorder)
Sets the recorder that can be used to record the graphics of this view. |
void |
setName(java.lang.String name)
Sets the name of this view. |
void |
setViewFrame(ViewFrameBridge frame)
Sets the frame this view appears in. |
java.lang.String |
toString()
Returns a short description of this view. |
void |
updateScapeGraphics()
Called when scape reports an update event. |
void |
writeExternal(java.io.ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Scape scape
protected ComponentViewDelegate delegate
protected int iterationsPerRedraw
protected java.lang.String name
Constructor Detail |
---|
public PanelView()
public PanelView(java.lang.String name)
name
- a user relevant name for this viewMethod Detail |
---|
public void build()
build
in interface ComponentView
public void scapeAdded(ScapeEvent scapeEvent) throws java.util.TooManyListenersException
scapeAdded
in interface ScapeListener
scapeEvent
- the scape added notification event
java.util.TooManyListenersException
- the too many listeners exception
java.util.TooManyListenersException
- on attempt to add this listener to another scape when one
has already been assignedpublic void scapeRemoved(ScapeEvent scapeEvent)
scapeRemoved
in interface ScapeListener
scapeEvent
- the scape removed notification eventscapeAdded
public void scapeNotification(ScapeEvent scapeEvent)
scapeNotification
in interface ScapeListener
scapeEvent
- a scape event updatepublic void scapeIterated(ScapeEvent scapeEvent)
scapeIterated
in interface ScapeListener
scapeEvent
- the scape eventpublic void scapeSetup(ScapeEvent scapeEvent)
scapeSetup
in interface ScapeListener
scapeEvent
- the scape eventpublic void updateScapeGraphics()
updateScapeGraphics
in interface ComponentView
public void scapeInitialized(ScapeEvent scapeEvent)
scapeInitialized
in interface ScapeListener
scapeEvent
- the scape eventpublic void scapeStarted(ScapeEvent scapeEvent)
scapeStarted
in interface ScapeListener
scapeEvent
- the scape eventpublic void scapeStopped(ScapeEvent scapeEvent)
scapeStopped
in interface ScapeListener
scapeEvent
- the scape eventpublic void scapeClosing(ScapeEvent scapeEvent)
scapeClosing
in interface ScapeListener
scapeEvent
- the scape eventpublic void environmentQuiting(ScapeEvent scapeEvent)
environmentQuiting
in interface ScapeListener
scapeEvent
- the scape eventpublic void onChangeIterationsPerRedraw()
ComponentView
onChangeIterationsPerRedraw
in interface ComponentView
public void scapeDeserialized(ScapeEvent scapeEvent)
scapeDeserialized
in interface ScapeListener
scapeEvent
- the scape eventpublic java.lang.String getName()
getName
in interface HasName
getName
in class java.awt.Component
public void setName(java.lang.String name)
setName
in class java.awt.Component
name
- a user relevant name for this viewpublic void setMovieRecorder(MovieRecorder recorder)
setMovieRecorder
in interface ComponentView
recorder
- the recorderpublic final boolean isGraphic()
isGraphic
in interface ScapeListener
public boolean isLifeOfScape()
isLifeOfScape
in interface ScapeListener
public Scape getScape()
getScape
in interface ScapeListener
getScape
in interface ComponentView
public int getIterationsPerRedraw()
getIterationsPerRedraw
in interface ComponentView
public void setIterationsPerRedraw(int iterationsPerRedraw)
setIterationsPerRedraw
in interface ComponentView
iterationsPerRedraw
- the number of iterations to wait between paintspublic ViewFrameBridge getViewFrame()
getViewFrame
in interface ComponentView
public void setViewFrame(ViewFrameBridge frame)
setViewFrame
in interface ComponentView
frame
- the framepublic void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- the gpublic void notifyScapeUpdated()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write the object to
java.io.IOException
- Signals that an I/O exception has occurred.
java.io.IOException
- Includes any I/O exceptions that may occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- the stream to read data from in order to restore the object
java.io.IOException
- Signals that an I/O exception has occurred.
java.lang.ClassNotFoundException
- the class not found exception
java.io.IOException
- if I/O errors occur
java.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.public java.lang.Object clone()
clone
in interface ScapeListener
clone
in class java.lang.Object
public ComponentViewDelegate getDelegate()
public void setDelegate(ComponentViewDelegate delegate)
delegate
- the new delegatepublic void forceScapeNotify()
ComponentView
forceScapeNotify
in interface ComponentView
public java.awt.Dimension getPreferredSizeWithin(java.awt.Dimension d)
getPreferredSizeWithin
in interface ComponentView
d
- the d
public javax.swing.ImageIcon getIcon()
getIcon
in interface ComponentView
public void iconUpdated()
iconUpdated
in interface ComponentView
public java.lang.String toString()
toString
in class java.awt.Component
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |