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:
@@ -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
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -63,6 +63,7 @@ public class Dialog extends Window
|
||||
{
|
||||
if (peer == null)
|
||||
peer = getToolkit ().createDialog (this);
|
||||
super.addNotify ();
|
||||
}
|
||||
|
||||
public boolean isModal ()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
*/
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user