Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
67833f28
Commit
67833f28
authored
7 years ago
by
Fabien Tessier
Browse files
Options
Downloads
Patches
Plain Diff
Update Loading Network Dialog for project manager merge
parent
0363e097
No related branches found
No related tags found
2 merge requests
!30
Merge project manager into master
,
!29
Resolve "Implement Project Management in TTool"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java
+52
-46
52 additions, 46 deletions
...ava/ui/networkmodelloader/JDialogLoadingNetworkModel.java
with
52 additions
and
46 deletions
src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java
+
52
−
46
View file @
67833f28
...
@@ -246,73 +246,79 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
...
@@ -246,73 +246,79 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
//connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
//connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
TraceManager.addDev("Connection setup 1");*/
TraceManager.addDev("Connection setup 1");*/
BufferedReader
in
=
URLManager
.
getBufferedReader
(
url
);
BufferedReader
in
=
URLManager
.
getBufferedReader
(
url
);
jta
.
append
(
"Connection established...\n"
);
if
(
in
==
null
)
{
String
inputLine
;
jta
.
append
(
"Could not establish a connection to the TTool server\n"
);
NetworkModel
nm
=
null
;
}
else
{
while
((
inputLine
=
in
.
readLine
())
!=
null
)
{
jta
.
append
(
"Connection established...\n"
);
if
(
inputLine
.
startsWith
(
"#FILE"
))
{
String
inputLine
=
null
;
nm
=
new
NetworkModel
(
inputLine
.
substring
(
5
,
inputLine
.
length
()).
trim
());
NetworkModel
nm
=
null
;
listOfModels
.
add
(
nm
);
while
((
inputLine
=
in
.
readLine
())
!=
null
)
{
}
if
(
inputLine
.
startsWith
(
"#FILE"
))
{
nm
=
new
NetworkModel
(
inputLine
.
substring
(
5
,
inputLine
.
length
()).
trim
());
listOfModels
.
add
(
nm
);
}
if
(
inputLine
.
startsWith
(
"-FEATURES"
))
{
if
(
inputLine
.
startsWith
(
"-FEATURES"
))
{
if
(
nm
!=
null
)
{
if
(
nm
!=
null
)
{
String
tmp
=
inputLine
.
substring
(
9
,
inputLine
.
length
()).
trim
().
toLowerCase
();
String
tmp
=
inputLine
.
substring
(
9
,
inputLine
.
length
()).
trim
().
toLowerCase
();
for
(
int
i
=
1
;
i
<
FEATURES
.
length
;
i
++)
{
for
(
int
i
=
1
;
i
<
FEATURES
.
length
;
i
++)
{
nm
.
features
[
i
]
=
tmp
.
indexOf
(
FEATURES
[
i
])
!=
-
1
;
nm
.
features
[
i
]
=
tmp
.
indexOf
(
FEATURES
[
i
])
!=
-
1
;
}
//nm.type = NetworkModel.stringToNetworkModelType(inputLine.substring(5, inputLine.length()).trim());
}
}
//nm.type = NetworkModel.stringToNetworkModelType(inputLine.substring(5, inputLine.length()).trim());
}
}
}
}
if
(
inputLine
.
startsWith
(
"-PROPS"
))
{
if
(
inputLine
.
startsWith
(
"-PROPS"
))
{
if
(
nm
!=
null
)
{
if
(
nm
!=
null
)
{
String
tmp
=
inputLine
.
substring
(
6
,
inputLine
.
length
()).
trim
().
toLowerCase
();
String
tmp
=
inputLine
.
substring
(
6
,
inputLine
.
length
()).
trim
().
toLowerCase
();
for
(
int
i
=
0
;
i
<
PROPS
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
PROPS
.
length
;
i
++)
{
nm
.
props
[
i
]
=
tmp
.
indexOf
(
PROPS
[
i
])
!=
-
1
;
nm
.
props
[
i
]
=
tmp
.
indexOf
(
PROPS
[
i
])
!=
-
1
;
}
//nm.type = NetworkModel.stringToNetworkModelType(inputLine.substring(5, inputLine.length()).trim());
}
}
//nm.type = NetworkModel.stringToNetworkModelType(inputLine.substring(5, inputLine.length()).trim());
}
}
}
if
(
inputLine
.
startsWith
(
"-AUTHOR"
))
{
if
(
inputLine
.
startsWith
(
"-AUTHOR"
))
{
if
(
nm
!=
null
)
{
if
(
nm
!=
null
)
{
nm
.
author
=
inputLine
.
substring
(
7
,
inputLine
.
length
()).
trim
();
nm
.
author
=
inputLine
.
substring
(
7
,
inputLine
.
length
()).
trim
();
}
}
}
}
if
(
inputLine
.
startsWith
(
"-DESCRIPTION"
))
{
if
(
inputLine
.
startsWith
(
"-DESCRIPTION"
))
{
if
(
nm
!=
null
)
{
if
(
nm
!=
null
)
{
nm
.
description
=
inputLine
.
substring
(
12
,
inputLine
.
length
()).
trim
();
nm
.
description
=
inputLine
.
substring
(
12
,
inputLine
.
length
()).
trim
();
}
}
}
}
if
(
inputLine
.
startsWith
(
"-IMG"
))
{
if
(
inputLine
.
startsWith
(
"-IMG"
))
{
if
(
nm
!=
null
)
{
if
(
nm
!=
null
)
{
nm
.
image
=
inputLine
.
substring
(
4
,
inputLine
.
length
()).
trim
();
nm
.
image
=
inputLine
.
substring
(
4
,
inputLine
.
length
()).
trim
();
//TraceManager.addDev("Dealing with image:" + nm.image);
//TraceManager.addDev("Dealing with image:" + nm.image);
//nm.bi = URLManager.getBufferedImageFromURL(URLManager.getBaseURL(url) + nm.image);
//nm.bi = URLManager.getBufferedImageFromURL(URLManager.getBaseURL(url) + nm.image);
}
}
}
//System.out.println(inputLine);
}
}
//System.out.println(inputLine);
jta
.
append
(
"\n"
+
listOfModels
.
size
()
+
" remote models found.\nSelect a model to download it locally and open it.\n\n"
);
mode
=
LISTED
;
panel
.
preparePanel
(
url
);
panel
.
repaint
();
in
.
close
();
// Wait 5seconds before refreshing panel
Thread
.
sleep
(
5000
);
panel
.
repaint
();
}
}
jta
.
append
(
"\n"
+
listOfModels
.
size
()
+
" remote models found.\nSelect a model to download it locally and open it.\n\n"
);
mode
=
LISTED
;
panel
.
preparePanel
(
url
);
panel
.
repaint
();
in
.
close
();
// Wait 5seconds before refreshing panel
Thread
.
sleep
(
5000
);
panel
.
repaint
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jta
.
append
(
"Error when retreiving file: "
+
url
+
"\n No internet connection?\n No right for the Java Virtual Machine to use http connections?\n\n"
);
jta
.
append
(
"Error when retreiving file: "
+
url
+
"\n No internet connection?\n No right for the Java Virtual Machine to use http connections?\n\n"
);
TraceManager
.
addDev
(
"Exception trace in loading network model:"
);
TraceManager
.
addDev
(
"Exception trace in loading network model:"
);
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment