Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2016-07-25 08:12:28 +0000
committerMaxime Porhel2016-08-22 13:46:48 +0000
commit1025f59755a010701972543326bebe451654070b (patch)
tree8f00d86ff161570209c0a99a832408a9d873c3ed /plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business
parenta08ff7906c9f1e61bad427c7e694d456f70a39ec (diff)
downloadorg.eclipse.sirius-1025f59755a010701972543326bebe451654070b.tar.gz
org.eclipse.sirius-1025f59755a010701972543326bebe451654070b.tar.xz
org.eclipse.sirius-1025f59755a010701972543326bebe451654070b.zip
[perf] Reduce style.getDescription() calls
Change-Id: Id709f9d29331a25414cf188e59c5f3a524f3d360 Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
Diffstat (limited to 'plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business')
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/api/image/ImageSelectorService.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/api/image/ImageSelectorService.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/api/image/ImageSelectorService.java
index 6482dd5248..58905d5ee9 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/api/image/ImageSelectorService.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/api/image/ImageSelectorService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2012, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,6 +56,7 @@ import org.eclipse.sirius.viewpoint.Customizable;
import org.eclipse.sirius.viewpoint.LabelStyle;
import org.eclipse.sirius.viewpoint.Style;
import org.eclipse.sirius.viewpoint.ViewpointPackage;
+import org.eclipse.sirius.viewpoint.description.style.StyleDescription;
import org.eclipse.ui.IEditorPart;
/**
@@ -157,8 +158,8 @@ public class ImageSelectorService {
if (basicLabelStyle instanceof WorkspaceImage) {
updateWorkspacePathCmd = SetCommand.create(domain, basicLabelStyle, DiagramPackage.Literals.WORKSPACE_IMAGE__WORKSPACE_PATH, workspacePath);
if (!basicLabelStyle.getCustomFeatures().contains(DiagramPackage.Literals.WORKSPACE_IMAGE__WORKSPACE_PATH.getName())) {
- updateWorkspacePathCmd = updateWorkspacePathCmd.chain(AddCommand.create(domain, basicLabelStyle, ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES,
- DiagramPackage.Literals.WORKSPACE_IMAGE__WORKSPACE_PATH.getName()));
+ updateWorkspacePathCmd = updateWorkspacePathCmd.chain(
+ AddCommand.create(domain, basicLabelStyle, ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES, DiagramPackage.Literals.WORKSPACE_IMAGE__WORKSPACE_PATH.getName()));
}
} else {
Object feature = getFeature(basicLabelStyle);
@@ -231,8 +232,9 @@ public class ImageSelectorService {
workspaceImage.setBorderLineStyle(oldStyle.getBorderLineStyle());
workspaceImage.setBorderSize(oldStyle.getBorderSize());
- if (oldStyle.getDescription() instanceof BorderedStyleDescription) {
- BorderedStyleDescription oldDesc = (BorderedStyleDescription) oldStyle.getDescription();
+ StyleDescription oldDescription = oldStyle.getDescription();
+ if (oldDescription instanceof BorderedStyleDescription) {
+ BorderedStyleDescription oldDesc = (BorderedStyleDescription) oldDescription;
workspaceImageDescription.setBorderColor(oldDesc.getBorderColor());
workspaceImageDescription.setBorderLineStyle(oldDesc.getBorderLineStyle());
workspaceImageDescription.setBorderSizeComputationExpression(oldDesc.getBorderSizeComputationExpression());

Back to the top