Commit 60aeb959 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

insert a button into the topography creater gui which can be pressed to...

insert a button into the topography creater gui which can be pressed to generate a PSLG out of the topography.
parent 30c27805
......@@ -303,9 +303,10 @@ ProjectView.btnCancel=Cancel
ProjectView.btnExpertCSV=Export as csv
ProjectView.label.simResults=Simulation Results
TopographyCreator.btnGeneratePoly.tooltip=Generate a Planar Straight-Line Graph (PSLG)
TopographyCreator.btnMergeObstacles.tooltip=Merge Overlapping Obstacles into One Polygon
TopographyCreator.btnMinimizeTopography.tooltip=Select Viewport area
TopographyCreator.btnMaximizeTopography.tooltip=Maximize Viewport area
TopographyCreator.btnMaximizeTopography.tooltip=Maximize Viewport Area
TopographyCreator.btnQuickSave.tooltip=Quicksave
TopographyCreator.btnNewTopography.tooltip=New Scenario
TopographyCreator.btnScroll.tooltip=Scroll Around
......@@ -317,14 +318,14 @@ TopographyCreator.btnCutTopography.tooltip=Cut Scenario
TopographyCreator.btnInsertPedestrian.tooltip=Pedestrian
TopographyCreator.btnTopographyBound.tooltip=Topography Bound
TopographyCreator.btnMergeWithConvexHull.tooltip=Merge With Convex Hull
TopographyCreator.btnTranslation.tooltip=Translate topography
TopographyCreator.btnElementTranslation.tooltip=Translate topography elements
TopographyCreator.btnTranslation.tooltip=Translate Topography
TopographyCreator.btnElementTranslation.tooltip=Translate Topography Elements
TopographyCreator.btnInsertObstacle.tooltip=Obstacle
TopographyCreator.btnInsertTarget.tooltip=Target
TopographyCreator.btnInsertAbsorbingArea.tooltip=Absorbing Area
TopographyCreator.btnInsertSource.tooltip=Source
TopographyCreator.btnInsertStairs.tooltip=Stairs
TopographyCreator.btnInsertMeasurementArea.tooltip=MeasurmentArea
TopographyCreator.btnInsertMeasurementArea.tooltip=Measurment Area
TopographyCreator.btnErase.tooltip=Eraser
TopographyCreator.btnConvexHull.label=Convex Hull
TopographyCreator.btnSimplePolygon.label=Simple Polygon
......
......@@ -297,6 +297,7 @@ ProjectView.btnCancel=Abbrechen
ProjectView.btnDrawVoronoiDiagram.tooltip=Voronoi-Diagramm zeichnen und anzeigen
ProjectView.btnDrawMesh.tooltip=Mesh zeichnen und anzeigen
TopographyCreator.btnGeneratePoly.tooltip=Generiere einen PSLG
TopographyCreator.btnMergeObstacles.tooltip=\u00dcberlappende Hindernisse zusammenf\u00fchren
TopographyCreator.btnMinimizeTopography.tooltip=Select Viewport area
TopographyCreator.btnMaximizeTopography.tooltip=Anzeigebereich maximieren
......
package org.vadere.gui.components.control.simulation;
package org.vadere.gui.components.control;
import org.apache.commons.configuration2.Configuration;
import org.vadere.gui.components.control.simulation.ActionGeneratePNG;
import org.vadere.gui.components.model.DefaultModel;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.meshing.mesh.impl.PSLG;
import org.vadere.meshing.utils.io.poly.PSLGGenerator;
import org.vadere.state.scenario.Obstacle;
......@@ -27,7 +25,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.prefs.Preferences;
import java.util.stream.Collectors;
import javax.swing.*;
......@@ -35,10 +32,9 @@ import javax.swing.*;
public class ActionGeneratePoly extends AbstractAction {
private static Logger logger = Logger.getLogger(ActionGeneratePNG.class);
private static final Configuration CONFIG = VadereConfig.getConfig();
private final SimulationModel<? extends DefaultSimulationConfig> model;
private final DefaultModel<? extends DefaultSimulationConfig> model;
public ActionGeneratePoly(final String name, Icon icon, final SimulationRenderer renderer,
final SimulationModel<? extends DefaultSimulationConfig> model) {
public ActionGeneratePoly(final String name, Icon icon, final DefaultModel<? extends DefaultSimulationConfig> model) {
super(name, icon);
this.model = model;
}
......
......@@ -3,6 +3,7 @@ package org.vadere.gui.onlinevisualization.view;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import org.apache.commons.configuration2.Configuration;
import org.vadere.gui.components.control.ActionGeneratePoly;
import org.vadere.gui.components.control.IViewportChangeListener;
import org.vadere.gui.components.control.JViewportChangeListener;
import org.vadere.gui.components.control.PanelResizeListener;
......@@ -186,7 +187,6 @@ public class OnlineVisualisationWindow extends JPanel implements Observer {
ActionGeneratePoly generatePoly = new ActionGeneratePoly(
Messages.getString("ProjectView.btnPolySnapshot.tooltip"),
resources.getIcon("camera_poly.png", iconWidth, iconHeight),
renderer,
model);
ActionShowPotentialField showPotentialField = new ActionShowPotentialField(
......
......@@ -9,7 +9,7 @@ import org.vadere.gui.components.control.JViewportChangeListener;
import org.vadere.gui.components.control.PanelResizeListener;
import org.vadere.gui.components.control.ViewportChangeListener;
import org.vadere.gui.components.control.simulation.ActionGeneratePNG;
import org.vadere.gui.components.control.simulation.ActionGeneratePoly;
import org.vadere.gui.components.control.ActionGeneratePoly;
import org.vadere.gui.components.control.simulation.ActionGenerateSVG;
import org.vadere.gui.components.control.simulation.ActionGenerateTikz;
import org.vadere.gui.components.control.simulation.ActionSwapSelectionMode;
......@@ -247,7 +247,7 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
AbstractAction tikzImg = new ActionGenerateTikz(Messages.getString("ProjectView.btnTikZSnapshot.tooltip"), resources.getIcon("camera_tikz.png", iconWidth, iconHeight),
renderer, model);
AbstractAction polyImg = new ActionGeneratePoly(Messages.getString("ProjectView.btnPolySnapshot.tooltip"), resources.getIcon("camera_poly.png", iconWidth, iconHeight),
renderer, model);
model);
// add new ImageGenerator Action ...
......
......@@ -3,6 +3,7 @@ package org.vadere.gui.topographycreator.view;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import org.vadere.gui.components.control.ActionGeneratePoly;
import org.vadere.gui.components.control.IViewportChangeListener;
import org.vadere.gui.components.control.JViewportChangeListener;
import org.vadere.gui.components.control.PanelResizeListener;
......@@ -375,6 +376,12 @@ public class TopographyWindow extends JPanel {
// ActionScenarioChecker actionScenarioChecker =
// new ActionScenarioChecker("ScenarioChecker", panelModel, jsonValidIndicator);
int iconHeight = VadereConfig.getConfig().getInt("ProjectView.icon.height.value");
int iconWidth = VadereConfig.getConfig().getInt("ProjectView.icon.width.value");
AbstractAction polyImg = new ActionGeneratePoly(Messages.getString("ProjectView.btnPolySnapshot.tooltip"),
resources.getIcon("camera_poly.png", iconWidth, iconHeight),
panelModel);
/* create toolbar*/
addActionToToolbar(toolbar, selectShape, "select_shape_tooltip");
......@@ -417,6 +424,7 @@ public class TopographyWindow extends JPanel {
addActionToToolbar(toolbar, selectCutAction, "TopographyCreator.btnCutTopography.tooltip");
addActionToToolbar(toolbar, resetScenarioAction, "TopographyCreator.btnNewTopography.tooltip");
addActionToToolbar(toolbar, saveScenarioAction, "TopographyCreator.btnQuickSave.tooltip");
addActionToToolbar(toolbar, polyImg, "TopographyCreator.btnGeneratePoly.tooltip");
toolbar.addSeparator(new Dimension(5, 50));
addActionToToolbar(toolbar, undoAction, "TopographyCreator.btnUndo.tooltip");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment