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
96bebddb
Commit
96bebddb
authored
7 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Udding graph capability to specify stylesheet
parent
b4e13640
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/common/ConfigurationTTool.java
+18
-0
18 additions, 0 deletions
src/main/java/common/ConfigurationTTool.java
src/main/java/ui/graph/AUTGraphDisplay.java
+9
-1
9 additions, 1 deletion
src/main/java/ui/graph/AUTGraphDisplay.java
with
27 additions
and
1 deletion
src/main/java/common/ConfigurationTTool.java
+
18
−
0
View file @
96bebddb
...
...
@@ -160,6 +160,8 @@ public class ConfigurationTTool {
public
static
String
URL_MODEL
=
"http://ttool.telecom-paristech.fr/networkmodels/models.txt"
;
// Others
public
static
String
RGStyleSheet
=
""
;
public
static
String
LastOpenFile
=
""
;
public
static
boolean
LastOpenFileDefined
=
false
;
...
...
@@ -172,6 +174,8 @@ public class ConfigurationTTool {
public
static
String
ExternalServer
=
""
;
public
static
String
ProVerifHash
=
""
;
public
static
void
makeDefaultConfiguration
()
{
//System.out.println(Paths.get("").toAbsolutePath().toString());
//System.out.println("User.dir path:" + System.getProperty("user.dir"));
...
...
@@ -496,6 +500,8 @@ public class ConfigurationTTool {
sb
.
append
(
"LastWindowAttributesHeight: "
).
append
(
LastWindowAttributesHeight
).
append
(
"\n"
);
sb
.
append
(
"LastWindowAttributesMax: "
).
append
(
LastWindowAttributesMax
).
append
(
"\n"
);
sb
.
append
(
"\nRG stylesheet configuration:"
).
append
(
RGStyleSheet
).
append
(
"\n"
);
//Huy Truong
sb
.
append
(
"ExternalServer "
).
append
(
ExternalServer
).
append
(
"\n"
);
...
...
@@ -797,6 +803,10 @@ public class ConfigurationTTool {
if
(
nl
.
getLength
()
>
0
)
LastWindowAttributes
(
nl
);
nl
=
doc
.
getElementsByTagName
(
"RGStyleSheet"
);
if
(
nl
.
getLength
()
>
0
)
RGStyleSheet
(
nl
);
nl
=
doc
.
getElementsByTagName
(
"ExternalServer"
);
if
(
nl
.
getLength
()
>
0
)
ExternalServer
(
nl
);
...
...
@@ -1569,6 +1579,14 @@ public class ConfigurationTTool {
}
}
private
static
void
RGStyleSheet
(
NodeList
nl
)
throws
MalformedConfigurationException
{
try
{
Element
elt
=
(
Element
)
(
nl
.
item
(
0
));
RGStyleSheet
=
elt
.
getAttribute
(
"data"
);
}
catch
(
Exception
e
)
{
throw
new
MalformedConfigurationException
(
e
.
getMessage
());
}
}
private
static
void
ExternalServer
(
NodeList
nl
)
throws
MalformedConfigurationException
{
try
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/ui/graph/AUTGraphDisplay.java
+
9
−
1
View file @
96bebddb
...
...
@@ -39,6 +39,7 @@
package
ui.graph
;
import
common.ConfigurationTTool
;
import
common.SpecConfigTTool
;
import
myutil.TraceManager
;
import
org.graphstream.graph.implementations.AbstractEdge
;
...
...
@@ -120,7 +121,13 @@ public class AUTGraphDisplay implements MouseListener, ViewerListener, Runnable
System
.
setProperty
(
"org.graphstream.ui.renderer"
,
"org.graphstream.ui.j2dviewer.J2DGraphRenderer"
);
vGraph
=
new
MultiGraph
(
"TTool graph"
);
vGraph
.
addAttribute
(
"ui.stylesheet"
,
STYLE_SHEET
);
if
((
ConfigurationTTool
.
RGStyleSheet
!=
null
)
&&
(
ConfigurationTTool
.
RGStyleSheet
.
trim
().
length
()
>
0
))
{
TraceManager
.
addDev
(
"Adding stylesheet:"
+
ConfigurationTTool
.
RGStyleSheet
+
"\n\nvs default:"
+
STYLE_SHEET
);
vGraph
.
addAttribute
(
"ui.stylesheet"
,
ConfigurationTTool
.
RGStyleSheet
);
}
else
{
vGraph
.
addAttribute
(
"ui.stylesheet"
,
STYLE_SHEET
);
}
//vGraph.addAttribute("layout.weight", 0.5);
int
cpt
=
0
;
graph
.
computeStates
();
for
(
AUTState
state
:
graph
.
getStates
())
{
...
...
@@ -145,6 +152,7 @@ public class AUTGraphDisplay implements MouseListener, ViewerListener, Runnable
TraceManager.addDev("Transition=" + tmp);*/
edge
.
addAttribute
(
"ui.label"
,
transition
.
transition
);
edge
.
addAttribute
(
"ui.class"
,
"defaultedge"
);
edge
.
addAttribute
(
"layout.weight"
,
0.4
);
if
(!(
transition
.
transition
.
startsWith
(
"i("
)))
{
edge
.
addAttribute
(
"ui.class"
,
"external"
);
}
...
...
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