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
5c129937
Commit
5c129937
authored
7 years ago
by
apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Update on countermeasures: first stable version
parent
3fec4583
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/ui/atd/ATDCountermeasure.java
+24
-16
24 additions, 16 deletions
src/ui/atd/ATDCountermeasure.java
src/ui/images/atdcountermeasure.gif
+0
-0
0 additions, 0 deletions
src/ui/images/atdcountermeasure.gif
with
24 additions
and
16 deletions
src/ui/atd/ATDCountermeasure.java
+
24
−
16
View file @
5c129937
...
@@ -67,7 +67,7 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
...
@@ -67,7 +67,7 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
protected
String
description
=
""
;
protected
String
description
=
""
;
private
String
stereotype
=
"countermeasure"
;
private
String
stereotype
=
"countermeasure"
;
private
static
int
d
ecPar
=
2
0
;
private
static
double
percentageD
ecPar
=
0
.15
;
private
static
int
maxFontSize
=
14
;
private
static
int
maxFontSize
=
14
;
private
static
int
minFontSize
=
4
;
private
static
int
minFontSize
=
4
;
...
@@ -86,15 +86,15 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
...
@@ -86,15 +86,15 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
connectingPoint
=
new
TGConnectingPoint
[
12
];
connectingPoint
=
new
TGConnectingPoint
[
12
];
connectingPoint
[
0
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.5
,
0.0
);
connectingPoint
[
0
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.5
,
0.0
);
connectingPoint
[
1
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
,
0.5
);
connectingPoint
[
1
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
-
percentageDecPar
/
2
,
0.5
);
connectingPoint
[
2
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
,
0.5
);
connectingPoint
[
2
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
+
percentageDecPar
/
2
,
0.5
);
connectingPoint
[
3
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.5
,
1.0
);
connectingPoint
[
3
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.5
,
1.0
);
connectingPoint
[
4
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.25
,
0.0
);
connectingPoint
[
4
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.25
,
0.0
);
connectingPoint
[
5
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.75
,
0.0
);
connectingPoint
[
5
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.75
,
0.0
);
connectingPoint
[
6
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
,
0.25
);
connectingPoint
[
6
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
-
percentageDecPar
/
4
,
0.25
);
connectingPoint
[
7
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
,
0.25
);
connectingPoint
[
7
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
+
percentageDecPar
*
0.75
,
0.25
);
connectingPoint
[
8
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
,
0.75
);
connectingPoint
[
8
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.0
-
percentageDecPar
*
0.75
,
0.75
);
connectingPoint
[
9
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
,
0.75
);
connectingPoint
[
9
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
1.0
+
percentageDecPar
*
0.25
,
0.75
);
connectingPoint
[
10
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.25
,
1.0
);
connectingPoint
[
10
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.25
,
1.0
);
connectingPoint
[
11
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.75
,
1.0
);
connectingPoint
[
11
]
=
new
ATDCountermeasureConnectingPoint
(
this
,
0
,
0
,
true
,
true
,
0.75
,
1.0
);
//addTGConnectingPointsComment();
//addTGConnectingPointsComment();
...
@@ -141,14 +141,13 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
...
@@ -141,14 +141,13 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
}
}
// Core of the countermeasure
// Core of the countermeasure
Color
c
=
g
.
getColor
();
Color
c
=
g
.
getColor
();
Polygon
p
=
new
Polygon
();
Polygon
p
=
getMyPolygon
();
g
.
draw3DRect
(
x
,
y
,
width
,
height
,
true
);
g
.
setColor
(
ColorManager
.
ATD_COUNTERMEASURE
);
g
.
setColor
(
ColorManager
.
ATD_COUNTERMEASURE
);
g
.
fillPolygon
(
p
);
g
.
setColor
(
c
);
g
.
drawPolygon
(
p
);
g
.
fill3DRect
(
x
+
1
,
y
+
1
,
width
-
1
,
height
-
1
,
true
);
g
.
setColor
(
c
);
// Strings
// Strings
int
w
;
int
w
;
...
@@ -204,6 +203,15 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
...
@@ -204,6 +203,15 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
}
}
private
Polygon
getMyPolygon
()
{
Polygon
p
=
new
Polygon
();
p
.
addPoint
(
x
,
y
);
p
.
addPoint
((
int
)(
x
+
width
+(
percentageDecPar
*
width
)),
y
);
p
.
addPoint
(
x
+
width
,
y
+
height
);
p
.
addPoint
((
int
)(
x
-(
percentageDecPar
*
width
)),
y
+
height
);
return
p
;
}
public
void
setValue
(
String
val
,
Graphics
g
)
{
public
void
setValue
(
String
val
,
Graphics
g
)
{
oldValue
=
value
;
oldValue
=
value
;
String
ster
;
String
ster
;
...
@@ -285,10 +293,10 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
...
@@ -285,10 +293,10 @@ public class ATDCountermeasure extends TGCScalableWithInternalComponent implemen
}
}
public
TGComponent
isOnOnlyMe
(
int
x1
,
int
y1
)
{
public
TGComponent
isOnOnlyMe
(
int
x1
,
int
y1
)
{
Polygon
p
=
getMyPolygon
();
if
(
GraphicLib
.
isInRectangle
(
x1
,
y1
,
x
,
y
,
width
,
height
))
{
if
(
p
.
contains
(
x1
,
y1
))
{
return
this
;
return
this
;
}
}
return
null
;
return
null
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/ui/images/atdcountermeasure.gif
+
0
−
0
View replaced file @
3fec4583
View file @
5c129937
100 B
|
W:
|
H:
104 B
|
W:
|
H:
2-up
Swipe
Onion skin
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