diff options
author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 10:53:49 +0000 |
---|---|---|
committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 10:53:49 +0000 |
commit | bfd03af53013b43663c88995c6d5943815e8d75b (patch) | |
tree | 871b70a606d87369d5aa9d6f621baedc13b49eba /libjava/classpath/java/awt | |
parent | befb0bace8afefe156fe5718f9d1f202d28560c7 (diff) | |
download | gcc-bfd03af53013b43663c88995c6d5943815e8d75b.tar.gz |
libjava/
2007-08-04 Matthias Klose <doko@ubuntu.com>
Import GNU Classpath (libgcj-import-20070727).
* Regenerate class and header files.
* Regenerate auto* files.
* include/jvm.h:
* jni-libjvm.cc (Jv_JNI_InvokeFunctions): Rename type.
* jni.cc (_Jv_JNIFunctions, _Jv_JNI_InvokeFunctions): Likewise.
* jni.cc (_Jv_JNI_CallAnyMethodA, _Jv_JNI_CallAnyVoidMethodA,
_Jv_JNI_CallMethodA, _Jv_JNI_CallVoidMethodA,
_Jv_JNI_CallStaticMethodA, _Jv_JNI_CallStaticVoidMethodA,
_Jv_JNI_NewObjectA, _Jv_JNI_SetPrimitiveArrayRegion): Constify
jvalue parameter.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise.
* java/lang/VMFloat.java (toString, parseFloat): New.
* gnu/awt/xlib/XToolkit.java (setAlwaysOnTop, isModalityTypeSupported,
isModalExclusionTypeSupported): New (stub only).
* gnu/awt/xlib/XCanvasPeer.java (requestFocus): Likewise.
* gnu/awt/xlib/XFramePeer.java (updateMinimumSize, updateIconImages,
updateFocusableWindowState, setModalBlocked, getBoundsPrivate,
setAlwaysOnTop): Likewise.
* gnu/awt/xlib/XFontPeer.java (canDisplay): Update signature.
* scripts/makemake.tcl: Ignore gnu/javax/sound/sampled/gstreamer,
ignore javax.sound.sampled.spi.MixerProvider, ignore .in files.
* HACKING: Mention --enable-gstreamer-peer, removal of generated files.
libjava/classpath/
2007-08-04 Matthias Klose <doko@ubuntu.com>
* java/util/EnumMap.java (clone): Add cast.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127204 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/awt')
-rw-r--r-- | libjava/classpath/java/awt/AWTKeyStroke.java | 2 | ||||
-rw-r--r-- | libjava/classpath/java/awt/AlphaComposite.java | 2 | ||||
-rw-r--r-- | libjava/classpath/java/awt/Dialog.java | 15 | ||||
-rw-r--r-- | libjava/classpath/java/awt/Font.java | 43 | ||||
-rw-r--r-- | libjava/classpath/java/awt/Toolkit.java | 6 | ||||
-rw-r--r-- | libjava/classpath/java/awt/event/MouseEvent.java | 95 | ||||
-rw-r--r-- | libjava/classpath/java/awt/peer/ComponentPeer.java | 13 | ||||
-rw-r--r-- | libjava/classpath/java/awt/peer/FramePeer.java | 3 | ||||
-rw-r--r-- | libjava/classpath/java/awt/peer/RobotPeer.java | 2 | ||||
-rw-r--r-- | libjava/classpath/java/awt/peer/WindowPeer.java | 9 |
10 files changed, 186 insertions, 4 deletions
diff --git a/libjava/classpath/java/awt/AWTKeyStroke.java b/libjava/classpath/java/awt/AWTKeyStroke.java index e0b34e99238..0fc44287a16 100644 --- a/libjava/classpath/java/awt/AWTKeyStroke.java +++ b/libjava/classpath/java/awt/AWTKeyStroke.java @@ -93,7 +93,7 @@ public class AWTKeyStroke implements Serializable private static final int MAX_CACHE_SIZE = 2048; /** Prune stale entries. */ - protected boolean removeEldestEntry(Entry<AWTKeyStroke,AWTKeyStroke> + protected boolean removeEldestEntry(Map.Entry<AWTKeyStroke,AWTKeyStroke> eldest) { return size() > MAX_CACHE_SIZE; diff --git a/libjava/classpath/java/awt/AlphaComposite.java b/libjava/classpath/java/awt/AlphaComposite.java index 90df2e66d8c..addd1e71327 100644 --- a/libjava/classpath/java/awt/AlphaComposite.java +++ b/libjava/classpath/java/awt/AlphaComposite.java @@ -61,7 +61,7 @@ public final class AlphaComposite implements Composite private static final int MAX_CACHE_SIZE = 2048; /** Prune stale entries. */ - protected boolean removeEldestEntry(Entry eldest) + protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_CACHE_SIZE; } diff --git a/libjava/classpath/java/awt/Dialog.java b/libjava/classpath/java/awt/Dialog.java index 7df2f523c86..83fb52d89d7 100644 --- a/libjava/classpath/java/awt/Dialog.java +++ b/libjava/classpath/java/awt/Dialog.java @@ -61,6 +61,21 @@ import javax.accessibility.AccessibleStateSet; */ public class Dialog extends Window { + public enum ModalExclusionType + { + APPLICATION_EXCLUDE, + NO_EXCLUDE, + TOOLKIT_EXCLUDE + } + + public enum ModalityType + { + APPLICATION_MODAL, + DOCUMENT_MODAL, + MODELESS, + TOOLKIT_MODAL + } + // Serialization constant private static final long serialVersionUID = 5920926903803293709L; diff --git a/libjava/classpath/java/awt/Font.java b/libjava/classpath/java/awt/Font.java index 29b87d6af99..d6892a626dc 100644 --- a/libjava/classpath/java/awt/Font.java +++ b/libjava/classpath/java/awt/Font.java @@ -170,6 +170,31 @@ public class Font implements Serializable public static final int LAYOUT_NO_LIMIT_CONTEXT = 4; /** + * @since 1.6 + */ + public static final String DIALOG = "Dialog"; + + /** + * @since 1.6 + */ + public static final String DIALOG_INPUT = "DialogInput"; + + /** + * @since 1.6 + */ + public static final String MONOSPACED = "Monospaced"; + + /** + * @since 1.6 + */ + public static final String SANS_SERIF = "SansSerif"; + + /** + * @since 1.6 + */ + public static final String SERIF = "Serif"; + + /** * The logical name of this font. * * @since 1.0 @@ -330,6 +355,11 @@ public class Font implements Serializable return getFont(propname, (Font) null); } + protected Font(Font font) + { + this(font.getName(), font.getAttributes()); + } + /** * Initializes a new instance of <code>Font</code> with the specified * attributes. @@ -491,7 +521,12 @@ public class Font implements Serializable */ public boolean canDisplay(char c) { - return peer.canDisplay(this, c); + return canDisplay((int) c); + } + + public boolean canDisplay(int codePoint) + { + return peer.canDisplay(this, codePoint); } /** @@ -1373,6 +1408,12 @@ public class Font implements Serializable return getLineMetrics(str, 0, str.length() - 1, frc); } + public boolean hasLayoutAttributes() + { + // TODO: Implement properly. + return false; + } + /** * Reads the normal fields from the stream and then constructs the * peer from the style and size through getPeerFromToolkit(). diff --git a/libjava/classpath/java/awt/Toolkit.java b/libjava/classpath/java/awt/Toolkit.java index 305402e9541..b12e9e10dc0 100644 --- a/libjava/classpath/java/awt/Toolkit.java +++ b/libjava/classpath/java/awt/Toolkit.java @@ -1287,6 +1287,12 @@ public abstract class Toolkit public abstract Map<TextAttribute,?> mapInputMethodHighlight(InputMethodHighlight highlight); + public abstract boolean isModalExclusionTypeSupported + (Dialog.ModalExclusionType modalExclusionType); + + public abstract boolean isModalityTypeSupported + (Dialog.ModalityType modalityType); + /** * Initializes the accessibility framework. In particular, this loads the * properties javax.accessibility.screen_magnifier_present and diff --git a/libjava/classpath/java/awt/event/MouseEvent.java b/libjava/classpath/java/awt/event/MouseEvent.java index f2bcfbcc65f..ad777e8f433 100644 --- a/libjava/classpath/java/awt/event/MouseEvent.java +++ b/libjava/classpath/java/awt/event/MouseEvent.java @@ -164,6 +164,16 @@ public class MouseEvent extends InputEvent private int y; /** + * The screen position of that mouse event, X coordinate. + */ + private int absX; + + /** + * The screen position of that mouse event, Y coordinate. + */ + private int absY; + + /** * The number of clicks that took place. For MOUSE_CLICKED, MOUSE_PRESSED, * and MOUSE_RELEASED, this will be at least 1; otherwise it is 0. * @@ -212,6 +222,7 @@ public class MouseEvent extends InputEvent int button) { super(source, id, when, modifiers); + this.x = x; this.y = y; this.clickCount = clickCount; @@ -234,6 +245,13 @@ public class MouseEvent extends InputEvent this.modifiersEx &= ~(BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK | BUTTON3_DOWN_MASK); + + if (source != null) + { + Point screenLoc = source.getLocationOnScreen(); + absX = screenLoc.x + x; + absY = screenLoc.y + y; + } } /** @@ -258,6 +276,59 @@ public class MouseEvent extends InputEvent } /** + * Creates a new MouseEvent. This is like the other constructors and adds + * specific absolute coordinates. + * + * @param source the source of the event + * @param id the event id + * @param when the timestamp of when the event occurred + * @param modifiers the modifier keys during the event, in old or new style + * @param x the X coordinate of the mouse point + * @param y the Y coordinate of the mouse point + * @param absX the absolute X screen coordinate of this event + * @param absY the absolute Y screen coordinate of this event + * @param clickCount the number of mouse clicks for this event + * @param popupTrigger true if this event triggers a popup menu + * @param button the most recent mouse button to change state + * + * @throws IllegalArgumentException if source is null or button is invalid + * + * @since 1.6 + */ + public MouseEvent(Component source, int id, long when, int modifiers, + int x, int y, int absX, int absY, int clickCount, + boolean popupTrigger, int button) + { + super(source, id, when, modifiers); + + this.x = x; + this.y = y; + this.clickCount = clickCount; + this.popupTrigger = popupTrigger; + this.button = button; + if (button < NOBUTTON || button > BUTTON3) + throw new IllegalArgumentException(); + if ((modifiers & EventModifier.OLD_MASK) != 0) + { + if ((modifiers & BUTTON1_MASK) != 0) + this.button = BUTTON1; + else if ((modifiers & BUTTON2_MASK) != 0) + this.button = BUTTON2; + else if ((modifiers & BUTTON3_MASK) != 0) + this.button = BUTTON3; + } + // clear the mouse button modifier masks if this is a button + // release event. + if (id == MOUSE_RELEASED) + this.modifiersEx &= ~(BUTTON1_DOWN_MASK + | BUTTON2_DOWN_MASK + | BUTTON3_DOWN_MASK); + + this.absX = absX; + this.absY = absY; + } + + /** * This method returns the X coordinate of the mouse position. This is * relative to the source component. * @@ -280,6 +351,30 @@ public class MouseEvent extends InputEvent } /** + * @since 1.6 + */ + public Point getLocationOnScreen() + { + return new Point(absX, absY); + } + + /** + * @since 1.6 + */ + public int getXOnScreen() + { + return absX; + } + + /** + * @since 1.6 + */ + public int getYOnScreen() + { + return absY; + } + + /** * This method returns a <code>Point</code> for the x,y position of * the mouse pointer. This is relative to the source component. * diff --git a/libjava/classpath/java/awt/peer/ComponentPeer.java b/libjava/classpath/java/awt/peer/ComponentPeer.java index bc6e3a457f3..b498ddf664e 100644 --- a/libjava/classpath/java/awt/peer/ComponentPeer.java +++ b/libjava/classpath/java/awt/peer/ComponentPeer.java @@ -59,6 +59,8 @@ import java.awt.image.ImageObserver; import java.awt.image.ImageProducer; import java.awt.image.VolatileImage; +import sun.awt.CausedFocusEvent; + /** * Defines the methods that a component peer is required to implement. */ @@ -264,7 +266,7 @@ public interface ComponentPeer /** * Requests that this component receives the focus. This is called from * {@link Component#requestFocus()}. - * + * * @specnote Part of the earlier 1.1 API, apparently replaced by argument * form of the same method. */ @@ -518,4 +520,13 @@ public interface ComponentPeer * @since 1.5 */ void layout(); + + + /** + * Requests the focus on the component. + */ + boolean requestFocus(Component lightweightChild, boolean temporary, + boolean focusedWindowChangeAllowed, long time, + CausedFocusEvent.Cause cause); + } diff --git a/libjava/classpath/java/awt/peer/FramePeer.java b/libjava/classpath/java/awt/peer/FramePeer.java index 13435f8e4c5..929791489ac 100644 --- a/libjava/classpath/java/awt/peer/FramePeer.java +++ b/libjava/classpath/java/awt/peer/FramePeer.java @@ -71,5 +71,8 @@ public interface FramePeer extends WindowPeer * @since 1.5 */ void setBoundsPrivate(int x, int y, int width, int height); + + Rectangle getBoundsPrivate(); + } // interface FramePeer diff --git a/libjava/classpath/java/awt/peer/RobotPeer.java b/libjava/classpath/java/awt/peer/RobotPeer.java index db81c809d72..a11bfc7343d 100644 --- a/libjava/classpath/java/awt/peer/RobotPeer.java +++ b/libjava/classpath/java/awt/peer/RobotPeer.java @@ -50,5 +50,7 @@ public interface RobotPeer void keyRelease (int keycode); int getRGBPixel (int x, int y); int[] getRGBPixels (Rectangle screen); + void dispose(); + } // interface RobotPeer diff --git a/libjava/classpath/java/awt/peer/WindowPeer.java b/libjava/classpath/java/awt/peer/WindowPeer.java index 00d1035791a..e8b7d72015b 100644 --- a/libjava/classpath/java/awt/peer/WindowPeer.java +++ b/libjava/classpath/java/awt/peer/WindowPeer.java @@ -38,6 +38,8 @@ exception statement from your version. */ package java.awt.peer; +import java.awt.Dialog; + public interface WindowPeer extends ContainerPeer { void toBack(); @@ -57,5 +59,12 @@ public interface WindowPeer extends ContainerPeer * @since 1.5 */ boolean requestWindowFocus(); + + void setAlwaysOnTop(boolean alwaysOnTop); + void updateFocusableWindowState(); + void setModalBlocked(Dialog blocker, boolean blocked); + void updateMinimumSize(); + void updateIconImages(); + } // interface WindowPeer |