Subversion Repositories general

Rev

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

PK
Âfê. META-INF/þÊPK
Âfê.ñÍ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
@eê./’êöÎÎ7src/plugins/regionEditorPlugin/RegionEditorPlugin.classÊþº¾-q1src/plugins/regionEditorPlugin/RegionEditorPluginjavax/swing/JPanelsrc/gui/PluginInterfaceguiLsrc/gui/GuiInterface;labelLjavax/swing/JLabel;<init>()VCode
javax/swing/JLabeldummy RegionEditorPlugin(Ljava/lang/String;)V
  
        java/awt/BorderLayout
java/awt/Container  setLayout(Ljava/awt/LayoutManager;)V
 Center"add)(Ljava/awt/Component;Ljava/lang/Object;)V$%
&javax/swing/JComponent(
setVisible(Z)V*+
),java/lang/System.outLjava/io/PrintStream;01   /23I'm a new instance of the dummy RegionEditorPlugin!4java/io/PrintStream6println8
79LineNumberTableLocalVariableTablethis3Lsrc/plugins/regionEditorPlugin/RegionEditorPlugin;init(Lsrc/gui/GuiInterface;)V        Asrc/gui/GuiInterfaceCsetPluginPanel(Ljavax/swing/JPanel;)VEFDG$dummy RegionEditorPlugin initializedIstart.(Lorg/w3c/dom/Element;Lorg/w3c/dom/Document;)Vjava/lang/StringBufferMgetText()Ljava/lang/String;OP
Qjava/lang/StringSvalueOf&(Ljava/lang/Object;)Ljava/lang/String;UV
TW
N: Zappend,(Ljava/lang/String;)Ljava/lang/StringBuffer;\]
N^java/lang/Object`toStringbP
ac
NcsetTextf
gelementLorg/w3c/dom/Element;environmentLorg/w3c/dom/Document;stopforceStatusReport
SourceFileRegionEditorPlugin.java!     

v4*·*»Y·µ*»Y·¶!**´#¶'*¶-²35¶:±;& +"3#<4=>?@
U*+µB+*¹H²3J¶:±;*+-.<=>KL
s-*´»NY*´¶R¸X·Y[¶_+¶d¶_¶e¶h*¶-±;5'6,7< -=>-ij-klm
4*¶-±;
>?<=>n
+±;G<=>opPK
=eê.c|%ÌÌ6src/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;

import java.awt.*;
import javax.swing.*;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import src.gui.*;


/**
 * dummy plugin used for testing
 */
public class RegionEditorPlugin extends JPanel
                                                                implements PluginInterface {
        
        private GuiInterface gui;
        private JLabel label = new JLabel("dummy RegionEditorPlugin");


        public RegionEditorPlugin() {
                setLayout(new BorderLayout());
                add(label, BorderLayout.CENTER);
                setVisible(false);

                System.out.println("I'm a new instance of the dummy RegionEditorPlugin!");
        }
        

        /* (non-Javadoc)
         * @see src.gui.PluginInterface#init(src.gui.GuiInterface)
         */
        public void init(GuiInterface gui) {
                this.gui = gui;
                gui.setPluginPanel(this);

                System.out.println("dummy RegionEditorPlugin initialized");
        }


        /* (non-Javadoc)
         * @see src.gui.PluginInterface#start(org.w3c.dom.Element, org.w3c.dom.Document)
         */
        public void start(Element element, Document environment) {
                label.setText(label.getText() + ": " + element.toString());
                setVisible(true);
        }


        /* (non-Javadoc)
         * @see src.gui.PluginInterface#stop()
         */
        public void stop() {
                setVisible(false);
        }


        /* (non-Javadoc)
         * @see src.gui.PluginInterface#forceStatusReport()
         */
        public void forceStatusReport() {
                //we must call method 'firePluginChangedNode'
        }

}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

Âfê. META-INF/þÊPK

Âfê.ñÍSºMM+META-INF/MANIFEST.MFPK

@eê./’êöÎÎ7ªsrc/plugins/regionEditorPlugin/RegionEditorPlugin.classPK

=eê.c|%ÌÌ6Ísrc/plugins/regionEditorPlugin/RegionEditorPlugin.javaPK

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

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