Class CustomTile

    • 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
    • Constructor Detail

      • CustomTile

        public CustomTile​(java.lang.String identifier,
                          double dpi)
    • Method Detail

      • setIdentifier

        public void setIdentifier​(java.lang.String identifier)
        Overrides:
        setIdentifier in class Tile
      • 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 as GraphicStyleFactory.
        Overrides:
        getImageFromIdentifier in class Tile
        Returns:
        an image for this identifier, possibly a "broken image" placeholder image
      • 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
      • setBleedMarginMarked

        public void setBleedMarginMarked​(boolean showCropMarks)
        Description copied from interface: UserBleedMarginStyle
        Sets whether the user bleed margin is drawn (as crop marks).
        Specified by:
        setBleedMarginMarked in interface UserBleedMarginStyle
        Parameters:
        showCropMarks - true if crop marks are enabled
      • setBleedMargin

        public void setBleedMargin​(double bleedMargin)
        Description copied from interface: UserBleedMarginStyle
        Sets 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:
        setBleedMargin in interface UserBleedMarginStyle
        Parameters:
        bleedMargin - the bleed margin size
      • 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
      • getOpacity

        public float getOpacity()
        Returns the opacity (alpha) for the tile.
        Specified by:
        getOpacity in interface OpacityStyle
        Returns:
        the opacity
      • setOpacity

        public void setOpacity​(float opacity)
        Set the opacity (alpha) of the tile.
        Specified by:
        setOpacity in interface OpacityStyle
        Parameters:
        opacity - the opacity to set
      • getOutlineColor

        public java.awt.Color getOutlineColor()
        Description copied from interface: OutlineStyle
        Returns the color used to draw the outline.
        Specified by:
        getOutlineColor in interface OutlineStyle
        Returns:
        the outline color
      • setOutlineColor

        public void setOutlineColor​(java.awt.Color borderColor)
        Description copied from interface: OutlineStyle
        Sets the color used to draw the outline.
        Specified by:
        setOutlineColor in interface OutlineStyle
        Parameters:
        borderColor - the outline color
      • getOutlineWidth

        public float getOutlineWidth()
        Description copied from interface: OutlineStyle
        Returns the width, in points, of the outline.
        Specified by:
        getOutlineWidth in interface OutlineStyle
        Returns:
        the outline line width
      • setOutlineWidth

        public void setOutlineWidth​(float borderWidth)
        Description copied from interface: OutlineStyle
        Sets the width, in points, of the outline.
        Specified by:
        setOutlineWidth in interface OutlineStyle
        Parameters:
        borderWidth - the outline width
      • setOutlineDashPattern

        public void setOutlineDashPattern​(DashPattern pat)
        Description copied from interface: OutlineStyle
        Sets the dash pattern used to draw the outline.
        Specified by:
        setOutlineDashPattern in interface OutlineStyle
        Parameters:
        pat - the dash pattern type
      • getOutlineJoin

        public LineJoin getOutlineJoin()
        Description copied from interface: OutlineStyle
        Returns the method used to join the line segments that make up the outline.
        Specified by:
        getOutlineJoin in interface OutlineStyle
        Returns:
        the line joining method
      • setOutlineJoin

        public void setOutlineJoin​(LineJoin join)
        Description copied from interface: OutlineStyle
        Sets the method used to join the line segments that make up the outline.
        Specified by:
        setOutlineJoin in interface OutlineStyle
        Parameters:
        join - the line joining method
      • setOutlineCap

        public void setOutlineCap​(LineCap cap)
        Description copied from interface: OutlineStyle
        Sets the line cap style used on outline ends.
        Specified by:
        setOutlineCap in interface OutlineStyle
        Parameters:
        cap - the line cap type
      • getOutlineCap

        public LineCap getOutlineCap()
        Description copied from interface: OutlineStyle
        Returns the line cap style used on outline ends.
        Specified by:
        getOutlineCap in interface OutlineStyle
        Returns:
        the line cap style
      • setX

        public void setX​(double x)
        Description copied from interface: PageItem
        Set the x-location of this item.
        Specified by:
        setX in interface PageItem
        Overrides:
        setX in class AbstractItem
        Parameters:
        x - the new x-location
      • setY

        public void setY​(double y)
        Description copied from interface: PageItem
        Set the y-location of this item.
        Specified by:
        setY in interface PageItem
        Overrides:
        setY in class AbstractItem
        Parameters:
        y - the new y-location
      • 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
        Overrides:
        paint in class Tile
        Parameters:
        g - the graphics context to paint to
        target - the type of destination being drawn to
        renderResolutionHint - a source resolution hint
      • writeImpl

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

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