* Makefile.in: Rebuilt.
* Makefile.am (awt_java_source_files): Added Line2D.java.
* java/awt/geom/Line2D.java: Wrote.
* java/awt/Menu.java (addNotify): Wrote.
* java/awt/PopupMenu.java (addNotify): Implemented.
(show): Likewise.
* java/awt/Scrollbar.java (addNotify): Call super.addNotify.
* java/awt/List.java (addNotify): Call super.addNotify.
* java/awt/Label.java (addNotify): Call super.addNotify.
* java/awt/FileDialog.java (addNotify): Call super.addNotify.
* java/awt/Dialog.java (addNotify): Call super.addNotify.
* java/awt/Choice.java (addNotify): Call super.addNotify.
* java/awt/CheckboxMenuItem.java (addNotify): Call super.addNotify.
* java/awt/Checkbox.java (addNotify): Call super.addNotify.
* java/awt/List.java (replaceItem): Notify peer.
* java/awt/geom/Rectangle2D.java
(Float.setRect(float,float,float,float)): New method.
* java/awt/event/ContainerEvent.java (getContainer): Now returns
Container.
* java/awt/RenderingHints.java (Key): Class now public.
* java/awt/Rectangle.java (Rectangle): Now implements
Serializable.
(getPathIterator): Removed.
* java/awt/GraphicsConfiguration.java (GraphicsConfiguration): New
constructor.
* java/awt/FileDialog.java: Wrote.
* java/awt/EventQueue.java (isDispatchThread): Now public.
(invokeLater): Likewise.
* java/awt/Component.java (setCursor): Update peer.
(getFontMetrics): Use peer.
* java/awt/ComponentOrientation.java (ComponentOrientation): Class
now final.
From-SVN: r41489
+2001-04-21 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (awt_java_source_files): Added Line2D.java.
+ * java/awt/geom/Line2D.java: Wrote.
+
+ * java/awt/Menu.java (addNotify): Wrote.
+
+ * java/awt/PopupMenu.java (addNotify): Implemented.
+ (show): Likewise.
+
+ * java/awt/Scrollbar.java (addNotify): Call super.addNotify.
+ * java/awt/List.java (addNotify): Call super.addNotify.
+ * java/awt/Label.java (addNotify): Call super.addNotify.
+ * java/awt/FileDialog.java (addNotify): Call super.addNotify.
+ * java/awt/Dialog.java (addNotify): Call super.addNotify.
+ * java/awt/Choice.java (addNotify): Call super.addNotify.
+ * java/awt/CheckboxMenuItem.java (addNotify): Call super.addNotify.
+ * java/awt/Checkbox.java (addNotify): Call super.addNotify.
+
+ * java/awt/List.java (replaceItem): Notify peer.
+
+ * java/awt/geom/Rectangle2D.java
+ (Float.setRect(float,float,float,float)): New method.
+
+ * java/awt/event/ContainerEvent.java (getContainer): Now returns
+ Container.
+
+ * java/awt/RenderingHints.java (Key): Class now public.
+
+ * java/awt/Rectangle.java (Rectangle): Now implements
+ Serializable.
+ (getPathIterator): Removed.
+
+ * java/awt/GraphicsConfiguration.java (GraphicsConfiguration): New
+ constructor.
+
+ * java/awt/FileDialog.java: Wrote.
+
+ * java/awt/EventQueue.java (isDispatchThread): Now public.
+ (invokeLater): Likewise.
+
+ * java/awt/Component.java (setCursor): Update peer.
+ (getFontMetrics): Use peer.
+
+ * java/awt/ComponentOrientation.java (ComponentOrientation): Class
+ now final.
+
2001-04-20 Tom Tromey <tromey@redhat.com>
* java/awt/List.java: Wrote.
java/awt/geom/Dimension2D.java \
java/awt/geom/Ellipse2D.java \
java/awt/geom/IllegalPathStateException.java \
+java/awt/geom/Line2D.java \
java/awt/geom/NoninvertibleTransformException.java \
java/awt/geom/PathIterator.java \
java/awt/geom/Point2D.java \
libgcj_basedir = @libgcj_basedir@
AUTOMAKE_OPTIONS = foreign
-@TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
-@TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
-@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
-@XLIB_AWT_TRUE@cond_x_ltlibrary = @XLIB_AWT_TRUE@libgcjx.la
-@XLIB_AWT_FALSE@cond_x_ltlibrary =
+@TESTSUBDIR_TRUE@SUBDIRS = \
+@TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
+@TESTSUBDIR_FALSE@SUBDIRS = \
+@TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
+@USE_LIBDIR_TRUE@toolexeclibdir = \
+@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexeclibdir = \
+@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexecdir = \
+@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
+@XLIB_AWT_TRUE@cond_x_ltlibrary = \
+@XLIB_AWT_TRUE@libgcjx.la
+@XLIB_AWT_FALSE@cond_x_ltlibrary = \
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
toolexeclib_DATA = libgcj.spec
data_DATA = libgcj.jar
-@NEEDS_DATA_START_TRUE@toolexeclib_LIBRARIES = @NEEDS_DATA_START_TRUE@libgcjdata.a
-@NEEDS_DATA_START_TRUE@libgcjdata_a_SOURCES = @NEEDS_DATA_START_TRUE@libgcjdata.c
+@NEEDS_DATA_START_TRUE@toolexeclib_LIBRARIES = \
+@NEEDS_DATA_START_TRUE@libgcjdata.a
+@NEEDS_DATA_START_TRUE@libgcjdata_a_SOURCES = \
+@NEEDS_DATA_START_TRUE@libgcjdata.c
-@NATIVE_TRUE@bin_PROGRAMS = @NATIVE_TRUE@jv-convert gij
+@NATIVE_TRUE@bin_PROGRAMS = \
+@NATIVE_TRUE@jv-convert gij
bin_SCRIPTS = addr2name.awk
-@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
-@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@fastjar
-@CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
-@CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh
-@CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = \
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = \
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@fastjar
+@CANADIAN_FALSE@ZIP = \
+@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+@CANADIAN_TRUE@GCJH = \
+@CANADIAN_TRUE@gcjh
+@CANADIAN_FALSE@GCJH = \
+@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
-fdollars-in-identifiers \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE
-@USING_GCC_TRUE@AM_CFLAGS = @USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
-@USING_GCC_FALSE@AM_CFLAGS = @USING_GCC_FALSE@@LIBGCJ_CFLAGS@
+@USING_GCC_TRUE@AM_CFLAGS = \
+@USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
+@USING_GCC_FALSE@AM_CFLAGS = \
+@USING_GCC_FALSE@@LIBGCJ_CFLAGS@
JCFLAGS = -g
JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
NM = nm
-@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = @NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS
+@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = \
+@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS
CONVERT_DIR = gnu/gcj/convert
java/awt/geom/Dimension2D.java \
java/awt/geom/Ellipse2D.java \
java/awt/geom/IllegalPathStateException.java \
+java/awt/geom/Line2D.java \
java/awt/geom/NoninvertibleTransformException.java \
java/awt/geom/PathIterator.java \
java/awt/geom/Point2D.java \
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/geom/AffineTransform.P .deps/java/awt/geom/Dimension2D.P \
.deps/java/awt/geom/Ellipse2D.P \
.deps/java/awt/geom/IllegalPathStateException.P \
+.deps/java/awt/geom/Line2D.P \
.deps/java/awt/geom/NoninvertibleTransformException.P \
.deps/java/awt/geom/PathIterator.P .deps/java/awt/geom/Point2D.P \
.deps/java/awt/geom/Rectangle2D.P \
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
{
if (peer == null)
peer = getToolkit ().createCheckbox (this);
+ super.addNotify ();
}
/** Returns the current CheckboxGroup associated with this
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
// what else to do.
peer = Toolkit.getDefaultToolkit ().createCheckboxMenuItem (this);
}
+ super.addNotify ();
}
/** Returns this checkbox's label if this checkbox is selected. */
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
{
if (peer == null)
peer = getToolkit ().createChoice (this);
+ super.addNotify ();
}
/** Returns number of items.
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
public FontMetrics getFontMetrics(Font font)
{
- return getToolkit().getFontMetrics(font);
+ if (peer == null)
+ return getToolkit().getFontMetrics(font);
+ return peer.getFontMetrics (font);
}
-
+
public void setCursor(Cursor cursor)
{
this.cursor = cursor;
+ if (peer != null)
+ peer.setCursor (cursor);
}
-
+
public Cursor getCursor()
{
return this.cursor;
parent.repaint(tm, x+getX(), y+getY(), width, height);
return;
}
-
+
if (peer != null)
peer.repaint(tm, x, y, width, height);
}
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
import java.util.Locale;
import java.util.ResourceBundle;
-public class ComponentOrientation implements java.io.Serializable
+public final class ComponentOrientation implements java.io.Serializable
{
// Here is a wild guess.
private static int HORIZONTAL_ID = 1 << 0,
// FIXME: This field is from the serialization spec, but what are the
// correct values?
int orientation;
-
+
ComponentOrientation(int orientation)
{
this.orientation = orientation;
public static ComponentOrientation getOrientation(ResourceBundle bdl)
{
ComponentOrientation r;
-
+
try
{
Object obj = bdl.getObject("Orientation");
{
if (peer == null)
peer = getToolkit ().createDialog (this);
+ super.addNotify ();
}
public boolean isModal ()
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
}
/** @since JDK1.2 */
- static void invokeLater(Runnable runnable)
+ public static void invokeLater(Runnable runnable)
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
eq.postEvent(ie);
}
- static boolean isDispatchThread()
+ public static boolean isDispatchThread()
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
return (Thread.currentThread() == eq.dispatchThread);
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
package java.awt;
-/* A very incomplete placeholder. */
+import java.awt.peer.FileDialogPeer;
+import java.io.FilenameFilter;
+
+/**
+ * @author Tom Tromey <tromey@redhat.com>
+ * @date April 20, 2001
+ */
public class FileDialog extends Dialog
{
- public FileDialog (Frame owner)
+ public static int LOAD = 0;
+ public static int SAVE = 1;
+
+ public FileDialog (Frame parent)
+ {
+ this (parent, "", LOAD);
+ }
+
+ public FileDialog (Frame parent, String title)
+ {
+ this (parent, title, LOAD);
+ }
+
+ public FileDialog (Frame parent, String title, int mode)
+ {
+ super (parent, title, true);
+ if (mode != LOAD && mode != SAVE)
+ throw new IllegalArgumentException ("unknown mode: " + mode);
+ this.mode = mode;
+ }
+
+ public void addNotify ()
+ {
+ if (peer == null)
+ peer = getToolkit ().createFileDialog (this);
+ super.addNotify ();
+ }
+
+ public String getDirectory ()
+ {
+ return dir;
+ }
+
+ public String getFile ()
+ {
+ return file;
+ }
+
+ public FilenameFilter getFilenameFilter ()
{
- super(owner);
- // FIXME
+ return filter;
}
+
+ public int getMode ()
+ {
+ return mode;
+ }
+
+ protected String paramString ()
+ {
+ return ("FileDialog[mode=" + mode
+ + ",dir=" + dir
+ + ",file=" + file + "]");
+ }
+
+ public void setDirectory (String dir)
+ {
+ this.dir = dir;
+ if (peer != null)
+ {
+ FileDialogPeer f = (FileDialogPeer) peer;
+ f.setDirectory (dir);
+ }
+ }
+
+ public void setFile (String file)
+ {
+ this.file = file;
+ if (peer != null)
+ {
+ FileDialogPeer f = (FileDialogPeer) peer;
+ f.setFile (file);
+ }
+ }
+
+ public void setFilenameFilter (FilenameFilter filter)
+ {
+ this.filter = filter;
+ if (peer != null)
+ {
+ FileDialogPeer f = (FileDialogPeer) peer;
+ f.setFilenameFilter (filter);
+ }
+ }
+
+ public void setMode (int mode)
+ {
+ if (mode != LOAD && mode != SAVE)
+ throw new IllegalArgumentException ("unknown mode: " + mode);
+ this.mode = mode;
+ // FIXME: update peer?
+ }
+
+ // Names here from serialization spec.
+ private int mode;
+ private String dir;
+ private String file;
+ private FilenameFilter filter;
}
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
public abstract class GraphicsConfiguration
{
+ // Can't instantiate directly. Having a protected constructor seems
+ // redundant, but that is what the docs specify.
+ protected GraphicsConfiguration ()
+ {
+ }
+
/*
public abstract GraphicsDevice getDevice();
*/
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
{
if (peer == null)
peer = getToolkit ().createLabel (this);
+ super.addNotify ();
}
public int getAlignment ()
{
if (peer != null)
peer = getToolkit ().createList (this);
+ super.addNotify ();
}
public int getItemCount ()
public void replaceItem (String item, int index)
{
items.setElementAt (item, index);
- // FIXME: notify peer
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+ l.delItems (index, index);
+ l.add (item, index);
+ }
}
public void removeAll ()
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.
public void addNotify()
{
- // FIXME
+ if (peer != null)
+ {
+ // This choice of toolkit seems unsatisfying, but I'm not sure
+ // what else to do.
+ peer = Toolkit.getDefaultToolkit ().createMenu (this);
+ }
+ super.addNotify ();
}
public void removeNotify()
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
package java.awt;
+import java.awt.peer.PopupMenuPeer;
+
/* Status: Incomplete. */
public class PopupMenu extends Menu
public void addNotify()
{
- // FIXME
+ if (peer != null)
+ {
+ // This choice of toolkit seems unsatisfying, but I'm not sure
+ // what else to do.
+ peer = Toolkit.getDefaultToolkit ().createPopupMenu (this);
+ }
+ super.addNotify ();
}
public void show(Component origin, int x, int y)
{
- // FIXME
+ if (! origin.isShowing ()
+ // FIXME: or ! parent is showing -- but how?
+ )
+ {
+ // This is an invalid call which we choose to ignore.
+ return;
+ }
+
+ addNotify (); // FIXME?
+ Event e = new Event (origin, 0, 0, x, y, 0, 0);
+ PopupMenuPeer p = (PopupMenuPeer) peer;
+ p.show (e);
}
-
+
// Accessibility API not yet implemented.
// public AccessibleContext getAccessibleContext()
}
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.
details. */
package java.awt;
+
import java.awt.geom.*;
+import java.io.Serializable;
/* Status: Mostly complete. Some of the Java2D stuff is commented out. */
-public class Rectangle extends Rectangle2D implements Cloneable, Shape
+public class Rectangle extends Rectangle2D
+ implements Cloneable, Shape, Serializable
{
public int x;
public int y;
return new Point(x,y);
}
- public PathIterator getPathIterator (AffineTransform t)
- {
- // FIXME
- return null;
- }
-
public Dimension getSize()
{
return new Dimension(width, height);
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
Cloneable
{
- static abstract class Key
+ public abstract static class Key
{
private int intKey;
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
{
if (peer == null)
peer = getToolkit ().createScrollbar (this);
+ super.addNotify ();
}
public int getOrientation ()
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2001 Free Software Foundation
This file is part of libjava.
details. */
package java.awt;
+
import java.awt.event.*;
+import java.awt.peer.TextComponentPeer;
/* A very incomplete placeholder. */
public class TextComponent extends Component
{
+ protected TextListener textListener;
+
char[] buffer;
int length;
int caretPosition;
+ public synchronized void addTextListener (TextListener listener)
+ {
+ textListener = AWTEventMulticaster.add (textListener, listener);
+ }
+
public synchronized String getText ()
{ return new String(buffer, 0, length); }
text.getChars(0, length, buffer, 0);
}
- public synchronized void addTextListener (TextListener listener)
- { /* FIXME */ }
-
public int getCaretPosition () { return caretPosition; }
- public void setCaretPosition (int pos) { caretPosition = pos; }
-
+ public void setCaretPosition (int pos)
+ {
+ caretPosition = pos;
+ if (peer != null)
+ {
+ TextComponentPeer t = (TextComponentPeer) peer;
+ t.setCaretPosition (pos);
+ }
+ }
}
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
return child;
}
- public Component getContainer ()
+ public Container getContainer ()
{
- return (Component) source;
+ return (Container) source;
}
public String paramString ()
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
this.height = (float) h;
}
+ public void setRect (float x, float y, float w, float h)
+ {
+ this.x = x;
+ this.y = y;
+ this.width = w;
+ this.height = h;
+ }
+
public void setRect (Rectangle2D r)
{
this.x = (float) r.getX ();