Need to deploy on Tomcat serer
This topic has been viewed 22865 times and has 41 replies
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..
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..
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
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.
Therefore I removed 3D view functionality and wanted to add a button to add 3D view functionality.
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.
Feel free to help other users! All help is welcomed. [:)]If you allow me , I would like to answer the questions which are publish in this forum and help the others.
Emmanuel Puybaret, Sweet Home 3D creator
Re: Need to deploy on Tomcat serer
That's my issue. I couldn't find how to show/hide 3D pannel.
Re: Need to deploy on Tomcat serer
What about calling setVisible?
Emmanuel Puybaret, Sweet Home 3D creator
Re: Need to deploy on Tomcat serer
Hi Puybaret..
Can you pls explain bit more about the solution..?
Can you pls explain bit more about the solution..?
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
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
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
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...........
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...........
Who is online
Users browsing this forum: No registered users and 1 guest