Subversion Repositories general

Rev

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

PK
€…ò.      META-INF/þÊPK
€…ò.
×Z6META-INF/MANIFEST.MFManifest-Version: 1.0
Comment: you can view images with this plugin
Transform-To-File: src/plugins/imagePlugin/ImagePluginTransform.xsl
Created-By: 1.4.0 (Sun Microsystems Inc.)
Description: ...(todo)
XMLEditor-Plugin-Name: ImageViewer
Class-Path: 
Transform-Fro-File: src/plugins/imagePlugin/ImagePluginTransformBack.x
 sl
Main-Class: src.plugins.imagePlugin.ImagePlugin

Name: src/plugins/imagePlugin
Specification-Version: 0.4 (05/07/03)
Specification-Title: plugin for XMLEditor
Implementation-Version: 0.2 (05/07/03)
Implementation-Title: src.plugins.imagePlugin
Implementation-Vendor: group5, software practice SS_2003, University B
 ielefeld, Germany
Specification-Vendor: group5, software practice SS_2003, University Bi
 elefeld, Germany

PK
§ƒò.™ùP(src/plugins/imagePlugin/ImagePanel.classÊþº¾-a"src/plugins/imagePlugin/ImagePaneljavax/swing/JPaneldxIdy
imageWidthimageHeightimageLjava/awt/Image;<init>()VCode(Z)V
LineNumberTableLocalVariableTablethis$Lsrc/plugins/imagePlugin/ImagePanel;paintComponent(Ljava/awt/Graphics;)Vjavax/swing/JComponentgetWidth()I
  getHeight
java/awt/Component!
getBackground()Ljava/awt/Color;#$
"%java/awt/Graphics'setColor(Ljava/awt/Color;)V)*
(+fillRect(IIII)V-.
(/
      1java/awt/Image3!(Ljava/awt/image/ImageObserver;)I5
465
48java/lang/Math:max(DD)D<=
;>       @       B       D        F  drawImage5(Ljava/awt/Image;IIIILjava/awt/image/ImageObserver;)ZHI
(JgLjava/awt/Graphics;whiwihkxDkyksetImage(Ljava/awt/Image;)VrepaintX
"YgetDxgetDy
getImageWidthgetImageHeight
SourceFileImagePanel.java        

4*·±
*+`ž*¶=*¶ >+*¶&¶,+¶0*´2Æ*´2¶76*´2¶96‡‡o9‡‡o9¸?9

—›‡
oŽ6‡
oŽ6*dlµA*dlµC*µE*µG+*´2*´A*´C¶KW±N01
346!8+95:=;E<N>U?^@gCqD{EF‡HJ\    žžLM™N
”O+rP5hQ=`RSEXTSNOUS
VWF
*+µ2*¶Z±OP      Q


[/*´A¬V\/*´C¬\]/*´E¬b^/*´G¬h_`PK
êð.îõ–[['src/plugins/imagePlugin/ImagePanel.java/* 
 * This file contains the ImagePanel class.
 * 
 * Coded by: Group 5, software practice summer 2003
 * University of Bielefeld, Germany
 * 
 * @version $Revision: 1.6 $
 *
 * Last modification: $Date: 2003/07/15 22:23:20 $
 * $Id: ImagePanel.java,v 1.6 2003/07/15 22:23:20 ioklasse Exp $
 */
 
package src.plugins.imagePlugin;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JPanel;

/**
 *  Image panel shows any images.
 *
 *  @author Yulia Klassen, Viktoriya Zudova
 */
class ImagePanel extends JPanel
{
        /** dx-shift of image according to the left top corner of plugin panel */
        private int dx;
        /** dy-shift of image according to the left top corner of plugin panel */
        private int dy;
        /** width of the image */
        private int imageWidth;
        /** height of the image */
        private int imageHeight;

        /** current image */
        public Image image;

        /** constructor invokes JPanel to create all elements for options dialog */
        public ImagePanel()
        {
                super(true);
        }

        /** draws the image */
        public void paintComponent(Graphics g)
        {
                int w  = getWidth();
                int h  = getHeight();

                g.setColor(getBackground());
                g.fillRect(0, 0, w, h);

                if(image != null)
                {
                        int iw = image.getWidth(null);
                        int ih = image.getHeight(null);
                        double kx = (double)iw/w;
                        double ky = (double)ih/h;
                        double k = Math.max(kx, ky);

                        if(k >= 1) {
                          iw = (int)(iw/k);
                          ih = (int)(ih/k);
                        }

                        dx = (w-iw)/2;
                        dy = (h-ih)/2;
                        imageWidth = iw;
                        imageHeight = ih;

                        g.drawImage(image, dx, dy, iw, ih, null);
                }
        }

        /** sets the image */
        public void setImage(Image image)
        {
                this.image = image;
                repaint();
        }

        /** returns dx-shift of image according to the left top corner of plugin panel */
        public int getDx()
        {
                return dx;
        }

        /** returns dy-shift of image according to the left top corner of plugin panel */
        public int getDy()
        {
                return dy;
        }

        /** returns width of the image */
        public int getImageWidth()
        {
                return imageWidth;
        }

        /**  returns height of the image */
        public int getImageHeight()
        {
                return imageHeight;
        }
}PK
§ƒò.Ù³¨ÕÏ!Ï!)src/plugins/imagePlugin/ImagePlugin.classÊþº¾-Ê#src/plugins/imagePlugin/ImagePluginjavax/swing/JPanelsrc/plugins/PluginInterfacejava/awt/event/ActionListener"java/awt/event/MouseMotionListener  java/awt/event/MouseListener
pluginNameLjava/lang/String;
ConstantValueImageViewerimageLjava/awt/Image;imageNameFieldLjavax/swing/JTextField;
confirmButtonLjavax/swing/JButton;imageFileLabelLjavax/swing/JLabel;fileChooserLjavax/swing/JFileChooser;openFileButton
imagePanel$Lsrc/plugins/imagePlugin/ImagePanel;guiLsrc/gui/GuiInterface;ourEventListenerLsrc/control/OurEventListener;  imageNameimageUrlcurrentFileLjava/io/File;oldNodeLorg/w3c/dom/Node;changedNode<init>()VCode*+
-
       /javax/swing/JTextField1
2-       4javax/swing/JButton6Confirm8(Ljava/lang/String;)V*:
7;       =javax/swing/JLabel?
@-       Bjavax/swing/JFileChooserD
E-       GOpen...I  K"src/plugins/imagePlugin/ImagePanelM
N-       Pjava/awt/BorderLayoutR
S-java/awt/ContainerU  setLayout(Ljava/awt/LayoutManager;)VWX
VYjava/awt/Component[addMouseListener!(Ljava/awt/event/MouseListener;)V]^
\_addMouseMotionListener'(Ljava/awt/event/MouseMotionListener;)Vab
\cadd*(Ljava/awt/Component;)Ljava/awt/Component;ef
VgEasti)(Ljava/awt/Component;Ljava/lang/Object;)Vek
Vljava/awt/Dimensionn(II)V*p
oqjavax/swing/JComponentssetPreferredSize(Ljava/awt/Dimension;)Vuv
twNorthyjavax/swing/AbstractButton{addActionListener"(Ljava/awt/event/ActionListener;)V}~
|
setVisible(Z)V‚
tƒLineNumberTableLocalVariableTablethis%Lsrc/plugins/imagePlugin/ImagePlugin;   leftPanelLjavax/swing/JPanel;
rightPaneltopPanelinit(Lsrc/gui/GuiInterface;)V    start+(Lorg/w3c/dom/Node;Lorg/w3c/dom/Document;)V'(        “src/gui/GuiInterface•getStatusInterface()Lsrc/gui/StatusInterface;—˜–™src/gui/StatusInterface›setIcon(I)VžœŸ
setMessage¡:œ¢setPoint(Ljava/awt/Point;)V¤¥œ¦java/lang/System¨outLjava/io/PrintStream;ª«      ©¬java/lang/StringBuffer®ImagePlugin gets node: °
¯;append,(Ljava/lang/Object;)Ljava/lang/StringBuffer;³´
¯µtoString()Ljava/lang/String;·¸
¯¹java/io/PrintStream»println½:
¼¾new node is "null"À
new node: Âname: Äorg/w3c/dom/NodeÆgetNodeNameȸÇÉ,(Ljava/lang/String;)Ljava/lang/StringBuffer;³Ë
¯ÌprintÎ:
¼Ï; attributes: Ñ
getAttributes()Lorg/w3c/dom/NamedNodeMap;ÓÔÇÕ "×org/w3c/dom/NamedNodeMapÙitem(I)Lorg/w3c/dom/Node;ÛÜÚÝ"=ßgetNodeValueá¸Çâ   getLength()IäåÚæ½+
¼èNode has attributes: ê
hasAttributes()ZìíÇî(Z)Ljava/lang/StringBuffer;³ð
¯ñnameógetNamedItem&(Ljava/lang/String;)Lorg/w3c/dom/Node;õöÚ÷#    ùurlû$    ý
imageUrl: ÿjavax/swing/text/JTextComponentsetText:
  loadImage:
setPluginPanel(Ljavax/swing/JPanel;)V       
–nodeenvironmentLorg/w3c/dom/Document;lLorg/w3c/dom/NamedNodeMap;iInodeAttrstopsetOurEventListener!(Lsrc/control/OurEventListener;)V!" newListenerforceStatusReport        cloneNode(Z)Lorg/w3c/dom/Node;Ç)(        setNodeValue":Ç#firePluginChangedElement'(Lorg/w3c/dom/Node;Lorg/w3c/dom/Node;)V%&
'src/control/OurEvent)java/lang/Object+([Ljava/lang/Object;)V*-
*.src/control/OurEventListener0
firedOurEvent(Lsrc/control/OurEvent;)V2314eLsrc/control/OurEvent;%&  8       :No image<getCurrentFile()Ljava/io/File;>?–@java/io/FileB
getParentFileD?
CE
C¹java/lang/StringH
startsWith(Ljava/lang/String;)ZJK
ILvalueOf&(Ljava/lang/Object;)Ljava/lang/String;NO
IP/RTreplaceFirst8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;VW
IXcharAt(I)CZ[
I\
C;#(Ljava/io/File;Ljava/lang/String;)V*_
C`javax/imageio/ImageIObread.(Ljava/io/File;)Ljava/awt/image/BufferedImage;de
cfShow image from hgetLogInterface()Lsrc/gui/LogInterface;jk–lCannot open file nsrc/gui/LogInterfaceplog(ILjava/lang/String;)Vrsqt
@setImage(Ljava/awt/Image;)Vwx
Nyjava/io/IOException{fileNamedocexLjava/io/IOException;actionPerformed(Ljava/awt/event/ActionEvent;)Vjava/util/EventObjectƒ   getSource()Ljava/lang/Object;…†
„‡getText‰¸
Š+
ŒsetSelectedFile(Ljava/io/File;)VŽ
E
getMainWindow()Ljava/awt/Frame;’“–”showOpenDialog(Ljava/awt/Component;)I–—
E˜getSelectedFileš?
E›getPath¸
CžLjava/awt/event/ActionEvent;mouseDragged(Ljava/awt/event/MouseEvent;)Vjava/awt/event/MouseEvent£getX¥å
¤¦getY¨å
¤©        showMouse«p
¬Ljava/awt/event/MouseEvent;
mouseMovedgetDx°å
N±getDy³å
N´
getImageWidth¶å
N·getImageHeight¹å
Nºjava/awt/Point¼
½qmouseXmouseYxymouseClickedmousePressed
mouseReleasedmouseEnteredmouseExited
SourceFileImagePlugin.java!

 !"#$%&'()(*+,É
*·.*µ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>
DG"J-M8PESPp[qcrkusv~w‡x‘|™}©~´½€ÇƒÏ„Ú…à†çˆî‰÷‹ÿŒŽ†*
‡ˆsš‰Š™t‹ŠÏ>ŒŠŽ,>*+µ±…
˜™†‡ˆ ‘’,.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‡ˆ,>*+µ±…
Ýކ‡ˆ"+,‡M**´”¹µ!*´!¹Öü¹ø*´þ¹$*´!¹Öô¹ø*´ú¹$**´”*´!·(±…éê'ë@ìLí†M‡ˆ%&,t$»*Y½,Y+SY,SYS·/N*´-¹5±…òó#ô†*$‡ˆ$'($)(67:,Û3*µ9+Ç+*µ;*´¹š¹ *´¹š=¹£§ñ*´¹AM+,¶F¶G¶M™%+»¯Y,¶F¶G¸Q·²S¶Í¶ºU¶YL+¶]/ *»CY+·^µ9§*»CY,¶F+·aµ9**´9¸gµ;*´¹š¹ *´¹š»¯Yi·²+¶Í¶º¹£§RM*´¹m»¯Yo·²+¶Í¶º¹u*´¹š¹ *´¹š»¯Yo·²+¶Í¶º¹£*´C+¶v*´Q*´;¶z±1ÐÐ|…^      1;I
ku„”Ÿ®ÐÑÚìñ!'"2#†*3‡ˆ3};•~&ÑN€‚,Çk+¶ˆ*´>¦*´úÆ**´5¶‹µú*¶+¶ˆ*´L¦A*´H*´9¶‘*´H*´¹•¶™š#**´H¶œ¶Ÿ·*´þÆ**´9¶Ÿµþ±….,-./!3,476J9X;_<j@†k‡ˆk6 ¡¢,[+¶ˆ*´Q¦*´;Æ*+¶§+¶ª¶­±…JKM†‡ˆ6®¯¢,[+¶ˆ*´Q¦*´;Æ*+¶§+¶ª¶­±…VWY†‡ˆ6®«p,Ê`*´Q¶²d>*´Q¶µd6››*´Q¶¸£*´Q¶»¤*´¹š¹§§*´¹š»½Y·¾¹§±…b
ce)f5hGk_m†4`‡ˆ`¿`À
VÁKÂâ,5±…v†‡ˆ6®Ä¢,5±…†‡ˆ6®Å¢,5±…ˆ†‡ˆ6®Æ¢,5±…‘†‡ˆ6®Ç¢,W+¶ˆ*´Q¦*´¹š¹§±…š›†‡ˆ6®ÈÉPK
Å‚ñ.“Ò^f(+(+(src/plugins/imagePlugin/ImagePlugin.java/* 
 * This file contains the ImagePlugin class.
 * 
 * Coded by: Group 5, software practice summer 2003
 * University of Bielefeld, Germany
 * 
 * @version $Revision: 1.17 $
 *
 * Last modification: $Date: 2003/07/17 14:22:10 $
 * $Id: ImagePlugin.java,v 1.17 2003/07/17 14:22:10 cstollen Exp $
 */

package src.plugins.imagePlugin;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.Point;

import java.io.File;
import java.io.IOException;

//import org.apache.xpath.XPathAPI;

//modified 10.07.03 Sascha W. cause of new PluginInterface
//import java.util.Map;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

//import javax.xml.transform.TransformerException;

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


/**
 * Image plugin shows any images.
 *
 * @author Yulia Klassen, Viktoriya Zudova
 */
public class ImagePlugin extends JPanel
  implements PluginInterface, ActionListener,
  MouseMotionListener, MouseListener
{
  //added 16.07.03 Sascha W. cause method "firedOurEvent" has changed
  /** Name of the plugin, used in method <code>firePluginChangedElement</code> */
  final private String pluginName = "ImageViewer";
        
  /* The current image. */
  private Image image;
  
  /* A text field to enter the name of an image. */
  private JTextField imageNameField = new JTextField();
  
  /* A button "Confirm" to change the image name and url in the node. */
  private JButton confirmButton = new JButton("Confirm");
 
  /* A label to show the name of the current image file. */
  private JLabel imageFileLabel = new JLabel();
 
  /* A file chooser to choose an image file. */
  private JFileChooser fileChooser = new JFileChooser();
  
  /* A button "Open..." to change images. */
  private JButton openFileButton = new JButton("Open...");
  
  /* An image panel to show an image in. */
  private ImagePanel imagePanel = new ImagePanel();
  
  /* Stores a reference to the GUI. */
  private GuiInterface gui;
  
  //added 11/07/03 Sascha W.; own events are available now
  /* Stores a reference to the event listener. */
  private OurEventListener ourEventListener;

  /* the image's name from the attributes of the selected node */
  private String imageName;
  
  /* the location of the image */
  private String imageUrl;
  
  /* The current file. */
  private File currentFile;
  
  /* The node given from the basis program. */
  private Node oldNode;
  
  /* The node returned to the basis program. */
  private Node changedNode;

  /** The class constructor creates all elements for the image plugin. */
  public ImagePlugin()
  {
    
        // sets new layout
        setLayout(new BorderLayout());
        imagePanel.addMouseListener(this);
        imagePanel.addMouseMotionListener(this);

        // left panel: text field to enter name of image,
        JPanel leftPanel = new JPanel();
        leftPanel.setLayout(new BorderLayout());
        leftPanel.add(imageNameField);
        leftPanel.add(confirmButton, BorderLayout.EAST);

        // right panel: label to show name of image file,
        //              open button to change images
        JPanel rightPanel = new JPanel();
        rightPanel.setPreferredSize(new Dimension(240, 24));
        rightPanel.setLayout(new BorderLayout());
        rightPanel.add(imageFileLabel);
        rightPanel.add(openFileButton, BorderLayout.EAST);

        // top panel contains left and right panels
        JPanel topPanel = new JPanel();
        topPanel.setLayout(new BorderLayout());
        topPanel.add(leftPanel);
        topPanel.add(rightPanel, BorderLayout.EAST);

        add(topPanel, BorderLayout.NORTH);
        add(imagePanel);

        confirmButton.addActionListener(this);
        openFileButton.addActionListener(this);

        setVisible(false);
  }

  /**
   * Initializes the plugin.
   * 
   * @param gui: A reference to the GUI object.
   */  
  public void init(GuiInterface gui) {
        
        this.gui = gui;
  }

  /**
   * Starts the plugin
   * 
   * @param element        the element that user has chosen
   * @param environment    the current document   
   */
  public void start(Node node, Document environment)
  {
        oldNode = node;
        gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
        gui.getStatusInterface().setMessage(null);
        gui.getStatusInterface().setPoint(null);

        System.out.println("ImagePlugin gets node: " + node);
        
        if (node == null) {
                System.out.println("new node is \"null\"");
        }
        else {
                System.out.println("new node: ");
                System.out.print("name: " + node.getNodeName());
                System.out.print("; attributes: ");
                NamedNodeMap l = node.getAttributes();
                if (l != null) {
                        for (int i = 0; i < l.getLength(); i++) {
                                System.out.print(" \"" + l.item(i).getNodeName() 
                                                                + "\"=" + l.item(i).getNodeValue());
                        }
                }
                System.out.println();

                //added and modified 14.07.03 Sascha W. during testing of transformations
                System.out.println("Node has attributes: " + node.hasAttributes());
                NamedNodeMap nodeAttr = node.getAttributes();
                imageName = nodeAttr.getNamedItem("name").getNodeValue();  //findImageName(element);
                imageUrl = nodeAttr.getNamedItem("url").getNodeValue();  //findFileName(element);
                System.out.println("imageUrl: " + imageUrl);
        }
        
        imageNameField.setText(imageName);
        loadImage(imageUrl);

        //added  15.07.03 Sascha W. was nonsene in method "init"
        gui.setPluginPanel(this);
        setVisible(true);
  }

  /**
   * Stops the plugin.
   */
  public void stop()
  {
        setVisible(false);
        gui.getStatusInterface().setIcon(StatusInterface.ICON_NONE);
        gui.getStatusInterface().setMessage(null);
        gui.getStatusInterface().setPoint(null);
  }

//====================================================================================
//old removed 10.07.03 Sascha W. cause of new PluginInterface

  //added 11/07/03 Sascha W.; own events are available now
  /* (non-Javadoc)
   * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
   */
  public void setOurEventListener(OurEventListener newListener) {
          ourEventListener = newListener;
  }


  //added 11/07/03 Sascha W.; own events are available now
  /**
   * Forces the text editor plugin to return the actual status as a node, 'cause
   * not well-formed parts have to be capsuled into a prosessing instruction.
   * 
   * @see src.gui.PluginInterface#forceStatusReport()
   */
  public void forceStatusReport() {
                changedNode = oldNode.cloneNode(true);
                changedNode.getAttributes().getNamedItem("url").setNodeValue(imageUrl);
                changedNode.getAttributes().getNamedItem("name").setNodeValue(imageName);
                firePluginChangedElement(oldNode, changedNode);
  }
        
        
  //added 11/07/03 Sascha W.; own events are available now
  private void firePluginChangedElement(Node oldNode, Node changedNode) {
          OurEvent e = new OurEvent(new Object[] {oldNode, changedNode, pluginName});
          ourEventListener.firedOurEvent(e);
  }

//====================================================================================

  /**
   *  loads image
   * 
   *  @param fileName    the file name that must be shown  
   */
  private void loadImage(String fileName)
  {
        //      file is absent
        currentFile = null;

        // file name is absent: status panel - "No image"
        if(fileName == null) {
          image = null;
          gui.getStatusInterface().setIcon(StatusInterface.ICON_WARNING);
          gui.getStatusInterface().setMessage("No image");
        }
        // get the current file from the directory where the doc is
        else {
          try {
                File doc = gui.getCurrentFile();
                if(fileName.startsWith(doc.getParentFile().toString())) {
                        fileName = fileName.replaceFirst(doc.getParentFile().toString() + "/", "");
                }
                if(fileName.charAt(0) == '/')
                  currentFile = new File(fileName);
                else {
                  currentFile = new File(doc.getParentFile(), fileName);
                }

                image = javax.imageio.ImageIO.read(currentFile);
                gui.getStatusInterface().setIcon(StatusInterface.ICON_INFORMATION);
                gui.getStatusInterface().setMessage("Show image from " + fileName);
          }
          catch(IOException ex) {
                gui.getLogInterface().log(
                  LogInterface.TYPE_ERROR, "Cannot open file " + fileName);
                gui.getStatusInterface().setIcon(StatusInterface.ICON_ERROR);
                gui.getStatusInterface().setMessage("Cannot open file " + fileName);
          }
        }

        imageFileLabel.setText(fileName);
        imagePanel.setImage(image);
  }

  /**
   *  reaction of all buttons
   * 
   *  @param e      ..................    
   */
  public void actionPerformed(ActionEvent e)
  {
        if(e.getSource() == confirmButton) {
          if(imageName != null) {
                imageName = imageNameField.getText();
                forceStatusReport();
          }
        }

        if(e.getSource() == openFileButton) {
          fileChooser.setSelectedFile(currentFile);

          if(fileChooser.showOpenDialog(gui.getMainWindow())
                == JFileChooser.APPROVE_OPTION)
          {
                loadImage(fileChooser.getSelectedFile().getPath());
                //imageUrl = fileChooser.getSelectedFile().getPath();
                if(imageUrl != null) {
                  imageUrl = currentFile.getPath();
                }
          }
        }
  }


  /**
   * invoked when a mouse button is pressed on a component 
   * 
   * @param e  ..................
   */
  public void mouseDragged(MouseEvent e)
  {
        if(e.getSource() == imagePanel && image != null) {
          showMouse(e.getX(), e.getY());
        }
  }

  /**
   * invoked when the mouse button has been moved on a component (with no buttons no down)
   * 
   * @param e .................
   */
  public void mouseMoved(MouseEvent e)
  {
        if(e.getSource() == imagePanel && image != null) {
          showMouse(e.getX(), e.getY());
        }
  }

  /** 
   * invoked when ........
   * 
   * @param e  ....................
   */
  public void showMouse(int mouseX, int mouseY)
  {
        int x = mouseX - imagePanel.getDx();
        int y = mouseY - imagePanel.getDy();

        if(x < 0 || y < 0 || x > imagePanel.getImageWidth()
          || y > imagePanel.getImageHeight())
        {
          gui.getStatusInterface().setPoint(null);
        }
        else {
          gui.getStatusInterface().setPoint(new Point(x, y));
        }
  }

  /**
   * invoked when the mouse has been clicked on a component
   * 
   * @param e  .....................
   */
  public void mouseClicked(MouseEvent e)
  {
  }

  /**
   * invoked when a mouse button has been pressed on a Component
   * 
   * @param e  ..............
   */
  public void mousePressed(MouseEvent e)
  {
  }

  /**
   * invoked when a mouse button has been released on a component
   * 
   * @param e  ......................
   */
  public void mouseReleased(MouseEvent e)
  {
  }

  /**
   * invoked when the mouse enters a component
   * 
   * @param e ...............
   */
  public void mouseEntered(MouseEvent e)
  {
  }

  /**
   * invoked when the mouse exits a component
   * 
   * @param e ................
   */
  public void mouseExited(MouseEvent e)
  {
        if(e.getSource() == imagePanel) {
          gui.getStatusInterface().setPoint(null);
        }
  }

}PK
ù„ò.çG oQQ0src/plugins/imagePlugin/ImagePluginTransform.xsl<!-- to-direction for pictureviewer
     status: ready
     updated to given schema from 15/07/2003 
     Last Revision: 18/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="PHOTO"><!-- element-plugin association -->
        <xsl:element name="PHOTO">
                <!-- work on attributes and childs -->
                <xsl:attribute name="name">
                        <xsl:value-of select="@label" />
                </xsl:attribute>
                <xsl:attribute name="url">
                        <xsl:value-of select="@uri" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('label'))">
                        <xsl:if test = "not(name(.) = ('uri'))">
                                <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:template>

<xsl:template match="Bild"><!-- element-plugin association -->
        <xsl:element name="Bild">
                <!-- work on attributes and childs -->
                <xsl:attribute name="name">
                        <xsl:value-of select="@Name" />
                </xsl:attribute>
                <xsl:attribute name="url">
                        <xsl:value-of select="@Pfad" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('Name'))">
                        <xsl:if test = "not(name(.) = ('Pfad'))">
                                <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:template>

<xsl:template match="Picture"><!-- element-plugin association -->
        <xsl:element name="Picture">
                <!-- work on attributes and childs -->
                <xsl:attribute name="name">
                        <xsl:value-of select="@Name" />
                </xsl:attribute>
                <xsl:attribute name="url">
                        <xsl:value-of select="@Path" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('Name'))">
                        <xsl:if test = "not(name(.) = ('Path'))">
                                <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:template>

<xsl:template match="IMAGE"><!-- element-plugin association -->
        <xsl:element name="IMAGE">
                <!-- work on attributes and childs -->
                <xsl:attribute name="name">
                        <xsl:value-of select="@label" />
                </xsl:attribute>
                <xsl:attribute name="url">
                        <xsl:value-of select="@uri" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('label'))">
                        <xsl:if test = "not(name(.) = ('uri'))">
                                <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:template>


</xsl:stylesheet>PK
xñ.òã$êÃÃ4src/plugins/imagePlugin/ImagePluginTransformBack.xsl<!-- back-direction for pictureviewer
     status: ready
     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="PHOTO">
        <xsl:element name="PHOTO">
                <!-- work on attributes and childs -->
                <xsl:attribute name="label">
                        <xsl:value-of select="@name" />
                </xsl:attribute>
                <xsl:attribute name="uri">
                        <xsl:value-of select="@url" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('name'))">
                        <xsl:if test = "not(name(.) = ('url'))">
                                <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:template>

<xsl:template match="Bild">
        <xsl:element name="Bild">
                <!-- work on attributes and childs -->
                <xsl:attribute name="Name">
                        <xsl:value-of select="@name" />
                </xsl:attribute>
                <xsl:attribute name="Pfad">
                        <xsl:value-of select="@url" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('name'))">
                        <xsl:if test = "not(name(.) = ('url'))">
                                <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:template>

<xsl:template match="Picture">
        <xsl:element name="Picture">
                <!-- work on attributes and childs -->
                <xsl:attribute name="Name">
                        <xsl:value-of select="@name" />
                </xsl:attribute>
                <xsl:attribute name="Path">
                        <xsl:value-of select="@url" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('name'))">
                        <xsl:if test = "not(name(.) = ('url'))">
                                <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:template>

<xsl:template match="IMAGE">
        <xsl:element name="IMAGE">
                <!-- work on attributes and childs -->
                <xsl:attribute name="label">
                        <xsl:value-of select="@name" />
                </xsl:attribute>
                <xsl:attribute name="uri">
                        <xsl:value-of select="@url" />
                </xsl:attribute>
                <xsl:for-each select="attribute::*">
                        <xsl:if test = "not(name(.) = ('name'))">
                        <xsl:if test = "not(name(.) = ('url'))">
                                <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:template>


</xsl:stylesheet>PK

€…ò.      META-INF/þÊPK

€…ò.
×Z6+META-INF/MANIFEST.MFPK

§ƒò.™ùP(^src/plugins/imagePlugin/ImagePanel.classPK

êð.îõ–[['¾
src/plugins/imagePlugin/ImagePanel.javaPK

§ƒò.Ù³¨ÕÏ!Ï!)^src/plugins/imagePlugin/ImagePlugin.classPK

Å‚ñ.“Ò^f(+(+(t5src/plugins/imagePlugin/ImagePlugin.javaPK

ù„ò.çG oQQ0â`src/plugins/imagePlugin/ImagePluginTransform.xslPK

xñ.òã$êÃÃ4msrc/plugins/imagePlugin/ImagePluginTransformBack.xslPK•–y