Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate SVG Java code from demo application fails #61

Open
softwaremagico opened this issue Mar 25, 2024 · 2 comments
Open

Generate SVG Java code from demo application fails #61

softwaremagico opened this issue Mar 25, 2024 · 2 comments

Comments

@softwaremagico
Copy link

Only playing around with the demo application, but I have notice that if you choose the option "Generate Code -> Copy SVG Java Code" launch a:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: expected type but was class javax.xml.transform.TransformerFactory
        at com.squareup.javapoet.CodeBlock$Builder.argToType(CodeBlock.java:360)
        at com.squareup.javapoet.CodeBlock$Builder.addArgument(CodeBlock.java:330)
        at com.squareup.javapoet.CodeBlock$Builder.add(CodeBlock.java:292)
        at com.squareup.javapoet.CodeBlock$Builder.addStatement(CodeBlock.java:402)
        at com.squareup.javapoet.MethodSpec$Builder.addStatement(MethodSpec.java:525)
        at io.github.simonscholz.service.codegen.SvgGraphicsCodeGenerator.generateJavaCode(SvgGraphicsCodeGenerator.kt:270)
        at io.github.simonscholz.service.CodeGeneratorService.generateSvgImageJavaCode(CodeGeneratorService.kt:19)
        at io.github.simonscholz.ui.FileUI.copySvgJavaCodeToClipboard(FileUI.kt:47)
        at io.github.simonscholz.ui.MainMenu.createGenerateCodeMenu$lambda$1(MainMenu.kt:64)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at java.desktop/javax.swing.AbstractButton.doClick(Unknown Source)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
        at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
        at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.desktop/java.awt.Component.processEvent(Unknown Source)
        at java.desktop/java.awt.Container.processEvent(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
        at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

I have not tested this functionality from the source code directly, only running the demo application.

@SimonScholz
Copy link
Owner

Hi @softwaremagico,

thanks for testing the application. I hope you like it.
The SVG feature is quite new and not really released yet.
Anyhow I´ve fixed the Exception now and at least it should now create valid java code without any exceptions.
But I need to test this further and have to think through how I´d want to integrate the new SVG functionalities into the application.

@softwaremagico
Copy link
Author

It is fine. I am not so interested in this featured, and this issue is more a "let you know" rather that I need it. In any case, I am glad you have fixed it. Do not worry, take your time and when the next release will be ready, I will update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants