Commit 4684d875 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

Add SI units to status bar of TopographyCreator and PostVis tab

parent 54358b8b
Pipeline #354813 passed with stages
in 128 minutes
......@@ -210,7 +210,24 @@ Step.text=Singlestep
OutputprocessorsView.columnNames.text=["No dataProcessor chosen"]
OutputprocessorsView.dataProcessor.text={Processor: ""}
AdjustPanel.lblVelocity.text=FPS
# Units which are used in info and adjust panel
Units.title=Unit
Units.length=meter
Units.time=second
Units.dimensionless=dimensionless
Units.fps=Frames per second
Units.simStep=Simulation step
# Info panel at the bottom of TopographyCreator
InfoPanel.GridResolution.label=Grid Resolution
InfoPanel.ScenarioSize.label=Size
InfoPanel.CursorPosition.label=Cursor
InfoPanel.ScaleFactor.label=Scale Factor
InfoPanel.ScenarioHash.label=Scenario Hash
# Adjust panel at the bottom of PostVis
AdjustPanel.lblVelocity.text=Frames
AdjustPanel.lblTime=Time
AdjustPanel.lblStep.text=SimStep
AdjustPanel.lblTimeResolution.text=Res.
......@@ -391,13 +408,6 @@ Tab.TopographyCreator.title=Topography creator
Tab.PostVisualization.title=Post-Visualization
TextView.Button.LoadPresettings=Load presettings
# Info Panel at bottom of Topography creator
InfoPanel.ScenarioSize.label=Scenario Size
InfoPanel.GridResolution.label=Grid Resolution
InfoPanel.CursorPosition.label=Cursor Position
InfoPanel.ScaleFactor.label=Scale Factor
InfoPanel.ScenarioHash.label=Scenario Hash
Messages.changeLanguagePopup.title=Reload required
Messages.changeLanguagePopup.text=Reload Vadere GUI to switch language.
......
......@@ -213,7 +213,23 @@ Step.text=Einzelschritt
OutputprocessorsView.columnNames.text=["Kein Prozessor gew\u00E4hlt"]
OutputprocessorsView.dataProcessor.text={"Processor": ""}
AdjustPanel.lblVelocity.text=FPS
# Units which are used in info and adjust panel
Units.title=Einheit
Units.length=Meter
Units.time=Sekunden
Units.fps=Bilder pro Sekunde
Units.simStep=Simulationsschritt
Units.dimensionless=Ohne Dimension
# Info Panel at bottom of Topography creator
InfoPanel.GridResolution.label=Gitteraufl\u00f6sung
InfoPanel.ScenarioSize.label=Gr\u00f6\u00dfe
InfoPanel.CursorPosition.label=Cursor
InfoPanel.ScaleFactor.label=Skalierungsfaktor
InfoPanel.ScenarioHash.label=Scenario Hash
# Adjust panel at the bottom of PostVis
AdjustPanel.lblVelocity.text=Frames
AdjustPanel.lblTime=Zeit
AdjustPanel.lblStep.text=SimSchritt
AdjustPanel.lblTimeResolution.text=Aufl.
......@@ -379,13 +395,6 @@ Tab.TopographyCreator.title=Topographie-Designer
Tab.PostVisualization.title=Post-Visualisierung
TextView.Button.LoadPresettings=Voreinstellungen laden
# Info Panel at bottom of Topography creator
InfoPanel.ScenarioSize.label=Szenariogr\u00f6\u00dfe
InfoPanel.GridResolution.label=Gitteraufl\u00f6sung
InfoPanel.CursorPosition.label=Cursor-Position
InfoPanel.ScaleFactor.label=Skalierungsfaktor
InfoPanel.ScenarioHash.label=Scenario Hash
Messages.changeLanguagePopup.title=Neu laden n\u00f6tig
Messages.changeLanguagePopup.text=Laden Sie die Vadere GUI neu um die Sprache zu wechseln.
......
......@@ -28,13 +28,13 @@ public class InfoPanel extends JPanel implements Observer {
private final IDefaultModel defaultModel;
private JLabel lblScenarioSizeLabel;
private JLabel lblGridResulutionLabel;
private JLabel lblGridResolutionLabel;
private JLabel lblCursorPositionLabel;
private JLabel lblScaleFactorLabel;
private JLabel lblScenarioHashLabel;
private JLabel lblScenarioSizeValue;
private JLabel lblGridResulutionValue;
private JLabel lblGridResolutionValue;
private JLabel lblCursorPositionValue;
private JLabel lblScaleFactorValue;
private JLabel lblScenarioHashValue;
......@@ -45,19 +45,19 @@ public class InfoPanel extends JPanel implements Observer {
this.defaultModel = defaultModel;
setLayout(new FlowLayout(FlowLayout.LEFT));
lblScenarioSizeLabel = new JLabel(Messages.getString("InfoPanel.ScenarioSize.label") + ":");
lblGridResulutionLabel = new JLabel(Messages.getString("InfoPanel.GridResolution.label") + ":");
lblGridResolutionLabel = new JLabel(Messages.getString("InfoPanel.GridResolution.label") + ":");
lblCursorPositionLabel = new JLabel(Messages.getString("InfoPanel.CursorPosition.label") + ":");
lblScaleFactorLabel = new JLabel(Messages.getString("InfoPanel.ScaleFactor.label") + ":");
lblScenarioHashLabel = new JLabel(Messages.getString("InfoPanel.ScenarioHash.label") + ":");
lblScaleFactorValue = new JLabel();
lblScenarioSizeValue = new JLabel();
lblGridResulutionValue = new JLabel();
lblGridResolutionValue = new JLabel();
lblCursorPositionValue = new JLabel();
lblScenarioHashValue = new JLabel();
add(lblGridResulutionLabel);
add(lblGridResulutionValue);
add(lblGridResolutionLabel);
add(lblGridResolutionValue);
add(lblScenarioSizeLabel);
add(lblScenarioSizeValue);
......@@ -82,15 +82,39 @@ public class InfoPanel extends JPanel implements Observer {
clipboard.setContents(stringSelection, null);
}
});
setToolTips();
}
private void setToolTips() {
String unitLengthText = String.format("%s: [%s]",
Messages.getString("Units.title"),
Messages.getString("Units.length"));
lblScenarioSizeLabel.setToolTipText(unitLengthText);
lblScenarioSizeValue.setToolTipText(unitLengthText);
lblGridResolutionLabel.setToolTipText(unitLengthText);
lblGridResolutionValue.setToolTipText(unitLengthText);
lblCursorPositionLabel.setToolTipText(unitLengthText);
lblCursorPositionValue.setToolTipText(unitLengthText);
String unitDimensionlessText = String.format("%s: [%s]",
Messages.getString("Units.title"),
Messages.getString("Units.dimensionless"));
lblScaleFactorLabel.setToolTipText(unitDimensionlessText);
lblScaleFactorValue.setToolTipText(unitDimensionlessText);
}
@Override
public void update(Observable o, Object arg) {
if (defaultModel.getTopography() != null) {
lblGridResulutionValue.setText(String.format("%3.2f | ", defaultModel.getGridResolution()));
Rectangle2D.Double topographyBound = defaultModel.getTopographyBound();
lblScenarioSizeValue.setText(String.format("%3.2f %3.2f | ", (float) topographyBound.getWidth(),
lblGridResolutionValue.setText(String.format("%3.2f [m] | ", defaultModel.getGridResolution()));
lblScenarioSizeValue.setText(String.format("(%3.2f x %3.2f) [m] | ", (float) topographyBound.getWidth(),
(float) topographyBound.getHeight()));
lblCursorPositionValue
.setText(String.format("%3.2f %3.2f | ", (float) defaultModel.getMousePosition().getX(),
......
......@@ -14,6 +14,7 @@ import java.util.Observer;
public class AdjustPanel extends JPanel implements Observer {
// Member Variables
private final JSlider slider;
private final JSpinner sVelocity;
......@@ -28,8 +29,14 @@ public class AdjustPanel extends JPanel implements Observer {
private final SpinnerModel sModelTimeStep;
private final SpinnerModel sModelTimeResolution;
private final JLabel lblVelocity;
private final JLabel lblTime;
private final JLabel lblStep;
private final JLabel lblTimeResolution;
private final PostvisualizationModel model;
// Constructtors
public AdjustPanel(final PostvisualizationModel model) {
this.model = model;
......@@ -58,20 +65,27 @@ public class AdjustPanel extends JPanel implements Observer {
sTime.setPreferredSize(new Dimension(70, 30));
sTimeResolution.setPreferredSize(new Dimension(70, 30));
String labelTemplate = "%s [%s]:";
lblVelocity = new JLabel(String.format(labelTemplate, Messages.getString("AdjustPanel.lblVelocity.text"), "fps"));
lblTime = new JLabel(String.format(labelTemplate, Messages.getString("AdjustPanel.lblTime"), "s"));
lblStep = new JLabel(String.format(labelTemplate, Messages.getString("AdjustPanel.lblStep.text"), "-"));
lblTimeResolution = new JLabel(String.format(labelTemplate, Messages.getString("AdjustPanel.lblTimeResolution.text"), "s"));
// Arrange the GUI components according to a column-based layout
FormLayout layout = new FormLayout(
"2dlu, default:grow, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu", // col
"2dlu, default, 2dlu"); // rows
setLayout(layout);
CellConstraints cc = new CellConstraints();
add(slider, cc.xy(2, 2));
add(new JLabel(Messages.getString("AdjustPanel.lblVelocity.text")), cc.xy(4, 2));
add(lblVelocity, cc.xy(4, 2));
add(sVelocity, cc.xy(6, 2));
add(new JLabel(Messages.getString("AdjustPanel.lblTime")), cc.xy(8, 2));
add(lblTime, cc.xy(8, 2));
add(sTime, cc.xy(10, 2));
add(new JLabel(Messages.getString("AdjustPanel.lblStep.text")), cc.xy(12, 2));
add(lblStep, cc.xy(12, 2));
add(sStep, cc.xy(14, 2));
add(new JLabel(Messages.getString("AdjustPanel.lblTimeResolution.text")), cc.xy(16, 2));
add(lblTimeResolution, cc.xy(16, 2));
add(sTimeResolution, cc.xy(18, 2));
sVelocity.addChangeListener(e -> {
......@@ -105,6 +119,34 @@ public class AdjustPanel extends JPanel implements Observer {
ActionSetTimeStep setTimeStepAction = new ActionSetTimeStep("setTimeStep", model);
slider.addChangeListener(setTimeStepAction);
setToolTips();
}
private void setToolTips() {
String unitFramesText = String.format("%s: [%s]",
Messages.getString("Units.title"),
Messages.getString("Units.fps"));
lblVelocity.setToolTipText(unitFramesText);
sVelocity.setToolTipText(unitFramesText);
String unitTimeText = String.format("%s: [%s]",
Messages.getString("Units.title"),
Messages.getString("Units.time"));
lblTime.setToolTipText(unitTimeText);
sTime.setToolTipText(unitTimeText);
lblTimeResolution.setToolTipText(unitTimeText);
sTimeResolution.setToolTipText(unitTimeText);
String unitSimStepText = String.format("%s: [%s]",
Messages.getString("Units.title"),
Messages.getString("Units.simStep"));
lblStep.setToolTipText(unitSimStepText);
sStep.setToolTipText(unitSimStepText);
}
@Override
......
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