PatchSet 7223 Date: 2006/04/14 22:22:59 Author: robilad Branch: HEAD Tag: (none) Log: Removed some duplicate files from Kaffe AWT
Members: ChangeLog:1.4729->1.4730 kaffe/kaffevm/boehm-gc/boehm/configure:1.14->1.15 libraries/javalib/awt-implementations/kaffe/Makefile.am:1.10->1.11 libraries/javalib/awt-implementations/kaffe/Makefile.in:1.54->1.55 libraries/javalib/awt-implementations/kaffe/java/awt/GridBagConstraints.java:1.1->1.2(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayout.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayoutInfo.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/GridLayout.java:1.1->1.2(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/Autoscroll.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DnDConstants.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DnDEventMulticaster.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureListener.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureRecognizer.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSource.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceAdapter.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceContext.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceDragEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceDropEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceListener.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceMotionListener.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTarget.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetAdapter.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetContext.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetDragEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetDropEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetEvent.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetListener.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/InvalidDnDOperationException.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/MouseDragGestureRecognizer.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/package.html:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DragSourceContextPeer.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DropTargetContextPeer.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DropTargetPeer.java:1.2->1.3(DEAD) libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/package.html:1.2->1.3(DEAD) libraries/javalib/external/classpath/doc/vmintegration.info:1.10->1.11 Index: kaffe/ChangeLog diff -u kaffe/ChangeLog:1.4729 kaffe/ChangeLog:1.4730 --- kaffe/ChangeLog:1.4729 Fri Apr 14 20:17:30 2006 +++ kaffe/ChangeLog Fri Apr 14 22:22:59 2006 @@ -1,3 +1,42 @@ +2006-04-13 Riccardo Mottola <[EMAIL PROTECTED]> + + libraries/javalib/awt-implementations/kaffe/Makefile.am: + Removed some classes that came from GNU Classpath. + + * libraries/javalib/awt-implementations/kaffe/java/awt/GridBagConstraints.java, + libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayout.java, + libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayoutInfo.java, + libraries/javalib/awt-implementations/kaffe/java/awt/GridLayout.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/Autoscroll.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DnDConstants.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DnDEventMulticaster.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureListener.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragGestureRecognizer.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSource.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceAdapter.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceContext.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceDragEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceDropEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceListener.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DragSourceMotionListener.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTarget.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetAdapter.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetContext.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetDragEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetDropEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetEvent.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/DropTargetListener.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/InvalidDnDOperationException.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/MouseDragGestureRecognizer.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/package.html, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DragSourceContextPeer.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DropTargetContextPeer.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/DropTargetPeer.java, + libraries/javalib/awt-implementations/kaffe/java/awt/dnd/peer/package.html: + Removed. + 2006-04-14 Dalibor Topic <[EMAIL PROTECTED]> * kaffe/kaffevm/jit3/icode.c, Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/configure diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.14 kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.15 --- kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.14 Mon Apr 3 19:59:43 2006 +++ kaffe/kaffe/kaffevm/boehm-gc/boehm/configure Fri Apr 14 22:23:04 2006 @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Revision: 1.5 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for gc 6.7. +# Generated by GNU Autoconf 2.59 for gc 6.6. # # Report bugs to <[EMAIL PROTECTED]>. # @@ -429,8 +429,8 @@ # Identity of this package. PACKAGE_NAME='gc' PACKAGE_TARNAME='gc' -PACKAGE_VERSION='6.7' -PACKAGE_STRING='gc 6.7' +PACKAGE_VERSION='6.6' +PACKAGE_STRING='gc 6.6' PACKAGE_BUGREPORT='[EMAIL PROTECTED]' ac_unique_file="gcj_mlc.c" @@ -956,7 +956,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gc 6.7 to adapt to many kinds of systems. +\`configure' configures gc 6.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1023,7 +1023,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gc 6.7:";; + short | recursive ) echo "Configuration of gc 6.6:";; esac cat <<\_ACEOF @@ -1167,7 +1167,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -gc configure 6.7 +gc configure 6.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1181,7 +1181,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gc $as_me 6.7, which was +It was created by gc $as_me 6.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1953,7 +1953,7 @@ # Define the identity of the package. PACKAGE='gc' - VERSION='6.7' + VERSION='6.6' cat >>confdefs.h <<_ACEOF @@ -4051,23 +4051,6 @@ INCLUDES="$INCLUDES -pthread" THREADDLLIBS=-pthread ;; - *-*-netbsd*) - { echo "$as_me:$LINENO: WARNING: \"Only on NetBSD 2.0 or later.\"" >&5 -echo "$as_me: WARNING: \"Only on NetBSD 2.0 or later.\"" >&2;} - cat >>confdefs.h <<\_ACEOF -#define GC_NETBSD_THREADS 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _PTHREADS 1 -_ACEOF - - THREADDLLIBS="-lpthread -lrt" - ;; *-*-solaris*) cat >>confdefs.h <<\_ACEOF #define GC_SOLARIS_THREADS 1 @@ -10317,7 +10300,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by gc $as_me 6.7, which was +This file was extended by gc $as_me 6.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10375,7 +10358,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -gc config.status 6.7 +gc config.status 6.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Index: kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.am diff -u kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.am:1.10 kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.am:1.11 --- kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.am:1.10 Tue Feb 7 21:48:36 2006 +++ kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.am Fri Apr 14 22:23:04 2006 @@ -17,8 +17,6 @@ $(java_awt_SRCS) \ $(java_awt_color_SRCS) \ $(java_awt_datatransfer_SRCS) \ - $(java_awt_dnd_SRCS) \ - $(java_awt_dnd_peer_SRCS) \ $(java_awt_event_SRCS) \ $(java_awt_font_SRCS) \ $(java_awt_geom_SRCS) \ @@ -94,10 +92,6 @@ java/awt/GraphicsEnvironment.java \ java/awt/Graphics.java \ java/awt/GraphicsLink.java \ - java/awt/GridBagConstraints.java \ - java/awt/GridBagLayoutInfo.java \ - java/awt/GridBagLayout.java \ - java/awt/GridLayout.java \ java/awt/HeadlessException.java \ java/awt/IllegalComponentStateException.java \ java/awt/ImageCapabilities.java \ @@ -185,34 +179,6 @@ java/awt/datatransfer/SystemFlavorMap.java \ java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java -java_awt_dnd_SRCS = \ - java/awt/dnd/Autoscroll.java \ - java/awt/dnd/DnDConstants.java \ - java/awt/dnd/DnDEventMulticaster.java \ - java/awt/dnd/DragGestureEvent.java \ - java/awt/dnd/DragGestureListener.java \ - java/awt/dnd/DragGestureRecognizer.java \ - java/awt/dnd/DragSourceAdapter.java \ - java/awt/dnd/DragSourceContext.java \ - java/awt/dnd/DragSourceDragEvent.java \ - java/awt/dnd/DragSourceDropEvent.java \ - java/awt/dnd/DragSourceEvent.java \ - java/awt/dnd/DragSource.java \ - java/awt/dnd/DragSourceListener.java \ - java/awt/dnd/DragSourceMotionListener.java \ - java/awt/dnd/DropTargetAdapter.java \ - java/awt/dnd/DropTargetContext.java \ - java/awt/dnd/DropTargetDragEvent.java \ - java/awt/dnd/DropTargetDropEvent.java \ - java/awt/dnd/DropTargetEvent.java \ - java/awt/dnd/DropTarget.java \ - java/awt/dnd/DropTargetListener.java \ - java/awt/dnd/InvalidDnDOperationException.java \ - java/awt/dnd/MouseDragGestureRecognizer.java -java_awt_dnd_peer_SRCS = \ - java/awt/dnd/peer/DragSourceContextPeer.java \ - java/awt/dnd/peer/DropTargetContextPeer.java \ - java/awt/dnd/peer/DropTargetPeer.java java_awt_event_SRCS = \ java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ Index: kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.in diff -u kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.in:1.54 kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.in:1.55 --- kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.in:1.54 Tue Feb 7 21:48:36 2006 +++ kaffe/libraries/javalib/awt-implementations/kaffe/Makefile.in Fri Apr 14 22:23:04 2006 @@ -365,8 +365,6 @@ $(java_awt_SRCS) \ $(java_awt_color_SRCS) \ $(java_awt_datatransfer_SRCS) \ - $(java_awt_dnd_SRCS) \ - $(java_awt_dnd_peer_SRCS) \ $(java_awt_event_SRCS) \ $(java_awt_font_SRCS) \ $(java_awt_geom_SRCS) \ @@ -444,10 +442,6 @@ java/awt/GraphicsEnvironment.java \ java/awt/Graphics.java \ java/awt/GraphicsLink.java \ - java/awt/GridBagConstraints.java \ - java/awt/GridBagLayoutInfo.java \ - java/awt/GridBagLayout.java \ - java/awt/GridLayout.java \ java/awt/HeadlessException.java \ java/awt/IllegalComponentStateException.java \ java/awt/ImageCapabilities.java \ @@ -538,36 +532,6 @@ java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java -java_awt_dnd_SRCS = \ - java/awt/dnd/Autoscroll.java \ - java/awt/dnd/DnDConstants.java \ - java/awt/dnd/DnDEventMulticaster.java \ - java/awt/dnd/DragGestureEvent.java \ - java/awt/dnd/DragGestureListener.java \ - java/awt/dnd/DragGestureRecognizer.java \ - java/awt/dnd/DragSourceAdapter.java \ - java/awt/dnd/DragSourceContext.java \ - java/awt/dnd/DragSourceDragEvent.java \ - java/awt/dnd/DragSourceDropEvent.java \ - java/awt/dnd/DragSourceEvent.java \ - java/awt/dnd/DragSource.java \ - java/awt/dnd/DragSourceListener.java \ - java/awt/dnd/DragSourceMotionListener.java \ - java/awt/dnd/DropTargetAdapter.java \ - java/awt/dnd/DropTargetContext.java \ - java/awt/dnd/DropTargetDragEvent.java \ - java/awt/dnd/DropTargetDropEvent.java \ - java/awt/dnd/DropTargetEvent.java \ - java/awt/dnd/DropTarget.java \ - java/awt/dnd/DropTargetListener.java \ - java/awt/dnd/InvalidDnDOperationException.java \ - java/awt/dnd/MouseDragGestureRecognizer.java - -java_awt_dnd_peer_SRCS = \ - java/awt/dnd/peer/DragSourceContextPeer.java \ - java/awt/dnd/peer/DropTargetContextPeer.java \ - java/awt/dnd/peer/DropTargetPeer.java - java_awt_event_SRCS = \ java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ @@ -846,7 +810,7 @@ distdir: $(DISTFILES) - $(mkdir_p) $(distdir)/java/applet $(distdir)/java/awt $(distdir)/java/awt/color $(distdir)/java/awt/datatransfer $(distdir)/java/awt/dnd $(distdir)/java/awt/dnd/peer $(distdir)/java/awt/event $(distdir)/java/awt/font $(distdir)/java/awt/geom $(distdir)/java/awt/im $(distdir)/java/awt/image $(distdir)/java/awt/image/renderable $(distdir)/java/awt/peer $(distdir)/java/awt/print $(distdir)/org/kaffe/applet $(distdir)/org/kaffe/awt $(distdir)/org/kaffe/util/log + $(mkdir_p) $(distdir)/java/applet $(distdir)/java/awt $(distdir)/java/awt/color $(distdir)/java/awt/datatransfer $(distdir)/java/awt/event $(distdir)/java/awt/font $(distdir)/java/awt/geom $(distdir)/java/awt/im $(distdir)/java/awt/image $(distdir)/java/awt/image/renderable $(distdir)/java/awt/peer $(distdir)/java/awt/print $(distdir)/org/kaffe/applet $(distdir)/org/kaffe/awt $(distdir)/org/kaffe/util/log @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ =================================================================== Checking out kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/GridBagConstraints.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Attic/GridBagConstraints.java,v VERS: 1.1 *************** --- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/GridBagConstraints.java Fri Apr 14 22:33:43 2006 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,144 +0,0 @@ -package java.awt; - -import java.io.Serializable; - -/** - * class GridBagConstraints - - * - * Copyright (c) 1998 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - * - * @author J.Mehlitz - */ -public class GridBagConstraints - implements Cloneable, Serializable -{ - final private static long serialVersionUID = -1000070633030801713L; - final public static int RELATIVE = -1; - final public static int REMAINDER = 0; - final public static int NONE = 0; - final public static int BOTH = 1; - final public static int HORIZONTAL = 2; - final public static int VERTICAL = 3; - final public static int CENTER = 10; - final public static int NORTH = 11; - final public static int NORTHEAST = 12; - final public static int EAST = 13; - final public static int SOUTHEAST = 14; - final public static int SOUTH = 15; - final public static int SOUTHWEST = 16; - final public static int WEST = 17; - final public static int NORTHWEST = 18; - public int gridx = RELATIVE; - public int gridy = RELATIVE; - public int gridwidth = 1; - public int gridheight = 1; - public double weightx; - public double weighty; - public int anchor = CENTER; - public int fill = NONE; - public int ipadx; - public int ipady; - public Insets insets = new Insets( 0, 0, 0, 0); - -public GridBagConstraints() { -} - -/** - * Creates a GridBagConstraints object with all of its fields set to the - * passed-in arguments. - * Note: Because the use of this constructor hinders readability of source - * code, this constructor should only be used by automatic source code - * generation tools. - * - * @since JDK1.2 - */ -public GridBagConstraints(int gridx, - int gridy, - int gridwidth, - int gridheight, - double weightx, - double weighty, - int anchor, - int fill, - Insets insets, - int ipadx, - int ipady) -{ - this.gridx = gridx; - this.gridy = gridy; - this.gridwidth = gridwidth; - this.gridheight = gridheight; - this.weightx = weightx; - this.weighty = weighty; - this.anchor = anchor; - this.fill = fill; - this.insets = insets; - this.ipadx = ipadx; - this.ipady = ipady; -} - -public Object clone() { - try { - GridBagConstraints gc = (GridBagConstraints) super.clone(); - gc.insets = (Insets) insets.clone(); - return gc; - } - catch ( CloneNotSupportedException e) { - return null; - } -} - -public String toString() { - String san, sfl; - - switch ( anchor ) { - case NORTH: - san = "north"; - break; - case NORTHEAST: - san = "northeast"; - break; - case EAST: - san = "east"; - break; - case SOUTHEAST: - san = "southeast"; - break; - case SOUTH: - san = "south"; - break; - case SOUTHWEST: - san = "southwest"; - break; - case WEST: - san = "west"; - break; - case NORTHWEST: - san = "northwest"; - break; - default: - san = "center"; - } - - switch ( fill ) { - case HORIZONTAL: - sfl = "horz"; - break; - case VERTICAL: - sfl = "vert"; - break; - case BOTH: - sfl = "both"; - break; - default: - sfl = "none"; - } - - return ("Constraint:" + gridx + "," + gridy + " " + gridwidth + "x" + gridheight + - ",fill:" + sfl + ",anchor:" + san + ",weight:" + weightx + "x" + weighty); -} -} =================================================================== Checking out kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayout.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Attic/GridBagLayout.java,v VERS: 1.2 *************** --- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/GridBagLayout.java Fri Apr 14 22:33:43 2006 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,1067 +0,0 @@ -/* GridBagLayout - Layout manager for components according to GridBagConstraints - Copyright (C) 2002, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package java.awt; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; - -/** - * @author Michael Koch <[EMAIL PROTECTED]> - * @author Jeroen Frijters <[EMAIL PROTECTED]> - */ -public class GridBagLayout - implements Serializable, LayoutManager2 -{ - private static final long serialVersionUID = 8838754796412211005L; - - protected static final int MINSIZE = 1; - protected static final int PREFERREDSIZE = 2; - protected static final int MAXGRIDSIZE = 512; - - // comptable remembers the original contraints given to us. - // internalcomptable is used to keep track of modified constraint values - // that we calculate, particularly when we are given RELATIVE and - // REMAINDER constraints. - // Constraints kept in comptable are never modified, and constraints - // kept in internalcomptable can be modified internally only. - protected Hashtable comptable; - private Hashtable internalcomptable; - protected GridBagLayoutInfo layoutInfo; - protected GridBagConstraints defaultConstraints; - - public double[] columnWeights; - public int[] columnWidths; - public double[] rowWeights; - public int[] rowHeights; - - public GridBagLayout () - { - this.comptable = new Hashtable(); - this.internalcomptable = new Hashtable(); - this.defaultConstraints= new GridBagConstraints(); - } - - /** - * Helper method to calc the sum of a range of elements in an int array. - */ - private int sumIntArray (int[] array, int upto) - { - int result = 0; - - for (int i = 0; i < upto; i++) - result += array [i]; - - return result; - } - - /** - * Helper method to calc the sum of all elements in an int array. - */ - private int sumIntArray (int[] array) - { - return sumIntArray(array, array.length); - } - - /** - * Helper method to calc the sum of all elements in an double array. - */ - private double sumDoubleArray (double[] array) - { - double result = 0; - - for (int i = 0; i < array.length; i++) - result += array [i]; - - return result; - } - - public void addLayoutComponent (String name, Component component) - { - // do nothing here. - } - - public void removeLayoutComponent (Component component) - { - // do nothing here - } - - public void addLayoutComponent (Component component, Object constraints) - { - if (constraints == null) - return; - - if (!(constraints instanceof GridBagConstraints)) - throw new IllegalArgumentException(); - - setConstraints (component, (GridBagConstraints) constraints); - } - - public Dimension preferredLayoutSize (Container parent) - { - if (parent == null) - return new Dimension (0, 0); - - GridBagLayoutInfo li = getLayoutInfo (parent, PREFERREDSIZE); - return getMinSize (parent, li); - } - - public Dimension minimumLayoutSize (Container parent) - { - if (parent == null) - return new Dimension (0, 0); - - GridBagLayoutInfo li = getLayoutInfo (parent, MINSIZE); - return getMinSize (parent, li); - } - - public Dimension maximumLayoutSize (Container target) - { - return new Dimension (Integer.MAX_VALUE, Integer.MAX_VALUE); - } - - public void layoutContainer (Container parent) - { - arrangeGrid (parent); - } - - public float getLayoutAlignmentX (Container target) - { - return Component.CENTER_ALIGNMENT; - } - - public float getLayoutAlignmentY (Container target) - { - return Component.CENTER_ALIGNMENT; - } - - public void invalidateLayout (Container target) - { - this.layoutInfo = null; - } - - public void setConstraints (Component component, - GridBagConstraints constraints) - { - GridBagConstraints clone = (GridBagConstraints) constraints.clone(); - - if (clone.gridx < 0) - clone.gridx = GridBagConstraints.RELATIVE; - - if (clone.gridy < 0) - clone.gridy = GridBagConstraints.RELATIVE; - - if (clone.gridwidth == 0) - clone.gridwidth = GridBagConstraints.REMAINDER; - else if (clone.gridwidth < 0 - && clone.gridwidth != GridBagConstraints.REMAINDER - && clone.gridwidth != GridBagConstraints.RELATIVE) - clone.gridwidth = 1; - - if (clone.gridheight == 0) - clone.gridheight = GridBagConstraints.REMAINDER; - else if (clone.gridheight < 0 - && clone.gridheight != GridBagConstraints.REMAINDER - && clone.gridheight != GridBagConstraints.RELATIVE) - clone.gridheight = 1; - - comptable.put (component, clone); - } - - public GridBagConstraints getConstraints (Component component) - { - return (GridBagConstraints) (lookupConstraints (component).clone()); - } - - protected GridBagConstraints lookupConstraints (Component component) - { - GridBagConstraints result = (GridBagConstraints) comptable.get (component); - - if (result == null) - { - setConstraints (component, defaultConstraints); - result = (GridBagConstraints) comptable.get (component); - } - - return result; - } - - private GridBagConstraints lookupInternalConstraints (Component component) - { - GridBagConstraints result = - (GridBagConstraints) internalcomptable.get (component); - - if (result == null) - { - result = (GridBagConstraints) lookupConstraints(component).clone(); - internalcomptable.put (component, result); - } - - return result; - } - - /** - * @since 1.1 - */ - public Point getLayoutOrigin () - { - if (layoutInfo == null) - return new Point (0, 0); - - return new Point (layoutInfo.pos_x, layoutInfo.pos_y); - } - - /** - * @since 1.1 - */ - public int[][] getLayoutDimensions () - { - int[][] result = new int [2][]; - if (layoutInfo == null) - { - result[0] = new int[0]; - result[1] = new int[0]; - - return result; - } - - result [0] = new int [layoutInfo.cols]; - System.arraycopy (layoutInfo.colWidths, 0, result [0], 0, layoutInfo.cols); - result [1] = new int [layoutInfo.rows]; - System.arraycopy (layoutInfo.rowHeights, 0, result [1], 0, layoutInfo.rows); - return result; - } - - public double[][] getLayoutWeights () - { - double[][] result = new double [2][]; - if (layoutInfo == null) - { - result[0] = new double[0]; - result[1] = new double[0]; - - return result; - } - - result [0] = new double [layoutInfo.cols]; - System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols); - result [1] = new double [layoutInfo.rows]; - System.arraycopy (layoutInfo.rowWeights, 0, result [1], 0, layoutInfo.rows); - return result; - } - - /** - * @since 1.1 - */ - public Point location (int x, int y) - { - if (layoutInfo == null) - return new Point (0, 0); - - int col; - int row; - int pixel_x = layoutInfo.pos_x; - int pixel_y = layoutInfo.pos_y; - - for (col = 0; col < layoutInfo.cols; col++) - { - int w = layoutInfo.colWidths [col]; - if (x < pixel_x + w) - break; - - pixel_x += w; - } - - for (row = 0; row < layoutInfo.rows; row++) - { - int h = layoutInfo.rowHeights [row]; - if (y < pixel_y + h) - break; - - pixel_y += h; - } - - return new Point (col, row); - } - - /** - * Obsolete. - */ - protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect) - { - // FIXME - throw new Error ("Not implemented"); - } - - /** - * Obsolete. - */ - protected void ArrangeGrid (Container parent) - { - Component[] components = parent.getComponents(); - - if (components.length == 0) - return; - - GridBagLayoutInfo info = getLayoutInfo (parent, MINSIZE); - if (info.cols == 0 && info.rows == 0) - return; - layoutInfo = info; - - // DEBUG - //dumpLayoutInfo (layoutInfo); - - for(int i = 0; i < components.length; i++) - { - Component component = components [i]; - - // If component is not visible we dont have to care about it. - if (!component.isVisible()) - continue; - - GridBagConstraints constraints = - lookupInternalConstraints(component); - - int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx); - int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy); - int cellw = sumIntArray(layoutInfo.colWidths, - constraints.gridx + constraints.gridwidth) - cellx; - int cellh = sumIntArray(layoutInfo.rowHeights, - constraints.gridy + constraints.gridheight) - celly; - - Insets insets = constraints.insets; - if (insets != null) - { - cellx += insets.left; - celly += insets.top; - cellw -= insets.left + insets.right; - cellh -= insets.top + insets.bottom; - } - - Dimension dim = component.getPreferredSize(); - - // Note: Documentation says that padding is added on both sides, but - // visual inspection shows that the Sun implementation only adds it - // once, so we do the same. - dim.width += constraints.ipadx; - dim.height += constraints.ipady; - - switch(constraints.fill) - { - case GridBagConstraints.HORIZONTAL: - dim.width = cellw; - break; - case GridBagConstraints.VERTICAL: - dim.height = cellh; - break; - case GridBagConstraints.BOTH: - dim.width = cellw; - dim.height = cellh; - break; - } - - int x; - int y; - - switch(constraints.anchor) - { - case GridBagConstraints.NORTH: - x = cellx + (cellw - dim.width) / 2; - y = celly; - break; - case GridBagConstraints.SOUTH: - x = cellx + (cellw - dim.width) / 2; - y = celly + cellh - dim.height; - break; - case GridBagConstraints.WEST: - x = cellx; - y = celly + (cellh - dim.height) / 2; - break; - case GridBagConstraints.EAST: - x = cellx + cellw - dim.width; - y = celly + (cellh - dim.height) / 2; - break; - case GridBagConstraints.NORTHEAST: - x = cellx + cellw - dim.width; - y = celly; - break; - case GridBagConstraints.NORTHWEST: - x = cellx; - y = celly; - break; - case GridBagConstraints.SOUTHEAST: - x = cellx + cellw - dim.width; - y = celly + cellh - dim.height; - break; - case GridBagConstraints.SOUTHWEST: - x = cellx; - y = celly + cellh - dim.height; - break; - default: - x = cellx + (cellw - dim.width) / 2; - y = celly + (cellh - dim.height) / 2; - break; - } - - component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height); - } - - // DEBUG - //dumpLayoutInfo (layoutInfo); - } - - /** - * Obsolete. - */ - protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag) - { - if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE) - throw new IllegalArgumentException(); - - Dimension parentDim = parent.getSize (); - Insets parentInsets = parent.getInsets (); - parentDim.width -= parentInsets.left + parentInsets.right; - parentDim.height -= parentInsets.top + parentInsets.bottom; - - int current_y = 0; - int max_x = 0; - int max_y = 0; - - // Guaranteed to contain the last component added to the given row - // or column, whose gridwidth/height is not REMAINDER. - HashMap lastInRow = new HashMap(); - HashMap lastInCol = new HashMap(); - - Component[] components = parent.getComponents(); - - // Components sorted by gridwidths/heights, - // smallest to largest, with REMAINDER and RELATIVE at the end. - // These are useful when determining sizes and weights. - ArrayList sortedByWidth = new ArrayList(components.length); - ArrayList sortedByHeight = new ArrayList(components.length); - - // STEP 1: first we figure out how many rows/columns - for (int i = 0; i < components.length; i++) - { - Component component = components [i]; - - // If component is not visible we dont have to care about it. - if (!component.isVisible()) - continue; - - // When looking up the constraint for the first time, check the - // original unmodified constraint. After the first time, always - // refer to the internal modified constraint. - GridBagConstraints originalConstraints = lookupConstraints (component); - GridBagConstraints constraints = (GridBagConstraints) originalConstraints.clone(); - internalcomptable.put(component, constraints); - - // Cases: - // - // 1. gridy == RELATIVE, gridx == RELATIVE - // - // use y as the row number; check for the next - // available slot at row y - // - // 2. only gridx == RELATIVE - // - // check for the next available slot at row gridy - // *** Patch too long, truncated *** _______________________________________________ kaffe mailing list kaffe@kaffe.org http://kaffe.org/cgi-bin/mailman/listinfo/kaffe