From c10418124bed15104b0e3821324c0c92056fe257 Mon Sep 17 00:00:00 2001 From: Jayant Gupta Date: Thu, 13 Dec 2012 09:52:21 +0530 Subject: Does corrections proposed in earlier reviews 1. Omits unnecessary dependencies 2. Removes unused Preference Initializer 3. Removes unnecessary refreshing of layout view 4. Corrects variable names Change-Id: I23e0e0e797696b6e1614b8dd36301839380ab744 --- .../ui/layout/ETriceDiagramLayoutManager.java | 22 +++++++------- .../etrice/ui/layout/ETriceLayoutConfig.java | 2 +- .../preferences/ETriceLayoutPreferencePage.java | 5 ---- .../layout/preferences/PreferenceInitializer.java | 34 ---------------------- 4 files changed, 12 insertions(+), 51 deletions(-) delete mode 100644 plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/PreferenceInitializer.java (limited to 'plugins/org.eclipse.etrice.ui.layout/src') diff --git a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceDiagramLayoutManager.java b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceDiagramLayoutManager.java index f9c5821de..cc9d6b408 100644 --- a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceDiagramLayoutManager.java +++ b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceDiagramLayoutManager.java @@ -250,7 +250,7 @@ public abstract class ETriceDiagramLayoutManager extends (Shape) element, null)); } else { - KGraphElement internalKGraphElement = createKGaphElementFromShape( + KGraphElement internalKGraphElement = createKGraphElementFromShape( mapping, null, (Shape) element); if (internalKGraphElement instanceof KNode @@ -259,7 +259,7 @@ public abstract class ETriceDiagramLayoutManager extends for (Shape childShape : ((ContainerShape) element) .getChildren()) { - createKGaphElementFromShape(mapping, + createKGraphElementFromShape(mapping, internalKGraphElement, childShape); } @@ -337,24 +337,24 @@ public abstract class ETriceDiagramLayoutManager extends KNode topLevelBoundingBoxNode = createNode(mapping, diagramNode, topLevelBoundingBox); - for (Shape secondtLevelShape : ((ContainerShape) topLevelBoundingBox) + for (Shape secondLevelShape : ((ContainerShape) topLevelBoundingBox) .getChildren()) { // Second Level - KGraphElement secondLevelKGraphElement = createKGaphElementFromShape( - mapping, topLevelBoundingBoxNode, secondtLevelShape); + KGraphElement secondLevelKGraphElement = createKGraphElementFromShape( + mapping, topLevelBoundingBoxNode, secondLevelShape); if (secondLevelKGraphElement instanceof KNode) { - for (Shape thirdLevelShape : ((ContainerShape) secondtLevelShape) + for (Shape thirdLevelShape : ((ContainerShape) secondLevelShape) .getChildren()) { // Third Level - createKGaphElementFromShape(mapping, + createKGraphElementFromShape(mapping, secondLevelKGraphElement, thirdLevelShape); } - if (!isInternalPort(secondtLevelShape)) { + if (!isInternalPort(secondLevelShape)) { // For KNodes which are not internal ports. setNodeLayoutOptions(mapping, - (KNode) secondLevelKGraphElement, secondtLevelShape); + (KNode) secondLevelKGraphElement, secondLevelShape); } } @@ -382,7 +382,7 @@ public abstract class ETriceDiagramLayoutManager extends * @author jayant */ /* This is fairly general for both the eTrice editors */ - private KGraphElement createKGaphElementFromShape( + private KGraphElement createKGraphElementFromShape( LayoutMapping mapping, KGraphElement parent, Shape shape) { @@ -455,7 +455,7 @@ public abstract class ETriceDiagramLayoutManager extends // Set Port label Shape portLabelShape = ((ContainerShape) shape).getChildren().get(0); - createKGaphElementFromShape(mapping, port, portLabelShape); + createKGraphElementFromShape(mapping, port, portLabelShape); // gather all connections connected to the parentNode via this port for (Anchor anchor : shape.getAnchors()) { diff --git a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceLayoutConfig.java b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceLayoutConfig.java index 69052564c..280239aa4 100644 --- a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceLayoutConfig.java +++ b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/ETriceLayoutConfig.java @@ -87,7 +87,7 @@ public class ETriceLayoutConfig implements ILayoutConfig { */ @Override public Object getValue(LayoutOptionData optionData, LayoutContext context) { - if (optionData.getId().equals(LayoutOptions.DIAGRAM_TYPE.getId())) { + if (optionData.equals(LayoutOptions.DIAGRAM_TYPE)) { EObject element = context.getProperty(LayoutContext.DOMAIN_MODEL); if (element instanceof ActorContainerClass diff --git a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/ETriceLayoutPreferencePage.java b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/ETriceLayoutPreferencePage.java index 45df03b42..cf9ca5943 100644 --- a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/ETriceLayoutPreferencePage.java +++ b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/ETriceLayoutPreferencePage.java @@ -31,7 +31,6 @@ import org.eclipse.ui.IWorkbenchPreferencePage; import de.cau.cs.kieler.kiml.ui.Messages; import de.cau.cs.kieler.kiml.ui.diagram.LayoutHandler; import de.cau.cs.kieler.kiml.ui.service.EclipseLayoutInfoService; -import de.cau.cs.kieler.kiml.ui.views.LayoutViewPart; /** * Preference page for common KIML preferences. @@ -176,10 +175,6 @@ public class ETriceLayoutPreferencePage extends PreferencePage implements preferenceStore.setValue(EclipseLayoutInfoService.PREF_OBLIQUE_ROUTE, obliqueCheckBox.getSelection()); - LayoutViewPart layoutView = LayoutViewPart.findView(); - if (layoutView != null) { - layoutView.refresh(); - } return true; } diff --git a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/PreferenceInitializer.java b/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/PreferenceInitializer.java deleted file mode 100644 index 534c144b5..000000000 --- a/plugins/org.eclipse.etrice.ui.layout/src/org/eclipse/etrice/ui/layout/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Jayant Gupta - * 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * CONTRIBUTORS: - * Jayant Gupta (initial contribution) - * - * - *******************************************************************************/ - -package org.eclipse.etrice.ui.layout.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; - -/** - * Class used to initialize default preference values. - * - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - /** - * {@inheritDoc} - * - * @author jayant - */ - public void initializeDefaultPreferences() { - // No Default initializations need to be made in the shared Preference - // Store (already made by kiml.ui.preferences.PreferenceInitializer) - } - -} -- cgit v1.2.3