Subversion Repositories general

Rev

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

PK
añ. META-INF/þÊPK
añ.ñÍ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
Òrñ.+PwÀ
À
7src/plugins/regionEditorPlugin/RegionEditorPlugin.classÊþº¾-‘1src/plugins/regionEditorPlugin/RegionEditorPluginjavax/swing/JPanelsrc/plugins/PluginInterface
pluginNameLjava/lang/String;
ConstantValueRegionEditor
guiLsrc/gui/GuiInterface;ourEventListenerLsrc/control/OurEventListener;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/JComponent1
setVisible(Z)V34
25java/lang/System7outLjava/io/PrintStream;9:   8;3I'm a new instance of the dummy RegionEditorPlugin!=java/io/PrintStream?printlnA
@BLineNumberTableLocalVariableTablethis3Lsrc/plugins/regionEditorPlugin/RegionEditorPlugin;init(Lsrc/gui/GuiInterface;)V
        J$dummy RegionEditorPlugin initializedLstart+(Lorg/w3c/dom/Node;Lorg/w3c/dom/Document;)Vjava/lang/StringBufferPgetText()Ljava/lang/String;RS
Tjava/lang/StringVvalueOf&(Ljava/lang/Object;)Ljava/lang/String;XY
WZ
Q: ]append,(Ljava/lang/String;)Ljava/lang/StringBuffer;_`
Qajava/lang/ObjectctoStringeS
df
QfsetTexti
jsrc/gui/GuiInterfacelsetPluginPanel(Ljavax/swing/JPanel;)VnompnodeLorg/w3c/dom/Node;environmentLorg/w3c/dom/Document;stopsetOurEventListener!(Lsrc/control/OurEventListener;)V    ynewListenerforceStatusReportfirePluginChangedElement-(Lorg/w3c/dom/Element;Lorg/w3c/dom/Element;)Vsrc/control/OurEvent([Ljava/lang/Object;)V
€‚src/control/OurEventListener„
firedOurEvent(Lsrc/control/OurEvent;)V†‡…ˆoldNodeLorg/w3c/dom/Element;changedElementeLsrc/control/OurEvent;
SourceFileRegionEditorPlugin.java!       
€:*·*µ*»Y·µ!*»#Y·$¶***´!,¶0*¶6²<>¶C±D"-&
*."/,01293E:FGHIJ*+µK²<M¶C±D:<
=EFG
NO7*´!»QY*´!¶U¸[·\^¶b+¶g¶b¶h¶k*´K*¹q*¶6±DD'H1I6JE 7FG7rs7tuv4*¶6±D
QREFGwx>*+µz±D
YZEFG{|+±DeEFG}~t$»€Y½dY+SY,SYS·ƒN*´z-¹‰±Dij#kE*$FG$Š‹$Œ‹ŽPK
B­ð.*eTmÒ
Ò
6src/plugins/regionEditorPlugin/RegionEditorPlugin.java/* 
 * This file contains the RegionEditorPlugin class.
 * 
 * Coded by: Group 5, software practice summer 2003
 * University of Bielefeld, Germany
 * 
 * @version $Revision: 1.13 $
 *
 * Last modification: $Date: 2003/07/16 19:42:05 $
 * $Id: RegionEditorPlugin.java,v 1.13 2003/07/16 19:42:05 smcsporr Exp $
 */

package src.plugins.regionEditorPlugin;

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;

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

import src.control.OurEvent;
import src.control.OurEventListener;

import src.gui.*;
import src.plugins.PluginInterface;

/**
 *  Dummy plugin used for testing
 */
// TODO JavaDoc comments
public class RegionEditorPlugin extends JPanel
                                                                implements PluginInterface {
        
        /* Name of the plugin, used in method <code>firePluginChangedElement</code> */
        final private String pluginName = "RegionEditor";
        
        private GuiInterface gui;
        private OurEventListener ourEventListener;
        private JLabel label = new JLabel("dummy RegionEditorPlugin");

        // TODO JavaDoc-comments
        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;

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


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

                //added 14.07.03 Sascha W. -> fixed problem of not visible plugins
                // (deleted this line in method "init"!)
                gui.setPluginPanel(this);
                setVisible(true);
        }


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


        /* (non-Javadoc)
         * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
         */
        public void setOurEventListener(OurEventListener newListener) {
                ourEventListener = newListener;
        }


        /**
         * Forces the text editor plugin to return the actual status as a node, 'cause
         * not well-formed parts have to be capsuled into a processing instruction.
         * 
         * @see src.gui.PluginInterface#forceStatusReport()
         */
        public void forceStatusReport() {
                //firePluginChangedElement(originalElement, originalElement);
        }
        
        // TODO JavaDoc-comments
        private void firePluginChangedElement(Element oldNode, Element changedElement) {
                OurEvent e = new OurEvent(new Object[] {oldNode, changedElement, pluginName});
                ourEventListener.firedOurEvent(e);
        }
}PK
º‰ñ.׿ä5ä5>src/plugins/regionEditorPlugin/RegionEditorPluginTransform.xsl<!-- to-direction for RegionEditor
     status: not tested, should be not so long
     updated to given schema from 15/07/2003 
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />


<xsl:template match="/">
        <xsl:apply-templates />
</xsl:template>


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

                <!-- work on attributes -->
                <!-- get information of used image out of attribute 'image' -->
                <xsl:attribute name="image">
                        <xsl:value-of select="@image" />
                </xsl:attribute>
                <!-- copy all other attributes -->
                <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 -->
                <!-- get information of used rectangle out of child 'RECTANGLE' -->
                <xsl:for-each select="RECTANGLE">
                        <xsl:element name="RECTANGLE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <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(.) = 'w')">
                                                        <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <xsl:for-each select="COORD_DATA">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="w">
                                                        <xsl:value-of select="@width" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@height" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x_pos')">
                                                        <xsl:if test = "not(name(.) = 'y_pos')">
                                                        <xsl:if test = "not(name(.) = 'width')">
                                                        <xsl:if test = "not(name(.) = 'height')">
                                                                <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                        <xsl:if test = "not(name(.) = 'COORD_DATA')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if></xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used ellipse out of child 'ELLIPSE' -->
                <xsl:for-each select="ELLIPSE">
                        <xsl:element name="ELLIPSE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@h" />
                                                </xsl:attribute>
                                                <xsl:attribute name="angle">
                                                        <xsl:value-of select="@angle" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                        <xsl:if test = "not(name(.) = 'w')">
                                                        <xsl:if test = "not(name(.) = 'h')">
                                                        <xsl:if test = "not(name(.) = 'angle')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </xsl:if></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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used polyline out of child 'POLYLINE' -->
                <xsl:for-each select="POLYLINE">
                        <xsl:element name="POLYLINE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- copy all other childs -->
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'RECTANGLE')">
                        <xsl:if test = "not(name(.) = 'ELLIPSE')">
                        <xsl:if test = "not(name(.) = 'POLYLINE')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if></xsl:if></xsl:if>
                </xsl:for-each>

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

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

                <!-- work on attributes -->
                <!-- get information of used image out of attribute 'image' -->
                <xsl:attribute name="image">
                        <xsl:value-of select="@image" />
                </xsl:attribute>
                <!-- copy all other attributes -->
                <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 -->
                <!-- get information of used rectangle out of child 'RECTANGLE' -->
                <xsl:for-each select="RECTANGLE">
                        <xsl:element name="RECTANGLE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <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(.) = 'w')">
                                                        <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <xsl:for-each select="COORD_DATA">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="w">
                                                        <xsl:value-of select="@width" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@height" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x_pos')">
                                                        <xsl:if test = "not(name(.) = 'y_pos')">
                                                        <xsl:if test = "not(name(.) = 'width')">
                                                        <xsl:if test = "not(name(.) = 'height')">
                                                                <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                        <xsl:if test = "not(name(.) = 'COORD_DATA')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if></xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used ellipse out of child 'ELLIPSE' -->
                <xsl:for-each select="ELLIPSE">
                        <xsl:element name="ELLIPSE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@h" />
                                                </xsl:attribute>
                                                <xsl:attribute name="angle">
                                                        <xsl:value-of select="@angle" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                        <xsl:if test = "not(name(.) = 'w')">
                                                        <xsl:if test = "not(name(.) = 'h')">
                                                        <xsl:if test = "not(name(.) = 'angle')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </xsl:if></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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used polyline out of child 'POLYLINE' -->
                <xsl:for-each select="POLYLINE">
                        <xsl:element name="POLYLINE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- copy all other childs -->
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'RECTANGLE')">
                        <xsl:if test = "not(name(.) = 'ELLIPSE')">
                        <xsl:if test = "not(name(.) = 'POLYLINE')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if></xsl:if></xsl:if>
                </xsl:for-each>

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


</xsl:stylesheet>PK
Mñ.½òn!Í5Í5Bsrc/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xsl<!-- back-direction for RegionEditor
     status: not tested
     updated to given schema from 15/07/2003 
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />


<xsl:template match="/">
        <xsl:apply-templates />
</xsl:template>


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

                <!-- work on attributes -->
                <!-- get information of used image out of attribute 'image' -->
                <xsl:attribute name="image">
                        <xsl:value-of select="@image" />
                </xsl:attribute>
                <!-- copy all other attributes -->
                <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 -->
                <!-- get information of used rectangle out of child 'RECTANGLE' -->
                <xsl:for-each select="RECTANGLE">
                        <xsl:element name="RECTANGLE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <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(.) = 'w')">
                                                        <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <xsl:for-each select="COORD_DATA">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="w">
                                                        <xsl:value-of select="@width" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@height" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x_pos')">
                                                        <xsl:if test = "not(name(.) = 'y_pos')">
                                                        <xsl:if test = "not(name(.) = 'width')">
                                                        <xsl:if test = "not(name(.) = 'height')">
                                                                <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                        <xsl:if test = "not(name(.) = 'COORD_DATA')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if></xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used ellipse out of child 'ELLIPSE' -->
                <xsl:for-each select="ELLIPSE">
                        <xsl:element name="ELLIPSE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@h" />
                                                </xsl:attribute>
                                                <xsl:attribute name="angle">
                                                        <xsl:value-of select="@angle" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                        <xsl:if test = "not(name(.) = 'w')">
                                                        <xsl:if test = "not(name(.) = 'h')">
                                                        <xsl:if test = "not(name(.) = 'angle')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </xsl:if></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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used polyline out of child 'POLYLINE' -->
                <xsl:for-each select="POLYLINE">
                        <xsl:element name="POLYLINE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- copy all other childs -->
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'RECTANGLE')">
                        <xsl:if test = "not(name(.) = 'ELLIPSE')">
                        <xsl:if test = "not(name(.) = 'POLYLINE')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if></xsl:if></xsl:if>
                </xsl:for-each>

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

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

                <!-- work on attributes -->
                <!-- get information of used image out of attribute 'image' -->
                <xsl:attribute name="image">
                        <xsl:value-of select="@image" />
                </xsl:attribute>
                <!-- copy all other attributes -->
                <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 -->
                <!-- get information of used rectangle out of child 'RECTANGLE' -->
                <xsl:for-each select="RECTANGLE">
                        <xsl:element name="RECTANGLE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <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(.) = 'w')">
                                                        <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <xsl:for-each select="COORD_DATA">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y_pos" />
                                                </xsl:attribute>
                                                <xsl:attribute name="w">
                                                        <xsl:value-of select="@width" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@height" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x_pos')">
                                                        <xsl:if test = "not(name(.) = 'y_pos')">
                                                        <xsl:if test = "not(name(.) = 'width')">
                                                        <xsl:if test = "not(name(.) = 'height')">
                                                                <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>
                                                <!-- Insert an attribut which saves the original name of node,
                                                     cause all nodes which contain data are transformed to a
                                                     "COORDS" node. This extra information is used in back-
                                                     transformation to restore the original name. -->
                                                <xsl:attribute name="XMLEditorSavedNameOfNode">
                                                        <xsl:value-of select="name(.)" />
                                                </xsl:attribute>
                                        </xsl:element>
                                </xsl:for-each>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                        <xsl:if test = "not(name(.) = 'COORD_DATA')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if></xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used ellipse out of child 'ELLIPSE' -->
                <xsl:for-each select="ELLIPSE">
                        <xsl:element name="ELLIPSE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <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="w">
                                                        <xsl:value-of select="@w" />
                                                </xsl:attribute>
                                                <xsl:attribute name="h">
                                                        <xsl:value-of select="@h" />
                                                </xsl:attribute>
                                                <xsl:attribute name="angle">
                                                        <xsl:value-of select="@angle" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                        <xsl:if test = "not(name(.) = 'w')">
                                                        <xsl:if test = "not(name(.) = 'h')">
                                                        <xsl:if test = "not(name(.) = 'angle')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </xsl:if></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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- get information of used polyline out of child 'POLYLINE' -->
                <xsl:for-each select="POLYLINE">
                        <xsl:element name="POLYLINE">
                                <!-- get coordinates -->
                                <xsl:for-each select="COORDS">
                                        <xsl:element name="COORDS">
                                                <xsl:attribute name="x">
                                                        <xsl:value-of select="@x" />
                                                </xsl:attribute>
                                                <xsl:attribute name="y">
                                                        <xsl:value-of select="@y" />
                                                </xsl:attribute>
                                                <xsl:for-each select="attribute::*">
                                                        <xsl:if test = "not(name(.) = 'x')">
                                                        <xsl:if test = "not(name(.) = 'y')">
                                                                <xsl:attribute name="{name(.)}">
                                                                        <xsl:value-of select="self::node()" />
                                                                </xsl:attribute>
                                                        </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>
                                <!-- copy all other childs -->
                                <xsl:for-each select="node()">
                                        <xsl:if test = "not(name(.) = 'COORDS')">
                                                <xsl:copy-of select="self::node()" />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:element>
                </xsl:for-each>

                <!-- copy all other childs -->
                <xsl:for-each select="node()">
                        <xsl:if test = "not(name(.) = 'RECTANGLE')">
                        <xsl:if test = "not(name(.) = 'ELLIPSE')">
                        <xsl:if test = "not(name(.) = 'POLYLINE')">
                                <xsl:copy-of select="self::node()" />
                        </xsl:if></xsl:if></xsl:if>
                </xsl:for-each>

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


</xsl:stylesheet>PK

añ. META-INF/þÊPK

añ.ñÍSºMM+META-INF/MANIFEST.MFPK

Òrñ.+PwÀ
À
7ªsrc/plugins/regionEditorPlugin/RegionEditorPlugin.classPK

B­ð.*eTmÒ
Ò
6¿src/plugins/regionEditorPlugin/RegionEditorPlugin.javaPK

º‰ñ.׿ä5ä5>åsrc/plugins/regionEditorPlugin/RegionEditorPluginTransform.xslPK

Mñ.½òn!Í5Í5B%Psrc/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xslPK"R†