Skip to content
Snippets Groups Projects
Commit 68197215 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Better handling of avatar transition info

parent 179c27eb
No related branches found
No related tags found
No related merge requests found
......@@ -193,6 +193,8 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree {
private boolean isScaled;
private boolean overcomeShowing = false;
private boolean drawingMain = true;
//protected Image offScreenBuffer;
......@@ -291,6 +293,10 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree {
}
}
public boolean isDrawingMain() {
return drawingMain;
}
public void updateComponentsAfterZoom() {
//TraceManager.addDev("Zoom factor=" + zoom);
TGComponent tgc;
......@@ -401,6 +407,7 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree {
public void paintMycomponents(Graphics g, boolean b, double w, double h) {
lastGraphics = g;
drawingMain = b;
//TraceManager.addDev("Nb of components: " + componentList.size());
......
......@@ -127,11 +127,15 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
g.setColor(ColorManager.AVATAR_GUARD);
if (tdp.isDrawingMain()) {
width = minWidth;
}
if (guard.length() > 0) {
if (guard.compareTo("[ ]") != 0) {
g.drawString(guard, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(guard), width);
width = Math.max(minWidth, width);
}
......@@ -146,7 +150,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
s = "after (" + afterMin + "," + afterMax + ")";
g.drawString(s, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(s), width);
width = Math.max(minWidth, width);
}
......@@ -155,7 +159,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
s = "after (" + afterMin + ")";
g.drawString(s, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(s), width);
width = Math.max(minWidth, width);
}
......@@ -168,7 +172,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
s = "computeFor (" + computeMin + "," + computeMax + ")";
g.drawString(s, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(s), width);
width = Math.max(minWidth, width);
}
......@@ -177,7 +181,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
s = "computeFor (" + computeMin + ")";
g.drawString(s, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(s), width);
width = Math.max(minWidth, width);
}
......@@ -192,7 +196,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
if (s.length() > 0) {
g.drawString(s, x, y + step);
atLeastOneThing = true;
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
width = Math.max(g.getFontMetrics().stringWidth(s), width);
width = Math.max(minWidth, width);
}
......@@ -225,7 +229,7 @@ public class AvatarSMDTransitionInfo extends TGCWithoutInternalComponent {
if (!tdp.isScaled()) {
if (tdp.isDrawingMain()) {
height = Math.max(step, minHeight);
}
......
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