|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.widget.WidgetAbstractImpl
com.jme.widget.image.WidgetImage
ImageWidget
ImageWidget is a widget that draws a 2d image.
The image may be scaled by four methods:
SCALE_MODE_NONE - The image will not be scaled.
SCALE_MODE_SIZE_TO_FIT - The image will be scaled to fill the size of the widget. Alignment is unused.
SCALE_MODE_ABSOLUTE - The image is scaled vertically and horizontally by a percentage of the original size of the image.
SCALE_MODE_RELATIVE - The image is scaled vertically and horizontally by a percentage of the size of the widget.
KNOWN ISSUES:
Drawing isn't clipped to the widget bounds.
Alignment code doesn't work properly.| Field Summary | |
static int |
SCALE_MODE_ABSOLUTE
|
static int |
SCALE_MODE_NONE
|
static int |
SCALE_MODE_RELATIVE
|
static int |
SCALE_MODE_SIZE_TO_FIT
|
| Fields inherited from class com.jme.widget.WidgetAbstractImpl |
alignment, bgColor, border, cantOwnMouse, DEFAULT_BORDER_SIZE, DEFAULT_COMP_HEIGHT, DEFAULT_COMP_WIDTH, defaultBgColor, defaultFgColor, fgColor, localBound, notifierMouseButtonDown, notifierMouseButtonUp, notifierMouseDrag, notifierMouseEnter, notifierMouseExit, notifierMouseMove, opaque, preferredSize, textureCoords, viewRectangle, visible, zOrder |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation |
| Constructor Summary | |
WidgetImage()
|
|
WidgetImage(Image image)
|
|
WidgetImage(Image image,
WidgetAlignmentType alignment,
int scaleMode)
|
|
| Method Summary | |
protected void |
alignCenter(Vector2f size,
WidgetInsets insets)
|
protected void |
alignEast(Vector2f size,
WidgetInsets insets)
|
protected void |
alignNorth(Vector2f size,
WidgetInsets insets)
|
protected void |
alignSouth(Vector2f size,
WidgetInsets insets)
|
protected void |
alignWest(Vector2f size,
WidgetInsets insets)
|
void |
doMouseButtonDown()
doMouseButtonDown |
void |
doMouseButtonUp()
doMouseButtonUp |
void |
draw(Renderer r)
draw abstract method that handles drawing data to the
renderer if it is geometry and passing the call to it's children if it is
a node. |
void |
drawBounds(Renderer r)
drawBounds abstract method that handles drawing bounds
data to the renderer if it is geometry and passing the call to it's
children if it is a node. |
void |
findCollisions(Spatial scene,
CollisionResults results)
checks this spatial against a second spatial, any collisions are stored in the results object. |
void |
findPick(Ray toTest,
PickResults results)
|
float |
getHorizontalScale()
|
Image |
getImage()
|
Vector2f |
getPreferredSize()
getPreferredSize |
int |
getScaleMode()
|
float |
getVerticalScale()
|
boolean |
hasCollision(Spatial scene,
boolean checkTriangles)
|
void |
initWidgetRenderer()
initWidgetRenderer |
void |
onDraw(Renderer r)
onDraw checks the node with the camera to see if it should
be culled, if not, the node's draw method is called. |
void |
setForceView(boolean value)
setForceView will force the node to be rendered whether
it's in the camera frustum or not. |
void |
setHorizontalScale(float f)
|
void |
setImage(Image image)
|
void |
setLocation(int x,
int y)
setLocation |
void |
setLocation(Vector2f at)
setLocation |
void |
setPreferredSize(Vector2f size)
setPreferredSize |
void |
setScaleMode(int mode)
|
void |
setSize(int width,
int height)
setSize |
void |
setSize(Vector2f size)
setSize |
void |
setVerticalScale(float f)
|
void |
setX(int x)
setX |
void |
setY(int y)
setY |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SCALE_MODE_NONE
public static final int SCALE_MODE_SIZE_TO_FIT
public static final int SCALE_MODE_ABSOLUTE
public static final int SCALE_MODE_RELATIVE
| Constructor Detail |
public WidgetImage()
public WidgetImage(Image image)
public WidgetImage(Image image,
WidgetAlignmentType alignment,
int scaleMode)
| Method Detail |
public Image getImage()
public void setImage(Image image)
public void onDraw(Renderer r)
SpatialonDraw checks the node with the camera to see if it should
be culled, if not, the node's draw method is called.
onDraw in class WidgetAbstractImplSpatial.onDraw(com.jme.renderer.Renderer)public void draw(Renderer r)
Spatialdraw abstract method that handles drawing data to the
renderer if it is geometry and passing the call to it's children if it is
a node.
draw in class WidgetAbstractImplSpatial.draw(com.jme.renderer.Renderer)public void drawBounds(Renderer r)
SpatialdrawBounds abstract method that handles drawing bounds
data to the renderer if it is geometry and passing the call to it's
children if it is a node.
drawBounds in class Spatialr - the renderer used for display.public float getHorizontalScale()
public void setHorizontalScale(float f)
public float getVerticalScale()
public void setVerticalScale(float f)
public int getScaleMode()
public void setScaleMode(int mode)
public Vector2f getPreferredSize()
WidgetgetPreferredSize
getPreferredSize in interface WidgetgetPreferredSize in class WidgetAbstractImplpublic void doMouseButtonDown()
WidgetMouseHandlerInterfacedoMouseButtonDown
doMouseButtonDown in interface WidgetMouseHandlerInterfacedoMouseButtonDown in class WidgetAbstractImplpublic void doMouseButtonUp()
WidgetMouseHandlerInterfacedoMouseButtonUp
doMouseButtonUp in interface WidgetMouseHandlerInterfacedoMouseButtonUp in class WidgetAbstractImplpublic void setSize(Vector2f size)
WidgetsetSize
setSize in interface WidgetsetSize in class WidgetAbstractImpl
public void setSize(int width,
int height)
WidgetsetSize
setSize in interface WidgetsetSize in class WidgetAbstractImplpublic void setForceView(boolean value)
SpatialsetForceView will force the node to be rendered whether
it's in the camera frustum or not.
setForceView in class Spatialvalue - true to force viewing, false otherwise.public void setPreferredSize(Vector2f size)
WidgetsetPreferredSize
setPreferredSize in interface WidgetsetPreferredSize in class WidgetAbstractImpl
protected void alignCenter(Vector2f size,
WidgetInsets insets)
alignCenter in class WidgetAbstractImpl
protected void alignWest(Vector2f size,
WidgetInsets insets)
alignWest in class WidgetAbstractImpl
protected void alignEast(Vector2f size,
WidgetInsets insets)
alignEast in class WidgetAbstractImpl
protected void alignNorth(Vector2f size,
WidgetInsets insets)
alignNorth in class WidgetAbstractImpl
protected void alignSouth(Vector2f size,
WidgetInsets insets)
alignSouth in class WidgetAbstractImpl
public void setLocation(int x,
int y)
WidgetsetLocation
setLocation in interface WidgetsetLocation in class WidgetAbstractImplpublic void setLocation(Vector2f at)
WidgetsetLocation
setLocation in interface WidgetsetLocation in class WidgetAbstractImplpublic void setX(int x)
WidgetsetX
setX in interface WidgetsetX in class WidgetAbstractImplpublic void setY(int y)
WidgetsetY
setY in interface WidgetsetY in class WidgetAbstractImplpublic void initWidgetRenderer()
WidgetinitWidgetRenderer
public void findCollisions(Spatial scene,
CollisionResults results)
Spatial
findCollisions in class Spatialscene - the scene to test against.results - the results of the collisions.
public boolean hasCollision(Spatial scene,
boolean checkTriangles)
hasCollision in class Spatial
public void findPick(Ray toTest,
PickResults results)
findPick in class Spatial
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||