Skip to content
Snippets Groups Projects
Commit 99c80c98 authored by Moemoea Fierin's avatar Moemoea Fierin
Browse files

[ZOOM] Issue #31 Avatar Meth. Defined minHeight and width

parent 4e6ccb2e
No related branches found
No related tags found
1 merge request!287Resolve "Zoom on all diagrams"
...@@ -64,8 +64,8 @@ import java.awt.*; ...@@ -64,8 +64,8 @@ import java.awt.*;
*/ */
public class AvatarMADAssumption extends TGCScalableWithInternalComponent implements WithAttributes, TGAutoAdjust { public class AvatarMADAssumption extends TGCScalableWithInternalComponent implements WithAttributes, TGAutoAdjust {
public String oldValue; public String oldValue;
protected int textX = 5; //protected int textX = 5;
protected int textY = 22; //protected int textY = 22;
protected int lineHeight = 30; protected int lineHeight = 30;
private double dlineHeight = 0.0; private double dlineHeight = 0.0;
//protected int reqType = 0; //protected int reqType = 0;
...@@ -110,7 +110,8 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem ...@@ -110,7 +110,8 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem
public AvatarMADAssumption(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMADAssumption(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); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
textX = 5;
textY = 22;
initScaling(200, 120); initScaling(200, 120);
oldScaleFactor = tdp.getZoom(); oldScaleFactor = tdp.getZoom();
dlineHeight = lineHeight * oldScaleFactor; dlineHeight = lineHeight * oldScaleFactor;
...@@ -229,12 +230,9 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem ...@@ -229,12 +230,9 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem
if ((lineHeight > 23) && (width > 23)){ if ((lineHeight > 23) && (width > 23)){
g.drawImage(scale(IconManager.img5100), x + width - scale(iconSize + 1), y + scale(3), Color.yellow, null); g.drawImage(scale(IconManager.img5100), x + width - scale(iconSize + 1), y + scale(3), Color.yellow, null);
} }
//issue #31 text must be readable to be displayed
int fontSize = g.getFont().getSize(); int fontSize = g.getFont().getSize();
if (!isTextReadable(g) || !canTextGoInTheBox(g, fontSize, value, iconSize))
return;
if (displayText) { if (displayText) {
size = currentFontSize - 2; size = currentFontSize - 2;
g.setFont(myFont.deriveFont((float)(myFont.getSize() - 2))); g.setFont(myFont.deriveFont((float)(myFont.getSize() - 2)));
......
...@@ -96,6 +96,11 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp ...@@ -96,6 +96,11 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp
public AvatarMethodologyDiagramName(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyDiagramName(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); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
//Issue #31
minWidth = 10;
minHeight = lineLength;
initScaling(10, 10);
nbConnectingPoint = 0; nbConnectingPoint = 0;
minWidth = 10; minWidth = 10;
nbInternalTGComponent = 0; nbInternalTGComponent = 0;
...@@ -106,7 +111,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp ...@@ -106,7 +111,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp
name = "value "; name = "value ";
initScaling(10, 10);
myImageIcon = IconManager.imgic302; myImageIcon = IconManager.imgic302;
} }
......
...@@ -188,12 +188,15 @@ public abstract class AvatarMethodologyDiagramReference extends TGCScalableWithI ...@@ -188,12 +188,15 @@ public abstract class AvatarMethodologyDiagramReference extends TGCScalableWithI
//g.setColor(ColorManager.AVATAR_REQUIREMENT_TOP); //g.setColor(ColorManager.AVATAR_REQUIREMENT_TOP);
//g.fillRect(x+1, y+1+lineHeight, width-1, height-1-lineHeight); //g.fillRect(x+1, y+1+lineHeight, width-1, height-1-lineHeight);
ColorManager.setColor(g, getState(), 0); ColorManager.setColor(g, getState(), 0);
//if (!isTextReadable(g))
// return;
if (!isTextReadable(g) || !canTextGoInTheBox(g, fontSize, value, ICON_SIZE))
return;
//if ((lineLength > 23) && (width > 23)){ //if ((lineLength > 23) && (width > 23)){
//g.drawImage(IconManager.img5100, x + width - iconSize + 1, y + 3, Color.yellow, null); //g.drawImage(IconManager.img5100, x + width - iconSize + 1, y + 3, Color.yellow, null);
g.drawImage( scale( IconManager.img5100 ), x + width - scale(ICON_SIZE + 1 ), y + scale( 3 ), Color.yellow, null); g.drawImage( scale( IconManager.img5100 ), x + width - scale(ICON_SIZE + 1 ), y + scale( 3 ), Color.yellow, null);
//} //}
if (!isTextReadable(g))
return;
if (displayText) { if (displayText) {
//size = currentFontSize - 2; //size = currentFontSize - 2;
//g.setFont(myFontB); //g.setFont(myFontB);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment