Re: Groupable Table Header under Substance

View: New views
8 Messages — Rating Filter:   Alert me  

Re: Groupable Table Header under Substance

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Is your custom UI delegate extending the SubstanceTableHeaderUI class? Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class? These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Parent Message unknown Re: Groupable Table Header under Substance

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Another thing to consider - it looks like you have multiple "rows" in the table header. If you use a separate background gradient on each cell, it will not look very appealing (three distinct horizontal stripes). If you wish to have a single continuous stripe across the entire header, you'll need to see the code of SubstanceTableHeaderUI.update and the calls to SubstanceHighlightUtils.paintHighlight and play with the bounds and offsets passed to that method.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: Groupable Table Header under Substance

by Oles Hodych :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)
    at java.awt.Container.doLayout(Container.java:1421)
    at java.awt.Container.validateTree(Container.java:1519)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validate(Container.java:1491)
    at java.awt.Window.show(Window.java:820)
    at java.awt.Component.show(Component.java:1419)
    at java.awt.Component.setVisible(Component.java:1372)
    at java.awt.Window.setVisible(Window.java:801)
    at org.jdesktop.swingx.ColumnGroupDemo.main(ColumnGroupDemo.java:133)
 
Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class?


No. As you have already recommended, I should probably have a look at the substance-swingx implementation to understand the role of SubstanceDefaultTableHeaderCell
Rendere.

In order to make our discussion more effective, I have attached the source of the Eclipse/M2 project, which I'm using for this spike. I would really appreciate if you get a chance to have a look at it.

Thanx a lot,
01es
 
These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

GroupableTableHeader.zip (24K) Download Attachment

Parent Message unknown Re: Groupable Table Header under Substance

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Attached please find the following files to have you started:

1. The plugin XML descriptor. This goes into META-INF folder of your plugin
2. The plugin class itself. Populates the UIDefaults table with the class name of the UI delegate
3. The UI delegate itself. Right now it only paints the background

This should have you started, and the next step for you would be to look at the sources of SubstanceTableHeaderUI and SubstanceDefaultTableHeaderCellRenderer to see how they paint the grid and provide the rollover animation effects.

Note that you'll need the latest 5.0dev version of Substance core library that provides a workaround for the ClassCastException.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Tuesday, May 13, 2008 12:32:54 AM
Subject: Re: Groupable Table Header under Substance

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)
    at java.awt.Container.doLayout(Container.java:1421)
    at java.awt.Container.validateTree(Container.java:1519)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validate(Container.java:1491)
    at java.awt.Window.show(Window.java:820)
    at java.awt.Component.show(Component.java:1419)
    at java.awt.Component.setVisible(Component.java:1372)
    at java.awt.Window.setVisible(Window.java:801)
    at org.jdesktop.swingx.ColumnGroupDemo.main(ColumnGroupDemo.java:133)
 
Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class?


No. As you have already recommended, I should probably have a look at the substance-swingx implementation to understand the role of SubstanceDefaultTableHeaderCell
Rendere.

In order to make our discussion more effective, I have attached the source of the Eclipse/M2 project, which I'm using for this spike. I would really appreciate if you get a chance to have a look at it.

Thanx a lot,
01es
 
These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


<laf-plugin>
        <component-plugin-class>org.jvnet.substance.swingx.SubstanceGroupablePlugin</component-plugin-class>
</laf-plugin>

[SubstanceGroupablePlugin.java]

/*
 * Copyright 2005-2008 Kirill Grouchnikov, based on work by
 * Sun Microsystems, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
package org.jvnet.substance.swingx;

import org.jdesktop.swingx.JXGroupableTableHeader;
import org.jvnet.lafplugin.LafComponentPlugin;

/**
 * Substance plugin for <a href="https://swingx.dev.java.net">SwingX</a>
 * components.
 *
 * @author Kirill Grouchnikov
 */
public class SubstanceGroupablePlugin implements LafComponentPlugin {

        /**
         * Creates a plugin instance.
         */
        public SubstanceGroupablePlugin() {
        }

        public Object[] getDefaults(Object mSkin) {
                Object[] defaults = new Object[] {

                JXGroupableTableHeader.muiClassID,
                                "org.jvnet.substance.swingx.SubstanceGroupableTableHeaderUI" };

                return defaults;
        }

        public void initialize() {
        }

        public void uninitialize() {
        }
}


[SubstanceGroupableTableHeaderUI.java]

package org.jvnet.substance.swingx;

import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;

import org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI;
import org.jvnet.substance.api.ComponentState;
import org.jvnet.substance.api.SubstanceColorScheme;
import org.jvnet.substance.painter.highlight.SubstanceHighlightUtils;
import org.jvnet.substance.utils.SubstanceThemeUtilities;

public class SubstanceGroupableTableHeaderUI extends
                BasicGroupableTableHeaderUI {
        public static ComponentUI createUI(JComponent c) {
                return new SubstanceGroupableTableHeaderUI();
        }

        @Override
        public void update(Graphics g, JComponent c) {
                ComponentState backgroundState = (this.header.isEnabled() && this.header
                                .getTable().isEnabled()) ? ComponentState.DEFAULT
                                : ComponentState.DISABLED_UNSELECTED;
                SubstanceColorScheme scheme = SubstanceThemeUtilities.getColorScheme(c,
                                backgroundState);

                SubstanceHighlightUtils.paintHighlight(g, c, c.getBounds(), 0.0f, null,
                                scheme, scheme, 0.0f);
                paint(g, c);
        }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

Re: Groupable Table Header under Substance

by Oles Hodych :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanx a lot Kirill,

I will provide the feedback as soon as I get some results.

Regards,
01es

2008/5/15 Kirill Grouchnikov <kirillcool@...>:
Hi,

Attached please find the following files to have you started:

1. The plugin XML descriptor. This goes into META-INF folder of your plugin
2. The plugin class itself. Populates the UIDefaults table with the class name of the UI delegate
3. The UI delegate itself. Right now it only paints the background

This should have you started, and the next step for you would be to look at the sources of SubstanceTableHeaderUI and SubstanceDefaultTableHeaderCellRenderer to see how they paint the grid and provide the rollover animation effects.

Note that you'll need the latest 5.0dev version of Substance core library that provides a workaround for the ClassCastException.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Tuesday, May 13, 2008 12:32:54 AM
Subject: Re: Groupable Table Header under Substance

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)
    at java.awt.Container.doLayout(Container.java:1421)
    at java.awt.Container.validateTree(Container.java:1519)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validate(Container.java:1491)
    at java.awt.Window.show(Window.java:820)
    at java.awt.Component.show(Component.java:1419)
    at java.awt.Component.setVisible(Component.java:1372)
    at java.awt.Window.setVisible(Window.java:801)
    at org.jdesktop.swingx.ColumnGroupDemo.main(ColumnGroupDemo.java:133)
 
Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class?


No. As you have already recommended, I should probably have a look at the substance-swingx implementation to understand the role of SubstanceDefaultTableHeaderCell
Rendere.

In order to make our discussion more effective, I have attached the source of the Eclipse/M2 project, which I'm using for this spike. I would really appreciate if you get a chance to have a look at it.

Thanx a lot,
01es
 
These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Groupable Table Header under Substance

by Oles Hodych :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Kirill,

Unfortunately, I did not have a chance to follow your recommendations with column groups -- still on the TODO list. However, recently I've started using JIDE Grids that provide column group feature, and the JideTable emitted exactly the same problem as was originaly raised -- ClassCastException (pls refer JideTable-substance-issue.png). This was with Substance 4.3.

I have tried using JideTable with substance 5.0 (14th of June snapshot) and the ClassCastException did not show up. However, when I try to change row selection an NPE gets thrown (pls refer JideTable-substance-selection-issue.png).

Could you pls provide some recommndations as to what would be the best appraoch of tackling these issues. What needs to be done to provide Substance support for JIDE components? I would be happy to attemt the development of substabce-jide plugin at least on per component basis. Where would I start especially in light that I do not have much exposure to LaF development.

Appreciate your help,
01es

2008/5/15 Oles Hodych <oles.hodych@...>:
Thanx a lot Kirill,

I will provide the feedback as soon as I get some results.

Regards,
01es

2008/5/15 Kirill Grouchnikov <kirillcool@...>:

Hi,

Attached please find the following files to have you started:

1. The plugin XML descriptor. This goes into META-INF folder of your plugin
2. The plugin class itself. Populates the UIDefaults table with the class name of the UI delegate
3. The UI delegate itself. Right now it only paints the background

This should have you started, and the next step for you would be to look at the sources of SubstanceTableHeaderUI and SubstanceDefaultTableHeaderCellRenderer to see how they paint the grid and provide the rollover animation effects.

Note that you'll need the latest 5.0dev version of Substance core library that provides a workaround for the ClassCastException.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Tuesday, May 13, 2008 12:32:54 AM
Subject: Re: Groupable Table Header under Substance

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)
    at java.awt.Container.doLayout(Container.java:1421)
    at java.awt.Container.validateTree(Container.java:1519)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validate(Container.java:1491)
    at java.awt.Window.show(Window.java:820)
    at java.awt.Component.show(Component.java:1419)
    at java.awt.Component.setVisible(Component.java:1372)
    at java.awt.Window.setVisible(Window.java:801)
    at org.jdesktop.swingx.ColumnGroupDemo.main(ColumnGroupDemo.java:133)
 
Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class?


No. As you have already recommended, I should probably have a look at the substance-swingx implementation to understand the role of SubstanceDefaultTableHeaderCell
Rendere.

In order to make our discussion more effective, I have attached the source of the Eclipse/M2 project, which I'm using for this spike. I would really appreciate if you get a chance to have a look at it.

Thanx a lot,
01es
 
These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

JideTable-substance-issue.png (182K) Download Attachment
JideTable-substance-selection-issue.png (231K) Download Attachment

Parent Message unknown Re: Groupable Table Header under Substance

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

The development of Substance plugin for JIDE open-source components is a long term goal, but it is currently of a lower priority than my other projects. The amount of interest in this project has been minimal so far (i can count them on one hand), and nobody followed through (that i know about) on their intent to investigate this manner further. I do understand that i am in the best position to provide this plugin, but it is all matter of resources and prioritization on my side.

The exceptions that you're seeing in Substance-JIDE combination are due to two things. JIDE tries to be clever and reuse as much of the functionality as possible from core components to be available under different LAFs. Substance tries to be clever and push the envelop of Swing applications to animations, skinning, decoration etc. In doing so, both libraries make assumptions, some of which break when the two are used together.

Specifically for these two stack traces. The first is on Substance assuming that a component that extends JTableHeader will have the UI delegate that extends SubstanceTableHeaderUI (running under Substance). The second is on Substance assuming that JTableHeader always has the matching JTable (that is, getTable() always returns non-null value). Apparently, both these assumptions break with the specific JIDE component.

You can send the stack traces of the exceptions (not the screenshots), preferrably to the project forums. Sometimes, i will need to see a reproducible scenario which might be problematic with commercial JIDE components. If i can fix the exception without a sample app, i will do so only on the 5.0dev branch - since this is happening on a third-party component suite. If i can't fix the exception without a sample app, we'll need to find a way to have this reproduced on my machine without me paying for the license. I will be extremely reluctant to accept code changes without seeing a specific exception and it being fixed on my dev environment.

In this specific case, this may or may not be addressed by writing custom UI delegate for that specific component. Without access to the source code of that specific component (and i doubt that JIDE gives you that for their commercial components), i'm not going to do that - and you might find it difficult as well. You can see the sources for existing Substance plugins for SwingX and Flamingo to understand how it is done. I can not provide a comprehensive tutorial on writing a custom look-and-feel / UI delegates, but i'm more than willing to address any Substance-specific questions.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, June 16, 2008 10:50:16 PM
Subject: Re: Groupable Table Header under Substance

Hi Kirill,

Unfortunately, I did not have a chance to follow your recommendations with column groups -- still on the TODO list. However, recently I've started using JIDE Grids that provide column group feature, and the JideTable emitted exactly the same problem as was originaly raised -- ClassCastException (pls refer JideTable-substance-issue.png). This was with Substance 4.3.

I have tried using JideTable with substance 5.0 (14th of June snapshot) and the ClassCastException did not show up. However, when I try to change row selection an NPE gets thrown (pls refer JideTable-substance-selection-issue.png).

Could you pls provide some recommndations as to what would be the best appraoch of tackling these issues. What needs to be done to provide Substance support for JIDE components? I would be happy to attemt the development of substabce-jide plugin at least on per component basis. Where would I start especially in light that I do not have much exposure to LaF development.

Appreciate your help,
01es

2008/5/15 Oles Hodych <oles.hodych@...>:
Thanx a lot Kirill,

I will provide the feedback as soon as I get some results.

Regards,
01es

2008/5/15 Kirill Grouchnikov <kirillcool@...>:

Hi,

Attached please find the following files to have you started:

1. The plugin XML descriptor. This goes into META-INF folder of your plugin
2. The plugin class itself. Populates the UIDefaults table with the class name of the UI delegate
3. The UI delegate itself. Right now it only paints the background

This should have you started, and the next step for you would be to look at the sources of SubstanceTableHeaderUI and SubstanceDefaultTableHeaderCellRenderer to see how they paint the grid and provide the rollover animation effects.

Note that you'll need the latest 5.0dev version of Substance core library that provides a workaround for the ClassCastException.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Tuesday, May 13, 2008 12:32:54 AM
Subject: Re: Groupable Table Header under Substance

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)
    at java.awt.Container.doLayout(Container.java:1421)
    at java.awt.Container.validateTree(Container.java:1519)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validateTree(Container.java:1526)
    at java.awt.Container.validate(Container.java:1491)
    at java.awt.Window.show(Window.java:820)
    at java.awt.Component.show(Component.java:1419)
    at java.awt.Component.setVisible(Component.java:1372)
    at java.awt.Window.setVisible(Window.java:801)
    at org.jdesktop.swingx.ColumnGroupDemo.main(ColumnGroupDemo.java:133)
 
Is your custom table header renderer extending the SubstanceDefaultTableHeaderCellRenderer class?


No. As you have already recommended, I should probably have a look at the substance-swingx implementation to understand the role of SubstanceDefaultTableHeaderCell
Rendere.

In order to make our discussion more effective, I have attached the source of the Eclipse/M2 project, which I'm using for this spike. I would really appreciate if you get a chance to have a look at it.

Thanx a lot,
01es
 
These two together are responsible for painting the correct gradients under the header cells.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, May 12, 2008 11:39:06 PM
Subject: Groupable Table Header under Substance

Kirill,

As has been recommended, I have registered at the Substance user mailing list to continue the discussion (http://forums.java.net/jive/thread.jspa?messageID=273961&#273961).

Pls find two screeshots attached as requested. Highly appreciate any help on this one.

Thanx,
01es
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Groupable Table Header under Substance

by Oles Hodych :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kirill,

Thanx for a very detailed explanation of the problem. Indeed, it is obviously the need for the JIDE team (or any component vendor for that matter) to want to provide Substabce support, and to cooperate closely with you on this matter. There are quite a few requests on the JIDE forum about Substance support, but my understanding is that JIDE Soft is not currently interested in supporting any LnF other than standard. Hopefully, when Substace becomes even more popular third party component vendors will show more care. As a JIDE Soft customer  I will definitely raise the need for Substabce support.

Thanx again,
01es

2008/6/17 Kirill Grouchnikov <kirillcool@...>:
Hi,

The development of Substance plugin for JIDE open-source components is a long term goal, but it is currently of a lower priority than my other projects. The amount of interest in this project has been minimal so far (i can count them on one hand), and nobody followed through (that i know about) on their intent to investigate this manner further. I do understand that i am in the best position to provide this plugin, but it is all matter of resources and prioritization on my side.

The exceptions that you're seeing in Substance-JIDE combination are due to two things. JIDE tries to be clever and reuse as much of the functionality as possible from core components to be available under different LAFs. Substance tries to be clever and push the envelop of Swing applications to animations, skinning, decoration etc. In doing so, both libraries make assumptions, some of which break when the two are used together.

Specifically for these two stack traces. The first is on Substance assuming that a component that extends JTableHeader will have the UI delegate that extends SubstanceTableHeaderUI (running under Substance). The second is on Substance assuming that JTableHeader always has the matching JTable (that is, getTable() always returns non-null value). Apparently, both these assumptions break with the specific JIDE component.

You can send the stack traces of the exceptions (not the screenshots), preferrably to the project forums. Sometimes, i will need to see a reproducible scenario which might be problematic with commercial JIDE components. If i can fix the exception without a sample app, i will do so only on the 5.0dev branch - since this is happening on a third-party component suite. If i can't fix the exception without a sample app, we'll need to find a way to have this reproduced on my machine without me paying for the license. I will be extremely reluctant to accept code changes without seeing a specific exception and it being fixed on my dev environment.

In this specific case, this may or may not be addressed by writing custom UI delegate for that specific component. Without access to the source code of that specific component (and i doubt that JIDE gives you that for their commercial components), i'm not going to do that - and you might find it difficult as well. You can see the sources for existing Substance plugins for SwingX and Flamingo to understand how it is done. I can not provide a comprehensive tutorial on writing a custom look-and-feel / UI delegates, but i'm more than willing to address any Substance-specific questions.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Monday, June 16, 2008 10:50:16 PM
Subject: Re: Groupable Table Header under Substance

Hi Kirill,

Unfortunately, I did not have a chance to follow your recommendations with column groups -- still on the TODO list. However, recently I've started using JIDE Grids that provide column group feature, and the JideTable emitted exactly the same problem as was originaly raised -- ClassCastException (pls refer JideTable-substance-issue.png). This was with Substance 4.3.

I have tried using JideTable with substance 5.0 (14th of June snapshot) and the ClassCastException did not show up. However, when I try to change row selection an NPE gets thrown (pls refer JideTable-substance-selection-issue.png).

Could you pls provide some recommndations as to what would be the best appraoch of tackling these issues. What needs to be done to provide Substance support for JIDE components? I would be happy to attemt the development of substabce-jide plugin at least on per component basis. Where would I start especially in light that I do not have much exposure to LaF development.

Appreciate your help,
01es

2008/5/15 Oles Hodych <oles.hodych@...>:
Thanx a lot Kirill,

I will provide the feedback as soon as I get some results.

Regards,
01es

2008/5/15 Kirill Grouchnikov <kirillcool@...>:

Hi,

Attached please find the following files to have you started:

1. The plugin XML descriptor. This goes into META-INF folder of your plugin
2. The plugin class itself. Populates the UIDefaults table with the class name of the UI delegate
3. The UI delegate itself. Right now it only paints the background

This should have you started, and the next step for you would be to look at the sources of SubstanceTableHeaderUI and SubstanceDefaultTableHeaderCellRenderer to see how they paint the grid and provide the rollover animation effects.

Note that you'll need the latest 5.0dev version of Substance core library that provides a workaround for the ClassCastException.

Thanks
Kirill

----- Original Message ----
From: Oles Hodych <oles.hodych@...>
To: users@...
Sent: Tuesday, May 13, 2008 12:32:54 AM
Subject: Re: Groupable Table Header under Substance

Kirill,


Is your custom UI delegate extending the SubstanceTableHeaderUI class?


No, the custom UI delegate extends TableHeaderUI and does not have SubstanceTableHeaderUI in its hierarchy, and thus the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI cannot be cast to org.jvnet.substance.SubstanceTableHeaderUI
at org.jvnet.substance.SubstanceScrollPaneUI.installTableHeaderCornerFiller(SubstanceScrollPaneUI.java:748)
at org.jvnet.substance.SubstanceScrollPaneUI$2$2.run(SubstanceScrollPaneUI.java:227)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


The org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI is that custom delegate.

I have tried to derive BasicGroupableTableHeaderUI from SubstanceTableHeaderUI (the paint method had to be overriden with no call to super). This resulted in failure to locate TableHeaderUI under the default LaF, and in the following exception under Substabce:

Exception in thread "main" java.lang.NullPointerException
    at org.jvnet.substance.SubstanceTableHeaderUI.getColumnState(SubstanceTableHeaderUI.java:864)
    at org.jvnet.substance.SubstanceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(SubstanceDefaultTableHeaderCellRenderer.java:129)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.configureDelegate(ColumnHeaderRenderer.java:236)
    at org.jdesktop.swingx.table.ColumnHeaderRenderer.getTableCellRendererComponent(ColumnHeaderRenderer.java:183)
    at org.jdesktop.swingx.table.ColumnGroup.getSize(ColumnGroup.java:169)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getHeaderHeight(BasicGroupableTableHeaderUI.java:240)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.createHeaderSize(BasicGroupableTableHeaderUI.java:355)
    at org.jdesktop.swingx.plaf.basic.BasicGroupableTableHeaderUI.getPreferredSize(BasicGroupableTableHeaderUI.java:274)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at org.jdesktop.swingx.JXTableHeader.getPreferredSize(JXTableHeader.java:213)
    at javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:78)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:702)
    at org.jvnet.substance.SubstanceScrollPaneUI$AdjustedLayout.layoutContainer(SubstanceScrollPaneUI.java:551)
    at java.awt.Container.layout(Container.java:1432)