NAME
Graphics::Primitive::Component
DESCRIPTION
A Component is an entity with a graphical representation. This class implements Layout::Manager::Component for use with a layout manager.
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.
- draw
-
Method to actually draw this component. This is an empty sub and is meant to be overriden by a specific implemntation.
- inside_bounding_box
-
Returns a Rectangle that defines the edges of the 'inside' box for this 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.
- 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.
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.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.