Commit bda14505 by Tom Tromey Committed by Tom Tromey

ButtonPeer.java: Replace with Classpath version.

	* java/awt/peer/ButtonPeer.java: Replace with Classpath version.
	* java/awt/peer/CanvasPeer.java: Replace with Classpath version.
	* java/awt/peer/CheckboxMenuItemPeer.java: Replace with Classpath
	version.
	* java/awt/peer/CheckboxPeer.java: Replace with Classpath version.
	* java/awt/peer/ChoicePeer.java: Replace with Classpath version.
	* java/awt/peer/ComponentPeer.java: Replace with Classpath version.
	* java/awt/peer/ContainerPeer.java: Replace with Classpath version.
	* java/awt/peer/DialogPeer.java: Replace with Classpath version.
	* java/awt/peer/FileDialogPeer.java: Replace with Classpath version.
	* java/awt/peer/FontPeer.java: Replace with Classpath version.
	* java/awt/peer/FramePeer.java: Replace with Classpath version.
	* java/awt/peer/LabelPeer.java: Replace with Classpath version.
	* java/awt/peer/LightweightPeer.java: Replace with Classpath version.
	* java/awt/peer/ListPeer.java: Replace with Classpath version.
	* java/awt/peer/MenuBarPeer.java: Replace with Classpath version.
	* java/awt/peer/MenuComponentPeer.java: Replace with Classpath version.
	* java/awt/peer/MenuItemPeer.java: Replace with Classpath version.
	* java/awt/peer/MenuPeer.java: Replace with Classpath version.
	* java/awt/peer/PanelPeer.java: Replace with Classpath version.
	* java/awt/peer/PopupMenuPeer.java: Replace with Classpath version.
	* java/awt/peer/ScrollPanePeer.java: Replace with Classpath version.
	* java/awt/peer/ScrollbarPeer.java: Replace with Classpath version.
	* java/awt/peer/TextAreaPeer.java: Replace with Classpath version.
	* java/awt/peer/TextComponentPeer.java: Replace with Classpath version.
	* java/awt/peer/TextFieldPeer.java: Replace with Classpath version.
	* java/awt/peer/WindowPeer.java: Replace with Classpath version.
	* gnu/awt/xlib/XPanelPeer.java (insets): New method.
	* gnu/awt/xlib/XCanvasPeer.java (show, hide): New methods.
	(minimumSize, preferredSize, reshape): Likewise.
	* gnu/awt/xlib/XFramePeer.java (insets, enable, disable,
	getColorModel): New methods.
	* java/awt/PopupMenu.java: Merged with Classpath.
	* java/awt/MenuBar.java: Merged with Classpath.
	* java/awt/SystemColor.java: Replace with Classpath version.
	* java/awt/Panel.java: Merged with Classpath.
	* java/awt/PaintContext.java: Updated copyright.
	* java/awt/MenuShortcut.java: Merged with Classpath.
	* java/awt/MenuContainer.java: Merged with Classpath.
	* java/awt/Menu.java: Merged with Classpath.
	* java/awt/MediaEntry.java: New file from Classpath.
	* java/awt/MediaTracker.java: New file from Classpath.
	* java/awt/List.java: Merged with Classpath version.
	* java/awt/Insets.java: Merged with Classpath version.
	* java/awt/ImageMediaEntry.java: New file from Classpath.
	* java/awt/Image.java: Replaced with Classpath version.
	* java/awt/FontMetrics.java: Merged with Classpath version.
	* java/awt/Cursor.java (getDefaultCursor): Use DEFAULT_CURSOR
	constant.
	* java/awt/Font.java: Merged with Classpath version.
	* java/awt/Dialog.java: Merged with Classpath version.
	* java/awt/Color.java: Merged with Classpath version.
	* java/awt/Choice.java: Merged with Classpath version.
	* java/awt/CheckboxMenuItem.java: Merged with Classpath version.
	* java/awt/Adjustable.java: Replace with Classpath version.
	* java/awt/MenuItem.java (paramString): Don't include class name
	or brackets.  Call superclass paramString.
	* java/awt/MenuComponent.java (toString): Call paramString.
	(paramString): Compute string; don't call toString.
	* java/awt/Label.java (paramString): Don't include class name
	or brackets.  Call superclass paramString.
	* java/awt/Checkbox.java (paramString): Don't include class name
	or brackets.  Call superclass paramString.
	* java/awt/Button.java (paramString): Don't include class name or
	brackets.  Call superclass paramString.
	* java/awt/MenuComponent.java (getTreeLock): Now protected.

From-SVN: r49099
parent e3b0efd1
2002-01-22 Tom Tromey <tromey@redhat.com>
* java/awt/peer/ButtonPeer.java: Replace with Classpath version.
* java/awt/peer/CanvasPeer.java: Replace with Classpath version.
* java/awt/peer/CheckboxMenuItemPeer.java: Replace with Classpath
version.
* java/awt/peer/CheckboxPeer.java: Replace with Classpath version.
* java/awt/peer/ChoicePeer.java: Replace with Classpath version.
* java/awt/peer/ComponentPeer.java: Replace with Classpath version.
* java/awt/peer/ContainerPeer.java: Replace with Classpath version.
* java/awt/peer/DialogPeer.java: Replace with Classpath version.
* java/awt/peer/FileDialogPeer.java: Replace with Classpath version.
* java/awt/peer/FontPeer.java: Replace with Classpath version.
* java/awt/peer/FramePeer.java: Replace with Classpath version.
* java/awt/peer/LabelPeer.java: Replace with Classpath version.
* java/awt/peer/LightweightPeer.java: Replace with Classpath version.
* java/awt/peer/ListPeer.java: Replace with Classpath version.
* java/awt/peer/MenuBarPeer.java: Replace with Classpath version.
* java/awt/peer/MenuComponentPeer.java: Replace with Classpath version.
* java/awt/peer/MenuItemPeer.java: Replace with Classpath version.
* java/awt/peer/MenuPeer.java: Replace with Classpath version.
* java/awt/peer/PanelPeer.java: Replace with Classpath version.
* java/awt/peer/PopupMenuPeer.java: Replace with Classpath version.
* java/awt/peer/ScrollPanePeer.java: Replace with Classpath version.
* java/awt/peer/ScrollbarPeer.java: Replace with Classpath version.
* java/awt/peer/TextAreaPeer.java: Replace with Classpath version.
* java/awt/peer/TextComponentPeer.java: Replace with Classpath version.
* java/awt/peer/TextFieldPeer.java: Replace with Classpath version.
* java/awt/peer/WindowPeer.java: Replace with Classpath version.
* gnu/awt/xlib/XPanelPeer.java (insets): New method.
* gnu/awt/xlib/XCanvasPeer.java (show, hide): New methods.
(minimumSize, preferredSize, reshape): Likewise.
* gnu/awt/xlib/XFramePeer.java (insets, enable, disable,
getColorModel): New methods.
* java/awt/PopupMenu.java: Merged with Classpath.
* java/awt/MenuBar.java: Merged with Classpath.
* java/awt/SystemColor.java: Replace with Classpath version.
* java/awt/Panel.java: Merged with Classpath.
* java/awt/PaintContext.java: Updated copyright.
* java/awt/MenuShortcut.java: Merged with Classpath.
* java/awt/MenuContainer.java: Merged with Classpath.
* java/awt/Menu.java: Merged with Classpath.
* java/awt/MediaEntry.java: New file from Classpath.
* java/awt/MediaTracker.java: New file from Classpath.
* java/awt/List.java: Merged with Classpath version.
* java/awt/Insets.java: Merged with Classpath version.
* java/awt/ImageMediaEntry.java: New file from Classpath.
* java/awt/Image.java: Replaced with Classpath version.
* java/awt/FontMetrics.java: Merged with Classpath version.
* java/awt/Cursor.java (getDefaultCursor): Use DEFAULT_CURSOR
constant.
* java/awt/Font.java: Merged with Classpath version.
* java/awt/Dialog.java: Merged with Classpath version.
* java/awt/Color.java: Merged with Classpath version.
* java/awt/Choice.java: Merged with Classpath version.
* java/awt/CheckboxMenuItem.java: Merged with Classpath version.
* java/awt/Adjustable.java: Replace with Classpath version.
* java/awt/MenuItem.java (paramString): Don't include class name
or brackets. Call superclass paramString.
* java/awt/MenuComponent.java (toString): Call paramString.
(paramString): Compute string; don't call toString.
* java/awt/Label.java (paramString): Don't include class name
or brackets. Call superclass paramString.
* java/awt/Checkbox.java (paramString): Don't include class name
or brackets. Call superclass paramString.
* java/awt/Button.java (paramString): Don't include class name or
brackets. Call superclass paramString.
* java/awt/MenuComponent.java (getTreeLock): Now protected.
2002-01-20 Andreas Schwab <schwab@suse.de> 2002-01-20 Andreas Schwab <schwab@suse.de>
* java/net/natPlainSocketImpl.cc (_Jv_recv): Change return type of * java/net/natPlainSocketImpl.cc (_Jv_recv): Change return type of
......
/* Copyright (C) 2000 Free Software Foundation /* Copyright (C) 2000, 2002 Free Software Foundation
This file is part of libgcj. This file is part of libgcj.
...@@ -230,6 +230,11 @@ public class XCanvasPeer implements CanvasPeer ...@@ -230,6 +230,11 @@ public class XCanvasPeer implements CanvasPeer
throw new UnsupportedOperationException("FIXME, not implemented"); throw new UnsupportedOperationException("FIXME, not implemented");
} }
public ColorModel getColorModel ()
{
return null;
}
public Graphics getGraphics() public Graphics getGraphics()
{ {
DirectRasterGraphics gfxDevice = new XGraphics(window, config); DirectRasterGraphics gfxDevice = new XGraphics(window, config);
...@@ -251,11 +256,21 @@ public class XCanvasPeer implements CanvasPeer ...@@ -251,11 +256,21 @@ public class XCanvasPeer implements CanvasPeer
return MIN_SIZE; return MIN_SIZE;
} }
public Dimension minimumSize ()
{
return getMinimumSize ();
}
public Dimension getPreferredSize () public Dimension getPreferredSize ()
{ {
return component.getSize(); return component.getSize();
} }
public Dimension preferredSize ()
{
return getPreferredSize();
}
public Toolkit getToolkit() public Toolkit getToolkit()
{ {
return getXToolkit(); return getXToolkit();
...@@ -318,6 +333,11 @@ public class XCanvasPeer implements CanvasPeer ...@@ -318,6 +333,11 @@ public class XCanvasPeer implements CanvasPeer
ensureFlush(); ensureFlush();
} }
public void reshape (int x, int y, int width, int height)
{
setBounds (x, y, width, height);
}
public void setCursor(Cursor cursor) public void setCursor(Cursor cursor)
{ {
throw new UnsupportedOperationException("FIXME, not implemented"); throw new UnsupportedOperationException("FIXME, not implemented");
...@@ -328,6 +348,16 @@ public class XCanvasPeer implements CanvasPeer ...@@ -328,6 +348,16 @@ public class XCanvasPeer implements CanvasPeer
throw new UnsupportedOperationException("FIXME, not implemented"); throw new UnsupportedOperationException("FIXME, not implemented");
} }
public void enable ()
{
setEnabled (true);
}
public void disable ()
{
setEnabled (false);
}
public void setEventMask(long eventMask) public void setEventMask(long eventMask)
{ {
WindowAttributes attributes = new WindowAttributes(); WindowAttributes attributes = new WindowAttributes();
...@@ -371,6 +401,16 @@ public class XCanvasPeer implements CanvasPeer ...@@ -371,6 +401,16 @@ public class XCanvasPeer implements CanvasPeer
} }
} }
public void show ()
{
setVisible (true);
}
public void hide ()
{
setVisible (false);
}
static class DoMap implements Runnable static class DoMap implements Runnable
{ {
Window window; Window window;
......
/* Copyright (C) 2000 Free Software Foundation /* Copyright (C) 2000, 2002 Free Software Foundation
This file is part of libgcj. This file is part of libgcj.
...@@ -93,6 +93,11 @@ public class XFramePeer extends XCanvasPeer implements FramePeer ...@@ -93,6 +93,11 @@ public class XFramePeer extends XCanvasPeer implements FramePeer
return (Insets) INSETS_0_PROTOTYPE.clone(); return (Insets) INSETS_0_PROTOTYPE.clone();
} }
public Insets insets ()
{
return getInsets ();
}
public void beginValidate() public void beginValidate()
{ {
} }
......
/* Copyright (C) 2000 Free Software Foundation /* Copyright (C) 2000, 2002 Free Software Foundation
This file is part of libgcj. This file is part of libgcj.
...@@ -40,6 +40,11 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer ...@@ -40,6 +40,11 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer
return (Insets) INSETS_0_PROTOTYPE.clone(); return (Insets) INSETS_0_PROTOTYPE.clone();
} }
public Insets insets()
{
return getInsets();
}
public void beginValidate() public void beginValidate()
{ {
// NOP // NOP
......
/* Copyright (C) 1999, 2000 Free Software Foundation /* Adjustable.java -- Objects with a numeric adjustment scale.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libjava. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libjava License. Please consult the file "LIBJAVA_LICENSE" for
details. */
package java.awt; package java.awt;
import java.awt.event.*;
import java.awt.event.AdjustmentListener;
/** /**
* @author Tom Tromey <tromey@cygnus.com> * This interface is for objects that take a numeric value that
* @date April 8, 2000 * can be adjusted within a bounded range. For example, a scroll bar.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface Adjustable
{
/*
* Static Variables
*/ */
/* Status: Believed complete and correct to JDK 1.2. */ /**
* Constant for a horizontal orientation
*/
public static final int HORIZONTAL = 0;
/**
* Constant for a vertical orientation
*/
public static final int VERTICAL = 1;
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Returns the current value of the object.
*
* @return The current value of the object.
*/
public abstract int
getValue();
/*************************************************************************/
/**
* Sets the current value of the object.
*
* @param value The current value of the object.
*/
public abstract void
setValue(int value);
/*************************************************************************/
/**
* Returns the orientation of the object, either <code>HORIZONTAL</code>
* or <code>VERTICAL</code>.
*
* @return The orientation of this object.
*/
public abstract int
getOrientation();
/*************************************************************************/
/**
* Returns the minimum value this object can take.
*
* @return The minimum value this object can take.
*/
public abstract int
getMinimum();
/*************************************************************************/
/**
* Sets the minimum value this object can take to the specified value.
*
* @param minimum The new minimum value for this object.
*/
public abstract void
setMinimum(int minimum);
/*************************************************************************/
/**
* Returns the maximum value this object can take.
*
* @return The maximum value this object can take.
*/
public abstract int
getMaximum();
/*************************************************************************/
/**
* Sets the maximum value this object can take to the specified value.
*
* @param maximum The new maximum value for this object.
*/
public abstract void
setMaximum(int maximum);
/*************************************************************************/
/**
* Returns the increment value for incrementing by units.
*
* @return The unit increment value.
*/
public abstract int
getUnitIncrement();
/*************************************************************************/
/**
* Sets the increment value for incrementing by units to the specified value.
*
* @param increment The unit increment value.
*/
public abstract void
setUnitIncrement(int increment);
/*************************************************************************/
/**
* Returns the increment value for incrementing by blocks.
*
* @return The block increment value.
*/
public abstract int
getBlockIncrement();
/*************************************************************************/
/**
* Sets the increment value for incrementing by blocks to the specified value.
*
* @param increment The block increment value.
*/
public abstract void
setBlockIncrement(int increment);
/*************************************************************************/
/**
* Returns the length of the indicator for this object.
*
* @return The indicator length.
*/
public abstract int
getVisibleAmount();
/*************************************************************************/
/**
* Sets the length of the indicator for this object to the specified value.
*
* @param length The indicator length
*/
public abstract void
setVisibleAmount(int length);
/*************************************************************************/
/**
* Adds a listener that will receive adjustment events for this object.
*
* @param listener The adjustment listener to add.
*/
public abstract void
addAdjustmentListener(AdjustmentListener listener);
/*************************************************************************/
/**
* Removes an adjustment listener from this object. It will no longer
* receive adjustment events.
*
* @param listener The adjustment listener to remove.
*/
public abstract void
removeAdjustmentListener(AdjustmentListener listener);
} // interface Adjustable
public interface Adjustable
{
public static final int HORIZONTAL = 0;
public static final int VERTICAL = 1;
public void addAdjustmentListener (AdjustmentListener l);
public int getBlockIncrement ();
public int getMaximum ();
public int getMinimum ();
public int getOrientation ();
public int getUnitIncrement ();
public int getValue ();
public int getVisibleAmount ();
public void removeAdjustmentListener (AdjustmentListener l);
public void setBlockIncrement (int b);
public void setMaximum (int max);
public void setMinimum (int min);
public void setUnitIncrement (int u);
public void setValue (int v);
public void setVisibleAmount (int v);
}
...@@ -269,8 +269,8 @@ dispatchEventImpl(AWTEvent e) ...@@ -269,8 +269,8 @@ dispatchEventImpl(AWTEvent e)
protected String protected String
paramString() paramString()
{ {
return(getClass().getName() + "(label=" + getLabel() + ",actionCommand=" + return ("label=" + getLabel() + ",actionCommand=" + getActionCommand()
getActionCommand() + ")"); + "," + super.paramString());
} }
} // class Button } // class Button
......
...@@ -362,8 +362,8 @@ processItemEvent(ItemEvent event) ...@@ -362,8 +362,8 @@ processItemEvent(ItemEvent event)
protected String protected String
paramString() paramString()
{ {
return(getClass().getName() + "[label=" + label + ",state=" + state return ("label=" + label + ",state=" + state + ",group=" + group
+ ",group=" + group + "]"); + "," + super.paramString());
} }
} // class Checkbox } // class Checkbox
/* Copyright (C) 2000 Free Software Foundation /* Copyright (C) 1999, 2000, 2002 Free Software Foundation
This file is part of libgcj. This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the GNU Classpath is free software; you can redistribute it and/or modify
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for it under the terms of the GNU General Public License as published by
details. */ the Free Software Foundation; either version 2, or (at your option)
any later version.
package java.awt; GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
/* A somewhat incomplete placeholder. */
package java.awt;
/**
* This class represents various predefined cursor types.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class Cursor implements java.io.Serializable public class Cursor implements java.io.Serializable
{ {
public static final int DEFAULT_CURSOR = 0, /**
CROSSHAIR_CURSOR = 1, * Constant for the system default cursor type
TEXT_CURSOR = 2, */
WAIT_CURSOR = 3, public static final int DEFAULT_CURSOR = 0;
SW_RESIZE_CURSOR = 4,
SE_RESIZE_CURSOR = 5, /**
NW_RESIZE_CURSOR = 6, * Constant for a cross-hair cursor.
NE_RESIZE_CURSOR = 7, */
N_RESIZE_CURSOR = 8, public static final int CROSSHAIR_CURSOR = 1;
S_RESIZE_CURSOR = 9,
W_RESIZE_CURSOR = 10, /**
E_RESIZE_CURSOR = 11, * Constant for a cursor over a text field.
HAND_CURSOR = 12, */
MOVE_CURSOR = 13, public static final int TEXT_CURSOR = 2;
CUSTOM_CURSOR = 0xFFFFFFFF;
/**
* Constant for a cursor to display while waiting for an action to complete.
*/
public static final int WAIT_CURSOR = 3;
/**
* Cursor used over SW corner of window decorations.
*/
public static final int SW_RESIZE_CURSOR = 4;
/**
* Cursor used over SE corner of window decorations.
*/
public static final int SE_RESIZE_CURSOR = 5;
/**
* Cursor used over NW corner of window decorations.
*/
public static final int NW_RESIZE_CURSOR = 6;
/**
* Cursor used over NE corner of window decorations.
*/
public static final int NE_RESIZE_CURSOR = 7;
/**
* Cursor used over N edge of window decorations.
*/
public static final int N_RESIZE_CURSOR = 8;
/**
* Cursor used over S edge of window decorations.
*/
public static final int S_RESIZE_CURSOR = 9;
/**
* Cursor used over W edge of window decorations.
*/
public static final int W_RESIZE_CURSOR = 10;
/**
* Cursor used over E edge of window decorations.
*/
public static final int E_RESIZE_CURSOR = 11;
/**
* Constant for a hand cursor.
*/
public static final int HAND_CURSOR = 12;
/**
* Constant for a cursor used during window move operations.
*/
public static final int MOVE_CURSOR = 13;
public static final int CUSTOM_CURSOR = 0xFFFFFFFF;
private static final int PREDEFINED_COUNT = 14; private static final int PREDEFINED_COUNT = 14;
protected static Cursor[] predefined = new Cursor[PREDEFINED_COUNT]; protected static Cursor[] predefined = new Cursor[PREDEFINED_COUNT];
protected String name; protected String name;
/**
* @serial The numeric id of this cursor.
*/
int type; int type;
/**
* Initializes a new instance of <code>Cursor</code> with the specified
* type.
*
* @param type The cursor type.
*/
public Cursor(int type) public Cursor(int type)
{ {
if (type < 0 || type >= PREDEFINED_COUNT) if (type < 0 || type >= PREDEFINED_COUNT)
...@@ -43,14 +130,25 @@ public class Cursor implements java.io.Serializable ...@@ -43,14 +130,25 @@ public class Cursor implements java.io.Serializable
} }
/** This constructor is used internally only. /** This constructor is used internally only.
* Application code should call Toolkit.createCustomCursor(). * Application code should call Toolkit.createCustomCursor().
*/ */
protected Cursor(String name) protected Cursor(String name)
{ {
this.name = name; this.name = name;
this.type = CUSTOM_CURSOR; this.type = CUSTOM_CURSOR;
} }
/**
* Returns an instance of <code>Cursor</code> for one of the specified
* predetermined types.
*
* @param type The type contant from this class.
*
* @return The requested predefined cursor.
*
* @exception IllegalArgumentException If the constant is not one of the
* predefined cursor type constants from this class.
*/
public static Cursor getPredefinedCursor(int type) public static Cursor getPredefinedCursor(int type)
{ {
if (type < 0 || type >= PREDEFINED_COUNT) if (type < 0 || type >= PREDEFINED_COUNT)
...@@ -67,11 +165,21 @@ public class Cursor implements java.io.Serializable ...@@ -67,11 +165,21 @@ public class Cursor implements java.io.Serializable
return null; return null;
} }
/**
* Returns an instance of the system default cursor type.
*
* @return The system default cursor.
*/
public static Cursor getDefaultCursor() public static Cursor getDefaultCursor()
{ {
return getPredefinedCursor(0); return getPredefinedCursor(DEFAULT_CURSOR);
} }
/**
* Returns the numeric type identifier for this cursor.
*
* @return The cursor id.
*/
public int getType() public int getType()
{ {
return type; return type;
......
/* Copyright (C) 2000, 2001 Free Software Foundation /* FileDialog.java -- A filename selection dialog box
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt; package java.awt;
import java.awt.peer.FileDialogPeer; import java.awt.peer.FileDialogPeer;
import java.awt.peer.DialogPeer;
import java.awt.peer.WindowPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
import java.io.FilenameFilter; import java.io.FilenameFilter;
/** /**
* @author Tom Tromey <tromey@redhat.com> * This class implements a file selection dialog box widget.
* @date April 20, 2001 *
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@redhat.com>
*/
public class FileDialog extends Dialog implements java.io.Serializable
{
/*
* Static Variables
*/
/**
* Indicates that the purpose of the dialog is for opening a file.
*/
public static final int LOAD = 0;
/**
* Indicates that the purpose of the dialog is for saving a file.
*/
public static final int SAVE = 1;
// Serialization constant
private static final long serialVersionUID = 5035145889651310422L;
/*************************************************************************/
/*
* Instance Variables
*/ */
public class FileDialog extends Dialog /**
* @serial The directory for this file dialog.
*/
private String dir;
/**
* @serial The filename for this file dialog
*/
private String file;
/**
* @serial The filter for selecting filenames to display
*/
private FilenameFilter filter;
/**
* @serial The mode of this dialog, either <code>LOAD</code> or
* <code>SAVE</code>.
*/
private int mode;
/*************************************************************************/
/*
* Constructors
*/
/**
* Initializes a new instance of <code>FileDialog</code> with the
* specified parent. This dialog will have no title and will be for
* loading a file.
*
* @param parent The parent frame for this dialog.
*/
public
FileDialog(Frame parent)
{
this(parent, "", LOAD);
}
/*************************************************************************/
/**
* Initialized a new instance of <code>FileDialog</code> with the
* specified parent and title. This dialog will be for opening a file.
*
* @param parent The parent frame for this dialog.
* @param title The title for this dialog.
*/
public
FileDialog(Frame parent, String title)
{ {
public static int LOAD = 0; this(parent, title, LOAD);
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 ()
{
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;
} }
/*************************************************************************/
/**
* Initialized a new instance of <code>FileDialog</code> with the
* specified parent, title, and mode.
*
* @param parent The parent frame for this dialog.
* @param title The title for this dialog.
* @param mode The mode of the dialog, either <code>LOAD</code> or
* <code>SAVE</code>.
*/
public
FileDialog(Frame parent, String title, int mode)
{
super(parent, title, true);
if ((mode != LOAD) && (mode != SAVE))
throw new IllegalArgumentException("Bad mode: " + mode);
this.mode = mode;
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Returns the mode of this dialog, either <code>LOAD</code> or
* <code>SAVE</code>.
*
* @return The mode of this dialog.
*/
public int
getMode()
{
return(mode);
}
/*************************************************************************/
/**
* Sets the mode of this dialog to either <code>LOAD</code> or
* <code>SAVE</code>. This method is only effective before the native
* peer is created.
*
* @param mode The new mode of this file dialog.
*/
public void
setMode(int mode)
{
if ((mode != LOAD) && (mode != SAVE))
throw new IllegalArgumentException("Bad mode: " + mode);
this.mode = mode;
}
/*************************************************************************/
/**
* Returns the directory for this file dialog.
*
* @return The directory for this file dialog.
*/
public String
getDirectory()
{
return(dir);
}
/*************************************************************************/
/**
* Sets the directory for this file dialog.
*
* @param dir The new directory for this file dialog.
*/
public synchronized void
setDirectory(String dir)
{
this.dir = dir;
if (peer != null)
{
FileDialogPeer f = (FileDialogPeer) peer;
f.setDirectory (dir);
}
}
/*************************************************************************/
/**
* Returns the file that is selected in this dialog.
*
* @return The file that is selected in this dialog.
*/
public String
getFile()
{
return(file);
}
/*************************************************************************/
/**
* Sets the selected file for this dialog.
*
* @param file The selected file for this dialog.
*/
public synchronized void
setFile(String file)
{
this.file = file;
if (peer != null)
{
FileDialogPeer f = (FileDialogPeer) peer;
f.setFile (file);
}
}
/*************************************************************************/
/**
* Returns the filename filter being used by this dialog.
*
* @param The filename filter being used by this dialog.
*/
public FilenameFilter
getFilenameFilter()
{
return(filter);
}
/*************************************************************************/
/**
* Sets the filename filter used by this dialog.
*
* @param filter The new filename filter for this file dialog box.
*/
public synchronized void
setFilenameFilter(FilenameFilter filter)
{
this.filter = filter;
if (peer != null)
{
FileDialogPeer f = (FileDialogPeer) peer;
f.setFilenameFilter (filter);
}
}
/*************************************************************************/
/**
* Creates the native peer for this file dialog box.
*/
public void
addNotify()
{
if (peer == null)
peer = getToolkit ().createFileDialog (this);
super.addNotify ();
}
/*************************************************************************/
/**
* Returns a debugging string for this object.
*
* @return A debugging string for this object.
*/
protected String
paramString()
{
return ("dir=" + dir + ",file=" + file +
",mode=" + mode + "," + super.paramString());
}
} // class FileDialog
/* Copyright (C) 2000 Free Software Foundation /* Image.java -- Java class for images
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt; package java.awt;
import java.awt.image.ImageObserver; import java.awt.image.*;
import java.awt.image.ImageProducer;
/** /**
* @author Warren Levy <warrenl@cygnus.com> * This is the abstract superclass of all image objects in Java.
* @date March 15, 2000. *
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public abstract class Image
{
/*
* Static Variables
*/ */
/** /**
* Written using on-line Java Platform 1.2 API Specification, as well * Constant indicating that the default scaling algorithm should be used.
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). */
* Status: Mostly complete, but look for FIXMEs. public static final int SCALE_DEFAULT = 1;
/**
* Constant indicating that a fast scaling algorithm should be used.
*/
public static final int SCALE_FAST = 2;
/**
* Constant indicating that a smooth scaling algorithm should be used.
*/
public static final int SCALE_SMOOTH = 4;
/**
* Constant indicating that the <code>ReplicateScaleFilter</code> class
* algorithm should be used for scaling.
*/
public static final int SCALE_REPLICATE = 8;
/**
* Constant indicating that the area averaging scaling algorithm should be
* used.
*/
public static final int SCALE_AREA_AVERAGING = 16;
/**
* This variable is returned whenever a property that is not defined
* is requested.
*/
public static final Object UndefinedProperty = Image.class;
/*************************************************************************/
/*
* Constructors
*/ */
public abstract class Image extends Object /**
* A default constructor for subclasses.
*/
public
Image()
{ {
public static final Object UndefinedProperty = new Object(); }
public static final int SCALE_DEFAULT = 1<<0, /*************************************************************************/
SCALE_FAST = 1<<1,
SCALE_SMOOTH = 1<<2,
SCALE_REPLICATE = 1<<3,
SCALE_AREA_AVERAGING = 1<<4;
public abstract int getWidth(ImageObserver observer); /*
* Instance Methods
*/
/**
* Returns the width of the image, or -1 if it is unknown. If the
* image width is unknown, the observer object will be notified when
* the value is known.
*
* @param observer The image observer for this object.
*/
public abstract int
getWidth(ImageObserver observer);
/*************************************************************************/
/**
* Returns the height of the image, or -1 if it is unknown. If the
* image height is unknown, the observer object will be notified when
* the value is known.
*
* @param observer The image observer for this object.
*/
public abstract int
getHeight(ImageObserver observer);
/*************************************************************************/
public abstract int getHeight(ImageObserver observer); /**
* Returns the image producer object for this object.
*
* @return The image producer for this object.
*/
public abstract ImageProducer
getSource();
public abstract ImageProducer getSource(); /*************************************************************************/
public abstract Graphics getGraphics(); /**
* Returns a graphics context object for drawing an off-screen object.
* This method is only valid for off-screen objects.
*
* @return A graphics context object for an off-screen object.
*/
public abstract Graphics
getGraphics();
public abstract Object getProperty(String name, ImageObserver observer); /*************************************************************************/
public Image getScaledInstance(int width, int height, int hints) /**
* This method requests a named property for an object. The value of the
* property is returned. The value <code>UndefinedProperty</code> is
* returned if there is no property with the specified name. The value
* <code>null</code> is returned if the properties for the object are
* not yet known. In this case, the specified image observer is notified
* when the properties are known.
*
* @param name The requested property name.
* @param observer The image observer for this object.
*/
public abstract Object
getProperty(String name, ImageObserver observer);
/*************************************************************************/
/**
* Scales the image to the requested dimension.
*
* XXX: FIXME
*
* @param width The width of the scaled image.
* @param height The height of the scaled image.
* @param flags A value indicating the algorithm to use, which will be
* set from contants defined in this class.
*
* @return The scaled <code>Image</code> object.
*/
public Image
getScaledInstance(int width, int height, int flags)
{ {
throw new UnsupportedOperationException("FIXME: not implemented yet"); return null;
} }
public abstract void flush(); /*************************************************************************/
}
/**
* Flushes (that is, destroys) any resources used for this image. This
* includes the actual image data.
*/
public abstract void
flush();
} // class Image
/* ImageMediaEntry.java -- A media entry type for images.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.awt;
import java.awt.image.ImageObserver;
import java.io.Serializable;
/**
* A concrete MediaEntry subtype for images.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
class ImageMediaEntry extends MediaEntry implements ImageObserver,
Serializable
{
private Image image;
private int width;
private int height;
ImageMediaEntry(MediaTracker tracker, Image image, int ID, int width, int height)
{
super(tracker, ID);
this.image = image;
this.width = width;
this.height = height;
}
public Object
getMedia()
{
return(image.getSource()); // FIXME: Is this really right?
}
public void
startLoad()
{
int status = getStatus();
// status |= MediaEntry.LOADSTARTED;
}
public boolean
imageUpdate(Image image, int flags, int x, int y, int width, int height)
{
// implement me
return true;
}
} // class ImageMediaEntry
/* Copyright (C) 2000 Free Software Foundation /* Insets.java -- Information about a container border.
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt; package java.awt;
/**
* This class represents the "margin" or space around a container.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class Insets implements Cloneable, java.io.Serializable public class Insets implements Cloneable, java.io.Serializable
{ {
public int top;
public int left; /*
public int bottom; * Instance Variable
public int right; */
public Insets(int top, int left, int bottom, int right) /**
{ * @serial The top inset
this.top = top; */
this.left = left; public int top;
this.bottom = bottom;
this.right = right; /**
} * @serial This bottom inset
*/
public boolean equals(Object obj) public int bottom;
{
if (obj instanceof Insets) /**
{ * @serial The left inset
Insets i = (Insets) obj; */
return (i.top == top public int left;
&& i.left == left
&& i.bottom == bottom /**
&& i.right == right); * @serial The right inset
} */
return false; public int right;
}
/*************************************************************************/
public int hashCode()
{ /**
// FIXME: what is the correct algorithm for this? * Initializes a new instance of <code>Inset</code> with the specified
return (top * (2 * left) * (3 * right) * (4 * bottom)); * inset values.
} *
* @param top The top inset
public String toString() * @param left The left inset
{ * @param bottom The bottom inset
return (getClass() + "[top=" + top + ",left=" + left + ",bottom=" * @param right The right inset
+ bottom + ",right=" + right + "]"); */
} public
Insets(int top, int left, int bottom, int right)
public Object clone() {
{ this.top = top;
Insets r = new Insets(top, left, bottom, right); this.left = left;
return r; this.bottom = bottom;
} this.right = right;
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Tests whether this object is equal to the specified object. This will
* be true if and only if the specified object:
* <p>
* <ul>
* <li>Is not <code>null</code>.
* <li>Is an instance of <code>Insets</code>.
* <li>Has the same top, bottom, left, and right inset values as this object.
* </ul>
*
* @param obj The object to test against.
*
* @return <code>true</code> if the specified object is equal to this
* one, <code>false</code> otherwise.
*/
public boolean
equals(Object obj)
{
if (!(obj instanceof Insets))
return(false);
Insets i = (Insets)obj;
if (i.top != top)
return(false);
if (i.bottom != bottom)
return(false);
if (i.left != left)
return(false);
if (i.right != right)
return(false);
return(true);
}
public int
hashCode()
{
return top + bottom + left + right;
}
/*************************************************************************/
/**
* Returns a string representation of this object.
*
* @return A string representation of this object.
*/
public String
toString()
{
return(getClass().getName() + "(top=" + top + ",bottom=" + bottom +
",left=" + left + ",right=" + right + ")");
}
/*************************************************************************/
/**
* Returns a copy of this object.
*
* @return A copy of this object.
*/
public Object
clone()
{
try
{
return(super.clone());
}
catch(Exception e)
{
return(null);
}
} }
} // class Insets
...@@ -225,8 +225,8 @@ addNotify() ...@@ -225,8 +225,8 @@ addNotify()
protected String protected String
paramString() paramString()
{ {
return(getClass().getName() + "(text=" + getText() + ",alignment=" + return ("text=" + getText() + ",alignment=" +
getAlignment() + ")"); getAlignment() + "," + super.paramString());
} }
} // class Label } // class Label
......
/* MediaEntry.java -- An entry in a MediaTracker
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.awt;
/**
* This is an entry in the media tracker
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
abstract class MediaEntry implements java.io.Serializable
{
protected static final int LOADING = 1;
protected static final int ABORTED = 2;
protected static final int ERRORED = 4;
protected static final int COMPLETE = 8;
protected static final int LOADSTARTED = 16;
protected static final int DONE = 32;
private MediaTracker tracker;
private int ID;
private int status;
private boolean cancelled;
private MediaEntry next;
static MediaEntry
insert(MediaEntry a, MediaEntry b)
{
while (a.next != null)
a = a.next;
a.next = b;
return(b);
}
MediaEntry(MediaTracker tracker, int ID)
{
this.tracker = tracker;
this.ID = ID;
}
public int
getID()
{
return(ID);
}
public int
getStatus()
{
return(status);
}
public void
setStatus(int status)
{
this.status = status;
}
public MediaEntry
getNext()
{
return(next);
}
public void
cancel()
{
cancelled = true;
if ((status == LOADING) || (status == LOADSTARTED))
setStatus(ABORTED);
}
abstract void
startLoad();
abstract Object
getMedia();
} // class MediaEntry
/* MediaTracker.java -- Class used for keeping track of images
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.awt;
/**
* This class is used for keeping track of the status of various media
* objects.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class MediaTracker implements java.io.Serializable
{
} // class MediaTracker
...@@ -221,7 +221,7 @@ getToolkit() ...@@ -221,7 +221,7 @@ getToolkit()
* *
* @return The synchronization lock for this component. * @return The synchronization lock for this component.
*/ */
public final Object protected final Object
getTreeLock() getTreeLock()
{ {
return(tree_lock); return(tree_lock);
...@@ -292,7 +292,7 @@ processEvent(AWTEvent event) ...@@ -292,7 +292,7 @@ processEvent(AWTEvent event)
public String public String
toString() toString()
{ {
return(getClass().getName() + "(" + getName() + ")"); return this.getClass().getName() + "[" + paramString() + "]";
} }
/*************************************************************************/ /*************************************************************************/
...@@ -303,7 +303,7 @@ toString() ...@@ -303,7 +303,7 @@ toString()
protected String protected String
paramString() paramString()
{ {
return(toString()); return "name=" + getName();
} }
// Accessibility API not yet implemented. // Accessibility API not yet implemented.
......
/* Copyright (C) 1999, 2000 Free Software Foundation /* MenuContainer.java -- Container for menu items.
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of libjava. This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the GNU Classpath is free software; you can redistribute it and/or modify
Libjava License. Please consult the file "LIBJAVA_LICENSE" for it under the terms of the GNU General Public License as published by
details. */ the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.awt;
/* Written using "Java Class Libraries", 2nd edition, plus online package java.awt;
* API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/**
* This interface is a container for menu components.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface MenuContainer public interface MenuContainer
{ {
public Font getFont();
/** /**
* @deprecated * Returns the font in use by this container.
*/ *
public boolean postEvent(Event evt); * @return The font in use by this container.
*/
public abstract Font
getFont();
/*************************************************************************/
/**
* Removes the specified menu component from the menu.
*
* @param component The menu component to remove.
*/
public abstract void
remove(MenuComponent component);
/*************************************************************************/
public void remove(MenuComponent comp); /**
} * Posts and event to the listeners. This is replaced by
* <code>dispatchEvent</code>.
*
* @param event The event to dispatch.
*
* @deprecated
*/
public abstract boolean
postEvent(Event event);
} // interface MenuContainer
...@@ -437,8 +437,8 @@ processActionEvent(ActionEvent event) ...@@ -437,8 +437,8 @@ processActionEvent(ActionEvent event)
public String public String
paramString() paramString()
{ {
return(getClass().getName() + "(label+" + label + ",enabled=" + enabled + return ("label=" + label + ",enabled=" + enabled +
",actionCommand=" + actionCommand + ")"); ",actionCommand=" + actionCommand + "," + super.paramString());
} }
// Accessibility API not yet implemented. // Accessibility API not yet implemented.
......
/* Copyright (C) 2000 Free Software Foundation /* MenuShortcut.java -- A class for menu accelerators
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the GNU Classpath is free software; you can redistribute it and/or modify
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for it under the terms of the GNU General Public License as published by
details. */ the Free Software Foundation; either version 2, or (at your option)
any later version.
package java.awt; GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
import java.awt.event.KeyEvent;
/* Status: Complete, except for hashCode(). Untested. */ package java.awt;
/**
* This class implements a keyboard accelerator for a menu item.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class MenuShortcut implements java.io.Serializable public class MenuShortcut implements java.io.Serializable
{ {
// Fields from the serialization spec. Decalare others "transient".
int key; /*
boolean usesShift; * Static Variables
*/
public MenuShortcut(int key)
{ // Serialization Constant
this.key = key; private static final long serialVersionUID = 143448358473180225L;
}
/*************************************************************************/
public MenuShortcut(int key, boolean useShiftModifier)
{ /*
this.key = key; * Instance Variables
this.usesShift = useShiftModifier; */
}
/**
public int getKey() * @serial The virtual keycode for the shortcut.
{ */
return key; private int key;
}
/**
public boolean usesShiftModifier() * @serial <code>true</code> if the shift key was used with this shortcut,
{ * or <code>false</code> otherwise.
return usesShift; */
} private boolean usesShift;
public boolean equals(MenuShortcut ms) /*************************************************************************/
{
return (ms.key == key && ms.usesShift == usesShift); /**
} * Initializes a new instance of <code>MenuShortcut</code> with the
* specified virtual key value.
public boolean equals(Object obj) *
{ * @param key The virtual keycode for the shortcut.
if (obj instanceof MenuShortcut) */
{ public
MenuShortcut ms = (MenuShortcut) obj; MenuShortcut(int key)
return (ms.key == key && ms.usesShift == usesShift); {
} this(key, false);
return false; }
}
/*************************************************************************/
public int hashCode()
{ /**
// FIXME: find/implement the correct algorithm for this * Initializes a new instance of <code>MenuShortcut</code> with the
if (usesShift) * specified virtual key value and shift setting.
return (2 * key); *
else * @param key The virtual keycode for the shortcut.
return key; * @param usesShift <code>true</code> if the shift key was pressed,
} * <code>false</code> otherwise.
*/
public String toString() public
{ MenuShortcut(int key, boolean usesShift)
return paramString(); // ? {
} this.key = key;
this.usesShift = usesShift;
protected String paramString() }
{
return KeyEvent.getKeyText(key); /*************************************************************************/
}
/*
* Instance Methods
*/
/**
* Returns the virtual keycode for this shortcut.
*
* @return The virtual keycode for this shortcut.
*/
public int
getKey()
{
return(key);
}
/*************************************************************************/
/**
* Returns the shift setting for this shortcut.
*
* @return <code>true</code> if the shift key was pressed, <code>false</code>
* otherwise.
*/
public boolean
usesShiftModifier()
{
return(usesShift);
}
/*************************************************************************/
/**
* Tests this object for equality against the specified object. The two
* objects will be considered equal if and only if the specified object
* is an instance of <code>MenuShortcut</code> and has the same key value
* and shift setting as this object.
*
* @param obj The object to test for equality against.
*
* @return <code>true</code> if the two objects are equal, <code>false</code>
* otherwise.
*/
public boolean
equals(MenuShortcut obj)
{
if (obj == null)
return(false);
if (obj.key != this.key)
return(false);
if (obj.usesShift != this.usesShift)
return(false);
return(true);
}
public boolean
equals(Object obj)
{
if (obj instanceof MenuShortcut)
{
MenuShortcut ms = (MenuShortcut) obj;
return (ms.key == key && ms.usesShift == usesShift);
}
return false;
} }
/*************************************************************************/
/**
* Returns a string representation of this shortcut.
*
* @return A string representation of this shortcut.
*/
public String
toString()
{
return(getClass().getName() + "[" + paramString () + "]");
}
public int
hashCode()
{
// Arbitrary.
return key + (usesShift ? 23 : 57);
}
/*************************************************************************/
/**
* Returns a debugging string for this object.
*
* @return A debugging string for this object.
*/
protected String
paramString()
{
return "key=" + key + ",usesShift=" + usesShift;
}
} // class MenuShortcut
/* Copyright (C) 2000 Free Software Foundation /* Copyright (C) 2000, 2002 Free Software Foundation
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt; package java.awt;
......
/* Copyright (C) 2000 Free Software Foundation /* Panel.java -- Simple container object.
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt; package java.awt;
import java.awt.peer.PanelPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer; import java.awt.peer.ComponentPeer;
/* This class is complete to 1.2. */ /**
* A panel is a simple container class.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class Panel extends Container implements java.io.Serializable
{
public class Panel extends Container /*
* Constructors
*/
/**
* Initializes a new instance of <code>Panel</code> that has a default
* layout manager of <code>FlowLayout</code>.
*/
public
Panel()
{ {
public Panel() this(new FlowLayout());
{
this (new FlowLayout ());
}
public Panel(LayoutManager layout)
{
super();
setLayout (layout);
}
//public AccessibleContext getAccessibleContext()
public void addNotify()
{
if (peer == null)
peer = getToolkit().createPanel(this);
super.addNotify();
}
} }
/*************************************************************************/
/**
* Initializes a new instance of <code>Panel</code> with the specified
* layout manager.
*
* @param layoutManager The layout manager for this object.
*/
public
Panel(LayoutManager layoutManager)
{
setLayout(layoutManager);
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Notifies this object to create its native peer.
*/
public void
addNotify()
{
if (peer == null)
peer = getToolkit().createPanel(this);
super.addNotify();
}
} // class Panel
/* Copyright (C) 2000, 2001 Free Software Foundation /* PopupMenu.java -- An AWT popup menu
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of libjava. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libjava License. Please consult the file "LIBJAVA_LICENSE" for
details. */
package java.awt; package java.awt;
import java.awt.peer.PopupMenuPeer; import java.awt.peer.PopupMenuPeer;
import java.awt.peer.MenuPeer;
import java.awt.peer.MenuItemPeer;
import java.awt.peer.MenuComponentPeer;
/**
* This class implement an AWT popup menu widget
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class PopupMenu extends Menu implements java.io.Serializable
{
/*
* Static Variables
*/
// Serialization Constant
private static final long serialVersionUID = -4620452533522760060L;
/*************************************************************************/
/*
* Constructors
*/
/**
* Initializes a new instance of <code>PopupMenu</code>.
*/
public
PopupMenu()
{
}
/* Status: Incomplete. */ /*************************************************************************/
public class PopupMenu extends Menu /**
* Initializes a new instance of <code>PopupMenu</code> with the specified
* label.
*
* @param label The label for this popup menu.
*/
public
PopupMenu(String label)
{ {
public PopupMenu() super(label);
{
super();
}
public PopupMenu(String label)
{
super(label);
}
public void addNotify()
{
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)
{
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()
} }
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Creates this object's native peer.
*/
public void
addNotify()
{
if (peer != null)
peer = getToolkit ().createPopupMenu (this);
super.addNotify ();
}
/*************************************************************************/
/**
* Displays this popup menu at the specified coordinates relative to
* the specified component.
*
* @param component The component to which the display coordinates are relative.
* @param x The X coordinate of the menu.
* @param y The Y coordinate of the menu.
*/
public void
show(Component component, int x, int y)
{
PopupMenuPeer pmp = (PopupMenuPeer)getPeer();
if (pmp != null)
{
/* XXX
Event e = new Event (component, Event.ACTION_EVENT, component);
e.x = x;
e.y = y;*/
pmp.show (component, x, y);
}
}
} // class PopupMenu
/* Copyright (C) 2000 Free Software Foundation /* ButtonPeer.java -- Peer interface for buttons
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface ButtonPeer extends ComponentPeer public interface ButtonPeer extends ComponentPeer
{ {
void setLabel(String label);
} public abstract void setLabel(String label);
} // interface ButtonPeer
/* Copyright (C) 2000 Free Software Foundation /* CanvasPeer.java -- Peer interface for a canvas
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface CanvasPeer extends ComponentPeer public interface CanvasPeer extends ComponentPeer
{ {
}
} // interface CanvasPeer
/* Copyright (C) 2000 Free Software Foundation /* CheckboxMenuItemPeer.java -- Peer interface for checkbox menu items
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface CheckboxMenuItemPeer extends MenuItemPeer public interface CheckboxMenuItemPeer extends MenuItemPeer
{ {
void setState(boolean state);
} public abstract void setState(boolean state);
} // interface CheckboxMenuItemPeer
/* Copyright (C) 2000 Free Software Foundation /* CheckboxPeer.java -- Interface for checkbox peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface CheckboxPeer extends ComponentPeer public interface CheckboxPeer extends ComponentPeer
{ {
void setCheckboxGroup(java.awt.CheckboxGroup group);
void setLabel(String label); public abstract void setCheckboxGroup(java.awt.CheckboxGroup group);
void setState(boolean state); public abstract void setLabel(String label);
} public abstract void setState(boolean state);
} // interface CheckboxPeer
/* Copyright (C) 2000 Free Software Foundation /* ChoicePeer.java -- Peer for choice box
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface ChoicePeer extends ComponentPeer public interface ChoicePeer extends ComponentPeer
{ {
void add(String item, int index);
void remove(int index); public abstract void add(String item, int index);
void select(int index); public abstract void addItem(String item, int index);
} public abstract void remove(int index);
public abstract void select(int index);
} // interface ChoicePeer
/* Copyright (C) 2000 Free Software Foundation /* ComponentPeer.java -- Toplevel component peer
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -13,10 +32,42 @@ import java.awt.image.*; ...@@ -13,10 +32,42 @@ import java.awt.image.*;
public interface ComponentPeer public interface ComponentPeer
{ {
int checkImage(Image img, int width, int height, ImageObserver o); public int checkImage(Image img, int width, int height,
Image createImage(ImageProducer prod); ImageObserver ob);
Image createImage(int width, int height); public Image createImage(ImageProducer prod);
void dispose(); public Image createImage(int width, int height);
public void disable();
public void dispose();
public void enable();
public ColorModel getColorModel();
public FontMetrics getFontMetrics(Font f);
public Graphics getGraphics();
public Point getLocationOnScreen();
public Dimension getMinimumSize();
public Dimension getPreferredSize();
public Toolkit getToolkit();
// The JCL says that handleEvent returns boolean. However, we've
// experimentally determined that it in fact actually returns void.
public void handleEvent(AWTEvent e);
public void hide();
public boolean isFocusTraversable();
public Dimension minimumSize();
public Dimension preferredSize();
public void paint(Graphics graphics);
public boolean prepareImage(Image img, int width, int height,
ImageObserver ob);
public void print(Graphics graphics);
public void repaint(long tm, int x, int y, int width, int height);
public void requestFocus();
public void reshape(int x, int y, int width, int height);
public void setBackground(Color color);
public void setBounds(int x, int y, int width, int height);
public void setCursor(Cursor cursor);
public void setEnabled(boolean enabled);
public void setFont(Font font);
public void setForeground(Color color);
public void setVisible(boolean visible);
public void show();
/** /**
* Get the graphics configuration of the component. The color model * Get the graphics configuration of the component. The color model
...@@ -24,27 +75,5 @@ public interface ComponentPeer ...@@ -24,27 +75,5 @@ public interface ComponentPeer
*/ */
GraphicsConfiguration getGraphicsConfiguration(); GraphicsConfiguration getGraphicsConfiguration();
FontMetrics getFontMetrics(Font f); public void setEventMask (long mask);
Graphics getGraphics();
Point getLocationOnScreen();
Dimension getMinimumSize();
Dimension getPreferredSize();
Toolkit getToolkit();
// The JCL says that handleEvent returns boolean. However, we've
// experimentally determined that it in fact actually returns void.
void handleEvent(AWTEvent e);
boolean isFocusTraversable();
void paint(Graphics graphics);
boolean prepareImage(Image img, int width, int height, ImageObserver o);
void print(Graphics graphics);
void repaint(long tm, int x, int y, int width, int height);
void requestFocus();
void setBackground(Color color);
void setBounds(int x, int y, int width, int height);
void setCursor(Cursor cursor);
void setEnabled(boolean enabled);
void setEventMask(long eventMask);
void setFont(Font font);
void setForeground(Color color);
void setVisible(boolean visible);
} }
/* Copyright (C) 2000 Free Software Foundation /* ContainerPeer.java -- Interface for container peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,7 +31,11 @@ import java.awt.Insets; ...@@ -12,7 +31,11 @@ import java.awt.Insets;
public interface ContainerPeer extends ComponentPeer public interface ContainerPeer extends ComponentPeer
{ {
Insets getInsets();
void beginValidate(); public abstract Insets insets();
void endValidate(); public abstract Insets getInsets();
} public abstract void beginValidate();
public abstract void endValidate();
} // interface ContainerPeer
/* Copyright (C) 2000 Free Software Foundation /* DialogPeer.java -- Interface for dialog box peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface DialogPeer extends WindowPeer public interface DialogPeer extends WindowPeer
{ {
void setResizable(boolean resizeable);
void setTitle(String title); public abstract void setResizable(boolean resizeable);
} public abstract void setTitle(String title);
} // interface DialogPeer
/* Copyright (C) 2000 Free Software Foundation /* FileDialogPeer.java -- Interface for file selection dialog box peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,7 +31,10 @@ import java.io.FilenameFilter; ...@@ -12,7 +31,10 @@ import java.io.FilenameFilter;
public interface FileDialogPeer extends DialogPeer public interface FileDialogPeer extends DialogPeer
{ {
void setDirectory(String dir);
void setFile(String file); public abstract void setFile(String file);
void setFilenameFilter(FilenameFilter filter); public abstract void setDirectory(String dir);
} public abstract void setFilenameFilter(FilenameFilter ff);
} // interface FileDialogPeer
/* Copyright (C) 2000 Free Software Foundation /* FontPeer.java -- Interface for font peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface FontPeer public interface FontPeer
{ {
}
} // interface FontPeer
/* Copyright (C) 2000 Free Software Foundation /* FramePeer.java -- Interface for frame peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -13,8 +32,11 @@ import java.awt.MenuBar; ...@@ -13,8 +32,11 @@ import java.awt.MenuBar;
public interface FramePeer extends WindowPeer public interface FramePeer extends WindowPeer
{ {
void setIconImage(Image image);
void setMenuBar(MenuBar mb); public abstract void setIconImage(Image image);
void setResizable(boolean resizable); public abstract void setMenuBar(MenuBar mb);
void setTitle(String title); public abstract void setResizable(boolean resizable);
} public abstract void setTitle(String title);
} // interface FramePeer
/* Copyright (C) 2000 Free Software Foundation /* LabelPeer.java -- Interface for simple text lable peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface LabelPeer extends ComponentPeer public interface LabelPeer extends ComponentPeer
{ {
void setAlignment(int alignment);
void setText(String text); public abstract void setAlignment(int alignment);
} public abstract void setText(String text);
} // interface LabelPeer
/* Copyright (C) 2000 Free Software Foundation /* LightweightPeer.java -- Interface for lightweight peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface LightweightPeer extends ComponentPeer public interface LightweightPeer extends ComponentPeer
{ {
}
} // interface LightweightPeer
/* Copyright (C) 2000 Free Software Foundation /* ListPeer.java -- Interface for list box peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,12 +31,20 @@ import java.awt.Dimension; ...@@ -12,12 +31,20 @@ import java.awt.Dimension;
public interface ListPeer extends ComponentPeer public interface ListPeer extends ComponentPeer
{ {
void add(String item, int index);
void delItems(int start_index, int end_index); public abstract void add(String item, int index);
void deselect(int index); public abstract void addItem(String item, int index);
int[] getSelectedIndexes(); public abstract void clear();
void makeVisible(int index); public abstract void delItems(int start_index, int end_index);
void removeAll(); public abstract void deselect(int index);
void select(int index); public abstract int[] getSelectedIndexes();
void setMultipleMode(boolean multipleMode); public abstract void makeVisible(int index);
} public abstract Dimension minimumSize(int s);
public abstract Dimension preferredSize(int s);
public abstract void removeAll();
public abstract void select(int index);
public abstract void setMultipleMode(boolean multi);
public abstract void setMultipleSelections(boolean multi);
} // interface ListPeer
/* Copyright (C) 2000 Free Software Foundation /* MenuBarPeer.java -- Interface for menu bar peer
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,7 +31,10 @@ import java.awt.Menu; ...@@ -12,7 +31,10 @@ import java.awt.Menu;
public interface MenuBarPeer extends MenuComponentPeer public interface MenuBarPeer extends MenuComponentPeer
{ {
void addHelpMenu(Menu menu);
void add(Menu menu); public abstract void addHelpMenu(Menu menu);
void remove(int index); public abstract void addMenu(Menu menu);
} public abstract void delMenu(int index);
} // interface MenuBarPeer
/* Copyright (C) 2000 Free Software Foundation /* MenuComponentPeer.java --
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface MenuComponentPeer public interface MenuComponentPeer
{ {
void dispose();
} public abstract void dispose();
} // interface MenuComponentPeer
/* Copyright (C) 2000 Free Software Foundation /* MenuItemPeer.java -- Interface for menu item peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface MenuItemPeer extends MenuComponentPeer public interface MenuItemPeer extends MenuComponentPeer
{ {
void setEnabled(boolean enabled);
void setLabel(String text); public abstract void disable();
} public abstract void enable();
public abstract void setEnabled(boolean enabled);
public abstract void setLabel(String text);
} // interface MenuItemPeer
/* Copyright (C) 2000 Free Software Foundation /* MenuPeer.java -- Interface for menu peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,7 +31,8 @@ import java.awt.MenuItem; ...@@ -12,7 +31,8 @@ import java.awt.MenuItem;
public interface MenuPeer extends MenuItemPeer public interface MenuPeer extends MenuItemPeer
{ {
void add(MenuItem item); public abstract void addItem (MenuItem item);
void addSeparator(); public abstract void addSeparator ();
void remove(int index); public abstract void delItem (int index);
} }
/* Copyright (C) 2000 Free Software Foundation /* PanelPeer.java -- Interface for panel peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface PanelPeer extends ContainerPeer public interface PanelPeer extends ContainerPeer
{ {
}
} // interface PanelPeer
/* Copyright (C) 2000 Free Software Foundation /* PopupMenuPeer.java -- Interface for popup menu peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the GNU Classpath is free software; you can redistribute it and/or modify
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for it under the terms of the GNU General Public License as published by
details. */ the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
package java.awt.peer;
import java.awt.Event; package java.awt.peer;
import java.awt.Component;
public interface PopupMenuPeer extends MenuPeer public interface PopupMenuPeer extends MenuPeer
{ {
void show(Event e);
} public abstract void show (Component origin, int x, int y);
} // interface PopupMenuPeer
/* Copyright (C) 2000 Free Software Foundation /* ScrollPanePeer.java -- Interface for scrollable panes
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,10 +31,13 @@ import java.awt.Adjustable; ...@@ -12,10 +31,13 @@ import java.awt.Adjustable;
public interface ScrollPanePeer extends ContainerPeer public interface ScrollPanePeer extends ContainerPeer
{ {
void childResized(int width, int height);
int getHScrollbarHeight(); public abstract int getHScrollbarHeight();
int getVScrollbarWidth(); public abstract int getVScrollbarWidth();
void setScrollPosition(int x, int y); public abstract void setScrollPosition(int h, int v);
void setUnitIncrement(Adjustable adj, int increment); public abstract void childResized(int width, int height);
void setValue(Adjustable adj, int value); public abstract void setUnitIncrement(Adjustable item, int inc);
} public abstract void setValue(Adjustable item, int value);
} // interface ScollPanePeer
/* Copyright (C) 2000 Free Software Foundation /* ScrollbarPeer.java -- Interface for scrollbar peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface ScrollbarPeer extends ComponentPeer public interface ScrollbarPeer extends ComponentPeer
{ {
void setLineIncrement(int increment);
void setPageIncrement(int increment); public abstract void setLineIncrement(int inc);
void setValues(int value, int visible, int minimum, int maximum); public abstract void setPageIncrement(int inc);
} public abstract void setValues(int value, int visible, int min, int max);
} // interface ScrollbarPeer
/* Copyright (C) 2000 Free Software Foundation /* TextAreaPeer.java -- Interface for text area peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,6 +31,14 @@ import java.awt.Dimension; ...@@ -12,6 +31,14 @@ import java.awt.Dimension;
public interface TextAreaPeer extends TextComponentPeer public interface TextAreaPeer extends TextComponentPeer
{ {
void insert(String text, int pos);
void replaceRange(String text, int start, int end); public abstract void insert(String text, int pos);
} public abstract void insertText(String text, int pos);
public abstract Dimension minimumSize(int rows, int cols);
public abstract Dimension getMinimumSize(int rows, int cols);
public abstract Dimension preferredSize(int rows, int cols);
public abstract Dimension getPreferredSize(int rows, int cols);
public abstract void replaceRange(String text, int start_pos, int end_pos);
public abstract void replaceText(String text, int start_pos, int end_pos);
} // interface TextAreaPeer
/* Copyright (C) 2000 Free Software Foundation /* TextComponentPeer.java -- Superclass interface for text components
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface TextComponentPeer extends ComponentPeer public interface TextComponentPeer extends ComponentPeer
{ {
int getCaretPosition();
int getSelectionEnd(); public abstract int getSelectionEnd();
int getSelectionStart(); public abstract int getSelectionStart();
String getText(); public abstract String getText();
void select(int start, int end); public abstract void setText(String text);
void setCaretPosition(int pos); public abstract void select(int start_pos, int end_pos);
void setEditable(boolean editable); public abstract void setEditable(boolean editable);
void setText(String text); public abstract int getCaretPosition();
} public abstract void setCaretPosition(int pos);
} // interface TextComponentPeer
/* Copyright (C) 2000 Free Software Foundation /* TextFieldPeer.java -- Interface for text field peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
...@@ -12,5 +31,13 @@ import java.awt.Dimension; ...@@ -12,5 +31,13 @@ import java.awt.Dimension;
public interface TextFieldPeer extends TextComponentPeer public interface TextFieldPeer extends TextComponentPeer
{ {
void setEchoChar(char echo);
} public abstract Dimension minimumSize(int len);
public abstract Dimension preferredSize(int len);
public abstract Dimension getMinimumSize(int len);
public abstract Dimension getPreferredSize(int len);
public abstract void setEchoChar(char echo_char);
public abstract void setEchoCharacter(char echo_char);
} // interface TextFieldPeer
/* Copyright (C) 2000 Free Software Foundation /* WindowPeer.java -- Interface for window peers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of libgcj. This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
As a special exception, if you link this library with other files to
produce an executable, this library does not by itself cause the
resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.awt.peer; package java.awt.peer;
public interface WindowPeer extends ContainerPeer public interface WindowPeer extends ContainerPeer
{ {
void toBack();
void toFront(); public abstract void toBack();
} public abstract void toFront();
} // interface WindowPeer
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment