Subversion Repositories general

Rev

Rev 240 | Blame | Last modification | View Log | RSS feed

PK
Ê{ç. META-INF/þÊPK
Ê{ç.ñÍSºMMMETA-INF/MANIFEST.MFManifest-Version: 1.0
Comment: you can set named regions on pictures
Transform-To-File: src/plugins/regionEditorPlugin/RegionEditorPluginTr
 ansform.xsl
Created-By: 1.4.0 (Sun Microsystems Inc.)
Description: ...(todo)
XMLEditor-Plugin-Name: RegionEditor
Class-Path: ImagePlugin.jar
Transform-Fro-File: src/plugins/regionEditorPlugin/RegionEditorPluginT
 ransformBack.xsl
Main-Class: src.plugins.regionEditorPlugin.RegionEditorPlugin

Name: src/plugins/regionEditorPlugin
Specification-Version: 0.4 (05/07/03)
Specification-Title: plugin for XMLEditor
Implementation-Version: 0.1 (05/07/03)
Implementation-Title: src.plugins.regionEditorPlugin
Implementation-Vendor: group5, software practice SS_2003, University B
 ielefeld, Germany
Specification-Vendor: group5, software practice SS_2003, University Bi
 elefeld, Germany

PK
´cç.n,@¯––7src/plugins/regionEditorPlugin/RegionEditorPlugin.classÊþº¾-"1src/plugins/regionEditorPlugin/RegionEditorPluginjava/lang/Object<init>()VCode
LineNumberTableLocalVariableTablethis3Lsrc/plugins/regionEditorPlugin/RegionEditorPlugin;main([Ljava/lang/String;)Vjava/lang/SystemoutLjava/io/PrintStream;       6This is the main method of a dummy RegionEditor pluginjava/io/PrintStreamprintln(Ljava/lang/String;)V
args[Ljava/lang/String;
SourceFileRegionEditorPlugin.java!/*·      ±

   7     ²¶±

    !PK
]ç.w6src/plugins/regionEditorPlugin/RegionEditorPlugin.java/*
* software practice
* ss_2003
* group project: XML-Editor
* $Id: RegionEditorPlugin.java,v 1.1 2003/07/07 09:44:33 swalkenh Exp $
*/

package src.plugins.regionEditorPlugin;


/**
 * dummy plugin used for testing
 */
public class RegionEditorPlugin {
        
        public static void main(String[] args) {
                System.out.println("This is the main method of a dummy RegionEditor plugin");
        }

}PK
]ç.r}‚ÈÈ>src/plugins/regionEditorPlugin/RegionEditorPluginTransform.xsl<!-- status: first working for regioneditor -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />

<!-- these parameters can be given from outside -->
<xsl:param name="input">/</xsl:param><!-- eg. /XMLEDITORCONFIGURATION/DEFAULTPLUGIN -->
<xsl:param name="elementnamenew">standardplugin</xsl:param>

<xsl:template match="/">
        <xsl:variable name="levelremaining" select="substring-after($input, '/')" />

        <xsl:message><xsl:value-of select="concat('outside-parameter input: ', $input)"/></xsl:message>
        <xsl:message><xsl:value-of select="concat('outside-parameter elementnamenew: ', $elementnamenew)"/></xsl:message>

        <xsl:for-each select="node()">
                <xsl:call-template name="selecter">
                        <xsl:with-param name="levelremaining" select="$levelremaining" />
                </xsl:call-template>
        </xsl:for-each>
</xsl:template>

<xsl:template name="selecter">
        <xsl:param name="levelremaining" />
        <xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
        <xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
        
        <!-- if this node belongs to the right path
             then work on childs with the selecter -->
        <xsl:if test = "(name() = $level)">
                <xsl:message>selecter-case: belongs to right path</xsl:message>
                <xsl:element name="name()">
                
                        <!-- if this is the last level this is the node which must be converted
                             then convert the node -->
                        <xsl:if test = "( ('' = $nextlevels) 
                                      and not('' = name()) )"><!-- avoid too many tags from matcher -->
                                <xsl:message>selecter-case: last level</xsl:message>
                                <xsl:apply-templates select="self::node()">
                                </xsl:apply-templates>
                        </xsl:if>
                        <!-- else (if there are levels left) work on childs -->
                        <xsl:if test = "not('' = $nextlevels)">
                                <xsl:message>selecter-case: levels left</xsl:message>
                                <xsl:copy>
                                        <xsl:for-each select="attribute::*">
                                                <xsl:attribute name="{name(.)}">
                                                        <xsl:value-of select="self::node()" />
                                                </xsl:attribute>
                                        </xsl:for-each>
                                        <xsl:for-each select="node()">
                                                <xsl:call-template name="selecter">
                                                        <xsl:with-param name="levelremaining" select="$nextlevels" />
                                                </xsl:call-template>
                                        </xsl:for-each>
                                </xsl:copy>
                        </xsl:if>
                </xsl:element>
        </xsl:if>
        <!-- else simply copy the node with childs -->
        <xsl:if test = "not(name() = $level)">
                <xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
                <xsl:copy-of select="self::node()" />
        </xsl:if>
</xsl:template>

<xsl:template match="Regionensatz"><!-- element-plugin association -->
        <xsl:element name="REGIONSET">

                <!-- work on attributes -->
                <xsl:attribute name="image">
                        <xsl:value-of select="@Bild" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('Bild'))">
                                <xsl:attribute name="{name(.)}">
                                        <xsl:value-of select="self::node()" />
                                </xsl:attribute>
                        </xsl:if>
                </xsl:for-each>

                <!-- work on childs -->
                <xsl:for-each select="Bereich">
                        <xsl:element name="RECT">
                                <xsl:attribute name="x">
                                        <xsl:value-of select="@x" />
                                </xsl:attribute>
                                <xsl:attribute name="y">
                                        <xsl:value-of select="@y" />
                                </xsl:attribute>
                                <xsl:attribute name="b">
                                        <xsl:value-of select="@Breite" />
                                </xsl:attribute>
                                <xsl:attribute name="h">
                                        <xsl:value-of select="@Hoehe" />
                                </xsl:attribute>
                                <xsl:for-each select="attribute::*">
                                        <xsl:if test = "not(name(.) = 'x')">
                                        <xsl:if test = "not(name(.) = 'y')">
                                        <xsl:if test = "not(name(.) = 'Breite')">
                                        <xsl:if test = "not(name(.) = 'Hoehe')">
                                                <xsl:attribute name="{name(.)}">
                                                        <xsl:value-of select="self::node()" />
                                                </xsl:attribute>
                                        </xsl:if></xsl:if></xsl:if></xsl:if>
                                </xsl:for-each>
                                <xsl:for-each select="node()">
                                        <xsl:copy-of select="self::node()" />
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'Bereich')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if>
                </xsl:for-each>

        </xsl:element>
</xsl:template>

<xsl:template match="REGIONSET"><!-- element-plugin association -->
        <xsl:copy-of select="." />
</xsl:template>

</xsl:stylesheet>PK
]ç.ÕÚq{¹¹Bsrc/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xsl<!-- status: first try for regioneditor -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />

<!-- these parameters can be given from outside -->
<xsl:param name="input">/</xsl:param><!-- eg. /XMLEDITORCONFIGURATION/DEFAULTPLUGIN -->
<xsl:param name="elementnamenew">standardplugin</xsl:param>

<xsl:template match="/">
        <xsl:variable name="levelremaining" select="substring-after($input, '/')" />

        <xsl:message><xsl:value-of select="concat('outside-parameter input: ', $input)"/></xsl:message>
        <xsl:message><xsl:value-of select="concat('outside-parameter elementnamenew: ', $elementnamenew)"/></xsl:message>

        <xsl:for-each select="node()">
                <xsl:call-template name="selecter">
                        <xsl:with-param name="levelremaining" select="$levelremaining" />
                </xsl:call-template>
        </xsl:for-each>
</xsl:template>

<xsl:template name="selecter">
        <xsl:param name="levelremaining" />
        <xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
        <xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
        
        <!-- if this node belongs to the right path
             then work on childs with the selecter -->
        <xsl:if test = "(name() = $level)">
                <xsl:message>selecter-case: belongs to right path</xsl:message>
                <xsl:element name="name()">
                
                        <!-- if this is the last level this is the node which must be converted
                             then convert the node -->
                        <xsl:if test = "( ('' = $nextlevels) 
                                      and not('' = name()) )"><!-- avoid too many tags from matcher -->
                                <xsl:message>selecter-case: last level</xsl:message>
                                <xsl:apply-templates select="self::node()">
                                </xsl:apply-templates>
                        </xsl:if>
                        <!-- else (if there are levels left) work on childs -->
                        <xsl:if test = "not('' = $nextlevels)">
                                <xsl:message>selecter-case: levels left</xsl:message>
                                <xsl:copy>
                                        <xsl:for-each select="attribute::*">
                                                <xsl:attribute name="{name(.)}">
                                                        <xsl:value-of select="self::node()" />
                                                </xsl:attribute>
                                        </xsl:for-each>
                                        <xsl:for-each select="node()">
                                                <xsl:call-template name="selecter">
                                                        <xsl:with-param name="levelremaining" select="$nextlevels" />
                                                </xsl:call-template>
                                        </xsl:for-each>
                                </xsl:copy>
                        </xsl:if>
                </xsl:element>
        </xsl:if>
        <!-- else simply copy the node with childs -->
        <xsl:if test = "not(name() = $level)">
                <xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
                <xsl:copy-of select="self::node()" />
        </xsl:if>
</xsl:template>

<xsl:template match="REGIONSET"><!-- element-plugin association -->
        <xsl:element name="Regionensatz">

                <!-- work on attributes -->
                <xsl:attribute name="Bild">
                        <xsl:value-of select="@image" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('image'))">
                                <xsl:attribute name="{name(.)}">
                                        <xsl:value-of select="self::node()" />
                                </xsl:attribute>
                        </xsl:if>
                </xsl:for-each>

                <!-- work on childs -->
                <xsl:for-each select="RECT">
                        <xsl:element name="Bereich">
                                <xsl:attribute name="x">
                                        <xsl:value-of select="@x" />
                                </xsl:attribute>
                                <xsl:attribute name="y">
                                        <xsl:value-of select="@y" />
                                </xsl:attribute>
                                <xsl:attribute name="Breite">
                                        <xsl:value-of select="@b" />
                                </xsl:attribute>
                                <xsl:attribute name="Hoehe">
                                        <xsl:value-of select="@h" />
                                </xsl:attribute>
                                <xsl:for-each select="attribute::*">
                                        <xsl:if test = "not(name(.) = 'x')">
                                        <xsl:if test = "not(name(.) = 'y')">
                                        <xsl:if test = "not(name(.) = 'b')">
                                        <xsl:if test = "not(name(.) = 'h')">
                                                <xsl:attribute name="{name(.)}">
                                                        <xsl:value-of select="self::node()" />
                                                </xsl:attribute>
                                        </xsl:if></xsl:if></xsl:if></xsl:if>
                                </xsl:for-each>
                                <xsl:for-each select="node()">
                                        <xsl:copy-of select="self::node()" />
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'RECT')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if>
                </xsl:for-each>

        </xsl:element>
</xsl:template>

<xsl:template match="REGIONSET"><!-- element-plugin association -->
        <xsl:copy-of select="." />
</xsl:template>

</xsl:stylesheet>PK

Ê{ç. META-INF/þÊPK

Ê{ç.ñÍSºMM+META-INF/MANIFEST.MFPK

´cç.n,@¯––7ªsrc/plugins/regionEditorPlugin/RegionEditorPlugin.classPK

]ç.w6•src/plugins/regionEditorPlugin/RegionEditorPlugin.javaPK

]ç.r}‚ÈÈ>hsrc/plugins/regionEditorPlugin/RegionEditorPluginTransform.xslPK

]ç.ÕÚq{¹¹BŒsrc/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xslPK"¥*