Menu

#62 Lot of content tab and little space available => exception

open
None
5
2008-12-07
2008-12-02
Anonymous
No

First my platform :

- linux ubuntu 8.04
- java 1.5_15
- mydoggy 1.4.2

When I launch the attached test case the frame display correctly the 8 content added. Now If I play around with the content. Selecting the second one and dropping it on the first one, the display then becomes mangled (see shot 1) and then if I try to move again one of the content I get a java exception (see below)

I don't know if I am doing something wrong (too many content ?) but it seems that in some cases myDoggy does have some issues handling content.

Thanks for any help on this, and for myDoggy in general

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (1275) and height (-13) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:314)
at org.noos.xing.mydoggy.plaf.ui.cmp.MultiSplitTabbedContentContainer$TabbedDragGesture.dragGestureRecognized(MultiSplitTabbedContentContainer.java:190)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGestureRecognizer.java:339)
at sun.awt.X11.XMouseDragGestureRecognizer.mouseDragged(XMouseDragGestureRecognizer.java:202)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:262)
at java.awt.Component.processMouseMotionEvent(Component.java:5565)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3153)
at java.awt.Component.processEvent(Component.java:5286)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Discussion

  • Nobody/Anonymous

     
  • igr cstang

    igr cstang - 2008-12-02

    I post a follow-up to myself. This is not the same issue, but somewhat related

    if my test case class is changed so that method buildToolWindow is like this :

    public MyDoggyToolWindowManager buildToolWindow() {
    this.toolW= new MyDoggyToolWindowManager();
    ContentManager contentManager = toolW.getContentManager();

    MyDoggyMultiSplitContentManagerUI contentUI=new MyDoggyMultiSplitContentManagerUI();
    this.toolW.getContentManager().setContentManagerUI(contentUI);

    for (int i=0;i<18;i++) {
    JPanel pane = new JPanel();
    // pane.setPreferredSize(new Dimension(400,400));
    Content cont = contentManager.addContent("content"+i, "content"+i, null, pane);
    }

    return this.toolW;
    }

    the idea is adding 18 content. Then I get another exception :

    Exception in thread "AWT-EventQueue-0" org.noos.xing.mydoggy.plaf.ui.cmp.MultiSplitLayout$InvalidLayoutException: Split children's total weight > 1.0
    at org.noos.xing.mydoggy.plaf.ui.cmp.MultiSplitLayout.throwInvalidLayout(MultiSplitLayout.java:822)
    at org.noos.xing.mydoggy.plaf.ui.cmp.MultiSplitLayout.checkLayout(MultiSplitLayout.java:850)
    at org.noos.xing.mydoggy.plaf.ui.cmp.MultiSplitLayout.layoutContainer(MultiSplitLayout.java:861)

    looking at problem with a debugger I think the issue here is rounding. I keep adding content to the same children and I can see their that each time the weight attributed to each content is basically 1/(number of Content) but with 18 content and some rounding occurring, at the end, when the systems checks for weight > 1.0 it triggers the exception because the weight is equal to 1.0000000000000002.

    I know that adding 18 contents is maybe too much, but I think there should be a way to handle this more gracefully.

    Thanks

     
  • Angelo De Caro

    Angelo De Caro - 2008-12-07
    • assigned_to: nobody --> adecaro
     
Auth0 Logo