A base class implementing common functionality for Drawable classes which consist of some kind of filled and stroked outline. More...
Inherits Drawable.
Inherited by DrawablePath, and DrawableRectangle.
Classes | |
| class | FillAndStrokeState |
| class | RelativeFillType |
| A FillType wrapper that allows the gradient coordinates to be implemented using RelativePoint. More... | |
Public Member Functions | |
| ~DrawableShape () | |
| Destructor. | |
| void | setFill (const FillType &newFill) |
| Sets a fill type for the path. | |
| void | setFill (const RelativeFillType &newFill) |
| Sets a fill type for the path. | |
| const RelativeFillType & | getFill () const noexcept |
| Returns the current fill type. | |
| void | setStrokeFill (const FillType &newStrokeFill) |
| Sets the fill type with which the outline will be drawn. | |
| void | setStrokeFill (const RelativeFillType &newStrokeFill) |
| Sets the fill type with which the outline will be drawn. | |
| const RelativeFillType & | getStrokeFill () const noexcept |
| Returns the current stroke fill. | |
| void | setStrokeType (const PathStrokeType &newStrokeType) |
| Changes the properties of the outline that will be drawn around the path. | |
| void | setStrokeThickness (float newThickness) |
| Changes the stroke thickness. | |
| const PathStrokeType & | getStrokeType () const noexcept |
| Returns the current outline style. | |
| Rectangle< float > | getDrawableBounds () const |
| void | paint (Graphics &g) |
| bool | hitTest (int x, int y) |
Protected Member Functions | |
| DrawableShape () | |
| DrawableShape (const DrawableShape &) | |
| void | pathChanged () |
| Called when the cached path should be updated. | |
| void | strokeChanged () |
| Called when the cached stroke should be updated. | |
| bool | isStrokeVisible () const noexcept |
| True if there's a stroke with a non-zero thickness and non-transparent colour. | |
| void | refreshFillTypes (const FillAndStrokeState &newState, ComponentBuilder::ImageProvider *) |
| Updates the details from a FillAndStrokeState object, returning true if something changed. | |
| void | writeTo (FillAndStrokeState &state, ComponentBuilder::ImageProvider *, UndoManager *) const |
| Writes the stroke and fill details to a FillAndStrokeState object. | |
Protected Attributes | |
| PathStrokeType | strokeType |
| Path | path |
| Path | strokePath |
A base class implementing common functionality for Drawable classes which consist of some kind of filled and stroked outline.
| DrawableShape::DrawableShape | ( | ) | [protected] |
| DrawableShape::DrawableShape | ( | const DrawableShape & | ) | [protected] |
Destructor.
| void DrawableShape::setFill | ( | const FillType & | newFill | ) |
Sets a fill type for the path.
This colour is used to fill the path - if you don't want the path to be filled (e.g. if you're just drawing an outline), set this to a transparent colour.
| void DrawableShape::setFill | ( | const RelativeFillType & | newFill | ) |
Sets a fill type for the path.
This colour is used to fill the path - if you don't want the path to be filled (e.g. if you're just drawing an outline), set this to a transparent colour.
| const RelativeFillType& DrawableShape::getFill | ( | ) | const |
Returns the current fill type.
| void DrawableShape::setStrokeFill | ( | const FillType & | newStrokeFill | ) |
Sets the fill type with which the outline will be drawn.
| void DrawableShape::setStrokeFill | ( | const RelativeFillType & | newStrokeFill | ) |
Sets the fill type with which the outline will be drawn.
| const RelativeFillType& DrawableShape::getStrokeFill | ( | ) | const |
Returns the current stroke fill.
| void DrawableShape::setStrokeType | ( | const PathStrokeType & | newStrokeType | ) |
Changes the properties of the outline that will be drawn around the path.
If the stroke has 0 thickness, no stroke will be drawn.
| void DrawableShape::setStrokeThickness | ( | float | newThickness | ) |
Changes the stroke thickness.
This is a shortcut for calling setStrokeType.
| const PathStrokeType& DrawableShape::getStrokeType | ( | ) | const |
Returns the current outline style.
| Rectangle<float> DrawableShape::getDrawableBounds | ( | ) | const [virtual] |
Implements Drawable.
| void DrawableShape::paint | ( | Graphics & | g | ) | [virtual] |
Reimplemented from Component.
| bool DrawableShape::hitTest | ( | int | x, |
| int | y | ||
| ) | [virtual] |
Reimplemented from Component.
| void DrawableShape::pathChanged | ( | ) | [protected] |
Called when the cached path should be updated.
| void DrawableShape::strokeChanged | ( | ) | [protected] |
Called when the cached stroke should be updated.
| bool DrawableShape::isStrokeVisible | ( | ) | const [protected] |
True if there's a stroke with a non-zero thickness and non-transparent colour.
| void DrawableShape::refreshFillTypes | ( | const FillAndStrokeState & | newState, |
| ComponentBuilder::ImageProvider * | |||
| ) | [protected] |
Updates the details from a FillAndStrokeState object, returning true if something changed.
| void DrawableShape::writeTo | ( | FillAndStrokeState & | state, |
| ComponentBuilder::ImageProvider * | , | ||
| UndoManager * | |||
| ) | const [protected] |
Writes the stroke and fill details to a FillAndStrokeState object.
PathStrokeType DrawableShape::strokeType [protected] |
Path DrawableShape::path [protected] |
Path DrawableShape::strokePath [protected] |