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
119179fd
Commit
119179fd
authored
7 years ago
by
Fabien Tessier
Browse files
Options
Downloads
Patches
Plain Diff
Add FileChooser for model network load
parent
fb530d95
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java
+20
-8
20 additions, 8 deletions
...ava/ui/networkmodelloader/JDialogLoadingNetworkModel.java
ttool/launch_configurations/config.xml
+2
-12
2 additions, 12 deletions
ttool/launch_configurations/config.xml
with
22 additions
and
20 deletions
src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java
+
20
−
8
View file @
119179fd
...
@@ -97,6 +97,7 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
...
@@ -97,6 +97,7 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
private
String
url
;
private
String
url
;
private
NetworkModelPanel
panel
;
private
NetworkModelPanel
panel
;
private
String
filePath
;
private
String
filePath
;
private
JFileChooser
jfc
;
/** Creates new form */
/** Creates new form */
...
@@ -124,6 +125,13 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
...
@@ -124,6 +125,13 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
protected
void
myInitComponents
()
{
protected
void
myInitComponents
()
{
if
(
ConfigurationTTool
.
DownloadedFILEPath
.
length
()
>
0
)
{
jfc
=
new
JFileChooser
(
ConfigurationTTool
.
DownloadedFILEPath
);
}
else
{
jfc
=
new
JFileChooser
();
}
mode
=
NOT_LISTED
;
mode
=
NOT_LISTED
;
setButtons
();
setButtons
();
}
}
...
@@ -356,14 +364,18 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
...
@@ -356,14 +364,18 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac
jta
.
append
(
"Loading model: "
+
fileName
);
jta
.
append
(
"Loading model: "
+
fileName
);
String
urlToLoad
=
URLManager
.
getBaseURL
(
url
)
+
fileName
;
String
urlToLoad
=
URLManager
.
getBaseURL
(
url
)
+
fileName
;
URLManager
urlm
=
new
URLManager
();
URLManager
urlm
=
new
URLManager
();
if
((
ConfigurationTTool
.
DownloadedFILEPath
==
null
)
||
(
ConfigurationTTool
.
DownloadedFILEPath
.
length
()
==
0
))
{
jfc
.
setSelectedFile
(
new
File
(
FileUtils
.
removeFileExtension
(
fileName
)));
filePath
=
fileName
;
int
returnVal
=
jfc
.
showSaveDialog
(
f
);
}
else
{
if
(
returnVal
==
JFileChooser
.
APPROVE_OPTION
)
{
filePath
=
ConfigurationTTool
.
DownloadedFILEPath
+
"/"
+
fileName
;
filePath
=
jfc
.
getSelectedFile
().
getAbsolutePath
();
}
filePath
=
FileUtils
.
addFileExtensionIfMissing
(
filePath
,
"xml"
);
boolean
ok
=
urlm
.
downloadFile
(
filePath
,
urlToLoad
,
this
);
boolean
ok
=
urlm
.
downloadFile
(
filePath
,
urlToLoad
,
this
);
if
(!
ok
)
{
if
(!
ok
)
{
loadFailed
();
loadFailed
();
}
}
else
{
panel
.
reactivateSelection
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ttool/launch_configurations/config.xml
+
2
−
12
View file @
119179fd
...
@@ -68,20 +68,10 @@
...
@@ -68,20 +68,10 @@
<PLUGIN_JAVA_CODE_GENERATOR
data=
"../plugins/CustomizerAvatarCodeGeneration.jar"
/>
<PLUGIN_JAVA_CODE_GENERATOR
data=
"../plugins/CustomizerAvatarCodeGeneration.jar"
/>
<<<<<<
< HEAD
<LastOpenFile
data=
"/home/satan/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.ttool"
/>
<<<<<<<
Upstream,
based
on
origin/project_manager
<LastOpenFile
data=
"/home/satan/ZigBeeTutorial.ttool/ZigBeeTutorial.xml"
/>
=======
<LastOpenFile
data=
"/home/dblouin/Projets/TTool/git/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.xml"
/>
>>>>>>> 4749348 Issue #98: Fixed default C Code generation directory
=======
<LastOpenFile
data=
"/home/dblouin/Projets/TTool/git/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.xml"
/>
>>>>>>> ac0a9cec52efa7fb18b9e7e8f72519b069f3c727
<LastWindowAttributes
x=
"65"
y=
"24"
width=
"1301"
height=
"744"
max=
"true"
/>
<LastWindowAttributes
x=
"65"
y=
"24"
width=
"1301"
height=
"744"
max=
"true"
/>
<ProVerifHash
data=
"
-695076237
"
/>
<ProVerifHash
data=
"
1427594573
"
/>
</TURTLECONFIGURATION>
</TURTLECONFIGURATION>
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