Commit 0c20647f authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

In "TikzGenerator.java", highlight currently selected agent with colored border.

In "PostvisualizationWindow.java", added button to generate TikZ image.
parent 15699d73
Pipeline #59686 passed with stage
in 51 seconds
......@@ -220,7 +220,7 @@ PostVis.chbShowStairs.text=Treppen anzeigen
PostVis.btnSnapshot.tooltip=Snapshot
PostVis.btnPNGSnapshot.tooltip=PNG-Snapshot
PostVis.btnSVGSnapshot.tooltip=SVG-Snapshot
PostVis.btnTikZSnapshot.tooltip=TikZ Snapshot
PostVis.btnTikZSnapshot.tooltip=TikZ-Snapshot
PostVis.menuFile.title=Datei
PostVis.menuSettings.title=Einstellungen
PostVis.menuRecentFiles.title=K\u00FCrzlich verwendete Dateien
......
......@@ -150,20 +150,20 @@ public class OnlineVisualisationWindow extends JPanel implements Observer {
};
ActionGeneratePNG generatePNG = new ActionGeneratePNG(
"generatePNG",
Messages.getString("PostVis.btnPNGSnapshot.tooltip"),
resources.getIcon("camera_png.png", iconWidth, iconHeight),
new OnlinevisualizationRenderer(model),
model);
ActionGenerateSVG generateSVG = new ActionGenerateSVG(
"generateSVG",
Messages.getString("PostVis.btnSVGSnapshot.tooltip"),
resources.getIcon("camera_svg.png", iconWidth, iconHeight),
new OnlinevisualizationRenderer(model),
model);
ActionGenerateTikz generateTikz = new ActionGenerateTikz(
"generateTikz",
Messages.getString("PostVis.btnTikZSnapshot.tooltip"),
resources.getIcon("camera_tikz.png", iconWidth, iconHeight),
new OnlinevisualizationRenderer(model),
model);
......
......@@ -167,6 +167,11 @@ public class TikzGenerator {
generatedCode += "% Agents\n";
for (Agent agent : model.getAgents()) {
String agentTextPattern = "\\fill[AgentColor] (%f,%f) circle [radius=%fcm];\n";
if (model.isElementSelected() && model.getSelectedElement().equals(agent)) {
agentTextPattern = "\\fill[draw=magenta,fill=AgentColor] (%f,%f) circle [radius=%fcm];\n";
}
generatedCode += String.format(agentTextPattern, agent.getPosition().x, agent.getPosition().y, agent.getRadius());
// Do not draw agents as path for performance reasons. Usually, agents have a circular shape.
// generatedCode += String.format("\\fill[AgentColor] %s\n", generatePathForScenarioElement(agent));
......
......@@ -253,12 +253,13 @@ public class PostvisualizationWindow extends JPanel implements Observer {
renderer);
ActionVisualization svgImg = new ActionGenerateSVG(Messages.getString("PostVis.btnSVGSnapshot.tooltip"), resources.getIcon("camera_svg.png", iconWidth, iconHeight),
renderer);
ActionVisualization tikzImg = new ActionGenerateTikz("tikz_snapshot", resources.getIcon("camera_tikz.png", iconWidth, iconHeight),
ActionVisualization tikzImg = new ActionGenerateTikz(Messages.getString("PostVis.btnTikZSnapshot.tooltip"), resources.getIcon("camera_tikz.png", iconWidth, iconHeight),
renderer);
// add new ImageGenerator Action ...
imgOptions.add(pngImg);
imgOptions.add(svgImg);
imgOptions.add(tikzImg);
// add Action to List ....
ActionVisualizationMenu imgDialog = new ActionVisualizationMenu(
......
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