< prev index next >

src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html

Print this page








   1 <!--
   2  Copyright (c) 2005, 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
  23  questions.
  24 -->
  25 
  26 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  27 <html>
  28 <head>
  29 <title></title>
  30 </head>
  31 <body bgcolor=white>
  32 
  33 <h1 align=center>AWT Desktop Properties</h1>
  34 
  35 The following refers to standard AWT desktop properties that
  36 may be obtained via the
  37 <a href="../Toolkit.html#getDesktopProperty(java.lang.String)">
  38 <code>Toolkit.getDesktopProperty</code></a> method.
  39 <p>
  40 Each desktop property is named by a unique string, which
  41 is the "name" of that property.
  42 <p>
  43 Desktop properties supported by the AWT but not documented
  44 elsewhere - typically because there is no suitable
  45 method or class - are documented here.
  46 <p>
  47 Desktop properties documented elsewhere are those which are
  48 tightly coupled with a method or class which documents them.
  49 <p>
  50 Since desktop properties abstract an underlying platform
  51 setting, they may not be available in environments that do
  52 not support them. In the event that a desktop property is
  53 unavailable for any reason, the implementation will return


  59 <table align="center" border="0" cellspacing="0" cellpadding="2"
  60   summary="Standard AWT Desktop Properties">
  61 <tr bgcolor="#ccccff">
  62 <th valign="TOP" align="LEFT">Property Name</th>
  63 <th valign="TOP" align="LEFT">Value Type</th>
  64 <th valign="TOP" align="LEFT">Summary Description</th>
  65 </tr>
  66 <tr>
  67 <td valign="TOP"><A href="#awt.font.desktophints">awt.font.desktophints</A></td>
  68 <td valign="TOP"><a href="../../util/Map.html">java.util.Map</a></td>
  69 <td valign="TOP">Font smoothing (text antialiasing) settings.</td>
  70 </tr>
  71 <tr>
  72 <td valign="TOP"><A href="#sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A></td>
  73 <td valign="TOP"><a href="../../lang/Boolean.html">java.lang.Boolean</a></td>
  74 <td valign="TOP">Controls if mouse events from extra buttons are to be generated or not</td>
  75 </tr>
  76 </table>
  77 
  78 <h2>Desktop Font Rendering Hints</h2>
  79 <b>Desktop Property: <A name="awt.font.desktophints">"awt.font.desktophints"</A></b>
  80 <p>
  81 Modern desktops support various forms of text antialiasing (font smoothing).
  82 <p>
  83 These are applied by platform-specific heavyweight components.
  84 However an application may want to render text using the same text
  85 antialiasing on a drawing surface or lightweight (non-platform) component using
  86 <a href="../Graphics2D.html"> <code>Graphics2D</code></a> methods.
  87 This is particularly important when creating
  88 <a href="../../../javax/swing/JComponent.html"> Swing components</a> which
  89 are required to appear consistent with native desktop components or other
  90 Swing components.
  91 
  92 <h3>Basic Usage</h3>
  93 The standard desktop property named
  94 <b>"awt.font.desktophints"</b>
  95 can be used to obtain the rendering hints that best match the desktop settings.
  96 
  97 The return value is a
  98 <a href="../../util/Map.html"> Map</a> of
  99 <a href="../RenderingHints.html"> <code>RenderingHints</code></a> which


 212 <li>A multi-screen desktop may support per-screen device settings in which
 213 case the returned value is for the default screen of the desktop.
 214 An application may want to use the settings for the screen on
 215 which they will be applied.
 216 The per-screen device hints may be obtained by per-device property names
 217 which are constructed as the String concatenation
 218 <pre><code>
 219 "awt.font.desktophints" + "." + GraphicsDevice.getIDstring();
 220 </code></pre>
 221 <p>
 222 An application can also listen for changes on these properties.
 223 <p>
 224 However this is an extremely unlikely configuration, so to help
 225 ease of development, if only a single, desktop-wide setting is supported,
 226 then querying each of these per-device settings will return null.
 227 So to determine if there are per-device settings it is sufficient to
 228 determine that there is a non-null return for any screen device using
 229 the per-device property name.
 230 </ul>
 231 <h2>Mouse Functionality</h2>
 232 <b>Desktop Property: <A name="sun.awt.enableExtraMouseButtons">"sun.awt.enableExtraMouseButtons"</A></b>
 233 <p>
 234 This property determines if events from extra mouse buttons (if they are exist and are
 235 enabled by the underlying operating system) are allowed to be processed and posted into
 236 {@code EventQueue}.
 237 <br>
 238 The value could be changed by passing "sun.awt.enableExtraMouseButtons"
 239 property value into java before application starts. This could be done with the following command:
 240 <pre>
 241 java -Dsun.awt.enableExtraMouseButtons=false Application
 242 </pre>
 243 Once set on application startup, it is impossible to change this value after.
 244 <br>
 245 Current value could also be queried using getDesktopProperty("sun.awt.enableExtraMouseButtons")
 246 method.
 247 <br>
 248 If the property is set to {@code true} then 
 249 <ul>
 250 <li> it is still legal to create {@code MouseEvent} objects with
 251 standard buttons and, if the mouse has more
 252 then three buttons, it is also legal to use buttons from the range started


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





  33 
  34 <h1>AWT Desktop Properties</h1>
  35 
  36 The following refers to standard AWT desktop properties that
  37 may be obtained via the
  38 <a href="../Toolkit.html#getDesktopProperty(java.lang.String)">
  39 <code>Toolkit.getDesktopProperty</code></a> method.
  40 <p>
  41 Each desktop property is named by a unique string, which
  42 is the "name" of that property.
  43 <p>
  44 Desktop properties supported by the AWT but not documented
  45 elsewhere - typically because there is no suitable
  46 method or class - are documented here.
  47 <p>
  48 Desktop properties documented elsewhere are those which are
  49 tightly coupled with a method or class which documents them.
  50 <p>
  51 Since desktop properties abstract an underlying platform
  52 setting, they may not be available in environments that do
  53 not support them. In the event that a desktop property is
  54 unavailable for any reason, the implementation will return


  60 <table align="center" border="0" cellspacing="0" cellpadding="2"
  61   summary="Standard AWT Desktop Properties">
  62 <tr bgcolor="#ccccff">
  63 <th valign="TOP" align="LEFT">Property Name</th>
  64 <th valign="TOP" align="LEFT">Value Type</th>
  65 <th valign="TOP" align="LEFT">Summary Description</th>
  66 </tr>
  67 <tr>
  68 <td valign="TOP"><A href="#awt.font.desktophints">awt.font.desktophints</A></td>
  69 <td valign="TOP"><a href="../../util/Map.html">java.util.Map</a></td>
  70 <td valign="TOP">Font smoothing (text antialiasing) settings.</td>
  71 </tr>
  72 <tr>
  73 <td valign="TOP"><A href="#sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A></td>
  74 <td valign="TOP"><a href="../../lang/Boolean.html">java.lang.Boolean</a></td>
  75 <td valign="TOP">Controls if mouse events from extra buttons are to be generated or not</td>
  76 </tr>
  77 </table>
  78 
  79 <h2>Desktop Font Rendering Hints</h2>
  80 <b>Desktop Property: <a id="awt.font.desktophints">"awt.font.desktophints"</A></b>
  81 <p>
  82 Modern desktops support various forms of text antialiasing (font smoothing).
  83 <p>
  84 These are applied by platform-specific heavyweight components.
  85 However an application may want to render text using the same text
  86 antialiasing on a drawing surface or lightweight (non-platform) component using
  87 <a href="../Graphics2D.html"> <code>Graphics2D</code></a> methods.
  88 This is particularly important when creating
  89 <a href="../../../javax/swing/JComponent.html"> Swing components</a> which
  90 are required to appear consistent with native desktop components or other
  91 Swing components.
  92 
  93 <h3>Basic Usage</h3>
  94 The standard desktop property named
  95 <b>"awt.font.desktophints"</b>
  96 can be used to obtain the rendering hints that best match the desktop settings.
  97 
  98 The return value is a
  99 <a href="../../util/Map.html"> Map</a> of
 100 <a href="../RenderingHints.html"> <code>RenderingHints</code></a> which


 213 <li>A multi-screen desktop may support per-screen device settings in which
 214 case the returned value is for the default screen of the desktop.
 215 An application may want to use the settings for the screen on
 216 which they will be applied.
 217 The per-screen device hints may be obtained by per-device property names
 218 which are constructed as the String concatenation
 219 <pre><code>
 220 "awt.font.desktophints" + "." + GraphicsDevice.getIDstring();
 221 </code></pre>
 222 <p>
 223 An application can also listen for changes on these properties.
 224 <p>
 225 However this is an extremely unlikely configuration, so to help
 226 ease of development, if only a single, desktop-wide setting is supported,
 227 then querying each of these per-device settings will return null.
 228 So to determine if there are per-device settings it is sufficient to
 229 determine that there is a non-null return for any screen device using
 230 the per-device property name.
 231 </ul>
 232 <h2>Mouse Functionality</h2>
 233 <b>Desktop Property: <a id="sun.awt.enableExtraMouseButtons">"sun.awt.enableExtraMouseButtons"</A></b>
 234 <p>
 235 This property determines if events from extra mouse buttons (if they are exist and are
 236 enabled by the underlying operating system) are allowed to be processed and posted into
 237 {@code EventQueue}.
 238 <br>
 239 The value could be changed by passing "sun.awt.enableExtraMouseButtons"
 240 property value into java before application starts. This could be done with the following command:
 241 <pre>
 242 java -Dsun.awt.enableExtraMouseButtons=false Application
 243 </pre>
 244 Once set on application startup, it is impossible to change this value after.
 245 <br>
 246 Current value could also be queried using getDesktopProperty("sun.awt.enableExtraMouseButtons")
 247 method.
 248 <br>
 249 If the property is set to {@code true} then
 250 <ul>
 251 <li> it is still legal to create {@code MouseEvent} objects with
 252 standard buttons and, if the mouse has more
 253 then three buttons, it is also legal to use buttons from the range started


< prev index next >