Class Line

    • Field Detail

      • DEFAULT_LINE_COLOR

        public static final java.awt.Color DEFAULT_LINE_COLOR
      • DEFAULT_DASH_PATTERN

        public static final DashPattern DEFAULT_DASH_PATTERN
      • cachedIcon

        protected transient javax.swing.ImageIcon cachedIcon
      • dsc

        protected transient ca.cgjennings.apps.arkham.deck.item.DropShadowLineCache dsc
    • Constructor Detail

      • Line

        public Line()
    • Method Detail

      • getThumbnailIcon

        public javax.swing.ImageIcon getThumbnailIcon()
        Description copied from interface: PageItem
        Returns a small representative icon for this item. The icon should be ICON_SIZE pixels wide and high.
        Specified by:
        getThumbnailIcon in interface PageItem
        Specified by:
        getThumbnailIcon in class AbstractItem
      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
        Description copied from interface: PageItem
        Return the user-friendly short name of this item.
        Specified by:
        getName in interface PageItem
        Returns:
        a name that describes the card or its general kind
      • getLineColor

        public java.awt.Color getLineColor()
        Description copied from interface: LineStyle
        Returns the color used to draw the border.
        Specified by:
        getLineColor in interface LineStyle
        Returns:
        the border color
      • setLineColor

        public void setLineColor​(java.awt.Color lineColour)
        Description copied from interface: LineStyle
        Sets the color used to draw the line.
        Specified by:
        setLineColor in interface LineStyle
      • getLineCap

        public LineCap getLineCap()
        Description copied from interface: LineStyle
        Returns the line cap style used on line ends.
        Specified by:
        getLineCap in interface LineStyle
        Returns:
        the line cap style
      • setLineCap

        public void setLineCap​(LineCap lineCap)
        Description copied from interface: LineStyle
        Sets the line cap style used on line ends.
        Specified by:
        setLineCap in interface LineStyle
        Parameters:
        lineCap - the line cap type
      • setLineJoin

        public void setLineJoin​(LineJoin join)
        Description copied from interface: LineStyle
        Sets the line join style used for paths containing multiple line or curve segments.
        Specified by:
        setLineJoin in interface LineStyle
        Parameters:
        join - the new line join style
      • setLineWidth

        public void setLineWidth​(float lineWidth)
        Description copied from interface: LineStyle
        Sets the width, in points, of the line.
        Specified by:
        setLineWidth in interface LineStyle
      • getLineDashPattern

        public DashPattern getLineDashPattern()
        Description copied from interface: LineStyle
        Returns the dash pattern used to draw the line.
        Specified by:
        getLineDashPattern in interface LineStyle
        Returns:
        the dash pattern for the border
      • setLineDashPattern

        public void setLineDashPattern​(DashPattern pat)
        Description copied from interface: LineStyle
        Sets the dash pattern used to draw the line.
        Specified by:
        setLineDashPattern in interface LineStyle
        Parameters:
        pat - the dash pattern type
      • isShadowed

        public boolean isShadowed()
        Description copied from interface: ShadowStyle
        Returns true if a drop shadow is enabled.
        Specified by:
        isShadowed in interface ShadowStyle
        Returns:
        true if a shadow is enabled
      • setShadowed

        public void setShadowed​(boolean enable)
        Description copied from interface: ShadowStyle
        Sets whether the drop shadow are enabled.
        Specified by:
        setShadowed in interface ShadowStyle
        Parameters:
        enable - if true, the object will have a drop shadow
      • getX2

        public double getX2()
      • getY2

        public double getY2()
      • getRectangle

        public java.awt.geom.Rectangle2D.Double getRectangle()
        Description copied from interface: PageItem
        Return a rectangle of the bounds of this item.
        Specified by:
        getRectangle in interface PageItem
        Overrides:
        getRectangle in class AbstractItem
        Returns:
        a bounding rectangle for the item
      • setSize

        public void setSize​(double width,
                            double height)
        Description copied from interface: SizablePageItem
        Set the new size of this item, in points.
        Specified by:
        setSize in interface SizablePageItem
        Parameters:
        width - the new width of the item
        height - the new height of the item
      • getWidth

        public double getWidth()
        Description copied from interface: PageItem
        Return the width of this item, in points.
        Specified by:
        getWidth in interface PageItem
        Specified by:
        getWidth in class AbstractItem
        Returns:
        the item's width
      • getHeight

        public double getHeight()
        Description copied from interface: PageItem
        Return the height of this item, in points.
        Specified by:
        getHeight in interface PageItem
        Specified by:
        getHeight in class AbstractItem
        Returns:
        the item's height
      • getStartPoint

        public java.awt.geom.Point2D.Double getStartPoint()
      • getEndPoint

        public java.awt.geom.Point2D.Double getEndPoint()
      • setStartPoint

        public void setStartPoint​(java.awt.geom.Point2D p)
      • setEndPoint

        public void setEndPoint​(java.awt.geom.Point2D p)
      • getLineWidth

        public float getLineWidth()
        Description copied from interface: LineStyle
        Returns the width, in points, of the line.
        Specified by:
        getLineWidth in interface LineStyle
        Returns:
        the border line width
      • getDragHandles

        public DragHandle[] getDragHandles()
        Description copied from class: AbstractItem
        Returns an array of the custom DragHandles for this item. If the item has no handles, returns null.

        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 interface PageItem
        Overrides:
        getDragHandles in class AbstractItem
        Returns:
        an array of drag handles that can be used to manipulate the item, or null
      • getOutline

        public java.awt.Shape getOutline()
        Description copied from interface: PageItem
        Return a Shape that corresponds to the outline of this item. In the simplest case, this can return the same result as PageItem.getRectangle(). If precise geometry is available for the item, then this should return a more accurate bounding shape.
        Specified by:
        getOutline in interface PageItem
        Overrides:
        getOutline in class AbstractItem
        Returns:
        the outline of this object
      • 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.
        Specified by:
        paint in interface PageItem
        Specified by:
        paint in class AbstractItem
        Parameters:
        g - the graphics context to paint to
        target - the type of destination being drawn to
        renderResolutionHint - a source resolution hint
      • paintFast

        public void paintFast​(java.awt.Graphics2D g,
                              java.awt.geom.Line2D.Double line,
                              RenderTarget target,
                              double renderResolutionHint)
      • applyStrokeAndPaint

        protected java.awt.Stroke applyStrokeAndPaint​(java.awt.Graphics2D g)
      • clone

        public PageItem clone()
        Description copied from interface: PageItem
        Returns a new page item, using this item as a template. The new item should generally be a deep copy, not sharing any objects with the original unless those objects are immutable. The deck editor absolutely relies on this method being implemented correctly! (For example, drag-and-drop and clipboard operations use clones to create copies of existing items.)
        Specified by:
        clone in interface PageItem
        Overrides:
        clone in class AbstractItem
        Returns:
        a new copy of this page item
      • hasExteriorHandles

        public boolean hasExteriorHandles()
        Description copied from interface: PageItem
        Returns true 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 returns true then the item's handles are always tested.
        Specified by:
        hasExteriorHandles in interface PageItem
        Overrides:
        hasExteriorHandles in class AbstractItem
        Returns:
        true if some handles may be outside the bounding box
      • writeImpl

        protected void writeImpl​(java.io.ObjectOutputStream out)
                          throws java.io.IOException
        Overrides:
        writeImpl in class AbstractItem
        Throws:
        java.io.IOException
      • readImpl

        protected void readImpl​(java.io.ObjectInputStream in)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Overrides:
        readImpl in class AbstractItem
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException