Subversion Repositories general

Rev

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

PK
pVë.  META-INF/þÊPK
pVë.ñÍ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
Y<ë.#src/plugins/regionEditorPlugin/CVS/PK
ñTë.iýA
A
7src/plugins/regionEditorPlugin/RegionEditorPlugin.classÊþº¾-‰1src/plugins/regionEditorPlugin/RegionEditorPluginjavax/swing/JPanelsrc/plugins/PluginInterfaceguiLsrc/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/JComponent*
setVisible(Z)V,-
+.java/lang/System0outLjava/io/PrintStream;23   143I'm a new instance of the dummy RegionEditorPlugin!6java/io/PrintStream8println:
9;LineNumberTableLocalVariableTablethis3Lsrc/plugins/regionEditorPlugin/RegionEditorPlugin;init(Lsrc/gui/GuiInterface;)V        Csrc/gui/GuiInterfaceEsetPluginPanel(Ljavax/swing/JPanel;)VGHFI$dummy RegionEditorPlugin initializedKstart.(Lorg/w3c/dom/Element;Lorg/w3c/dom/Document;)Vjava/lang/StringBufferOgetText()Ljava/lang/String;QR
Sjava/lang/StringUvalueOf&(Ljava/lang/Object;)Ljava/lang/String;WX
VY
P: \append,(Ljava/lang/String;)Ljava/lang/StringBuffer;^_
P`java/lang/ObjectbtoStringdR
ce
PesetTexth
ielementLorg/w3c/dom/Element;environmentLorg/w3c/dom/Document;stopsetOurEventListener!(Lsrc/control/OurEventListener;)V        
        rnewListenerforceStatusReportfirePluginChangedElement-(Lorg/w3c/dom/Element;Lorg/w3c/dom/Element;)Vsrc/control/OurEventx([Ljava/lang/Object;)V
z
y{src/control/OurEventListener}
firedOurEvent(Lsrc/control/OurEvent;)V€~oldNodechangedElementeLsrc/control/OurEvent;
SourceFileRegionEditorPlugin.java!     

v4*·*»Y·µ*»Y·¶#**´%¶)*¶/²57¶<±= !"&#+%3&>4?@ABU*+µD+*¹J²5L¶<±=-.01>?@MNs-*´»PY*´¶T¸Z·[]¶a+¶f¶a¶g¶j*¶/±=8'9,:> -?@-kl-mno4*¶/±=
AB>?@pq>*+µs±=
IJ>?@t
u+±=U>?@vwo»yY½cY+SY,S·|N*´s-¹‚±=YZ[>*?@ƒl„l…†‡ˆPK
ðTë.Ð-ÈÈ6src/plugins/regionEditorPlugin/RegionEditorPlugin.java/*
* software practice
* ss_2003
* group project: XML-Editor
* $Id: RegionEditorPlugin.java,v 1.4 2003/07/10 15:43:00 swalkenh Exp $
*/

package src.plugins.regionEditorPlugin;

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

import org.w3c.dom.*;

import src.control.OurEvent;
import src.control.OurEventListener;
import src.gui.*;
import src.plugins.PluginInterface;


/**
 * dummy plugin used for testing
 */
public class RegionEditorPlugin extends JPanel
                                                                implements PluginInterface {
        
        private GuiInterface gui;
        private OurEventListener ourEventListener;
        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#setOurEventListener(src.control.OurEventListener)
         */
        public void setOurEventListener(OurEventListener newListener) {
                ourEventListener = newListener;
        }


        /**
         * forces the Text Editor Plugin to return the actual status as a node
         * not well-formed parts have to be capsuled into a prosessing instruction
         * 
         * @see src.gui.PluginInterface#forceStatusReport()
         */
        public void forceStatusReport() {
                //firePluginChangedElement(originalElement, originalElement);
        }
        
        
        private void firePluginChangedElement(Element oldNode, Element changedElement) {
                OurEvent e = new OurEvent(new Object[] {oldNode, changedElement});
                ourEventListener.firedOurEvent(e);
        }

}PK
ñ}ç.×,…‚ýýAsrc/plugins/regionEditorPlugin/RegionEditorPluginManifestAdditionXMLEditor-Plugin-Name: RegionEditor
Comment: you can set named regions on pictures
Description: ...(todo)
Main-Class: src.plugins.regionEditorPlugin.RegionEditorPlugin
Class-Path: ImagePlugin.jar
Transform-To-File: src/plugins/regionEditorPlugin/RegionEditorPluginTransform.xsl
Transform-Fro-File: src/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xsl

Name: src/plugins/regionEditorPlugin
Specification-Title: plugin for XMLEditor
Specification-Version: 0.4 (05/07/03)
Specification-Vendor: group5, software practice SS_2003, University Bielefeld, Germany
Implementation-Title: src.plugins.regionEditorPlugin
Implementation-Version: 0.1 (05/07/03)
Implementation-Vendor: group5, software practice SS_2003, University Bielefeld, Germany
PK
‘]ç.IAECC>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
‘]ç.v,xY44Bsrc/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

pVë.  META-INF/þÊPK

pVë.ñÍSºMM+META-INF/MANIFEST.MFPK

Y<ë.#ªsrc/plugins/regionEditorPlugin/CVS/PK

ñTë.iýA
A
7ësrc/plugins/regionEditorPlugin/RegionEditorPlugin.classPK

ðTë.Ð-ÈÈ6src/plugins/regionEditorPlugin/RegionEditorPlugin.javaPK

ñ}ç.×,…‚ýýAsrc/plugins/regionEditorPlugin/RegionEditorPluginManifestAdditionPK

‘]ç.IAECC>ùsrc/plugins/regionEditorPlugin/RegionEditorPluginTransform.xslPK

‘]ç.v,xY44B˜,src/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xslPKâ,>