Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4524 times and has 3 replies Next Thread
ectw
Newbie




Joined: Sep 15, 2014
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Sep 15, 2014, 3:57:26 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Sep 16, 2014, 1:00:59 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
ectw
Newbie




Joined: Sep 15, 2014
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Sep 25, 2014, 4:30:31 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Questions on Plugin Development

Thanks for the information. I updated the plug-in developer's guide accordingly.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Sep 25, 2014, 8:43:38 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved