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: 8
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 7431 times and has 7 replies Next Thread
rohanbhanu
Newbie




Joined: May 31, 2013
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
confused Basic Code Required

Dear All,

I am using SweetHome3d in servlet.
I am new in Java and dont understand how to use this api for my application.
I request you to give me some sample codes.
I am using Eclipse as development tool.

Thank you in advance,
Rohan bhanu

rohanbhanu@gmail.com
[Jun 4, 2013, 8:49:35 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: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

In servlet!?! What for?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Jun 4, 2013, 9:03:12 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
rohanbhanu
Newbie




Joined: May 31, 2013
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
love struck Re: Basic Code Required

I am attaching code for reference.

try {
Class c=Class.forName("com.eteks.sweethome3d.model.Home");
Home hm=(Home)c.newInstance();
hm=new Home();
hm.setName("rohan");
hm.addLabel(new Label("MyHome", 1, 11));
Level arg0 = new Level("rohan",20,1,3);
out.print("asdasdasd");
hm.addLevel(arg0);
hm.getPrint();
hm.setModified(true);
Room rom;
Room room=new Room({{},{}});
hm.addRoom(room);

}catch(Exception e){out.print(e.getMessage());}


Using this code I can initialize the home class.
But what is method to display the home preview after adding walls and furniture.
[Jun 5, 2013, 8:33:21 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: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

Sorry but I still understand why you speak about servlets? What is your goal?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Jun 5, 2013, 8:42: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 
rohanbhanu
Newbie




Joined: May 31, 2013
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

OK let me know you.
My goal is to develop website in which user can create his/her own view for their own house.
They will upload image and draw walls,may add furniture as per their requirement.
I want to build the web application as same as sweet home 3d has developed online application.


For this reason I have downloaded the jar file.
Imported in my eclipse IDE and start using classes developed by SweetHome3d.
[Jun 5, 2013, 8:52:53 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
rohanbhanu
Newbie




Joined: May 31, 2013
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

hello Emmanuel Puybaret,
I am waiting for your reply.
[Jun 5, 2013, 10:23:59 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: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

I think you are on the wrong path. Servlets won't help you (at least in a first step) and you'd rather study applets and how it works in Sweet Home 3D Online case.
I'm ok to give you a few hints but sorry I can't spend time on teaching you the basics of Java technology itself.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Jun 5, 2013, 11:05:48 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
rohanbhanu
Newbie




Joined: May 31, 2013
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Basic Code Required

Dear,
As you have mentioned I have tried using applet but it is showing me error:
Code of Applet init method:

public void init(){
Container c=getContentPane();
c.setLayout(new FlowLayout());
JLabel jtemp=new JLabel("Demo Label");
c.add(jtemp);
Class c=Class.forName("com.eteks.sweethome3d.model.Home");
Home hm=(Home)c.newInstance();
Class l=Class.forName("com.eteks.sweethome3d.model.Wall");
Wall w=(Wall)l.newInstance();
w.setThickness(10);
w.setLeftSideColor(20);
w.setRightSideColor(200);
w.setXStart(WIDTH);
hm.addWall(w);
c.add(hm);
}


It is showing error in c.add(hm); statement.
[Jun 7, 2013, 6:57: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 
[ 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