mickleness / pumpernickel

This Java project includes classes related to desktop applications, Swing, performance, image processing, data structures, and other misc topics.
https://mickleness.github.io/pumpernickel/
MIT License
66 stars 12 forks source link

Demo App throws exceptions #83

Closed eGit closed 1 year ago

eGit commented 2 years ago

https://github.com/mickleness/pumpernickel/raw/master/release/jars/Pumpernickel.jar

Tried it with JDK8, 11, and GraalVM22

SessionLog initialized using: /home/nemo/com.pump.showcase Logs/2022.04.14 at 13.02.42 CEST.txt DesktopApplication installing com.pump.showcase 1.03-beta OS = Linux (5.4.0-107-generic), amd64 Java Version = 11.0.14

Initialized temp directory as /tmp/com.pump.showcase+TempFileMgr/119545962 BugReporter initialized using: /home/nemo/com.pump.showcase/Common/Incidents java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:83) at com.pump.showcase.app.ShowcaseDemoPanel.(ShowcaseDemoPanel.java:86) at com.pump.showcase.app.PumpernickelShowcaseApp$5.propertyChange(PumpernickelShowcaseApp.java:410) at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341) at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:334) at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266) at java.desktop/java.awt.Component.firePropertyChange(Component.java:8731) at java.desktop/javax.swing.JComponent.putClientProperty(JComponent.java:4117) at com.pump.showcase.app.PumpernickelShowcaseApp.setSelectedDemo(PumpernickelShowcaseApp.java:597) at com.pump.showcase.app.HeaderRow$6.actionPerformed(HeaderRow.java:442) at com.pump.showcase.app.HeaderRow.(HeaderRow.java:449) at com.pump.showcase.app.PumpernickelShowcaseApp.(PumpernickelShowcaseApp.java:424) at com.pump.showcase.app.PumpernickelShowcaseApp$4.run(PumpernickelShowcaseApp.java:107) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:79) ... 25 more Caused by: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at com.pump.graphics.Graphics2DContext.setColor(Graphics2DContext.java:378) at com.pump.graphics.vector.VectorGraphics2D.setColor(VectorGraphics2D.java:258) at java.desktop/javax.swing.plaf.basic.BasicSliderUI.paintThumb(BasicSliderUI.java:1500) at com.pump.swing.popup.SliderThumbPopupTarget.getLocalThumbScreenRect(SliderThumbPopupTarget.java:52) at com.pump.swing.popup.SliderThumbPopupTarget.(SliderThumbPopupTarget.java:35) at com.pump.swing.popover.JPopover.add(JPopover.java:198) at com.pump.swing.popover.JPopover.add(JPopover.java:166) at com.pump.showcase.demo.AlphaCompositeDemo.(AlphaCompositeDemo.java:87) ... 30 more

java.lang.reflect.InvocationTargetException at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367) at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342) at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) at com.pump.showcase.app.DemoLoadThread.run(DemoLoadThread.java:59) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:83) at com.pump.showcase.app.DemoLoadThread$1.run(DemoLoadThread.java:61) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117) at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233) at java.desktop/java.awt.Dialog.show(Dialog.java:1070) at java.desktop/java.awt.Component.show(Component.java:1716) at java.desktop/java.awt.Component.setVisible(Component.java:1663) at java.desktop/java.awt.Window.setVisible(Window.java:1031) at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1005) at com.pump.desktop.error.ErrorDialogThrowableHandler$1.run(ErrorDialogThrowableHandler.java:46) at com.pump.desktop.error.ErrorDialogThrowableHandler.processThrowable(ErrorDialogThrowableHandler.java:58) at com.pump.desktop.error.ErrorManager.process(ErrorManager.java:89) at com.pump.desktop.error.ErrorManager.process(ErrorManager.java:74) at com.pump.desktop.error.ErrorManager$1.uncaughtException(ErrorManager.java:62) at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1055) at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1050) at java.desktop/java.awt.EventDispatchThread.processException(EventDispatchThread.java:222) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:214) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:79) ... 35 more Caused by: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at com.pump.graphics.Graphics2DContext.setColor(Graphics2DContext.java:378) at com.pump.graphics.vector.VectorGraphics2D.setColor(VectorGraphics2D.java:258) at java.desktop/javax.swing.plaf.basic.BasicSliderUI.paintThumb(BasicSliderUI.java:1500) at com.pump.swing.popup.SliderThumbPopupTarget.getLocalThumbScreenRect(SliderThumbPopupTarget.java:52) at com.pump.swing.popup.SliderThumbPopupTarget.(SliderThumbPopupTarget.java:35) at com.pump.swing.popover.JPopover.add(JPopover.java:198) at com.pump.swing.popover.JPopover.add(JPopover.java:166) at com.pump.showcase.demo.AlphaCompositeDemo.(AlphaCompositeDemo.java:87) ... 40 more

eGit commented 2 years ago

The demo tries to create an Instance of AlphaCompositeDemo and fails. This is the main culprit:

Caused by: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at com.pump.graphics.Graphics2DContext.setColor(Graphics2DContext.java:378) at com.pump.graphics.vector.VectorGraphics2D.setColor(VectorGraphics2D.java:258) at java.desktop/javax.swing.plaf.basic.BasicSliderUI.paintThumb(BasicSliderUI.java:1500) at com.pump.swing.popup.SliderThumbPopupTarget.getLocalThumbScreenRect(SliderThumbPopupTarget.java:52) at com.pump.swing.popup.SliderThumbPopupTarget.<init>(SliderThumbPopupTarget.java:35) at com.pump.swing.popover.JPopover.add(JPopover.java:198) at com.pump.swing.popover.JPopover.add(JPopover.java:166) at com.pump.showcase.demo.AlphaCompositeDemo.<init>(AlphaCompositeDemo.java:87)

mickleness commented 2 years ago

Thanks; I'll have a look sometime in the next 24 hrs.

mickleness commented 2 years ago

@eGit : I just pushed a new https://github.com/mickleness/pumpernickel/raw/master/release/jars/Pumpernickel.jar that should resolve the NPE. Unfortunately I don't have a Linux machine to test against.

I appreciate your letting me know about this issue. If you have a chance please let me know if this resolves the issue.

(Otherwise... someday I may set up a Linux machine again. Not sure when. :) )

eGit commented 2 years ago

@eGit : I just pushed a new https://github.com/mickleness/pumpernickel/raw/master/release/jars/Pumpernickel.jar that should resolve the NPE. Unfortunately I don't have a Linux machine to test against.

I appreciate your letting me know about this issue. If you have a chance please let me know if this resolves the issue.

(Otherwise... someday I may set up a Linux machine again. Not sure when. :) )

Thanks. Now it starts up. It still throws some exceptions because of missing resources. Maybe some Demos will not work properly.

You could set up Linux in a VM - you can download images and it works in 5 min. But usually there is ZERO difference between Windows and Linux Java. OSX is rather the odd one out. Also there are over a dozen JREs out now from different Vendors. They are probably more different then the same Vender on Windows vs. Linux.

`SessionLog initialized using: /home/nemo/com.pump.showcase Logs/2022.04.14 at 21.30.54 CEST.txt DesktopApplication installing com.pump.showcase 1.03-beta OS = Linux (5.4.0-107-generic), amd64 Java Version = 11.0.14

Initialized temp directory as /tmp/com.pump.showcase+TempFileMgr/104754696 BugReporter initialized using: /home/nemo/com.pump.showcase/Common/Incidents skipping "LIST" of size 38 skipping "id3 " of size 138 skipping "LIST" of size 38 skipping "id3 " of size 138 Startup took 1,146 ms java.io.FileNotFoundException: https://raw.githubusercontent.com/mickleness/pumpernickel/master/src/main/resources/com/pump/showcase/Ludic.wav at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1935) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1525) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250) at java.base/java.net.URL.openStream(URL.java:1165) at com.pump.plaf.WaveformSliderUI.createWaveform(WaveformSliderUI.java:55) at com.pump.plaf.WaveformSliderUI.(WaveformSliderUI.java:196) at com.pump.plaf.BasicAudioPlayerUI$Fields$5.run(BasicAudioPlayerUI.java:176) java.io.FileNotFoundException: https://raw.githubusercontent.com/mickleness/pumpernickel/master/src/main/resources/com/pump/showcase/Ludic.wav at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1935) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1525) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250) at java.base/java.net.URL.openStream(URL.java:1165) at com.pump.plaf.WaveformSliderUI.createWaveform(WaveformSliderUI.java:55) at com.pump.plaf.WaveformSliderUI.(WaveformSliderUI.java:196) at com.pump.plaf.BasicAudioPlayerUI$Fields$5.run(BasicAudioPlayerUI.java:176) java.io.FileNotFoundException: https://raw.githubusercontent.com/mickleness/pumpernickel/master/src/main/resources/com/pump/showcase/Ludic.wav at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1935) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1525) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250) at java.base/java.net.URL.openStream(URL.java:1165) at com.pump.plaf.WaveformSliderUI.createWaveform(WaveformSliderUI.java:55) at com.pump.plaf.WaveformSliderUI.(WaveformSliderUI.java:196) at com.pump.plaf.BasicAudioPlayerUI$Fields$5.run(BasicAudioPlayerUI.java:176) java.io.FileNotFoundException: https://raw.githubusercontent.com/mickleness/pumpernickel/master/src/main/resources/com/pump/showcase/Ludic.wav at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1935) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1525) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250) at java.base/java.net.URL.openStream(URL.java:1165) at com.pump.plaf.WaveformSliderUI.createWaveform(WaveformSliderUI.java:55) at com.pump.plaf.WaveformSliderUI.(WaveformSliderUI.java:196) at com.pump.plaf.BasicAudioPlayerUI$Fields$5.run(BasicAudioPlayerUI.java:176) java.lang.ClassCastException: class com.sun.java.swing.plaf.gtk.GTKLookAndFeel cannot be cast to class javax.swing.plaf.nimbus.NimbusLookAndFeel (com.sun.java.swing.plaf.gtk.GTKLookAndFeel and javax.swing.plaf.nimbus.NimbusLookAndFeel are in module java.desktop of loader 'bootstrap') at java.desktop/javax.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:256) at java.desktop/javax.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:820) at java.desktop/javax.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:493) at java.desktop/javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:915) at java.desktop/javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:270) at java.desktop/javax.swing.plaf.synth.SynthButtonUI.updateStyle(SynthButtonUI.java:79) at java.desktop/javax.swing.plaf.synth.SynthButtonUI.installDefaults(SynthButtonUI.java:62) at java.desktop/javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:110) at java.desktop/javax.swing.JComponent.setUI(JComponent.java:685) at java.desktop/javax.swing.AbstractButton.setUI(AbstractButton.java:1753) at java.desktop/javax.swing.JButton.updateUI(JButton.java:141) at java.desktop/javax.swing.AbstractButton.init(AbstractButton.java:2136) at java.desktop/javax.swing.JButton.(JButton.java:131) at java.desktop/javax.swing.JButton.(JButton.java:104) at com.pump.showcase.demo.JButtonDemo.(JButtonDemo.java:161) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:79) at com.pump.showcase.app.DemoLoadThread$1.run(DemoLoadThread.java:61) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) java.lang.reflect.InvocationTargetException at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367) at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342) at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) at com.pump.showcase.app.DemoLoadThread.run(DemoLoadThread.java:59) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:83) at com.pump.showcase.app.DemoLoadThread$1.run(DemoLoadThread.java:61) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:79) ... 14 more Caused by: java.lang.RuntimeException: This ButtonUI is not compatible with this mixed state renderer. javax.swing.plaf.synth.SynthCheckBoxUI at com.pump.plaf.button.MixedCheckBoxState.register(MixedCheckBoxState.java:171) at com.pump.plaf.button.MixedCheckBoxState.setMixed(MixedCheckBoxState.java:243) at com.pump.plaf.button.MixedCheckBoxButtonGroup$2.itemStateChanged(MixedCheckBoxButtonGroup.java:74) at com.pump.plaf.button.MixedCheckBoxButtonGroup.(MixedCheckBoxButtonGroup.java:100) at com.pump.showcase.demo.MixedCheckBoxStateDemo.(MixedCheckBoxStateDemo.java:58) ... 19 more java.lang.reflect.InvocationTargetException at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367) at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342) at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) at com.pump.showcase.app.DemoLoadThread.run(DemoLoadThread.java:59) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:83) at com.pump.showcase.app.DemoLoadThread$1.run(DemoLoadThread.java:61) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.pump.showcase.app.ShowcaseDemoInfo.getDemo(ShowcaseDemoInfo.java:79) ... 14 more Caused by: java.lang.NullPointerException at com.pump.showcase.demo.TextEffectDemo.getEffectFont(TextEffectDemo.java:315) at com.pump.showcase.demo.TextEffectDemo.refreshControls(TextEffectDemo.java:239) at com.pump.showcase.demo.TextEffectDemo.access$0(TextEffectDemo.java:234) at com.pump.showcase.demo.TextEffectDemo$2.actionPerformed(TextEffectDemo.java:123) at java.desktop/javax.swing.JComboBox.fireActionEvent(JComboBox.java:1264) at java.desktop/javax.swing.JComboBox.setSelectedItem(JComboBox.java:589) at java.desktop/javax.swing.JComboBox.setSelectedIndex(JComboBox.java:620) at com.pump.swing.FontComboBox.selectFont(FontComboBox.java:112) at com.pump.showcase.demo.TextEffectDemo.(TextEffectDemo.java:217) ... 19 more `

