Interface DrawableSupport
public interface DrawableSupport
Utility service that can be used by implementations
of
DrawableFactory
.-
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultEdgeDrawable
(Paint paint, Stroke stroke, boolean arrowAtStart, boolean arrowAtEnd) Creates a default edge drawable without having access to the actual path of the edge.createDefaultEdgeDrawable
(MTEdgePath path, Paint paint, Stroke stroke, boolean arrowAtStart, boolean arrowAtEnd) Creates a default drawable for an edge.createIconDrawable
(Icon icon, Icon... icons) Creates a drawable backed by icons.Creates a drawable that draws nothing.createSVGDrawable
(InputStream svgInputStream) Creates a new drawable from an SVG data source.
-
Method Details
-
createSVGDrawable
Creates a new drawable from an SVG data source.- Parameters:
svgInputStream
- The SVG data source.- Returns:
- An SVG drawable.
-
createNullDrawable
Drawable createNullDrawable()Creates a drawable that draws nothing.- Returns:
- A no-op drawable.
-
createIconDrawable
Creates a drawable backed by icons. The drawable will automatically choose the largest of the supplied icons that will still fit inside the bounds where the drawable is being drawn.- Parameters:
icon
- One of the backing iconsicons
- Optional other backing icons.- Returns:
- A drawable backed by the sent in icons.
-
createDefaultEdgeDrawable
Drawable createDefaultEdgeDrawable(Paint paint, Stroke stroke, boolean arrowAtStart, boolean arrowAtEnd) Creates a default edge drawable without having access to the actual path of the edge. This can be used to create a drawable for edge types that can be used for icons.- Parameters:
paint
- The paint to use for the edge drawable.stroke
- The stroke to use for the edge drawable.arrowAtStart
-true
if the edge should have an arrow at the start.arrowAtEnd
-true
if the edge should have an arrow at the end.- Returns:
- A default drawable for an edge.
-
createDefaultEdgeDrawable
Drawable createDefaultEdgeDrawable(MTEdgePath path, Paint paint, Stroke stroke, boolean arrowAtStart, boolean arrowAtEnd) Creates a default drawable for an edge.- Parameters:
path
- The path of the edge.paint
- The paint to use for the edge drawable.stroke
- The stroke to use for the edge drawable.arrowAtStart
-true
if the edge should have an arrow at the start.arrowAtEnd
-true
if the edge should have an arrow at the end.- Returns:
- A default drawable for an edge.
-