flatscape.glyph
Class Line

java.lang.Object
  |
  +--manifold.base.Glyph
        |
        +--flatscape.FGlyph
              |
              +--flatscape.glyph.GeometricFigure
                    |
                    +--flatscape.glyph.Line
All Implemented Interfaces:
java.lang.Cloneable, Configurable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
Arrow

public class Line
extends GeometricFigure

Glyph to render lines.

Copyright (c) 2001 Rutgers, The State University of New Jersey

Since:
flatscape %Version%
Version:
%Version%, %Time%

Field Summary
protected  double x1_
          Copy of x1 property.
protected  double x2_
          Copy of x2 property.
protected  double y1_
          Copy of y1 property.
protected  double y2_
          Copy of y2 property.
 
Fields inherited from class flatscape.glyph.GeometricFigure
fillColor_, height_, lineColor_, lineWidth_, width_
 
Fields inherited from class flatscape.FGlyph
curInteractionPoint, DEFAULT, interactionPoints, POINTSIZE, selected_
 
Fields inherited from class manifold.base.Glyph
model_, TRANSFORM, viewer_, visible_
 
Constructor Summary
Line()
           
 
Method Summary
 void draw(Traversal t)
          FGlyphs can not be drawed - Does nothing.
protected  java.awt.Shape getBoundingShape()
          Gets the bounding shape of the glyph.
protected  java.awt.Shape getShape()
           
 java.lang.Object moveInteractionPoint(java.awt.geom.Point2D newPos)
          Redefines the moveInteractionPOint method to match the values of (x1,y1) or(x2,y2)
 void pick(Traversal t)
          Default pick method, which uses getBoundingShape to determine if a glyph has been picked.
protected  void updateInteractionPoints()
          Defines the interaction points as the endpoints of the line
protected  void updateProperties()
          Updates the local copies of the properties from the model.
 
Methods inherited from class flatscape.glyph.GeometricFigure
getLimits, getShape, propertyChange
 
Methods inherited from class flatscape.FGlyph
addInteractionPoint, children, config, constructGlyph, drawSelectionBox, getAllowsChildren, getChildAt, getChildCount, getIndex, getInteractionPoint, getParent, getTransform, getTransform, insert, isLeaf, pickInteractionPoint, remove, remove, removeFromParent, setInteractionPoint, setModel, setParent, setSelected, setUserObject, toString, traverse, validTypes
 
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

x1_

protected double x1_
Copy of x1 property.


y1_

protected double y1_
Copy of y1 property.


x2_

protected double x2_
Copy of x2 property.


y2_

protected double y2_
Copy of y2 property.

Constructor Detail

Line

public Line()
Method Detail

draw

public void draw(Traversal t)
Description copied from class: FGlyph
FGlyphs can not be drawed - Does nothing.

Overrides:
draw in class GeometricFigure
Parameters:
t - keeps the state of the traversal

pick

public void pick(Traversal t)
Description copied from class: FGlyph
Default pick method, which uses getBoundingShape to determine if a glyph has been picked.

Overrides:
pick in class FGlyph
Parameters:
t - keeps the state of the traversal

getShape

protected java.awt.Shape getShape()
Specified by:
getShape in class GeometricFigure
Returns:
an Line2D shape.

getBoundingShape

protected java.awt.Shape getBoundingShape()
Description copied from class: FGlyph
Gets the bounding shape of the glyph. Must be overridden by sub-classes if the pick(Traversal t) method of FGlyph is to be used

Overrides:
getBoundingShape in class GeometricFigure
Returns:
getShape()

updateProperties

protected void updateProperties()
Updates the local copies of the properties from the model.

Overrides:
updateProperties in class GeometricFigure

updateInteractionPoints

protected void updateInteractionPoints()
Defines the interaction points as the endpoints of the line

Overrides:
updateInteractionPoints in class FGlyph

moveInteractionPoint

public java.lang.Object moveInteractionPoint(java.awt.geom.Point2D newPos)
Redefines the moveInteractionPOint method to match the values of (x1,y1) or(x2,y2)

Overrides:
moveInteractionPoint in class FGlyph


Copyright (c) 2003 Rutgers, The State University of New Jersey