< prev index next >

src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java

Print this page




 331     public void setCursorAllowed(boolean isCursorAllowed) {
 332         this.isCursorAllowed = isCursorAllowed;
 333         final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
 334         peer.updateCursorImmediately();
 335     }
 336     public boolean isCursorAllowed() {
 337         return isCursorAllowed;
 338     }
 339     public Cursor getCursor() {
 340         return (isCursorAllowed)
 341             ? super.getCursor()
 342             : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
 343     }
 344 
 345     protected void setPeer(final ComponentPeer p){
 346         AWTAccessor.getComponentAccessor().setPeer(EmbeddedFrame.this, p);
 347     };
 348 
 349     /**
 350      * Synthesize native message to activate or deactivate EmbeddedFrame window
 351      * depending on the value of parameter <code>b</code>.
 352      * Peers should override this method if they are to implement
 353      * this functionality.
 354      * @param doActivate  if <code>true</code>, activates the window;
 355      * otherwise, deactivates the window
 356      */
 357     public void synthesizeWindowActivation(boolean doActivate) {}
 358 
 359     /**
 360      * Moves this embedded frame to a new location. The top-left corner of
 361      * the new location is specified by the <code>x</code> and <code>y</code>
 362      * parameters relative to the native parent component.
 363      * <p>
 364      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 365      * within the native parent. These methods always put embedded frame to
 366      * (0, 0) for backward compatibility. To allow moving embedded frame
 367      * setLocationPrivate() and setBoundsPrivate() were introduced, and they
 368      * work just the same way as setLocation() and setBounds() for usual,
 369      * non-embedded components.
 370      * </p>
 371      * <p>
 372      * Using usual get/setLocation() and get/setBounds() together with new
 373      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 374      * For example, calling getBoundsPrivate() after setLocation() works fine,
 375      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 376      * </p>
 377      * @param x the new <i>x</i>-coordinate relative to the parent component
 378      * @param y the new <i>y</i>-coordinate relative to the parent component
 379      * @see java.awt.Component#setLocation
 380      * @see #getLocationPrivate
 381      * @see #setBoundsPrivate


 401      * <p>
 402      * Using usual get/setLocation() and get/setBounds() together with new
 403      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 404      * For example, calling getBoundsPrivate() after setLocation() works fine,
 405      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 406      * </p>
 407      * @return a point indicating this embedded frame's top-left corner
 408      * @see java.awt.Component#getLocation
 409      * @see #setLocationPrivate
 410      * @see #setBoundsPrivate
 411      * @see #getBoundsPrivate
 412      * @since 1.6
 413      */
 414     protected Point getLocationPrivate() {
 415         Rectangle bounds = getBoundsPrivate();
 416         return new Point(bounds.x, bounds.y);
 417     }
 418 
 419     /**
 420      * Moves and resizes this embedded frame. The new location of the top-left
 421      * corner is specified by <code>x</code> and <code>y</code> parameters
 422      * relative to the native parent component. The new size is specified by
 423      * <code>width</code> and <code>height</code>.
 424      * <p>
 425      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 426      * within the native parent. These methods always put embedded frame to
 427      * (0, 0) for backward compatibility. To allow moving embedded frames
 428      * setLocationPrivate() and setBoundsPrivate() were introduced, and they
 429      * work just the same way as setLocation() and setBounds() for usual,
 430      * non-embedded components.
 431      * </p>
 432      * <p>
 433      * Using usual get/setLocation() and get/setBounds() together with new
 434      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 435      * For example, calling getBoundsPrivate() after setLocation() works fine,
 436      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 437      * </p>
 438      * @param x the new <i>x</i>-coordinate relative to the parent component
 439      * @param y the new <i>y</i>-coordinate relative to the parent component
 440      * @param width the new <code>width</code> of this embedded frame
 441      * @param height the new <code>height</code> of this embedded frame
 442      * @see java.awt.Component#setBounds
 443      * @see #setLocationPrivate
 444      * @see #getLocationPrivate
 445      * @see #getBoundsPrivate
 446      * @since 1.5
 447      */
 448     protected void setBoundsPrivate(int x, int y, int width, int height) {
 449         final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
 450         if (peer != null) {
 451             peer.setBoundsPrivate(x, y, width, height);
 452         }
 453     }
 454 
 455     /**
 456      * Gets the bounds of this embedded frame as a rectangle specifying the
 457      * width, height and location relative to the native parent component.
 458      * <p>
 459      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 460      * within the native parent. These methods always put embedded frame to
 461      * (0, 0) for backward compatibility. To allow getting location and size




 331     public void setCursorAllowed(boolean isCursorAllowed) {
 332         this.isCursorAllowed = isCursorAllowed;
 333         final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
 334         peer.updateCursorImmediately();
 335     }
 336     public boolean isCursorAllowed() {
 337         return isCursorAllowed;
 338     }
 339     public Cursor getCursor() {
 340         return (isCursorAllowed)
 341             ? super.getCursor()
 342             : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
 343     }
 344 
 345     protected void setPeer(final ComponentPeer p){
 346         AWTAccessor.getComponentAccessor().setPeer(EmbeddedFrame.this, p);
 347     };
 348 
 349     /**
 350      * Synthesize native message to activate or deactivate EmbeddedFrame window
 351      * depending on the value of parameter {@code b}.
 352      * Peers should override this method if they are to implement
 353      * this functionality.
 354      * @param doActivate  if {@code true}, activates the window;
 355      * otherwise, deactivates the window
 356      */
 357     public void synthesizeWindowActivation(boolean doActivate) {}
 358 
 359     /**
 360      * Moves this embedded frame to a new location. The top-left corner of
 361      * the new location is specified by the {@code x} and {@code y}
 362      * parameters relative to the native parent component.
 363      * <p>
 364      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 365      * within the native parent. These methods always put embedded frame to
 366      * (0, 0) for backward compatibility. To allow moving embedded frame
 367      * setLocationPrivate() and setBoundsPrivate() were introduced, and they
 368      * work just the same way as setLocation() and setBounds() for usual,
 369      * non-embedded components.
 370      * </p>
 371      * <p>
 372      * Using usual get/setLocation() and get/setBounds() together with new
 373      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 374      * For example, calling getBoundsPrivate() after setLocation() works fine,
 375      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 376      * </p>
 377      * @param x the new <i>x</i>-coordinate relative to the parent component
 378      * @param y the new <i>y</i>-coordinate relative to the parent component
 379      * @see java.awt.Component#setLocation
 380      * @see #getLocationPrivate
 381      * @see #setBoundsPrivate


 401      * <p>
 402      * Using usual get/setLocation() and get/setBounds() together with new
 403      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 404      * For example, calling getBoundsPrivate() after setLocation() works fine,
 405      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 406      * </p>
 407      * @return a point indicating this embedded frame's top-left corner
 408      * @see java.awt.Component#getLocation
 409      * @see #setLocationPrivate
 410      * @see #setBoundsPrivate
 411      * @see #getBoundsPrivate
 412      * @since 1.6
 413      */
 414     protected Point getLocationPrivate() {
 415         Rectangle bounds = getBoundsPrivate();
 416         return new Point(bounds.x, bounds.y);
 417     }
 418 
 419     /**
 420      * Moves and resizes this embedded frame. The new location of the top-left
 421      * corner is specified by {@code x} and {@code y} parameters
 422      * relative to the native parent component. The new size is specified by
 423      * {@code width} and {@code height}.
 424      * <p>
 425      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 426      * within the native parent. These methods always put embedded frame to
 427      * (0, 0) for backward compatibility. To allow moving embedded frames
 428      * setLocationPrivate() and setBoundsPrivate() were introduced, and they
 429      * work just the same way as setLocation() and setBounds() for usual,
 430      * non-embedded components.
 431      * </p>
 432      * <p>
 433      * Using usual get/setLocation() and get/setBounds() together with new
 434      * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
 435      * For example, calling getBoundsPrivate() after setLocation() works fine,
 436      * but getBounds() after setBoundsPrivate() may return unpredictable value.
 437      * </p>
 438      * @param x the new <i>x</i>-coordinate relative to the parent component
 439      * @param y the new <i>y</i>-coordinate relative to the parent component
 440      * @param width the new {@code width} of this embedded frame
 441      * @param height the new {@code height} of this embedded frame
 442      * @see java.awt.Component#setBounds
 443      * @see #setLocationPrivate
 444      * @see #getLocationPrivate
 445      * @see #getBoundsPrivate
 446      * @since 1.5
 447      */
 448     protected void setBoundsPrivate(int x, int y, int width, int height) {
 449         final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
 450         if (peer != null) {
 451             peer.setBoundsPrivate(x, y, width, height);
 452         }
 453     }
 454 
 455     /**
 456      * Gets the bounds of this embedded frame as a rectangle specifying the
 457      * width, height and location relative to the native parent component.
 458      * <p>
 459      * setLocation() and setBounds() for EmbeddedFrame really don't move it
 460      * within the native parent. These methods always put embedded frame to
 461      * (0, 0) for backward compatibility. To allow getting location and size


< prev index next >