Layout.add( new SeparatingMenuPiece( new SingleCDockableListMenuPiece( co

Hi, loaded charts are added to the Window menu, –
layout.add( new SeparatingMenuPiece( new SingleCDockableListMenuPiece( dk.control ), true, false, true )).
“layout” is a new RootMenuPiece.

The below exception appears when a dockable chart is deleted and a new chart is loaded when more than two charts are added. Printed the indexes in RootMenuPiece.java:103 - remove(…), but its called more than I expected.

This is how the chart is deleted, control.removeSingleDockable(dockable.getUniqueId()).
It doesn’t consistently generate an exception, I can’t find a pattern.

Exception in thread “VisualATS_DF1.1” java.lang.IllegalArgumentException: index greater than the number of items.
at javax.swing.JPopupMenu.remove(JPopupMenu.java:472)
at javax.swing.JMenu.remove(JMenu.java:831)
at bibliothek.gui.dock.facile.menu.RootMenuPiece$2.remove(RootMenuPiece.java:103)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.facile.menu.NodeMenuPiece.access$300(NodeMenuPiece.java:40)
at bibliothek.gui.dock.facile.menu.NodeMenuPiece$Listener.remove(NodeMenuPiece.java:184)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.support.menu.SeparatingMenuPiece$Listener.remove(SeparatingMenuPiece.java:345)
at bibliothek.gui.dock.support.menu.MenuPiece.fireRemove(MenuPiece.java:86)
at bibliothek.gui.dock.support.menu.BaseMenuPiece.removeAll(BaseMenuPiece.java:122)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece.order(CloseableDockableMenuPiece.java:135)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece.access$100(CloseableDockableMenuPiece.java:54)
at bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece$2.run(CloseableDockableMenuPiece.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

I’ll have a look into this issue maybe tomorrow (no promises).

But if the behavior is not consistent, then usually it is something related to multi-threading. Make sure you call all methods of the framework only within the EDT (EventDispatchThread).

Thanks Beni!
The layout menu is added in the below thread, also delete chart/dockable , add new chart/dockable is in that thread.
No other thread access add chart nor delete chart, but all new chart/dockable run in a new thread. The exception is only related to the
SingleCDockableListMenuPiece, and no exceptions occur without it. Removing it from the gui window menu eliminates the problem, no exceptions occur.

I have other methods for selecting a chart in a tool bar, so if it continues to be a problem I can remove that part of the layout menu.

public static void main(String s[]) {
SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            Thread.currentThread().setName("VisualATS");
            new DeskTop();
        }
    });

}

The bug is caused by the SeparatingMenuPiece. For a workaround you have to remove the SeparatingMenuPiece. I will fix this in the next version. Unfortunatelly my developer machine has some issue right now and I have first to reinstall Ubuntu, Eclipse, Java, etc… I hope to be able to work again on the weekend.

Confirmed! Sorry I didn’t try that myself, would have saved your time, little rusty I guess.

Ok, version 1.1.2p8e is online, download here. Let me know if that solves the issue you found (it did in my test).

[offtopic]Today I learned - even if you fu** up a dist-upgrade, reinstalling Ubuntu will not delete all your settings. :open_mouth: [/offtopic]

“Ubuntu will not delete all your settings.” lol, pure unadulterated luck - I’d say.

Yes 1.1.2p8e works perfectly thanks.

Except for the ClassNotFoundException in workarounds.Java7Workaround
points to .Workarounds.tryAddWorkaround(Workarounds.java:77)
Commented out // tryAddWorkaround( “bibliothek.util.workarounds.Java7Workaround” ); and no more issues.

[QUOTE=glikar]
Except for the ClassNotFoundException in workarounds.Java7Workaround
points to .Workarounds.tryAddWorkaround(Workarounds.java:77)
Commented out // tryAddWorkaround( “bibliothek.util.workarounds.Java7Workaround” ); and no more issues.[/QUOTE]
-_-

Thansk for the reply.
Are you using Java 7? That is a strange exception… and it did not happen with the old version?

Yes the latest /usr/lib/jvm/jdk1.7.0_25