< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html

Print this page


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


 760     <p>
 761       Consider the following:
 762     </p>
 763     <div class="example">
 764       <pre>
 765 &lt;style id="test">
 766   &lt;painter idref="fallbackPainter"/>
 767   &lt;painter idref="styleButtonBackgroundPainter" method="buttonBackground"/>
 768   &lt;state value="SELECTED">
 769     &lt;painter idref="stateFallbackPainter"/>
 770     &lt;painter idref="stateButtonBackgroundPainter" method="buttonBackground"/>
 771   &lt;/state>
 772 &lt;/style>
 773       </pre>
 774     </div>
 775     <p>
 776       The following outlines which painter will be used for what
 777       SynthPainter method:
 778     </p>
 779     <table border=1>
 780      <caption> Painters for SynthPainter methods </caption>
 781       <tr><th>State<th>Method<th>Painter
 782         <tr><td>SELECTED<td>paintButtonBackground<td>stateButtonBackgroundPainter
 783         <tr><td>SELECTED<td>Anything but paintButtonBackground<td>stateFallbackPainter
 784         <tr><td>Anything but SELECTED<td>paintButtonBackground<td>styleButtonBackgroundPainter
 785         <tr><td>Anything but SELECTED<td>Anything but paintButtonBackground<td>fallbackPainter




















 786     </table>
 787 
 788     <p>
 789       When several identical painters are declared, they are aggregated into
 790       a single one. Two painters are identical if their <em>direction</em> and
 791       <em>method</em> attributes values are equal. Consider the following:
 792     </p>
 793 
 794         <div class="example">
 795           <pre>
 796 &lt;style id="panelStyle"&gt;
 797   &lt;imagePainter method="panelBackground" path="red.png" /&gt;
 798   &lt;imagePainter method="panelBackground" path="green.png" /&gt;
 799   &lt;imagePainter method="panelBackground" path="blue.png" /&gt;
 800 &lt;/style&gt;
 801           </pre>
 802         </div>
 803 
 804         <p>
 805           These three painters are identical for they use the same method and the


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


 760     <p>
 761       Consider the following:
 762     </p>
 763     <div class="example">
 764       <pre>
 765 &lt;style id="test">
 766   &lt;painter idref="fallbackPainter"/>
 767   &lt;painter idref="styleButtonBackgroundPainter" method="buttonBackground"/>
 768   &lt;state value="SELECTED">
 769     &lt;painter idref="stateFallbackPainter"/>
 770     &lt;painter idref="stateButtonBackgroundPainter" method="buttonBackground"/>
 771   &lt;/state>
 772 &lt;/style>
 773       </pre>
 774     </div>
 775     <p>
 776       The following outlines which painter will be used for what
 777       SynthPainter method:
 778     </p>
 779     <table border=1>
 780      <caption>Painters for SynthPainter methods</caption>
 781       <thead>
 782       <tr>
 783         <th scope="col">Index
 784         <th scope="col">State
 785         <th scope="col">Method
 786         <th scope="col">Painter
 787       </thead>
 788       <tbody>
 789             <tr>
 790         <th scope="row">1
 791         <td>SELECTED
 792         <td>paintButtonBackground<td>stateButtonBackgroundPainter
 793             <tr>
 794         <th scope="row">2
 795         <td>SELECTED
 796         <td>Anything but paintButtonBackground<td>stateFallbackPainter
 797             <tr>
 798         <th scope="row">3
 799         <td>Anything but SELECTED
 800         <td>paintButtonBackground<td>styleButtonBackgroundPainter
 801             <tr>
 802         <th scope="row">4
 803         <td>Anything but SELECTED
 804         <td>Anything but paintButtonBackground<td>fallbackPainter
 805       </tbody>
 806     </table>
 807 
 808     <p>
 809       When several identical painters are declared, they are aggregated into
 810       a single one. Two painters are identical if their <em>direction</em> and
 811       <em>method</em> attributes values are equal. Consider the following:
 812     </p>
 813 
 814         <div class="example">
 815           <pre>
 816 &lt;style id="panelStyle"&gt;
 817   &lt;imagePainter method="panelBackground" path="red.png" /&gt;
 818   &lt;imagePainter method="panelBackground" path="green.png" /&gt;
 819   &lt;imagePainter method="panelBackground" path="blue.png" /&gt;
 820 &lt;/style&gt;
 821           </pre>
 822         </div>
 823 
 824         <p>
 825           These three painters are identical for they use the same method and the


< prev index next >