Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
577 swalkenh 2
 
3
 
240 swalkenh 4
×Z6META-INF/MANIFEST.MFManifest-Version: 1.0
5
Comment: you can view images with this plugin
6
Transform-To-File: src/plugins/imagePlugin/ImagePluginTransform.xsl
7
Created-By: 1.4.0 (Sun Microsystems Inc.)
8
Description: ...(todo)
9
XMLEditor-Plugin-Name: ImageViewer
10
Class-Path: 
11
Transform-Fro-File: src/plugins/imagePlugin/ImagePluginTransformBack.x
12
 sl
13
Main-Class: src.plugins.imagePlugin.ImagePlugin
14
 
15
Name: src/plugins/imagePlugin
16
Specification-Version: 0.4 (05/07/03)
17
Specification-Title: plugin for XMLEditor
18
Implementation-Version: 0.2 (05/07/03)
19
Implementation-Title: src.plugins.imagePlugin
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
556 swalkenh 26
 
279 swalkenh 27
imageWidthimageHeightimageLjava/awt/Image;<init>()VCode(Z)V
28
 
29
 
30
 
31
"%java/awt/Graphics'setColor(Ljava/awt/Color;)V)*
32
 
33
 
34
 
35
 
36
 
37
 
38
 
39
 
40
 
41

4*·±
42
*+`ž*¶=*¶ >+*¶&¶,+¶0*´2Æ*´2¶76*´2¶96‡‡o9‡‡o9¸?9
43
 
44
 
521 swalkenh 45
 
279 swalkenh 46
oŽ6*dlµA*dlµC*µE*µG+*´2*´A*´C¶KW±N01
47
346!8+95:=;E<N>U?^@gCqD{EF‡HJ\	žžLM™N
48
”O+rP5hQ=`RSEXTSNOUS
521 swalkenh 49
VWF
50
 
279 swalkenh 51
 
52
 
521 swalkenh 53
[/*´A¬V\/*´C¬\]/*´E¬b^/*´G¬h_`PK
279 swalkenh 54
 
55
 
521 swalkenh 56
 
57
 
58
 * University of Bielefeld, Germany
59
 * 
60
 * @version $Revision: 1.6 $
61
 *
62
 * Last modification: $Date: 2003/07/15 22:23:20 $
63
 * $Id: ImagePanel.java,v 1.6 2003/07/15 22:23:20 ioklasse Exp $
64
 */
65
 
66
package src.plugins.imagePlugin;
67
68
 
69
import java.awt.Image;
70
 
71
import javax.swing.JPanel;
72
73
 
74
 *  Image panel shows any images.
75
 
76
 *  @author Yulia Klassen, Viktoriya Zudova
77
 */
78
class ImagePanel extends JPanel
79
{
80
	/** dx-shift of image according to the left top corner of plugin panel */
81
	private int dx;
82
	/** dy-shift of image according to the left top corner of plugin panel */
83
	private int dy;
84
	/** width of the image */
85
	private int imageWidth;
86
	/** height of the image */
87
	private int imageHeight;
88
89
	/** current image */
90
	public Image image;
91
 
92
	/** constructor invokes JPanel to create all elements for options dialog */
93
	public ImagePanel()
94
 
95
		super(true);
96
	}
97
98
	/** draws the image */
99
	public void paintComponent(Graphics g)
100
 
101
		int w  = getWidth();
102
		int h  = getHeight();
103
104
		g.setColor(getBackground());
105
		g.fillRect(0, 0, w, h);
106
 
107
		if(image != null)
108
		{
109
 
110
			int ih = image.getHeight(null);
111
			double kx = (double)iw/w;
112
			double ky = (double)ih/h;
113
			double k = Math.max(kx, ky);
114
115
			if(k >= 1) {
116
			  iw = (int)(iw/k);
117
 
118
                        }
119
120
			dx = (w-iw)/2;
121
			dy = (h-ih)/2;
122
 
123
                        imageHeight = ih;
124
125
			g.drawImage(image, dx, dy, iw, ih, null);
126
		}
127
 
128
129
	/** sets the image */
130
	public void setImage(Image image)
131
 
132
		this.image = image;
133
		repaint();
134
	}
135
136
	/** returns dx-shift of image according to the left top corner of plugin panel */
137
	public int getDx()
138
 
139
		return dx;
140
	}
141
142
	/** returns dy-shift of image according to the left top corner of plugin panel */
143
	public int getDy()
144
 
145
		return dy;
146
	}
147
148
	/** returns width of the image */
149
	public int getImageWidth()
150
 
151
		return imageWidth;
152
	}
153
154
	/**  returns height of the image */
155
	public int getImageHeight()
156
 
157
		return imageHeight;
158
	}
159
}PK
160
ãtñ.Ø•Ñ
161
ÉÉ)src/plugins/imagePlugin/ImagePlugin.classÊþº¾-¦#src/plugins/imagePlugin/ImagePluginjavax/swing/JPanelsrc/plugins/PluginInterfacejava/awt/event/ActionListener"java/awt/event/MouseMotionListener	java/awt/event/MouseListener
348 swalkenh 162
pluginNameLjava/lang/String;
ConstantValueImageViewerimageLjava/awt/Image;imageNameFieldLjavax/swing/JTextField;nameChangeButtonLjavax/swing/JButton;imageFileLabelLjavax/swing/JLabel;fileChooserLjavax/swing/JFileChooser;openFileButton
577 swalkenh 163
 
164
+
	-javax/swing/JTextField/
521 swalkenh 165
0+	2javax/swing/JButton4Change6(Ljava/lang/String;)V(8
166
59	;javax/swing/JLabel=
348 swalkenh 167
>+	@javax/swing/JFileChooserB
279 swalkenh 168
C+	EOpen...G	I"src/plugins/imagePlugin/ImagePanelK
521 swalkenh 169
L+	Njava/awt/BorderLayoutP
170
 
171
 
172
 
173
 
174
 
175
 
176
 
177
 
178
 
179
 
180
 
181
 
182
 
183
 
184
 
185
 
186
¶ÂtoStringĽ
187
 
188
¯È; attributes: Ê
getAttributes()Lorg/w3c/dom/NamedNodeMap;ÌͻΠ"Ðorg/w3c/dom/NamedNodeMapÒitem(I)Lorg/w3c/dom/Node;ÔÕÓÖ"=ØgetNodeValueÚ½»Û	getLength()IÝÞÓß°)
539 swalkenh 189
¯áhas element attributes: ã
hasAttributes()Zåæ»ç(Z)Ljava/lang/StringBuffer;Àé
190
 
191
fileName: ôjavax/swing/text/JTextComponentösetTextø8
192
 
193
 
194
 
195
 
196
25getPath7½
197
 
198
2;javax/imageio/ImageIO=read.(Ljava/io/File;)Ljava/awt/image/BufferedImage;?@
199
 
200
>ùsetImage(Ljava/awt/Image;)VRS
201
 
202
 
203
÷fsetNodeValueh8»isetSelectedFile(Ljava/io/File;)Vkl
577 swalkenh 204
Cm
getMainWindow()Ljava/awt/Frame;op’qshowOpenDialog(Ljava/awt/Component;)Ist
205
CugetSelectedFilew.
206
Cx%$	zLjava/awt/event/ActionEvent;mouseDragged(Ljava/awt/event/MouseEvent;)Vjava/awt/event/MouseEventgetXÞ
207
€‚getY„Þ
208
€…	showMouse‡n
209
ˆLjava/awt/event/MouseEvent;
210
mouseMovedgetDxŒÞ
211
 
212
 
213
L“getImageHeight•Þ
214
 
215
 
216
SourceFileImagePlugin.java!
217
 
218
 
219
”•„…† *&F*´Ž¹–¹œ*´Ž¹–¹Ÿ*´Ž¹–¹£¥N¥:+Dz«­¶²§è²«´¶²²«»¶Y¸·¹+¹¿¶Ã¶Æ¶É²«˶É+¹Ï:ÆQ6§?²«»¶YÑ·¹¹×¹¿¶Ãٶù׹ܶöƶɄ¹à¡ÿ»²«¶â²«»¶Yä·¹+¹è¶ë¶Æ¶²+¹Ï:í¹ñ¹ÜNó¹ñ¹Ü:²«»¶Yõ·¹¶Ã¶Æ¶²*´3-¶ú*·ý*´Ž*¹*¶‚±ƒvŸ ¡-¤0¥4¦8§CªK«f¬n­v®{¯°„°ž±´°º¯É´Ï·ê¸ò¹º»(¾0¿6Â@ÃEĄRF…†F$F04v²~K	
220
ò6)*m3*¶‚*´Ž¹–¹œ*´Ž¹–¹Ÿ*´Ž¹–¹£±ƒËÌÍ#Î2Ï„3…†
*>*+µ±ƒ
221
 
222
*µ(+Ç+*µ**´Ž¹–¹œ*´Ž¹–,¹Ÿ§È*´Ž¹0M,Ç*»2Y+·3µ(§ ²«,¶6¶9¶²*»2Y,¶6+·<µ(**´(¸Bµ**´Ž¹–¹œ*´Ž¹–»¶YD·¹+¶Ã¶Æ¹Ÿ§RM*´Ž¹H»¶YJ·¹+¶Ã¶Æ¹P*´Ž¹–¹œ*´Ž¹–»¶YJ·¹+¶Ã¶Æ¹Ÿ*´A+¶Q*´O*´*¶U±1§§WƒZùü	ýþÿ1;?N	[
223
 
224
 
225
;lX'¨NYZ[\*Éq+¶b*´<¦*´dÆ*´d*´3¶g¹j+¶b*´J¦F*´F*´(¶n*´F*´Ž¹r¶vš(**´F¶y¶9·ý*´{Æ*´{*´(¶9¹j±ƒ*
226
 
227
 
228
`œ
279 swalkenh 229

230
V
348 swalkenh 231
 
521 swalkenh 232
 
233
 
234
 * This file contains the ImagePlugin class.
235
 
236
 
539 swalkenh 237
 
238
 
239
 * @version $Revision: 1.16 $
577 swalkenh 240
 
241
 * Last modification: $Date: 2003/07/16 16:07:06 $
242
 
243
 
244
 
245
package src.plugins.imagePlugin;
246
 
247
import java.awt.BorderLayout;
248
 
539 swalkenh 249
 
577 swalkenh 250
 
251
 
252
 
253
 
521 swalkenh 254
import java.awt.event.MouseListener;
255
import java.awt.event.MouseMotionListener;
256
import java.awt.Point;
257
258
import java.io.File;
545 swalkenh 259
import java.io.IOException;
521 swalkenh 260
545 swalkenh 261
//import org.apache.xpath.XPathAPI;
262
327 swalkenh 263
//modified 10.07.03 Sascha W. cause of new PluginInterface
279 swalkenh 264
 
265
import org.w3c.dom.NamedNodeMap;
266
 
521 swalkenh 267
import org.w3c.dom.Element;
268
import org.w3c.dom.Node;
269
270
 
271
import javax.swing.JFileChooser;
272
import javax.swing.JLabel;
273
import javax.swing.JPanel;
274
import javax.swing.JTextField;
275
276
//import javax.xml.transform.TransformerException;
277
 
278
import src.control.OurEvent;
279
import src.control.OurEventListener;
280
 
281
import src.plugins.PluginInterface;
282
 
327 swalkenh 283
284
/**
521 swalkenh 285
 * Image plugin shows any images.
286
 *
287
 * @author Yulia Klassen, Viktoriya Zudova
288
 */
279 swalkenh 289
 
521 swalkenh 290
  implements PluginInterface, ActionListener,
291
  MouseMotionListener, MouseListener
292
{
293
  //added 16.07.03 Sascha W. cause method "firedOurEvent" has changed
294
  /** Name of the plugin, used in method <code>firePluginChangedElement</code> */
295
 
296
	
297
 
348 swalkenh 298
  private Image image;
299
  
279 swalkenh 300
  /* A text field to enter the name of an image. */
348 swalkenh 301
  private JTextField imageNameField = new JTextField();
279 swalkenh 302
 
303
 
304
  private JButton nameChangeButton = new JButton("Change");
521 swalkenh 305
 
327 swalkenh 306
  /* A label to show the name of the current image file. */
521 swalkenh 307
  private JLabel imageFileLabel = new JLabel();
327 swalkenh 308
 
279 swalkenh 309
  /* A file chooser to choose an image file. */
310
  private JFileChooser fileChooser = new JFileChooser();
311
  
312
  /* A button "Open..." to change images. */
521 swalkenh 313
  private JButton openFileButton = new JButton("Open...");
314
  
315
  /* An image panel to show an image in. */
316
 
317
  
279 swalkenh 318
  /* Stores a reference to the GUI. */
521 swalkenh 319
 
320
  
279 swalkenh 321
  //added 11/07/03 Sascha W.; own events are available now
521 swalkenh 322
 
323
  private OurEventListener ourEventListener;
279 swalkenh 324
521 swalkenh 325
 
326
  private Node imageNameNode;
279 swalkenh 327
  
521 swalkenh 328
 
329
  private Node imageFileNode;
279 swalkenh 330
  
521 swalkenh 331
 
332
  private File currentFile;
279 swalkenh 333
521 swalkenh 334
 
335
  public ImagePlugin()
279 swalkenh 336
  {
521 swalkenh 337
 
338
	// sets new layout
279 swalkenh 339
	setLayout(new BorderLayout());
521 swalkenh 340
 
348 swalkenh 341
	imagePanel.addMouseMotionListener(this);
521 swalkenh 342
348 swalkenh 343
	// left panel: text field to enter name of image,
521 swalkenh 344
 
345
	JPanel leftPanel = new JPanel();
279 swalkenh 346
	leftPanel.setLayout(new BorderLayout());
521 swalkenh 347
 
348
	leftPanel.add(nameChangeButton, BorderLayout.EAST);
279 swalkenh 349
521 swalkenh 350
 
351
	//              open button to change images
279 swalkenh 352
	JPanel rightPanel = new JPanel();
353
 
521 swalkenh 354
	rightPanel.setLayout(new BorderLayout());
279 swalkenh 355
	rightPanel.add(imageFileLabel);
356
	rightPanel.add(openFileButton, BorderLayout.EAST);
327 swalkenh 357
 
358
	// top panel contains left and right panels
359
	JPanel topPanel = new JPanel();
360
	topPanel.setLayout(new BorderLayout());
361
	topPanel.add(leftPanel);
279 swalkenh 362
 
327 swalkenh 363
364
	add(topPanel, BorderLayout.NORTH);
365
	add(imagePanel);
366
367
	nameChangeButton.addActionListener(this);
368
	openFileButton.addActionListener(this);
279 swalkenh 369
 
327 swalkenh 370
	setVisible(false);
371
  }
372
373
  /**
374
   * Initializes the plugin.
375
   * 
376
   * @param gui: A reference to the GUI object.
279 swalkenh 377
 
327 swalkenh 378
  public void init(GuiInterface gui) {
379
	
380
	this.gui = gui;
381
  }
382
279 swalkenh 383
 
327 swalkenh 384
   * Starts the plugin
385
   * 
279 swalkenh 386
 
327 swalkenh 387
   * @param environment    the current document   
388
   */
279 swalkenh 389
 
327 swalkenh 390
  {
279 swalkenh 391
	gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
392
 
327 swalkenh 393
	gui.getStatusInterface().setPoint(null);
521 swalkenh 394
327 swalkenh 395
	//for testing
521 swalkenh 396
	String imageName = "";
327 swalkenh 397
	String fileName = "";
521 swalkenh 398
	if (element == null) {
399
 
327 swalkenh 400
	}
279 swalkenh 401
	else {
402
 
327 swalkenh 403
		System.out.print("name: " + element.getNodeName());
521 swalkenh 404
		System.out.print("; attributes: ");
327 swalkenh 405
		NamedNodeMap l = element.getAttributes();
521 swalkenh 406
		if (l != null) {
407
			for (int i = 0; i < l.getLength(); i++) {
327 swalkenh 408
				System.out.print(" \"" + l.item(i).getNodeName() 
521 swalkenh 409
								+ "\"=" + l.item(i).getNodeValue());
279 swalkenh 410
			}
327 swalkenh 411
		}
412
		System.out.println();
413
279 swalkenh 414
 
539 swalkenh 415
		System.out.println("has element attributes: " + element.hasAttributes());
416
		NamedNodeMap elementAttr = element.getAttributes();
417
		imageName = elementAttr.getNamedItem("name").getNodeValue();  //findImageName(element);
418
		fileName = elementAttr.getNamedItem("url").getNodeValue();  //findFileName(element);
419
		System.out.println("fileName: " + fileName);
420
	}
421
	
422
	imageNameField.setText(imageName);
423
	loadImage(fileName);
424
425
	//added  15.07.03 Sascha W. was nonsene in method "init"
426
	gui.setPluginPanel(this);
427
	setVisible(true);
428
  }
429
430
  /**
431
   * Stops the plugin.
432
   */
433
 
434
  {
435
	setVisible(false);
436
	gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
437
	gui.getStatusInterface().setMessage(null);
438
	gui.getStatusInterface().setPoint(null);
439
  }
440
521 swalkenh 441
 
327 swalkenh 442
//old removed 10.07.03 Sascha W. cause of new PluginInterface
443
279 swalkenh 444
 
521 swalkenh 445
  /* (non-Javadoc)
446
   * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
327 swalkenh 447
   */
279 swalkenh 448
  public void setOurEventListener(OurEventListener newListener) {
449
 
327 swalkenh 450
  }
521 swalkenh 451
327 swalkenh 452
279 swalkenh 453
  //added 11/07/03 Sascha W.; own events are available now
454
  /**
327 swalkenh 455
   * Forces the text editor plugin to return the actual status as a node, 'cause
456
   * not well-formed parts have to be capsuled into a prosessing instruction.
457
   * 
458
   * @see src.gui.PluginInterface#forceStatusReport()
279 swalkenh 459
   */
460
 
327 swalkenh 461
	  //firePluginChangedElement(originalElement, originalElement);
462
  }
348 swalkenh 463
 
464
	
327 swalkenh 465
  //added 11/07/03 Sascha W.; own events are available now
348 swalkenh 466
  private void firePluginChangedElement(Element oldNode, Element changedElement) {
467
	  OurEvent e = new OurEvent(new Object[] {oldNode, changedElement, pluginName});
468
	  ourEventListener.firedOurEvent(e);
469
  }
470
471
 
472
 
473
  /**
474
   *  loads image
521 swalkenh 475
   * 
476
   *  @param fileName    the file name that must be shown  
348 swalkenh 477
   */
327 swalkenh 478
  private void loadImage(String fileName)
479
  {
480
	//	file is absent
348 swalkenh 481
	currentFile = null;
279 swalkenh 482
348 swalkenh 483
 
484
 
485
	  image = null;
486
	  gui.getStatusInterface().setIcon(StatusInterface.ICON_WARNING);
521 swalkenh 487
	  gui.getStatusInterface().setMessage("No image");
348 swalkenh 488
	}
489
	// get the current file from the directory where the doc is
490
 
327 swalkenh 491
	  try {
279 swalkenh 492
 
327 swalkenh 493
521 swalkenh 494
		if(doc == null)
327 swalkenh 495
		  currentFile = new File(fileName);
521 swalkenh 496
		else {
327 swalkenh 497
			System.out.println(doc.getParentFile().getPath());
279 swalkenh 498
		    currentFile = new File(doc.getParentFile(), fileName);
499
		}
521 swalkenh 500
327 swalkenh 501
		image = javax.imageio.ImageIO.read(currentFile);
279 swalkenh 502
 
521 swalkenh 503
		gui.getStatusInterface().setMessage("Show image from " + fileName);
327 swalkenh 504
	  }
505
	  catch(IOException ex) {
506
		gui.getLogInterface().log(
507
		  LogInterface.TYPE_ERROR, "Cannot open file " + fileName);
508
		gui.getStatusInterface().setIcon(StatusInterface.ICON_ERROR);
521 swalkenh 509
		gui.getStatusInterface().setMessage("Cannot open file " + fileName);
327 swalkenh 510
	  }
511
	}
577 swalkenh 512
513
 
327 swalkenh 514
	imagePanel.setImage(image);
515
  }
516
577 swalkenh 517
  /**
518
   *  reaction of all buttons
327 swalkenh 519
   * 
577 swalkenh 520
 
521
   */
327 swalkenh 522
  public void actionPerformed(ActionEvent e)
523
  {
524
	if(e.getSource() == nameChangeButton) {
525
	  if(imageNameNode != null) {
526
		imageNameNode.setNodeValue(imageNameField.getText());
527
	  }
528
	}
529
530
	if(e.getSource() == openFileButton) {
531
	  fileChooser.setSelectedFile(currentFile);
279 swalkenh 532
 
327 swalkenh 533
	  if(fileChooser.showOpenDialog(gui.getMainWindow())
534
		== JFileChooser.APPROVE_OPTION)
279 swalkenh 535
	  {
536
 
327 swalkenh 537
521 swalkenh 538
		if(imageFileNode != null) {
327 swalkenh 539
		  imageFileNode.setNodeValue(currentFile.getPath());
521 swalkenh 540
		}
327 swalkenh 541
	  }
279 swalkenh 542
	}
543
  }
327 swalkenh 544
545
546
  /**
547
   * invoked when a mouse button is pressed on a component 
548
   * 
279 swalkenh 549
 
327 swalkenh 550
   */
551
  public void mouseDragged(MouseEvent e)
279 swalkenh 552
 
327 swalkenh 553
	if(e.getSource() == imagePanel && image != null) {
554
	  showMouse(e.getX(), e.getY());
555
	}
556
  }
279 swalkenh 557
 
327 swalkenh 558
  /**
559
   * invoked when the mouse button has been moved on a component (with no buttons no down)
560
   * 
561
   * @param e .................
562
   */
279 swalkenh 563
  public void mouseMoved(MouseEvent e)
564
 
521 swalkenh 565
 
566
	  showMouse(e.getX(), e.getY());
567
	}
568
  }
569
570
  /** 
279 swalkenh 571
   * invoked when ........
572
   * 
327 swalkenh 573
   * @param e  ....................
574
   */
575
  public void showMouse(int mouseX, int mouseY)
279 swalkenh 576
  {
577
 
521 swalkenh 578
	int y = mouseY - imagePanel.getDy();
579
580
	if(x < 0 || y < 0 || x > imagePanel.getImageWidth()
581
	  || y > imagePanel.getImageHeight())
582
	{
279 swalkenh 583
	  gui.getStatusInterface().setPoint(null);
584
	}
327 swalkenh 585
	else {
586
	  gui.getStatusInterface().setPoint(new Point(x, y));
587
	}
279 swalkenh 588
  }
589
 
521 swalkenh 590
  /**
591
   * invoked when the mouse has been clicked on a component
592
   * 
593
   * @param e  .....................
594
   */
279 swalkenh 595
  public void mouseClicked(MouseEvent e)
596
  {
327 swalkenh 597
  }
598
279 swalkenh 599
 
327 swalkenh 600
   * invoked when a mouse button has been pressed on a Component
601
   * 
602
   * @param e  ..............
603
   */
604
  public void mousePressed(MouseEvent e)
605
  {
606
  }
607
279 swalkenh 608
  /**
609
 
521 swalkenh 610
   * 
611
   * @param e  ......................
612
   */
613
  public void mouseReleased(MouseEvent e)
614
  {
279 swalkenh 615
  }
616
617
  /**
618
 
521 swalkenh 619
   * 
620
   * @param e ...............
621
   */
622
  public void mouseEntered(MouseEvent e)
623
  {
279 swalkenh 624
  }
625
626
  /**
627
 
521 swalkenh 628
   * 
629
   * @param e ................
630
   */
631
  public void mouseExited(MouseEvent e)
632
  {
279 swalkenh 633
	if(e.getSource() == imagePanel) {
634
	  gui.getStatusInterface().setPoint(null);
635
	}
636
 
521 swalkenh 637
638
}PK
639
lsñ.úàQMM0src/plugins/imagePlugin/ImagePluginTransform.xsl<!-- to-direction - status: ready for pictureviewer
640
     updated to given schema from 15/07/2003 
641
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
279 swalkenh 642
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
643
<xsl:output method="xml" indent="yes" />
644
645
 
521 swalkenh 646
<xsl:template match="/">
647
	<xsl:apply-templates />
648
</xsl:template>
649
650
279 swalkenh 651
<xsl:template match="PHOTO"><!-- element-plugin association -->
652
	<xsl:element name="IMAGE">
327 swalkenh 653
		<!-- work on attributes and childs -->
654
		<xsl:attribute name="name">
655
			<xsl:value-of select="@label" />
279 swalkenh 656
		</xsl:attribute>
348 swalkenh 657
 
521 swalkenh 658
			<xsl:value-of select="@uri" />
556 swalkenh 659
 
660
		<xsl:for-each select="attribute::*">
661
			<xsl:if test = "not(name(.) = ('label'))">
539 swalkenh 662
			<xsl:if test = "not(name(.) = ('uri'))">
663
				<xsl:attribute name="{name(.)}">
664
 
665
 
666
			</xsl:if></xsl:if>
667
		</xsl:for-each>
668
		<xsl:for-each select="node()">
669
 
670
 
545 swalkenh 671
	</xsl:element>
539 swalkenh 672
</xsl:template>
673
674
<xsl:template match="Bild"><!-- element-plugin association -->
675
	<xsl:element name="IMAGE">
676
		<!-- work on attributes and childs -->
677
		<xsl:attribute name="name">
556 swalkenh 678
			<xsl:value-of select="@Name" />
539 swalkenh 679
		</xsl:attribute>
680
		<xsl:attribute name="url">
681
			<xsl:value-of select="@Pfad" />
556 swalkenh 682
		</xsl:attribute>
539 swalkenh 683
		<xsl:for-each select="attribute::*">
684
			<xsl:if test = "not(name(.) = ('Name'))">
685
			<xsl:if test = "not(name(.) = ('Pfad'))">
686
				<xsl:attribute name="{name(.)}">
687
					<xsl:value-of select="self::node()" />
688
				</xsl:attribute>
689
			</xsl:if></xsl:if>
690
		</xsl:for-each>
691
		<xsl:for-each select="node()">
692
			<xsl:copy-of select="self::node()" />
693
 
545 swalkenh 694
	</xsl:element>
539 swalkenh 695
</xsl:template>
696
697
<xsl:template match="Picture"><!-- element-plugin association -->
698
	<xsl:element name="IMAGE">
699
		<!-- work on attributes and childs -->
700
		<xsl:attribute name="name">
701
			<xsl:value-of select="@Name" />
702
		</xsl:attribute>
703
		<xsl:attribute name="url">
704
			<xsl:value-of select="@Path" />
705
		</xsl:attribute>
706
		<xsl:for-each select="attribute::*">
707
			<xsl:if test = "not(name(.) = ('Name'))">
708
			<xsl:if test = "not(name(.) = ('Path'))">
709
				<xsl:attribute name="{name(.)}">
710
					<xsl:value-of select="self::node()" />
711
				</xsl:attribute>
712
			</xsl:if></xsl:if>
713
		</xsl:for-each>
714
		<xsl:for-each select="node()">
715
			<xsl:copy-of select="self::node()" />
716
 
545 swalkenh 717
	</xsl:element>
539 swalkenh 718
</xsl:template>
719
720
<xsl:template match="IMAGE"><!-- element-plugin association -->
721
	<xsl:element name="IMAGE">
722
		<!-- work on attributes and childs -->
723
		<xsl:attribute name="name">
724
			<xsl:value-of select="@label" />
725
		</xsl:attribute>
726
		<xsl:attribute name="url">
727
			<xsl:value-of select="@uri" />
728
		</xsl:attribute>
729
		<xsl:for-each select="attribute::*">
730
			<xsl:if test = "not(name(.) = ('label'))">
731
			<xsl:if test = "not(name(.) = ('uri'))">
732
				<xsl:attribute name="{name(.)}">
733
					<xsl:value-of select="self::node()" />
734
				</xsl:attribute>
735
			</xsl:if></xsl:if>
736
		</xsl:for-each>
737
		<xsl:for-each select="node()">
738
			<xsl:copy-of select="self::node()" />
739
 
545 swalkenh 740
	</xsl:element>
556 swalkenh 741
</xsl:template>
742
743
744
</xsl:stylesheet>PK
745
hsñ.cotÀÀ4src/plugins/imagePlugin/ImagePluginTransformBack.xsl<!-- back-direction - status: ready for pictureviewer
746
     updated to given schema from 15/07/2003 
747
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
748
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
749
<xsl:output method="xml" indent="yes" />
750
751
752
<xsl:template match="/">
753
	<xsl:apply-templates />
754
</xsl:template>
755
756
757
<xsl:template match="PHOTO">
758
	<xsl:element name="PHOTO">
759
		<!-- work on attributes and childs -->
760
		<xsl:attribute name="label">
539 swalkenh 761
			<xsl:value-of select="@name" />
762
 
763
 
240 swalkenh 764
			<xsl:value-of select="@url" />
556 swalkenh 765
 
766
		<xsl:for-each select="attribute::*">
767
			<xsl:if test = "not(name(.) = ('name'))">
539 swalkenh 768
			<xsl:if test = "not(name(.) = ('url'))">
769
				<xsl:attribute name="{name(.)}">
770
 
771
 
772
			</xsl:if></xsl:if>
773
		</xsl:for-each>
774
		<xsl:for-each select="node()">
775
 
776
 
777
	</xsl:element>
778
</xsl:template>
779
780
<xsl:template match="Bild">
781
	<xsl:element name="Bild">
782
		<!-- work on attributes and childs -->
556 swalkenh 783
		<xsl:attribute name="Name">
539 swalkenh 784
			<xsl:value-of select="@name" />
785
		</xsl:attribute>
786
		<xsl:attribute name="Pfad">
787
			<xsl:value-of select="@url" />
788
		</xsl:attribute>
789
		<xsl:for-each select="attribute::*">
790
			<xsl:if test = "not(name(.) = ('name'))">
791
			<xsl:if test = "not(name(.) = ('url'))">
792
				<xsl:attribute name="{name(.)}">
793
					<xsl:value-of select="self::node()" />
794
				</xsl:attribute>
795
			</xsl:if></xsl:if>
796
		</xsl:for-each>
797
		<xsl:for-each select="node()">
798
			<xsl:copy-of select="self::node()" />
799
 
800
	</xsl:element>
801
</xsl:template>
802
803
<xsl:template match="Picture">
804
	<xsl:element name="Picture">
805
		<!-- work on attributes and childs -->
806
		<xsl:attribute name="Name">
807
			<xsl:value-of select="@name" />
808
		</xsl:attribute>
809
		<xsl:attribute name="Path">
810
			<xsl:value-of select="@url" />
811
		</xsl:attribute>
812
		<xsl:for-each select="attribute::*">
813
			<xsl:if test = "not(name(.) = ('name'))">
814
			<xsl:if test = "not(name(.) = ('url'))">
815
				<xsl:attribute name="{name(.)}">
816
					<xsl:value-of select="self::node()" />
817
				</xsl:attribute>
818
			</xsl:if></xsl:if>
819
		</xsl:for-each>
820
		<xsl:for-each select="node()">
821
			<xsl:copy-of select="self::node()" />
822
 
823
	</xsl:element>
824
</xsl:template>
825
826
<xsl:template match="IMAGE">
827
	<xsl:element name="IMAGE">
828
		<!-- work on attributes and childs -->
829
		<xsl:attribute name="label">
830
			<xsl:value-of select="@name" />
831
		</xsl:attribute>
832
		<xsl:attribute name="uri">
833
			<xsl:value-of select="@url" />
834
		</xsl:attribute>
835
		<xsl:for-each select="attribute::*">
836
			<xsl:if test = "not(name(.) = ('name'))">
837
			<xsl:if test = "not(name(.) = ('url'))">
838
				<xsl:attribute name="{name(.)}">
839
					<xsl:value-of select="self::node()" />
840
				</xsl:attribute>
841
			</xsl:if></xsl:if>
842
		</xsl:for-each>
843
		<xsl:for-each select="node()">
844
			<xsl:copy-of select="self::node()" />
845
 
846
	</xsl:element>
556 swalkenh 847
</xsl:template>
848
849
850
</xsl:stylesheet>PK
851
852
ëtñ.	META-INF/þÊPK
853
854
ëtñ.
855
×Z6+META-INF/MANIFEST.MFPK
856
857
Òrñ.™ùP(^src/plugins/imagePlugin/ImagePanel.classPK
858
859
êð.îõ–[['¾
860
src/plugins/imagePlugin/ImagePanel.javaPK
861
862
ãtñ.Ø•Ñ
863
ÉÉ)^src/plugins/imagePlugin/ImagePlugin.classPK
864
865
âtñ.WéD ð)ð)(n3src/plugins/imagePlugin/ImagePlugin.javaPK
866
539 swalkenh 867
lsñ.úàQMM0¤]src/plugins/imagePlugin/ImagePluginTransform.xslPK
868
 
869