Imported GNU Classpath 0.90
Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r111942
This commit is contained in:
parent
27079765d0
commit
8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions
|
@ -38,9 +38,12 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Component;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.PaintEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.peer.WindowPeer;
|
||||
|
||||
|
@ -123,7 +126,23 @@ public class GtkWindowPeer extends GtkContainerPeer
|
|||
|
||||
native void nativeSetBounds (int x, int y, int width, int height);
|
||||
native void nativeSetBoundsUnlocked (int x, int y, int width, int height);
|
||||
native void nativeSetLocation (int x, int y);
|
||||
native void nativeSetLocationUnlocked (int x, int y);
|
||||
|
||||
public void setLocation (int x, int y)
|
||||
{
|
||||
// prevent window_configure_cb -> awtComponent.setSize ->
|
||||
// peer.setBounds -> nativeSetBounds self-deadlock on GDK lock.
|
||||
if (Thread.currentThread() == GtkToolkit.mainThread)
|
||||
return;
|
||||
nativeSetLocation (x, y);
|
||||
}
|
||||
|
||||
public void setLocationUnlocked (int x, int y)
|
||||
{
|
||||
nativeSetLocationUnlocked (x, y);
|
||||
}
|
||||
|
||||
public void setBounds (int x, int y, int width, int height)
|
||||
{
|
||||
// prevent window_configure_cb -> awtComponent.setSize ->
|
||||
|
@ -192,12 +211,7 @@ public class GtkWindowPeer extends GtkContainerPeer
|
|||
|
||||
public void show ()
|
||||
{
|
||||
// Prevent the window manager from automatically placing this
|
||||
// window when it is shown.
|
||||
setBounds (awtComponent.getX(),
|
||||
awtComponent.getY(),
|
||||
awtComponent.getWidth(),
|
||||
awtComponent.getHeight());
|
||||
setLocation(awtComponent.getX(), awtComponent.getY());
|
||||
setVisible (true);
|
||||
}
|
||||
|
||||
|
@ -235,4 +249,32 @@ public class GtkWindowPeer extends GtkContainerPeer
|
|||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public void handleEvent(AWTEvent event)
|
||||
{
|
||||
int id = event.getID();
|
||||
if (id == PaintEvent.UPDATE || id == PaintEvent.PAINT)
|
||||
{
|
||||
try
|
||||
{
|
||||
Graphics g = getGraphics();
|
||||
if (! awtComponent.isShowing() || awtComponent.getWidth() < 1
|
||||
|| awtComponent.getHeight() < 1 || g == null)
|
||||
return;
|
||||
|
||||
g.setClip(((PaintEvent) event).getUpdateRect());
|
||||
|
||||
// Do not want to clear anything before painting.
|
||||
awtComponent.paint(g);
|
||||
|
||||
g.dispose();
|
||||
return;
|
||||
}
|
||||
catch (InternalError e)
|
||||
{
|
||||
System.err.println(e);
|
||||
}
|
||||
}
|
||||
super.handleEvent(event);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue