Imported GNU Classpath 0.92
2006-08-14 Mark Wielaard <mark@klomp.org> Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139
This commit is contained in:
parent
abab460491
commit
ac1ed908de
1294 changed files with 99479 additions and 35933 deletions
|
@ -48,8 +48,6 @@ import java.awt.Font;
|
|||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
|
@ -101,8 +99,8 @@ public class SwingComponentPeer
|
|||
/**
|
||||
* Creates a SwingComponentPeer instance. Subclasses are expected to call
|
||||
* this constructor and thereafter call
|
||||
* {@link #init(Component, SwingComponent)} in order to setup the AWT and
|
||||
* Swing components properly.
|
||||
* {@link #init(Component,SwingComponent)}
|
||||
* in order to setup the AWT and Swing components properly.
|
||||
*/
|
||||
protected SwingComponentPeer()
|
||||
{
|
||||
|
@ -167,12 +165,9 @@ public class SwingComponentPeer
|
|||
*/
|
||||
public Image createImage(int width, int height)
|
||||
{
|
||||
GraphicsEnvironment graphicsEnv =
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice dev = graphicsEnv.getDefaultScreenDevice();
|
||||
GraphicsConfiguration conf = dev.getDefaultConfiguration();
|
||||
Image image = conf.createCompatibleImage(width, height);
|
||||
return image;
|
||||
Component parent = awtComponent.getParent();
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
return parentPeer.createImage(width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -336,21 +331,24 @@ public class SwingComponentPeer
|
|||
{
|
||||
case PaintEvent.UPDATE:
|
||||
case PaintEvent.PAINT:
|
||||
Graphics g = getGraphics();
|
||||
Rectangle clip = ((PaintEvent)e).getUpdateRect();
|
||||
g.clipRect(clip.x, clip.y, clip.width, clip.height);
|
||||
//if (this instanceof LightweightPeer)
|
||||
// {
|
||||
// This only will work when the component is showing.
|
||||
if (awtComponent.isShowing())
|
||||
{
|
||||
Graphics g = getGraphics();
|
||||
Rectangle clip = ((PaintEvent)e).getUpdateRect();
|
||||
g.clipRect(clip.x, clip.y, clip.width, clip.height);
|
||||
//if (this instanceof LightweightPeer)
|
||||
// {
|
||||
if (e.getID() == PaintEvent.UPDATE)
|
||||
awtComponent.update(g);
|
||||
else
|
||||
awtComponent.paint(g);
|
||||
// }
|
||||
// We paint the 'heavyweights' at last, so that they appear on top of
|
||||
// everything else.
|
||||
peerPaint(g);
|
||||
|
||||
g.dispose();
|
||||
// }
|
||||
// We paint the 'heavyweights' at last, so that they appear on top of
|
||||
// everything else.
|
||||
peerPaint(g);
|
||||
g.dispose();
|
||||
}
|
||||
break;
|
||||
case MouseEvent.MOUSE_PRESSED:
|
||||
case MouseEvent.MOUSE_RELEASED:
|
||||
|
@ -384,6 +382,11 @@ public class SwingComponentPeer
|
|||
{
|
||||
if (swingComponent != null)
|
||||
swingComponent.getJComponent().setVisible(false);
|
||||
|
||||
Component parent = awtComponent.getParent();
|
||||
if (parent != null)
|
||||
parent.repaint(awtComponent.getX(), awtComponent.getY(),
|
||||
awtComponent.getWidth(), awtComponent.getHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -470,17 +473,15 @@ public class SwingComponentPeer
|
|||
public boolean prepareImage(Image img, int width, int height, ImageObserver ob)
|
||||
{
|
||||
Component parent = awtComponent.getParent();
|
||||
boolean res;
|
||||
if(parent != null)
|
||||
{
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
res = parentPeer.prepareImage(img, width, height, ob);
|
||||
}
|
||||
{
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
return parentPeer.prepareImage(img, width, height, ob);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = Toolkit.getDefaultToolkit().prepareImage(img, width, height, ob);
|
||||
}
|
||||
return res;
|
||||
{
|
||||
return Toolkit.getDefaultToolkit().prepareImage(img, width, height, ob);
|
||||
}
|
||||
}
|
||||
|
||||
public void print(Graphics graphics)
|
||||
|
@ -662,8 +663,10 @@ public class SwingComponentPeer
|
|||
*/
|
||||
public void setVisible(boolean visible)
|
||||
{
|
||||
if (swingComponent != null)
|
||||
swingComponent.getJComponent().setVisible(visible);
|
||||
if (visible)
|
||||
show();
|
||||
else
|
||||
hide();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -782,8 +785,13 @@ public class SwingComponentPeer
|
|||
public VolatileImage createVolatileImage(int width, int height)
|
||||
{
|
||||
Component parent = awtComponent.getParent();
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
return parentPeer.createVolatileImage(width, height);
|
||||
VolatileImage im = null;
|
||||
if (parent != null)
|
||||
{
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
im = parentPeer.createVolatileImage(width, height);
|
||||
}
|
||||
return im;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue