Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
348 swalkenh 2
 
3
 
240 swalkenh 4
Comment: you can set named regions on pictures
5
Transform-To-File: src/plugins/regionEditorPlugin/RegionEditorPluginTr
6
 ansform.xsl
7
Created-By: 1.4.0 (Sun Microsystems Inc.)
8
Description: ...(todo)
9
XMLEditor-Plugin-Name: RegionEditor
10
Class-Path: ImagePlugin.jar
11
Transform-Fro-File: src/plugins/regionEditorPlugin/RegionEditorPluginT
260 swalkenh 12
 ransformBack.xsl
240 swalkenh 13
Main-Class: src.plugins.regionEditorPlugin.RegionEditorPlugin
14
 
15
Name: src/plugins/regionEditorPlugin
16
Specification-Version: 0.4 (05/07/03)
17
Specification-Title: plugin for XMLEditor
18
Implementation-Version: 0.1 (05/07/03)
19
Implementation-Title: src.plugins.regionEditorPlugin
20
Implementation-Vendor: group5, software practice SS_2003, University B
21
 ielefeld, Germany
22
Specification-Vendor: group5, software practice SS_2003, University Bi
23
 elefeld, Germany
24
 
25
PK
348 swalkenh 26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
 
34
 
35
 
36
 
37
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
38
 
39
 
40
 
41
 
42
 
43
 
44
 
45
 
46
 
47
 
48
 
49
 
50
IJ>?@t
51
u+±=U>?@vwo»yY½cY+SY,S·|N*´s-¹‚±=YZ[>*?@ƒl„l…†‡ˆPK
52
 
53
 
54
 
55
 
56
 
57
 
58
59
package src.plugins.regionEditorPlugin;
60
61
import java.awt.*;
62
import javax.swing.*;
63
 
64
import org.w3c.dom.*;
65
 
66
import src.control.OurEvent;
67
import src.control.OurEventListener;
68
 
69
import src.plugins.PluginInterface;
70
 
71
72
/**
73
 * dummy plugin used for testing
74
 */
75
 
76
 
77
	
78
	private GuiInterface gui;
79
	private OurEventListener ourEventListener;
80
	private JLabel label = new JLabel("dummy RegionEditorPlugin");
81
82
 
83
	public RegionEditorPlugin() {
84
		setLayout(new BorderLayout());
85
		add(label, BorderLayout.CENTER);
86
 
87
 
88
		System.out.println("I'm a new instance of the dummy RegionEditorPlugin!");
89
	}
90
	
91
92
 
93
	 * @see src.gui.PluginInterface#init(src.gui.GuiInterface)
94
	 */
95
 
96
 
97
		gui.setPluginPanel(this);
98
99
		System.out.println("dummy RegionEditorPlugin initialized");
100
	}
101
102
103
 
104
	 * @see src.gui.PluginInterface#start(org.w3c.dom.Element, org.w3c.dom.Document)
105
	 */
106
 
107
 
108
		setVisible(true);
109
	}
110
111
112
	/* (non-Javadoc)
113
	 * @see src.gui.PluginInterface#stop()
114
	 */
115
 
116
 
117
	}
118
119
120
	/* (non-Javadoc)
121
	 * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
122
	 */
123
 
124
 
125
	}
126
127
128
	/**
129
	 * forces the Text Editor Plugin to return the actual status as a node
130
	 * not well-formed parts have to be capsuled into a prosessing instruction
131
 
132
 
133
	 */
134
	public void forceStatusReport() {
135
		//firePluginChangedElement(originalElement, originalElement);
136
	}
137
	
138
	
139
	private void firePluginChangedElement(Element oldNode, Element changedElement) {
140
		OurEvent e = new OurEvent(new Object[] {oldNode, changedElement});
141
		ourEventListener.firedOurEvent(e);
142
 
143
 
144
}PK
145
ñ}ç.×,…‚ýýAsrc/plugins/regionEditorPlugin/RegionEditorPluginManifestAdditionXMLEditor-Plugin-Name: RegionEditor
146
Comment: you can set named regions on pictures
147
Description: ...(todo)
148
 
240 swalkenh 149
Class-Path: ImagePlugin.jar
348 swalkenh 150
 
151
Transform-Fro-File: src/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xsl
152
153
Name: src/plugins/regionEditorPlugin
154
Specification-Title: plugin for XMLEditor
155
Specification-Version: 0.4 (05/07/03)
156
Specification-Vendor: group5, software practice SS_2003, University Bielefeld, Germany
157
 
158
Implementation-Version: 0.1 (05/07/03)
159
Implementation-Vendor: group5, software practice SS_2003, University Bielefeld, Germany
160
PK
161
‘]ç.IAECC>src/plugins/regionEditorPlugin/RegionEditorPluginTransform.xsl<!-- status: first working for regioneditor -->
162
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
163
<xsl:output method="xml" indent="yes" />
164
165
<!-- these parameters can be given from outside -->
166
 
167
<xsl:param name="elementnamenew">standardplugin</xsl:param>
168
169
 
170
	<xsl:variable name="levelremaining" select="substring-after($input, '/')" />
171
172
	<xsl:message><xsl:value-of select="concat('outside-parameter input: ', $input)"/></xsl:message>
173
 
174
175
	<xsl:for-each select="node()">
176
 
177
			<xsl:with-param name="levelremaining" select="$levelremaining" />
178
		</xsl:call-template>
179
 
180
</xsl:template>
181
182
<xsl:template name="selecter">
183
	<xsl:param name="levelremaining" />
184
	<xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
185
	<xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
186
 
187
	<!-- if this node belongs to the right path
188
	     then work on childs with the selecter -->
189
	<xsl:if test = "(name() = $level)">
190
		<xsl:message>selecter-case: belongs to right path</xsl:message>
191
 
192
		
193
			<!-- if this is the last level this is the node which must be converted
194
			     then convert the node -->
195
			<xsl:if test = "( ('' = $nextlevels) 
196
		    	              and not('' = name()) )"><!-- avoid too many tags from matcher -->
197
 
198
				<xsl:apply-templates select="self::node()">
199
				</xsl:apply-templates>
200
			</xsl:if>
201
			<!-- else (if there are levels left) work on childs -->
202
			<xsl:if test = "not('' = $nextlevels)">
203
				<xsl:message>selecter-case: levels left</xsl:message>
204
				<xsl:copy>
205
					<xsl:for-each select="attribute::*">
206
						<xsl:attribute name="{name(.)}">
207
							<xsl:value-of select="self::node()" />
208
						</xsl:attribute>
209
					</xsl:for-each>
210
					<xsl:for-each select="node()">
211
						<xsl:call-template name="selecter">
212
							<xsl:with-param name="levelremaining" select="$nextlevels" />
213
						</xsl:call-template>
214
					</xsl:for-each>
215
				</xsl:copy>
216
			</xsl:if>
217
		</xsl:element>
218
	</xsl:if>
219
	<!-- else simply copy the node with childs -->
220
	<xsl:if test = "not(name() = $level)">
221
		<xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
222
		<xsl:copy-of select="self::node()" />
223
	</xsl:if>
224
</xsl:template>
225
226
<xsl:template match="Regionensatz"><!-- element-plugin association -->
227
	<xsl:element name="REGIONSET">
228
229
		<!-- work on attributes -->
230
 
231
			<xsl:value-of select="@Bild" />
232
		</xsl:attribute>
233
 
234
			<xsl:if test = "not(name(.) = ('Bild'))">
235
				<xsl:attribute name="{name(.)}">
236
					<xsl:value-of select="self::node()" />
237
				</xsl:attribute>
238
			</xsl:if>
239
		</xsl:for-each>
240
241
		<!-- work on childs -->
242
		<xsl:for-each select="Bereich">
243
			<xsl:element name="RECT">
244
				<xsl:attribute name="x">
245
 
246
				</xsl:attribute>
247
				<xsl:attribute name="y">
248
					<xsl:value-of select="@y" />
249
				</xsl:attribute>
250
				<xsl:attribute name="b">
251
					<xsl:value-of select="@Breite" />
252
				</xsl:attribute>
253
				<xsl:attribute name="h">
254
					<xsl:value-of select="@Hoehe" />
255
				</xsl:attribute>
256
				<xsl:for-each select="attribute::*">
257
					<xsl:if test = "not(name(.) = 'x')">
258
					<xsl:if test = "not(name(.) = 'y')">
259
					<xsl:if test = "not(name(.) = 'Breite')">
260
					<xsl:if test = "not(name(.) = 'Hoehe')">
261
						<xsl:attribute name="{name(.)}">
262
							<xsl:value-of select="self::node()" />
263
						</xsl:attribute>
264
					</xsl:if></xsl:if></xsl:if></xsl:if>
265
				</xsl:for-each>
266
				<xsl:for-each select="node()">
267
					<xsl:copy-of select="self::node()" />
268
				</xsl:for-each>
269
			</xsl:element>
270
		</xsl:for-each>
271
		<xsl:for-each select="node()">
272
			<xsl:if test = "not(name(.) = 'Bereich')">
273
				<xsl:copy-of select="self::node()" />
274
			</xsl:if>
275
		</xsl:for-each>
276
277
	</xsl:element>
278
</xsl:template>
279
280
<xsl:template match="REGIONSET"><!-- element-plugin association -->
281
 
282
</xsl:template>
283
284
 
285
‘]ç.v,xY44Bsrc/plugins/regionEditorPlugin/RegionEditorPluginTransformBack.xsl<!-- status: first try for regioneditor -->
286
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
287
<xsl:output method="xml" indent="yes" />
288
 
240 swalkenh 289
<!-- these parameters can be given from outside -->
348 swalkenh 290
 
