Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGéry Deloge2016-05-11 07:38:27 +0000
committerPatrick Tessier2016-07-01 11:22:01 +0000
commit098878d3d56893f5d767b45d7a5d10ad0444094d (patch)
tree05ac9fd63bde9dab3b9f2ec23cc9d344a602c986 /plugins
parent184eae77538997610368faae86cd00d5628deca7 (diff)
downloadorg.eclipse.papyrus-098878d3d56893f5d767b45d7a5d10ad0444094d.tar.gz
org.eclipse.papyrus-098878d3d56893f5d767b45d7a5d10ad0444094d.tar.xz
org.eclipse.papyrus-098878d3d56893f5d767b45d7a5d10ad0444094d.zip
Bug 459888: [Activity Diagram] The bottom and right margins of
Activities are too big change margins to 10px Change-Id: I2a13b68123356cc6022a5de6370edb67a037c98e Signed-off-by: Géry Deloge <gery.deloge@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigure.java37
1 files changed, 29 insertions, 8 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigure.java
index 6fcf49ed5b7..ffe3fd9bc69 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/ActivityFigure.java
@@ -43,6 +43,18 @@ public class ActivityFigure extends RoundedCompartmentFigure {
*/
protected class ActivityLayoutManager extends AbstractLayout {
+
+ /** right and bottom margin of diagram. Set to 10 to be consistent with left and top margin */
+ private int rightAndBottomMargin = 10;
+
+ public int getRightAndBottomMargin() {
+ return rightAndBottomMargin;
+ }
+
+ public void setRightAndBottomMargin(int rightAndBottomMargin) {
+ this.rightAndBottomMargin = rightAndBottomMargin;
+ }
+
/**
* ---------------------------------------------------| |sterotypeLabel|
* precondition | |--------------| | |QualifiedName
@@ -57,28 +69,29 @@ public class ActivityFigure extends RoundedCompartmentFigure {
*/
@Override
protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
- int minimumWith = 0;
+ int minimumWidth = 0;
int minimumHeight = 0;
+
// take in account the content of the figure activity
if ((getContentFigure().getChildren().size() > 0)) {
IFigure content = (IFigure) getContentFigure().getChildren().get(0);
- minimumWith = content.getPreferredSize().width + 50;
- minimumHeight = content.getPreferredSize().height + 50;
+ minimumWidth = content.getPreferredSize().width + rightAndBottomMargin;
+ minimumHeight = content.getPreferredSize().height + rightAndBottomMargin;
}
// display name
if (getNameLabel() != null) {
- if (getNameLabel().getPreferredSize().width > minimumWith) {
- minimumWith = getNameLabel().getPreferredSize().width;
+ if (getNameLabel().getPreferredSize().width > minimumWidth) {
+ minimumWidth = getNameLabel().getPreferredSize().width;
}
minimumHeight += getNameLabel().getPreferredSize().height;
}
if (getHeaderSingleExecution() != null) {
- if (getHeaderSingleExecution().getBounds().getTopRight().x > minimumWith) {
- minimumWith = getHeaderSingleExecution().getBounds().getTopRight().x;
+ if (getHeaderSingleExecution().getBounds().getTopRight().x > minimumWidth) {
+ minimumWidth = getHeaderSingleExecution().getBounds().getTopRight().x;
}
}
- return new Dimension(minimumWith, minimumHeight);
+ return new Dimension(minimumWidth, minimumHeight);
}
/**
@@ -430,4 +443,12 @@ public class ActivityFigure extends RoundedCompartmentFigure {
public RectangleFigure getCompartmentFigure() {
return fCompartmentFigure;
}
+
+ public void setRightAndBottomMargin(int rightAndBottomMargin){
+ ActivityLayoutManager lm = (ActivityLayoutManager) getLayoutManager();
+
+ if(lm != null){
+ lm.setRightAndBottomMargin(rightAndBottomMargin);
+ }
+ }
}

Back to the top