Class Curve
- java.lang.Object
-
- ca.cgjennings.apps.arkham.deck.item.AbstractItem
-
- ca.cgjennings.apps.arkham.deck.item.Line
-
- ca.cgjennings.apps.arkham.deck.item.Curve
-
- All Implemented Interfaces:
LineStyle
,PageItem
,ShadowStyle
,SizablePageItem
,Style
,java.io.Serializable
,java.lang.Cloneable
public class Curve extends Line
An page item representing a quadratic parametric curve segment.- Author:
- Chris Jennings
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ca.cgjennings.apps.arkham.deck.item.PageItem
PageItem.SnapClass, PageItem.SnapTarget
-
-
Field Summary
-
Fields inherited from class ca.cgjennings.apps.arkham.deck.item.Line
cachedIcon, DEFAULT_DASH_PATTERN, DEFAULT_LINE_CAP, DEFAULT_LINE_COLOR, DEFAULT_LINE_JOIN, DEFAULT_LINE_WIDTH, dsc
-
Fields inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractItem
dragHandles, group, parent, selectionLock, snapClass, snapTarget, snapToClasses, xOff, yOff
-
Fields inherited from interface ca.cgjennings.apps.arkham.deck.item.PageItem
ICON_SIZE, ORIENT_MIRROR_TURN_LEFT, ORIENT_MIRROR_TURN_RIGHT, ORIENT_MIRROR_UPRIGHT, ORIENT_MIRROR_UPSIDEDOWN, ORIENT_TURN_LEFT, ORIENT_TURN_RIGHT, ORIENT_UPRIGHT, ORIENT_UPSIDEDOWN
-
-
Constructor Summary
Constructors Constructor Description Curve()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Point2D.Double
getControlPoint()
double
getCX()
double
getCY()
DragHandle[]
getDragHandles()
Returns an array of the customDragHandle
s for this item.java.awt.Shape
getOutline()
Return aShape
that corresponds to the outline of this item.javax.swing.ImageIcon
getThumbnailIcon()
Returns a small representative icon for this item.boolean
hasExteriorHandles()
Returnstrue
if this item has one or more drag handles that may lie outside of the item's bounding box.void
paint(java.awt.Graphics2D g, RenderTarget target, double renderResolutionHint)
Paint this item at its current location.protected void
readImpl(java.io.ObjectInputStream in)
void
setControlPoint(java.awt.geom.Point2D cp)
protected void
writeImpl(java.io.ObjectOutputStream out)
-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.Line
applyStrokeAndPaint, clone, getEndPoint, getHeight, getLineCap, getLineColor, getLineDashPattern, getLineJoin, getLineWidth, getName, getRectangle, getStartPoint, getWidth, getX2, getY2, isShadowed, paintFast, setEndPoint, setLineCap, setLineColor, setLineDashPattern, setLineJoin, setLineWidth, setName, setShadowed, setSize, setStartPoint
-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractItem
customizePopupMenu, getBleedMargin, getClassesSnappedTo, getClientProperty, getFoldMarks, getGroup, getLocation, getOrientation, getPage, getSnapClass, getSnapTarget, getX, getY, hitTest, isBleedMarginMarked, isHorizontal, isMirrored, isSelectionLocked, isTurned0DegreesFrom, isTurned180DegreesFrom, isTurned90DegreesFrom, isVertical, itemChanged, itemChanging, prepareToPaint, putClientProperty, setClassesSnappedTo, setGroup, setLocation, setLocation, setPage, setSelectionLocked, setSnapClass, setSnapTarget, setX, setY, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ca.cgjennings.apps.arkham.deck.item.PageItem
customizePopupMenu, getBleedMargin, getClassesSnappedTo, getClientProperty, getFoldMarks, getGroup, getLocation, getOrientation, getPage, getSnapClass, getSnapTarget, getX, getY, hitTest, isBleedMarginMarked, isHorizontal, isMirrored, isSelectionLocked, isTurned0DegreesFrom, isTurned180DegreesFrom, isTurned90DegreesFrom, isVertical, prepareToPaint, putClientProperty, setClassesSnappedTo, setGroup, setLocation, setLocation, setPage, setSelectionLocked, setSnapClass, setSnapTarget, setX, setY
-
-
-
-
Method Detail
-
getThumbnailIcon
public javax.swing.ImageIcon getThumbnailIcon()
Description copied from interface:PageItem
Returns a small representative icon for this item. The icon should beICON_SIZE
pixels wide and high.- Specified by:
getThumbnailIcon
in interfacePageItem
- Overrides:
getThumbnailIcon
in classLine
-
getControlPoint
public java.awt.geom.Point2D.Double getControlPoint()
-
setControlPoint
public void setControlPoint(java.awt.geom.Point2D cp)
-
getCX
public double getCX()
-
getCY
public double getCY()
-
paint
public void paint(java.awt.Graphics2D g, RenderTarget target, double renderResolutionHint)
Description copied from interface:PageItem
Paint this item at its current location. The graphics context will be scaled so that 1 unit represents 1 point. The resolution hint is a suggestion as to the resolution the item should be rendered at if it must be converted to a bitmap before being drawn. It may or may not represent the actual resolution of the output target.
-
getOutline
public java.awt.Shape getOutline()
Description copied from interface:PageItem
Return aShape
that corresponds to the outline of this item. In the simplest case, this can return the same result asPageItem.getRectangle()
. If precise geometry is available for the item, then this should return a more accurate bounding shape.- Specified by:
getOutline
in interfacePageItem
- Overrides:
getOutline
in classLine
- Returns:
- the outline of this object
-
getDragHandles
public DragHandle[] getDragHandles()
Description copied from class:AbstractItem
Returns an array of the customDragHandle
s for this item. If the item has no handles, returnsnull
.Concrete subclasses should create an array of handles on demand and cache them in the
dragHandles
field in order to ensure that handles are not shared between copies of the item. Example:public DragHandle[] getDragHandles() { if( dragHandles == null ) { dragHandles = new DragHandle[] { ... }; } return dragHandles; }
- Specified by:
getDragHandles
in interfacePageItem
- Overrides:
getDragHandles
in classLine
- Returns:
- an array of drag handles that can be used to manipulate the item,
or
null
-
hasExteriorHandles
public boolean hasExteriorHandles()
Description copied from interface:PageItem
Returnstrue
if this item has one or more drag handles that may lie outside of the item's bounding box. The editor normally only tests handles that lie within the bounding box to see if the user has pointed at them; if this method returnstrue
then the item's handles are always tested.- Specified by:
hasExteriorHandles
in interfacePageItem
- Overrides:
hasExteriorHandles
in classLine
- Returns:
true
if some handles may be outside the bounding box
-
writeImpl
protected void writeImpl(java.io.ObjectOutputStream out) throws java.io.IOException
-
-