+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:
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.
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
{
*/
private String title;
+ /**
+ * This field indicates whether the dialog is undecorated or not.
+ */
+ private boolean undecorated = false;
+
/*************************************************************************/
/*
",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
* Returns a native peer object for this font.
*
* @return A native peer object for this font.
+ *
+ * @deprecated
*/
public FontPeer
getPeer()
*/
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;
+
/*************************************************************************/
/*
return(getClass().getName());
}
-public int
-getState()
-{
- /* FIXME: State might have changed in the peer... Must check. */
-
- return state;
-}
-
public static Frame[]
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
int blockIncrement = 1;
AdjustmentListener adjustmentListener;
+ private transient boolean valueIsAdjusting = false;
+
ScrollPaneAdjustable (ScrollPane sp, int orientation)
{
this.sp = sp;
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
// List of AdjustmentListener's.
private AdjustmentListener adjustment_listeners;
+private transient boolean valueIsAdjusting = false;
+
/*************************************************************************/
/*
{
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
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;
&& 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;
+ }
}