mickleness commented 2 years ago

Hmmm. The setColor(..) issue was trivial, but these may not be. I'll look at them... sometime in coming days.

eGit commented 2 years ago

No rush. It seems it wants to fetch the files (.wav) from an URL. I thought they are part of the .jar?! In the app itself I can play back those .wav files.

Btw, I saw you also had a Thumbnail-Demo. Is there a quick thumbnailer on Java by now?

To get a thumbnail you need to decode the full picture and then scale it to thumbnail size. To overcome this obstacle the jpeg-format allows you to get a picture 1/2, 1/4, 1/8 or even 1/16 in size of the original picture. E.g. for a factor 1/8, a 5000x5000 picture will be returned as a 625x625 picture. Java does NOT offer this functionality (C++ libs like ijg do).

For jpeg thumbnails you just need the DC components and skip all the AC components. This means you only have to decrypt the DC component. You still have to do the full Huffman decompression, but still it saves a hell lot of time, disk I/O, memory and exceptions.

There are many implementations of this in C/C++. Are there any in Java? Could be a game-changer for apps that generate a lot of thumbnails.

mickleness commented 2 years ago

To my knowledge what you're describing hasn't really been addressed in Java yet. (But I have two small kids, and most of my "free time" Java has been focused here in the last 6+ months. Which is to say: there's always a lot I might be unaware of.)

But in the Pumpernickel demo regarding scaling jpgs:

  1. The "ThumbnailGenerator" demo includes the "JPEGMetaDataThumbnailGenerator" that extracts embedded thumbnails. (Which ImageIO can support, but not as part of the default Java install.)

  2. The "Scaling" demo offers a faster/lighter (although less mathematically pure) conversion from a large to a small image. It has the potential to scale the image as it is being read -- so the whole image is never loaded into memory.

  3. Also I wrote a couple of Mac-specific ThumbnailGenerators. I think (?) one uses a command-line tool, and another uses some Apple-specific classes. I haven't invested in similar Windows-y or Linux-y options, but they might not be too hard.

eGit commented 2 years ago

No worries. I was hoping you know about an already existing Java implementation. Facebook once upon a time was running a Java applet for Image upload. It created Thumbnails amazingly fast without accessing the HDD a lot. And they didn't have any native parts - I checked. This was pure Java.

Anyhow, if you run into a good implementation of what I described, please let me know.

mickleness commented 2 years ago

Is there a command-line tool for Mac or Windows I should be comparing performance against?

eGit commented 2 years ago

https://pillow.readthedocs.io/en/stable/reference/Image.html

If they haven't removed it, Python PIL (Pillow) supports this. I think last time I used it.

mickleness commented 1 year ago

Closing this ticket.

I also made reference to Pillow experiments here: https://github.com/mickleness/pumpernickel/wiki/Thumbnails#discussion