Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
vadere
vadere
Commits
4684d875
Commit
4684d875
authored
Nov 05, 2020
by
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
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
VadereGui/resources/messages.properties
View file @
4684d875
...
...
@@ -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.
...
...
VadereGui/resources/messages_de_DE.properties
View file @
4684d875
...
...
@@ -213,7 +213,23 @@ Step.text=Einzelschritt
OutputprocessorsView.columnNames.text
=
["Kein Prozessor gew
\u
00E4hlt"]
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
\u
00f6sung
InfoPanel.ScenarioSize.label
=
Gr
\u
00f6
\u
00dfe
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
\u
00f6
\u
00dfe
InfoPanel.GridResolution.label
=
Gitteraufl
\u
00f6sung
InfoPanel.CursorPosition.label
=
Cursor-Position
InfoPanel.ScaleFactor.label
=
Skalierungsfaktor
InfoPanel.ScenarioHash.label
=
Scenario Hash
Messages.changeLanguagePopup.title
=
Neu laden n
\u
00f6tig
Messages.changeLanguagePopup.text
=
Laden Sie die Vadere GUI neu um die Sprache zu wechseln.
...
...
VadereGui/src/org/vadere/gui/components/view/InfoPanel.java
View file @
4684d875
...
...
@@ -28,13 +28,13 @@ public class InfoPanel extends JPanel implements Observer {
private
final
IDefaultModel
defaultModel
;
private
JLabel
lblScenarioSizeLabel
;
private
JLabel
lblGridRes
u
lutionLabel
;
private
JLabel
lblGridRes
o
lutionLabel
;
private
JLabel
lblCursorPositionLabel
;
private
JLabel
lblScaleFactorLabel
;
private
JLabel
lblScenarioHashLabel
;
private
JLabel
lblScenarioSizeValue
;
private
JLabel
lblGridRes
u
lutionValue
;
private
JLabel
lblGridRes
o
lutionValue
;
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"
)
+
":"
);
lblGridRes
u
lutionLabel
=
new
JLabel
(
Messages
.
getString
(
"InfoPanel.GridResolution.label"
)
+
":"
);
lblGridRes
o
lutionLabel
=
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
();
lblGridRes
u
lutionValue
=
new
JLabel
();
lblGridRes
o
lutionValue
=
new
JLabel
();
lblCursorPositionValue
=
new
JLabel
();
lblScenarioHashValue
=
new
JLabel
();
add
(
lblGridRes
u
lutionLabel
);
add
(
lblGridRes
u
lutionValue
);
add
(
lblGridRes
o
lutionLabel
);
add
(
lblGridRes
o
lutionValue
);
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
(),
...
...
VadereGui/src/org/vadere/gui/postvisualization/view/AdjustPanel.java
View file @
4684d875
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment