|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wilmascope.patterns.Prototype
org.wilmascope.view.GraphElementView
public abstract class GraphElementView
GraphElementView defines the methods and interfaces required for Edge and
Node views that implement this to be registered as prototypes in the
ViewManager
Field Summary | |
---|---|
protected javax.media.j3d.Transform3D |
t3d
|
Constructor Summary | |
---|---|
GraphElementView()
|
Method Summary | |
---|---|
protected void |
addLabel(java.lang.String text,
double scale,
javax.vecmath.Point3f originPosition,
javax.vecmath.Vector3f vTranslation,
javax.media.j3d.Appearance apText)
add a label to the element |
protected void |
addLiveBranch(javax.media.j3d.BranchGroup b)
|
void |
addPickingClient(PickingClient client)
Register a PickingClient whose PickingClient.callback(java.awt.event.MouseEvent) method will
be called when the element is clicked |
protected void |
addShape(javax.media.j3d.Shape3D shape)
Add a visible Shape3D to this Graph Element. |
void |
addTransformGroupChild(javax.media.j3d.Node node)
add a scene graph node to this graph element's transform group |
void |
defaultColour()
|
void |
delete()
Make it go away, for the last time! |
javax.media.j3d.Appearance |
getAppearance()
|
static javax.vecmath.AxisAngle4f |
getAxisAngle4f(javax.vecmath.Vector3f init,
javax.vecmath.Vector3f target)
|
javax.media.j3d.BranchGroup |
getBranchGroup()
|
javax.vecmath.Color3f |
getColor3f()
|
java.awt.Color |
getColour()
|
java.awt.Color |
getDefaultColour()
|
GraphCanvas |
getGraphCanvas()
|
abstract javax.swing.ImageIcon |
getIcon()
|
java.lang.String |
getLabel()
|
java.util.Properties |
getProperties()
|
javax.media.j3d.TransformGroup |
getTransformGroup()
|
java.lang.Object |
getUserData()
|
void |
hide()
|
void |
highlightColour()
|
protected abstract void |
init()
you must over-ride the following method to create the 3D Shapes which will represent your graph elements |
void |
initGraphElement()
|
boolean |
isDefaultColour()
|
void |
makePickable(javax.media.j3d.Shape3D shape)
Make a given shape a pick target for this GraphElement |
boolean |
picked(java.awt.event.MouseEvent e)
|
void |
removeLabel()
|
void |
removePickingClient(PickingClient client)
|
void |
setColour(java.awt.Color colour)
|
void |
setColour(javax.vecmath.Color3f diffuse)
|
void |
setColour(float red,
float green,
float blue)
|
protected void |
setFullTransform(javax.vecmath.Vector3d scale,
javax.vecmath.Vector3f translation,
javax.vecmath.AxisAngle4f rotation)
set up for a full transform with scale, translation and rotation components |
protected void |
setFullTransform(javax.vecmath.Vector3d scale,
javax.vecmath.Vector3f translation,
javax.vecmath.Quat4f orientation)
set up for a full transform with scale, translation and rotation components |
void |
setLabel(java.lang.String text)
|
void |
setLabel(java.lang.String[] labelLines)
sets a multiline label... |
protected void |
setLabel(javax.media.j3d.TransformGroup label)
|
void |
setPickable(boolean pickable)
|
void |
setProperties(java.util.Properties p)
|
protected void |
setResizeTranslateTransform(javax.vecmath.Vector3d scale,
javax.vecmath.Vector3f translation)
set up for a transform with scale and translation components |
protected void |
setTransformGroupTransform(javax.media.j3d.Transform3D transform)
set the transform for this graph element's transform group |
protected void |
setTranslation(javax.vecmath.Vector3f v)
set up for a translation transform |
void |
setTransparencyAttributes(javax.media.j3d.TransparencyAttributes ta)
|
protected void |
setupDefaultAppearance(javax.media.j3d.Material defaultMaterial)
|
protected abstract void |
setupDefaultMaterial()
Sets the default material for graph elements You must over-ride this abstract method stub with: setupDefaultAppearance(myDefaultMaterial); |
protected void |
setupHighlightAppearance(javax.media.j3d.Material highlightMaterial)
|
protected abstract void |
setupHighlightMaterial()
You must over-ride this method with: setupHighlightAppearance(myHighLightedMaterial) |
void |
setUserData(java.lang.Object data)
|
void |
show(GraphCanvas graphCanvas)
|
protected abstract void |
showLabel(java.lang.String text)
|
void |
transform(javax.vecmath.Vector3f v)
|
Methods inherited from class org.wilmascope.patterns.Prototype |
---|
clone, getTypeName, setTypeName |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.wilmascope.graph.Viewable |
---|
draw |
Field Detail |
---|
protected javax.media.j3d.Transform3D t3d
Constructor Detail |
---|
public GraphElementView()
Method Detail |
---|
public void initGraphElement()
public void setTransparencyAttributes(javax.media.j3d.TransparencyAttributes ta)
protected abstract void setupDefaultMaterial()
protected abstract void setupHighlightMaterial()
protected abstract void init()
public void delete()
delete
in interface Viewable
public void addTransformGroupChild(javax.media.j3d.Node node)
protected void setTransformGroupTransform(javax.media.j3d.Transform3D transform)
public javax.media.j3d.TransformGroup getTransformGroup()
protected void setTranslation(javax.vecmath.Vector3f v)
protected void setResizeTranslateTransform(javax.vecmath.Vector3d scale, javax.vecmath.Vector3f translation)
protected void setFullTransform(javax.vecmath.Vector3d scale, javax.vecmath.Vector3f translation, javax.vecmath.AxisAngle4f rotation)
protected void setFullTransform(javax.vecmath.Vector3d scale, javax.vecmath.Vector3f translation, javax.vecmath.Quat4f orientation)
public void transform(javax.vecmath.Vector3f v)
public boolean picked(java.awt.event.MouseEvent e)
protected void setupDefaultAppearance(javax.media.j3d.Material defaultMaterial)
protected void setupHighlightAppearance(javax.media.j3d.Material highlightMaterial)
public javax.media.j3d.Appearance getAppearance()
public void setColour(float red, float green, float blue)
public void setColour(javax.vecmath.Color3f diffuse)
public void setColour(java.awt.Color colour)
public javax.vecmath.Color3f getColor3f()
public java.awt.Color getColour()
public java.awt.Color getDefaultColour()
public boolean isDefaultColour()
public void defaultColour()
public void highlightColour()
public void setLabel(java.lang.String text)
public void setLabel(java.lang.String[] labelLines)
public java.lang.String getLabel()
protected void addLabel(java.lang.String text, double scale, javax.vecmath.Point3f originPosition, javax.vecmath.Vector3f vTranslation, javax.media.j3d.Appearance apText)
String
- the text of the labelscale
- factor to resize the textPoint3f
- origin position of the centre of the label relative to the axis
of the edgeVector3f
- Translation vector to position the label origin relative to
centre of the edgeAppearance
- for the labelpublic void removeLabel()
protected void setLabel(javax.media.j3d.TransformGroup label)
protected void addShape(javax.media.j3d.Shape3D shape)
public void makePickable(javax.media.j3d.Shape3D shape)
public void hide()
hide
in interface Viewable
public GraphCanvas getGraphCanvas()
public void show(GraphCanvas graphCanvas)
show
in interface Viewable
public void addPickingClient(PickingClient client)
PickingClient.callback(java.awt.event.MouseEvent)
method will
be called when the element is clicked
public void removePickingClient(PickingClient client)
public javax.media.j3d.BranchGroup getBranchGroup()
public abstract javax.swing.ImageIcon getIcon()
public void setPickable(boolean pickable)
setPickable
in interface Viewable
public void setUserData(java.lang.Object data)
public java.lang.Object getUserData()
protected void addLiveBranch(javax.media.j3d.BranchGroup b)
public java.util.Properties getProperties()
public void setProperties(java.util.Properties p)
public static javax.vecmath.AxisAngle4f getAxisAngle4f(javax.vecmath.Vector3f init, javax.vecmath.Vector3f target)
init
- target
-
protected abstract void showLabel(java.lang.String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |