Class AbstractDrawable
java.lang.Object
se.conciliate.extensions.drawable.AbstractDrawable
- All Implemented Interfaces:
Drawable
-
Nested Class Summary
Nested classes/interfaces inherited from interface se.conciliate.extensions.drawable.Drawable
Drawable.PaintMode, Drawable.TextDirection, Drawable.TextHorizontalAlign, Drawable.TextVerticalAlign
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFillImage
(int index, MTLanguage lang) Returns the image that fills the shape.getOutline
(Rectangle bounds) Returns the outline of the drawable.getPaint
(Drawable.PaintMode paintMode, int index, Rectangle bounds) Returns a paint for a given shape and paint mode.getStroke
(int index) Returns the stroke of the edge around the shape.getText
(int index, MTLanguage lang) Returns the text that lies in the shape.getTextDirection
(int index) getTextFont
(int index) Returns the font of the shape's text.getTextHorizontalAlign
(int index) getTextVerticalAlign
(int index) boolean
Returns true if a shadow should be rendered below the drawable.boolean
hasText
(int index) Returns true if the shape has text in it.boolean
isBorder
(int index) Returns true if the shape is a border.boolean
isFillImage
(int index) Returns true if the shape has a fill image.boolean
isPaintTransformable
(Drawable.PaintMode paintMode, int index) This can returnfalse
to indicate that the paint cannot be transformed in any way for this shape, e.g.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.conciliate.extensions.drawable.Drawable
getId, getShape, getShapeCount, useHyphenation
-
Constructor Details
-
AbstractDrawable
public AbstractDrawable()
-
-
Method Details
-
isPaintTransformable
Description copied from interface:Drawable
This can returnfalse
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 iftrue
is returned.- Specified by:
isPaintTransformable
in interfaceDrawable
- 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. -
getOutline
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 interfaceDrawable
- 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. -
isFillImage
public boolean isFillImage(int index) Description copied from interface:Drawable
Returns true if the shape has a fill image.- Specified by:
isFillImage
in interfaceDrawable
- Parameters:
index
- the index of the shape,0 <= i < getShapeCount()
- Returns:
- true if the shape has a fill image
-
getPaint
Description copied from interface:Drawable
Returns a paint for a given shape and paint mode. -
getStroke
Description copied from interface:Drawable
Returns the stroke of the edge around the shape. -
getFillImage
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 interfaceDrawable
- 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. -
getText
Description copied from interface:Drawable
Returns the text that lies in the shape. -
getTextFont
Description copied from interface:Drawable
Returns the font of the shape's text.- Specified by:
getTextFont
in interfaceDrawable
- Parameters:
index
- the index of the shape,0 <= i < getShapeCount()
- Returns:
- the shape's font
-
getTextDirection
- Specified by:
getTextDirection
in interfaceDrawable
-
getTextHorizontalAlign
- Specified by:
getTextHorizontalAlign
in interfaceDrawable
-
getTextVerticalAlign
- Specified by:
getTextVerticalAlign
in interfaceDrawable
-