diff --git a/build.gradle b/build.gradle index fedd7e5..9b7b77d 100644 --- a/build.gradle +++ b/build.gradle @@ -74,8 +74,8 @@ jar { manifest { attributes( "Plugin-Date": new Date().format("yyyy-MM-dd HH:mm"), - "Plugin-Version": "v0.7.0", - "Plugin-Mainversion": 10600, + "Plugin-Version": "v0.7.1", + "Plugin-Mainversion": 10786, "10340_Plugin-Url": "v0.6.0;https://github.com/matsim-org/josm-matsim-plugin/releases/download/v0.6.0/matsim.jar", "9278_Plugin-Url": "v0.5.9;https://github.com/matsim-org/josm-matsim-plugin/releases/download/v0.5.9/matsim.jar", "Created-By": System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')', diff --git a/src/main/java/org/matsim/contrib/josm/gui/OTFDialog.java b/src/main/java/org/matsim/contrib/josm/gui/OTFDialog.java index eb55556..c577d6f 100644 --- a/src/main/java/org/matsim/contrib/josm/gui/OTFDialog.java +++ b/src/main/java/org/matsim/contrib/josm/gui/OTFDialog.java @@ -23,6 +23,7 @@ import org.matsim.contrib.otfvis.OTFVis; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.mobsim.qsim.QSim; +import org.matsim.vis.otfvis.OTFClient; import org.matsim.vis.otfvis.OTFClientControl; import org.matsim.vis.otfvis.OTFVisConfigGroup; import org.matsim.vis.otfvis.OnTheFlyServer; @@ -71,24 +72,19 @@ public OTFDialog(Scenario scenario, EventsManager eventsManager, QSim qSim) { connectionManager.connectReceiverToLayer(FacilityDrawer.DataDrawer.class, SimpleSceneLayer.class); } + Component canvas = OTFOGLDrawer.createGLCanvas(visconf); + OTFHostControl hostControl = new OTFHostControl(server, canvas); OTFClientControl.getInstance().setOTFVisConfig(visconf); // has to be set before OTFClientQuadTree.getConstData() is invoked! OTFServerQuadTree serverQuadTree = server.getQuad(connectionManager); OTFClientQuadTree clientQuadTree = serverQuadTree.convertToClient(server, connectionManager); - clientQuadTree.getConstData(); - - Component canvas = OTFOGLDrawer.createGLCanvas(visconf); - OTFHostControl otfHostControl = new OTFHostControl(server, canvas); - OTFOGLDrawer drawer = new OTFOGLDrawer(clientQuadTree, visconf, canvas, otfHostControl); - OTFClientControl.getInstance().setMainOTFDrawer(drawer); - OTFControlBar controlBar = new OTFControlBar(server, otfHostControl, drawer); + OTFOGLDrawer mainDrawer = new OTFOGLDrawer(clientQuadTree, visconf, canvas, hostControl); + OTFControlBar hostControlBar = new OTFControlBar(server, hostControl, mainDrawer); OTFQueryControl queryControl = new OTFQueryControl(server, visconf); OTFQueryControlToolBar queryControlBar = new OTFQueryControlToolBar(queryControl, visconf); queryControl.setQueryTextField(queryControlBar.getTextField()); - - - drawer.setQueryHandler(queryControl); + mainDrawer.setQueryHandler(queryControl); JPanel compositePanel = new JPanel(); compositePanel.setBackground(Color.white); @@ -99,7 +95,7 @@ public OTFDialog(Scenario scenario, EventsManager eventsManager, QSim qSim) { compositePanel.setPreferredSize(new Dimension(screenSize.width/2,screenSize.height/2)); getContentPane().add(compositePanel, BorderLayout.CENTER); - getContentPane().add(controlBar, BorderLayout.NORTH); + getContentPane().add(hostControlBar, BorderLayout.NORTH); getContentPane().add(queryControlBar, BorderLayout.SOUTH); pack(); }