de.steeringbehaviors.creator.editor
Class EditorCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by de.steeringbehaviors.creator.editor.EditorCanvas
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class EditorCanvas
extends javax.swing.JComponent

Implements the canvas in the editor

See Also:
Serialized Form

Nested Class Summary
 
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  AttributeEditor m_attributeEditor
          The AttributeEditor
protected  Geometrie m_backgroundImage
          Geometrie which contains a tile with the background image
protected  Geometrie m_clickedObject
          Geometrie which describes the last clicked object
protected  Geometrie m_currentObject
          Geometrie which describes the current selected object
protected  java.awt.Graphics m_dbGraphics
          Graphic context
protected  java.awt.Image m_DoubleBuffer
          Image used for double buffering
protected  java.util.Hashtable m_geometrieObjects
          Hashtable with all objects
protected  SteeringMenuManager m_menuManager
          The menu manager object if necessary
protected  SteeringRenderer m_Renderer
          The SteeringRenderer
protected  java.util.Vector m_selectedObjects
          List of all selected objects
protected  java.util.Vector m_selection
          List of descriptions of all selection objects
protected  SteeringTree m_steeringTree
          The SteeringTree
protected  Geometrie m_velocityNode
          Geometrie which describes the velocity node
protected  java.util.Vector m_visibleObjects
          List of all visible objects
 
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
EditorCanvas(java.util.Hashtable h, SteeringTree tree)
          Constructor
 
Method Summary
 void deselectObjects()
          Deselects all objects
 Geometrie getBackgroundImageGeometrie()
          Returns the geometrie object with the background image tile
 Tile getBackgroundImageTile()
          Returns the tile object with the background image
 SteeringRenderer getRenderer()
          Returns the Renderer
 void loadBackgroundImage(java.lang.String filename)
          Loads a image and sets it as background
 void paint(java.awt.Graphics g)
          Paints the canvas
 void resize()
          Resizes the Canvas and the Renderer to the size specified with the methods setWidth() and setHeight()
 void selectObject(Geometrie obj)
          Selects a Geometrie object
 void setActiveObject(Geometrie obj)
          Sets the active object
 void setAttributeEditor(AttributeEditor aeditor)
          Sets the AttributeEditor
 void setBackgroundImage(java.awt.Image background)
          Sets the background image
 void setGeometrieObjects(java.util.Hashtable h)
          Sets the Hashtable with all geometrie objects
 void setHeight(int height)
          Sets the height of the canvas
 void setMenuManager(SteeringMenuManager mm)
          Sets the menu manager object
 void setWidth(int width)
          Sets the width of the canvas
 void updateDescriptions(SteeringTree steeringtree)
          Generates all descriptions of the objects from the spzified SteeringTree
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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, getName, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_geometrieObjects

protected java.util.Hashtable m_geometrieObjects
Hashtable with all objects


m_selectedObjects

protected java.util.Vector m_selectedObjects
List of all selected objects


m_visibleObjects

protected java.util.Vector m_visibleObjects
List of all visible objects


m_menuManager

protected SteeringMenuManager m_menuManager
The menu manager object if necessary


m_selection

protected java.util.Vector m_selection
List of descriptions of all selection objects


m_backgroundImage

protected Geometrie m_backgroundImage
Geometrie which contains a tile with the background image


m_currentObject

protected Geometrie m_currentObject
Geometrie which describes the current selected object


m_velocityNode

protected Geometrie m_velocityNode
Geometrie which describes the velocity node


m_clickedObject

protected Geometrie m_clickedObject
Geometrie which describes the last clicked object


m_steeringTree

protected SteeringTree m_steeringTree
The SteeringTree


m_attributeEditor

protected AttributeEditor m_attributeEditor
The AttributeEditor


m_Renderer

protected SteeringRenderer m_Renderer
The SteeringRenderer


m_DoubleBuffer

protected java.awt.Image m_DoubleBuffer
Image used for double buffering


m_dbGraphics

protected java.awt.Graphics m_dbGraphics
Graphic context

Constructor Detail

EditorCanvas

public EditorCanvas(java.util.Hashtable h,
                    SteeringTree tree)
Constructor

Parameters:
h - Hashtable of all objects
tree - The SteeringTree
Method Detail

setBackgroundImage

public void setBackgroundImage(java.awt.Image background)
Sets the background image

Parameters:
filename - The Image object to set as background

setWidth

public void setWidth(int width)
Sets the width of the canvas

Parameters:
width - Width to set

setHeight

public void setHeight(int height)
Sets the height of the canvas

Parameters:
height - Height to set

setAttributeEditor

public void setAttributeEditor(AttributeEditor aeditor)
Sets the AttributeEditor

Parameters:
aeditor - The AttributeEditor

setMenuManager

public void setMenuManager(SteeringMenuManager mm)
Sets the menu manager object

Parameters:
mm - The SteeringMenuManager object for menu-generating

setGeometrieObjects

public void setGeometrieObjects(java.util.Hashtable h)
Sets the Hashtable with all geometrie objects

Parameters:
h - Hashtable with all geometrie objects

setActiveObject

public void setActiveObject(Geometrie obj)
Sets the active object

Parameters:
obj - Geometrie object which should be the active object

getRenderer

public SteeringRenderer getRenderer()
Returns the Renderer

Returns:
The used Renderer

getBackgroundImageTile

public Tile getBackgroundImageTile()
Returns the tile object with the background image

Returns:
The tile object

getBackgroundImageGeometrie

public Geometrie getBackgroundImageGeometrie()
Returns the geometrie object with the background image tile

Returns:
The geometrie object

loadBackgroundImage

public void loadBackgroundImage(java.lang.String filename)
Loads a image and sets it as background

Parameters:
filename - The filename of the image to load

resize

public void resize()
Resizes the Canvas and the Renderer to the size specified with the methods setWidth() and setHeight()


paint

public void paint(java.awt.Graphics g)
Paints the canvas

Overrides:
paint in class javax.swing.JComponent
Parameters:
g - The Graphic context

updateDescriptions

public void updateDescriptions(SteeringTree steeringtree)
Generates all descriptions of the objects from the spzified SteeringTree

Parameters:
steeringtree - SteeringTree from which the descriptions should be generated

deselectObjects

public void deselectObjects()
Deselects all objects


selectObject

public void selectObject(Geometrie obj)
Selects a Geometrie object

Parameters:
obj - Geometrie to select