Print at Dec 21, 2025, 6:06:19 PM
Posts: 42   Pages: 5   [ Previous Page | 1 2 3 4 5 | Next Page ]
View all posts in this thread on one page
Posted by prabath at Feb 8, 2015, 1:27:08 PM
Re: Need to deploy on Tomcat serer
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..

Posted by Puybaret at Feb 9, 2015, 3:28:06 PM
Re: Need to deploy on Tomcat serer
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

Posted by prabath at Feb 10, 2015, 2:56:19 AM
Re: Need to deploy on Tomcat serer
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.

Posted by Puybaret at Feb 10, 2015, 10:19:48 AM
Re: Need to deploy on Tomcat serer
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. smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by prabath at Feb 10, 2015, 1:33:39 PM
Re: Need to deploy on Tomcat serer
That's my issue. I couldn't find how to show/hide 3D pannel.

Posted by Puybaret at Feb 10, 2015, 1:59:54 PM
Re: Need to deploy on Tomcat serer
What about calling setVisible?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by prabath at Feb 12, 2015, 6:48:36 AM
Re: Need to deploy on Tomcat serer
Hi Puybaret..

Can you pls explain bit more about the solution..?

Posted by Puybaret at Feb 12, 2015, 7:52:16 AM
Re: Need to deploy on Tomcat serer
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

Posted by prabath at Mar 10, 2015, 3:32:41 AM
Re: Need to deploy on Tomcat serer
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

Posted by prabath at Mar 12, 2015, 5:14:29 AM
Re: Need to deploy on Tomcat serer
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...........

Posts: 42   Pages: 5   [ Previous Page | 1 2 3 4 5 | Next Page ]