public class DiagramShape extends DiagramComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList |
points |
protected int |
type |
static int |
TYPE_ARROWHEAD |
static int |
TYPE_CUSTOM |
static int |
TYPE_DECISION |
static int |
TYPE_DOCUMENT |
static int |
TYPE_ELLIPSE |
static int |
TYPE_IO |
static int |
TYPE_MANUAL_OPERATION |
static int |
TYPE_POINT_MARKER |
static int |
TYPE_SIMPLE |
static int |
TYPE_STORAGE |
static int |
TYPE_TRAPEZOID |
Constructor and Description |
---|
DiagramShape() |
Modifier and Type | Method and Description |
---|---|
void |
addToPoints(ShapePoint point) |
void |
connectEndsToAnchors(TextGrid grid,
Diagram diagram) |
boolean |
contains(java.awt.geom.Rectangle2D rect) |
boolean |
contains(ShapePoint point) |
static DiagramShape |
createArrowhead(TextGrid grid,
TextGrid.Cell cell,
int cellXSize,
int cellYSize) |
static DiagramShape |
createSmallLine(TextGrid grid,
TextGrid.Cell cell,
int cellXSize,
int cellYSize) |
boolean |
dropsShadow() |
boolean |
equals(java.lang.Object object) |
java.awt.Rectangle |
getBounds() |
ShapePoint |
getCellEdgePointBetween(ShapePoint pointInCell,
ShapePoint otherPoint,
Diagram diagram)
Finds the point that represents the intersection between the cell edge
that contains pointInCell and the line connecting pointInCell and
otherPoint.
|
ShapePoint |
getCellEdgeProjectionPointBetween(ShapePoint pointInCell,
ShapePoint otherPoint,
Diagram diagram)
Returns C, if A is point in cell and B is otherPoint:
Cell
+-----+
| A | B
C *--*--+------------------*
| |
+-----+
|
CustomShapeDefinition |
getDefinition() |
java.util.ArrayList |
getEdges() |
java.awt.Color |
getFillColor() |
ShapePoint |
getPoint(int i) |
java.util.ArrayList |
getPoints() |
java.util.Iterator |
getPointsIterator() |
java.awt.Color |
getStrokeColor() |
int |
getType() |
boolean |
intersects(java.awt.geom.Rectangle2D rect) |
boolean |
isClosed() |
boolean |
isEmpty() |
boolean |
isFilled() |
boolean |
isPointLinesEnd(ShapePoint point) |
boolean |
isRectangle() |
boolean |
isSmallerThan(DiagramShape other)
Crude way to determine which of the two shapes is smaller,
based just on their bounding boxes.
|
boolean |
isStrokeDashed() |
static void |
main(java.lang.String[] args) |
java.awt.geom.GeneralPath |
makeIntoPath() |
java.awt.geom.GeneralPath |
makeIntoRenderPath(Diagram diagram) |
java.awt.geom.GeneralPath |
makeMarkerPath(Diagram diagram) |
void |
moveEndsToCellEdges(TextGrid grid,
Diagram diagram) |
void |
printDebug() |
void |
scale(float factor) |
void |
setClosed(boolean b) |
void |
setDefinition(CustomShapeDefinition definition) |
void |
setFillColor(java.awt.Color color) |
void |
setIsNotFilled() |
void |
setPoint(int i,
ShapePoint point) |
void |
setStrokeColor(java.awt.Color color) |
void |
setStrokeDashed(boolean b) |
void |
setType(int i) |
java.lang.String |
toString() |
createClosedFromBoundaryCells, createClosedFromBoundaryCells, makePointForCell
public static final int TYPE_SIMPLE
public static final int TYPE_ARROWHEAD
public static final int TYPE_POINT_MARKER
public static final int TYPE_DOCUMENT
public static final int TYPE_STORAGE
public static final int TYPE_IO
public static final int TYPE_DECISION
public static final int TYPE_MANUAL_OPERATION
public static final int TYPE_TRAPEZOID
public static final int TYPE_ELLIPSE
public static final int TYPE_CUSTOM
protected int type
protected java.util.ArrayList points
public static void main(java.lang.String[] args)
public static DiagramShape createArrowhead(TextGrid grid, TextGrid.Cell cell, int cellXSize, int cellYSize)
public static DiagramShape createSmallLine(TextGrid grid, TextGrid.Cell cell, int cellXSize, int cellYSize)
public void addToPoints(ShapePoint point)
public java.util.Iterator getPointsIterator()
public void scale(float factor)
public boolean isEmpty()
public boolean isFilled()
public void setIsNotFilled()
public boolean isPointLinesEnd(ShapePoint point)
public boolean isRectangle()
public boolean isSmallerThan(DiagramShape other)
other
- public java.awt.Color getFillColor()
public java.awt.Color getStrokeColor()
public void setFillColor(java.awt.Color color)
color
- public void setStrokeColor(java.awt.Color color)
color
- public boolean isClosed()
public void setClosed(boolean b)
b
- public void printDebug()
public java.util.ArrayList getPoints()
public ShapePoint getPoint(int i)
public void setPoint(int i, ShapePoint point)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public java.awt.geom.GeneralPath makeIntoPath()
public java.awt.geom.GeneralPath makeMarkerPath(Diagram diagram)
public java.awt.Rectangle getBounds()
public java.awt.geom.GeneralPath makeIntoRenderPath(Diagram diagram)
public java.util.ArrayList getEdges()
public ShapePoint getCellEdgePointBetween(ShapePoint pointInCell, ShapePoint otherPoint, Diagram diagram)
Cell +-----+ | A |C B | *--*------------------* | | +-----+
pointInCell
- otherPoint
- public ShapePoint getCellEdgeProjectionPointBetween(ShapePoint pointInCell, ShapePoint otherPoint, Diagram diagram)
Cell +-----+ | A | B C *--*--+------------------* | | +-----+
pointInCell
- otherPoint
- diagram
- public boolean contains(ShapePoint point)
public boolean contains(java.awt.geom.Rectangle2D rect)
public boolean intersects(java.awt.geom.Rectangle2D rect)
public boolean dropsShadow()
public int getType()
public void setType(int i)
i
- public java.lang.String toString()
toString
in class java.lang.Object
public boolean isStrokeDashed()
public void setStrokeDashed(boolean b)
b
- public CustomShapeDefinition getDefinition()
public void setDefinition(CustomShapeDefinition definition)
Copyright © 2020. All Rights Reserved.