Java Code Examples for sun.java2d.SunGraphicsEnvironment#getUsableBounds()

The following examples show how to use sun.java2d.SunGraphicsEnvironment#getUsableBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 2
Source File: GraphicsEnvironment.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 3
Source File: GraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 4
Source File: GraphicsEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 5
Source File: GraphicsEnvironment.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 6
Source File: GraphicsEnvironment.java    From jdk-1.7-annotated with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 7
Source File: GraphicsEnvironment.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 8
Source File: GraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 9
Source File: GraphicsEnvironment.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the Point where Windows should be centered.
 * It is recommended that centered Windows be checked to ensure they fit
 * within the available display area using getMaximumWindowBounds().
 * @return the point where Windows should be centered
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getMaximumWindowBounds
 * @since 1.4
 */
public Point getCenterPoint() throws HeadlessException {
// Default implementation: return the center of the usable bounds of the
// default screen device.
    Rectangle usableBounds =
     SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
    return new Point((usableBounds.width / 2) + usableBounds.x,
                     (usableBounds.height / 2) + usableBounds.y);
}
 
Example 10
Source File: GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 11
Source File: GraphicsEnvironment.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 12
Source File: GraphicsEnvironment.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * {@code GraphicsConfiguration.getBounds()} and
 * {@code Toolkit.getScreenInsets()}.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 13
Source File: GraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 14
Source File: GraphicsEnvironment.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * {@code GraphicsConfiguration.getBounds()} and
 * {@code Toolkit.getScreenInsets()}.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 15
Source File: GraphicsEnvironment.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 16
Source File: GraphicsEnvironment.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 17
Source File: GraphicsEnvironment.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 18
Source File: GraphicsEnvironment.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 19
Source File: GraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}
 
Example 20
Source File: GraphicsEnvironment.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the maximum bounds for centered Windows.
 * These bounds account for objects in the native windowing system such as
 * task bars and menu bars.  The returned bounds will reside on a single
 * display with one exception: on multi-screen systems where Windows should
 * be centered across all displays, this method returns the bounds of the
 * entire display area.
 * <p>
 * To get the usable bounds of a single display, use
 * <code>GraphicsConfiguration.getBounds()</code> and
 * <code>Toolkit.getScreenInsets()</code>.
 * @return  the maximum bounds for centered Windows
 *
 * @exception HeadlessException if isHeadless() returns true
 * @see #getCenterPoint
 * @see GraphicsConfiguration#getBounds
 * @see Toolkit#getScreenInsets
 * @since 1.4
 */
public Rectangle getMaximumWindowBounds() throws HeadlessException {
// Default implementation: return the usable bounds of the default screen
// device.  This is correct for Microsoft Windows and non-Xinerama X11.
    return SunGraphicsEnvironment.getUsableBounds(getDefaultScreenDevice());
}