|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.swfm.mica.core.MiCanvas
This class provides an absract interface to the wrapper/driver classes that interact with the native system's canvas/panel widget. There are drivers for AWT, AWT 10.02 and Swing.
This class also manages the runtime thread and handles events and modifies the graphics display list. As such it handles the synchronization between the redraw thread(s) and event thread(s) of the native system and this Mica-specific part-modifying thread.
| Field Summary | |
static int |
ANIMATIONS_PER_SECOND
|
static int |
CYCLES_PER_GRAPHICS_UPDATE
|
static java.lang.String |
Mi_ANTI_ALIASING
|
static java.lang.String |
Mi_DOUBLE_BUFFERING
|
| Constructor Summary | |
MiCanvas(MiiCanvas nativeComponent)
Constructs a new MiCanvas. |
|
MiCanvas(MiiCanvas nativeComponent,
MiBounds deviceBounds)
Constructs a new MiCanvas of the given size and location. |
|
| Method Summary | |
void |
boundsHasChanged(java.awt.Rectangle newBounds,
boolean awtThread)
|
java.awt.Image |
createImage(int width,
int height)
|
void |
dispose()
|
void |
forceRedraw()
|
void |
freeAccessLock()
Free one lock that was obtained using getAccessLock. |
int |
freeAccessLocks(java.lang.Thread thread)
Free all of the locks this thread has on this canvas. |
void |
freeze(boolean flag)
|
void |
getAccessLock()
Waits, if necessary, and obtains a lock on this canvas. |
boolean |
getAccessLockIfPossible()
|
void |
getAccessLocks(int numLocksToGet)
Get number of locks. |
MiAnimationManager |
getAnimationManager()
Returns the animation manager for this canvas. |
MiBounds |
getCanvasBounds()
Get the bounds of the canvas in pixels. |
boolean |
getDrawingEnabled()
|
boolean |
getEventDispatchingEnabled()
|
boolean |
getEventHandlingEnabled()
|
java.awt.Graphics |
getGraphics()
|
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of this canvas. |
int |
getMouseAppearance()
Returns the appearance of the mouse cursor in this canvas. |
MiiCanvas |
getNativeComponent()
|
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this canvas. |
MiRenderer |
getRenderer()
Returns the renderer for this canvas. |
static MiBounds |
getScreenBounds()
Get the bounds of the entire screen in pixels. |
MiWindow |
getWindow()
|
boolean |
handleEvent(java.awt.Event evt)
Process the awt.event as per the awt.Component API. |
boolean |
hasBoundsChanged(int x,
int y,
int width,
int height)
|
boolean |
isDoubleBuffered()
Get whether this canvas is double-buffered. |
boolean |
isFrozen()
|
MiPartModifierThread |
makeNewRunningThread()
Makes and returns a new event-processing scene-graph modifying thread. |
void |
notifySelf()
Wakes up any threads waiting on this canvas. |
boolean |
paint(java.awt.Graphics g)
Causes the canvas to be redrawn as per the awt.Component API. |
void |
processCommand(java.lang.String arg)
Processes the given command. |
void |
pushBackEvent(MiEvent event)
|
void |
run()
Runs the event-processing scene-graph modifying thread as part of the awt.Runnable interface. |
void |
setCanvasBounds(MiBounds deviceBounds)
Sets the bounds of the canvas, in pixels. |
void |
setDoubleBuffered(boolean flag)
Set whether this canvas is double-buffered. |
void |
setDrawingEnabled(boolean flag)
|
void |
setEventDispatchingEnabled(boolean flag)
|
void |
setEventHandlingEnabled(boolean flag)
|
void |
setMouseAppearance(int appearance)
Sets the appearance of the mouse cursor within the bounds of this canvas. |
void |
setRenderingHints(java.util.HashMap hints)
Sets default rendering hints. |
void |
setWindow(MiWindow window)
Sets the (root) window associated with this canvas. |
void |
start()
Starts the event-processing scene-graph modifying thread as part of the awt.Runnable interface. |
void |
stop()
Stops the event-processing scene-graph modifying thread as part of the awt.Runnable interface. |
java.lang.String |
toString()
|
void |
update(java.awt.Graphics g)
Causes the canvas to be redrawn as per the awt.Component API. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static java.lang.String Mi_DOUBLE_BUFFERING
public static java.lang.String Mi_ANTI_ALIASING
public static int ANIMATIONS_PER_SECOND
public static int CYCLES_PER_GRAPHICS_UPDATE
| Constructor Detail |
public MiCanvas(MiiCanvas nativeComponent)
public MiCanvas(MiiCanvas nativeComponent,
MiBounds deviceBounds)
deviceBounds - the size of the canvas| Method Detail |
public MiiCanvas getNativeComponent()
public void setEventHandlingEnabled(boolean flag)
public boolean getEventHandlingEnabled()
public void setRenderingHints(java.util.HashMap hints)
hints - a list of keyword/values (for example
a list of java.awt.RenderingHints.Key/Objects)public void setDoubleBuffered(boolean flag)
flag - true if double-bufferedpublic boolean isDoubleBuffered()
public void setEventDispatchingEnabled(boolean flag)
public boolean getEventDispatchingEnabled()
public void setDrawingEnabled(boolean flag)
public boolean getDrawingEnabled()
public void setWindow(MiWindow window)
window - the root windowMiWindowpublic MiWindow getWindow()
public MiAnimationManager getAnimationManager()
MiAnimationManagerpublic MiPartModifierThread makeNewRunningThread()
MiPartModifierThreadpublic void setMouseAppearance(int appearance)
appearance - the cursor appearancepublic int getMouseAppearance()
MiAnimationManagerpublic void setCanvasBounds(MiBounds deviceBounds)
deviceBounds - the bounds of this canvaspublic MiBounds getCanvasBounds()
public static MiBounds getScreenBounds()
public MiRenderer getRenderer()
MiRendererpublic void notifySelf()
public void getAccessLock()
freeAccessLock()public boolean getAccessLockIfPossible()
public void freeAccessLock()
getAccessLock()public void getAccessLocks(int numLocksToGet)
freeAccessLocks(java.lang.Thread)public int freeAccessLocks(java.lang.Thread thread)
getAccessLocks(int)public void freeze(boolean flag)
public boolean isFrozen()
public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public void start()
public void stop()
public void dispose()
public void run()
run in interface java.lang.Runnablepublic boolean handleEvent(java.awt.Event evt)
evt - the awt.Event eventpublic void pushBackEvent(MiEvent event)
public void update(java.awt.Graphics g)
g - the awt.graphics rendererpublic java.awt.Graphics getGraphics()
public java.awt.Image createImage(int width,
int height)
public boolean paint(java.awt.Graphics g)
g - the awt.graphics renderer
public boolean hasBoundsChanged(int x,
int y,
int width,
int height)
public void boundsHasChanged(java.awt.Rectangle newBounds,
boolean awtThread)
public void forceRedraw()
public java.lang.String toString()
public void processCommand(java.lang.String arg)
MiiCommandHandler
processCommand in interface MiiCommandHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||