|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--manifold.base.Glyph
|
+--flatscape.FGlyph
This is a Glyph (view) corresponding to a model Element. It subscribes to the model and listens to the important state changes. It also implements MutableTreeNode and is a node in the scenegraph of a view.
Copyright (c) 2001 Rutgers, The State University of New Jersey
| Field Summary | |
protected int |
curInteractionPoint
|
static double[] |
DEFAULT
|
protected java.util.Vector |
interactionPoints
|
protected double |
POINTSIZE
|
protected boolean |
selected_
selection status |
| Fields inherited from class manifold.base.Glyph |
model_, TRANSFORM, viewer_, visible_ |
| Constructor Summary | |
FGlyph()
|
|
| Method Summary | |
void |
addInteractionPoint(java.awt.geom.Point2D p,
int type)
Adds an interaction Point |
java.util.Enumeration |
children()
Returns the children of this Glyph. |
java.lang.Object |
config(java.lang.Object parent,
org.w3c.dom.Element config)
Implementation of Configurable. |
static FGlyph |
constructGlyph(org.w3c.dom.Element model)
Static method to create new glyphs. |
void |
draw(Traversal t)
FGlyphs can not be drawed - Does nothing. |
protected void |
drawSelectionBox(java.awt.Graphics2D g)
Draws the bounding box when a glyph is seleceted. |
boolean |
getAllowsChildren()
|
protected java.awt.Shape |
getBoundingShape()
Gets the bounding shape of the glyph. |
javax.swing.tree.TreeNode |
getChildAt(int childIndex)
|
int |
getChildCount()
|
int |
getIndex(javax.swing.tree.TreeNode node)
|
java.awt.geom.Point2D |
getInteractionPoint()
|
Limits |
getLimits()
|
javax.swing.tree.TreeNode |
getParent()
|
java.awt.geom.AffineTransform |
getTransform()
Gets the transform property of the model UForm and returns it as a Transform2D |
java.awt.geom.AffineTransform |
getTransform(double[] projectionPlane)
Gets the transform property of the model Element according to a projectionPlane and returns it as a Transform2D |
void |
insert(javax.swing.tree.MutableTreeNode child,
int index)
Removes child from its present parent (if it has a
parent), sets the child's parent to this node, and then adds the child
to this node's child array at index index.
|
boolean |
isLeaf()
|
java.lang.Object |
moveInteractionPoint(java.awt.geom.Point2D newPos)
moves the interaction point to the new position referenced in argument newPos
By default, it modifies the width and height of the bounding rectangle accordingly |
void |
pick(Traversal t)
Default pick method, which uses getBoundingShape to determine if a glyph has been picked. |
protected boolean |
pickInteractionPoint(java.awt.geom.Point2D p)
Tests if the user has picked any of the glyph's interaction points |
void |
propertyChange(org.w3c.dom.Element model,
java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Method called by a UForm which had a change of a property. |
void |
remove(int index)
Removes the child at the specified index from this node's children and sets that node's parent to null. |
void |
remove(javax.swing.tree.MutableTreeNode child)
Removes child from this node's child array, giving it a
null parent. |
void |
removeFromParent()
Removes the subtree rooted at this node from the tree, giving this node a null parent. |
void |
setInteractionPoint(int p)
Sets the current interaction point picked by the user |
void |
setModel(org.w3c.dom.Element model)
Sets the model and updates the properties. |
void |
setParent(javax.swing.tree.MutableTreeNode parent)
Sets this node's parent to parent but does not
change the parent's child array. |
void |
setSelected(boolean selected)
Selects or unselects this glyph, depending on the value of selected |
void |
setUserObject(java.lang.Object object)
Resets the user object of the receiver to object. |
java.lang.String |
toString()
|
void |
traverse(Traversal t)
Support for traversal of the scenegraph. |
protected void |
updateInteractionPoints()
Updates the interaction points. |
protected void |
updateProperties()
Updates the local copies of the properties from the model. |
static java.lang.String[] |
validTypes()
Returns the valid data types corresponding with glyphs. |
| Methods inherited from class manifold.base.Glyph |
getModel, getViewer, isVisible, setViewer, setVisible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final double[] DEFAULT
protected boolean selected_
protected java.util.Vector interactionPoints
protected final double POINTSIZE
protected int curInteractionPoint
| Constructor Detail |
public FGlyph()
| Method Detail |
public static FGlyph constructGlyph(org.w3c.dom.Element model)
public static java.lang.String[] validTypes()
public void setModel(org.w3c.dom.Element model)
setModel in class Glyphmodel - the modelpublic java.awt.geom.AffineTransform getTransform()
Transform2D
DEFAULTpublic java.awt.geom.AffineTransform getTransform(double[] projectionPlane)
Transform2D
DEFAULTprotected java.awt.Shape getBoundingShape()
pick(Traversal t) method
of FGlyph is to be used
public void traverse(Traversal t)
traverse in class Glypht - keeps the state of the traversalprotected boolean pickInteractionPoint(java.awt.geom.Point2D p)
public void pick(Traversal t)
getBoundingShape to determine if a glyph has been picked.
pick in class Glypht - keeps the state of the traversalpublic void draw(Traversal t)
draw in class Glypht - keeps the state of the traversalprotected void drawSelectionBox(java.awt.Graphics2D g)
public java.lang.String toString()
toString in class java.lang.Object
public java.lang.Object config(java.lang.Object parent,
org.w3c.dom.Element config)
throws java.lang.Exception
config in interface Configurableparent - The argument passed into the FConfig.getList methodconfig - The DOM element representing the XML element that
loaded this class.
java.lang.Exception - Thrown if there is any problem configuring this class.public java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt in interface javax.swing.tree.TreeNodepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic javax.swing.tree.TreeNode getParent()
getParent in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNode
public void insert(javax.swing.tree.MutableTreeNode child,
int index)
child from its present parent (if it has a
parent), sets the child's parent to this node, and then adds the child
to this node's child array at index index.
child must not be null.
insert in interface javax.swing.tree.MutableTreeNodechild - the MutableTreeNode to insert under this nodeindex - the index in this node's child array where this node is to be inserted
java.lang.IllegalArgumentException - if child is not instance of FGlyphpublic void remove(int index)
MutableTreeNode.
remove in interface javax.swing.tree.MutableTreeNodeindex - the index in this node's child array of the child to remove
java.lang.ArrayIndexOutOfBoundsException - if index is out of boundspublic void remove(javax.swing.tree.MutableTreeNode child)
child from this node's child array, giving it a
null parent.
remove in interface javax.swing.tree.MutableTreeNodechild - a child of this node to remove
java.lang.IllegalArgumentException - if child is null or is not a child of this nodepublic void removeFromParent()
removeFromParent in interface javax.swing.tree.MutableTreeNodepublic void setParent(javax.swing.tree.MutableTreeNode parent)
parent but does not
change the parent's child array. This method is called from
insert() and remove() to
reassign a child's parent, it should not be messaged from anywhere
else.
setParent in interface javax.swing.tree.MutableTreeNodeparent - this node's new parentpublic void setUserObject(java.lang.Object object)
setUserObject in interface javax.swing.tree.MutableTreeNode
public void propertyChange(org.w3c.dom.Element model,
java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
name - the name of the propertyoldValue - the old value of the propertynewValue - the new value of the propertypublic void setSelected(boolean selected)
selected
selected - - If true, selects this glyph; otherwise, unselects this glyph.public Limits getLimits()
protected void updateProperties()
protected void updateInteractionPoints()
public void addInteractionPoint(java.awt.geom.Point2D p,
int type)
public void setInteractionPoint(int p)
public java.awt.geom.Point2D getInteractionPoint()
public java.lang.Object moveInteractionPoint(java.awt.geom.Point2D newPos)
newPos
By default, it modifies the width and height of the bounding rectangle accordingly
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||