ubc.cs.JLog.Animation
Class aAnimationEnvironment

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by ubc.cs.JLog.Animation.aAnimationEnvironment
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class aAnimationEnvironment
extends java.awt.Panel

This represents a graphical environment containing any number of named aAnimationObjects. These objects are drawn in this graphical environment.

Author:
Glendon Holst
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  iJLogApplBaseServices base
           
protected  FloatRectangle cached_active_bounds_rect
           
protected  float magnification
           
protected  java.util.Hashtable named_objects
           
protected  java.util.Vector objects
           
protected  java.awt.Image offscreen_buffer
           
 
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
aAnimationEnvironment(iJLogApplBaseServices b)
           
 
Method Summary
 void addObject(aAnimationObject ao)
          Add an aAnimationObject.
 java.util.Enumeration enumObjects()
          Enumerate all aAnimationObjects belonging to the environment.
 java.awt.Image getImage(java.lang.String name)
           
 float getMagnification()
           
 aAnimationObject getObject(java.lang.String name)
          Find an aAnimationObject by name.
 java.awt.Dimension getPreferredSize()
           
 void init()
           
 void paint(java.awt.Graphics g)
          Draws the entire environment, including all aAnimationObjects.
 void removeObject(aAnimationObject ao)
          Remove an aAnimationObject.
 void setMagnification(float m)
          Sets the maginfication of the environment.
 void update()
           
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

base

protected iJLogApplBaseServices base

objects

protected java.util.Vector objects

named_objects

protected java.util.Hashtable named_objects

offscreen_buffer

protected java.awt.Image offscreen_buffer

magnification

protected float magnification

cached_active_bounds_rect

protected FloatRectangle cached_active_bounds_rect
Constructor Detail

aAnimationEnvironment

public aAnimationEnvironment(iJLogApplBaseServices b)
Method Detail

init

public void init()

setMagnification

public void setMagnification(float m)
Sets the maginfication of the environment. The aAnimationObjects use the value of this attribute to determine their appearance. Changing the magnification sends update notification to the objects of the environment, which update their display coordinates accordingly. Note: Not all Animation objects may scale as expected (e.g., font size and display).

Parameters:
m - The magnification level (1.0 is 100% - no magnification, 2.0 is 200%, 0.5 is 50%).

getMagnification

public final float getMagnification()

paint

public void paint(java.awt.Graphics g)
Draws the entire environment, including all aAnimationObjects. Drawing is done in the order of the animation object's level (smaller levels are drawn first, larger levels are drawn later).

Overrides:
paint in class java.awt.Container
Parameters:
g - The Graphics environment for Panels' paint function.

enumObjects

public java.util.Enumeration enumObjects()
Enumerate all aAnimationObjects belonging to the environment.

Returns:
An Enumeration ofaAnimationObjects.

getObject

public aAnimationObject getObject(java.lang.String name)
Find an aAnimationObject by name.

Parameters:
name - The string name for an object in the environment.
Returns:
An aAnimationObject matching the given name.

addObject

public void addObject(aAnimationObject ao)
Add an aAnimationObject. The object must already be created with this environment being its environment.

Parameters:
ao - The aAnimationObject to add.

removeObject

public void removeObject(aAnimationObject ao)
Remove an aAnimationObject.

Parameters:
ao - The aAnimationObject to remove.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Container

getImage

public java.awt.Image getImage(java.lang.String name)

update

public void update()

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Container