Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
8948b6fb
Commit
8948b6fb
authored
Mar 18, 2019
by
Benedikt Kleinmeier
Browse files
Merge branch 'save_current_project'
parents
8cf7c11e
ec2b615d
Pipeline
#98662
failed with stages
in 151 minutes and 13 seconds
Changes
95
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/projectview/control/ActionAbstractSaveProject.java
View file @
8948b6fb
...
...
@@ -2,16 +2,19 @@ package org.vadere.gui.projectview.control;
import
org.vadere.gui.components.utils.Messages
;
import
org.vadere.gui.projectview.VadereApplication
;
import
org.vadere.gui.projectview.model.ProjectViewModel
;
import
org.vadere.gui.projectview.utils.ApplicationWriter
;
import
org.vadere.gui.projectview.view.VDialogManager
;
import
org.vadere.util.io.IOUtils
;
import
org.vadere.util.logging.Logger
;
import
javax.swing.*
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.TreeSet
;
import
java.util.prefs.BackingStoreException
;
import
javax.swing.*
;
import
java.util.prefs.Preferences
;
public
abstract
class
ActionAbstractSaveProject
extends
AbstractAction
{
...
...
@@ -99,6 +102,7 @@ public abstract class ActionAbstractSaveProject extends AbstractAction {
model
.
getProject
().
saveChanges
();
model
.
refreshScenarioNames
();
logger
.
info
(
"save project"
);
updateRecentProjectPreferences
(
model
);
}
catch
(
IOException
e
)
{
IOUtils
.
errorBox
(
Messages
.
getString
(
"SaveFileErrorMessage.text"
)
+
System
.
lineSeparator
()
...
...
@@ -113,6 +117,16 @@ public abstract class ActionAbstractSaveProject extends AbstractAction {
}
}
private
static
void
updateRecentProjectPreferences
(
ProjectViewModel
model
)
{
Preferences
preferences
=
Preferences
.
userNodeForPackage
(
VadereApplication
.
class
);
final
String
key
=
"recent_projects"
;
final
TreeSet
<
String
>
values
=
new
TreeSet
(
Arrays
.
asList
(
preferences
.
get
(
key
,
""
).
split
(
","
)));
values
.
add
(
model
.
getCurrentProjectPath
());
String
value
=
values
.
stream
().
reduce
(
""
,
(
a
,
b
)
->
a
+
","
+
b
);
System
.
out
.
println
(
values
.
toString
());
preferences
.
put
(
key
,
value
.
replaceFirst
(
","
,
""
));
}
static
void
savePreferences
()
throws
IOException
,
BackingStoreException
{
ApplicationWriter
.
savePreferences
();
logger
.
info
(
"save preferences"
);
...
...
VadereGui/src/org/vadere/gui/projectview/view/ProjectView.java
View file @
8948b6fb
...
...
@@ -333,7 +333,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
closeApplicationAction
.
actionPerformed
(
null
);
}
});
Preferences
pref
=
Preferences
.
userNodeForPackage
(
VadereApplication
.
class
);
pack
();
}
...
...
@@ -365,7 +365,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
JMenuItem
mntmLoadProject
=
new
JMenuItem
(
loadProjectAction
);
mntmRecentProjects
=
new
JMenu
(
Messages
.
getString
(
"ProjectView.mntmRecentProjects.text"
));
mntmRecentProjects
.
setEnabled
(
fals
e
);
mntmRecentProjects
.
setEnabled
(
tru
e
);
updateRecentProjectsMenu
();
Action
changeNameAction
=
new
ActionRenameProject
(
Messages
.
getString
(
"ProjectView.mntmChangeName.text"
),
model
);
...
...
@@ -535,6 +535,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
model
.
setCurrentScenario
(
bundle
.
getScenario
());
logger
.
info
(
String
.
format
(
"selected scenario '%s'"
,
bundle
.
getScenario
().
getName
()));
scenarioJPanel
.
setScenario
(
bundle
.
getScenario
(),
true
);
outputTableRenderer
.
setMarkedOutputFiles
(
bundle
.
getOutputDirectories
());
...
...
VadereModelTests/TestGNM/scenarios/basic_1_chicken_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_1_chicken_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -118,6 +118,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -139,6 +140,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -148,8 +150,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_1_chicken_gnm1_displaced.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_1_chicken_gnm1_displaced",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -118,6 +118,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -139,6 +140,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -148,8 +150,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_1_chicken_gnm2.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_1_chicken_gnm2",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -118,6 +118,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -139,6 +140,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -148,8 +150,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_2_density_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_2_density_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -127,6 +127,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -148,6 +149,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -157,8 +159,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_3_1_wall_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_3_1_wall_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -100,6 +100,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -121,6 +122,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -130,8 +132,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_3_2_wall_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_3_2_wall_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -100,6 +100,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -121,6 +122,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -130,8 +132,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_3_3_wall_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_3_3_wall_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -100,6 +100,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -121,6 +122,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -130,8 +132,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_4_1_wall_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_4_1_wall_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -100,6 +100,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -121,6 +122,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -130,8 +132,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/basic_4_2_wall_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "basic_4_2_wall_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -58,7 +58,7 @@
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 1,
"simulationSeed" :
0
"simulationSeed" :
1
},
"topography" : {
"attributes" : {
...
...
@@ -100,6 +100,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -121,6 +122,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -130,8 +132,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/rimea_01_pathway_gnm1.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "rimea_01_pathway_gnm1",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -91,6 +91,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -112,6 +113,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -121,8 +123,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/rimea_04_flow_gnm1_025_h.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "rimea_04_flow_gnm1_025_h",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -91,6 +91,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -112,6 +113,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -121,8 +123,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/rimea_04_flow_gnm1_050_h.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "rimea_04_flow_gnm1_050_h",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -91,6 +91,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -112,6 +113,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -121,8 +123,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
\ No newline at end of file
VadereModelTests/TestGNM/scenarios/rimea_04_flow_gnm1_075_h.scenario
View file @
8948b6fb
...
...
@@ -2,11 +2,11 @@
"name" : "rimea_04_flow_gnm1_075_h",
"description" : "",
"release" : "0.7",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
"isTimestamped" : true,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
...
...
@@ -91,6 +91,7 @@
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : -1,
"shape" : {
...
...
@@ -112,6 +113,7 @@
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
...
...
@@ -121,8 +123,9 @@
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null,
"dynamicElements" : [ ]
}
"teleporter" : null,
"attributesCar" : null