Imported GNU Classpath 0.90
Imported GNU Classpath 0.90 * scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale. * sources.am: Regenerated. * gcj/javaprims.h: Regenerated. * Makefile.in: Regenerated. * gcj/Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * gnu/java/lang/VMInstrumentationImpl.java: New override. * gnu/java/net/local/LocalSocketImpl.java: Likewise. * gnu/classpath/jdwp/VMMethod.java: Likewise. * gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest interface. * java/lang/Thread.java: Add UncaughtExceptionHandler. * java/lang/reflect/Method.java: Implements GenericDeclaration and isSynthetic(), * java/lang/reflect/Field.java: Likewise. * java/lang/reflect/Constructor.java * java/lang/Class.java: Implements Type, GenericDeclaration, getSimpleName() and getEnclosing*() methods. * java/lang/Class.h: Add new public methods. * java/lang/Math.java: Add signum(), ulp() and log10(). * java/lang/natMath.cc (log10): New function. * java/security/VMSecureRandom.java: New override. * java/util/logging/Logger.java: Updated to latest classpath version. * java/util/logging/LogManager.java: New override. From-SVN: r113887
This commit is contained in:
parent
eaec4980e1
commit
4f9533c772
1640 changed files with 126485 additions and 104808 deletions
|
@ -63,6 +63,7 @@ import java.awt.event.FocusEvent;
|
|||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.PaintEvent;
|
||||
import java.awt.event.TextEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
@ -86,8 +87,6 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
|
||||
Insets insets;
|
||||
|
||||
boolean isInRepaint;
|
||||
|
||||
/* this isEnabled differs from Component.isEnabled, in that it
|
||||
knows if a parent is disabled. In that case Component.isEnabled
|
||||
may return true, but our isEnabled will always return false */
|
||||
|
@ -100,8 +99,9 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
native void gtkWidgetGetPreferredDimensions (int[] dim);
|
||||
native void gtkWindowGetLocationOnScreen (int[] point);
|
||||
native void gtkWidgetGetLocationOnScreen (int[] point);
|
||||
native void gtkWidgetSetCursor (int type);
|
||||
native void gtkWidgetSetCursorUnlocked (int type);
|
||||
native void gtkWidgetSetCursor (int type, GtkImage image, int x, int y);
|
||||
native void gtkWidgetSetCursorUnlocked (int type, GtkImage image,
|
||||
int x, int y);
|
||||
native void gtkWidgetSetBackground (int red, int green, int blue);
|
||||
native void gtkWidgetSetForeground (int red, int green, int blue);
|
||||
native void gtkWidgetSetSensitive (boolean sensitive);
|
||||
|
@ -150,6 +150,9 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
setNativeEventMask ();
|
||||
|
||||
realize ();
|
||||
|
||||
if (awtComponent.isCursorSet())
|
||||
setCursor ();
|
||||
}
|
||||
|
||||
void setParentAndBounds ()
|
||||
|
@ -176,16 +179,6 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
gtkWidgetSetParent (p);
|
||||
}
|
||||
|
||||
void beginNativeRepaint ()
|
||||
{
|
||||
isInRepaint = true;
|
||||
}
|
||||
|
||||
void endNativeRepaint ()
|
||||
{
|
||||
isInRepaint = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the bounds of this peer's AWT Component based on dimensions
|
||||
* returned by the native windowing system. Most Components impose
|
||||
|
@ -250,6 +243,8 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
return getToolkit().getFontMetrics(font);
|
||||
}
|
||||
|
||||
// getGraphics may be overridden by derived classes but it should
|
||||
// never return null.
|
||||
public Graphics getGraphics ()
|
||||
{
|
||||
if (GtkToolkit.useGraphics2D ())
|
||||
|
@ -291,30 +286,10 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
switch (id)
|
||||
{
|
||||
case PaintEvent.PAINT:
|
||||
paintComponent((PaintEvent) event);
|
||||
break;
|
||||
case PaintEvent.UPDATE:
|
||||
{
|
||||
try
|
||||
{
|
||||
Graphics g = getGraphics();
|
||||
|
||||
if (!awtComponent.isShowing() || awtComponent.getWidth() < 1
|
||||
|| awtComponent.getHeight() < 1 || g == null)
|
||||
break;
|
||||
|
||||
g.setClip(((PaintEvent) event).getUpdateRect());
|
||||
|
||||
if (id == PaintEvent.PAINT)
|
||||
awtComponent.paint(g);
|
||||
else
|
||||
awtComponent.update(g);
|
||||
|
||||
g.dispose();
|
||||
}
|
||||
catch (InternalError e)
|
||||
{
|
||||
System.err.println(e);
|
||||
}
|
||||
}
|
||||
updateComponent((PaintEvent) event);
|
||||
break;
|
||||
case KeyEvent.KEY_PRESSED:
|
||||
ke = (KeyEvent) event;
|
||||
|
@ -328,7 +303,49 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This method and its overrides are the only methods in the peers
|
||||
// that should call awtComponent.paint.
|
||||
protected void paintComponent (PaintEvent event)
|
||||
{
|
||||
// Do not call Component.paint if the component is not showing or
|
||||
// if its bounds form a degenerate rectangle.
|
||||
if (!awtComponent.isShowing()
|
||||
|| (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
|
||||
return;
|
||||
|
||||
// Creating and disposing a GdkGraphics every time paint is called
|
||||
// seems expensive. However, the graphics state does not carry
|
||||
// over between calls to paint, and resetting the graphics object
|
||||
// may even be more costly than simply creating a new one.
|
||||
Graphics g = getGraphics();
|
||||
|
||||
g.setClip(event.getUpdateRect());
|
||||
|
||||
awtComponent.paint(g);
|
||||
|
||||
g.dispose();
|
||||
}
|
||||
|
||||
// This method and its overrides are the only methods in the peers
|
||||
// that should call awtComponent.update.
|
||||
protected void updateComponent (PaintEvent event)
|
||||
{
|
||||
// Do not call Component.update if the component is not showing or
|
||||
// if its bounds form a degenerate rectangle.
|
||||
if (!awtComponent.isShowing()
|
||||
|| (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
|
||||
return;
|
||||
|
||||
Graphics g = getGraphics();
|
||||
|
||||
g.setClip(event.getUpdateRect());
|
||||
|
||||
awtComponent.update(g);
|
||||
|
||||
g.dispose();
|
||||
}
|
||||
|
||||
public boolean isFocusTraversable ()
|
||||
{
|
||||
return true;
|
||||
|
@ -369,7 +386,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
|
||||
public void repaint (long tm, int x, int y, int width, int height)
|
||||
{
|
||||
if (x == 0 && y == 0 && width == 0 && height == 0)
|
||||
if (width < 1 || height < 1)
|
||||
return;
|
||||
|
||||
if (tm <= 0)
|
||||
|
@ -490,10 +507,28 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
|
||||
public void setCursor (Cursor cursor)
|
||||
{
|
||||
if (Thread.currentThread() == GtkToolkit.mainThread)
|
||||
gtkWidgetSetCursorUnlocked (cursor.getType ());
|
||||
int x, y;
|
||||
GtkImage image;
|
||||
int type = cursor.getType();
|
||||
if (cursor instanceof GtkCursor)
|
||||
{
|
||||
GtkCursor gtkCursor = (GtkCursor) cursor;
|
||||
image = gtkCursor.getGtkImage();
|
||||
Point hotspot = gtkCursor.getHotspot();
|
||||
x = hotspot.x;
|
||||
y = hotspot.y;
|
||||
}
|
||||
else
|
||||
gtkWidgetSetCursor (cursor.getType ());
|
||||
{
|
||||
image = null;
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (Thread.currentThread() == GtkToolkit.mainThread)
|
||||
gtkWidgetSetCursorUnlocked(cursor.getType(), image, x, y);
|
||||
else
|
||||
gtkWidgetSetCursor(cursor.getType(), image, x, y);
|
||||
}
|
||||
|
||||
public void setEnabled (boolean b)
|
||||
|
@ -532,7 +567,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
public void setVisible (boolean b)
|
||||
{
|
||||
// Only really set visible when component is bigger than zero pixels.
|
||||
if (b)
|
||||
if (b && ! (awtComponent instanceof Window))
|
||||
{
|
||||
Rectangle bounds = awtComponent.getBounds();
|
||||
b = (bounds.width > 0) && (bounds.height > 0);
|
||||
|
@ -561,10 +596,22 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
clickCount, popupTrigger));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for component_scroll_cb.
|
||||
*/
|
||||
protected void postMouseWheelEvent(int id, long when, int mods,
|
||||
int x, int y, int clickCount,
|
||||
boolean popupTrigger,
|
||||
int type, int amount, int rotation)
|
||||
{
|
||||
q().postEvent(new MouseWheelEvent(awtComponent, id, when, mods,
|
||||
x, y, clickCount, popupTrigger,
|
||||
type, amount, rotation));
|
||||
}
|
||||
|
||||
protected void postExposeEvent (int x, int y, int width, int height)
|
||||
{
|
||||
if (!isInRepaint)
|
||||
q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
|
||||
q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
|
||||
new Rectangle (x, y, width, height)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue