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
79ae02d4
Commit
79ae02d4
authored
7 years ago
by
Fabien Tessier
Browse files
Options
Downloads
Patches
Plain Diff
Config network load to create .ttool project
parent
f9283e5c
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
+20
-2
20 additions, 2 deletions
...ava/ui/networkmodelloader/JDialogLoadingNetworkModel.java
with
20 additions
and
2 deletions
src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java
+
20
−
2
View file @
79ae02d4
...
...
@@ -43,13 +43,14 @@ package ui.networkmodelloader;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.io.File
;
import
java.util.*
;
import
javax.swing.*
;
import
java.io.*
;
import
common.ConfigurationTTool
;
import
common.SpecConfigTTool
;
import
ui.*
;
import
ui.file.TFileFilter
;
import
myutil.*
;
import
ui.util.IconManager
;
...
...
@@ -361,7 +362,24 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
this
.
dispose
();
SwingUtilities
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
mgui
.
openProjectFromFile
(
new
File
(
filePath
));
File
dir
=
new
File
(
filePath
.
replace
(
".xml"
,
""
));
dir
=
FileUtils
.
addFileExtensionIfMissing
(
dir
,
"ttool"
);
dir
.
mkdir
();
SpecConfigTTool
.
setDirConfig
(
dir
);
File
config
=
SpecConfigTTool
.
createProjectConfig
(
dir
);
try
{
SpecConfigTTool
.
loadConfigFile
(
config
);
}
catch
(
MalformedConfigurationException
e
)
{
System
.
err
.
println
(
e
.
getMessage
()
+
" : Can't load config file."
);
}
File
file
=
new
File
(
filePath
);
file
=
FileUtils
.
addFileExtensionIfMissing
(
file
,
TFileFilter
.
getExtension
());
try
{
FileUtils
.
moveFileToDirectory
(
file
,
dir
,
false
);
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
e
.
getMessage
()
+
" : Network loading failed"
);
}
mgui
.
openProjectFromFile
(
dir
);
// Here, we can safely update the GUI
// because we'll be called from the
// event dispatch thread
...
...
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