Joined: Sep 15, 2014
Post Count: 2
Status:
Offline
Questions on Plugin Development
Hi,
I have encountered the following problems when developing my plugin: 1. I created a sh3p file successfully. After adding the plugin, the SweetHome3D application can be launched successfully by the command "java -jar SweetHome3D-4.4.jar". However, when I click "SweetHome3D.exe" to launch, the JAVA application hangs after showing the initial banner. What is the possible cause for that?
2. I want to create a plugin similar to the "Create Video" function. When I check the JAVA code, it seems that it requires the classes "home", "UserPreferences", "ViewFactory", "ContentManager" for the constructor of VideoController. In the plugin, I can get home and User Preferences but not for ViewFactory and ContentManger. What are the uses of the ViewFactory and ContentManager class? For a plugin, how to handle this case if we need to access the ViewFactory and ContentManager?
Would someone please help? Thank you very much in advance.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Questions on Plugin Development
when I click "SweetHome3D.exe" to launch, the JAVA application hangs after showing the initial banner. What is the possible cause for that?
Add some logs in the startup of your plug-in to check if it starts correctly or not.
I can get home and User Preferences but not for ViewFactory and ContentManger.
You can get ContentManger instance from HomeController one. For ViewFactory, create yourself an instance of SwingViewFactory if you need it. ContentManger is used to manage the user's choice of data (homes, images, 3D models,…) with file choosers for Sweet Home 3D desktop version, or from lists returned by the server / file choosers (depending on the content) for applet version. ViewFactory is use to create main window panes and modification dialog boxes of the program. It's the entry point for controllers classes to access user interface implementation. If a programmer wants to replace Swing by another toolkit (for example JavaFX or SWT/JFace), his main work would consist of implementing the methods of ViewFactory using that toolkit.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Sep 15, 2014
Post Count: 2
Status:
Offline
Re: Questions on Plugin Development
Hi, I have figured out my problem. I think it is caused by different version of JRE. I compiled my plugin by JAVA 7 and the default runtime is 5 I think... So that's why my plugin hangs at starting when clicking the exe while it works fine when I launch JAVA using my default JRE... Thank you for your help.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Questions on Plugin Development
Thanks for the information. I updated the plug-in developer's guide accordingly.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator