Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
c66f1d56
Commit
c66f1d56
authored
Feb 20, 2023
by
Eric Duminil
Browse files
Allow Repo to be a project.
parent
50c68ebb
Pipeline
#7233
passed with stage
in 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionChooserBrowser.java
View file @
c66f1d56
...
...
@@ -110,7 +110,6 @@ public Integer call() throws IOException, XPathParseException, NavException, Par
public
void
selectRepository
()
{
//FIXME: Allow project folders too. But don't silently fail if repo isn't really a repo
Preferences
userPrefs
=
Preferences
.
userRoot
().
node
(
"/eu/simstadt/desktop"
);
DirectoryChooser
fileChooser
=
new
DirectoryChooser
();
...
...
@@ -135,7 +134,7 @@ private File selectSaveFileWithDialog(String project, String citygml, String suf
Stage
mainStage
=
(
Stage
)
RegionChooserBrowser
.
this
.
getScene
().
getWindow
();
FileChooser
fileChooser
=
new
FileChooser
();
fileChooser
.
setTitle
(
"Save CITYGML ids"
);
if
(
project
!=
null
)
{
if
(
project
!=
null
&&
!
isRepoAProject
()
)
{
fileChooser
.
setInitialDirectory
(
repo
.
resolve
(
project
+
".proj"
).
toFile
());
}
else
{
fileChooser
.
setInitialDirectory
(
repo
.
toFile
());
...
...
@@ -158,8 +157,21 @@ public void warning(String text) {
LOGGER
.
warning
(
text
);
}
/*
* NOTE: Users sometime select some_region.proj/ as a repository.
* SimStadt won't show any project in this "repository", but RegionChooser shouldn't complain and
* still be able to extract regions.
*/
private
boolean
isRepoAProject
(){
return
repo
.
toString
().
endsWith
(
".proj"
);
}
private
Path
citygmlPath
(
String
project
,
String
citygml
)
{
return
repo
.
resolve
(
project
+
".proj"
).
resolve
(
citygml
);
if
(
isRepoAProject
()){
return
repo
.
resolve
(
citygml
);
}
else
{
return
repo
.
resolve
(
project
+
".proj"
).
resolve
(
citygml
);
}
}
}
...
...
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