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: 6
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4274 times and has 5 replies Next Thread
Cardinal
Member




Joined: Jul 4, 2011
Post Count: 22
Status: Offline
Reply to this Post  Reply with Quote 
Access the PlanController

Hello,

Can plugin developers access the PlanController? It would be useful for example to know what state the Controller is in.
[Sep 12, 2011, 9:49:24 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
dlarroumets
Newbie




Joined: Nov 3, 2009
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
Re: Access the PlanController

It is a very good idea isn't it ?
biggrin

In deed, we make a pluggin that extend wall creation. But we have to click first on wall creation and after on the pluggin. It is not very intuitive for users.

This access could be usefull to initiliaze the controller and so have different pluggins.
[Sep 12, 2011, 3:18:49 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: 9427
Status: Offline
Reply to this Post  Reply with Quote 
Re: Access the PlanController

I know it could be useful. It would let the plug-in access the views too.
If it's not accessible, it's because it will oblige me to maintain for ever the backward compatibility of com.eteks.sweethome3d.viewcontroller API. Even if I didn't break it in the past, only the API of com.eteks.sweethome3d.model and com.eteks.sweethome3d.plugin packages are in this case at this moment, because they are the only two packages accessible from a plug-in.
If I change it, I'll add a getHomeController to Plugin class, and from the HomeController instance it will return, you'll be able to access to PlanController instance.
I'll also would like to reduce PlanController class size by extracting all ControllerState classes to a com.eteks.sweethome3d.viewcontroller.plan new package, but don't want to introduce a bidirectional dependency between com.eteks.sweethome3d.viewcontroller and com.eteks.sweethome3d.viewcontroller.plan packages. I could make PlanController class and all its get...State() methods abstract, implement them in a new com.eteks.sweethome3d.viewcontroller.plan.DefaultPlanController subclass and instantiate DefaultPlanController class in com.eteks.sweethome3d assembly package.
That should make it, don't you think?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Sep 12, 2011, 8:45:07 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
dlarroumets
Newbie




Joined: Nov 3, 2009
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
Re: Access the PlanController

This seems like a good solution, and more "opened" than we need.

Is it too too accessible or not, I do not know... We have not the knowledge as well as you, to be sure of that. The only risk as you mentioned is the backward compatibility in the future.

If you want we can test it with our development before a public release...
[Sep 13, 2011, 11:09:43 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: 9427
Status: Offline
Reply to this Post  Reply with Quote 
Re: Access the PlanController

Hi,

I just committed some changes in source code to grant access to controllers from plugins.
Sorry if I didn't include this change in version 3.4, but once I discovered that it required to change some dependency between com.eteks.sweethome3d.viewcontroller and com.eteks.sweethome3d.plugin packages, I was reluctant to do it, because it would break code in some versions derived from Sweet Home 3D (but not existing plugins). I finally made the changes today, so please test it when you can.

To all developers who created a derived version of Sweet Home 3D:
if your program uses directly com.eteks.sweethome3d.viewcontroller.HomeController class (by subclassing it or instantiating it), you should just replace it by com.eteks.sweethome3d.plugin.HomePluginController class. Sorry for any problem it might cause.

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
----------------------------------------
[Edit 2 times, last edit by Puybaret at Jan 30, 2012, 7:15:29 AM]
[Jan 5, 2012, 11:14:39 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: 9427
Status: Offline
Reply to this Post  Reply with Quote 
Re: Access the PlanController

The access to controllers is available from version 3.5 through the getHomeController method added to com.eteks.sweethome3d.plugin.Plugin class.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[May 13, 2012, 8:19:28 PM] 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 2024 Space Mushrooms - All rights reserved