Home
Categories
Dictionnary
Download
Project Details
Changes Log
Who We Are
FAQ
License

Synth2 Look and Feel configuration bindings


    1  Style element
       1.1  State element
          1.1.1  StyleSets
          1.1.2  Interaction states
    2  Bind element
       2.1  List of synth2 UI elements
    3  Properties types
    4  Example
    5  Notes

The specification of Styles for a widget uses two related XML elements;


Note that a Style must be defined only once, and binded once. It is not valid for example to define one "style" element, and bind it on several "bind" elements.

Style element

The "style" element contains only one "id" attribute which will be used by the next "bind" element[1] .
This element can contain both:
For example:

      <style id="readout">
         <insets top="0" left="4" bottom="−4" right="4"/>
         <state styleSet="0">
            <color value="transparent" type="BACKGROUND"/>
            <color value="GREEN" type="TEXT_FOREGROUND"/>
            <property key="Label.halo" type="boolean" value="false" />
            <font resource="DU1310SSmall" size="12.6" style="BOLD" />
         </state>
      </style>

State element

"state" elements represent the states of the component which is specified under the "style" element. States take into account:
Note that:

StyleSets

The StyleSets for a "state" element are specified through the "styleSet" attribute. This attribute can either define only one StyleSet index or several StyleSet indexes separated by commas (",").

Interaction states

The interaction states for a "state" element are specified through the "value" attribute. The list of available interaction states in Synth2 is fixed. The following pseudo−states are available:
Note that:

Bind element

The "bind" element bind a "style" element to a Swing component UI, and optionally an ARINC ID. For example:


      <style id="myButton">
         ...
      </style>
      <bind style="myButton" key="button"/>

      <style id="myPanel">
         ...
      </style>
      <bind style="myPanel" key="panel" arinc="A661_PANEL"/>

In this example:

List of synth2 UI elements

See List of synth2 UI elements.

Properties types

Several properties can be defined under a style or a state element:

Example

      <style id="line">
         <state styleSet="0">
            <stroke width="2" endCap="CAP_ROUND" />
            <property key="graphicWidget.halo" type="boolean" value="false" />
            <property key="halo" type="string" value="supersmall" />
         </state>
      </style>
      <bind style="line" key="line"/>

Notes

  1. The effective binding between the style specified in the "style" element and the "bind" element will be preformed by this id
  2. It is similar to the CSS pseudo-classes, which define for example pseudo−classes like "hover", "selected", etc... for components
  3. The "transparetn" color name will always point to a completely transparent color

See Also


Category: lookandfeel Category: server Category: swing Category: user

Copyright 2016 Dassault Aviation. All Rights Reserved. Documentation and source under the GPL v2 licence

Project Web Hosted by SourceForge.net Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved About - Legal - Help