291
<xsl:param name="elementnamenew">standardplugin</xsl:param>
292
293
 
294
	<xsl:variable name="levelremaining" select="substring-after($input, '/')" />
295
296
	<xsl:message><xsl:value-of select="concat('outside-parameter input: ', $input)"/></xsl:message>
297
 
298
299
	<xsl:for-each select="node()">
300
 
301
			<xsl:with-param name="levelremaining" select="$levelremaining" />
302
		</xsl:call-template>
303
 
304
</xsl:template>
305
306
<xsl:template name="selecter">
307
	<xsl:param name="levelremaining" />
308
	<xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
309
	<xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
310
 
311
	<!-- if this node belongs to the right path
312
	     then work on childs with the selecter -->
313
	<xsl:if test = "(name() = $level)">
314
		<xsl:message>selecter-case: belongs to right path</xsl:message>
315
 
316
		
317
			<!-- if this is the last level this is the node which must be converted
318
			     then convert the node -->
319
			<xsl:if test = "( ('' = $nextlevels) 
320
		    	              and not('' = name()) )"><!-- avoid too many tags from matcher -->
321
 
322
				<xsl:apply-templates select="self::node()">
323
				</xsl:apply-templates>
324
			</xsl:if>
325
			<!-- else (if there are levels left) work on childs -->
326
			<xsl:if test = "not('' = $nextlevels)">
327
				<xsl:message>selecter-case: levels left</xsl:message>
328
				<xsl:copy>
329
					<xsl:for-each select="attribute::*">
330
						<xsl:attribute name="{name(.)}">
331
							<xsl:value-of select="self::node()" />
332
						</xsl:attribute>
333
					</xsl:for-each>
334
					<xsl:for-each select="node()">
335
						<xsl:call-template name="selecter">
336
							<xsl:with-param name="levelremaining" select="$nextlevels" />
337
						</xsl:call-template>
338
					</xsl:for-each>
339
				</xsl:copy>
340
			</xsl:if>
341
		</xsl:element>
342
	</xsl:if>
343
	<!-- else simply copy the node with childs -->
344
	<xsl:if test = "not(name() = $level)">
345
		<xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
346
		<xsl:copy-of select="self::node()" />
347
	</xsl:if>
348
</xsl:template>
349
350
<xsl:template match="REGIONSET"><!-- element-plugin association -->
351
	<xsl:element name="Regionensatz">
352
353
		<!-- work on attributes -->
354
 
355
			<xsl:value-of select="@image" />
356
		</xsl:attribute>
357
 
358
			<xsl:if test = "not(name(.) = ('image'))">
359
				<xsl:attribute name="{name(.)}">
360
					<xsl:value-of select="self::node()" />
361
				</xsl:attribute>
362
			</xsl:if>
363
		</xsl:for-each>
364
365
		<!-- work on childs -->
366
		<xsl:for-each select="RECT">
367
			<xsl:element name="Bereich">
368
				<xsl:attribute name="x">
369
 
370
				</xsl:attribute>
371
				<xsl:attribute name="y">
372
					<xsl:value-of select="@y" />
373
				</xsl:attribute>
374
				<xsl:attribute name="Breite">
375
					<xsl:value-of select="@b" />
376
				</xsl:attribute>
377
				<xsl:attribute name="Hoehe">
378
					<xsl:value-of select="@h" />
379
				</xsl:attribute>
380
				<xsl:for-each select="attribute::*">
381
					<xsl:if test = "not(name(.) = 'x')">
382
					<xsl:if test = "not(name(.) = 'y')">
383
					<xsl:if test = "not(name(.) = 'b')">
384
					<xsl:if test = "not(name(.) = 'h')">
385
						<xsl:attribute name="{name(.)}">
386
							<xsl:value-of select="self::node()" />
387
						</xsl:attribute>
388
					</xsl:if></xsl:if></xsl:if></xsl:if>
389
				</xsl:for-each>
390
				<xsl:for-each select="node()">
391
					<xsl:copy-of select="self::node()" />
392
				</xsl:for-each>
393
			</xsl:element>
394
		</xsl:for-each>
395
		<xsl:for-each select="node()">
396
			<xsl:if test = "not(name(.) = 'RECT')">
397
				<xsl:copy-of select="self::node()" />
398
			</xsl:if>
399
		</xsl:for-each>
400
401
	</xsl:element>
402
</xsl:template>
403
404
<xsl:template match="REGIONSET"><!-- element-plugin association -->
405
 
406
</xsl:template>
407
408
 
409
410
pVë.	META-INF/þÊPK
411
412
 
240 swalkenh 413
414
 
348 swalkenh 415
 
240 swalkenh 416
 
348 swalkenh 417
 
240 swalkenh 418
 
348 swalkenh 419
 
240 swalkenh 420
 
348 swalkenh 421
 
422
 
423
 
240 swalkenh 424
 
348 swalkenh 425
 
240 swalkenh 426