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: 11
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5829 times and has 10 replies Next Thread
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Plugin Load

Hello everyone

In this way, I created an application window consisting of a window and texboxes.

I want to run it as a plugin on sweet home.

for example placing it in the tools menu.

Which codes should I add to which class?

*****
import javax.swing.JOptionPane;
import com.eteks.sweethome3d.plugin.Plugin;
import com.eteks.sweethome3d.plugin.PluginAction;



public Action() {
putPropertyValue(Property.NAME, "window-1");
putPropertyValue(Property.MENU, "Tools");

setEnabled(true);
}
****



[Aug 25, 2022, 6:37:33 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load


[Aug 25, 2022, 6:40:16 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 398
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load

Maybe you should first understand the workflow.

You have to create at least 2 classes:
- a class which extends Plugin;
- one or more classes which extend PluginAction. One for each menu entry or toolbar button.

The first class must implement the getActions method, which must return an array of instances of the second classes (one instance for each of them). Each of these instances will be rendered as a menu item or a toolbar button. These classes must implement the execute method which will be called whenever the user clicks on the corresponding menu item/toolbar button.
What to do in this method is up to you, you may open a window or shutdown the user's pc, it depends on what your plugin should do.

Read the developer's guide for further details.
[Aug 25, 2022, 9:58:40 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load

Now, by simplifying what you wrote, I think let's go straight to action.

What I want to do is for this form to work on sweet for now.

if you can tell me where to write the required code and in which class this will work... can you help me at this point?

I read the part you mentioned.

Thank you.
[Aug 25, 2022, 6:03:55 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: Plugin Load

You could try to modify the execute method in the Volume plug-in you succeeded to generate, but if you’re new to Java and don’t understand its statements, I fear you won’t go very far. What about learning more Java and Swing on your side first?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 25, 2022, 9:45:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load

Yes, you are right.

I'm beginner level. Now tell me, I have an idea about it.

If I send you my work, can you make the missing parts work in sweet home and send it to me?

this would be a start for me to learn java.

Thank you.
[Aug 26, 2022, 6:03:58 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: Plugin Load

Sorry, even if I teach Java from time to time, my support on this forum doesn’t consist of helping users learning a programming language, and certainly not programming for them.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 26, 2022, 8:16:56 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load

OK. Thank you
[Aug 26, 2022, 8:48: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 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 47
Status: Offline
Reply to this Post  Reply with Quote 
Re: Plugin Load

Yes. My first plugin is ready. it was nice.

Thanks to the helpful friends.




[Aug 29, 2022, 6:40:41 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: Plugin Load

Congratulations!
What does it do?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 29, 2022, 7:25:31 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ 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