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
fc217f67
Commit
fc217f67
authored
10 years ago
by
Andrea Enrici
Browse files
Options
Downloads
Patches
Plain Diff
Changed the dialog window to add parameters to CP SD messages
parent
2e73bf0c
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/ui/tmlsd/TGConnectorMessageTMLSD.java
+51
-19
51 additions, 19 deletions
src/ui/tmlsd/TGConnectorMessageTMLSD.java
with
51 additions
and
19 deletions
src/ui/tmlsd/TGConnectorMessageTMLSD.java
+
51
−
19
View file @
fc217f67
...
...
@@ -46,8 +46,6 @@ knowledge of the CeCILL license and that you accept its terms.
package
ui.tmlsd
;
//import java.awt.*;
//import java.awt.geom.*;
import
javax.swing.*
;
...
...
@@ -55,10 +53,14 @@ import java.util.*;
import
myutil.*
;
import
ui.*
;
import
ui.window.*
;
import
org.w3c.dom.*
;
public
abstract
class
TGConnectorMessageTMLSD
extends
TGConnector
{
public
abstract
class
TGConnectorMessageTMLSD
extends
TGConnector
{
protected
int
arrowLength
=
10
;
protected
int
widthValue
,
heightValue
;
protected
int
nParam
=
5
;
protected
String
[]
params
=
new
String
[
nParam
];
public
TGConnectorMessageTMLSD
(
int
_x
,
int
_y
,
int
_minX
,
int
_minY
,
int
_maxX
,
int
_maxY
,
boolean
_pos
,
TGComponent
_father
,
TDiagramPanel
_tdp
,
TGConnectingPoint
_p1
,
TGConnectingPoint
_p2
,
Vector
_listPoint
)
{
super
(
_x
,
_y
,
_minX
,
_minY
,
_maxX
,
_maxY
,
_pos
,
_father
,
_tdp
,
_p1
,
_p2
,
_listPoint
);
...
...
@@ -132,25 +134,55 @@ public abstract class TGConnectorMessageTMLSD extends TGConnector {
return
true
;
}
public
boolean
editOndoubleClick
(
JFrame
frame
)
{
//System.out.println("Double click");
String
text
=
getName
()
+
": "
;
if
(
hasFather
())
{
text
=
getTopLevelName
()
+
" / "
+
text
;
@Override
public
boolean
editOndoubleClick
(
JFrame
frame
)
{
String
[]
labels
=
new
String
[
nParam
+
1
];
String
[]
values
=
new
String
[
nParam
+
1
];
labels
[
0
]
=
"Message name"
;
values
[
0
]
=
this
.
name
;
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
{
labels
[
i
+
1
]
=
"Param #"
+
(
i
+
1
);
values
[
i
+
1
]
=
params
[
i
];
}
JDialogMultiString
jdms
=
new
JDialogMultiString
(
frame
,
"Setting message properties"
,
nParam
+
1
,
labels
,
values
);
jdms
.
setSize
(
350
,
300
);
GraphicLib
.
centerOnParent
(
jdms
);
jdms
.
show
();
// blocked until dialog has been closed
if
(
jdms
.
hasBeenSet
()
&&
(
jdms
.
hasValidString
(
0
)))
{
this
.
name
=
jdms
.
getString
(
0
);
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
{
params
[
i
]
=
jdms
.
getString
(
i
+
1
);
}
String
s
=
(
String
)
JOptionPane
.
showInputDialog
(
frame
,
text
,
"setting message value"
,
JOptionPane
.
PLAIN_MESSAGE
,
IconManager
.
imgic100
,
null
,
getValue
());
if
((
s
!=
null
)
&&
(
s
.
length
()
>
0
))
{
setValue
(
s
);
return
true
;
makeValue
();
return
true
;
}
return
false
;
}
public
void
makeValue
()
{
boolean
first
=
true
;
value
=
this
.
name
+
"("
;
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
{
if
(
params
[
i
].
length
()
>
0
)
{
if
(
!
first
)
{
value
+=
", "
+
params
[
i
];
}
else
{
first
=
false
;
value
+=
params
[
i
];
}
}
return
false
;
}
value
+=
")"
;
}
public
String
[]
getParams
()
{
return
params
;
}
public
TGComponent
extraIsOnOnlyMe
(
int
x1
,
int
y1
)
{
//System.out.println("Extra");
if
(
GraphicLib
.
isInRectangle
(
x1
,
y1
,
((
p1
.
getX
()
+
p2
.
getX
())
/
2
)-
widthValue
/
2
,
((
p1
.
getY
()
+
p2
.
getY
())
/
2
)
-
5
-
heightValue
,
widthValue
,
heightValue
))
{
...
...
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