aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-05-25 11:24:27 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-05-25 11:24:27 +0000
commiteceea3010ff9d19a48d650e5dccb7105d66adbd2 (patch)
tree2e2b4385c6d0944dde3daf07a226888715d75aea /libjava/java/awt
parentef8855d7a019355492cdd8989add15393b01ac86 (diff)
downloadgcc-eceea3010ff9d19a48d650e5dccb7105d66adbd2.zip
gcc-eceea3010ff9d19a48d650e5dccb7105d66adbd2.tar.gz
gcc-eceea3010ff9d19a48d650e5dccb7105d66adbd2.tar.bz2
Checkbox.java, [...]: New versions from classpath.
2003-05-25 Michael Koch <konqueror@gmx.de> * java/awt/Checkbox.java, java/awt/Dialog.java, java/awt/Font.java, java/awt/Frame.java, java/awt/ScrollPaneAdjustable.java, java/awt/Scrollbar.java, java/awt/Window.java: New versions from classpath. From-SVN: r67164
Diffstat (limited to 'libjava/java/awt')
-rw-r--r--libjava/java/awt/Checkbox.java6
-rw-r--r--libjava/java/awt/Dialog.java40
-rw-r--r--libjava/java/awt/Font.java2
-rw-r--r--libjava/java/awt/Frame.java99
-rw-r--r--libjava/java/awt/ScrollPaneAdjustable.java21
-rw-r--r--libjava/java/awt/Scrollbar.java22
-rw-r--r--libjava/java/awt/Window.java47
7 files changed, 221 insertions, 16 deletions
diff --git a/libjava/java/awt/Checkbox.java b/libjava/java/awt/Checkbox.java
index 1268fe8..9c7f994 100644
--- a/libjava/java/awt/Checkbox.java
+++ b/libjava/java/awt/Checkbox.java
@@ -307,7 +307,11 @@ addNotify()
super.addNotify ();
}
-/*************************************************************************/
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[])
+ AWTEventMulticaster.getListeners (item_listeners, ItemListener.class);
+ }
/**
* Adds a new listeners to the list of registered listeners for this object.
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index e7c40b1..5c64dc9 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -44,11 +44,11 @@ import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
/**
- * A dialog box widget class.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
- */
+ * A dialog box widget class.
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Tom Tromey <tromey@redhat.com>
+ */
public class Dialog extends Window
{
@@ -81,6 +81,11 @@ private boolean resizable;
*/
private String title;
+ /**
+ * This field indicates whether the dialog is undecorated or not.
+ */
+ private boolean undecorated = false;
+
/*************************************************************************/
/*
@@ -395,5 +400,30 @@ paramString()
",resizable=" + resizable + "," + super.paramString());
}
+ /**
+ * Returns whether this frame is undecorated or not.
+ *
+ * @since 1.4
+ */
+ public boolean isUndecorated ()
+ {
+ return undecorated;
+ }
+
+ /**
+ * Disables or enables decorations for this frame. This method can only be
+ * called while the frame is not displayable.
+ *
+ * @exception IllegalComponentStateException If this frame is displayable.
+ *
+ * @since 1.4
+ */
+ public void setUndecorated (boolean undecorated)
+ {
+ if (isDisplayable ())
+ throw new IllegalComponentStateException ();
+
+ this.undecorated = undecorated;
+ }
} // class Dialog
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index 3723a45..d1b2b46 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -406,6 +406,8 @@ getStyle()
* Returns a native peer object for this font.
*
* @return A native peer object for this font.
+ *
+ * @deprecated
*/
public FontPeer
getPeer()
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
index c6742b0..5aab5ef 100644
--- a/libjava/java/awt/Frame.java
+++ b/libjava/java/awt/Frame.java
@@ -201,6 +201,16 @@ private int state;
*/
private String title = "";
+ /**
+ * Maximized bounds for this frame.
+ */
+ private Rectangle maximizedBounds;
+
+ /**
+ * This field indicates whether the frame is undecorated or not.
+ */
+ private boolean undecorated = false;
+
/*************************************************************************/
/*
@@ -456,14 +466,6 @@ paramString()
return(getClass().getName());
}
-public int
-getState()
-{
- /* FIXME: State might have changed in the peer... Must check. */
-
- return state;
-}
-
public static Frame[]
getFrames()
{
@@ -475,5 +477,86 @@ getFrames()
throw new UnsupportedOperationException(msg);
}
+ public void setState (int state)
+ {
+ int current_state = getExtendedState ();
+
+ if (state == NORMAL
+ && (current_state & ICONIFIED) != 0)
+ setExtendedState (current_state | ICONIFIED);
+
+ if (state == ICONIFIED
+ && (current_state & ~ICONIFIED) == 0)
+ setExtendedState (current_state & ~ICONIFIED);
+ }
+
+ public int getState ()
+ {
+ /* FIXME: State might have changed in the peer... Must check. */
+
+ return (state & ICONIFIED) != 0 ? ICONIFIED : NORMAL;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setExtendedState (int state)
+ {
+ this.state = state;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public int getExtendedState ()
+ {
+ return state;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setMaximizedBounds (Rectangle maximizedBounds)
+ {
+ throw new Error ("not implemented");
+ }
+
+ /**
+ * Returns the maximized bounds of this frame.
+ *
+ * @return the maximized rectangle, may be null.
+ *
+ * @since 1.4
+ */
+ public Rectangle getMaximizedBounds ()
+ {
+ return maximizedBounds;
+ }
+
+ /**
+ * Returns whether this frame is undecorated or not.
+ *
+ * @since 1.4
+ */
+ public boolean isUndecorated ()
+ {
+ return undecorated;
+ }
+
+ /**
+ * Disables or enables decorations for this frame. This method can only be
+ * called while the frame is not displayable.
+ *
+ * @exception IllegalComponentStateException If this frame is displayable.
+ *
+ * @since 1.4
+ */
+ public void setUndecorated (boolean undecorated)
+ {
+ if (!isDisplayable ())
+ throw new IllegalComponentStateException ();
+
+ this.undecorated = undecorated;
+ }
} // class Frame
diff --git a/libjava/java/awt/ScrollPaneAdjustable.java b/libjava/java/awt/ScrollPaneAdjustable.java
index 13131f9..700d060 100644
--- a/libjava/java/awt/ScrollPaneAdjustable.java
+++ b/libjava/java/awt/ScrollPaneAdjustable.java
@@ -63,6 +63,8 @@ public class ScrollPaneAdjustable
int blockIncrement = 1;
AdjustmentListener adjustmentListener;
+ private transient boolean valueIsAdjusting = false;
+
ScrollPaneAdjustable (ScrollPane sp, int orientation)
{
this.sp = sp;
@@ -175,5 +177,24 @@ public class ScrollPaneAdjustable
throw new Error ("not implemented");
}
+ /**
+ * Returns true if the value is in the process of changing.
+ *
+ * @since 1.4
+ */
+ public boolean getValueIsAdjusting ()
+ {
+ return valueIsAdjusting;
+ }
+
+ /**
+ * Sets the value of valueIsAdjusting.
+ *
+ * @since 1.4
+ */
+ public void setValueIsAdjusting (boolean valueIsAdjusting)
+ {
+ this.valueIsAdjusting = valueIsAdjusting;
+ }
} // class ScrollPaneAdjustable
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
index b9a81a5..e8d408e 100644
--- a/libjava/java/awt/Scrollbar.java
+++ b/libjava/java/awt/Scrollbar.java
@@ -119,6 +119,8 @@ private int visibleAmount;
// List of AdjustmentListener's.
private AdjustmentListener adjustment_listeners;
+private transient boolean valueIsAdjusting = false;
+
/*************************************************************************/
/*
@@ -725,5 +727,25 @@ paramString()
{
return (AdjustmentListener[]) getListeners (AdjustmentListener.class);
}
+
+ /**
+ * Returns true if the value is in the process of changing.
+ *
+ * @since 1.4
+ */
+ public boolean getValueIsAdjusting ()
+ {
+ return valueIsAdjusting;
+ }
+
+ /**
+ * Sets the value of valueIsAdjusting.
+ *
+ * @since 1.4
+ */
+ public void setValueIsAdjusting (boolean valueIsAdjusting)
+ {
+ this.valueIsAdjusting = valueIsAdjusting;
+ }
} // class Scrollbar
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index d8a9954..fcb9c1ae 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -57,10 +57,14 @@ import java.util.ResourceBundle;
public class Window extends Container
{
// Serialized fields, from Sun's serialization spec.
- // private FocusManager focusMgr; // FIXME: what is this?
private String warningString = null;
- private int state = 0;
private int windowSerializedDataVersion = 0; // FIXME
+ /** @since 1.2 */
+ // private FocusManager focusMgr; // FIXME: what is this?
+ /** @since 1.2 */
+ private int state = 0;
+ /** @since 1.4 */
+ private boolean focusableWindowState = true;
private transient WindowListener windowListener;
private transient WindowFocusListener windowFocusListener;
@@ -645,4 +649,43 @@ public class Window extends Container
&& event.getID () == WindowEvent.WINDOW_STATE_CHANGED)
windowStateListener.windowStateChanged (event);
}
+
+ /**
+ * Returns whether this <code>Window</code> can get the focus or not.
+ *
+ * @since 1.4
+ */
+ public boolean isFocusableWindow ()
+ {
+ if (getFocusableWindowState () == false)
+ return false;
+
+ if (this instanceof Dialog
+ || this instanceof Frame)
+ return true;
+
+ // FIXME: Implement more possible cases for returning true.
+
+ return false;
+ }
+
+ /**
+ * Returns the value of the focusableWindowState property.
+ *
+ * @since 1.4
+ */
+ public boolean getFocusableWindowState ()
+ {
+ return focusableWindowState;
+ }
+
+ /**
+ * Sets the value of the focusableWindowState property.
+ *
+ * @since 1.4
+ */
+ public void setFocusableWindowState (boolean focusableWindowState)
+ {
+ this.focusableWindowState = focusableWindowState;
+ }
}