JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Member Functions | Protected Member Functions | Protected Attributes
DrawableShape Class Reference

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.

List of all members.

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 RelativeFillTypegetFill () 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 RelativeFillTypegetStrokeFill () 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 PathStrokeTypegetStrokeType () 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

Detailed Description

A base class implementing common functionality for Drawable classes which consist of some kind of filled and stroked outline.

See also:
DrawablePath, DrawableRectangle

Constructor & Destructor Documentation

DrawableShape::DrawableShape ( const DrawableShape ) [protected]

Destructor.


Member Function Documentation

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.

See also:
setPath, setStrokeFill
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.

See also:
setPath, setStrokeFill

Returns the current fill type.

See also:
setFill
void DrawableShape::setStrokeFill ( const FillType newStrokeFill)

Sets the fill type with which the outline will be drawn.

See also:
setFill
void DrawableShape::setStrokeFill ( const RelativeFillType newStrokeFill)

Sets the fill type with which the outline will be drawn.

See also:
setFill

Returns the current stroke fill.

See also:
setStrokeFill
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.

See also:
setStrokeThickness, setStrokeColour
void DrawableShape::setStrokeThickness ( float  newThickness)

Changes the stroke thickness.

This is a shortcut for calling setStrokeType.

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.

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.


Member Data Documentation


The documentation for this class was generated from the following file: