gishur.gui2
Class DrawManager
java.lang.Object
|
+--gishur.gui2.DrawAtom
|
+--gishur.gui2.DrawManager
- Direct Known Subclasses:
- LayerManager, SimpleDrawManager
- public abstract class DrawManager
- extends DrawAtom
Root object in the drawing hierachy of DrawAtom
s. This
is just an abstract basis class - subclasses need to implement
methods to manage the drawing hierachy. This class has methods
to manage the repainting together with a DisplayManager
that represents the drawing surface.
- Version:
- 2.0
- Author:
- Thomas Wolf
Methods inherited from class gishur.gui2.DrawAtom |
addProperties, collectHits, getBounds, getLocalProperty, getProperty, getProperty, getRequiredProperty, locate, prepeareRenderContext, preprocessEvent, properties, removeProperty, sendEvent, sendMessage, setBounds, setPropertiesTo, setProperty, setProperty, setProperty, setProperty, toString, toString, toStringDetail, toTreeString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DrawManager
public DrawManager()
- Constructor.
drawComponent
public java.awt.Component drawComponent()
- Returns the component where all DrawAtoms draw on.
- Overrides:
drawComponent
in class DrawAtom
- Returns:
- Component where all DrawAtoms draw onto.
displayManager
protected DisplayManager displayManager()
- Returns the
DisplayManager
that manages the redrawing.
- Overrides:
displayManager
in class DrawAtom
- Returns:
DisplayManager
.
processMessage
protected java.lang.Object processMessage(java.lang.String id_string,
java.lang.Object argument)
- Processes a given message. This method will be called via
DrawAtom.sendMessage(java.lang.String, java.lang.Object)
.
If the returned value is not null
, the message will be consumed and
no longer send up the drawing hierachy.
- Overrides:
processMessage
in class DrawAtom
- Parameters:
id_string
- the id Stringargument
- the message argument- Returns:
- if
!=null
, the object will be sent back as response
recalculate
protected void recalculate(RenderContext context)
- Forces the
DrawAtom
to recalculate its representation.
This method will only be called, if it became dirty via a call
to the #makeDirty
method or something has happened, that
causes all DrawAtoms
to recalculate their
representation.
This method should only be called by the render system.
- Overrides:
recalculate
in class DrawAtom
- Parameters:
context
- the RenderContext
to use
draw
protected void draw(java.awt.Graphics g,
RenderContext context)
- Draws
this
DrawAtom
to the given
Graphics
g
.
This method should only be called by the render system.
- Overrides:
draw
in class DrawAtom
- Parameters:
g
- Graphics for drawingcontext
- the RenderContext
to use- Throws:
DrawException
- if invalid call to this method
dispatchEvent
protected void dispatchEvent(java.awt.AWTEvent e)
- Dispatches the given event
e
.
DrawAtoms deliver their events simply to their parent DrawAtoms
- Overrides:
dispatchEvent
in class DrawAtom
- Parameters:
e
- event to dispatch