|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.xith.java3d.overlay.OverlayBase
Copyright: Copyright (c) 2000,2001 Company: Teseract Software, LLP
Field Summary | |
static int |
ACTIVE_BUFFER
|
protected int |
activeBuffer
|
protected int |
backgroundMode
|
protected java.awt.image.BufferedImage |
canvas
|
protected javax.media.j3d.BranchGroup |
consoleBranchGroup
|
protected javax.media.j3d.TransformGroup |
consoleTransformGroup
|
static int |
POSITION
|
protected int[] |
relativePosition
|
protected com.xith.java3d.overlay.SubOverlay[] |
subOverlay
|
static int |
VISIBLE
|
Fields inherited from interface com.xith.java3d.overlay.Overlay |
BACKGROUND_COPY, BACKGROUND_NONE, PLACE_BOTTOM, PLACE_CENTER, PLACE_LEFT, PLACE_RIGHT, PLACE_TOP, X_PLACEMENT, Y_PLACEMENT |
Constructor Summary | |
OverlayBase(javax.media.j3d.Canvas3D canvas3D,
java.awt.Rectangle bounds)
Creates a new overlay covering the given canvas bounds. |
|
OverlayBase(javax.media.j3d.Canvas3D canvas3D,
java.awt.Rectangle bounds,
boolean clipAlpha,
boolean blendAlpha)
|
|
OverlayBase(javax.media.j3d.Canvas3D canvas3D,
java.awt.Rectangle bounds,
boolean clipAlpha,
boolean blendAlpha,
UpdateManager updateManager)
|
|
OverlayBase(javax.media.j3d.Canvas3D canvas3D,
java.awt.Rectangle bounds,
boolean clipAlpha,
boolean blendAlpha,
UpdateManager updateManager,
int numBuffers)
Constructs an overlay window. |
|
OverlayBase(javax.media.j3d.Canvas3D canvas3D,
java.awt.Rectangle bounds,
UpdateManager manager)
|
Method Summary | |
void |
addMouseListener(java.awt.event.MouseListener listener)
|
void |
dirty(int property)
|
java.awt.image.BufferedImage |
getBackgroundImage()
Returns the background for the overlay. |
java.awt.Rectangle |
getBounds()
Returns the rectangular portion of the canvas that this overlay covers. |
javax.media.j3d.Canvas3D |
getCanvas()
Returns the canvas being drawn on. |
protected java.awt.Graphics2D |
getGraphics()
Prepares the canvas to be painted. |
javax.media.j3d.PolygonAttributes |
getPolygonAttributes()
Return the polygon attributes shared by all the sub-overlays |
javax.media.j3d.RenderingAttributes |
getRenderingAttributes()
Return the rendering attributes shared by all sub-overlays |
javax.media.j3d.BranchGroup |
getRoot()
Return the root of the overlay and its sub-overlays so it can be added to the scene graph |
javax.media.j3d.TextureAttributes |
getTextureAttributes()
Return the texture attributes shared by all the sub-overlays |
javax.media.j3d.TransparencyAttributes |
getTransparencyAttributes()
Return the transparency attributes |
UpdateManager |
getUpdateManager()
Returns the UpdateManager responsible for seeing that updates to the Overlay only take place between frames. |
boolean |
hasAlphaComponent()
Returns if the Overlay may be semi-transparent |
protected void |
initialize()
|
boolean |
isAntialiased()
Returns whether drawing on this overlay is anti-aliased |
boolean |
isVisible()
Returns the visiblity of the Overlay. |
void |
paint(java.awt.Graphics2D g)
This is where the actualy drawing of the window takes place. |
void |
removeMouseListener(java.awt.event.MouseListener listener)
|
void |
repaint()
This is called to trigger a repaint of the overlay. |
protected void |
setActiveBuffer(int activeBuffer)
|
void |
setAntialiased(boolean antialiased)
Sets whether drawing onto this Overlay is anialiased. |
void |
setBackgroundColor(java.awt.Color color)
Sets the background to a solid color. |
void |
setBackgroundImage(java.awt.image.BufferedImage backgroundImage)
Sets the background image to the one specified. |
void |
setBackgroundMode(int mode)
Sets the background mode. |
void |
setOffset(java.awt.Dimension offset)
Sets the relative offset of the overlay. |
void |
setOffset(int width,
int height)
Sets the relative offset of the overlay. |
void |
setRelativePosition(int[] relativePositon)
Sets the relative position of the overlay on the screen using a 2 dimensional array. |
void |
setRelativePosition(int xType,
int yType)
Sets the relative position of the overlay on the screen. |
void |
setUpdateManager(UpdateManager updateManager)
Sets the UpdateManager |
void |
setVisible(boolean visible)
Changes the visibility of the overlay. |
void |
update()
Any changes that will affect the screen appearance should be made in here. |
protected void |
updateBuffer(java.awt.image.BufferedImage image,
int bufferIndex)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int backgroundMode
protected int[] relativePosition
protected java.awt.image.BufferedImage canvas
protected com.xith.java3d.overlay.SubOverlay[] subOverlay
protected int activeBuffer
protected javax.media.j3d.BranchGroup consoleBranchGroup
protected javax.media.j3d.TransformGroup consoleTransformGroup
public static final int VISIBLE
public static final int POSITION
public static final int ACTIVE_BUFFER
Constructor Detail |
public OverlayBase(javax.media.j3d.Canvas3D canvas3D, java.awt.Rectangle bounds)
canvas3D
- Canvas being drawn ontobounds
- Bounds on the canvas covered by the overlaypublic OverlayBase(javax.media.j3d.Canvas3D canvas3D, java.awt.Rectangle bounds, UpdateManager manager)
public OverlayBase(javax.media.j3d.Canvas3D canvas3D, java.awt.Rectangle bounds, boolean clipAlpha, boolean blendAlpha)
public OverlayBase(javax.media.j3d.Canvas3D canvas3D, java.awt.Rectangle bounds, boolean clipAlpha, boolean blendAlpha, UpdateManager updateManager)
public OverlayBase(javax.media.j3d.Canvas3D canvas3D, java.awt.Rectangle bounds, boolean clipAlpha, boolean blendAlpha, UpdateManager updateManager, int numBuffers)
canvas3D
- The canvas the overlay is drawn onbounds
- The part of the canvas covered by the overlayclipAlpha
- Should the polygon clip where alpha is zeroblendAlpha
- Should we blend to background where alpha is < 1updateManager
- Responsible for allowing the Overlay to update
between renders. If this is null a default
manager is created.numBuffers
- The number of buffers to generate, the default
is two.Method Detail |
protected void initialize()
public java.awt.Rectangle getBounds()
Overlay
getBounds
in interface Overlay
public UpdateManager getUpdateManager()
Overlay
getUpdateManager
in interface Overlay
public void setUpdateManager(UpdateManager updateManager)
Overlay
setUpdateManager
in interface Overlay
public void setOffset(java.awt.Dimension offset)
setOffset
in interface Overlay
public void setOffset(int width, int height)
setOffset
in interface Overlay
public void setRelativePosition(int[] relativePositon)
setRelativePosition
in interface Overlay
relativePosition[X_PLACEMENT]
- May be PLACE_LEFT, PLACE_RIGHT, or PLACE_CENTERrelativePosition[Y_PLACEMENT]
- May be PLACE_TOP, PLACE_BOTTOM, or PLACE_CENTERpublic void setRelativePosition(int xType, int yType)
setRelativePosition
in interface Overlay
xType
- May be PLACE_LEFT, PLACE_RIGHT, or PLACE_CENTERyType
- May be PLACE_TOP, PLACE_BOTTOM, or PLACE_CENTERpublic javax.media.j3d.BranchGroup getRoot()
getRoot
in interface Overlay
public boolean hasAlphaComponent()
public void setAntialiased(boolean antialiased)
setAntialiased
in interface Overlay
public boolean isAntialiased()
Overlay
isAntialiased
in interface Overlay
public javax.media.j3d.Canvas3D getCanvas()
getCanvas
in interface Overlay
public javax.media.j3d.RenderingAttributes getRenderingAttributes()
public javax.media.j3d.PolygonAttributes getPolygonAttributes()
public javax.media.j3d.TextureAttributes getTextureAttributes()
public javax.media.j3d.TransparencyAttributes getTransparencyAttributes()
protected java.awt.Graphics2D getGraphics()
public void repaint()
protected void updateBuffer(java.awt.image.BufferedImage image, int bufferIndex)
public void setVisible(boolean visible)
setVisible
in interface Overlay
public boolean isVisible()
Overlay
isVisible
in interface Overlay
public void paint(java.awt.Graphics2D g)
protected void setActiveBuffer(int activeBuffer)
public void setBackgroundColor(java.awt.Color color)
public java.awt.image.BufferedImage getBackgroundImage()
public void setBackgroundImage(java.awt.image.BufferedImage backgroundImage)
public void setBackgroundMode(int mode)
public void addMouseListener(java.awt.event.MouseListener listener)
public void removeMouseListener(java.awt.event.MouseListener listener)
public void dirty(int property)
public void update()
Overlay
update
in interface Overlay
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |