14.07.2013 Views

Contents - Cultural View

Contents - Cultural View

Contents - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Synth Look and Feel 292<br />

Synth Look and Feel<br />

synth is a skinnable Java look and feel, which is configured with an XML property file.<br />

According to Sun, goals for synth were:<br />

• Enable to create custom look without writing any code.<br />

• Allow appearance to be configured from images.<br />

• Provide the ability to customize the look of a component based on its named properties.<br />

• Provide a centralized point for overriding the look of all components.<br />

• Enable custom rendering based on images, or user-defined SynthPainters.<br />

History<br />

synth is available beginning with version J2SE 5.0 of Java (see Java version history).<br />

Java SE 6 Update 10 release and newer contain Nimbus, a cross-platform Look and Feel implemented with Synth.<br />

However, for backwards compatibility, Metal is still the default Swing look and feel. [1]<br />

Architecture<br />

Synth is a skinnable look and feel in which all painting is delegated to the components, without having to write any<br />

code (see Synth Look and Feel).<br />

However synth does not provide a default look, and components that are not defined in the synth XML file will not<br />

be painted. It is however possible to assign a default style to all other widgets, and customize styles for some specific<br />

widgets only.<br />

Example<br />

The following XML declaration defines a style named textfield and binds it to all text fields. The defaultStyle allows<br />

to set a default font, foreground and background colors to all other widgets.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!