src/share/classes/java/awt/peer/ComponentPeer.java

Print this page


   1 /*
   2  * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 499      * Returns whether this peer supports reparenting to another parent without
 500      * destroying the peer.
 501      *
 502      * @return true if appropriate reparent is supported, false otherwise
 503      *
 504      * @since 1.5
 505      */
 506     boolean isReparentSupported();
 507 
 508     /**
 509      * Used by lightweight implementations to tell a ComponentPeer to layout
 510      * its sub-elements.  For instance, a lightweight Checkbox needs to layout
 511      * the box, as well as the text label.
 512      *
 513      * @see Component#validate()
 514      */
 515     void layout();
 516 
 517     /**
 518      * Applies the shape to the native component window.

 519      * @since 1.7
 520      *
 521      * @see Component#applyCompoundShape
 522      */
 523     void applyShape(Region shape);
 524 
 525     /**
 526      * Lowers this component at the bottom of the above HW peer. If the above parameter
 527      * is null then the method places this component at the top of the Z-order.

 528      */
 529     void setZOrder(ComponentPeer above);
 530 
 531     /**
 532      * Updates internal data structures related to the component's GC.
 533      *
 534      * @return if the peer needs to be recreated for the changes to take effect
 535      * @since 1.7
 536      */
 537     boolean updateGraphicsData(GraphicsConfiguration gc);
 538 }
   1 /*
   2  * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 499      * Returns whether this peer supports reparenting to another parent without
 500      * destroying the peer.
 501      *
 502      * @return true if appropriate reparent is supported, false otherwise
 503      *
 504      * @since 1.5
 505      */
 506     boolean isReparentSupported();
 507 
 508     /**
 509      * Used by lightweight implementations to tell a ComponentPeer to layout
 510      * its sub-elements.  For instance, a lightweight Checkbox needs to layout
 511      * the box, as well as the text label.
 512      *
 513      * @see Component#validate()
 514      */
 515     void layout();
 516 
 517     /**
 518      * Applies the shape to the native component window.
 519      * @param shape the shape to apply
 520      * @since 1.7
 521      *
 522      * @see Component#applyCompoundShape
 523      */
 524     void applyShape(Region shape);
 525 
 526     /**
 527      * Lowers this component at the bottom of the above HW peer. If the above parameter
 528      * is null then the method places this component at the top of the Z-order.
 529      * @param above the peer to lower this component with respect to
 530      */
 531     void setZOrder(ComponentPeer above);
 532 
 533     /**
 534      * Updates internal data structures related to the component's GC.
 535      * @param gc the reference graphics configuration
 536      * @return if the peer needs to be recreated for the changes to take effect
 537      * @since 1.7
 538      */
 539     boolean updateGraphicsData(GraphicsConfiguration gc);
 540 }