Skip to content
Snippets Groups Projects
Commit e3c66340 authored by Daniela Genius's avatar Daniela Genius
Browse files

modified ADDCPUNode.java to fit clustered version

parent 0616b924
No related branches found
No related tags found
1 merge request!72Syscams
......@@ -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;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment