public class DiagramShape extends DiagramComponent
Modifier and Type | Field and Description |
---|---|
protected 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(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(Object object) |
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() |
ArrayList |
getEdges() |
Color |
getFillColor() |
ShapePoint |
getPoint(int i) |
ArrayList |
getPoints() |
Iterator |
getPointsIterator() |
Color |
getStrokeColor() |
int |
getType() |
boolean |
intersects(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(String[] args) |
GeneralPath |
makeIntoPath() |
GeneralPath |
makeIntoRenderPath(Diagram diagram) |
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(Color color) |
void |
setIsNotFilled() |
void |
setPoint(int i,
ShapePoint point) |
void |
setStrokeColor(Color color) |
void |
setStrokeDashed(boolean b) |
void |
setType(int i) |
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 ArrayList points
public static void main(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 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 Color getFillColor()
public Color getStrokeColor()
public void setFillColor(Color color)
color
- public void setStrokeColor(Color color)
color
- public boolean isClosed()
public void setClosed(boolean b)
b
- public void printDebug()
public ArrayList getPoints()
public ShapePoint getPoint(int i)
public void setPoint(int i, ShapePoint point)
public GeneralPath makeIntoPath()
public GeneralPath makeMarkerPath(Diagram diagram)
public Rectangle getBounds()
public GeneralPath makeIntoRenderPath(Diagram diagram)
public 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(Rectangle2D rect)
public boolean intersects(Rectangle2D rect)
public boolean dropsShadow()
public int getType()
public void setType(int i)
i
- public boolean isStrokeDashed()
public void setStrokeDashed(boolean b)
b
- public CustomShapeDefinition getDefinition()
public void setDefinition(CustomShapeDefinition definition)
Copyright © 2017. All Rights Reserved.