|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.TriMesh
com.jme.scene.shape.Quad
com.jmex.awt.swingui.JMEDesktop
public class JMEDesktop
A quad that displays a JDesktopPane
as texture. It also converts jME mouse and keyboard events to Swing
events. The latter does work for ortho mode only. There are some issues with using multiple of this desktops.
Notes
SwingUtilities.invokeLater(java.lang.Runnable)
and Swing tutorial for details.
ImageGraphics
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.scene.TriMesh |
---|
TriMesh.Mode |
Nested classes/interfaces inherited from class com.jme.scene.Spatial |
---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
Field Summary |
---|
Fields inherited from class com.jme.scene.TriMesh |
---|
indexBuffer, mode, triangleQuantity |
Fields inherited from class com.jme.scene.Geometry |
---|
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity |
Fields inherited from class com.jme.scene.Spatial |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
Constructor Summary | |
---|---|
JMEDesktop(java.lang.String name)
Create a quad with a Swing-Texture. |
|
JMEDesktop(java.lang.String name,
int width,
int height,
boolean mipMapping,
InputHandler inputHandlerParent)
Create a quad with a Swing-Texture. |
|
JMEDesktop(java.lang.String name,
int width,
int height,
InputHandler inputHandlerParent)
Create a quad with a Swing-Texture. |
Method Summary | |
---|---|
java.awt.Component |
componentAt(int x,
int y)
Find a component at specified desktop position. |
void |
convert(int x,
int y,
Vector2f store)
Convert mouse coordinates from jME screen to JMEDesktop coordinates (Swing). |
void |
dispose()
Call this method of the desktop is no longer needed. |
void |
draw(Renderer r)
draw calls super to set the render state then passes
itself to the renderer. |
com.jmex.awt.swingui.JMEDesktop.ButtonAction |
getButtonUpdateAction(int swingButtonIndex)
|
JMEDragAndDrop |
getDragAndDropSupport()
|
java.awt.Component |
getFocusOwner()
|
InputHandler |
getInputHandler()
Allows to disable input for the whole desktop and to add custom input actions. |
javax.swing.JDesktopPane |
getJDesktop()
|
InputAction |
getKeyUpdateAction()
|
java.awt.Component |
getModalComponent()
|
com.jmex.awt.swingui.JMEDesktop.WheelUpdateAction |
getWheelUpdateAction()
|
com.jmex.awt.swingui.JMEDesktop.XUpdateAction |
getXUpdateAction()
|
com.jmex.awt.swingui.JMEDesktop.YUpdateAction |
getYUpdateAction()
|
boolean |
isShowingJFrame()
|
boolean |
isSynchronizingThreadsOnUpdate()
|
void |
onButton(int swingButton,
boolean pressed,
int x,
int y)
|
void |
onKey(char character,
int keyCode,
boolean pressed)
|
void |
onMove(int xDelta,
int yDelta,
int newX,
int newY)
|
void |
onWheel(int wheelDelta,
int x,
int y)
|
void |
resize(float width,
float height)
Deprecated. |
void |
setDragAndDropSupport(JMEDragAndDrop dragAndDropSupport)
|
void |
setFocusOwner(java.awt.Component comp)
|
void |
setModalComponent(java.awt.Component value)
Filter the swing event to allow events to the specified component and its children only. |
protected void |
setParent(Node parent)
Called by Node.attachChild(Spatial) and
Node.detachChild(Spatial) - don't call directly. |
void |
setShowingJFrame(boolean showingJFrame)
Deprecated. for debuggin only |
void |
setSynchronizingThreadsOnUpdate(boolean synchronizingThreadsOnUpdate)
Choose if update and swing thread should be synchronized (avoids flickering, eats some performance) |
void |
setup(int width,
int height,
boolean mipMapping,
InputHandler inputHandlerParent)
Set up the desktop quad - may be called only once. |
protected void |
setupDefaultInputBindings()
|
Methods inherited from class com.jme.scene.shape.Quad |
---|
getCenter, getHeight, getWidth, initialize, updateGeometry |
Methods inherited from class com.jme.scene.TriMesh |
---|
clearBuffers, findCollisions, findTriangleCollision, findTrianglePick, getIndexBuffer, getMaxIndex, getMeshAsTriangles, getMeshAsTrianglesVertices, getMode, getTriangle, getTriangle, getTriangleCount, getTriangleIndices, getVertIndex, hasCollision, hasTriangleCollision, randomPointOnTriangles, read, recalcTriangleQuantity, reconstruct, setIndexBuffer, setMode, setTriangleQuantity, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jme.util.export.Savable |
---|
getClassTag |
Constructor Detail |
---|
public JMEDesktop(java.lang.String name)
setup(int, int, boolean, InputHandler)
to finish setup.
name
- name of this desktoppublic JMEDesktop(java.lang.String name, int width, int height, InputHandler inputHandlerParent)
name
- name of the spatialwidth
- desktop widthheight
- desktop heightinputHandlerParent
- InputHandler where the InputHandler of this desktop should be added as subhandler,
may be null to provide custom input handling or later adding of InputHandler(s)getInputHandler()
public JMEDesktop(java.lang.String name, int width, int height, boolean mipMapping, InputHandler inputHandlerParent)
name
- name of the spatialwidth
- desktop widthheight
- desktop hieghtmipMapping
- true to compute mipmaps for the desktop (not recommended), false for creating
a single image textureinputHandlerParent
- InputHandler where the InputHandler of this desktop should be added as subhandler,
may be null to provide custom input handling or later adding of InputHandler(s)getInputHandler()
Method Detail |
---|
public JMEDragAndDrop getDragAndDropSupport()
public void setDragAndDropSupport(JMEDragAndDrop dragAndDropSupport)
dragAndDropSupport
- JMEDragAndDrop to be used for this desktopJMEDragAndDrop.setDesktop(JMEDesktop)
public boolean isShowingJFrame()
setShowingJFrame(boolean)
public void setShowingJFrame(boolean showingJFrame)
showingJFrame
- true to display the desktop in a JFrame instead on this quad.public InputHandler getInputHandler()
getXUpdateAction()
,
getYUpdateAction()
,
getWheelUpdateAction()
,
getButtonUpdateAction(int)
,
getKeyUpdateAction()
public void setup(int width, int height, boolean mipMapping, InputHandler inputHandlerParent)
width
- desktop widthheight
- desktop hieghtmipMapping
- true to compute mipmaps for the desktop (not recommended), false for creating
a single image textureinputHandlerParent
- InputHandler where the InputHandler of this desktop should be added as subhandler,
may be null to provide custom input handling or later adding of InputHandler(s)getInputHandler()
protected void setupDefaultInputBindings()
public void onKey(char character, int keyCode, boolean pressed)
public void onButton(int swingButton, boolean pressed, int x, int y)
public void onWheel(int wheelDelta, int x, int y)
public void onMove(int xDelta, int yDelta, int newX, int newY)
public boolean isSynchronizingThreadsOnUpdate()
public void setSynchronizingThreadsOnUpdate(boolean synchronizingThreadsOnUpdate)
synchronizingThreadsOnUpdate
- true to synchronizepublic com.jmex.awt.swingui.JMEDesktop.XUpdateAction getXUpdateAction()
public com.jmex.awt.swingui.JMEDesktop.YUpdateAction getYUpdateAction()
public com.jmex.awt.swingui.JMEDesktop.WheelUpdateAction getWheelUpdateAction()
public com.jmex.awt.swingui.JMEDesktop.ButtonAction getButtonUpdateAction(int swingButtonIndex)
swingButtonIndex
- button index sent in generated swing event, InputHandler.BUTTON_ALL for using
trigger index + 1
public InputAction getKeyUpdateAction()
public void setFocusOwner(java.awt.Component comp)
public void convert(int x, int y, Vector2f store)
x
- jME x coordinatey
- jME y coordinatestore
- resulting JDesktop coordinatespublic java.awt.Component componentAt(int x, int y)
x
- x coordinate in Swing coordinate spacey
- y coordinate in Swing coordinate space
public void draw(Renderer r)
TriMesh
draw
calls super to set the render state then passes
itself to the renderer. LOGIC: 1. If we're not RenderQueue calling draw
goto 2, if we are, goto 3 2. If we are supposed to use queue, add to
queue and RETURN, else 3 3. call super draw 4. tell renderer to draw me.
draw
in class TriMesh
r
- the renderer to displaySpatial.draw(com.jme.renderer.Renderer)
public javax.swing.JDesktopPane getJDesktop()
public java.awt.Component getFocusOwner()
public java.awt.Component getModalComponent()
setModalComponent(java.awt.Component)
public void setModalComponent(java.awt.Component value)
value
- component that can be exclusively accessed (including children)protected void setParent(Node parent)
Spatial
Node.attachChild(Spatial)
and
Node.detachChild(Spatial)
- don't call directly.
setParent
sets the parent of this node.
setParent
in class Spatial
parent
- the parent of this node.public void dispose()
@Deprecated public void resize(float width, float height)
resize
in class Quad
width
- -height
- -
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |