Class DiagramShape
java.lang.Object
org.stathissideris.ascii2image.graphics.DiagramComponent
org.stathissideris.ascii2image.graphics.DiagramShape
-
Field Summary
Modifier and TypeFieldDescriptionprotected ArrayList
protected int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
boolean
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.getCellEdgeProjectionPointBetween
(ShapePoint pointInCell, ShapePoint otherPoint, Diagram diagram) Returns C, if A is point in cell and B is otherPoint:getEdges()
getPoint
(int i) int
getType()
boolean
intersects
(Rectangle2D rect) boolean
isClosed()
boolean
isEmpty()
boolean
isFilled()
boolean
isPointLinesEnd
(ShapePoint point) boolean
boolean
isSmallerThan
(DiagramShape other) Crude way to determine which of the two shapes is smaller, based just on their bounding boxes.boolean
static void
makeIntoRenderPath
(Diagram diagram) makeMarkerPath
(Diagram diagram) void
moveEndsToCellEdges
(TextGrid grid, Diagram diagram) void
void
scale
(float factor) void
setClosed
(boolean b) void
setDefinition
(CustomShapeDefinition definition) void
setFillColor
(Color color) void
void
setPoint
(int i, ShapePoint point) void
setStrokeColor
(Color color) void
setStrokeDashed
(boolean b) void
setType
(int i) toString()
Methods inherited from class org.stathissideris.ascii2image.graphics.DiagramComponent
createClosedFromBoundaryCells, createClosedFromBoundaryCells, makePointForCell
-
Field Details
-
TYPE_SIMPLE
public static final int TYPE_SIMPLE- See Also:
-
TYPE_ARROWHEAD
public static final int TYPE_ARROWHEAD- See Also:
-
TYPE_POINT_MARKER
public static final int TYPE_POINT_MARKER- See Also:
-
TYPE_DOCUMENT
public static final int TYPE_DOCUMENT- See Also:
-
TYPE_STORAGE
public static final int TYPE_STORAGE- See Also:
-
TYPE_IO
public static final int TYPE_IO- See Also:
-
TYPE_DECISION
public static final int TYPE_DECISION- See Also:
-
TYPE_MANUAL_OPERATION
public static final int TYPE_MANUAL_OPERATION- See Also:
-
TYPE_TRAPEZOID
public static final int TYPE_TRAPEZOID- See Also:
-
TYPE_ELLIPSE
public static final int TYPE_ELLIPSE- See Also:
-
TYPE_CUSTOM
public static final int TYPE_CUSTOM- See Also:
-
type
protected int type -
points
-
-
Constructor Details
-
DiagramShape
public DiagramShape()
-
-
Method Details
-
main
-
createArrowhead
public static DiagramShape createArrowhead(TextGrid grid, TextGrid.Cell cell, int cellXSize, int cellYSize) -
createSmallLine
public static DiagramShape createSmallLine(TextGrid grid, TextGrid.Cell cell, int cellXSize, int cellYSize) -
addToPoints
-
getPointsIterator
-
scale
public void scale(float factor) -
isEmpty
public boolean isEmpty() -
isFilled
public boolean isFilled() -
setIsNotFilled
public void setIsNotFilled() -
isPointLinesEnd
-
isRectangle
public boolean isRectangle() -
isSmallerThan
Crude way to determine which of the two shapes is smaller, based just on their bounding boxes. Used in markup assignment precendence.- Parameters:
other
-- Returns:
-
getFillColor
- Returns:
-
getStrokeColor
- Returns:
-
setFillColor
- Parameters:
color
-
-
setStrokeColor
- Parameters:
color
-
-
isClosed
public boolean isClosed()- Returns:
-
setClosed
public void setClosed(boolean b) - Parameters:
b
-
-
printDebug
public void printDebug() -
getPoints
- Returns:
-
getPoint
-
setPoint
-
equals
-
makeIntoPath
-
makeMarkerPath
-
getBounds
-
makeIntoRenderPath
-
getEdges
-
getCellEdgePointBetween
public 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. Returns C, if A is point in cell and B is otherPoint:Cell +-----+ | A |C B | *--*------------------* | | +-----+
- Parameters:
pointInCell
-otherPoint
-diagram
-- Returns:
-
getCellEdgeProjectionPointBetween
public ShapePoint getCellEdgeProjectionPointBetween(ShapePoint pointInCell, ShapePoint otherPoint, Diagram diagram) Returns C, if A is point in cell and B is otherPoint:Cell +-----+ | A | B C *--*--+------------------* | | +-----+
- Parameters:
pointInCell
-otherPoint
-diagram
-- Returns:
-
contains
-
contains
-
intersects
-
dropsShadow
public boolean dropsShadow() -
getType
public int getType()- Returns:
-
setType
public void setType(int i) - Parameters:
i
-
-
moveEndsToCellEdges
-
connectEndsToAnchors
-
toString
-
isStrokeDashed
public boolean isStrokeDashed()- Returns:
-
setStrokeDashed
public void setStrokeDashed(boolean b) - Parameters:
b
-
-
getDefinition
-
setDefinition
-