Class CustomTile
- java.lang.Object
-
- All Implemented Interfaces:
EditablePageItem,FlippablePageItem,OpacityStyle,OutlineStyle,PageItem,SizablePageItem,Style,UserBleedMarginStyle,java.io.Serializable,java.lang.Cloneable
public class CustomTile extends Tile implements EditablePageItem, SizablePageItem, UserBleedMarginStyle, OutlineStyle, OpacityStyle
Resizable, customizable tiles that can be placed in a deck.- 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 Modifier and Type Field Description static java.lang.StringPLACEHOLDER_IDENTIFIERThe placeholder identifier that acts as the default for new custom tiles.-
Fields inherited from class ca.cgjennings.apps.arkham.deck.item.Tile
identifier
-
Fields inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractRenderedItem
render
-
Fields inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractFlippableItem
orientation
-
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 CustomTile(java.lang.String identifier, double dpi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginEditing()doublegetBleedMargin()Returns the bleed margin used for any automatic crop marks, in points.DragHandle[]getDragHandles()Returns an array of the customDragHandles for this item.protected java.awt.image.BufferedImagegetImageFromIdentifier()Fetch this tile's image using its identifier.floatgetOpacity()Returns the opacity (alpha) for the tile.LineCapgetOutlineCap()Returns the line cap style used on outline ends.java.awt.ColorgetOutlineColor()Returns the color used to draw the outline.DashPatterngetOutlineDashPattern()Returns the dash pattern used to draw the outline.LineJoingetOutlineJoin()Returns the method used to join the line segments that make up the outline.floatgetOutlineWidth()Returns the width, in points, of the outline.javax.swing.IcongetThumbnailIcon()Returns a small representative icon for this item.booleanisBleedMarginMarked()Returnstrueif this item should have crop marks added to it.voidpaint(java.awt.Graphics2D g, RenderTarget target, double renderResolutionHint)Paint this item at its current location.protected voidreadImpl(java.io.ObjectInputStream in)voidsetBleedMargin(double bleedMargin)Sets the size of the user-defined bleed margin, in points.voidsetBleedMarginMarked(boolean showCropMarks)Sets whether the user bleed margin is drawn (as crop marks).voidsetIdentifier(java.lang.String identifier)voidsetOpacity(float opacity)Set the opacity (alpha) of the tile.voidsetOutlineCap(LineCap cap)Sets the line cap style used on outline ends.voidsetOutlineColor(java.awt.Color borderColor)Sets the color used to draw the outline.voidsetOutlineDashPattern(DashPattern pat)Sets the dash pattern used to draw the outline.voidsetOutlineJoin(LineJoin join)Sets the method used to join the line segments that make up the outline.voidsetOutlineWidth(float borderWidth)Sets the width, in points, of the outline.voidsetSize(double width, double height)Set the new size of this item, in points.voidsetX(double x)Set the x-location of this item.voidsetY(double y)Set the y-location of this item.protected voidwriteImpl(java.io.ObjectOutputStream out)-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.Tile
clearCachedImages, getDPI, getIdentifier, getName, getResolution, getUprightHeight, getUprightWidth, isFastOutlineAllowed, isMipMapCacheEnabledByDefault, renderImage, scaleMipMapUpAtHighZoom, setDPI, setFastOutlineAllowed, setName, setOrientation, setResolution
-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractRenderedItem
clearCachedIcon, clone, createOrientedImage, getHeight, getOrientedImage, getWidth, isMipMapCacheEnabled, prepareToPaint, setMipMapCacheEnabled
-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractFlippableItem
flip, getOrientation, turnLeft, turnRight
-
Methods inherited from class ca.cgjennings.apps.arkham.deck.item.AbstractItem
customizePopupMenu, getClassesSnappedTo, getClientProperty, getFoldMarks, getGroup, getLocation, getOutline, getPage, getRectangle, getSnapClass, getSnapTarget, getX, getY, hasExteriorHandles, hitTest, isHorizontal, isMirrored, isSelectionLocked, isTurned0DegreesFrom, isTurned180DegreesFrom, isTurned90DegreesFrom, isVertical, itemChanged, itemChanging, putClientProperty, setClassesSnappedTo, setGroup, setLocation, setLocation, setPage, setSelectionLocked, setSnapClass, setSnapTarget, 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
clone, customizePopupMenu, getClassesSnappedTo, getClientProperty, getFoldMarks, getGroup, getHeight, getLocation, getName, getOrientation, getOutline, getPage, getRectangle, getSnapClass, getSnapTarget, getWidth, getX, getY, hasExteriorHandles, hitTest, isHorizontal, isMirrored, isSelectionLocked, isTurned0DegreesFrom, isTurned180DegreesFrom, isTurned90DegreesFrom, isVertical, prepareToPaint, putClientProperty, setClassesSnappedTo, setGroup, setLocation, setLocation, setPage, setSelectionLocked, setSnapClass, setSnapTarget
-
-
-
-
Field Detail
-
PLACEHOLDER_IDENTIFIER
public static final java.lang.String PLACEHOLDER_IDENTIFIER
The placeholder identifier that acts as the default for new custom tiles.- See Also:
- Constant Field Values
-
-
Method Detail
-
getThumbnailIcon
public javax.swing.Icon getThumbnailIcon()
Description copied from interface:PageItemReturns a small representative icon for this item. The icon should beICON_SIZEpixels wide and high.- Specified by:
getThumbnailIconin interfacePageItem- Overrides:
getThumbnailIconin classAbstractRenderedItem
-
setIdentifier
public void setIdentifier(java.lang.String identifier)
- Overrides:
setIdentifierin classTile
-
getImageFromIdentifier
protected java.awt.image.BufferedImage getImageFromIdentifier()
Fetch this tile's image using its identifier. Locates the image as a file or URL using the same syntax asGraphicStyleFactory.- Overrides:
getImageFromIdentifierin classTile- Returns:
- an image for this identifier, possibly a "broken image" placeholder image
-
beginEditing
public void beginEditing()
- Specified by:
beginEditingin interfaceEditablePageItem
-
getDragHandles
public DragHandle[] getDragHandles()
Description copied from class:AbstractItemReturns an array of the customDragHandles 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
dragHandlesfield 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:
getDragHandlesin interfacePageItem- Overrides:
getDragHandlesin classAbstractItem- Returns:
- an array of drag handles that can be used to manipulate the item,
or
null
-
setBleedMarginMarked
public void setBleedMarginMarked(boolean showCropMarks)
Description copied from interface:UserBleedMarginStyleSets whether the user bleed margin is drawn (as crop marks).- Specified by:
setBleedMarginMarkedin interfaceUserBleedMarginStyle- Parameters:
showCropMarks-trueif crop marks are enabled
-
isBleedMarginMarked
public boolean isBleedMarginMarked()
Description copied from interface:PageItemReturnstrueif this item should have crop marks added to it. The crop marks will be placedPageItem.getBleedMargin()points from the ends of each edge.- Specified by:
isBleedMarginMarkedin interfacePageItem- Specified by:
isBleedMarginMarkedin interfaceUserBleedMarginStyle- Overrides:
isBleedMarginMarkedin classAbstractItem- Returns:
trueif crop marks are enabled
-
getBleedMargin
public double getBleedMargin()
Description copied from interface:PageItemReturns the bleed margin used for any automatic crop marks, in points.- Specified by:
getBleedMarginin interfacePageItem- Specified by:
getBleedMarginin interfaceUserBleedMarginStyle- Overrides:
getBleedMarginin classAbstractItem- Returns:
- the bleed margin for this item
-
setBleedMargin
public void setBleedMargin(double bleedMargin)
Description copied from interface:UserBleedMarginStyleSets the size of the user-defined bleed margin, in points. If the specified value is more half of the greater of the width or height of the item, then the value will be silently reduced to this maximum.- Specified by:
setBleedMarginin interfaceUserBleedMarginStyle- Parameters:
bleedMargin- the bleed margin size
-
setSize
public void setSize(double width, double height)Description copied from interface:SizablePageItemSet the new size of this item, in points.- Specified by:
setSizein interfaceSizablePageItem- Parameters:
width- the new width of the itemheight- the new height of the item
-
getOpacity
public float getOpacity()
Returns the opacity (alpha) for the tile.- Specified by:
getOpacityin interfaceOpacityStyle- Returns:
- the opacity
-
setOpacity
public void setOpacity(float opacity)
Set the opacity (alpha) of the tile.- Specified by:
setOpacityin interfaceOpacityStyle- Parameters:
opacity- the opacity to set
-
getOutlineColor
public java.awt.Color getOutlineColor()
Description copied from interface:OutlineStyleReturns the color used to draw the outline.- Specified by:
getOutlineColorin interfaceOutlineStyle- Returns:
- the outline color
-
setOutlineColor
public void setOutlineColor(java.awt.Color borderColor)
Description copied from interface:OutlineStyleSets the color used to draw the outline.- Specified by:
setOutlineColorin interfaceOutlineStyle- Parameters:
borderColor- the outline color
-
getOutlineWidth
public float getOutlineWidth()
Description copied from interface:OutlineStyleReturns the width, in points, of the outline.- Specified by:
getOutlineWidthin interfaceOutlineStyle- Returns:
- the outline line width
-
setOutlineWidth
public void setOutlineWidth(float borderWidth)
Description copied from interface:OutlineStyleSets the width, in points, of the outline.- Specified by:
setOutlineWidthin interfaceOutlineStyle- Parameters:
borderWidth- the outline width
-
getOutlineDashPattern
public DashPattern getOutlineDashPattern()
Description copied from interface:OutlineStyleReturns the dash pattern used to draw the outline.- Specified by:
getOutlineDashPatternin interfaceOutlineStyle- Returns:
- the dash pattern for the outline
-
setOutlineDashPattern
public void setOutlineDashPattern(DashPattern pat)
Description copied from interface:OutlineStyleSets the dash pattern used to draw the outline.- Specified by:
setOutlineDashPatternin interfaceOutlineStyle- Parameters:
pat- the dash pattern type
-
getOutlineJoin
public LineJoin getOutlineJoin()
Description copied from interface:OutlineStyleReturns the method used to join the line segments that make up the outline.- Specified by:
getOutlineJoinin interfaceOutlineStyle- Returns:
- the line joining method
-
setOutlineJoin
public void setOutlineJoin(LineJoin join)
Description copied from interface:OutlineStyleSets the method used to join the line segments that make up the outline.- Specified by:
setOutlineJoinin interfaceOutlineStyle- Parameters:
join- the line joining method
-
setOutlineCap
public void setOutlineCap(LineCap cap)
Description copied from interface:OutlineStyleSets the line cap style used on outline ends.- Specified by:
setOutlineCapin interfaceOutlineStyle- Parameters:
cap- the line cap type
-
getOutlineCap
public LineCap getOutlineCap()
Description copied from interface:OutlineStyleReturns the line cap style used on outline ends.- Specified by:
getOutlineCapin interfaceOutlineStyle- Returns:
- the line cap style
-
setX
public void setX(double x)
Description copied from interface:PageItemSet the x-location of this item.- Specified by:
setXin interfacePageItem- Overrides:
setXin classAbstractItem- Parameters:
x- the new x-location
-
setY
public void setY(double y)
Description copied from interface:PageItemSet the y-location of this item.- Specified by:
setYin interfacePageItem- Overrides:
setYin classAbstractItem- Parameters:
y- the new y-location
-
paint
public void paint(java.awt.Graphics2D g, RenderTarget target, double renderResolutionHint)Description copied from interface:PageItemPaint 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.
-
writeImpl
protected void writeImpl(java.io.ObjectOutputStream out) throws java.io.IOException
-
-