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

Print this page




  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
  23  * questions.
  24  */
  25 
  26 package java.awt.peer;
  27 
  28 import java.awt.*;
  29 
  30 import sun.awt.EmbeddedFrame;

  31 
  32 /**
  33  * The peer interface for {@link Frame}. This adds a couple of frame specific
  34  * methods to the {@link WindowPeer} interface.
  35  *
  36  * The peer interfaces are intended only for use in porting
  37  * the AWT. They are not intended for use by application
  38  * developers, and developers should not implement peers
  39  * nor invoke any of the peer methods directly on the peer
  40  * instances.
  41  */
  42 public interface FramePeer extends WindowPeer {
  43 
  44     /**
  45      * Sets the title on the frame.
  46      *
  47      * @param title the title to set
  48      *
  49      * @see Frame#setTitle(String)
  50      */


 114 
 115     /**
 116      * Returns the size and location for embedded frames. (On embedded frames,
 117      * setLocation() and setBounds() always set the frame to (0,0) for
 118      * backwards compatibility.
 119      *
 120      * @return the bounds of an embedded frame
 121      *
 122      * @see EmbeddedFrame#getBoundsPrivate()
 123      */
 124     // TODO: This is only used in EmbeddedFrame, and should probably be moved
 125     // into an EmbeddedFramePeer which would extend FramePeer
 126     Rectangle getBoundsPrivate();
 127 
 128     /**
 129      * Requests the peer to emulate window activation.
 130      *
 131      * @param activate activate or deactivate the window
 132      */
 133     void emulateActivation(boolean activate);













 134 }


  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
  23  * questions.
  24  */
  25 
  26 package java.awt.peer;
  27 
  28 import java.awt.*;
  29 
  30 import sun.awt.EmbeddedFrame;
  31 import sun.awt.image.OffScreenImage;
  32 
  33 /**
  34  * The peer interface for {@link Frame}. This adds a couple of frame specific
  35  * methods to the {@link WindowPeer} interface.
  36  *
  37  * The peer interfaces are intended only for use in porting
  38  * the AWT. They are not intended for use by application
  39  * developers, and developers should not implement peers
  40  * nor invoke any of the peer methods directly on the peer
  41  * instances.
  42  */
  43 public interface FramePeer extends WindowPeer {
  44 
  45     /**
  46      * Sets the title on the frame.
  47      *
  48      * @param title the title to set
  49      *
  50      * @see Frame#setTitle(String)
  51      */


 115 
 116     /**
 117      * Returns the size and location for embedded frames. (On embedded frames,
 118      * setLocation() and setBounds() always set the frame to (0,0) for
 119      * backwards compatibility.
 120      *
 121      * @return the bounds of an embedded frame
 122      *
 123      * @see EmbeddedFrame#getBoundsPrivate()
 124      */
 125     // TODO: This is only used in EmbeddedFrame, and should probably be moved
 126     // into an EmbeddedFramePeer which would extend FramePeer
 127     Rectangle getBoundsPrivate();
 128 
 129     /**
 130      * Requests the peer to emulate window activation.
 131      *
 132      * @param activate activate or deactivate the window
 133      */
 134     void emulateActivation(boolean activate);
 135     
 136     /**
 137      * Notifies that the scale factor has changed.
 138      * The method is used by the LightweightFrame Mac implementation.
 139      */
 140     default void notifyScaleFactorChanged() {}
 141     
 142     /**
 143      * Creates a HiDPI back buffer image with a scale factor matching
 144      * the scale of the frame (which is an internal value).
 145      * The method is currently used by the LightweightFrame Mac implementation.
 146      */
 147     default OffScreenImage createHiDPIImage(int width, int height) { return null; }
 148 }