Class AbstractDrawable

java.lang.Object
se.conciliate.extensions.drawable.AbstractDrawable
All Implemented Interfaces:
Drawable

public abstract class AbstractDrawable extends Object implements Drawable
  • Constructor Details

    • AbstractDrawable

      public AbstractDrawable()
  • Method Details

    • isPaintTransformable

      public boolean isPaintTransformable(Drawable.PaintMode paintMode, int index)
      Description copied from interface: Drawable
      This can return false to indicate that the paint cannot be transformed in any way for this shape, e.g. if the user has created a color scheme and this is one of the shapes in a drawable for a vertex it will have the same color regardless of the settings in the color scheme if true is returned.
      Specified by:
      isPaintTransformable in interface Drawable
      Parameters:
      paintMode - The paint mode used.
      index - The index of the shape.
      Returns:
      true to never transform the paint of the given paint mode, of the shape at the given index, false to allow paint transformation of the given paint mode and shape.
      See Also:
    • hasShadow

      public boolean hasShadow()
      Description copied from interface: Drawable
      Returns true if a shadow should be rendered below the drawable.
      Specified by:
      hasShadow in interface Drawable
      Returns:
      true if a shadow should be rendered below the drawable.
    • getOutline

      public Shape getOutline(Rectangle bounds)
      Description copied from interface: Drawable
      Returns the outline of the drawable. This is the area that marks the outer limit of the drawable, where edges will stop.
      Specified by:
      getOutline in interface Drawable
      Parameters:
      bounds - The outer bounds that the drawable should fill up
      Returns:
      The outline of the drawable.
    • isBorder

      public boolean isBorder(int index)
      Description copied from interface: Drawable
      Returns true if the shape is a border. A border's outline can be changed if the user indicates that this drawable should have another border or if the drawable is selected in the UI. If isBorder() is true getOutlinePaint() and getOutlineStroke() can be ignored by the renderer.
      Specified by:
      isBorder in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      Returns:
      true if the shape is a border
    • isFillImage

      public boolean isFillImage(int index)
      Description copied from interface: Drawable
      Returns true if the shape has a fill image.
      Specified by:
      isFillImage in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      Returns:
      true if the shape has a fill image
    • getPaint

      public Paint getPaint(Drawable.PaintMode paintMode, int index, Rectangle bounds)
      Description copied from interface: Drawable
      Returns a paint for a given shape and paint mode.
      Specified by:
      getPaint in interface Drawable
      Parameters:
      paintMode - The paint mode.
      index - the index of the shape, 0 <= i < getShapeCount()
      bounds - The bounds in which the drawable will be drawn.
      Returns:
      the fill paint of the shape, null if no fill paint
      See Also:
    • getStroke

      public Stroke getStroke(int index)
      Description copied from interface: Drawable
      Returns the stroke of the edge around the shape.
      Specified by:
      getStroke in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      Returns:
      the outline stroke of the shape or null for no stroking of the shape.
    • getFillImage

      public Image getFillImage(int index, MTLanguage lang)
      Description copied from interface: Drawable
      Returns the image that fills the shape. The shape will be stretched to fill the shape.
      Specified by:
      getFillImage in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      lang - The language to get the image for.
      Returns:
      the shape's fill image
    • hasText

      public boolean hasText(int index)
      Description copied from interface: Drawable
      Returns true if the shape has text in it.
      Specified by:
      hasText in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      Returns:
      true if the shape has text.
    • getText

      public String getText(int index, MTLanguage lang)
      Description copied from interface: Drawable
      Returns the text that lies in the shape.
      Specified by:
      getText in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      lang - The language to get the text for.
      Returns:
      the shape's text, or null if no text is available
    • getTextFont

      public Font getTextFont(int index)
      Description copied from interface: Drawable
      Returns the font of the shape's text.
      Specified by:
      getTextFont in interface Drawable
      Parameters:
      index - the index of the shape, 0 <= i < getShapeCount()
      Returns:
      the shape's font
    • getTextDirection

      public Drawable.TextDirection getTextDirection(int index)
      Specified by:
      getTextDirection in interface Drawable
    • getTextHorizontalAlign

      public Drawable.TextHorizontalAlign getTextHorizontalAlign(int index)
      Specified by:
      getTextHorizontalAlign in interface Drawable
    • getTextVerticalAlign

      public Drawable.TextVerticalAlign getTextVerticalAlign(int index)
      Specified by:
      getTextVerticalAlign in interface Drawable