High priority Need to deploy on Tomcat serer

This topic has been viewed 22854 times and has 41 replies
Thread status: Active
Questions about Sweet Home 3D installation [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

Hi Puybaret....

I'm bit stuck with one more thing. I was able to Add a button on tool bar as you said. I want to implement 3D view on/off function to that.

`Code in Applet Application

toolBar.addSeparator();
addActionToToolBar(homeView, HomeView.ActionType.TEST_BUTTON, toolBar);

Code in HomePane

createAction(ActionType.TEST_BUTTON, preferences, controller, "testMethod");

And Create a method in HomeControler

public void testMethod() {
System.out.println("Hi there.. I am the test method.. ");
is3DViewClicked = true;
View view = getHomeController3D().getView();

}


Once I press the button, the method is called. But I can't see the 3D view. Could you tell me how to view 3D panel ?

Thank You..
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need to deploy on Tomcat serer

Post by Puybaret »

If you didn't create the 3D view as requested previously, don't be astonished that you can't manage it later!
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

The application which I developed using Sweet Home, is capable of detecting floor plan and drawing walls automatically. So If 3D view is enabled, system becomes slow.

Therefore I removed 3D view functionality and wanted to add a button to add 3D view functionality.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need to deploy on Tomcat serer

Post by Puybaret »

If you want to show/hide the 3D view, don't implement an other view factory to avoid its creation. Just make it invisible in the createHomeController method you overrode, and manage the divider of the JSplitPane grand parent of the 3D view when you show/hide the 3D view.
If you allow me , I would like to answer the questions which are publish in this forum and help the others.
Feel free to help other users! All help is welcomed. [:)]
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

That's my issue. I couldn't find how to show/hide 3D pannel.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need to deploy on Tomcat serer

Post by Puybaret »

What about calling setVisible?
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

Hi Puybaret..

Can you pls explain bit more about the solution..?
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need to deploy on Tomcat serer

Post by Puybaret »

In the current version, all classes that implement com.eteks.sweethome3d.viewcontroller.View interface are subclasses of javax.swing.JComponent. So cast 3D view to JComponent to be able to call its setVisible method.
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

Hi Puybaret..

I tried to fix my requirement as you said. Actually it is not clear to me. Anyway I found a solution to do that and mentioned below the code. Initially I set the 3D pane as 0.

HomePane - createMainPane Method

else {
final JSplitPane mainPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, catalogFurniturePane, planView3DPane);
// Set default divider location

mainPane.setDividerLocation(0);
configureSplitPane(mainPane, home, MAIN_PANE_DIVIDER_LOCATION_VISUAL_PROPERTY, 0.3, true, controller);
return mainPane;
}

Code for Button - Methods in HomeController.java

public void enable3DView() {

View vv = getHomeController3D().getView();
attachView(vv);

show3DView(vv);
}

/*------3D View-----------------*/

private void show3DView(final View view) {
JComponent jc = (JComponent)view;

Container parent = jc.getParent(); // dummyComponent.getParent();
if (parent instanceof JSplitPane) {
JSplitPane splitPane = (JSplitPane)parent;

int loc = splitPane.getDividerLocation();
int min = splitPane.getMinimumDividerLocation();
int max = splitPane.getMaximumDividerLocation();


if(is3DViewClicked){
splitPane.setDividerLocation(0.0);
is3DViewClicked = false;
}
else {
splitPane.setDividerLocation(1.0);
is3DViewClicked = true;
}
}

Thnak You
User avatar
prabath
Posts: 28
Joined: Wed Dec 24, 2014 4:41 am

Re: Need to deploy on Tomcat serer

Post by prabath »

Hi Puybaret..

In my application , I retrieve the Floor Plan from the server. (Not from the Client side). When I try to save the Floor Plan, It gives
a NotSerializableException. Because I load the Floor Plan image through a URL

eg :
Content c = new URLContent(new URL(AppletApplication.URL_PREFIX + "/restAPI/plan/" + AppletApplication.SELECTED_PLAN_ID +"/image"));


I would be thankful, If you are able to give me a solution for this.

Thank You...........
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest