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
e3c66340
Commit
e3c66340
authored
6 years ago
by
Daniela Genius
Browse files
Options
Downloads
Patches
Plain Diff
modified ADDCPUNode.java to fit clustered version
parent
0616b924
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/avatardd/ADDCPUNode.java
+37
-15
37 additions, 15 deletions
src/main/java/ui/avatardd/ADDCPUNode.java
with
37 additions
and
15 deletions
src/main/java/ui/avatardd/ADDCPUNode.java
+
37
−
15
View file @
e3c66340
...
...
@@ -36,6 +36,9 @@
* knowledge of the CeCILL license and that you accept its terms.
*/
package
ui.avatardd
;
import
myutil.GraphicLib
;
...
...
@@ -73,8 +76,10 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
private
int
dCacheWords
=
0
;
protected
int
index
=
0
;
protected
int
cluster_index
=
0
;
protected
int
monitored
=
0
;
public
ADDCPUNode
(
int
_x
,
int
_y
,
int
_minX
,
int
_maxX
,
int
_minY
,
int
_maxY
,
boolean
_pos
,
TGComponent
_father
,
TDiagramPanel
_tdp
)
{
super
(
_x
,
_y
,
_minX
,
_maxX
,
_minY
,
_maxY
,
_pos
,
_father
,
_tdp
);
...
...
@@ -119,11 +124,11 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
myImageIcon
=
IconManager
.
imgic700
;
}
@Override
public
void
internalDrawing
(
Graphics
g
)
{
Color
c
=
g
.
getColor
();
g
.
draw3DRect
(
x
,
y
,
width
,
height
,
true
);
// Top lines
g
.
drawLine
(
x
,
y
,
x
+
derivationx
,
y
-
derivationy
);
g
.
drawLine
(
x
+
width
,
y
,
x
+
width
+
derivationx
,
y
-
derivationy
);
...
...
@@ -153,7 +158,6 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
g
.
drawImage
(
IconManager
.
img9
,
x
+
width
-
20
,
y
+
4
,
null
);
}
@Override
public
TGComponent
isOnOnlyMe
(
int
x1
,
int
y1
)
{
Polygon
pol
=
new
Polygon
();
...
...
@@ -179,7 +183,6 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
return
name
;
}
@Override
public
boolean
editOndoubleClick
(
JFrame
frame
)
{
boolean
error
=
false
;
String
errors
=
""
;
...
...
@@ -206,6 +209,7 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
}
if
(
dialog
.
getNbOFIRQ
().
length
()
!=
0
)
{
try
{
tmp
=
nbOfIrq
;
...
...
@@ -311,6 +315,8 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
}
/*if (dialog.getClockRatio().length() != 0) {
try {
tmp = clockRatio;
...
...
@@ -326,7 +332,7 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
}*/
if
(
dialog
.
getIndex
().
length
()
!=
0
)
{
if
(
dialog
.
getIndex
().
length
()
!=
0
)
{
try
{
tmp
=
index
;
index
=
Integer
.
decode
(
dialog
.
getIndex
()).
intValue
();
...
...
@@ -341,7 +347,24 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
}
if
(
dialog
.
getMonitored
()
!=
0
)
{
if
(
dialog
.
getIndex
().
length
()
!=
0
)
{
try
{
tmp
=
cluster_index
;
cluster_index
=
Integer
.
decode
(
dialog
.
getIndex
()).
intValue
();
if
(
cluster_index
<
0
)
{
cluster_index
=
tmp
;
error
=
true
;
errors
+=
"cluster index "
;
}
}
catch
(
Exception
e
)
{
error
=
true
;
errors
+=
"cluster index "
;
}
}
if
(
dialog
.
getMonitored
()
!=
0
)
{
try
{
tmp
=
monitored
;
...
...
@@ -368,19 +391,17 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
return
true
;
}
@Override
public
int
getType
()
{
return
TGComponentManager
.
ADD_CPUNODE
;
}
@Override
public
boolean
acceptSwallowedTGComponent
(
TGComponent
tgc
)
{
//TraceManager.addDev("Accept swallowed?");
return
tgc
instanceof
ADDBlockArtifact
;
}
@Override
public
boolean
addSwallowedTGComponent
(
TGComponent
tgc
,
int
x
,
int
y
)
{
//TraceManager.addDev("Add swallowed?");
//Set its coordinates
...
...
@@ -397,7 +418,6 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
@Override
public
void
removeSwallowedTGComponent
(
TGComponent
tgc
)
{
removeInternalComponent
(
tgc
);
}
...
...
@@ -415,7 +435,6 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
return
v
;
}
@Override
public
void
hasBeenResized
()
{
for
(
int
i
=
0
;
i
<
nbInternalTGComponent
;
i
++)
{
if
(
tgcomponent
[
i
]
instanceof
ADDBlockArtifact
)
{
...
...
@@ -425,7 +444,6 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
@Override
protected
String
translateExtraParam
()
{
StringBuffer
sb
=
new
StringBuffer
(
"<extraparam>\n"
);
sb
.
append
(
"<info stereotype=\""
+
stereotype
+
"\" nodeName=\""
+
name
);
...
...
@@ -492,15 +510,15 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
}
}
catch
(
Exception
e
)
{
throw
new
MalformedModelingException
(
e
);
throw
new
MalformedModelingException
();
}
}
@Override
public
int
getDefaultConnector
()
{
return
TGComponentManager
.
ADD_CONNECTOR
;
}
public
String
getAttributes
()
{
String
attr
=
""
;
attr
+=
"Nb of irq = "
+
nbOfIrq
+
"\n"
;
...
...
@@ -546,12 +564,16 @@ public class ADDCPUNode extends ADDNode implements SwallowTGComponent, WithAttri
return
index
;
}
public
int
getClusterIndex
()
{
return
cluster_index
;
}
public
int
getMonitored
()
{
return
monitored
;
}
public
void
setMonitored
(
int
_monitored
){
monitored
=
_monitored
;
monitored
=
_monitored
;
}
}
}
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