Resizing of frame causes exception

Hi,

using the glassfactory libraries, it is not possible to have a Frame with zero height. This error occurs if someone resizes the height e.g. of a lower frame of in a vertical split to zero by moving the split down.

Andy

java.lang.IllegalArgumentException: Width (317) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.(BufferedImage.java:340)
at kux.glass.CGlassFactory.RenderBufferedImage(Unknown Source)
at glass.eclipse.theme.CGlassStripPainter.paintBackground(Unknown Source)
at glass.eclipse.theme.CGlassStripPainter.paintHorizontal(Unknown Source)
at glass.eclipse.theme.CGlassStripPainter.paintBackground(Unknown Source)
at bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPaneContent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at bibliothek.extension.gui.dock.theme.eclipse.displayer.NoTitleDisplayer.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Hm, to my defense: that is not my code throwing an exception :slight_smile: I’ll fix the problem next weekend.

Thanks for the bug report.

Hi,

i’ll check and fix that problem at the weekend. Beni, I will take care of this.
Doesn’t thought that there would be dockables with zero width/height, my fault :wink:

Hmm, I have to visit this forum more often :slight_smile:

Greetz,
Thomas

Hi Thomas. I already thought you had disappeared. In this case I’ll relax and do nothing :stuck_out_tongue:

Hi Beni,
no, I’m not disapeared :slight_smile: Just a lot to do at work ::pc

BTW, at work, we completely replaced our previous docking framework to DockingFrames :slight_smile:
It’s really a great framework.

Thomas

Hi Andy,
i’ve fixed this problem, you can download the fixed version from the code repository.

Something about the exception:
I’m using BufferedImages to draw the glass effect. But, a BufferedImage can’t have a
width or height of 0 pixels and would throw that exception if either the width or height
would be 0. Now, the glass effect gets only painted if width and height are not 0.

Greetz.
Thomas

Thanks for the fix.

Thanks a lot!

Andy