Company News

<< Previous PageNext Page >>

Synthetica + NetBeans 7.1(10:29, 19. Jan. 2012)

As of NetBeans 7.1 non-document windows in the same docking spot are organized into a tab group and are no longer stretched by default. To support this new feature SyntheticaAddons V1.6.2 provides an updated NetBeans plugin. The new plugin is backwards compatible and works fine with NetBeans 6.9/7.0.

non-stretching view tabs

To enable the old appearance/behavior NetBeans supports the system property winsys.stretching_view_tabs. By setting the system property to true you can force NetBeans using the old streched tabs appearance.

stretching view tabs

Related Links

Synthetica V2.14.2 and SyntheticaAddons V1.6.2 have been released!(21:36, 17. Jan. 2012)

The maintenance releases Synthetica V2.14.2 and SyntheticaAddons V1.6.2 are available. The updates provide support for NetBeans 7.1 and some minor bug fixes. See also Synthetica changelog and SyntheticaAddons changelog.

Synthetica + NetBeans RCP, Part II(19:08, 25. Nov. 2011)

This Article describes how to integrate Synthetica, Themes and SyntheticaAddons in your Netbeans Platform application (RCP). Instead of extending the classpath as described here, let's create two additional modules and add these modules to our NetBeans RCP application.

The first module covers Swing core components only. For this we create a module called Synthetica which provides Synthetica's core library and all needed theme libraries. We additionally create a LAFInstall class to install the look and feel on application startup. The "--laf" parameter, mentioned in the first article, is therefore no longer needed.

Create Module Synthetica

  • Create a new module
    • Name: Synthetica
    • Code Name Base: myrcp.synthetica
    • Finish
  • Select Module Synthetica / Properties
    • Select Libraries / Module Dependencies
    • Add Dependency: Module System API, Utilities API
    • Select 'Wrapped JARs'
    • Add JAR: core library synthetica.jar and your preferred theme e.g syntheticaSimple2D.jar, Note: the Standard theme is already part of synthetica.jar
    • Select API Versioning, select modul type eager and make myrcp.synthetica and all listed packages public
  • Create class myrcp.synthetica.LAFInstall and override the method #restored()
    		public class LAFInstall extends ModuleInstall 
    {
      @Override
      public void restored() 
      {
        try 
        {
          UIManager.setLookAndFeel(
            "de.javasoft.plaf.synthetica.SyntheticaSimple2DLookAndFeel");
        } 
        catch (Exception e) 
        {
          Exceptions.printStackTrace(e);
        }    
      }  
    }
    
  • Edit Important files / Module Manifest
    • add the line below to the manifest file
      				OpenIDE-Module-Install: myrcp/synthetica/LAFInstall.class
      

The second module is used to provide all SynteticaAddons libraries and covers UI-support for Netbeans components. In this example configuration we assume that SyntheticaSimple2D is used as preferred theme, which also means that the theme extension syntheticaSimple2DAddon.jar has to be added to your module.

Create Module SyntheticaAddons

  • Create a new Module
    • Name: SyntheticaAddons
    • Code Name Base: myrcp.syntheticaaddons
    • Finish
  • Select Module SyntheticaAddons / Properties
    • Select Libraries / Module Dependencies
    • Add Dependency: Look & Feel Customization LibraryNodes API, Synthetica, Tab Control, UI Utilities API, Window System API
    • Select 'Wrapped JARs'
    • Add JAR: de-javasoft-synthetica-netbeans.jar, syntheticaAddons.jar, syntheticaSimple2DAddon.jar, jywidgets.jar, swingx-1.6.2.jar
    • Selet API Versioning, select modul type eager and make all packages public

Modify your Main/Core Module

  • Select your Main/Core Module / Properties
    • Select Libraries / Module Dependencies
    • Add Dependency: Synthetica, SyntheticaNetbeans

Modify your Netbeans Platform Application

  • Select Important Files / Project Properties
    • add app.conf=myrcp.conf
  • create new file myrcp.conf to provide basic configuration
    		# ${HOME} will be replaced by user home directory according to platform
    default_userdir="${HOME}/.${APPNAME}/dev"
    default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/dev"
    
    # options used by the launcher by default, can be overridden by explicit
    # command line switches
    default_options="--branding testrcp -J-Dnb.forceui=de.javasoft.synthetica.netbeans.SyntheticaLFCustoms -J-Xms24m -J-Xmx64m"
    # for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
    
  • make sure that -J-Dnb.forceui=de.javasoft.synthetica.netbeans.SyntheticaLFCustoms has been added to the default options of the config file

Related Links

Synthetica maintenance release V2.14.1 is available(12:51, 25. Nov. 2011)

Synthetica V2.14.1 is available - see changelog for more details.

SyntheticaAddons maintenance release V1.6.1 is available(12:27, 17. Nov. 2011)

SyntheticaAddons V1.6.1 is available - see changelog for more details.

JYTabbedPane Features in SyntheticaAddons V1.6(10:54, 10. Nov. 2011)

SyntheticaAddons V1.6.0 provides some new JYTabbedPane features. So let's take a look at these new features and find out how to use them in your application.

PlusButton support to add new tabs

JYTabbedPane PlusButton

The PlusButton isn't shown by default and has to be enabled by calling JYTabbedPane#setShowPlusButton(true). To let you control how the new Tabs will be created you additionaly have to provide an "addTab" action and put the action into the action map just like in the example below.

final JYTabbedPane tabbedPane = new JYTabbedPane();
tabbedPane.getActionMap().put("addTab", new AbstractAction(){
  public void actionPerformed(ActionEvent evt)
  {
    //add tab and content
    tabbedPane.addTab("New Tab", createTabbedPaneContent());    
    //move tab after selected tab and select the new tab
    if (tabPane.getTabCount() > 1)
    {  
      int index = tabPane.getSelectedIndex() + 1;
      tabbedPane.moveTab(tabPane.getTabCount() - 1, index);
      tabbedPane.setSelectedIndex(index);
    }  
  }
});
tabbedPane.setShowPlusButton(true);

Editable tabs

JYTabbedPane PlusButton

Tabs are non-editable by default. However, JYTabbedPane#setTabsEditable(true) is the related method to make tabs editable on double-click. If you are interested in tab text changes, add a PropertyChangeListener to the tabbed pane and filter events for the property name "title".

Custom Close Button Strategy

JYTabbedPane CustomCloseButtonStrategy

Sometimes it's necessary to use a custom strategy e.g. to make one or more tabs non-closable. By setting the custom ICloseButtonStrategy below there's no way for the user to close the first tab.

JYTabbedPane tabbedPane = new JYTabbedPane();
tabbedPane.setCloseButtonStrategy(new ICloseButtonStrategy()
{      
  public boolean isButtonVisible(JYTabbedPane tabbedPane, Tab tab)
  {
    return tab.getTabIndex()) > 0;
  }
});

Tab History Support

The default behavior on tab close is to automatically select the next available tab in the tab row. By enabling tab history JYTabbedPane is able to remember the tab which was selected before the currently selected tab and restores the tab on tab close. This feature improves usability for closable tabs.

JYTabbedPane TabHistory

The example below demonstrates how to enable tab history.

JYTabbedPane tabbedPane = new JYTabbedPane();
tabbedPane.setTabHistoryEnabled(true);
tabbedPane.setCloseButtonStrategy(CloseButtonStrategy.ALL_TABS);

 

Related Posts

Synthetica V2.14 and SyntheticaAddons V1.6 is released!(15:23, 08. Nov. 2011)

We are pleased to announce the release of Synthetica V2.14.0 and SyntheticaAddons V1.6.0. Please find all major improvements below - a complete list of changes can be found at Synthetica changelog and SyntheticaAddons changelog.

New Synthetica Features

  • Style name support by client property Synthetica.style (Java6u10 or above required)
    • Until now a custom style has to be bound by the component name (JComponent#setName(String)). The base functionality is inherited from Synth. Because some apps already use the component name for other things there's a need to bind a style to a component by another mechanism - the client property  "Synthetica.style" fulfills this requirement.
    • While style binding by name is still supported, binding by client property Synthetica.style has priority.
    • Because JFrame/JDialog doesn't support a #putClientProperty() method, you have to use the related RootPane instead.
  • Custom window shape support.
    • Non-rectangular (rounded rectangale) window shapes are already supported. However, in case that you want to use a different window shape, you have to create and provide your own shape class which implements the SyntheticaWindowShape interface.
  • Improved customization for title panes.
  • Improved large icon support for menu items.
  • New UI-property to enable/disable style name support.
  • Added UI-property 'ToolTip.background' support.
  • Window close item in system menu will be disabled when close button becomes disabled or invisible.
  • Updated themes.

New SyntheticaAddons Features

  • New JYTabbedPane features
    • build in plus button support to allow users to add new tabs
    • support for editable tab titles
    • custom close button strategy support
    • tab history support to restore last selected tab on tab close
    • custom font and color support for HTML based tab titles
  • New JYTable features
    • support to specify initial column filter and value
    • improved filter model binding
  • New JYDocking features
    • tab reorder support
    • DockableFactory support to allow dynamic, persisted dockables being restored
    • support for persistent active and selected dockable states
    • new UI-property to respect the minimum size of Dockables (JYDockingView) when resizing a region - JYDocking.respectMinimumDockableSize (false by default).
  • New Component JYTaskPane - improved customizability compared to JXTaskPane.
  • JYLabel - support for being editable on double click.
  • Updated DemoCenter application - new examples.
Product Links
<< Previous PageNext Page >>