Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
607 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
607 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
§ƒò.Ù³¨ÕÏ!Ï!)src/plugins/imagePlugin/ImagePlugin.classÊþº¾-Ê#src/plugins/imagePlugin/ImagePluginjavax/swing/JPanelsrc/plugins/PluginInterfacejava/awt/event/ActionListener"java/awt/event/MouseMotionListener	java/awt/event/MouseListener
161
pluginNameLjava/lang/String;
ConstantValueImageViewerimageLjava/awt/Image;imageNameFieldLjavax/swing/JTextField;
confirmButtonLjavax/swing/JButton;imageFileLabelLjavax/swing/JLabel;fileChooserLjavax/swing/JFileChooser;openFileButton
348 swalkenh 162
imagePanel$Lsrc/plugins/imagePlugin/ImagePanel;guiLsrc/gui/GuiInterface;ourEventListenerLsrc/control/OurEventListener;	imageNameimageUrlcurrentFileLjava/io/File;oldNodeLorg/w3c/dom/Node;changedNode<init>()VCode*+
607 swalkenh 163
 
521 swalkenh 164
2-	4javax/swing/JButton6Confirm8(Ljava/lang/String;)V*:
607 swalkenh 165
7;	=javax/swing/JLabel?
166
@-	Bjavax/swing/JFileChooserD
167
E-	GOpen...I	K"src/plugins/imagePlugin/ImagePanelM
168
 
169
 
170
 
171
 
172
 
173
 
174
 
175
 
176
 
177
 
178
 
179
 
180
 
181
 
182
 
183
 
184
¯¹java/io/PrintStream»println½:
185
 
186
new node: Âname: Äorg/w3c/dom/NodeÆgetNodeNameȸÇÉ,(Ljava/lang/String;)Ljava/lang/StringBuffer;³Ë
187
¯ÌprintÎ:
188
 
189
 
190
 
191
 
192
	loadImage:
193
 
194
 
195
'src/control/OurEvent)java/lang/Object+([Ljava/lang/Object;)V*-
196
 
197
CE
198
 
199
startsWith(Ljava/lang/String;)ZJK
200
ILvalueOf&(Ljava/lang/Object;)Ljava/lang/String;NO
201
 
202
 
203
 
204
C;#(Ljava/io/File;Ljava/lang/String;)V*_
205
C`javax/imageio/ImageIObread.(Ljava/io/File;)Ljava/awt/image/BufferedImage;de
206
cfShow image from hgetLogInterface()Lsrc/gui/LogInterface;jk–lCannot open file nsrc/gui/LogInterfaceplog(ILjava/lang/String;)Vrsqt
207
@setImage(Ljava/awt/Image;)Vwx
208
Nyjava/io/IOException{fileNamedocexLjava/io/IOException;actionPerformed(Ljava/awt/event/ActionEvent;)Vjava/util/EventObjectƒ	getSource()Ljava/lang/Object;…†
209
„‡getText‰¸
210
Š+
211
ŒsetSelectedFile(Ljava/io/File;)VŽ
212
E
getMainWindow()Ljava/awt/Frame;’“–”showOpenDialog(Ljava/awt/Component;)I–—
213
E˜getSelectedFileš?
214
E›getPath¸
215
CžLjava/awt/event/ActionEvent;mouseDragged(Ljava/awt/event/MouseEvent;)Vjava/awt/event/MouseEvent£getX¥å
216
¤¦getY¨å
217
 
218
 
219
mouseMovedgetDx°å
220
N±getDy³å
221
 
222
 
223
Nºjava/awt/Point¼
224
 
225
 
226

 !"#$%&'()(*+,É
*·.*µ0*»2Y·3µ5*»7Y9·<µ>*»@Y·AµC*»EY·FµH*»7YJ·<µL*»NY·OµQ*»SY·T¶Z*´Q*¶`*´Q*¶d»Y·.L+»SY·T¶Z+*´5¶hW+*´>j¶m»Y·.M,»oYð·r¶x,»SY·T¶Z,*´C¶hW,*´Lj¶m»Y·.N-»SY·T¶Z-+¶hW-,j¶m*-z¶m**´Q¶hW*´>*¶€*´L*¶€*¶„±…zl>
227
DG"J-M8PESPp[qcrkusv~w‡x‘|™}©~´½€ÇƒÏ„Ú…à†çˆî‰÷‹ÿŒŽ†*
‡ˆsš‰Š™t‹ŠÏ>ŒŠŽ,>*+µ±…
228
˜™†‡ˆ ‘’,.b*+µ”*´¹š¹ *´¹š¹£*´¹š¹§²­»¯Y±·²+¶¶¶º¶¿+Dz­Á¶¿§ë²­ö¿²­»¯YÅ·²+¹Ê¶Í¶º¶Ð²­Ò¶Ð+¹ÖN-ÆN6§=²­»¯YØ·²-¹Þ¹Ê¶Íà¶Í-¹Þ¹ã¶Í¶º¶Ð„-¹ç¡ÿ¾²­¶é²­»¯Yë·²+¹ï¶ò¶º¶¿+¹Ö:*ô¹ø¹ãµú*ü¹ø¹ãµþ²­»¯Y·²*´þ¶Í¶º¶¿*´5*´ú¶**´þ·*´*¹*¶„±…v£¤¥#¦2¨HªL«W®_¯z°‚±‰²³“´–´¯µÄ´Ê³Ø¸Þ»ù¼½¾%¿?ÂJÃRÆ\ÇaȆ>b‡ˆb
(b‰¶H>+,m3*¶„*´¹š¹ *´¹š¹£*´¹š¹§±…ÏÐÑ#Ò2ӆ3‡ˆ,>*+µ±…
229
 
230
ce)f5hGk_m†4`‡ˆ`¿`À
231
 
232
 
233
 * This file contains the ImagePlugin class.
234
 
235
 
236
 * University of Bielefeld, Germany
279 swalkenh 237
 * 
238
 * @version $Revision: 1.17 $
607 swalkenh 239
 
240
 
241
 * $Id: ImagePlugin.java,v 1.17 2003/07/17 14:22:10 cstollen Exp $
242
 
243
 
244
 
245
 
246
 
247
 
248
import java.awt.Image;
249
 
250
 
521 swalkenh 251
import java.awt.event.ActionListener;
252
import java.awt.event.MouseEvent;
253
import java.awt.event.MouseListener;
254
import java.awt.event.MouseMotionListener;
255
import java.awt.Point;
607 swalkenh 256
521 swalkenh 257
import java.io.File;
607 swalkenh 258
import java.io.IOException;
259
327 swalkenh 260
//import org.apache.xpath.XPathAPI;
279 swalkenh 261
 
262
//modified 10.07.03 Sascha W. cause of new PluginInterface
263
 
521 swalkenh 264
import org.w3c.dom.NamedNodeMap;
265
import org.w3c.dom.Document;
266
import org.w3c.dom.Node;
267
 
268
import javax.swing.JButton;
269
import javax.swing.JFileChooser;
270
import javax.swing.JLabel;
271
import javax.swing.JPanel;
272
import javax.swing.JTextField;
273
274
 
275
276
import src.control.OurEvent;
277
 
278
import src.gui.*;
279
 
327 swalkenh 280
281
521 swalkenh 282
/**
283
 * Image plugin shows any images.
284
 *
279 swalkenh 285
 
521 swalkenh 286
 */
287
public class ImagePlugin extends JPanel
288
  implements PluginInterface, ActionListener,
289
  MouseMotionListener, MouseListener
290
{
291
 
292
  /** Name of the plugin, used in method <code>firePluginChangedElement</code> */
293
 
348 swalkenh 294
	
295
  /* The current image. */
279 swalkenh 296
  private Image image;
348 swalkenh 297
  
279 swalkenh 298
 
299
 
300
  
521 swalkenh 301
  /* A button "Confirm" to change the image name and url in the node. */
327 swalkenh 302
  private JButton confirmButton = new JButton("Confirm");
521 swalkenh 303
 
327 swalkenh 304
  /* A label to show the name of the current image file. */
279 swalkenh 305
  private JLabel imageFileLabel = new JLabel();
306
 
307
  /* A file chooser to choose an image file. */
308
  private JFileChooser fileChooser = new JFileChooser();
521 swalkenh 309
  
310
  /* A button "Open..." to change images. */
311
  private JButton openFileButton = new JButton("Open...");
312
 
313
  /* An image panel to show an image in. */
279 swalkenh 314
  private ImagePanel imagePanel = new ImagePanel();
521 swalkenh 315
 
316
  /* Stores a reference to the GUI. */
279 swalkenh 317
  private GuiInterface gui;
521 swalkenh 318
 
607 swalkenh 319
  //added 11/07/03 Sascha W.; own events are available now
320
  /* Stores a reference to the event listener. */
521 swalkenh 321
 
322
279 swalkenh 323
  /* the image's name from the attributes of the selected node */
521 swalkenh 324
 
325
  
279 swalkenh 326
  /* the location of the image */
521 swalkenh 327
 
328
  
279 swalkenh 329
  /* The current file. */
521 swalkenh 330
 
331
  
279 swalkenh 332
  /* The node given from the basis program. */
521 swalkenh 333
 
334
  
279 swalkenh 335
  /* The node returned to the basis program. */
521 swalkenh 336
 
348 swalkenh 337
521 swalkenh 338
  /** The class constructor creates all elements for the image plugin. */
348 swalkenh 339
  public ImagePlugin()
521 swalkenh 340
 
607 swalkenh 341
    
342
	// sets new layout
521 swalkenh 343
 
607 swalkenh 344
	imagePanel.addMouseListener(this);
345
	imagePanel.addMouseMotionListener(this);
521 swalkenh 346
 
347
	// left panel: text field to enter name of image,
279 swalkenh 348
	JPanel leftPanel = new JPanel();
607 swalkenh 349
 
350
	leftPanel.add(imageNameField);
351
	leftPanel.add(confirmButton, BorderLayout.EAST);
352
 
353
	// right panel: label to show name of image file,
354
	//              open button to change images
279 swalkenh 355
 
521 swalkenh 356
	rightPanel.setPreferredSize(new Dimension(240, 24));
279 swalkenh 357
	rightPanel.setLayout(new BorderLayout());
358
	rightPanel.add(imageFileLabel);
327 swalkenh 359
 
360
361
	// top panel contains left and right panels
362
	JPanel topPanel = new JPanel();
363
	topPanel.setLayout(new BorderLayout());
279 swalkenh 364
 
327 swalkenh 365
	topPanel.add(rightPanel, BorderLayout.EAST);
366
367
	add(topPanel, BorderLayout.NORTH);
368
	add(imagePanel);
607 swalkenh 369
279 swalkenh 370
 
327 swalkenh 371
	openFileButton.addActionListener(this);
372
373
	setVisible(false);
374
  }
375
376
  /**
377
   * Initializes the plugin.
279 swalkenh 378
 
327 swalkenh 379
   * @param gui: A reference to the GUI object.
380
   */  
381
  public void init(GuiInterface gui) {
382
	
383
	this.gui = gui;
279 swalkenh 384
 
327 swalkenh 385
386
  /**
279 swalkenh 387
 
607 swalkenh 388
   * 
327 swalkenh 389
   * @param element        the element that user has chosen
279 swalkenh 390
 
327 swalkenh 391
   */
279 swalkenh 392
  public void start(Node node, Document environment)
393
 
327 swalkenh 394
  	oldNode = node;
521 swalkenh 395
	gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
327 swalkenh 396
	gui.getStatusInterface().setMessage(null);
521 swalkenh 397
	gui.getStatusInterface().setPoint(null);
327 swalkenh 398
521 swalkenh 399
	System.out.println("ImagePlugin gets node: " + node);
400
 
327 swalkenh 401
	if (node == null) {
279 swalkenh 402
		System.out.println("new node is \"null\"");
403
 
327 swalkenh 404
	else {
521 swalkenh 405
		System.out.println("new node: ");
327 swalkenh 406
		System.out.print("name: " + node.getNodeName());
521 swalkenh 407
		System.out.print("; attributes: ");
408
		NamedNodeMap l = node.getAttributes();
327 swalkenh 409
		if (l != null) {
607 swalkenh 410
			for (int i = 0; i < l.getLength(); i++) {
279 swalkenh 411
				System.out.print(" \"" + l.item(i).getNodeName() 
607 swalkenh 412
								+ "\"=" + l.item(i).getNodeValue());
327 swalkenh 413
			}
414
		}
415
		System.out.println();
279 swalkenh 416
 
607 swalkenh 417
		//added and modified 14.07.03 Sascha W. during testing of transformations
418
 
419
		NamedNodeMap nodeAttr = node.getAttributes();
539 swalkenh 420
		imageName = nodeAttr.getNamedItem("name").getNodeValue();  //findImageName(element);
421
		imageUrl = nodeAttr.getNamedItem("url").getNodeValue();  //findFileName(element);
422
		System.out.println("imageUrl: " + imageUrl);
423
	}
607 swalkenh 424
	
539 swalkenh 425
	imageNameField.setText(imageName);
607 swalkenh 426
	loadImage(imageUrl);
539 swalkenh 427
428
	//added  15.07.03 Sascha W. was nonsene in method "init"
429
	gui.setPluginPanel(this);
430
	setVisible(true);
431
  }
432
433
  /**
434
 
435
   */
607 swalkenh 436
  public void stop()
437
  {
438
	setVisible(false);
439
	gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
440
	gui.getStatusInterface().setMessage(null);
539 swalkenh 441
	gui.getStatusInterface().setPoint(null);
521 swalkenh 442
 
327 swalkenh 443
607 swalkenh 444
//====================================================================================
279 swalkenh 445
 
521 swalkenh 446
447
  //added 11/07/03 Sascha W.; own events are available now
327 swalkenh 448
  /* (non-Javadoc)
279 swalkenh 449
   * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
450
 
327 swalkenh 451
  public void setOurEventListener(OurEventListener newListener) {
521 swalkenh 452
	  ourEventListener = newListener;
327 swalkenh 453
  }
279 swalkenh 454
455
327 swalkenh 456
  //added 11/07/03 Sascha W.; own events are available now
457
  /**
458
   * Forces the text editor plugin to return the actual status as a node, 'cause
459
   * not well-formed parts have to be capsuled into a prosessing instruction.
279 swalkenh 460
   * 
461
 
327 swalkenh 462
   */
463
  public void forceStatusReport() {
348 swalkenh 464
 
465
		changedNode.getAttributes().getNamedItem("url").setNodeValue(imageUrl);
327 swalkenh 466
		changedNode.getAttributes().getNamedItem("name").setNodeValue(imageName);
348 swalkenh 467
		firePluginChangedElement(oldNode, changedNode);
468
  }
469
	
470
	
471
  //added 11/07/03 Sascha W.; own events are available now
472
 
473
 
474
	  ourEventListener.firedOurEvent(e);
475
  }
521 swalkenh 476
477
//====================================================================================
348 swalkenh 478
327 swalkenh 479
  /**
480
   *  loads image
481
   * 
607 swalkenh 482
   *  @param fileName    the file name that must be shown  
483
   */
484
  private void loadImage(String fileName)
485
  {
279 swalkenh 486
	//	file is absent
348 swalkenh 487
 
488
 
489
	// file name is absent: status panel - "No image"
607 swalkenh 490
	if(fileName == null) {
491
	  image = null;
348 swalkenh 492
	  gui.getStatusInterface().setIcon(StatusInterface.ICON_WARNING);
493
	  gui.getStatusInterface().setMessage("No image");
494
 
327 swalkenh 495
	// get the current file from the directory where the doc is
279 swalkenh 496
 
327 swalkenh 497
	  try {
521 swalkenh 498
		File doc = gui.getCurrentFile();
327 swalkenh 499
		if(fileName.startsWith(doc.getParentFile().toString())) {
521 swalkenh 500
			fileName = fileName.replaceFirst(doc.getParentFile().toString() + "/", "");
327 swalkenh 501
		}
279 swalkenh 502
		if(fileName.charAt(0) == '/')
503
		  currentFile = new File(fileName);
521 swalkenh 504
		else {
327 swalkenh 505
		  currentFile = new File(doc.getParentFile(), fileName);
279 swalkenh 506
 
521 swalkenh 507
327 swalkenh 508
		image = javax.imageio.ImageIO.read(currentFile);
509
		gui.getStatusInterface().setIcon(StatusInterface.ICON_INFORMATION);
510
		gui.getStatusInterface().setMessage("Show image from " + fileName);
511
	  }
512
	  catch(IOException ex) {
521 swalkenh 513
		gui.getLogInterface().log(
327 swalkenh 514
		  LogInterface.TYPE_ERROR, "Cannot open file " + fileName);
515
		gui.getStatusInterface().setIcon(StatusInterface.ICON_ERROR);
577 swalkenh 516
		gui.getStatusInterface().setMessage("Cannot open file " + fileName);
607 swalkenh 517
	  }
518
	}
519
520
	imageFileLabel.setText(fileName);
327 swalkenh 521
	imagePanel.setImage(image);
522
  }
607 swalkenh 523
327 swalkenh 524
  /**
577 swalkenh 525
 
526
   * 
327 swalkenh 527
   *  @param e      ..................    
528
   */
529
  public void actionPerformed(ActionEvent e)
530
  {
531
	if(e.getSource() == confirmButton) {
532
	  if(imageName != null) {
533
		imageName = imageNameField.getText();
534
		forceStatusReport();
535
	  }
536
	}
279 swalkenh 537
 
327 swalkenh 538
	if(e.getSource() == openFileButton) {
539
	  fileChooser.setSelectedFile(currentFile);
279 swalkenh 540
541
 
327 swalkenh 542
		== JFileChooser.APPROVE_OPTION)
521 swalkenh 543
	  {
327 swalkenh 544
		loadImage(fileChooser.getSelectedFile().getPath());
521 swalkenh 545
		//imageUrl = fileChooser.getSelectedFile().getPath();
327 swalkenh 546
		if(imageUrl != null) {
279 swalkenh 547
		  imageUrl = currentFile.getPath();
548
		}
607 swalkenh 549
	  }
550
	}
551
  }
552
327 swalkenh 553
554
  /**
279 swalkenh 555
 
327 swalkenh 556
   * 
557
   * @param e  ..................
279 swalkenh 558
 
327 swalkenh 559
  public void mouseDragged(MouseEvent e)
560
  {
561
	if(e.getSource() == imagePanel && image != null) {
562
	  showMouse(e.getX(), e.getY());
607 swalkenh 563
	}
564
  }
565
327 swalkenh 566
  /**
567
   * invoked when the mouse button has been moved on a component (with no buttons no down)
568
   * 
279 swalkenh 569
   * @param e .................
570
 
521 swalkenh 571
 
572
  {
573
	if(e.getSource() == imagePanel && image != null) {
574
	  showMouse(e.getX(), e.getY());
575
	}
576
  }
279 swalkenh 577
578
  /** 
327 swalkenh 579
   * invoked when ........
580
   * 
581
   * @param e  ....................
279 swalkenh 582
   */
583
 
521 swalkenh 584
  {
585
	int x = mouseX - imagePanel.getDx();
586
	int y = mouseY - imagePanel.getDy();
587
588
	if(x < 0 || y < 0 || x > imagePanel.getImageWidth()
279 swalkenh 589
	  || y > imagePanel.getImageHeight())
590
	{
327 swalkenh 591
	  gui.getStatusInterface().setPoint(null);
592
	}
593
	else {
279 swalkenh 594
	  gui.getStatusInterface().setPoint(new Point(x, y));
595
 
521 swalkenh 596
  }
597
598
  /**
599
   * invoked when the mouse has been clicked on a component
600
   * 
279 swalkenh 601
   * @param e  .....................
602
   */
327 swalkenh 603
  public void mouseClicked(MouseEvent e)
604
  {
279 swalkenh 605
 
327 swalkenh 606
607
  /**
608
   * invoked when a mouse button has been pressed on a Component
609
   * 
610
   * @param e  ..............
611
   */
612
  public void mousePressed(MouseEvent e)
613
  {
279 swalkenh 614
  }
615
 
521 swalkenh 616
  /**
617
   * invoked when a mouse button has been released on a component
618
   * 
619
   * @param e  ......................
620
   */
279 swalkenh 621
  public void mouseReleased(MouseEvent e)
622
  {
623
  }
624
 
521 swalkenh 625
  /**
626
   * invoked when the mouse enters a component
627
   * 
628
   * @param e ...............
629
   */
279 swalkenh 630
  public void mouseEntered(MouseEvent e)
631
  {
632
  }
633
 
521 swalkenh 634
  /**
635
   * invoked when the mouse exits a component
636
   * 
637
   * @param e ................
638
   */
279 swalkenh 639
  public void mouseExited(MouseEvent e)
640
  {
641
	if(e.getSource() == imagePanel) {
642
 
521 swalkenh 643
	}
644
  }
645
646
}PK
647
ù„ò.çG oQQ0src/plugins/imagePlugin/ImagePluginTransform.xsl<!-- to-direction for pictureviewer
279 swalkenh 648
     status: ready
649
     updated to given schema from 15/07/2003 
650
     Last Revision: 18/07/2003 by Sascha Walkenhorst -->
651
 
521 swalkenh 652
<xsl:output method="xml" indent="yes" />
653
654
655
<xsl:template match="/">
656
	<xsl:apply-templates />
279 swalkenh 657
</xsl:template>
658
327 swalkenh 659
660
<xsl:template match="PHOTO"><!-- element-plugin association -->
661
	<xsl:element name="PHOTO">
279 swalkenh 662
		<!-- work on attributes and childs -->
348 swalkenh 663
 
521 swalkenh 664
			<xsl:value-of select="@label" />
607 swalkenh 665
 
666
		<xsl:attribute name="url">
556 swalkenh 667
			<xsl:value-of select="@uri" />
607 swalkenh 668
		</xsl:attribute>
539 swalkenh 669
		<xsl:for-each select="attribute::*">
670
			<xsl:if test = "not(name(.) = ('label'))">
671
 
672
 
673
					<xsl:value-of select="self::node()" />
674
				</xsl:attribute>
675
			</xsl:if></xsl:if>
676
 
677
 
545 swalkenh 678
			<xsl:copy-of select="self::node()" />
607 swalkenh 679
		</xsl:for-each>
539 swalkenh 680
	</xsl:element>
681
</xsl:template>
682
683
<xsl:template match="Bild"><!-- element-plugin association -->
684
	<xsl:element name="Bild">
556 swalkenh 685
		<!-- work on attributes and childs -->
539 swalkenh 686
		<xsl:attribute name="name">
687
			<xsl:value-of select="@Name" />
688
		</xsl:attribute>
556 swalkenh 689
		<xsl:attribute name="url">
539 swalkenh 690
			<xsl:value-of select="@Pfad" />
691
		</xsl:attribute>
692
		<xsl:for-each select="attribute::*">
693
			<xsl:if test = "not(name(.) = ('Name'))">
694
			<xsl:if test = "not(name(.) = ('Pfad'))">
695
				<xsl:attribute name="{name(.)}">
696
					<xsl:value-of select="self::node()" />
697
				</xsl:attribute>
698
			</xsl:if></xsl:if>
699
		</xsl:for-each>
700
 
545 swalkenh 701
			<xsl:copy-of select="self::node()" />
607 swalkenh 702
		</xsl:for-each>
539 swalkenh 703
	</xsl:element>
704
</xsl:template>
705
706
<xsl:template match="Picture"><!-- element-plugin association -->
707
	<xsl:element name="Picture">
708
		<!-- work on attributes and childs -->
709
		<xsl:attribute name="name">
710
			<xsl:value-of select="@Name" />
711
		</xsl:attribute>
712
		<xsl:attribute name="url">
713
			<xsl:value-of select="@Path" />
714
		</xsl:attribute>
715
		<xsl:for-each select="attribute::*">
716
			<xsl:if test = "not(name(.) = ('Name'))">
717
			<xsl:if test = "not(name(.) = ('Path'))">
718
				<xsl:attribute name="{name(.)}">
719
					<xsl:value-of select="self::node()" />
720
				</xsl:attribute>
721
			</xsl:if></xsl:if>
722
		</xsl:for-each>
723
 
545 swalkenh 724
			<xsl:copy-of select="self::node()" />
607 swalkenh 725
		</xsl:for-each>
539 swalkenh 726
	</xsl:element>
727
</xsl:template>
728
729
<xsl:template match="IMAGE"><!-- element-plugin association -->
730
	<xsl:element name="IMAGE">
731
		<!-- work on attributes and childs -->
732
		<xsl:attribute name="name">
733
			<xsl:value-of select="@label" />
734
		</xsl:attribute>
735
		<xsl:attribute name="url">
736
			<xsl:value-of select="@uri" />
737
		</xsl:attribute>
738
		<xsl:for-each select="attribute::*">
739
			<xsl:if test = "not(name(.) = ('label'))">
740
			<xsl:if test = "not(name(.) = ('uri'))">
741
				<xsl:attribute name="{name(.)}">
742
					<xsl:value-of select="self::node()" />
743
				</xsl:attribute>
744
			</xsl:if></xsl:if>
745
		</xsl:for-each>
746
 
545 swalkenh 747
			<xsl:copy-of select="self::node()" />
556 swalkenh 748
		</xsl:for-each>
749
	</xsl:element>
750
</xsl:template>
751
752
753
</xsl:stylesheet>PK
754
xñ.òã$êÃÃ4src/plugins/imagePlugin/ImagePluginTransformBack.xsl<!-- back-direction for pictureviewer
755
     status: ready
756
     updated to given schema from 15/07/2003 
757
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
758
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
759
<xsl:output method="xml" indent="yes" />
760
761
762
<xsl:template match="/">
763
	<xsl:apply-templates />
764
</xsl:template>
765
766
767
<xsl:template match="PHOTO">
539 swalkenh 768
	<xsl:element name="PHOTO">
769
 
770
 
240 swalkenh 771
			<xsl:value-of select="@name" />
607 swalkenh 772
 
773
		<xsl:attribute name="uri">
556 swalkenh 774
			<xsl:value-of select="@url" />
775
		</xsl:attribute>
539 swalkenh 776
		<xsl:for-each select="attribute::*">
777
			<xsl:if test = "not(name(.) = ('name'))">
778
 
779
 
780
					<xsl:value-of select="self::node()" />
781
				</xsl:attribute>
782
			</xsl:if></xsl:if>
783
 
784
 
785
			<xsl:copy-of select="self::node()" />
786
		</xsl:for-each>
787
	</xsl:element>
788
</xsl:template>
789
790
<xsl:template match="Bild">
556 swalkenh 791
	<xsl:element name="Bild">
539 swalkenh 792
		<!-- work on attributes and childs -->
793
		<xsl:attribute name="Name">
794
			<xsl:value-of select="@name" />
795
		</xsl:attribute>
796
		<xsl:attribute name="Pfad">
797
			<xsl:value-of select="@url" />
798
		</xsl:attribute>
799
		<xsl:for-each select="attribute::*">
800
			<xsl:if test = "not(name(.) = ('name'))">
801
			<xsl:if test = "not(name(.) = ('url'))">
802
				<xsl:attribute name="{name(.)}">
803
					<xsl:value-of select="self::node()" />
804
				</xsl:attribute>
805
			</xsl:if></xsl:if>
806
		</xsl:for-each>
807
 
808
			<xsl:copy-of select="self::node()" />
809
		</xsl:for-each>
810
	</xsl:element>
811
</xsl:template>
812
813
<xsl:template match="Picture">
814
	<xsl:element name="Picture">
815
		<!-- work on attributes and childs -->
816
		<xsl:attribute name="Name">
817
			<xsl:value-of select="@name" />
818
		</xsl:attribute>
819
		<xsl:attribute name="Path">
820
			<xsl:value-of select="@url" />
821
		</xsl:attribute>
822
		<xsl:for-each select="attribute::*">
823
			<xsl:if test = "not(name(.) = ('name'))">
824
			<xsl:if test = "not(name(.) = ('url'))">
825
				<xsl:attribute name="{name(.)}">
826
					<xsl:value-of select="self::node()" />
827
				</xsl:attribute>
828
			</xsl:if></xsl:if>
829
		</xsl:for-each>
830
 
831
			<xsl:copy-of select="self::node()" />
832
		</xsl:for-each>
833
	</xsl:element>
834
</xsl:template>
835
836
<xsl:template match="IMAGE">
837
	<xsl:element name="IMAGE">
838
		<!-- work on attributes and childs -->
839
		<xsl:attribute name="label">
840
			<xsl:value-of select="@name" />
841
		</xsl:attribute>
842
		<xsl:attribute name="uri">
843
			<xsl:value-of select="@url" />
844
		</xsl:attribute>
845
		<xsl:for-each select="attribute::*">
846
			<xsl:if test = "not(name(.) = ('name'))">
847
			<xsl:if test = "not(name(.) = ('url'))">
848
				<xsl:attribute name="{name(.)}">
849
					<xsl:value-of select="self::node()" />
850
				</xsl:attribute>
851
			</xsl:if></xsl:if>
852
		</xsl:for-each>
853
 
854
			<xsl:copy-of select="self::node()" />
556 swalkenh 855
		</xsl:for-each>
856
	</xsl:element>
857
</xsl:template>
858
859
860
</xsl:stylesheet>PK
861
862
€…ò.	META-INF/þÊPK
863
864
€…ò.
865
×Z6+META-INF/MANIFEST.MFPK
866
867
§ƒò.™ùP(^src/plugins/imagePlugin/ImagePanel.classPK
868
869
êð.îõ–[['¾
870
src/plugins/imagePlugin/ImagePanel.javaPK
871
872
§ƒò.Ù³¨ÕÏ!Ï!)^src/plugins/imagePlugin/ImagePlugin.classPK
873
874
Å‚ñ.“Ò^f(+(+(t5src/plugins/imagePlugin/ImagePlugin.javaPK
539 swalkenh 875
876
 
877
 
521 swalkenh 878
xñ.òã$êÃÃ4msrc/plugins/imagePlugin/ImagePluginTransformBack.xslPK•–y