public class Poly extends PolyBase
Modifier and Type | Class and Description |
---|---|
static class |
Poly.Builder
This class builds shapes of nodes and arcs in lambda units as Poly arrays.
|
static class |
Poly.Type
Type is a typesafe enum class that describes the nature of a Poly.
|
PolyBase.PolyBaseTree
Modifier and Type | Field and Description |
---|---|
static Poly[] |
NULL_ARRAY |
Constructor and Description |
---|
Poly(double cX,
double cY,
double width,
double height)
The constructor creates a new Poly that describes a rectangle.
|
Poly(java.awt.geom.Point2D[] points)
The constructor creates a new Poly given an array of points.
|
Poly(java.awt.geom.Rectangle2D rect)
The constructor creates a new Poly that describes a rectangle.
|
Modifier and Type | Method and Description |
---|---|
DisplayedText |
getDisplayedText()
Method to return the DisplayedText associated with this Poly.
|
static double |
getExtendFactor(double width,
int extend)
Method to return the amount that an arc end should extend, given its width and extension factor.
|
EGraphics |
getGraphicsOverride()
Method to return the EGraphics which overrides default EGraphics
for Poly's Layer.
|
java.lang.String |
getString()
Method to return the String associated with this Poly.
|
TextDescriptor |
getTextDescriptor()
Method to return the Text Descriptor associated with this Poly.
|
static Poly |
makeEndPointPoly(double len,
double wid,
int angle,
java.awt.geom.Point2D endH,
double extendH,
java.awt.geom.Point2D endT,
double extendT,
Poly.Type style)
Method to construct a Poly for an arc with a given length, width, angle, endpoint, and extension.
|
static Poly.Builder |
newGridBuilder()
Returns new instance of Poly builder to build shapes in grid units.
|
static Poly.Builder |
newLambdaBuilder()
Returns new instance of Poly builder to build shapes in lambda units.
|
void |
setDisplayedText(DisplayedText dt)
Method to set the DisplayedText associated with this Poly.
|
boolean |
setExactTextBounds(EditWindow0 wnd,
ElectricObject eObj)
Method to convert text Polys to their precise bounds in a given window.
|
void |
setGraphicsOverride(EGraphics graphics)
Method to set the EGraphics which overrides default EGraphics
for Poly's Layer.
|
void |
setString(java.lang.String string)
Method to set the String associated with this Poly.
|
void |
setTextDescriptor(TextDescriptor descript)
Method to set the Text Descriptor associated with this Poly.
|
static Poly.Builder |
threadLocalLambdaBuilder()
Returns thread local instance of Poly builder to build shapes in lambda units.
|
void |
transform(java.awt.geom.AffineTransform af)
Method to transformed the points in this Poly.
|
clipArc, closestPoint, compare, contains, contains, contains, contains, cropBox, cropBoxComplete, getArea, getBounds, getBounds2D, getBox, getCenter, getCenterX, getCenterY, getLayer, getLayerOrPseudoLayer, getLoopsFromArea, getMaxLength, getMaxSize, getMinSize, getPathIterator, getPathIterator, getPerimeter, getPoints, getPointsInArea, getPolygon, getPolyTrees, getPort, getStyle, getTextScale, getTreesFromLoops, gridToLambda, halfCropBox, intersects, intersects, intersects, isInside, isInside, isPointOnCorner, isPseudoLayer, lambdaToGrid, makePoints, makePoints, polyDistance, polyDistance, polySame, reducePortPoly, rotateType, roundPoints, separation, separationBox, setLayer, setPoint, setPort, setStyle, unRotateType
public static final Poly[] NULL_ARRAY
public Poly(java.awt.geom.Point2D[] points)
points
- the array of coordinates.public Poly(double cX, double cY, double width, double height)
cX
- the center X coordinate of the rectangle.cY
- the center Y coordinate of the rectangle.width
- the width of the rectangle.height
- the height of the rectangle.public Poly(java.awt.geom.Rectangle2D rect)
rect
- the Rectangle2D of the rectangle.public EGraphics getGraphicsOverride()
public void setGraphicsOverride(EGraphics graphics)
graphics
- graphics overridepublic java.lang.String getString()
public void setString(java.lang.String string)
string
- the String associated with this Poly.public TextDescriptor getTextDescriptor()
public void setTextDescriptor(TextDescriptor descript)
descript
- the Text Descriptor associated with this Poly.public DisplayedText getDisplayedText()
public void setDisplayedText(DisplayedText dt)
dt
- the DisplayedText associated with this Poly.public void transform(java.awt.geom.AffineTransform af)
public static double getExtendFactor(double width, int extend)
width
- the width of the arc.extend
- the extension factor (from 0 to 90).public static Poly makeEndPointPoly(double len, double wid, int angle, java.awt.geom.Point2D endH, double extendH, java.awt.geom.Point2D endT, double extendT, Poly.Type style)
len
- the length of the arc.wid
- the width of the arc.angle
- the angle of the arc.endH
- the head end of the arc.extendH
- the head end extension distance of the arc.endT
- the tail end of the arc.extendT
- the tail end extension distance of the arc.style
- the style of the polygon (filled, opened, etc.)public boolean setExactTextBounds(EditWindow0 wnd, ElectricObject eObj)
wnd
- the window.eObj
- the ElectricObject on which this text resides.
If that ElectricObject is a NodeInst and the node is rotated, it affects the text anchor point.public static Poly.Builder newLambdaBuilder()
public static Poly.Builder newGridBuilder()
public static Poly.Builder threadLocalLambdaBuilder()