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
5ce55ce5
Commit
5ce55ce5
authored
5 years ago
by
Moemoea Fierin
Browse files
Options
Downloads
Patches
Plain Diff
[ZOOM] Rescaled the var "cran" and "spaces"
parent
48fd6247
No related branches found
No related tags found
1 merge request
!287
Resolve "Zoom on all diagrams"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/avatardd/ADDArtifact.java
+31
-16
31 additions, 16 deletions
src/main/java/ui/avatardd/ADDArtifact.java
with
31 additions
and
16 deletions
src/main/java/ui/avatardd/ADDArtifact.java
+
31
−
16
View file @
5ce55ce5
...
...
@@ -56,14 +56,22 @@ import java.awt.*;
* @author Ludovic APVRILLE
*/
public
class
ADDArtifact
extends
TGCWithoutInternalComponent
implements
SwallowedTGComponent
,
WithAttributes
{
protected
int
lineLength
=
5
;
//
protected int lineLength = 5;
// protected int textX = 5;
// protected int textY = 15;
protected
int
textY2
=
35
;
protected
int
space
=
5
;
protected
int
fileX
=
20
;
protected
int
fileY
=
25
;
protected
int
cran
=
5
;
// Issue #31
private
static
final
int
SPACE
=
5
;
private
static
final
int
CRAN
=
5
;
private
static
final
int
FILE_X
=
20
;
private
static
final
int
FILE_Y
=
25
;
// protected int textY2 = 35;
// protected int space = 5;
// protected int fileX = 20;
// protected int fileY = 25;
// protected int cran = 5;
protected
String
oldValue
=
""
;
protected
String
referenceTaskName
=
"referenceToBlock"
;
...
...
@@ -71,7 +79,7 @@ public class ADDArtifact extends TGCWithoutInternalComponent implements Swallowe
public
ADDArtifact
(
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
);
//Issue #31
textY
=
15
;
textX
=
5
;
width
=
75
;
...
...
@@ -107,25 +115,32 @@ public class ADDArtifact extends TGCWithoutInternalComponent implements Swallowe
g
.
fillRect
(
x
+
1
,
y
+
1
,
width
-
1
,
height
-
1
);
g
.
setColor
(
c
);
// Issue #31
final
int
space
=
scale
(
SPACE
);
final
int
marginFileX
=
scale
(
SPACE
+
FILE_X
);
final
int
marginFileY
=
scale
(
SPACE
+
FILE_Y
);
final
int
marginCran
=
scale
(
SPACE
+
CRAN
);
//g.drawRoundRect(x, y, width, height, arc, arc);
g
.
drawLine
(
x
+
width
-
space
-
f
ileX
,
y
+
space
,
x
+
width
-
space
-
f
ileX
,
y
+
space
+
f
ileY
);
g
.
drawLine
(
x
+
width
-
space
-
f
ileX
,
y
+
space
,
x
+
width
-
space
-
c
ran
,
y
+
space
);
g
.
drawLine
(
x
+
width
-
space
-
c
ran
,
y
+
space
,
x
+
width
-
space
,
y
+
space
+
c
ran
);
g
.
drawLine
(
x
+
width
-
space
,
y
+
space
+
c
ran
,
x
+
width
-
space
,
y
+
space
+
f
ileY
);
g
.
drawLine
(
x
+
width
-
space
,
y
+
space
+
f
ileY
,
x
+
width
-
space
-
f
ileX
,
y
+
space
+
f
ileY
);
g
.
drawLine
(
x
+
width
-
space
-
c
ran
,
y
+
space
,
x
+
width
-
space
-
cran
,
y
+
space
+
c
ran
);
g
.
drawLine
(
x
+
width
-
space
-
cran
,
y
+
space
+
c
ran
,
x
+
width
-
space
,
y
+
space
+
c
ran
);
g
.
drawLine
(
x
+
width
-
marginF
ileX
,
y
+
space
,
x
+
width
-
marginF
ileX
,
y
+
marginF
ileY
);
g
.
drawLine
(
x
+
width
-
marginF
ileX
,
y
+
space
,
x
+
width
-
marginC
ran
,
y
+
space
);
g
.
drawLine
(
x
+
width
-
marginC
ran
,
y
+
space
,
x
+
width
-
space
,
y
+
marginC
ran
);
g
.
drawLine
(
x
+
width
-
space
,
y
+
marginC
ran
,
x
+
width
-
space
,
y
+
marginF
ileY
);
g
.
drawLine
(
x
+
width
-
space
,
y
+
marginF
ileY
,
x
+
width
-
marginF
ileX
,
y
+
marginF
ileY
);
g
.
drawLine
(
x
+
width
-
marginC
ran
,
y
+
space
,
x
+
width
-
marginCran
,
y
+
marginC
ran
);
g
.
drawLine
(
x
+
width
-
marginCran
,
y
+
marginC
ran
,
x
+
width
-
space
,
y
+
marginC
ran
);
g
.
drawImage
(
scale
(
IconManager
.
img9
),
x
+
scale
(
width
-
space
-
f
ileX
+
3
),
y
+
scale
(
space
+
7
),
null
);
g
.
drawImage
(
scale
(
IconManager
.
img9
),
x
+
scale
(
width
-
marginF
ileX
+
3
),
y
+
scale
(
space
+
7
),
null
);
drawSingleString
(
g
,
value
,
x
+
textX
,
y
+
textY
);
}
public
void
setValue
(
String
val
,
Graphics
g
)
{
final
int
marginFileX
=
scale
(
SPACE
+
FILE_X
);
oldValue
=
value
;
int
w
=
g
.
getFontMetrics
().
stringWidth
(
value
);
int
w1
=
Math
.
max
(
minWidth
,
w
+
2
*
textX
+
fileX
+
space
);
int
w1
=
Math
.
max
(
minWidth
,
w
+
2
*
textX
+
marginFileX
);
//
if
(
w1
!=
width
)
{
...
...
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