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
ed4de1f8
Commit
ed4de1f8
authored
4 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Adding graph dir selection ticket 50
parent
62952c0f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/window/JDialogAvatarModelChecker.java
+39
-2
39 additions, 2 deletions
src/main/java/ui/window/JDialogAvatarModelChecker.java
with
39 additions
and
2 deletions
src/main/java/ui/window/JDialogAvatarModelChecker.java
+
39
−
2
View file @
ed4de1f8
...
...
@@ -48,6 +48,7 @@ import avatartranslator.modelchecker.SpecificationActionLoop;
import
avatartranslator.modelchecker.SpecificationReachability
;
import
avatartranslator.modelchecker.SpecificationPropertyPhase
;
import
myutil.*
;
import
org.apache.commons.io.FilenameUtils
;
import
ui.util.IconManager
;
import
ui.MainGUI
;
import
ui.TGComponent
;
...
...
@@ -84,6 +85,8 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
private
final
static
Color
[]
COLORS
=
{
Color
.
darkGray
,
Color
.
magenta
,
Color
.
red
,
Color
.
blue
};
private
final
static
String
[]
WORD_BITS
=
{
"32 bits"
,
"16 bits"
,
"8 bits"
};
private
final
static
String
[]
SEARCH_TYPE
=
{
"BFS"
,
"DFS"
};
private
final
static
String
RG_NAME
=
"rgavatar$.aut"
;
public
final
static
int
REACHABILITY_ALL
=
1
;
...
...
@@ -180,6 +183,7 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
protected
JCheckBox
saveGraphAUT
,
saveGraphDot
,
ignoreEmptyTransitions
,
ignoreInternalStates
,
ignoreConcurrenceBetweenInternalActions
,
generateDesign
;
protected
JButton
graphDirButton
,
graphPathDotButton
;
protected
JTextField
graphPath
,
graphPathDot
;
protected
JTabbedPane
jp1
;
protected
JScrollPane
jsp
;
...
...
@@ -207,10 +211,10 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
spec
=
_spec
;
if
(
graphDir
==
null
)
{
graphDir
=
_graphDir
+
File
.
separator
+
"rgavatar$.aut"
;
graphDir
=
_graphDir
+
File
.
separator
+
RG_NAME
;
}
if
(
graphDirDot
==
null
)
{
graphDirDot
=
_graphDir
+
File
.
separator
+
"rgavatar$.dot"
;
graphDirDot
=
_graphDir
+
File
.
separator
+
RG_NAME
;
}
countertracePath
=
"trace$.txt"
;
...
...
@@ -529,18 +533,30 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
// RG
copt
.
gridwidth
=
GridBagConstraints
.
REMAINDER
;
//end row
saveGraphAUT
=
new
JCheckBox
(
"Reachability Graph Generation"
,
graphSelected
);
saveGraphAUT
.
addActionListener
(
this
);
//saveGraphAUT.addSelectionListener(this);
jpopt
.
add
(
saveGraphAUT
,
copt
);
copt
.
gridwidth
=
1
;
graphPath
=
new
JTextField
(
graphDir
);
jpopt
.
add
(
graphPath
,
copt
);
copt
.
gridwidth
=
GridBagConstraints
.
REMAINDER
;
//end row
graphDirButton
=
new
JButton
(
"Select another directory"
,
IconManager
.
imgic22
);
graphDirButton
.
addActionListener
(
this
);
jpopt
.
add
(
graphDirButton
,
copt
);
saveGraphDot
=
new
JCheckBox
(
"Save RG in dotty:"
,
graphSelectedDot
);
saveGraphDot
.
addActionListener
(
this
);
//saveGraphDot.setEnebaled(false);
jpopt
.
add
(
saveGraphDot
,
copt
);
copt
.
gridwidth
=
1
;
graphPathDot
=
new
JTextField
(
graphDirDot
);
jpopt
.
add
(
graphPathDot
,
copt
);
copt
.
gridwidth
=
GridBagConstraints
.
REMAINDER
;
//end row
graphPathDotButton
=
new
JButton
(
"Select another directory"
,
IconManager
.
imgic22
);
graphPathDotButton
.
addActionListener
(
this
);
jpopt
.
add
(
graphPathDotButton
,
copt
);
c
.
add
(
jpopt
,
BorderLayout
.
NORTH
);
...
...
@@ -688,11 +704,29 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
setButtons
();
}
else
if
(
evt
.
getSource
()
==
ignoreInternalStates
)
{
setButtons
();
}
else
if
(
evt
.
getSource
()
==
graphDirButton
)
{
selectDirectoryDir
(
graphPath
);
}
else
if
(
evt
.
getSource
()
==
graphPathDotButton
)
{
selectDirectoryDir
(
graphPathDot
);
}
else
{
setButtons
();
}
}
public
void
selectDirectoryDir
(
JTextField
field
)
{
JFileChooser
jfc
=
new
JFileChooser
(
FilenameUtils
.
getPath
(
field
.
getText
()));
jfc
.
setFileSelectionMode
(
JFileChooser
.
DIRECTORIES_ONLY
);
jfc
.
setAcceptAllFileFilterUsed
(
false
);
int
returnVal
=
jfc
.
showDialog
(
this
,
"Select directory"
);
if
(
returnVal
!=
JFileChooser
.
APPROVE_OPTION
)
{
return
;
}
File
directory
=
jfc
.
getSelectedFile
();
field
.
setText
(
directory
+
File
.
separator
+
RG_NAME
);
}
public
void
closeDialog
()
{
if
(
mode
==
STARTED
)
{
stopProcess
();
...
...
@@ -1183,8 +1217,11 @@ public class JDialogAvatarModelChecker extends javax.swing.JFrame implements Act
protected
void
setButtons
()
{
graphSelected
=
saveGraphAUT
.
isSelected
();
graphPath
.
setEnabled
(
saveGraphAUT
.
isSelected
());
graphDirButton
.
setEnabled
(
saveGraphAUT
.
isSelected
());
graphSelectedDot
=
saveGraphDot
.
isSelected
();
saveGraphDot
.
setEnabled
(
saveGraphAUT
.
isSelected
());
graphPathDotButton
.
setEnabled
(
saveGraphDot
.
isSelected
()
&&
saveGraphAUT
.
isSelected
());
graphPathDot
.
setEnabled
(
saveGraphDot
.
isSelected
()
&&
saveGraphAUT
.
isSelected
());
if
(
generateDesign
!=
null
)
{
generateDesignSelected
=
generateDesign
.
isSelected
();
...
...
This diff is collapsed.
Click to expand it.
Ludovic Apvrille
@ludovic.apvrille
mentioned in issue
#50 (closed)
·
4 years ago
mentioned in issue
#50 (closed)
mentioned in issue #50
Toggle commit list
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