NAME

Graphics::Primitive::Component

DESCRIPTION

A Component is an entity with a graphical representation.

SYNOPSIS

my $c = Graphics::Primitive::Component->new({
  origin => Geometry::Primitive::Point->new({
      x => $x, y => $y
  }),
  width => 500, height => 350
});

METHODS

Constructor

new

Creates a new Component.

Instance Methods

background_color

Set this component's background color.

border

Set this component's border, which should be an instance of Border.

color

Set this component's foreground color.

height

Set this component's height.

inside_bounding_box

Returns a Rectangle that defines the edges of the 'inside' box for this component. This box is relative to the origin of the component.

inside_height

Get the height available in this container after taking away space for padding, margin and borders.

inside_width

Get the width available in this container after taking away space for padding, margin and borders.

margins

Set this component's margins, which should be an instance of Insets. Margins are the space outside the component's bounding box, as in CSS. The margins should be outside the border.

name

Set this component's name. This is not required, but may inform consumers of a component. Pay attention to that library's documentation.

origin

Set/Get the origin point for this component.

outside_height

Get the height consumed by padding, margin and borders.

outside_width

Get the width consumed by padding, margin and borders.

padding

Set this component's padding, which should be an instance of Insets. Padding is the space inside the component's bounding box, as in CSS. This padding should be between the border and the component's content.

prepare

Method to prepare this component for drawing. This is an empty sub and is meant to be overriden by a specific implemntation.

maximum_height

Set/Get this component's maximum height. Used to inform a layout manager.

item maximum_width

Set/Get this component's maximum width. Used to inform a layout manager.

item minimum_height

Set/Get this component's minimum height. Used to inform a layout manager.

item minimum_width

Set/Get this component's minimum width. Used to inform a layout manager.

preferred_height

Set/Get this component's preferred height. Used to inform a layout manager.

preferred_width

Set/Get this component's preferred width. Used to inform a layout manager.

visible

Set/Get this component's visible flag.

width

Set/Get this component's width.

AUTHOR

Cory Watson, <gphat@cpan.org>

Infinity Interactive, http://www.iinteractive.com

BUGS

Please report any bugs or feature requests to bug-geometry-primitive at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geometry-Primitive. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2008 by Infinity Interactive, Inc.

http://www.iinteractive.com

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.