Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
569ad96a
Commit
569ad96a
authored
4 weeks ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Style: Rename function and field
parent
3fd5502f
master
dev
dev_gui_features_zip_loading
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java
+1
-1
...ava/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntry.java
+12
-7
...ava/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntry.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+1
-1
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
+3
-3
...ava/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/ZipEntryNode.java
+1
-1
...a/de/hft/stuttgart/citydoctor2/gui/tree/ZipEntryNode.java
with
18 additions
and
13 deletions
+18
-13
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java
+
1
-
1
View file @
569ad96a
...
...
@@ -30,7 +30,7 @@ public class ArchivePacker {
tmpDir
=
Files
.
createTempDirectory
(
"zipTmp"
);
tmpDir
.
toFile
().
deleteOnExit
();
for
(
CityGmlZipEntry
entry
:
archive
.
getEntries
())
{
if
(
entry
.
getErrorType
()
!=
null
||
!
entry
.
is
Decompress
ed
())
{
if
(
entry
.
getErrorType
()
!=
null
||
!
entry
.
is
Load
ed
())
{
continue
;
}
CityDoctorModel
model
=
entry
.
getModel
();
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntry.java
+
12
-
7
View file @
569ad96a
...
...
@@ -26,7 +26,7 @@ public class CityGmlZipEntry implements Serializable {
private
final
String
displayName
;
private
transient
CityDoctorModel
model
;
private
CityGmlZipArchive
parentArchive
;
private
boolean
decompressed
;
private
boolean
inMemory
;
private
long
fileSize
=
-
1L
;
private
static
final
long
MB
=
1024
*
1024L
;
private
ZipEntryErrorType
errorType
=
null
;
...
...
@@ -42,7 +42,7 @@ public class CityGmlZipEntry implements Serializable {
}
public
void
loadEntry
(
ParserConfiguration
config
,
ProgressListener
l
)
{
if
(
decompressed
)
{
if
(
inMemory
)
{
return
;
}
if
(
errorType
!=
null
)
{
...
...
@@ -51,7 +51,7 @@ public class CityGmlZipEntry implements Serializable {
}
try
{
this
.
model
=
CityGmlParser
.
parseCityGmlZipEntry
(
this
,
config
,
l
);
this
.
decompressed
=
true
;
this
.
inMemory
=
true
;
}
catch
(
CityGmlParseException
|
InvalidGmlFileException
e
)
{
logger
.
error
(
e
);
this
.
errorType
=
ZipEntryErrorType
.
INVALID_CITY_GML_FILE
;
...
...
@@ -91,7 +91,7 @@ public class CityGmlZipEntry implements Serializable {
return
memoryLimit
>
(
fileSize
/
MB
);
}
pr
otec
te
d
CityGmlZipEntry
(
ZipEntry
entry
,
CityGmlZipArchive
parentArchive
,
boolean
decompressed
)
{
pr
iva
te
CityGmlZipEntry
(
ZipEntry
entry
,
CityGmlZipArchive
parentArchive
,
boolean
inMemory
)
{
this
.
fileName
=
entry
.
getName
();
this
.
filePath
=
Path
.
of
(
entry
.
getName
());
this
.
displayName
=
filePath
.
getFileName
().
toString
();
...
...
@@ -99,7 +99,7 @@ public class CityGmlZipEntry implements Serializable {
this
.
fileSize
=
entry
.
getSize
();
}
this
.
model
=
null
;
this
.
decompressed
=
decompressed
;
this
.
inMemory
=
inMemory
;
this
.
parentArchive
=
parentArchive
;
}
...
...
@@ -140,8 +140,13 @@ public class CityGmlZipEntry implements Serializable {
return
filePath
.
getParent
().
resolve
(
libraryObjectPath
);
}
public
boolean
isDecompressed
()
{
return
decompressed
;
/**
* Returns whether this entry has been loaded into memory.
*
* @return true if
*/
public
boolean
isLoaded
()
{
return
inMemory
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
1
-
1
View file @
569ad96a
...
...
@@ -200,7 +200,7 @@ public class CityDoctorController {
}
public
void
loadZipEntry
(
CityGmlZipEntry
entry
)
{
if
(!
entry
.
is
Decompress
ed
())
{
if
(!
entry
.
is
Load
ed
())
{
entry
.
loadEntry
(
currentConfig
);
}
if
(
entry
.
getErrorType
()
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
+
3
-
3
View file @
569ad96a
...
...
@@ -118,7 +118,7 @@ public class ZipEntryManager {
private
final
String
unknownValueText
=
Localization
.
getText
(
"ZipEntryManager.unknownValue"
);
private
static
final
Predicate
<
ZipEntryNode
>
entryDecompressed
=
node
->
(
node
.
getEntry
().
is
Decompress
ed
()
||
node
.
getEntry
().
getErrorType
()
!=
null
);
(
node
.
getEntry
().
is
Load
ed
()
||
node
.
getEntry
().
getErrorType
()
!=
null
);
private
static
final
Predicate
<
ZipEntryNode
>
entryValidated
=
entryDecompressed
.
and
(
node
->
(
node
.
getEntry
().
getModel
()
!=
null
&&
node
.
getEntry
().
getModel
().
isValidated
()));
...
...
@@ -383,8 +383,8 @@ public class ZipEntryManager {
}
else
{
erroneousValue
.
setText
(
Localization
.
getText
(
"ZipEntryManager.no"
));
loadBtn
.
setDisable
(!
entry
.
is
Decompress
ed
());
decompressBtn
.
setDisable
(
entry
.
is
Decompress
ed
());
loadBtn
.
setDisable
(!
entry
.
is
Load
ed
());
decompressBtn
.
setDisable
(
entry
.
is
Load
ed
());
if
(
entry
.
getModel
()
==
null
)
{
validatedValue
.
setText
(
unknownValueText
);
objectCountValue
.
setText
(
unknownValueText
);
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/ZipEntryNode.java
+
1
-
1
View file @
569ad96a
...
...
@@ -25,7 +25,7 @@ public class ZipEntryNode {
return
Color
.
RED
;
}
return
Color
.
BLUE
;
}
else
if
(
entry
.
is
Decompress
ed
())
{
}
else
if
(
entry
.
is
Load
ed
())
{
return
Color
.
BLUE
;
}
else
{
return
Color
.
BLACK
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets