19 require_once(BASE.
"wcmf/lib/output/class.ImageOutputStrategy.php");
45 $this->_labelDim[
'left'] = -10;
46 $this->_labelDim[
'top'] = -10;
47 $this->_labelDim[
'right'] = 80;
48 $this->_labelDim[
'bottom'] = 45;
50 $this->_textPos[
'left'] = -5;
51 $this->_textPos[
'top'] = -8;
60 $color = ImageColorAllocate($this->_img,0,150,0);
62 new Position($this->_border+10, $this->_border+10, 0), $this->_bgColor, $color);
63 ImageString($this->_img,1, $this->_border+20, $this->_border+2,
"optional", $color);
66 new Position($this->_border+10, $this->_border+30, 0), $this->_bgColor, $color);
67 ImageString($this->_img,1, $this->_border+20, $this->_border+22,
"required", $color);
68 $color = ImageColorAllocate($this->_img,150,150,150);
71 new Position($this->_border+10+2*$i, $this->_border+50+2*$i, 0), $this->_bgColor, $color);
72 ImageString($this->_img,1, $this->_border+20, $this->_border+42,
"repetitive", $color);
81 if (!strstr($obj->getType(),
'->'))
83 $smallText = $obj->getType();
84 $bigText = $properties[
'oid'];
89 $smallText = substr ($obj->getType(), 0, strrpos ($obj->getType(),
":"));
90 $bigText = substr (strrchr ($obj->getType(),
":"), 1);
91 $color = ImageColorAllocate($this->_img,150,150,150);
94 $oid = $obj->getOID();
95 $x = $this->_map[$oid]->x * $this->_xscale - $this->_labelDim[
'left'] +
$this->_border;
96 $y = $this->_map[$oid]->y * $this->_yscale - $this->_labelDim[
'top'] +
$this->_border;
98 if ($obj->getProperty(
'minOccurs') == 0)
100 $color = ImageColorAllocate($this->_img,0,150,0);
104 if ($obj->getProperty(
'maxOccurs') ==
'unbounded' || $obj->getProperty(
'maxOccurs') > 1)
108 new Position($x + $this->_labelDim[
'right']+5*$i, $y + $this->_labelDim[
'bottom']+5*$i, 0),
113 new Position($x + $this->_labelDim[
'right'], $y + $this->_labelDim[
'bottom'], 0),
114 $this->_bgColor, $color);
116 ImageString($this->_img,2,
117 $x + $this->_textPos[
'left'],
118 $y + $this->_textPos[
'top'],
121 ImageString($this->_img,1,
122 $x + $this->_textPos[
'left'],
123 $y + $this->_textPos[
'top']+15,
124 "E: ".$properties[
'data_type'],
129 if (is_array($attribs))
131 foreach ($attribs as $attrib)
133 ImageString($this->_img,1,
134 $x + $this->_textPos[
'left'],
135 $y + $this->_textPos[
'top']+25+10*$i,
141 ImageString($this->_img,45,
142 $x + $this->_textPos[
'left']+65,
143 $y + $this->_textPos[
'top']+37,
148 $parent = & $obj->getParent();
153 if ($this->_usemap !=
'')
155 echo
'<area shape="rect" coords="'.
156 ($x + $this->_labelDim[
'left']).
','.
157 ($y + $this->_labelDim[
'top']).
','.
158 ($x + $this->_labelDim[
'right']).
','.
159 ($y + $this->_labelDim[
'bottom'] + 8*$this->_map[$oid]->z).
160 '" onclick="javascript:alert(\'Node OID: '.$obj->getOID().
'\')
" alt="'.$obj->getOID().'">'."\n
";
163 function writeFilledBorderedRect($topleft, $bottomright, $bgcolor, $bordercolor)
165 ImageFilledRectangle($this->_img, $topleft->x, $topleft->y, $bottomright->x, $bottomright->y, $bgcolor);
166 ImageRectangle($this->_img, $topleft->x, $topleft->y, $bottomright->x, $bottomright->y, $bordercolor);
This OutputStrategy outputs a tree of objects into an image file. It must be configured with a map th...
ImageOutputStrategy($format, $file, $map, $lineType=LINETYPE_DIRECT, $scale=100, $aspect=0.5, $border=50, $usemap='')
writeFilledBorderedRect($topleft, $bottomright, $bgcolor, $bordercolor)
This OutputStrategy outputs a tree of objects into an image file. It must be configured with a map th...
The Position class stores a coordinate tuple for use with the LayoutVisitor.
ElementImageOutputStrategy($format, $file, $map, $lineType=LINETYPE_DIRECT, $scale=100, $aspect=0.5, $border=50, $usemap='')
drawConnectionLine($poid, $oid)