Makefile.in: Rebuilt.

* 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
This commit is contained in:
Tom Tromey 2001-04-22 03:05:39 +00:00 committed by Tom Tromey
parent d80d2d2a5b
commit 760903c056
24 changed files with 304 additions and 72 deletions

View File

@ -1,3 +1,51 @@
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.

View File

@ -694,6 +694,7 @@ java/awt/geom/AffineTransform.java \
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 \

View File

@ -119,29 +119,43 @@ here = @here@
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
@ -160,8 +174,10 @@ AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fnon-call-exceptions \
-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)
@ -229,7 +245,8 @@ extra_headers = java/lang/Object.h java/lang/Class.h
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
@ -429,6 +446,7 @@ java/awt/geom/AffineTransform.java \
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 \
@ -1194,7 +1212,7 @@ libgcj-test.spec.in libgcj.spec.in
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 \
@ -1378,6 +1396,7 @@ 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 \
@ -2092,7 +2111,7 @@ distdir: $(DISTFILES)
@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 \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -63,6 +63,7 @@ public class Checkbox extends Component implements ItemSelectable
{
if (peer == null)
peer = getToolkit ().createCheckbox (this);
super.addNotify ();
}
/** Returns the current CheckboxGroup associated with this

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -55,6 +55,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable
// what else to do.
peer = Toolkit.getDefaultToolkit ().createCheckboxMenuItem (this);
}
super.addNotify ();
}
/** Returns this checkbox's label if this checkbox is selected. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -66,6 +66,7 @@ public class Choice extends Component implements ItemSelectable
{
if (peer == null)
peer = getToolkit ().createChoice (this);
super.addNotify ();
}
/** Returns number of items.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -649,14 +649,18 @@ public abstract class Component implements ImageObserver, MenuContainer,
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;
@ -705,7 +709,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
parent.repaint(tm, x+getX(), y+getY(), width, height);
return;
}
if (peer != null)
peer.repaint(tm, x, y, width, height);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -13,7 +13,7 @@ package java.awt;
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,
@ -29,7 +29,7 @@ public class ComponentOrientation implements java.io.Serializable
// FIXME: This field is from the serialization spec, but what are the
// correct values?
int orientation;
ComponentOrientation(int orientation)
{
this.orientation = orientation;
@ -54,7 +54,7 @@ public class ComponentOrientation implements java.io.Serializable
public static ComponentOrientation getOrientation(ResourceBundle bdl)
{
ComponentOrientation r;
try
{
Object obj = bdl.getObject("Orientation");

View File

@ -63,6 +63,7 @@ public class Dialog extends Window
{
if (peer == null)
peer = getToolkit ().createDialog (this);
super.addNotify ();
}
public boolean isModal ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -166,7 +166,7 @@ public class EventQueue
}
/** @since JDK1.2 */
static void invokeLater(Runnable runnable)
public static void invokeLater(Runnable runnable)
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
@ -176,7 +176,7 @@ public class EventQueue
eq.postEvent(ie);
}
static boolean isDispatchThread()
public static boolean isDispatchThread()
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
return (Thread.currentThread() == eq.dispatchThread);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -8,13 +8,112 @@ details. */
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)
{
super(owner);
// FIXME
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 ()
{
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;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -17,6 +17,12 @@ import java.awt.geom.AffineTransform;
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();
*/

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -43,6 +43,7 @@ public class Label extends Component
{
if (peer == null)
peer = getToolkit ().createLabel (this);
super.addNotify ();
}
public int getAlignment ()

View File

@ -52,6 +52,7 @@ public class List extends Component implements ItemSelectable
{
if (peer != null)
peer = getToolkit ().createList (this);
super.addNotify ();
}
public int getItemCount ()
@ -107,7 +108,12 @@ public class List extends Component implements ItemSelectable
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 ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -40,7 +40,13 @@ public class Menu extends MenuItem implements MenuContainer
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()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -8,6 +8,8 @@ details. */
package java.awt;
import java.awt.peer.PopupMenuPeer;
/* Status: Incomplete. */
public class PopupMenu extends Menu
@ -24,14 +26,31 @@ 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()
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -7,11 +7,14 @@ Libjava License. Please consult the file "LIBJAVA_LICENSE" for
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;
@ -151,12 +154,6 @@ public class Rectangle extends Rectangle2D implements Cloneable, Shape
return new Point(x,y);
}
public PathIterator getPathIterator (AffineTransform t)
{
// FIXME
return null;
}
public Dimension getSize()
{
return new Dimension(width, height);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -16,7 +16,7 @@ public class RenderingHints implements
Cloneable
{
static abstract class Key
public abstract static class Key
{
private int intKey;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -55,6 +55,7 @@ public class Scrollbar extends Component implements Adjustable
{
if (peer == null)
peer = getToolkit ().createScrollbar (this);
super.addNotify ();
}
public int getOrientation ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999 Free Software Foundation
/* Copyright (C) 1999, 2001 Free Software Foundation
This file is part of libjava.
@ -7,16 +7,25 @@ Libjava License. Please consult the file "LIBJAVA_LICENSE" for
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); }
@ -28,11 +37,15 @@ public class TextComponent extends Component
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);
}
}
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -35,9 +35,9 @@ public class ContainerEvent extends ComponentEvent
return child;
}
public Component getContainer ()
public Container getContainer ()
{
return (Component) source;
return (Container) source;
}
public String paramString ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation
/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libjava.
@ -379,6 +379,14 @@ public abstract class Rectangle2D extends RectangularShape
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 ();