|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.gui2.DrawAtom | +--gishur.gui2.InputLayer
An InputLayer is a special layer which accepts only InputHandler
as members. An InputLayer delivers all events dispatched at the drawing surface
(the component, it must be an DisplayManager
, where the parent
DrawManager
paints all objects on) to its members if they implement the
corresponding Listener interface.
Fields inherited from class gishur.gui2.DrawAtom |
BLOCK_REPAINT, MARK_RECALC, MARK_REPAINT, MARK_SIZE, REPAINT, UNBLOCK_REPAINT, USER_STATES_FIRST, USER_STATES_MASK |
Constructor Summary | |
InputLayer()
Default constructor. |
Method Summary | |
void |
add(InputHandler drw)
Adds the InputHandler drw at the end of the layer. |
void |
add(InputHandler drw,
boolean enable)
Adds the InputHandler drw at the end of the layer. |
void |
clear()
Removes all member DrawObject s from this layer. |
void |
disable()
Disables this InputLayer. |
protected void |
draw(java.awt.Graphics g,
RenderContext context)
Draws this DrawAtom to the given
Graphics g .
|
void |
enable()
Enables this InputLayer. |
boolean |
enabled()
Returns true , if the InputLayer is enabled,
otherwise false . |
boolean |
eventProcessThread()
Returns true , if the InputLayer uses an extra
event thread for event processing. |
InputHandler |
first()
Returns the first element of the input layer. |
void |
hide()
Hides the Layer ( ). |
void |
insert(InputHandler p,
InputHandler drw)
Inserts the InputHandler drw in the layer
before p . |
void |
insert(InputHandler p,
InputHandler drw,
boolean enable)
Inserts the InputHandler drw in the layer
before p . |
InputHandler |
last()
Returns the last element of the input layer. |
protected void |
preprocessEvent(int id,
DrawAtom sender)
Preprocesses the event specified via its id sent by the given source. |
protected void |
recalculate(RenderContext context)
Forces the DrawAtom to recalculate its representation.
|
void |
remove(InputHandler drw)
Removes the given InputHandler from this layer. |
void |
setEventProcessThread(boolean thread)
Enables the InputLayer to use an extra event thread. |
void |
setEventThreadPriority(int priority)
Sets the priority of the thread that processes incoming events throughout the layer. |
void |
setScreenTransformation(ScreenTransformation transform)
Sets the screen transformation for this Layer. |
void |
show()
Shows the Layer ( ). |
boolean |
visible()
Returns true, if the Layer is visible. |
Methods inherited from class gishur.gui2.DrawAtom |
addProperties, collectHits, dispatchEvent, displayManager, drawComponent, getBounds, getLocalProperty, getProperty, getProperty, getRequiredProperty, locate, prepeareRenderContext, processMessage, 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 |
Constructor Detail |
public InputLayer()
Method Detail |
public final void setScreenTransformation(ScreenTransformation transform)
ScreenTransformation
correctly, use this method instead of DrawAtom.setProperty(java.lang.String, java.lang.Object)
.transform
- the new ScreenTransformation
public boolean eventProcessThread()
true
, if the InputLayer
uses an extra
event thread for event processing.true
, if the InputLayer
uses an extra
event thread for event processing.public void setEventProcessThread(boolean thread)
InputLayer
to use an extra event thread.thread
- if true
, use extra event threadpublic void setEventThreadPriority(int priority)
Thread.MIN_PRIORITY
to Thread.MAX_PRIORITY
.priority
- the new priority for the event processing threadpublic InputHandler first()
public InputHandler last()
public void add(InputHandler drw)
InputHandler
drw
at the end of the layer.drw
- InputHandler to addpublic void insert(InputHandler p, InputHandler drw)
InputHandler
drw
in the layer
before p
.p
- group member to insert before or null
to add
at the end of the layerdrw
- InputHandler to insertpublic void add(InputHandler drw, boolean enable)
InputHandler
drw
at the end of the layer.drw
- InputHandler to addenable
- if true
, the element will be enabled
via InputHandler.enable()
else it will be disabled via
InputHandler.disable()
public void insert(InputHandler p, InputHandler drw, boolean enable)
InputHandler
drw
in the layer
before p
.p
- layer member to insert before or null
to add
at the end of the layerdrw
- InputHandler to insertenable
- if true
, the element will be enabled
via InputHandler.enable()
else it will be disabled via
InputHandler.disable()
public void remove(InputHandler drw)
InputHandler
from this layer. If the specified
InputHandler
has members, all members were removed first. Insertion
of the InputHandler
inserts only the InputHandler
-
without its members.drw
- InputHandler
to removepublic void clear()
DrawObject
s from this
layer.public boolean visible()
Layer
is visible.public void hide()
Layer
(visible()
()==false
).public void show()
Layer
(visible()
()==true
).public final boolean enabled()
true
, if the InputLayer is enabled,
otherwise false
.true
, if the InputLayer is enabled,
otherwise false
.public final void enable()
this
InputLayer. Only if the InputLayer
is enabled, it can post events to its members.public final void disable()
this
InputLayer. So it no longer posts
AWTEvents
to its members.protected void preprocessEvent(int id, DrawAtom sender)
DrawAtom
itself
and by DrawAtom
where this
depends from. The method
will be called before events are filtered out.preprocessEvent
in class DrawAtom
id
- the event idsender
- the source of the eventDrawEvent
protected void recalculate(RenderContext context)
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.recalculate
in class DrawAtom
context
- the RenderContext
to useprotected void draw(java.awt.Graphics g, RenderContext context)
this
DrawAtom
to the given
Graphics
g
.
This method should only be called by the render system.draw
in class DrawAtom
g
- Graphics for drawingcontext
- the RenderContext
to useDrawException
- if invalid call to this method
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |