You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ar...@locus.apache.org on 2000/04/04 11:47:52 UTC
cvs commit: xml-fop/src/org/apache/fop/viewer Command.java
arved 00/04/04 02:47:52
Modified: src/org/apache/fop/viewer Command.java
Log:
Fix: various, by the AWT Viewer team
Revision Changes Path
1.3 +60 -62 xml-fop/src/org/apache/fop/viewer/Command.java
Index: Command.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/viewer/Command.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Command.java 2000/01/25 13:53:56 1.2
+++ Command.java 2000/04/04 09:47:52 1.3
@@ -1,62 +1,60 @@
-package org.apache.fop.viewer;
-/*
- originally contributed by
- Juergen Verwohlt: Juergen.Verwohlt@af-software.de,
- Rainer Steinkuhle: Rainer.Steinkuhle@af-software.de,
- Stanislav Gorkhover: Stanislav.Gorkhover@af-software.de
- */
-
-import java.awt.event.ActionEvent;
-import javax.swing.AbstractAction;
-import javax.swing.ImageIcon;
-import java.io.File;
-
-
-/**
- * Klasse f�r UI-Kommandos. Die Kommandos k�nnen in das Men�system oder
- * in eine Toolbar eingef�gt werden.<br>
- * <code>Commands</code> unterst�tzen mehrsprachigkeit.<br>
- * Durch �berschreiben der Methode <code>doit<code> kann die Klasse customisiert werden.
- * �ber die Methode <code>undoit</code> kann Undo-Funktionalit�t unterst�tzt werden.<br>
- *
- * @author Juergen.Verwohlt@af-software.de
- * @version 1.0 18.03.99
- */
-public class Command extends AbstractAction {
-
- public static String IMAGE_DIR = "../viewer/images/";
-
- public Command(String name) {
- this(name, (ImageIcon)null);
- }
-
- public Command(String name, ImageIcon anIcon) {
- super(name, anIcon);
- }
-
-
- public Command(String name, ImageIcon anIcon, String path) {
- this(name, anIcon);
- File f = new File (IMAGE_DIR + path + ".gif");
- if (!f.exists()) {
- System.err.println("Icon not found: " + f.getAbsolutePath());
- }
-
- }
-
- public Command(String name, String iconName) {
- this(name, new ImageIcon(IMAGE_DIR + iconName + ".gif"), iconName);
- }
-
- public void actionPerformed(ActionEvent e) {
- doit();
- }
-
- public void doit() {
- System.err.println("Not implemented.");
- }
-
- public void undoit() {
- System.err.println("Not implemented.");
- }
-}
+package org.apache.fop.viewer;
+/*
+ Juergen Verwohlt: Juergen.Verwohlt@jcatalog.com,
+ Rainer Steinkuhle: Rainer.Steinkuhle@jcatalog.com,
+ Stanislav Gorkhover: Stanislav.Gorkhover@jcatalog.com
+ */
+
+import java.awt.event.ActionEvent;
+import javax.swing.AbstractAction;
+import javax.swing.ImageIcon;
+import java.net.*;
+
+
+/**
+ * Klasse f�r UI-Kommandos. Die Kommandos k�nnen in das Men�system oder
+ * in eine Toolbar eingef�gt werden.<br>
+ * <code>Commands</code> unterst�tzen mehrsprachigkeit.<br>
+ * Durch �berschreiben der Methode <code>doit<code> kann die Klasse customisiert werden.
+ * �ber die Methode <code>undoit</code> kann Undo-Funktionalit�t unterst�tzt werden.<br>
+ *
+ * @author Juergen.Verwohlt@jcatalog.com
+ * @version 1.0 18.03.99
+ */
+public class Command extends AbstractAction {
+
+ public static String IMAGE_DIR = "/org/apache/fop/viewer/Images/";
+
+ public Command(String name) {
+ this(name, (ImageIcon)null);
+ }
+
+ public Command(String name, ImageIcon anIcon) {
+ super(name, anIcon);
+ }
+
+
+ public Command(String name, String iconName) {
+ super(name);
+ String path = IMAGE_DIR + iconName + ".gif";
+ URL url = getClass().getResource(path);
+ if (url == null) {
+ System.err.println("Icon not found: " + path);
+ }
+ else
+ putValue(SMALL_ICON, new ImageIcon(url));
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ doit();
+ }
+
+ public void doit() {
+ System.err.println("Not implemented.");
+ }
+
+ public void undoit() {
+ System.err.println("Not implemented.");
+ }
+}