Hi Tom, Am Dienstag, den 21.03.2006, 15:08 -0700 schrieb Tom Tromey: > Roman> 2006-03-21 Roman Kennke <[EMAIL PROTECTED]> > Roman> * javax/swing/text/html/FormView.java > Roman> (MouseEventListener): New inner class. > > This broke the build: > > String data = getImageData(ev.getPoint());
Duh, stupid me. I prepared this at work (and knew that it compiled),
went home, opened an SSH terminal and copy+pasted it into emacs. Only, I
forgot to copy+paste that method too. I really shouldn't check in stuff
late at night...
2006-03-21 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/text/html/FormView.java
(getImageData): New helper method.
/Roman
Index: javax/swing/text/html/FormView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/html/FormView.java,v
retrieving revision 1.2
diff -u -r1.2 FormView.java
--- javax/swing/text/html/FormView.java 21 Mar 2006 21:39:39 -0000 1.2
+++ javax/swing/text/html/FormView.java 22 Mar 2006 08:14:45 -0000
@@ -39,6 +39,7 @@
package javax.swing.text.html;
import java.awt.Component;
+import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -247,4 +248,28 @@
{
// FIXME: Implement this.
}
+
+ /**
+ * Determines the image data that should be submitted in response to a
+ * mouse click on a image. This is either 'x=<p.x>&y=<p.y>' if the name
+ * attribute of the element is null or '' or
+ * <name>.x=<p.x>&<name>.y=<p.y>' when the name attribute is not empty.
+ *
+ * @param p the coordinates of the mouseclick
+ */
+ String getImageData(Point p)
+ {
+ String name = (String) getElement().getAttributes()
+ .getAttribute(HTML.Attribute.NAME);
+ String data;
+ if (name == null || name.equals(""))
+ {
+ data = "x=" + p.x + "&y=" + p.y;
+ }
+ else
+ {
+ data = name + ".x=" + p.x + "&" + name + ".y=" + p.y;
+ }
+ return data;
+ }
}
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
