Packageindex Classtrees Modulegroups Elementlist Report XML Files

pc4p

pc4p_object

pc4p_object

private class pc4p_object

In this object, the general object-handling functions and variables are defined. As this is the superclass for the other objects, all functions and variables here can be overwritten.

AuthorsAlexander Wirtz <alex@pc4p.net>
Version$Id: pc4p_object.html,v 1.17.2.1 2002/08/12 22:47:08 eru Exp $

 
Direct known subclasses: pc4p_box, pc4p_image, pc4p_line, pc4p_text, pc4p_table

Public Method Summary

void pc4p_object(object pc4p_page &$parent)
pc4p_object constructor
void pc4p_set_rot(float $phi)
Sets the rotation for the object
void pc4p_set_margin(mixed $margin)
Sets the margins for the object
void pc4p_set_width(mixed $width)
Sets the width for the object
void pc4p_set_alignment([ string $alignment ])
Sets the alignment for this object.
void pc4p_set_textleading(integer $leading)
Sets the textleading for text-subobjects.
void pc4p_set_linecolor(string $linecolor)
Sets the color of the lines in this objects.
void pc4p_set_fillcolor(string $fillcolor)
Sets the color for a fill of this objects.

Private Method Summary

array pc4p_calc_rot(float $x, float $y, float $phi)
Calculates the new coordinates after a rotation
array pc4p_calc_rot_dim(float $width, float $height, float $phi)
Calculates the new dimensions after a rotation
object pc4p_object pc4p_make_objcopy(object pc4p_object $object)
Makes a real copy from an object and all subobjects
void pc4p_draw()
Draw-function for the object
void pc4p_draw_children()
Draw-children-function for the object
integer pc4p_calc_offset(object pc4p_page &$parent)
Calls the calc_offset function in all children, sets its own offsets

Private Field Summary

array $children
Array of all children of this object
integer $pdfp
PDF-Pointer used for all pdf_*
object pc4p_main $pdfobj
The main PDF-Object
integer $pagewidth
Width of the page the object is on
integer $pageheight
Height of the page the object is on
integer $width
Width of the object
integer $height
Height of the object
array $margin
Margins for the object
integer $act_x
x-Pos where the object is placed
integer $act_y
y-Pos where the object is placed
integer $draw_x
x-Pos used when calculating the positions of subobjects
integer $draw_y
y-Pos used when calculating the positions of subobjects
string $alignment
Alignment for the object
float $phi
Rotation for the object
integer $leading
Text-Leading
array $linecolor
Linecolor
string $fillcolor
Fillcolor

Public Method Details

pc4p_object

public void pc4p_object(object pc4p_page &$parent)

  Checks, if we have a valid parent

Parameter
object pc4p_page &$parent
Valid values are pc4p_page, pc4p_box, pc4p_table and pc4p_object
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_rot

public void pc4p_set_rot(float $phi)

  Accepts an angle, so that the object can be rotated

Parameter
float $phi
Angle for the rotation
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_margin

public void pc4p_set_margin(mixed $margin)

  As opposed to a page, here the margins are on the _inside_ the object. The array should look like array( "top" => top, "bottom" => bottom, "left" => left, "right" => right )

Parameter
mixed $margin
Array containing the margins for the object or an integer to set all margins
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_width

public void pc4p_set_width(mixed $width)

  You can set a default width for an object

Parameter
mixed $width
Width for the object
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_alignment

public void pc4p_set_alignment([ string $alignment ])

  The same functionality as in every other document-software

Parameter
string $alignment = >>"left"<<
Valid values are "left", "center" and "right"
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_textleading

public void pc4p_set_textleading(integer $leading)

  You can define a spacing between each line of text

Parameter
integer $leading
Please use reasonable values, according to the fontsize
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_linecolor

public void pc4p_set_linecolor(string $linecolor)

  You can define a linecolor here or reset the linecolor to default, if you don't give a parameter

Parameter
string $linecolor
You can use one of the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_main::pc4p_check_color()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_fillcolor

public void pc4p_set_fillcolor(string $fillcolor)

  You can define a fillcolor here or reset the fillcolor to default, if you don't give a parameter

Parameter
string $fillcolor
You can use one of the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_main::pc4p_check_color()
Author(s) Alexander Wirtz <alex@pc4p.net>

Private Method Details

pc4p_calc_rot

private array pc4p_calc_rot(float $x, float $y, float $phi)

  Simple rotation for a matrix. Can be found in any general book about linear algebra.

Parameter
float $x
X-coordinate
float $y
Y-coordinate
float $phi
Angle for the rotation
Returns array $ret

Array containing the new [ "x" ] and [ "y" ]

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_rot_dim

private array pc4p_calc_rot_dim(float $width, float $height, float $phi)

  Uses pc4p_calc_rot to determine the new coordinates for every corner of the object. Then it determines the new dimensions after a rotation.

Parameter
float $width
Width of the object
float $height
Height of the object
float $phi
Angle for the rotation
Returns array $ret

Array containging the new [ "width" ] and [ "height" ]

See Also pc4p_object::pc4p_calc_rot()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_make_objcopy

private object pc4p_object pc4p_make_objcopy(object pc4p_object $object)

  This function is _ugly_ and I only wrote it to accomodate the perverse handling of references

Parameter
object pc4p_object $object
The object you want to copy
Returns object pc4p_object $copy

The copy of the object

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_draw

private void pc4p_draw()

  Calls the pc4p_draw_children

Returns void

See Also pc4p_object::pc4p_draw_children()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_draw_children

private void pc4p_draw_children()

  Calls the draw function for each child in the children-array

Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_offset

private integer pc4p_calc_offset(object pc4p_page &$parent)

  Checks for a already set width, watches for alignments

Parameter
object pc4p_page &$parent
Parent of the object
Returns integer $this

->height Calculated height of the object

Author(s) Alexander Wirtz <alex@pc4p.net>

Private Field Details

$children

private array $children

>>array()<<


$pdfp

private integer $pdfp

>><<


$pdfobj

private object pc4p_main $pdfobj

>><<


$pagewidth

private integer $pagewidth

>><<


$pageheight

private integer $pageheight

>><<


$width

private integer $width

>><<


$height

private integer $height

>><<


$margin

private array $margin

>>array( "top" => 0, "bottom" => 0, "left" => 0, "right" => 0 )<<


$act_x

private integer $act_x

>><<


$act_y

private integer $act_y

>><<


$draw_x

private integer $draw_x

>><<


$draw_y

private integer $draw_y

>><<


$alignment

private string $alignment

>>"left"<<


$phi

private float $phi

>><<


$leading

private integer $leading

>><<


$linecolor

private array $linecolor

>>array( 0, 0, 0 )<<


$fillcolor

private string $fillcolor

>>""<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Tue, 13 Aug 2002 00:43:10 +0200 by PHPDoc v1.5 www.phpdoc.de