Checkbox.java, [...]: New versions from classpath.
authorMichael Koch <konqueror@gmx.de>
Sun, 25 May 2003 11:24:27 +0000 (11:24 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Sun, 25 May 2003 11:24:27 +0000 (11:24 +0000)
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

libjava/ChangeLog
libjava/java/awt/Checkbox.java
libjava/java/awt/Dialog.java
libjava/java/awt/Font.java
libjava/java/awt/Frame.java
libjava/java/awt/ScrollPaneAdjustable.java
libjava/java/awt/Scrollbar.java
libjava/java/awt/Window.java

index 2e2f5f7a65419ada28a1e12fafdc7b70ee7356f6..a44d88f62710f4a2423fd46263ed5bbf84363bd7 100644 (file)
@@ -1,3 +1,14 @@
+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.
+
 2003-05-22     Jeff Sturm      <jsturm@one-point.com>
 
        PR libgcj/10838:
index 1268fe86eca4429eb8cb7542d0ac46ceee1d6228..9c7f994e39ce257034f46c9efb6b5471914cb416 100644 (file)
@@ -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.
index e7c40b14ae42fa66e4344c383184b9647b91055f..5c64dc97a87e8d9a05afa1630063541f0d5c85fc 100644 (file)
@@ -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
 
index 3723a4528ed3ca48312282428e087063c558191d..d1b2b463d7517d4a74383f0d8c734cbc7bcad9bd 100644 (file)
@@ -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()
index c6742b0c3215b7088bf0539fcee7d3c333d9901d..5aab5ef49a99ec737944f01c4937d6ced702cabb 100644 (file)
@@ -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 
 
index 13131f9c45b862494d26d968538f8f1b22fbaa8b..700d060a0aef00ee30cc361677d039467933e211 100644 (file)
@@ -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
 
index b9a81a53b0fe5541092577a71c3a820bdd5b7f63..e8d408e5d262ccc1153006f5f7bcbf1a14f91ccc 100644 (file)
@@ -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 
 
index d8a99542eafc10b1747e485bd96608f44bf93ef2..fcb9c1aefdb834202cd8e324dd5cf75fed754ab5 100644 (file)
@@ -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;
+  }
 }