Synth Look and Feel

Synth Look and Feel

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

According to Sun, goals for synth were:
* Enable to create custom look without writing any code.
* Allow appearance to be configured from images.
* Provide the ability to customize the look of a component based on its named properties.
* Provide a centralized point for overriding the look of all components.
* Enable custom rendering based on images, or user-defined Javadoc:SE|javax/swing/plaf/synth|SynthPainters.

History

synth is available beginning with version J2SE 5.0 of Java (see Java version history).

Java upcoming Java SE 6 Update 10 release (which was called "Consumer JRE" by Sun) will use "Nimbus", a cross-platform Look and Feel implemented with synth, as the default Look and Feel [cite web
url=https://jdk6.dev.java.net/6uNea.html
title=Welcome to the Java SE 6 Update N Early Access Program!
publisher=Sun Microsystems
accessdate=2007-11-01
] [cite web
url=http://java.sun.com/developer/technicalArticles/javase/consumerjre/#Nimbus
title=Consumer JRE: Leaner, Meaner Java Technology
publisher=Sun Microsystems
last=Haase|first=Chet
date=May 2007
accessdate=2007-11-01
] .

Architecture

Synth is a skinnable look and feel in which all painting is delegated to the components, without having to write any code (see Javadoc:SE|package=Synth Look and Feel|javax/swing/plaf/synth).

However synth does not provide a default look, and components that are not defined in the synth XML file will not be painted. It is however possible to assign a default style to all other widgets, and customize styles for some specific widgets only.

Example

The following XML declaration defines a style named textfield and binds it to all text fields. The "defaultStyle" allows to set a default font, foreground and background colors to all other widgets.

Supposing that the XML declaration is defined in a file named "synthExample.xml", the following code loads the XML definition file and sets the current look and feel to synth (loading a synth Look and Feel is done using the "load" method of the Javadoc:SE|javax/swing/plaf/synth|SynthLookAndFeel class): SynthLookAndFeel laf = new SynthLookAndFeel(); laf.load(new File("synthExample.xml").toURL()); UIManager.setLookAndFeel(laf);

ee also

* Swing, the standard cross-platform widget toolkit for Java
* Pluggable look and feel
* Look and Feel in Widget Toolkits

References

External links

* API documentation
* [http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/synth/doc-files/synthFileFormat.html synth file format]
* [http://javadesktop.org/articles/synth/ synth tutorial]
* [http://www.ibm.com/developerworks/java/library/j-synth/ another synth tutorial]
* [https://nimbus.dev.java.net/ nimbus home page]
* [http://www.javasoft.de/jsf/public/products/synthetica Synthetica - commercial Synth Look and Feel with many different themes]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Look and feel — is a term used in descriptions of products and fields such as marketing, branding and trademarking, to signify the experience a person has using a product, and the main features of its appearance and interfaces.In software design, look and feel… …   Wikipedia

  • Pluggable look and feel — is a mechanism used in the Java Swing widget toolkit allowing to change the look and feel of the graphical user interface at runtime.Swing allows to specialize the look and feel of widgets, by modifying the default (via runtime parameters),… …   Wikipedia

  • Synth (disambiguation) — Synth may refer to:* Synthesizer, any kind of electronic musical instrument * Synth Look and Feel, a skinnable Java look and feel …   Wikipedia

  • Swing (Java) — Swing is a widget toolkit for Java. It is part of Sun Microsystems Java Foundation Classes (JFC) mdash; an API for providing a graphical user interface (GUI) for Java programs.Swing was developed to provide a more sophisticated set of GUI… …   Wikipedia

  • Swing (Java) — Die Widgets von Swing mit dem Ocean Look and Feel (Standard seit Java 1.5) …   Deutsch Wikipedia

  • Don't Look Now — This article is about the 1973 film. For the short story collection by Daphne du Maurier, see Not After Midnight. For other uses, see Don t Look Now (disambiguation). Don t Look Now Original film poster …   Wikipedia

  • HIStory: Past, Present and Future, Book I — For the song, see HIStory/Ghosts. HIStory: Past, Present and Future, Book I …   Wikipedia

  • List of Italo Disco artists and songs — The following is a list of Italo Disco artists and their most notable song(s) (non Italian artists are indicated):0–9* 50 50 Brothers Red Man * 93rd Superbowl Forever and a Day A* Advance Take Me To The Top * Ago Computer (In My Mind) , I Want… …   Wikipedia

  • XML User Interface — The XML User Interface ( XUI ) is a Java and XML framework for building rich client, desktop and mobile applications. The framework can save much of the code typically needed to build an application with consequent savings in development time,… …   Wikipedia

  • Swing — У этого термина существуют и другие значения, см. Свинг. Пример Swing интерфейса для X Window System. Swing  библиотека для создания графи …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”