]> git.llucax.com Git - mecon/meconlib.git/commitdiff
Se cambia el contructor y agrega funcionalidad.
authorLeandro Lucarella <llucax@gmail.com>
Tue, 1 Jul 2003 18:44:29 +0000 (18:44 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Tue, 1 Jul 2003 18:44:29 +0000 (18:44 +0000)
pear_lib_tmp/HTML/Image.php
pear_lib_tmp/HTML/Image/uml.xmi

index bb19f271eb2c6ed4cc2c1ce9daea6cb62c0ace9e..5c9df5b2f3fd827fe980c1db9482673a1e43a383 100644 (file)
 // $Id$
 //
 
 // $Id$
 //
 
-
 // +X2C includes
 require_once 'HTML/Common.php';
 // ~X2C
 
 // +X2C Class 214 :Image
 /**
 // +X2C includes
 require_once 'HTML/Common.php';
 // ~X2C
 
 // +X2C Class 214 :Image
 /**
+ * HTML Image representation.
+ *
  * @access public
  */
 class HTML_Image extends HTML_Common {
  * @access public
  */
 class HTML_Image extends HTML_Common {
+    /**
+     * List of valid HTML attributes for an Image.
+     *
+     * @var    array $validAttrs
+     * @access protected
+     */
+    var $_validAttrs = array('src', 'alt', 'longdesc', 'width', 'height', 'usemap', 'ismap', 'align', 'border', 'hspace', 'vspace', 'id', 'class', 'style', 'title', 'lang', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup');
+
     // ~X2C
 
     // ~X2C
 
+    // +X2C Operation 221
+    /**
+     * Constructor.
+     *
+     * @param  string $src Image location.
+     * @param  string $alt Alternate text.
+     * @param  array $attrs Other image attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function HTML_Image($src = '', $alt = '', $attrs = array())// ~X2C
+    {
+        $attrs['src'] = $src;
+        $attrs['alt'] = $alt;
+        parent::HTML_Common($attrs);
+    }
+    // -X2C
+
     // +X2C Operation 216
     /**
     // +X2C Operation 216
     /**
+     * Converts to HTML output.
+     *
      * @return string
      * @access public
      */
     function toHtml()// ~X2C
     {
         $attrs = '';
      * @return string
      * @access public
      */
     function toHtml()// ~X2C
     {
         $attrs = '';
-        foreach ($this->_attributes as $key => $val) {
+        foreach ($this->getAttributes() as $key => $val) {
             $attrs .= ' ' . $key . '="' . htmlentities($val) . '"';
         }
             $attrs .= ' ' . $key . '="' . htmlentities($val) . '"';
         }
-        return "<IMG$attrs>";
+        return "<IMG$attrs/>";
+    }
+    // -X2C
+
+    // +X2C Operation 217
+    /**
+     * Gets image location.
+     *
+     * @return string
+     * @access public
+     */
+    function getSrc()// ~X2C
+    {
+        return $this->getAttribute('src');
+    }
+    // -X2C
+
+    // +X2C Operation 218
+    /**
+     * Sets image location.
+     *
+     * @param  string $src Image location.
+     *
+     * @return void
+     * @access public
+     */
+    function setSrc($src)// ~X2C
+    {
+        $this->updateAttributes('src' => $src);
+    }
+    // -X2C
+
+    // +X2C Operation 219
+    /**
+     * Gets image alternate text.
+     *
+     * @return string
+     * @access public
+     */
+    function getAlt()// ~X2C
+    {
+        return $this->getAttribute('alt');
+    }
+    // -X2C
+
+    // +X2C Operation 220
+    /**
+     * Sets image alternate text.
+     *
+     * @param  string $alt Alternate text.
+     *
+     * @return void
+     * @access public
+     */
+    function setAlt($alt)// ~X2C
+    {
+        $this->updateAttributes('alt' => $alt);
     }
     // -X2C
 
 } // -X2C Class :Image
     }
     // -X2C
 
 } // -X2C Class :Image
+
 ?>
 ?>
index 31cabfa4fe4fa722f2ed91ba73dffadbf3a78b9b..a2ea2dcc160333724459c74502bf9e4001d382e3 100644 (file)
@@ -9,25 +9,39 @@
   <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
  </XMI.header>
  <XMI.content>
   <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
  </XMI.header>
  <XMI.content>
-  <docsettings viewid="213" documentation="" uniqueid="216" />
+  <docsettings viewid="213" documentation="" uniqueid="223" />
   <umlobjects>
   <umlobjects>
-   <UML:Class stereotype="" package="HTML" xmi.id="214" abstract="0" documentation="" name="Image" static="0" scope="200" >
-    <UML:Operation stereotype="" package="" xmi.id="216" type="string" abstract="0" documentation="" name="toHtml" static="0" scope="200" />
+   <UML:Class stereotype="" package="HTML" xmi.id="214" abstract="0" documentation="HTML Image representation." name="Image" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="221" type="void" abstract="0" documentation="Constructor." name="HTML_Image" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="''" type="string" abstract="0" documentation="Image location." name="src" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="''" type="string" abstract="0" documentation="Alternate text." name="alt" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="array()" type="array" abstract="0" documentation="Other image attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="216" type="string" abstract="0" documentation="Converts to HTML output." name="toHtml" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="217" type="string" abstract="0" documentation="Gets image location." name="getSrc" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="218" type="void" abstract="0" documentation="Sets image location." name="setSrc" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Image location." name="src" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="219" type="string" abstract="0" documentation="Gets image alternate text." name="getAlt" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="220" type="void" abstract="0" documentation="Sets image alternate text." name="setAlt" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Alternate text." name="alt" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="223" value="array('src', 'alt', 'longdesc', 'width', 'height', 'usemap', 'ismap', 'align', 'border', 'hspace', 'vspace', 'id', 'class', 'style', 'title', 'lang', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup')" type="array" abstract="0" documentation="List of valid HTML attributes for an Image." name="validAttrs" static="0" scope="202" />
    </UML:Class>
    <UML:Class stereotype="" package="HTML" xmi.id="215" abstract="0" documentation="x2c:extern" name="Common" static="0" scope="200" />
   </umlobjects>
   <diagrams>
    </UML:Class>
    <UML:Class stereotype="" package="HTML" xmi.id="215" abstract="0" documentation="x2c:extern" name="Common" static="0" scope="200" />
   </umlobjects>
   <diagrams>
-   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="213" documentation="" type="402" showops="1" showpackage="0" name="class diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
+   <diagram snapgrid="0" showattsig="0" fillcolor="#ffffc0" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="213" documentation="" type="402" showops="1" showpackage="0" name="class diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
     <widgets>
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="154" showattsigs="601" usesdiagramusefillcolour="0" x="93" linecolour="#ff0000" y="149" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="52" usefillcolor="1" showattributes="1" xmi.id="214" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="84" showattsigs="601" usesdiagramusefillcolour="0" x="128" linecolour="#ff0000" y="38" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="41" usefillcolor="1" showattributes="1" xmi.id="215" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="588" showattsigs="600" usesdiagramusefillcolour="0" x="34" linecolour="#ff0000" y="167" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="168" usefillcolor="1" showattributes="1" xmi.id="214" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="84" showattsigs="600" usesdiagramusefillcolour="0" x="286" linecolour="#ff0000" y="38" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="31" usefillcolor="1" showattributes="0" xmi.id="215" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
     </widgets>
     <messages/>
     <associations>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="215" widgetaid="214" documentation="" type="500" >
       <linepath>
     </widgets>
     <messages/>
     <associations>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="215" widgetaid="214" documentation="" type="500" >
       <linepath>
-       <startpoint startx="170" starty="149" />
-       <endpoint endx="170" endy="79" />
+       <startpoint startx="328" starty="167" />
+       <endpoint endx="328" endy="69" />
       </linepath>
      </UML:AssocWidget>
     </associations>
       </linepath>
      </UML:AssocWidget>
     </associations>
      <listitem open="0" type="807" id="213" label="class diagram" />
      <listitem open="1" type="813" id="215" label="Common" />
      <listitem open="1" type="813" id="214" label="Image" >
      <listitem open="0" type="807" id="213" label="class diagram" />
      <listitem open="1" type="813" id="215" label="Common" />
      <listitem open="1" type="813" id="214" label="Image" >
+      <listitem open="0" type="815" id="219" label="getAlt" />
+      <listitem open="0" type="815" id="217" label="getSrc" />
+      <listitem open="0" type="815" id="221" label="HTML_Image" />
+      <listitem open="0" type="815" id="220" label="setAlt" />
+      <listitem open="0" type="815" id="218" label="setSrc" />
       <listitem open="0" type="815" id="216" label="toHtml" />
       <listitem open="0" type="815" id="216" label="toHtml" />
+      <listitem open="0" type="814" id="223" label="validAttrs" />
      </listitem>
     </listitem>
     <listitem open="1" type="802" id="-1" label="Use Case View" />
      </listitem>
     </listitem>
     <listitem open="1" type="802" id="-1" label="Use Case View" />