Classes | Public Member Functions | Static Public Attributes

DrawableComposite Class Reference

A drawable object which acts as a container for a set of other Drawables. More...

Inherits Drawable.

List of all members.

Classes

class  ValueTreeWrapper
 Internally-used class for wrapping a DrawableComposite's state into a ValueTree. More...

Public Member Functions

 DrawableComposite ()
 Creates a composite Drawable.
 DrawableComposite (const DrawableComposite &other)
 Creates a copy of a DrawableComposite.
 ~DrawableComposite ()
 Destructor.
void setBoundingBox (const RelativeParallelogram &newBoundingBox)
 Sets the parallelogram that defines the target position of the content rectangle when the drawable is rendered.
const RelativeParallelogramgetBoundingBox () const noexcept
 Returns the parallelogram that defines the target position of the content rectangle when the drawable is rendered.
void resetBoundingBoxToContentArea ()
 Changes the bounding box transform to match the content area, so that any sub-items will be drawn at their untransformed positions.
RelativeRectangle getContentArea () const
 Returns the main content rectangle.
void setContentArea (const RelativeRectangle &newArea)
 Changes the main content area.
void resetContentAreaAndBoundingBoxToFitChildren ()
 Resets the content area and the bounding transform to fit around the area occupied by the child components (ignoring any markers).
DrawablecreateCopy () const
 Creates a deep copy of this Drawable object.
void refreshFromValueTree (const ValueTree &tree, ComponentBuilder &builder)
ValueTree createValueTree (ComponentBuilder::ImageProvider *imageProvider) const
 Creates a ValueTree to represent this Drawable.
Rectangle< float > getDrawableBounds () const
 Returns the area that this drawble covers.
void childBoundsChanged (Component *)
 Called when one of this component's children is moved or resized.
void childrenChanged ()
 Subclasses can use this callback to be told when children are added or removed.
void parentHierarchyChanged ()
 Called to indicate that the component's parents have changed.
MarkerListgetMarkers (bool xAxis)
 Components can implement this method to provide a MarkerList.

Static Public Attributes

static const char *const contentLeftMarkerName
 The name of the marker that defines the left edge of the content area.
static const char *const contentRightMarkerName
 The name of the marker that defines the right edge of the content area.
static const char *const contentTopMarkerName
 The name of the marker that defines the top edge of the content area.
static const char *const contentBottomMarkerName
 The name of the marker that defines the bottom edge of the content area.
static const Identifier valueTreeType

Detailed Description

A drawable object which acts as a container for a set of other Drawables.

See also:
Drawable

Constructor & Destructor Documentation

DrawableComposite::DrawableComposite (  )

Creates a composite Drawable.

DrawableComposite::DrawableComposite ( const DrawableComposite other )

Creates a copy of a DrawableComposite.

DrawableComposite::~DrawableComposite (  )

Destructor.


Member Function Documentation

void DrawableComposite::setBoundingBox ( const RelativeParallelogram newBoundingBox )

Sets the parallelogram that defines the target position of the content rectangle when the drawable is rendered.

See also:
setContentArea
const RelativeParallelogram& DrawableComposite::getBoundingBox (  ) const

Returns the parallelogram that defines the target position of the content rectangle when the drawable is rendered.

See also:
setBoundingBox
void DrawableComposite::resetBoundingBoxToContentArea (  )

Changes the bounding box transform to match the content area, so that any sub-items will be drawn at their untransformed positions.

RelativeRectangle DrawableComposite::getContentArea (  ) const

Returns the main content rectangle.

The content area is actually defined by the markers named "left", "right", "top" and "bottom", but this method is a shortcut that returns them all at once.

See also:
contentLeftMarkerName, contentRightMarkerName, contentTopMarkerName, contentBottomMarkerName
void DrawableComposite::setContentArea ( const RelativeRectangle newArea )

Changes the main content area.

The content area is actually defined by the markers named "left", "right", "top" and "bottom", but this method is a shortcut that sets them all at once.

See also:
setBoundingBox, contentLeftMarkerName, contentRightMarkerName, contentTopMarkerName, contentBottomMarkerName
void DrawableComposite::resetContentAreaAndBoundingBoxToFitChildren (  )

Resets the content area and the bounding transform to fit around the area occupied by the child components (ignoring any markers).

Drawable* DrawableComposite::createCopy (  ) const [virtual]

Creates a deep copy of this Drawable object.

Use this to create a new copy of this and any sub-objects in the tree.

Implements Drawable.

void DrawableComposite::refreshFromValueTree ( const ValueTree tree,
ComponentBuilder builder 
)
ValueTree DrawableComposite::createValueTree ( ComponentBuilder::ImageProvider imageProvider ) const [virtual]

Creates a ValueTree to represent this Drawable.

The ValueTree that is returned can be turned back into a Drawable with createFromValueTree(). If there are any images used in this drawable, you'll need to provide a valid ImageProvider object that can be used to create storable representations of them.

Implements Drawable.

Rectangle<float> DrawableComposite::getDrawableBounds (  ) const [virtual]

Returns the area that this drawble covers.

The result is expressed in this drawable's own coordinate space, and does not take into account any transforms that may be applied to the component.

Implements Drawable.

void DrawableComposite::childBoundsChanged ( Component child ) [virtual]

Called when one of this component's children is moved or resized.

If the parent wants to know about changes to its immediate children (not to children of its children), this is the method to override.

See also:
moved, resized, parentSizeChanged

Reimplemented from Component.

void DrawableComposite::childrenChanged (  ) [virtual]

Subclasses can use this callback to be told when children are added or removed.

See also:
parentHierarchyChanged

Reimplemented from Component.

void DrawableComposite::parentHierarchyChanged (  ) [virtual]

Called to indicate that the component's parents have changed.

When a component is added or removed from its parent, this method will be called on all of its children (recursively - so all children of its children will also be called as well).

Subclasses can override this if they need to react to this in some way.

See also:
getParentComponent, isShowing, ComponentListener::componentParentHierarchyChanged

Reimplemented from Drawable.

MarkerList* DrawableComposite::getMarkers ( bool  xAxis ) [virtual]

Components can implement this method to provide a MarkerList.

The default implementation of this method returns 0, but you can override it to return a pointer to the component's marker list. If xAxis is true, it should return the X marker list; if false, it should return the Y markers.

Reimplemented from Component.


Member Data Documentation

const char* const DrawableComposite::contentLeftMarkerName [static]

The name of the marker that defines the left edge of the content area.

const char* const DrawableComposite::contentRightMarkerName [static]

The name of the marker that defines the right edge of the content area.

const char* const DrawableComposite::contentTopMarkerName [static]

The name of the marker that defines the top edge of the content area.

const char* const DrawableComposite::contentBottomMarkerName [static]

The name of the marker that defines the bottom edge of the content area.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines