diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/.ratings b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/.ratings index da3863ec41f72dfc3c8e4c922f0ff3b22f69a114..a6e50fb4b234d81008daabdb059a8693810fee7f 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/.ratings +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/.ratings @@ -1,7 +1,8 @@ AdvancedTreeViewerEditorBase.java 3bb67c52886069379765289885df3b23790b88c9 GREEN AllocationDiagramEditorBase.java 3c03b9220f1c342ded673d6d1b2fd2c01b57fba6 GREEN CommonDiagramEditorBase.java 438babd95dd7a185bd32246cb8180b00bb53f18a GREEN -ConstraintBasedProcessEditor.java 5d29c95bb69762814e1e0f3065a15f76155fac40 YELLOW +ConstraintBasedProcessEditor.java f42887f36324edd3e52ffc8f9c6c574bb071a7f2 RED +ConstraintBasedProcessEditorHelper.java 2ac99a960a45b891b3fe1dbff3b79a3fc5f4f834 RED DiagramEditorBase.java 3d2bb40e18548ebca0dfdd78f094598e5ee298d1 GREEN DiagramKeyHandler.java 8b64048b966e6e8cacfa7fb78edebef2a4981fc4 GREEN FormsEditorBase.java 50934d36124dea9b16ac45fe3621d878afb48bc7 GREEN diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditor.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditor.java index 5be57079b4a98d2b0e3f9e049d1b5ea02e327ecb..95ef24c46909dd4e9e02c59c62d188bb8086eba7 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditor.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditor.java @@ -15,18 +15,24 @@ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.base.ui.editor; +import static java.util.stream.Collectors.toList; import static org.eclipse.core.runtime.IStatus.ERROR; +import static org.eclipse.emf.ecore.util.EcoreUtil.delete; import static org.eclipse.jface.dialogs.ErrorDialog.openError; +import static org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditorHelper.adjustColorIndex; +import static org.fortiss.tooling.base.ui.utils.ConstraintsBaseUIUtils.activateConfiguration; +import static org.fortiss.tooling.base.ui.utils.ConstraintsBaseUIUtils.deactivateConfiguration; import static org.fortiss.tooling.base.utils.ConstraintsBaseUtils.DEFAULT_CONFIGURATION_NAME; import static org.fortiss.tooling.base.utils.ConstraintsBaseUtils.getActiveConfigurationsTransitively; import static org.fortiss.tooling.base.utils.ConstraintsBaseUtils.getActiveConstraintsTransitively; import static org.fortiss.tooling.base.utils.ConstraintsBaseUtils.retrieveDefaultConfig; +import static org.fortiss.tooling.kernel.utils.EcoreUtils.disableNotificationsOf; +import static org.fortiss.tooling.kernel.utils.EcoreUtils.enableNotificationsOf; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; -import java.util.stream.Collectors; import org.conqat.ide.commons.ui.jface.TreeContentProviderBase; import org.eclipse.core.runtime.Status; @@ -35,7 +41,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.TreeIterator; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.viewers.CellEditor; @@ -77,7 +82,6 @@ import org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditorHelper.Gre import org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditorHelper.NormalFontStyler; import org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditorHelper.RedFontStyler; import org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditorHelper.TreeStructureNode; -import org.fortiss.tooling.base.ui.utils.ConstraintsBaseUIUtils; import org.fortiss.tooling.kernel.extension.IConstraint; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.model.constraints.ConstraintInstance; @@ -95,14 +99,11 @@ import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider; import org.fortiss.tooling.kernel.ui.service.IActionService; import org.fortiss.tooling.kernel.ui.service.IConstraintUIService; import org.fortiss.tooling.kernel.ui.service.IContextMenuService; -import org.fortiss.tooling.kernel.utils.EcoreUtils; /** * Editor for {@link IConstraintBasedProcess}s. * * @author aravantinos - * @ConQAT.Rating RED Hash: E05108EBDA465E0637FAD82A817FE0D6 - * @ConQAT.Rating RED Hash: E05108EBDA465E0637FAD82A817FE0D6 */ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> extends EditorBase<CBP> implements ContextMenuContextProvider, ISelectionProvider { @@ -145,6 +146,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e treeViewer.getTree().setMenu(menu); createCurrentObjectivePart(parent); refreshAdapter = new EContentAdapter() { + /** {@inheritDoc} */ @Override public void notifyChanged(Notification notification) { treeViewer.refresh(); @@ -152,7 +154,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e }; editedObject.eAdapters().add(refreshAdapter); treeViewer.addFilter(new ViewerFilter() { - + /** {@inheritDoc} */ @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if(element instanceof TreeStructureNode && @@ -167,9 +169,9 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e /** {@inheritDoc} */ @Override public void dispose() { - EcoreUtils.disableNotificationsOf(editedObject); + disableNotificationsOf(editedObject); editedObject.eAdapters().remove(refreshAdapter); - EcoreUtils.enableNotificationsOf(editedObject); + enableNotificationsOf(editedObject); super.dispose(); } @@ -179,6 +181,8 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e currentObjComposite.setLayout(new GridLayout(2, false)); } + // TODO (SB,9): Can you think of a better name that explains the purpose of a fake child. Is it + // a place holder? /** Fake child used to add new elements. */ private static class FakeChild { // Nothing to implement: just a marker class @@ -230,13 +234,14 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e .getAlwaysActivatedConstraints()); if(editedObject.getConfigurations().size() > 1) { + // TODO(SB,19) List<ConfigurationRefWithContextualConfiguration> refs = editedObject .getConfigurations() .stream() .map(t -> new ConfigurationRefWithContextualConfiguration(t, (ConstraintConfiguration)parentElement)) - .collect(Collectors.toList()); + .collect(toList()); refs.removeIf(c -> c.config.getName().equalsIgnoreCase(c.target.getName())); refs.forEach(c -> { parentList.add(new TreeStructureNode(parentElement, c)); @@ -294,6 +299,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e HashMap<String, String> groupedConstraint = groupNameAndConstraints.get(constraintGroupName); for(String key : groupedConstraint.keySet()) { + // TODO(SB,1) // if(isUniqueConstraint(key)) { constraintInfo.put(key, groupedConstraint.get(key)); TreeStructureNode node = new TreeStructureNode(parentElement, key); @@ -363,6 +369,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e (ConstraintWithContextualConfiguration)element; IConstraintService cs = IConstraintService.getInstance(); String name = cs.getName(cstrInContext.cstr); + // TODO(SB,1) // return cstrInContext.config.getActiveConstraints().contains(name); HashMap<String, String> hashMap = groupNameAndConstraints.get(element.toString()); return hashMap.keySet().contains(name); @@ -381,7 +388,6 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e ConstraintConfiguration config = ((ConstraintConfiguration)parent2); EList<String> activeConstraints = config.getActiveConstraints(); for(String string : activeConstraints) { - if(string.equalsIgnoreCase(stringNode)) { return true; } @@ -432,14 +438,10 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e top.runAsCommand(() -> { if(event.getChecked()) { configRef.config.getIncludedConfigurations().add(configRef.target); - ConstraintsBaseUIUtils.activateConfiguration(configRef.target, - cstrContainer); - - // } + activateConfiguration(configRef.target, cstrContainer); } else { configRef.config.getIncludedConfigurations().remove(configRef.target); - ConstraintsBaseUIUtils.deactivateConfiguration(configRef.target, - cstrContainer, configRef.config); + deactivateConfiguration(configRef.target, cstrContainer, configRef.config); } }); } @@ -454,18 +456,19 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e String constraintName = ((TreeStructureNode)element).data.toString(); if(constraintMap.containsKey(constraintName)) { top.runAsNonDirtyingCommand(new Runnable() { + /** {@inheritDoc} */ @Override public void run() { - // Get the constraintName as a full class path (e.g., // a.b.c.constraintName.Java) if(event.getChecked()) { - config.getActiveConstraints().add(constraintName); List<ConstraintConfiguration> activeConfigs = getActiveConfigurationsTransitively(config, null); // If the selected constraint is in the active constraints list + // TODO(SB,14): Provide reason why get(0) cannot fail. Additional + // test might be needed. EList<String> activeConstraints = activeConfigs.get(0).getActiveConstraints(); if(activeConstraints.contains(cs @@ -515,6 +518,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e onlyViewerColumn.setLabelProvider(new BoldColumnLabelProvider()); onlyViewerColumn.setEditingSupport(new EditingSupport(treeViewer) { + /** {@inheritDoc} */ @Override protected void setValue(Object element, Object value) { if(element instanceof FakeChild) { @@ -539,16 +543,19 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e } } + /** {@inheritDoc} */ @Override protected Object getValue(Object element) { return getLabelText(element); } + /** {@inheritDoc} */ @Override protected CellEditor getCellEditor(Object element) { return new TextCellEditor((Composite)getViewer().getControl()); } + /** {@inheritDoc} */ @Override protected boolean canEdit(Object element) { return element instanceof ConstraintConfiguration || element instanceof FakeChild || @@ -604,8 +611,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e */ private boolean alreadyExists(String name) { List<String> configNames = - editedObject.getConfigurations().stream().map(c -> c.getName()) - .collect(Collectors.toList()); + editedObject.getConfigurations().stream().map(c -> c.getName()).collect(toList()); if(configNames.contains(name)) { Status status = new Status(ERROR, ToolingBaseUIActivator.PLUGIN_ID, 0, @@ -695,6 +701,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e // Not supported } + // TODO(SB, 4): Explain what the method does /** * @param cs * constraintService @@ -708,8 +715,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e private void clearConstraintInstance(IConstraintService cs, IConstraintUIService cuis, ConstraintConfiguration config, String constraintName) { // If the constraint is unchecked from the tree remove the - // constraint from - // the active constraints list and constraint instance list + // constraint from the active constraints list and constraint instance list config.getActiveConstraints().remove(constraintName); // If the constraint is still not active @@ -730,23 +736,23 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e EList<EObject> eContents = editedObject.getCurrentObjective().eContents(); List<EObject> duplicateList = new ArrayList<EObject>(); duplicateList.addAll(eContents); - List<Object> toReomve = new ArrayList<Object>(); + List<Object> toRemove = new ArrayList<Object>(); while(allContents.hasNext()) { EObject next = allContents.next(); if(next instanceof ConstraintNameToChecksumImpl && next.toString().contains(constraintName)) { - toReomve.add(next); + toRemove.add(next); } if(next instanceof ConstraintInstanceImpl && next.toString().contains(constraintName)) { - toReomve.add(next); + toRemove.add(next); } } - toReomve.forEach(c -> { + toRemove.forEach(c -> { duplicateList.remove(c); - EcoreUtil.delete((EObject)c); + delete((EObject)c); }); }); } @@ -767,12 +773,13 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e ConstraintConfiguration config = ((ConstraintConfiguration)provider.getParent(parentElement)); + // TODO(SB,1) // for(TreeStructureNode node : parentList) { List<Class<? extends IConstraint>> activeConstraintsTransitively = getActiveConstraintsTransitively(config, null); List<String> constraintList = activeConstraintsTransitively.stream().map((item) -> item.getName()) - .collect(Collectors.toList()); + .collect(toList()); for(String string : constraintList) { if(!config.getActiveConstraints().contains(string) && @@ -784,10 +791,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e return true; } - /** - * @param element - * @return the concatenated string containing the score for the configuration - */ + /** @return the concatenated string containing the score for the configuration. */ private String getInstanceCount(Object element) { String constraintGroupName = ((TreeStructureNode)element).data.toString(); // If the constraint is in the active constraint list and the status is true @@ -808,7 +812,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e int duplicateSize = stillActiveCstrs.stream().filter(c -> !(activeConstraints.contains(c.getName()))) - .collect(Collectors.toList()).size(); + .collect(toList()).size(); if(config.getName().equalsIgnoreCase(editedObject.getCurrentObjective().getName())) { for(ConstraintInstance instance : constraintInstances) { for(String constraintName : editedObject.getCurrentObjective() @@ -823,6 +827,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e } } } + // TODO (SB,9): I think the Integer.toString() can be omitted? return "[ " + Integer.toString(successCount) + " / " + Integer.toString(failCount) + "/" + Integer.toString(hashMap.size() - duplicateSize) + " ]"; } @@ -855,23 +860,23 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e int constarintNameLength = constraintGroupName.length(); if(instanceCountList == null) { StyledString finalString = new StyledString(constraintGroupName); - ConstraintBasedProcessEditorHelper - .adjustColorIndex(groupNameAndConstraints.keySet().size()); + adjustColorIndex(groupNameAndConstraints.keySet().size()); finalString.setStyle(0, finalString.length(), new NormalFontStyler()); return finalString; } + // TODO (SB, 14): Add check that instanceCountList has at least 3 elements // the elements are stored in the list sequentially- success count, fail // count and total of instances int successLength = Integer.toString(instanceCountList.get(0)).length(); int failCountLength = Integer.toString(instanceCountList.get(1)).length(); // creating the string with all the counts + // TODO (SB,9): I think the Integer.toString() can be omitted? StyledString finalString = new StyledString(constraintGroupName + "[" + Integer.toString(instanceCountList.get(0)) + "/" + Integer.toString(instanceCountList.get(1)) + "/" + Integer.toString(instanceCountList.get(2)) + "]"); - ConstraintBasedProcessEditorHelper.adjustColorIndex(groupNameAndConstraints - .keySet().size()); + adjustColorIndex(groupNameAndConstraints.keySet().size()); finalString.setStyle(0, finalString.length(), new NormalFontStyler()); finalString.setStyle(constarintNameLength + 1, successLength, @@ -888,13 +893,9 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e return null; } - /** - * the class to create stylized string for labels of the tree - * - * @author ss - */ + /** Class to create stylized string for labels of the tree. */ private class BoldColumnLabelProvider extends DelegatingStyledCellLabelProvider { - + // TODO(SB,1) // Styler styler = new BoldFontStyler(); /** {@inheritDoc} */ @@ -915,37 +916,40 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e return null; } - /** - * the class for generating stylized text - * - */ + /** Class for generating stylized text. */ public BoldColumnLabelProvider() { super(new IStyledLabelProvider() { + /** {@inheritDoc} */ @Override public Image getImage(Object element) { return null; } + /** {@inheritDoc} */ @Override public StyledString getStyledText(Object element) { return getStylizedLabel(element); } + /** {@inheritDoc} */ @Override public void addListener(ILabelProviderListener listener) { return; } + /** {@inheritDoc} */ @Override public void dispose() { return; } + /** {@inheritDoc} */ @Override public boolean isLabelProperty(Object element, String property) { return false; } + /** {@inheritDoc} */ @Override public void removeListener(ILabelProviderListener listener) { return; @@ -979,7 +983,7 @@ public class ConstraintBasedProcessEditor<CBP extends IConstraintBasedProcess> e int duplicateSize = stillActiveCstrs.stream().filter(c -> !(activeConstraints.contains(c.getName()))) - .collect(Collectors.toList()).size(); + .collect(toList()).size(); if(config.getName().equalsIgnoreCase(editedObject.getCurrentObjective().getName())) { for(ConstraintInstance instance : constraintInstances) { for(String constraintName : editedObject.getCurrentObjective() diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditorHelper.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditorHelper.java index 9f4be1b4cb313d5d1f3e352cfefb454e1a5eb6a6..44c6d8aebd6bf3465d6d17f0437b7658786daef5 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditorHelper.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/ConstraintBasedProcessEditorHelper.java @@ -15,6 +15,8 @@ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.base.ui.editor; +import static org.eclipse.jface.resource.FontDescriptor.createFrom; + import org.eclipse.jface.resource.FontDescriptor; import org.eclipse.jface.viewers.StyledString.Styler; import org.eclipse.swt.SWT; @@ -25,6 +27,7 @@ import org.eclipse.swt.widgets.Display; import org.fortiss.tooling.base.model.element.ConstraintConfiguration; import org.fortiss.tooling.kernel.extension.IConstraint; +// TODO(SB,3): Add class comment, use proper author name tag (fortiss login) /** * * @author ss @@ -72,7 +75,8 @@ public class ConstraintBasedProcessEditorHelper { WithContextualConfiguration { /** Constraint. */ - ConstraintConfiguration target; + // TODO: Check if the variable should really be package accessible + /* package */ConstraintConfiguration target; /** Constructor. */ public ConfigurationRefWithContextualConfiguration(ConstraintConfiguration configRef, @@ -85,6 +89,7 @@ public class ConstraintBasedProcessEditorHelper { @Override public boolean equals(Object obj) { if(obj instanceof ConfigurationRefWithContextualConfiguration) { + // TODO (SB, 19) return this.target.getName().equalsIgnoreCase( ((ConfigurationRefWithContextualConfiguration)obj).target.getName()) && this.config.getName() @@ -102,24 +107,17 @@ public class ConstraintBasedProcessEditorHelper { } } - /** - * the class to manipulate and store parent of elements - * - * @author salman - */ + /** Class to manipulate and store parent of elements. */ public static class TreeStructureNode { - /** parent object variable */ - Object parent; + // TODO: Check if the variables should really be package accessible + /** Parent object variable. */ + /* package */Object parent; - /** data object variable */ - Object data; + /** Data object variable. */ + /* package */Object data; - /** - * @param parent - * the parent element - * @param children - */ + /** Constructor. */ public TreeStructureNode(Object parent, Object children) { this.parent = parent; this.data = children; @@ -129,6 +127,7 @@ public class ConstraintBasedProcessEditorHelper { @Override public boolean equals(Object obj) { if(obj instanceof TreeStructureNode) { + // TODO (SB, 19) return this.data.toString().equalsIgnoreCase( ((TreeStructureNode)obj).data.toString()) && this.parent.toString().equalsIgnoreCase( @@ -144,20 +143,14 @@ public class ConstraintBasedProcessEditorHelper { } } - /** - * styler class to create colored bold labels for constraint group name - * - * @author ss - */ + /** Styler class to create colored bold labels for constraint group name. */ public static class NormalFontStyler extends Styler { - /** counter to keep track of currently used color in color array */ - int colorIndex = 0; + /** Counter to keep track of currently used color in color array. */ + // TODO: Check if the variable should really be package accessible + /* package */int colorIndex = 0; - /** - * constructor - * index the index for color ickup in color array - */ + /** Constructor. */ public NormalFontStyler() { this.colorIndex = colorCtr; } @@ -166,52 +159,45 @@ public class ConstraintBasedProcessEditorHelper { @Override public void applyStyles(final TextStyle textStyle) { - FontDescriptor boldDescriptor = - FontDescriptor.createFrom(new FontData()).setStyle(SWT.BOLD); + FontDescriptor boldDescriptor = createFrom(new FontData()).setStyle(SWT.BOLD); Font boldFont = boldDescriptor.createFont(Display.getCurrent()); textStyle.font = boldFont; textStyle.foreground = Display.getCurrent().getSystemColor(colorArray[colorIndex]); } } - /** - * - * @author ss - */ + // TODO (SB,3) + /** */ public static class RedFontStyler extends Styler { /** {@inheritDoc} */ @Override public void applyStyles(final TextStyle textStyle) { - FontDescriptor boldDescriptor = - FontDescriptor.createFrom(new FontData()).setStyle(SWT.BOLD); + FontDescriptor boldDescriptor = createFrom(new FontData()).setStyle(SWT.BOLD); Font boldFont = boldDescriptor.createFont(Display.getCurrent()); textStyle.font = boldFont; textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED); } } - /** - * styler class to create green color labels - * - * @author ss - */ + /** Styler class to create green color labels. */ public static class GreenFontStyler extends Styler { /** {@inheritDoc} */ @Override public void applyStyles(final TextStyle textStyle) { - FontDescriptor boldDescriptor = - FontDescriptor.createFrom(new FontData()).setStyle(SWT.BOLD); + FontDescriptor boldDescriptor = createFrom(new FontData()).setStyle(SWT.BOLD); Font boldFont = boldDescriptor.createFont(Display.getCurrent()); textStyle.font = boldFont; textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN); } } + // TODO(SB,3) /** * @param groupSize * the size of the groups present */ public static void adjustColorIndex(int groupSize) { + // TODO(SB,11): Can you use modulo to write this more elegantly? if(ConstraintBasedProcessEditorHelper.colorCtr != ConstraintBasedProcessEditorHelper.colorCtr - 1) { if(groupSize == ConstraintBasedProcessEditorHelper.colorCtr + 1) { ConstraintBasedProcessEditorHelper.colorCtr = 0;