|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.ui.graphics.AbstractShapeCanvas
abstract class AbstractShapeCanvas
Provides a base class for a canvas for drawing 3D shapes.
Field Summary | |
---|---|
protected Component |
_canvas
The GUI component. |
protected Point |
_canvasCenter
The center of the canvas. |
protected boolean |
_isDrawn
Flag indicating the image is already draw to the buffer. |
Constructor Summary | |
---|---|
AbstractShapeCanvas()
Construct this object. |
Method Summary | |
---|---|
void |
add(IShape shape)
Add the given shape. |
void |
clear()
Clear all the shapes. |
protected void |
computeQuaternion()
Compute a quaternion from the rotations. |
protected abstract Component |
createCanvas()
Create the appropriate canvas. |
IState |
getAbsoluteState()
Return the absolute state. |
protected AnchorShape |
getAnchor()
|
Iterator |
getAnchorShapeGroupIterator()
Return an iterator over the anchor shape group. |
Component |
getComponent()
Return the GUI component. |
double |
getMagnify()
Return the magnification. |
double |
getPerspectiveConstant()
Return the perspective constant. |
IState |
getState()
Return the state. |
IStateful |
getStatefulParent()
Return the parent. |
protected double |
getXRotation()
|
protected double |
getYRotation()
|
protected double |
getZRotation()
|
boolean |
isViewPointLightUsed()
|
protected void |
myPaint(Graphics g)
Paint the shapes. |
protected void |
orientationChanged()
The shapes have moved. |
void |
remove(IShape shape)
Remove the given shape. |
void |
setBackground(Color color)
Set the background color. |
void |
setBounds(int x,
int y,
int w,
int h)
Set the bounds. |
void |
setBounds(Rectangle r)
Set the bounds. |
void |
setMagnify(double magnify)
Set the magnification. |
void |
setPerspectiveConstant(double d)
Set the perspective constant. |
protected void |
setQuaternion(Quaternion q)
Set the current rotation quaternion. |
void |
setStatefulParent(IStateful parent)
Set the parent. |
void |
setViewPointLightUsed(boolean isViewPointLightUsed)
|
void |
setXRotation(double rotation)
Set the rotation around the X axis in radians. |
void |
setYRotation(double rotation)
Set the rotation around the Y axis in radians. |
void |
setZRotation(double rotation)
Set the rotation around the Z axis in radians. |
protected void |
sizeChanged()
The canvas size changed. |
void |
update()
Update the shapes on this canvas. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Component _canvas
protected Point _canvasCenter
protected boolean _isDrawn
Constructor Detail |
---|
public AbstractShapeCanvas()
Method Detail |
---|
public void add(IShape shape)
add
in interface IShapeCanvas
shape
- The shape to add.public void clear()
clear
in interface IShapeCanvas
public IState getAbsoluteState()
getAbsoluteState
in interface IStateful
public Iterator getAnchorShapeGroupIterator()
getAnchorShapeGroupIterator
in interface IShapeCanvas
public Component getComponent()
getComponent
in interface IShapeCanvas
public double getMagnify()
getMagnify
in interface IShapeCanvas
public double getPerspectiveConstant()
getPerspectiveConstant
in interface IShapeCanvas
public IState getState()
getState
in interface IStateful
public IStateful getStatefulParent()
getStatefulParent
in interface IStateful
public boolean isViewPointLightUsed()
isViewPointLightUsed
in interface IShapeCanvas
public void remove(IShape shape)
remove
in interface IShapeCanvas
public void setBackground(Color color)
setBackground
in interface IShapeCanvas
color
- The new color.public void setBounds(Rectangle r)
setBounds
in interface IShapeCanvas
public void setBounds(int x, int y, int w, int h)
setBounds
in interface IShapeCanvas
public void setMagnify(double magnify)
setMagnify
in interface IShapeCanvas
magnify
- The new magnification.public void setPerspectiveConstant(double d)
setPerspectiveConstant
in interface IShapeCanvas
public void setStatefulParent(IStateful parent)
setStatefulParent
in interface IStateful
public void setViewPointLightUsed(boolean isViewPointLightUsed)
setViewPointLightUsed
in interface IShapeCanvas
isViewPointLightUsed
- the isViewPointLightUsed to setpublic void setXRotation(double rotation)
setXRotation
in interface IShapeCanvas
rotation
- The new rotation in radians.public void setYRotation(double rotation)
setYRotation
in interface IShapeCanvas
rotation
- The new rotation in radians.public void setZRotation(double rotation)
setZRotation
in interface IShapeCanvas
rotation
- The new rotation in radians.public void update()
update
in interface IShapeCanvas
protected abstract Component createCanvas()
protected void computeQuaternion()
protected AnchorShape getAnchor()
protected double getXRotation()
protected double getYRotation()
protected double getZRotation()
protected void myPaint(Graphics g)
protected void orientationChanged()
protected void setQuaternion(Quaternion q)
q
- Quaternion.protected void sizeChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |