Detailed Description

ImageOutputStrategy outputs a tree of objects into an image file.

It must be configured with a map that was calculated by a LayoutVisitor.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 23 of file ImageOutputStrategy.php.

+ Inheritance diagram for ImageOutputStrategy:

Public Member Functions

 __construct ($format, $file, $map, $lineType=self::LINETYPE_DIRECT, $scale=100, $aspect=0.5, $border=50, $usemap='')
 
 writeHeader ()
 
 writeFooter ()
 
 writeObject (PersistentObject $obj)
 

Public Attributes

const LINETYPE_DIRECT = 0
 
const LINETYPE_ROUTED = 1
 

Protected Member Functions

 drawConnectionLine ($poid, $oid)
 
 drawDirectLine ($start, $end)
 
 drawRoutedLine ($start, $end)
 

Protected Attributes

 $format = null
 
 $file = ''
 
 $map = null
 
 $img = null
 
 $width = 0
 
 $height = 0
 
 $scale = null
 
 $border = 0
 
 $bgColor = null
 
 $txtColor = null
 
 $lineColor = null
 
 $lineType = null
 
 $labelDim = null
 
 $textPos = null
 
 $usemap = ''
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $format,
  $file,
  $map,
  $lineType = self::LINETYPE_DIRECT,
  $scale = 100,
  $aspect = 0.5,
  $border = 50,
  $usemap = '' 
)

Constructor.

Parameters
$formatImage format name [IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP].
$fileThe output file name.
$mapThe position map provided by LayoutVisitor.
$lineTypeThe linetype to use [LINETYPE_DIRECT|LINETYPE_ROUTED] DEFAULT LINETYPE_DIRECT.
$scaleThe image scale DEFAULT 100.
$aspectThe image aspect DEFAULT 0.5.
$borderThe image border [px] DEFAULT 50.
$usemapName of the HTML ImageMap to write to stdout ['' means no map] DEFAULT ''.

Reimplemented in ElementImageOutputStrategy.

Definition at line 55 of file ImageOutputStrategy.php.

Member Function Documentation

◆ writeHeader()

writeHeader ( )
See also
OutputStrategy::writeHeader

Implements OutputStrategy.

Reimplemented in ElementImageOutputStrategy.

Definition at line 85 of file ImageOutputStrategy.php.

◆ writeFooter()

writeFooter ( )
See also
OutputStrategy::writeFooter

Implements OutputStrategy.

Definition at line 111 of file ImageOutputStrategy.php.

◆ writeObject()

writeObject ( PersistentObject  $obj)
See also
OutputStrategy::writeObject

Implements OutputStrategy.

Reimplemented in ElementImageOutputStrategy.

Definition at line 133 of file ImageOutputStrategy.php.

◆ drawConnectionLine()

drawConnectionLine (   $poid,
  $oid 
)
protected

Draw connection line.

Parameters
$poidThe parent object's object id.
$oidThe object's object id.

Definition at line 196 of file ImageOutputStrategy.php.

◆ drawDirectLine()

drawDirectLine (   $start,
  $end 
)
protected

Draw direct line.

Parameters
$startThe start point (Position).
$endThe end point (Position).

Definition at line 211 of file ImageOutputStrategy.php.

◆ drawRoutedLine()

drawRoutedLine (   $start,
  $end 
)
protected

Draw routed line.

Parameters
$startThe start point (Position).
$endThe end point (Position).

Definition at line 225 of file ImageOutputStrategy.php.

Member Data Documentation

◆ LINETYPE_DIRECT

const LINETYPE_DIRECT = 0

Definition at line 25 of file ImageOutputStrategy.php.

◆ LINETYPE_ROUTED

const LINETYPE_ROUTED = 1

Definition at line 26 of file ImageOutputStrategy.php.

◆ $format

$format = null
protected

Definition at line 28 of file ImageOutputStrategy.php.

◆ $file

$file = ''
protected

Definition at line 29 of file ImageOutputStrategy.php.

◆ $map

$map = null
protected

Definition at line 30 of file ImageOutputStrategy.php.

◆ $img

$img = null
protected

Definition at line 31 of file ImageOutputStrategy.php.

◆ $width

$width = 0
protected

Definition at line 32 of file ImageOutputStrategy.php.

◆ $height

$height = 0
protected

Definition at line 33 of file ImageOutputStrategy.php.

◆ $scale

$scale = null
protected

Definition at line 34 of file ImageOutputStrategy.php.

◆ $border

$border = 0
protected

Definition at line 35 of file ImageOutputStrategy.php.

◆ $bgColor

$bgColor = null
protected

Definition at line 36 of file ImageOutputStrategy.php.

◆ $txtColor

$txtColor = null
protected

Definition at line 37 of file ImageOutputStrategy.php.

◆ $lineColor

$lineColor = null
protected

Definition at line 38 of file ImageOutputStrategy.php.

◆ $lineType

$lineType = null
protected

Definition at line 39 of file ImageOutputStrategy.php.

◆ $labelDim

$labelDim = null
protected

Definition at line 40 of file ImageOutputStrategy.php.

◆ $textPos

$textPos = null
protected

Definition at line 41 of file ImageOutputStrategy.php.

◆ $usemap

$usemap = ''
protected

Definition at line 42 of file ImageOutputStrategy.php.