Wolfgang has posted 20 posts at DZone. You can read more from them at their website. View Full User Profile

Synthetica Simple2D Highlights

11.16.2008
| 8341 views |
  • submit to reddit

Synthetica V2.8 offers a new theme called Synthetica Simple2D Look and Feel. Below you'll find a short summary of the most important highlights.

  • Drop shadows for popup menus and combobox popups - Synthetica supports drop shadow effect for popupMenus since the first release in 2005. However this new theme also supports drop shadows for combobox popups. 

popupMenucomboPopup

  • ScrollPanes with rounded corners and inner shadow - The implementation of a rounded border scrollPane is a bit tricky because it affects the scrollBar position. The goal was to avoid an additional gap between the scrollBar position and the border.

scrollPaneRoundedCorners

  • Translucent scrollbars - Scrollbars are translucent to adopt the view background.

translucentScrollBars

  • Increased table cell insets - Tables look more balanced with increased cell insets.

table

  • Translucent frameHeader with Java6u10 - Synthetica 2.8 supports a new UI-property called "Synthetica.window.opaque" which can be used to enable window titlePane translucency. By default translucency is disabled - to enable translucency you have to set the value to 'false'.

windowTitlePanetranslucentWindowTitlePane

  • Translucent tooltips - ToolTips are translucent and use real translucency if the UI-property "Synthetica.window.opaque" is set to 'false'.

translucentToolTip

  • TitledBorder with translucent background fill - To get a more realistic etched effect a titled border additionally modifies the background color of the container.

titledBorder

  • Java 1.5 support - Compared to other Java 2D based themes Synthetica Simple2D also supports Java 1.5. The only thing you have to do is to add the 'syntheticaBatik.jar' file to your classpath. The library is part of the Synthetica download.  
  • New paint cache to improve Java2D performance - Synthetica provides a new paint cache to minimize Java2D calls which results in a better paint performance (up to factor 2).
  • SwingX support is given through SyntheticaAddons 

 

Tipps for known issues

  • Custom comboBox renderers - Custom comboBox renderers you have to respect opacity to keep the default style. Example:
      combo.setRenderer(new DefaultListCellRenderer(){
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
          super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
          setIcon(icon);
          //avoid painting over comboBox background - a selected list entry has to be opaque
          setOpaque(isSelected);
          return this;
      }
    });

comboBoxRenderer

  • TitledBorder background - Titled border affects component background. In case that you are using additional containers you have to set opacity of inner containers to false (#setOpaque(false)). 
  • Non-editable textComponents - Sometimes you have to use non-editable text components for i.e. descriptions. In case that you also need to disable painting for such text components you can set the background alpha value to 0 or set the "Synthetica.opaque" client property to false - both methods are equivalent.    

  nonEditableTextArea

 

Links

 

Published at DZone with permission of its author, Wolfgang Zitzelsberger.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Kirill Grouchnikov replied on Sun, 2008/11/16 - 9:05pm

Congratulations on the release. A question about the performance - what did you use to measure the improvements (up to factor 2)? I've ran the new version through the LightBeam [1] test bed, and i saw the following:

  • Under the base look-and-feel, the total time for dynamc scenarios went from 4908ms to 5189ms (about 6% slower than previous release).
  • White Vision (sample skin that i checked) ran in 5389ms (about 4% slower than base). Do you have any numbers to compare the performance of different Synthetica skins?
  • Simple2D runs in 4434ms (about 15% faster than base). The scenario that contributed the most to the 755ms difference was dynamic selection of table rows. It went from 607ms to 215ms. Other scenarios features imrovements much less moderate (20 scenarios resulted in about 8% improvement on average).  

Thanks
Kirill

[1] https://lightbeam.dev.java.net

Wolfgang Zitzel... replied on Mon, 2008/11/17 - 3:47am in response to: Kirill Grouchnikov

Hello Kirill,

the mentioned performance factor is related to the Simple2D theme (measured with and without Cache).

Below please find the numbers for Synthetica's base theme (SyntheticaStandardLookAndFeel) with LightBeam's DynamicPerformanceSuite.

Test-System: Dell Dual Core (2.13 GHz, NVidia GeForce 7900GS), Windows Vista, Java 6u10 B33, LightBeam startup argument: 5

Synthetica (non-eval) V2.7.2    3262

Synthetica (non-eval) V2.8.0    2854

This means a performance gain of about 12%. The new cache is currently only enabled for the Simple2D theme. The result for this theme is 2733. The performance of the eval release is possibly a bit less because of the evaluation message at the bottom of the window.

I really appreciate the LightBeam project for LAF optimizations but users should be careful in comparing different Look and Feels with this tool because more complex LAF's simply need more CPU-time. That's why Metal is very fast.

As you've already noticed, results can vary on different systems so I'm not quite sure if LightBeam measurement is completely correct or affected by some additional settings. For comparing results on a single test system I think it is a very useful tool.

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.