|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.imp.awt.ViewComponentAdapter
public abstract class ViewComponentAdapter
Field Summary | |
---|---|
protected static int |
DISPOSED
Bit mask for renderFlags indicating that this
view is disposed. |
protected static int |
DISPOSING
Bit mask for renderFlags indicating that this
view is currently disposing. |
protected static int |
RENDERED_IMAGE
|
protected static int |
RENDERING
Bit mask for renderFlags indicating that this
view is currently rendering. |
protected static int |
REPAINT_MASK
|
Fields inherited from interface de.grogra.imp.ViewComponent |
---|
ALL, CHANGED, MIN_USER_FLAG, SCENE, SELECTION, TOOLS |
Constructor Summary | |
---|---|
ViewComponentAdapter()
|
Method Summary | |
---|---|
void |
checkRepaint()
|
void |
checkRepaintWrapException()
|
void |
dispose()
|
void |
disposeRenderer(Renderer r)
|
static java.awt.Color |
getColor(int argb,
java.awt.Color old)
|
static java.awt.Color |
getColor(Tuple3f c,
java.awt.Color old)
|
Item |
getFactory()
Returns the factory item which has been set by ViewComponent.initFactory(Item) , i.e., the item which
created this component. |
java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
|
int |
getGlobalLOD()
Determines the global level-of-detail which should currently be used in this view component. |
static int |
getIntColor(Tuple3f c)
|
java.lang.InterruptedException |
getInterruptedException()
|
protected abstract java.awt.image.ImageObserver |
getObserverForRenderer()
Returns an observer which receives the information about the rendered image from a Renderer . |
java.lang.Object |
getOption(java.lang.String name,
java.lang.Object defaultValue)
|
GraphState |
getRenderGraphState()
|
View |
getView()
|
void |
initFactory(Item factory)
Sets the factory item which created this view component. |
protected abstract void |
initRender(int flags)
Performs initialization tasks in preparation for rendering. |
void |
initView(View view,
EventListener listener)
Initializes this component. |
protected void |
installListeners(java.awt.Component canvas)
|
protected abstract void |
invokeRender(int flags)
Invoked to perform rendering. |
protected void |
invokeRenderSync(int flags)
Invokes render(int) , ensuring that
Workbench.current() returns the correct workbench. |
protected void |
optionValueChanged(java.lang.String name,
java.lang.Object object)
|
protected abstract void |
render(int flags)
Performs rendering. |
void |
render(Renderer r)
Initiates a rendering of the graph using the specified renderer. |
void |
render(Renderer r,
int width,
int height)
|
protected void |
renderUninterruptibly()
|
void |
repaint(int flags)
Initiates a repaint of those parts of the view which are indicated by the flags , interpreted as a
combination of bit masks. |
void |
run()
Controls rendering and the global level of detail in an own thread. |
Selection |
toSelection(Context ctx)
Converts this object into a Selection . |
protected void |
uninstallListeners(java.awt.Component canvas)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.grogra.imp.ViewComponent |
---|
makeSnapshot |
Methods inherited from interface de.grogra.pf.ui.ComponentWrapper |
---|
getComponent |
Field Detail |
---|
protected static final int DISPOSED
renderFlags
indicating that this
view is disposed.
protected static final int DISPOSING
renderFlags
indicating that this
view is currently disposing.
protected static final int RENDERED_IMAGE
protected static final int RENDERING
renderFlags
indicating that this
view is currently rendering.
protected static final int REPAINT_MASK
Constructor Detail |
---|
public ViewComponentAdapter()
Method Detail |
---|
public void checkRepaint() throws java.lang.InterruptedException
java.lang.InterruptedException
public void checkRepaintWrapException()
public void dispose()
dispose
in interface Disposable
public void disposeRenderer(Renderer r)
disposeRenderer
in interface ViewComponent
public static java.awt.Color getColor(int argb, java.awt.Color old)
public static java.awt.Color getColor(Tuple3f c, java.awt.Color old)
public Item getFactory()
ViewComponent
ViewComponent.initFactory(Item)
, i.e., the item which
created this component.
getFactory
in interface ViewComponent
public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
public int getGlobalLOD()
ViewComponent
View.LOD_MIN
and View.LOD_MAX
inclusively.
getGlobalLOD
in interface ViewComponent
public static int getIntColor(Tuple3f c)
public java.lang.InterruptedException getInterruptedException()
protected abstract java.awt.image.ImageObserver getObserverForRenderer()
Renderer
. The returned observer
has to manage the drawing of the (partially) rendered image
on the view component.
null
if
this is not supported by this componentpublic java.lang.Object getOption(java.lang.String name, java.lang.Object defaultValue)
public GraphState getRenderGraphState()
public View getView()
public void initFactory(Item factory)
ViewComponent
initFactory
in interface ViewComponent
factory
- factory itemprotected abstract void initRender(int flags)
run()
in this
ViewComponent
's own thread.
flags
- combination of bit maskspublic void initView(View view, EventListener listener)
ViewComponent
view
within which this view component is used to display the graph.
It also sets an event listener. this has to be informed of
mouse and keys events within the view component by implementations
of this method.
initView
in interface ViewComponent
view
- the containing viewlistener
- mouse and key events will be reported to this listenerprotected void installListeners(java.awt.Component canvas)
protected abstract void invokeRender(int flags)
run()
in this ViewComponent
's own thread.
Its sole task is to invoke invokeRenderSync(int)
in
the rendering thread (which may be this
ViewComponent
's thread, the AWT-thread, or another
thread, depending on the implementation) in a write-protected
context. The invocation has to be
synchronously, i.e., if it is in another thread, the current thread
has to wait until invokeRenderSync(int)
has completed.
flags
- the flags to pass to invokeRenderSync(int)
protected void invokeRenderSync(int flags)
render(int)
, ensuring that
Workbench.current()
returns the correct workbench.
If render(int)
throws an InterruptedException
,
a repaint is posted. The write-lock of this view's graph has to be
acquired by the invoker (see Lockable
).
flags
- the flags to pass to render(int)
protected void optionValueChanged(java.lang.String name, java.lang.Object object)
protected abstract void render(int flags) throws java.lang.InterruptedException
invokeRenderSync(int)
in a context where
Workbench.current()
returns the workbench of this
view.
flags
- combination of bit masks
java.lang.InterruptedException
- if the rendering has been interruptedpublic void render(Renderer r)
ViewComponent
render
in interface ViewComponent
public void render(Renderer r, int width, int height)
render
in interface ViewComponent
protected void renderUninterruptibly()
public void repaint(int flags)
ViewComponent
flags
, interpreted as a
combination of bit masks. This method may be invoked from
arbitrary threads.
repaint
in interface ViewComponent
flags
- the parts to be repaintedpublic final void run()
run
in interface java.lang.Runnable
public Selection toSelection(Context ctx)
Selectable
Selection
.
toSelection
in interface Selectable
ctx
- the UI context
null
if this is not possibleprotected void uninstallListeners(java.awt.Component canvas)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |