Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
5625b20c
Commit
5625b20c
authored
May 21, 2012
by
Florian Hölzl
Browse files
some improvement on lifeline handling
refs 820
parent
5b6011d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.msc.ui/trunk/src/org/fortiss/af3/msc/ui/figure/MSCObjectFigure.java
View file @
5625b20c
...
...
@@ -21,6 +21,7 @@ import static org.fortiss.af3.msc.utils.MSCLayoutConstants.MSC_OBJECT_HEADER_HEI
import
static
org
.
fortiss
.
af3
.
msc
.
utils
.
MSCLayoutConstants
.
MSC_OBJECT_Y
;
import
static
org
.
fortiss
.
af3
.
msc
.
utils
.
MSCLayoutUtil
.
computeLifelineBounds
;
import
static
org
.
fortiss
.
tooling
.
base
.
layout
.
DefaultLayoutConstants
.
DEFAULT_CONNECTOR_SIZE
;
import
static
org
.
fortiss
.
tooling
.
base
.
layout
.
DefaultLayoutConstants
.
DEFAULT_SHAPE_INSETS
;
import
org.eclipse.draw2d.Figure
;
import
org.eclipse.draw2d.RectangleFigure
;
...
...
@@ -34,7 +35,7 @@ import org.fortiss.tooling.base.ui.editpart.figure.PrettyRoundedRectangle;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating
GREEN
Hash: B
BBF812AD0ACC3CFA10FF5D0474E5552
* @ConQAT.Rating
YELLOW
Hash: B
99E92E7989C98FAFC3BEF8C7FD7240A
*/
public
class
MSCObjectFigure
extends
Figure
{
...
...
@@ -83,7 +84,8 @@ public class MSCObjectFigure extends Figure {
java
.
awt
.
Rectangle
llb
=
computeLifelineBounds
(
new
java
.
awt
.
Rectangle
(
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
));
lifelineFigure
.
setBounds
(
new
Rectangle
(
llb
.
x
,
llb
.
y
,
llb
.
width
,
llb
.
height
));
lifelineFigure
.
setBounds
(
new
Rectangle
(
llb
.
x
+
DEFAULT_SHAPE_INSETS
,
llb
.
y
,
llb
.
width
-
2
*
DEFAULT_SHAPE_INSETS
,
llb
.
height
));
Rectangle
mscObjectBounds
=
new
Rectangle
(
headerX
,
headerY
,
headerWidth
,
rect
.
height
);
super
.
setBounds
(
mscObjectBounds
);
...
...
org.fortiss.af3.msc/trunk/src/org/fortiss/af3/msc/utils/MSCLayoutUtil.java
View file @
5625b20c
...
...
@@ -61,16 +61,18 @@ import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
F05E2BBD9D7EA16F51A43074E0324F1C
* @ConQAT.Rating
YELLOW
Hash:
9A59064ACEE8C8E1DC628E3FE7C4107A
*/
public
class
MSCLayoutUtil
{
/** Computes the lifeline bounds. */
public
static
Rectangle
computeLifelineBounds
(
Rectangle
mscBounds
)
{
int
lifelineX
=
mscBounds
.
getLocation
().
x
+
mscBounds
.
width
/
2
-
DEFAULT_GRID_SIZE
/
2
;
int
lifelineX
=
mscBounds
.
getLocation
().
x
+
mscBounds
.
width
/
2
-
DEFAULT_GRID_SIZE
-
DEFAULT_SHAPE_INSETS
;
int
lifelineY
=
MSC_OBJECT_Y
+
MSC_OBJECT_HEADER_HEIGHT
;
int
lifelineWidth
=
DEFAULT_GRID_SIZE
;
int
lifelineWidth
=
2
*
(
DEFAULT_GRID_SIZE
+
DEFAULT_SHAPE_INSETS
)
;
int
lifelineHeight
=
mscBounds
.
height
-
MSC_OBJECT_HEADER_HEIGHT
;
if
(
lifelineHeight
<
MINIMUM_MSC_OBJECT_LIFELINE_HEIGHT
)
{
lifelineHeight
=
MINIMUM_MSC_OBJECT_LIFELINE_HEIGHT
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment