Commit ec8a1dd5 by Mark Wielaard

[multiple changes]

2003-07-25  Mark Wielaard  <mark@klomp.org>

	* Makefile.am (awt_java_source_files): java/awt/GridBagLayoutInfo.java
	added.
	* Makefile.in: Likewise.

2003-07-25  Jeroen Frijters  <jeroen@frijters.net>

	* java/awt/Component.java
	(getPreferredSize): Call preferredSize.
	(preferredSize): Moved body of getPreferredSize here.
	(getMinimumSize): Call minimumSize.
	(minimumSize): Moved body of getMinimumSize here.
	(prepareImage): Fall back on Toolkit.prepareImage if there is no peer
	(checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
	pass -1
	* java/awt/Container.java
	(validate): Don't validate if there is no peer.
	(update): Clear background before calling paint.
	* java/awt/GridBagLayout.java
	Completed the implementation and fixed several bugs.
	* java/awt/MediaTracker.java
	(MediaEntry.imageUpdate): Fixed typo. & instead of | was used to
	combine flags.
	* java/awt/Window.java
	(Window): Don't call setVisible(false). Windows are invisible by
	default and calling virtual methods from constructor causes
	compatibility problems (e.g. subclasses may assume that the peer
	already exists).

2003-07-25  Michael Koch  <konqueror@gmx.de>

	* java/awt/GridBagLayout.java:
	Totally reworked and partly implemented.
	* java/awt/GridBagLayoutInfo.java:
	New file.

From-SVN: r69785
parent 0fe37f68
2003-07-25 Mark Wielaard <mark@klomp.org>
* Makefile.am (awt_java_source_files): java/awt/GridBagLayoutInfo.java
added.
* Makefile.in: Likewise.
2003-07-25 Jeroen Frijters <jeroen@frijters.net>
* java/awt/Component.java
(getPreferredSize): Call preferredSize.
(preferredSize): Moved body of getPreferredSize here.
(getMinimumSize): Call minimumSize.
(minimumSize): Moved body of getMinimumSize here.
(prepareImage): Fall back on Toolkit.prepareImage if there is no peer
(checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
pass -1
* java/awt/Container.java
(validate): Don't validate if there is no peer.
(update): Clear background before calling paint.
* java/awt/GridBagLayout.java
Completed the implementation and fixed several bugs.
* java/awt/MediaTracker.java
(MediaEntry.imageUpdate): Fixed typo. & instead of | was used to
combine flags.
* java/awt/Window.java
(Window): Don't call setVisible(false). Windows are invisible by
default and calling virtual methods from constructor causes
compatibility problems (e.g. subclasses may assume that the peer
already exists).
2003-07-25 Michael Koch <konqueror@gmx.de>
* java/awt/GridBagLayout.java:
Totally reworked and partly implemented.
* java/awt/GridBagLayoutInfo.java:
New file.
2003-07-24 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (create):
......
......@@ -818,6 +818,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
......
......@@ -589,6 +589,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
......@@ -3094,6 +3095,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/GraphicsConfiguration.P .deps/java/awt/GraphicsDevice.P \
.deps/java/awt/GraphicsEnvironment.P \
.deps/java/awt/GridBagConstraints.P .deps/java/awt/GridBagLayout.P \
.deps/java/awt/GridBagLayoutInfo.P \
.deps/java/awt/GridLayout.P .deps/java/awt/HeadlessException.P \
.deps/java/awt/IllegalComponentStateException.P .deps/java/awt/Image.P \
.deps/java/awt/ImageCapabilities.P .deps/java/awt/Insets.P \
......
......@@ -1452,12 +1452,7 @@ public abstract class Component
*/
public Dimension getPreferredSize()
{
if (prefSize == null)
if (peer == null)
return new Dimension(width, height);
else
prefSize = peer.getPreferredSize();
return prefSize;
return preferredSize();
}
/**
......@@ -1468,7 +1463,12 @@ public abstract class Component
*/
public Dimension preferredSize()
{
return getPreferredSize();
if (prefSize == null)
if (peer == null)
return new Dimension(width, height);
else
prefSize = peer.getPreferredSize();
return prefSize;
}
/**
......@@ -1480,10 +1480,7 @@ public abstract class Component
*/
public Dimension getMinimumSize()
{
if (minSize == null)
minSize = (peer != null ? peer.getMinimumSize()
: new Dimension(width, height));
return minSize;
return minimumSize();
}
/**
......@@ -1494,7 +1491,10 @@ public abstract class Component
*/
public Dimension minimumSize()
{
return getMinimumSize();
if (minSize == null)
minSize = (peer != null ? peer.getMinimumSize()
: new Dimension(width, height));
return minSize;
}
/**
......@@ -1941,7 +1941,10 @@ public abstract class Component
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer)
{
return peer.prepareImage(image, width, height, observer);
if (peer != null)
return peer.prepareImage(image, width, height, observer);
else
return getToolkit().prepareImage(image, width, height, observer);
}
/**
......@@ -1957,8 +1960,7 @@ public abstract class Component
*/
public int checkImage(Image image, ImageObserver observer)
{
return checkImage(image, image.getWidth(observer),
image.getHeight(observer), observer);
return checkImage(image, -1, -1, observer);
}
/**
......
......@@ -473,7 +473,7 @@ public class Container extends Component
{
synchronized (getTreeLock ())
{
if (! isValid())
if (! isValid() && peer != null)
{
validateTree();
}
......@@ -658,6 +658,7 @@ public class Container extends Component
*/
public void update(Graphics g)
{
g.clearRect(0, 0, width, height);
super.update(g);
}
......
/* GridBagLayoutInfo -
Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307 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;
/**
* @author Michael Koch <konqueror@gmx.de>
*/
class GridBagLayoutInfo implements Serializable
{
private static final long serialVersionUID = -4899416460737170217L;
int pos_x;
int pos_y;
int cols;
int rows;
int colWidths[];
int rowHeights[];
double colWeights[];
double rowWeights[];
GridBagLayoutInfo (int cols, int rows)
{
this.pos_x = 0;
this.pos_y = 0;
this.cols = cols;
this.rows = rows;
this.colWidths = new int [cols];
this.rowHeights = new int [rows];
this.colWeights = new double [cols];
this.rowWeights = new double [rows];
}
}
......@@ -76,9 +76,9 @@ public class MediaTracker implements java.io.Serializable
int width, int height)
{
if ((flags & ABORT) != 0)
status = ABORTED & COMPLETE;
status = ABORTED | COMPLETE;
else if ((flags & ERROR) != 0)
status = ERRORED & COMPLETE;
status = ERRORED | COMPLETE;
else if ((flags & ALLBITS) != 0)
status = COMPLETE;
else
......
......@@ -84,7 +84,6 @@ public class Window extends Container implements Accessible
*/
Window()
{
setVisible(false);
setLayout(new BorderLayout());
}
......@@ -106,7 +105,7 @@ public class Window extends Container implements Accessible
peer = ((EmbeddedWindowSupport) getToolkit())
.createEmbeddedWindow (window_id, width, height);
}
/**
* Initializes a new instance of <code>Window</code> with the specified
* parent. The window will initially be invisible.
......
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