Anonymous avatar Anonymous committed fd7160a

Refactors are done

Comments (0)

Files changed (82)

src/nl/tudelft/lime/LimeContextMenuProvider.java

 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.ui.actions.ActionRegistry;
 import org.eclipse.gef.ui.actions.GEFActionConstants;
+
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
+
 import org.eclipse.ui.actions.ActionFactory;
 
 

src/nl/tudelft/lime/LimeCreationWizard.java

 
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
+
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 

src/nl/tudelft/lime/LimeEditor.java

 package nl.tudelft.lime;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.List;
-
 import nl.tudelft.lime.actions.LimePasteTemplateAction;
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.dnd.TextTransferDropTargetListener;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Platform;
+
 import org.eclipse.draw2d.FigureCanvas;
 import org.eclipse.draw2d.LightweightSystem;
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.Viewport;
 import org.eclipse.draw2d.parts.ScrollableThumbnail;
 import org.eclipse.draw2d.parts.Thumbnail;
+
 import org.eclipse.gef.ContextMenuProvider;
 import org.eclipse.gef.DefaultEditDomain;
 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
 import org.eclipse.gef.ui.parts.TreeViewer;
 import org.eclipse.gef.ui.rulers.RulerComposite;
+
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.jface.util.TransferDropTargetListener;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
+
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.List;
+
 
 public class LimeEditor extends GraphicalEditorWithFlyoutPalette {
     protected static final String PALETTE_DOCK_LOCATION = "Dock location"; //$NON-NLS-1$
      * based on if the file is opened in the workspace or outside the workspace, creates a
      * file
      */
-/*    private IFile getFile(IEditorInput input) {
-        IFile file = null;
 
-        if (input instanceof IFileEditorInput) {
-            file = ((IFileEditorInput) input).getFile();
-        } else if (input instanceof FileStoreEditorInput) {
-            IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
-            FileStoreEditorInput fileStoreEditorInput = (FileStoreEditorInput) input;
-            URI uri = fileStoreEditorInput.getURI();
-            String path = uri.getPath();
+    /*    private IFile getFile(IEditorInput input) {
+            IFile file = null;
 
-            // Bug 526: uri.getHost() can be null for a local file URL
-            if (uri.getScheme().equals("file") &&
-                    ((uri.getHost() == null) ||
-                    uri.getHost().equals("localhost"))) {
-                file = wsRoot.getFile(new Path(path));
-            } else {
-                System.err.println("File could not be found @ " + path);
+            if (input instanceof IFileEditorInput) {
+                file = ((IFileEditorInput) input).getFile();
+            } else if (input instanceof FileStoreEditorInput) {
+                IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+                FileStoreEditorInput fileStoreEditorInput = (FileStoreEditorInput) input;
+                URI uri = fileStoreEditorInput.getURI();
+                String path = uri.getPath();
+
+                // Bug 526: uri.getHost() can be null for a local file URL
+                if (uri.getScheme().equals("file") &&
+                        ((uri.getHost() == null) ||
+                        uri.getHost().equals("localhost"))) {
+                    file = wsRoot.getFile(new Path(path));
+                } else {
+                    System.err.println("File could not be found @ " + path);
+                }
             }
-        }
 
-        return file;
-    }*/
-
+            return file;
+        }*/
     protected void closeEditor(boolean save) {
         getSite().getPage().closeEditor(LimeEditor.this, save);
     }
                 }
 
                 is.close();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                 //otherwise file was not be able to be read
                 setLimeDiagram(new LimeDiagram());
                 System.out.println(e.getMessage());

src/nl/tudelft/lime/LimePlugin.java

 package nl.tudelft.lime;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.constants.SystemSettings;
 import nl.tudelft.lime.model.codefragment.LimeCodeFragment;
 import org.eclipse.gef.palette.ToolEntry;
 import org.eclipse.gef.requests.SimpleFactory;
 import org.eclipse.gef.tools.MarqueeSelectionTool;
+
 import org.eclipse.jface.resource.ImageDescriptor;
 
+import java.util.ArrayList;
+import java.util.List;
+
 
 public class LimePlugin extends org.eclipse.ui.plugin.AbstractUIPlugin {
     private static LimePlugin singleton;
 
         //TODO: It is not yet supported to save the text in the XML file, it is easy, but not planned yet
         //previously it was stored as a serialized object, but now the default type is XML
-                combined = new CombinedTemplateCreationEntry(LimeMessages.LimePlugin_Tool_CreationTool_Label_Label,
-                        LimeMessages.LimePlugin_Tool_CreationTool_Label_Description,
-                        new SimpleFactory(LimeCodeFragment.class),
-                        ImageDescriptor.createFromFile(LimeComponent.class,
-                            SystemSettings.Code_Fragment_Normal_Icon_Path),
-                        ImageDescriptor.createFromFile(LimeComponent.class,
-                            SystemSettings.Code_Fragment_Big_Icon_Path));
-                entries.add(combined);
+        combined = new CombinedTemplateCreationEntry(LimeMessages.LimePlugin_Tool_CreationTool_Label_Label,
+                LimeMessages.LimePlugin_Tool_CreationTool_Label_Description,
+                new SimpleFactory(LimeCodeFragment.class),
+                ImageDescriptor.createFromFile(LimeComponent.class,
+                    SystemSettings.Code_Fragment_Normal_Icon_Path),
+                ImageDescriptor.createFromFile(LimeComponent.class,
+                    SystemSettings.Code_Fragment_Big_Icon_Path));
+        entries.add(combined);
         drawer.addAll(entries);
 
         return drawer;

src/nl/tudelft/lime/LimeWizardPage.java

 package nl.tudelft.lime;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.model.component.LimeDiagram;
 import nl.tudelft.lime.xml.XMLFactory;
 
 import org.eclipse.core.resources.IFile;
+
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.IStructuredSelection;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
+
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.ide.IDE;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
 
 public class LimeWizardPage extends WizardNewFileCreationPage {
     private static int exampleCount = 1;
 
         try {
             ByteArrayOutputStream out = new ByteArrayOutputStream();
-            XMLFactory.writeXMLDiagramToOutputStream(out,new LimeDiagram());
+            XMLFactory.writeXMLDiagramToOutputStream(out, new LimeDiagram());
             out.flush();
             out.close();
 
     public boolean finish() {
         try {
             IFile newFile = createNewFile();
-            
 
             if (newFile == null) {
                 return false; // ie.- creation was unsuccessful
             }
+
             // Since the file resource was created fine, open it for editing
             // iff requested by the user
             IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow();
             }
         } catch (Exception e) {
             e.printStackTrace();
+
             return false;
         }
 

src/nl/tudelft/lime/actions/FlyoutChangeLayoutAction.java

 import nl.tudelft.lime.model.component.LimeDiagram;
 
 import org.eclipse.jface.action.Action;
+
 import org.eclipse.ui.IEditorPart;
 
 

src/nl/tudelft/lime/actions/LimeActionBarContributor.java

 import nl.tudelft.lime.model.component.LimeComponent;
 
 import org.eclipse.draw2d.PositionConstants;
+
 import org.eclipse.gef.editparts.ZoomManager;
 import org.eclipse.gef.internal.GEFMessages;
 import org.eclipse.gef.ui.actions.ActionBarContributor;
 import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
 import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
 import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
+
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.resource.ImageDescriptor;
+
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.actions.ActionFactory;

src/nl/tudelft/lime/actions/LimePasteTemplateAction.java

 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.GraphicalEditPart;
+
 import org.eclipse.ui.IEditorPart;
 
 

src/nl/tudelft/lime/actions/LimePrintAction.java

  *******************************************************************************/
 package nl.tudelft.lime.actions;
 
-import java.io.InputStream;
-
 import nl.tudelft.lime.edit.GraphicalPartFactory;
 
 import org.eclipse.core.resources.IFile;
+
 import org.eclipse.gef.DefaultEditDomain;
 import org.eclipse.gef.GraphicalViewer;
 import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
 import org.eclipse.gef.print.PrintGraphicalViewerOperation;
 import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
+
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.printing.PrintDialog;
 import org.eclipse.swt.printing.Printer;
 import org.eclipse.swt.printing.PrinterData;
 import org.eclipse.swt.widgets.Shell;
+
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
 
+import java.io.InputStream;
+
 
 /**
  * @author Eric Bordeau

src/nl/tudelft/lime/actions/PasteTemplateAction.java

  *******************************************************************************/
 package nl.tudelft.lime.actions;
 
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 
 import org.eclipse.draw2d.geometry.Point;
+
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.requests.CreateRequest;
 import org.eclipse.gef.requests.CreationFactory;
 import org.eclipse.gef.ui.actions.Clipboard;
 import org.eclipse.gef.ui.actions.SelectionAction;
+
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.actions.ActionFactory;
 
+import java.util.List;
+
 
 /**
  * If the current object on the clipboard is a valid template, this action will paste

src/nl/tudelft/lime/actions/PrintModeDialog.java

 import nl.tudelft.lime.constants.LimeMessages;
 
 import org.eclipse.draw2d.PrintFigureOperation;
+
 import org.eclipse.jface.dialogs.Dialog;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;

src/nl/tudelft/lime/constants/LimeMessages.java

 
 
 public class LimeMessages extends NLS {
-	public static String AddCommand_Label;
+    public static String AddCommand_Label;
     public static String AlignmentAction_AlignSubmenu_ActionLabelText;
     public static String CellEditorValidator_NotANumberMessage;
     public static String CloneCommand_Label;
     public static String PropertyDescriptor_Diagram_Manual;
     public static String PropertyDescriptor_Diagram_Manhattan;
     public static String PropertyDescriptor_Diagram_ShortestPath;
-	public static String PropertyDescriptor_Diagram_Instance_Only;
+    public static String PropertyDescriptor_Diagram_Instance_Only;
     public static String PropertyDescriptor_FIFO;
     public static String PropertyDescriptor_LIFO;
     public static String PropertyDescriptor_Size;
     public static String PropertyDescriptor_Component_Type_Label;
     public static String PropertyDescriptor_Component_Ret_Label;
     public static String PropertyDescriptor_Component_InstanceOf_Label;
-    public static String PropertyDescriptor_Label_Context_Label;    
+    public static String PropertyDescriptor_Label_Context_Label;
     public static String PropertyDescriptor_Name_Label;
     public static String PropertyDescriptor_Port_Const_Label;
     public static String PropertyDescriptor_Port_Constp_Label;

src/nl/tudelft/lime/constants/SystemSettings.java

  *
  */
 public class SystemSettings {
-  public static final String PropertyDescriptor_Component_Type_ID = "ComponentTypeID";
-  public static final String PropertyDescriptor_Component_Ret_ID = "ComponentRetID";
-  public static final String PropertyDescriptor_Name_ID = "NameID";
-  public static final String PropertyDescriptor_Port_Const_ID = "PortConstID";
-  public static final String PropertyDescriptor_Port_Constp_ID = "PortConstpID";
-  public static final String PropertyDescriptor_Location_ID = "LocationID";
-  public static final String PropertyDescriptor_Code_Fragment_Context_ID = "ContextID";
-  public static final String PropertyDescriptor_Port_Restrict_ID = "RestrictID";
-  public static final String PropertyDescriptor_Port_Size_ID = "PortSizeID";
-  public static final String PropertyDescriptor_Port_Static_ID = "StaticID";
-  public static final String PropertyDescriptor_Port_Type_ID = "PortTypeID";
-  public static final String PropertyDescriptor_Port_Volatile_ID = "VolatileID";
-  public static final String PropertyDescriptor_Port_VolatileP_ID = "VolatilepID";
-  public static final String PropertyDescriptor_Size_ID = "SizeID";
-  public static final String PropertyDescriptor_Diagram_Only_Instances_ID = "OnlyInstancesID";
-  public static final String PropertyDescriptor_Component_InstanceOf_ID = "InstanceOfID";
+    public static final String PropertyDescriptor_Component_Type_ID = "ComponentTypeID";
+    public static final String PropertyDescriptor_Component_Ret_ID = "ComponentRetID";
+    public static final String PropertyDescriptor_Name_ID = "NameID";
+    public static final String PropertyDescriptor_Port_Const_ID = "PortConstID";
+    public static final String PropertyDescriptor_Port_Constp_ID = "PortConstpID";
+    public static final String PropertyDescriptor_Location_ID = "LocationID";
+    public static final String PropertyDescriptor_Code_Fragment_Context_ID = "ContextID";
+    public static final String PropertyDescriptor_Port_Restrict_ID = "RestrictID";
+    public static final String PropertyDescriptor_Port_Size_ID = "PortSizeID";
+    public static final String PropertyDescriptor_Port_Static_ID = "StaticID";
+    public static final String PropertyDescriptor_Port_Type_ID = "PortTypeID";
+    public static final String PropertyDescriptor_Port_Volatile_ID = "VolatileID";
+    public static final String PropertyDescriptor_Port_VolatileP_ID = "VolatilepID";
+    public static final String PropertyDescriptor_Size_ID = "SizeID";
+    public static final String PropertyDescriptor_Diagram_Only_Instances_ID = "OnlyInstancesID";
+    public static final String PropertyDescriptor_Component_InstanceOf_ID = "InstanceOfID";
 
-  //Arcs which their endpoints (the two ports which are connected) are inside a component hierarchy are intra_arcs
-  public static final String DUMMY_INTRA_ARCS_TAG = "dummyIntraArcs";
+    //Arcs which their endpoints (the two ports which are connected) are inside a component hierarchy are intra_arcs
+    public static final String DUMMY_INTRA_ARCS_TAG = "dummyIntraArcs";
 
-  //Arcs which their endpoints (the two ports which are connected) are not inside a component hierarchy are intra_arcs
-  public static final String DUMMY_INTER_ARCS_TAG = "dummyInterArcs";
-  public static final String DUMMY_ASSOCIATIONS_TAG = "dummyAssociations";
-  public static final String DUMMY_ROOT_ARCS_TAG = "dummy-root-arcs";
-  public static final String DUMMY_ROOT_ASSOCIATIONS_TAG = "dummy-root-associations";
+    //Arcs which their endpoints (the two ports which are connected) are not inside a component hierarchy are intra_arcs
+    public static final String DUMMY_INTER_ARCS_TAG = "dummyInterArcs";
+    public static final String DUMMY_ASSOCIATIONS_TAG = "dummyAssociations";
+    public static final String DUMMY_ROOT_ARCS_TAG = "dummy-root-arcs";
+    public static final String DUMMY_ROOT_ASSOCIATIONS_TAG = "dummy-root-associations";
 
+    //hardcoded tags (TODO: they should be moved to SystemSettings) 
+    public static String XLINK_TYPE_ATTRIBUTE;
+    public static String XLINK_LABEL_ATTRIBUTE;
+    public static String XLINK_HREF_ATTRIBUTE;
+    public static String XLINK_TO_ATTRIBUTE;
+    public static String XLINK_FROM_ATTRIBUTE;
+    public static String BOUND_TO_TAG;
+    public static String CODE_TAG;
+    public static String CONTEXT_TAG;
+    public static String ENDPOINT_TAG;
+    public static String EDGE_TAG;
+    public static String EDGES_TAG;
+    public static String TYPE_TAG;
+    public static String META_TAG;
+    public static String NODE_TAG;
+    public static String PORT_TAG;
+    public static String GXF_URL;
+    public static String ID_TAG;
+    public static String TO_TAG;
+    public static String FROM_TAG;
+    public static String TO_NODE_TAG;
+    public static String FROM_NODE_TAG;
+    public static String PORT_ID_TAG;
+    public static String META_TAG_VISUAL_ID;
+    public static String META_TAG_CODE_ID;
+    public static String SIZE_TAG;
+    public static String LOCATION_TAG;
+    public static String DIMENSION_TAG;
+    public static String ID_ATTRIBUTE;
+    public static String VALUE_ATTRIBUTE;
+    public static String RET_TAG;
+    public static String STEREOTYPE_TAG;
+    public static String CODE_FRAGMENT_DEFAULT_CONTEXT;
+    public static String ARC_DEFAULT_TYPE;
+    public static String PORT_DEFAULT_SIZE;
+    public static String GXF_TAG;
+    public static String CONSTP_TAG;
+    public static String RESTRICT_TAG;
+    public static String STATIC_TAG;
+    public static String VOLATILE_TAG;
+    public static String VOLATILEP_TAG;
 
-  //hardcoded tags (TODO: they should be moved to SystemSettings) 
-  public static String XLINK_TYPE_ATTRIBUTE;
-  public static String XLINK_LABEL_ATTRIBUTE;
-  public static String XLINK_HREF_ATTRIBUTE;
-  public static String XLINK_TO_ATTRIBUTE;
-  public static String XLINK_FROM_ATTRIBUTE;
-  public static String BOUND_TO_TAG;
-  public static String CODE_TAG;
-  public static String CONTEXT_TAG;
-  public static String ENDPOINT_TAG;
-  public static String EDGE_TAG;
-  public static String EDGES_TAG;
-  public static String TYPE_TAG;
-  public static String META_TAG;
-  public static String NODE_TAG;
-  public static String PORT_TAG;
-  public static String GXF_URL;
-  public static String ID_TAG;
-  public static String TO_TAG;
-  public static String FROM_TAG;
-  public static String TO_NODE_TAG;
-  public static String FROM_NODE_TAG;
-  public static String PORT_ID_TAG;
-  public static String META_TAG_VISUAL_ID;
-  public static String META_TAG_CODE_ID;
-  public static String SIZE_TAG;
-  public static String LOCATION_TAG;
-  public static String DIMENSION_TAG;
-  public static String ID_ATTRIBUTE;
-  public static String VALUE_ATTRIBUTE;
-  public static String RET_TAG;
-  public static String STEREOTYPE_TAG;
+    //Normal Icons Path
+    public static String Component_Normal_Icon_Path;
+    public static String Input_Port_Normal_Icon_Path;
+    public static String Output_Port_Normal_Icon_Path;
+    public static String Arc_Normal_Icon_Path;
+    public static String Association_Normal_Icon_Path;
+    public static String Code_Fragment_Normal_Icon_Path;
 
+    //Big Icons Path
+    public static String Component_Big_Icon_Path;
+    public static String Input_Port_Big_Icon_Path;
+    public static String Output_Port_Big_Icon_Path;
+    public static String Arc_Big_Icon_Path;
+    public static String Association_Big_Icon_Path;
+    public static String Code_Fragment_Big_Icon_Path;
 
-  public static String CODE_FRAGMENT_DEFAULT_CONTEXT;
-  public static String ARC_DEFAULT_TYPE;
-  public static String PORT_DEFAULT_SIZE;
-  public static String GXF_TAG;
-  public static String CONSTP_TAG;
-  public static String RESTRICT_TAG;
-  public static String STATIC_TAG;
-  public static String VOLATILE_TAG;
-  public static String VOLATILEP_TAG;
+    //other Icons
+    public static String Component_Menu_Icon_Path;
+    public static String Layout_Normal_Icon_Path;
+    public static String Layout_Disabled_Icon_Path;
 
-  //Normal Icons Path
-  public static String Component_Normal_Icon_Path;
-  public static String Input_Port_Normal_Icon_Path;
-  public static String Output_Port_Normal_Icon_Path;
-  public static String Arc_Normal_Icon_Path;
-  public static String Association_Normal_Icon_Path;
-  public static String Code_Fragment_Normal_Icon_Path;
+    //XML
+    public static String Default_XML_DTD_Entry;
+    public static String Correct_XML_DTD_Path;
 
-  //Big Icons Path
-  public static String Component_Big_Icon_Path;
-  public static String Input_Port_Big_Icon_Path;
-  public static String Output_Port_Big_Icon_Path;
-  public static String Arc_Big_Icon_Path;
-  public static String Association_Big_Icon_Path;
-  public static String Code_Fragment_Big_Icon_Path;
-
-  //other Icons
-  public static String Component_Menu_Icon_Path;
-  public static String Layout_Normal_Icon_Path;
-  public static String Layout_Disabled_Icon_Path;
-
-  //XML
-  public static String Default_XML_DTD_Entry;
-  public static String Correct_XML_DTD_Path;
-
-  static {
-    NLS.initializeMessages("system", SystemSettings.class); //$NON-NLS-1$
-  }
+    static {
+        NLS.initializeMessages("system", SystemSettings.class); //$NON-NLS-1$
+    }
 }

src/nl/tudelft/lime/dnd/FileTransferDragSourceListener.java

 import nl.tudelft.lime.edit.editpart.LimeCodeFragmentEditPart;
 
 import org.eclipse.gef.EditPartViewer;
+
 import org.eclipse.swt.dnd.DragSourceEvent;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;

src/nl/tudelft/lime/dnd/TextTransferDropTargetListener.java

 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.dnd.AbstractTransferDropTargetListener;
+
 import org.eclipse.swt.dnd.Transfer;
 
 

src/nl/tudelft/lime/edit/CodeFragmentCellEditorLocator.java

 import nl.tudelft.lime.figures.codefragment.CodeFragmentFigure;
 
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.tools.CellEditorLocator;
+
 import org.eclipse.jface.viewers.CellEditor;
+
 import org.eclipse.swt.widgets.Text;
 
 

src/nl/tudelft/lime/edit/LimeCodeFragmentEditManager.java

 import org.eclipse.gef.editparts.ZoomManager;
 import org.eclipse.gef.tools.CellEditorLocator;
 import org.eclipse.gef.tools.DirectEditManager;
+
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.TextCellEditor;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
+
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.ActionFactory;
     protected void initCellEditor() {
         // update text
         CodeFragmentFigure stickyNote = (CodeFragmentFigure) getEditPart()
-                                                             .getFigure();
+                                                                 .getFigure();
         getCellEditor().setValue(stickyNote.getText());
 
         // update font

src/nl/tudelft/lime/edit/editpart/ArcEditPart.java

 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-
 import nl.tudelft.lime.figures.FigureFactory;
 import nl.tudelft.lime.figures.connection.ArcFigure;
 import nl.tudelft.lime.model.connection.Arc;
 
 import org.eclipse.draw2d.IFigure;
 
+import java.beans.PropertyChangeEvent;
+
 
 /**
  * Implements a Connection Editpart to represnt a arclike

src/nl/tudelft/lime/edit/editpart/ComponentEditPart.java

  *******************************************************************************/
 package nl.tudelft.lime.edit.editpart;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
 import nl.tudelft.lime.edit.policy.ContainerHighlightEditPolicy;
 import nl.tudelft.lime.edit.policy.LimeXYLayoutEditPolicy;
 import nl.tudelft.lime.figures.FigureFactory;
 import org.eclipse.draw2d.XYLayout;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.AccessibleAnchorProvider;
 import org.eclipse.gef.AutoexposeHelper;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.editparts.ViewportExposeHelper;
 import org.eclipse.gef.editparts.ViewportMouseWheelHelper;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
 
 /**
  * Holds a circuit, which is a container capable of

src/nl/tudelft/lime/edit/editpart/ConnectionEditPart.java

  */
 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.edit.policy.ArcBendpointEditPolicy;
 import nl.tudelft.lime.edit.policy.ArcEditPolicy;
 
 import org.eclipse.draw2d.ManhattanConnectionRouter;
 import org.eclipse.draw2d.RelativeBendpoint;
+
 import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+
 import org.eclipse.swt.accessibility.AccessibleEvent;
 
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
 
 /**
  * @author af08018

src/nl/tudelft/lime/edit/editpart/LimeCodeFragmentEditPart.java

  *******************************************************************************/
 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.edit.CodeFragmentCellEditorLocator;
 import nl.tudelft.lime.edit.LimeCodeFragmentEditManager;
 import nl.tudelft.lime.model.codefragment.LimeCodeFragment;
 
 import org.eclipse.draw2d.IFigure;
+
 import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
+
 import org.eclipse.swt.accessibility.AccessibleControlEvent;
 import org.eclipse.swt.accessibility.AccessibleEvent;
 
+import java.beans.PropertyChangeEvent;
+
 
 public class LimeCodeFragmentEditPart extends LimeEditPart {
     protected AccessibleEditPart createAccessible() {
         installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
         installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
             new CodeFragmentDirectEditPolicy());
-        installEditPolicy(EditPolicy.COMPONENT_ROLE, new CodeFragmentEditPolicy());
+        installEditPolicy(EditPolicy.COMPONENT_ROLE,
+            new CodeFragmentEditPolicy());
     }
 
     protected IFigure createFigure() {
         CodeFragmentFigure label = new CodeFragmentFigure();
+
         return label;
     }
 
 
     protected void refreshVisuals() {
         ((CodeFragmentFigure) getFigure()).setText(getLimeLabel()
-                                                     .getLabelContents());
+                                                       .getLabelContents());
         super.refreshVisuals();
     }
 }

src/nl/tudelft/lime/edit/editpart/LimeContainerEditPart.java

 package nl.tudelft.lime.edit.editpart;
 
-import java.util.List;
-
 import nl.tudelft.lime.edit.policy.LimeContainerEditPolicy;
 import nl.tudelft.lime.model.component.LimeDiagram;
 
 import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.EditPolicy;
+
 import org.eclipse.swt.accessibility.AccessibleEvent;
 
+import java.util.List;
+
 
 /**
  * Provides support for Container EditParts.

src/nl/tudelft/lime/edit/editpart/LimeContainerTreeEditPart.java

  *******************************************************************************/
 package nl.tudelft.lime.edit.editpart;
 
-import java.util.List;
-
 import nl.tudelft.lime.edit.policy.LimeContainerEditPolicy;
 import nl.tudelft.lime.edit.policy.LimeTreeContainerEditPolicy;
 import nl.tudelft.lime.model.component.LimeDiagram;
 import org.eclipse.gef.RootEditPart;
 import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
 
+import java.util.List;
+
 
 /**
  * Tree EditPart for the Container.

src/nl/tudelft/lime/edit/editpart/LimeDiagramEditPart.java

  *******************************************************************************/
 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.edit.policy.LimeXYLayoutEditPolicy;
 import nl.tudelft.lime.layout.DelegatingLayoutManager;
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.ShortestPathConnectionRouter;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.CompoundSnapToHelper;
 import org.eclipse.gef.ConnectionEditPart;
 import org.eclipse.gef.rulers.RulerProvider;
 import org.eclipse.gef.tools.DeselectAllTracker;
 import org.eclipse.gef.tools.MarqueeDragTracker;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.accessibility.AccessibleEvent;
 
+import java.beans.PropertyChangeEvent;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.List;
+
 
 /**
  * Holds all other LimeEditParts under this. It is
 
     public void propertyChange(PropertyChangeEvent evt) {
         if (LimeDiagram.ID_ROUTER.equals(evt.getPropertyName()) ||
-        	LimeDiagram.Property_ID_DIAGRAM_ONLY_INSTANCES.equals(evt.getPropertyName())) {
+                LimeDiagram.Property_ID_DIAGRAM_ONLY_INSTANCES.equals(
+                    evt.getPropertyName())) {
             refreshVisuals();
         } else {
             super.propertyChange(evt);
         if ((getViewer().getControl().getStyle() & SWT.MIRRORED) == 0) {
             cLayer.setAntialias(SWT.ON);
         }
+
         if (getLimeDiagram().getConnectionRouter()
                     .equals(LimeDiagram.ROUTER_MANUAL)) {
             AutomaticRouter router = new FanRouter();
         Animation.run(400);
         refreshChildren();
     }
-    
-   
+
     /**
      * Returns the children of this through the model.
      * If LimeDiagram is set in its only instances mode only show components which are instances
      */
     @SuppressWarnings("unchecked")
     protected List getModelChildren() {
-    	List<LimeElement> children = getLimeDiagram().getChildren();
-    	List<LimeElement> filteredChildren = new ArrayList<LimeElement>();
-    	boolean onlyInstances = getLimeDiagram().showOnlyInstances() == 1;
-    	for (LimeElement child : children){
-    		//if it is a component but is it is different than the diagram must show hide it
-    		if (!(child instanceof LimeComponent)
-    			|| (onlyInstances == ((LimeComponent) child).isInstance()))
-    			filteredChildren.add(child);
-    	}
+        List<LimeElement> children = getLimeDiagram().getChildren();
+        List<LimeElement> filteredChildren = new ArrayList<LimeElement>();
+        boolean onlyInstances = getLimeDiagram().showOnlyInstances() == 1;
+
+        for (LimeElement child : children) {
+            //if it is a component but is it is different than the diagram must show hide it
+            if (!(child instanceof LimeComponent) ||
+                    (onlyInstances == ((LimeComponent) child).isInstance())) {
+                filteredChildren.add(child);
+            }
+        }
+
         return filteredChildren;
-    }        
+    }
 }

src/nl/tudelft/lime/edit/editpart/LimeEditPart.java

 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-
 import nl.tudelft.lime.edit.policy.ElementEditPolicy;
 import nl.tudelft.lime.edit.policy.LimeNodeEditPolicy;
 import nl.tudelft.lime.figures.NodeFigure;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.ConnectionEditPart;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
 import org.eclipse.gef.requests.DropRequest;
 
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import java.util.List;
+
 
 /**
  * Porvides support for

src/nl/tudelft/lime/edit/editpart/LimeTreeEditPart.java

  *******************************************************************************/
 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Collections;
-import java.util.List;
-
 import nl.tudelft.lime.edit.policy.ElementEditPolicy;
 import nl.tudelft.lime.edit.policy.LimeTreeEditPolicy;
 import nl.tudelft.lime.model.LimeSubpart;
 
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPolicy;
+
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import java.util.Collections;
+import java.util.List;
+
 
 /**
  * EditPart for Lime components in the Tree.

src/nl/tudelft/lime/edit/editpart/PortEditPart.java

 package nl.tudelft.lime.edit.editpart;
 
-import java.beans.PropertyChangeEvent;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
 import nl.tudelft.lime.figures.FigureFactory;
 import nl.tudelft.lime.model.port.Port;
 
 import org.eclipse.draw2d.ConnectionAnchor;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.geometry.Point;
+
 import org.eclipse.gef.AccessibleAnchorProvider;
 import org.eclipse.gef.AccessibleEditPart;
+
 import org.eclipse.swt.accessibility.AccessibleEvent;
 
+import java.beans.PropertyChangeEvent;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
 
 /**
  * EditPart which is used in Ports

src/nl/tudelft/lime/edit/policy/ArcBendpointEditPolicy.java

 
 import org.eclipse.draw2d.Connection;
 import org.eclipse.draw2d.geometry.Point;
+
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.requests.BendpointRequest;
 

src/nl/tudelft/lime/edit/policy/CodeFragmentEditPolicy.java

 
     protected Command getDropTextCommand(NativeDropRequest request) {
         LimeCodeFragmentCommand command = new LimeCodeFragmentCommand((LimeCodeFragment) getHost()
-                                                                        .getModel(),
+                                                                                             .getModel(),
                 (String) request.getData());
 
         return command;

src/nl/tudelft/lime/edit/policy/ConnectionWhileEditingEditPolicy.java

 
 import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.PolylineConnection;
+
 import org.eclipse.gef.GraphicalEditPart;
 
 

src/nl/tudelft/lime/edit/policy/ContainerHighlightEditPolicy.java

 import nl.tudelft.lime.figures.LimeConstants;
 
 import org.eclipse.draw2d.IFigure;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
+
 import org.eclipse.swt.graphics.Color;
 
 

src/nl/tudelft/lime/edit/policy/LimeContainerEditPolicy.java

 package nl.tudelft.lime.edit.policy;
 
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.model.LimeSubpart;
 import nl.tudelft.lime.model.commands.OrphanChildCommand;
 import org.eclipse.gef.requests.CreateRequest;
 import org.eclipse.gef.requests.GroupRequest;
 
+import java.util.List;
+
 
 public class LimeContainerEditPolicy extends ContainerEditPolicy {
     protected Command getCreateCommand(CreateRequest request) {

src/nl/tudelft/lime/edit/policy/LimeDiagramXYLayoutPolicy.java

 
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.Request;

src/nl/tudelft/lime/edit/policy/LimeNodeEditPolicy.java

 import org.eclipse.draw2d.ConnectionAnchor;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.PolylineConnection;
+
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.LayerConstants;
 import org.eclipse.gef.Request;

src/nl/tudelft/lime/edit/policy/LimeTreeContainerEditPolicy.java

 package nl.tudelft.lime.edit.policy;
 
-import java.util.List;
-
 import nl.tudelft.lime.model.LimeSubpart;
 import nl.tudelft.lime.model.commands.CreateCommand;
 import nl.tudelft.lime.model.commands.ReorderPartCommand;
 
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.commands.CompoundCommand;
 import org.eclipse.gef.requests.ChangeBoundsRequest;
 import org.eclipse.gef.requests.CreateRequest;
 
+import java.util.List;
+
 
 /**
  * Displays the outline tree in the outline view

src/nl/tudelft/lime/edit/policy/LimeXYLayoutEditPolicy.java

 package nl.tudelft.lime.edit.policy;
 
-import java.util.List;
-
 import nl.tudelft.lime.constants.LimeMessages;
 import nl.tudelft.lime.edit.editpart.LimeCodeFragmentEditPart;
 import nl.tudelft.lime.figures.LimeConstants;
 import org.eclipse.draw2d.XYLayout;
 import org.eclipse.draw2d.geometry.Insets;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.requests.CreateRequest;
 import org.eclipse.gef.rulers.RulerProvider;
 
+import java.util.List;
+
 
 public class LimeXYLayoutEditPolicy extends org.eclipse.gef.editpolicies.XYLayoutEditPolicy {
     public LimeXYLayoutEditPolicy(XYLayout layout) {
 
         LimeSubpart newPart = (LimeSubpart) request.getNewObject();
         create.setChild(newPart);
-        
-        Rectangle constraint; 
-        if (getLayoutContainer().getLayoutManager() instanceof XYLayout)
-        	create.setLocation((Rectangle) getConstraintFor(request));
-        
+
+        Rectangle constraint;
+
+        if (getLayoutContainer().getLayoutManager() instanceof XYLayout) {
+            create.setLocation((Rectangle) getConstraintFor(request));
+        }
+
         create.setLabel(LimeMessages.LimeXYLayoutEditPolicy_CreateCommandLabelText);
 
         Command cmd = chainGuideAttachmentCommand(request, newPart, create, true);

src/nl/tudelft/lime/edit/policy/WhileDraggingEditPolicy.java

 package nl.tudelft.lime.edit.policy;
 
-import java.util.List;
-
 import nl.tudelft.lime.figures.LimeConstants;
 import nl.tudelft.lime.figures.NodeFigure;
 import nl.tudelft.lime.figures.codefragment.CodeFragmentFigure;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.RectangleFigure;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.LayerConstants;
 import org.eclipse.gef.editpolicies.ResizableEditPolicy;
 
+import java.util.List;
+
 
 /**
  *

src/nl/tudelft/lime/figures/FigureUtility.java

 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 
         int xLoc = r.getCenter().x - ((textGraphicalSize.width) / 2);
         int yLoc = r.getCenter().y - (textGraphicalSize.height / 2);
 
-        if (xLoc < 0) xLoc = 0;
-        if (yLoc < 0) yLoc = 0;
+        if (xLoc < 0) {
+            xLoc = 0;
+        }
+
+        if (yLoc < 0) {
+            yLoc = 0;
+        }
+
         return new Point(xLoc, yLoc);
     }
 
     public static void setDefaultFont(Font newFont) {
         DEFAULT_FONT = newFont;
     }
-
 }

src/nl/tudelft/lime/figures/LimeConstants.java

 import nl.tudelft.lime.constants.LimeMessages;
 
 import org.eclipse.jface.viewers.LabelProvider;
+
 import org.eclipse.swt.graphics.Color;
 
 
     public final static Color black = new Color(null, 0, 0, 0);
     public final static Color ghostFillColor = new Color(null, 31, 31, 31);
     public final static String[] booleanTypes = {
-        LimeMessages.PropertyDescriptor_Boolean_False,
-        LimeMessages.PropertyDescriptor_Boolean_True
-    };
+            LimeMessages.PropertyDescriptor_Boolean_False,
+            LimeMessages.PropertyDescriptor_Boolean_True
+        };
+
     /**
      * This is a label provider for the type of the arc
      * @author mazaninfardi
             return super.getText(element);
         }
     }
-
 }

src/nl/tudelft/lime/figures/NodeFigure.java

 package nl.tudelft.lime.figures;
 
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
 import org.eclipse.draw2d.ConnectionAnchor;
 import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
 
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
 
 public class NodeFigure extends Figure {
     public static final String BOUNDS = "BOUNDS";

src/nl/tudelft/lime/figures/codefragment/CodeFragmentFigure.java

 package nl.tudelft.lime.figures.codefragment;
 
-
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.StackLayout;
 import org.eclipse.draw2d.geometry.Dimension;
  */
 public class CodeFragmentFigure extends BentCornerFigure {
     protected static final Dimension SIZE = new Dimension(150, -1);
+
     /** The inner TextFlow **/
     private TextFlow textFlow;
 
         add(flowPage);
     }
 
-    
     /**
      * Returns the text inside the TextFlow.
      *

src/nl/tudelft/lime/figures/component/ComponentFigure.java

 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Insets;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.gef.handles.HandleBounds;
 
 

src/nl/tudelft/lime/figures/connection/ArcFigure.java

 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.PointList;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.swt.graphics.Color;
 
 
     @Override
     public void paintFigure(Graphics graphics) {
         super.paintFigure(graphics);
+
         PointList points = getPoints();
+
         //we have at least two points - we assume that we would use the last two points as text show
         Point firstPoint = points.getPoint(points.size() - 2);
         Point secondPoint = points.getPoint(points.size() - 1);
 
         graphics.setFont(FigureUtility.DEFAULT_FONT);
 
-        Dimension textSize = FigureUtility.getTextSize(graphics, this.typeName.length());
+        Dimension textSize = FigureUtility.getTextSize(graphics,
+                this.typeName.length());
         //padding for the text compartment
         textSize.height += 2;
         textSize.width += 5;
-        
-        if (getBounds().width < textSize.width)
-        	getBounds().expand(textSize.width - getBounds().width, 0);
+
+        if (getBounds().width < textSize.width) {
+            getBounds().expand(textSize.width - getBounds().width, 0);
+        }
 
         Point p = FigureUtility.centeredTextLocation(graphics, r,
                 this.typeName.length());
-        if (p.x < getBounds().x) p.x = getBounds().x;
-        
-//		Dimension prefferedSize = textSize.union(bounds.getSize());
-//        setBounds(new Rectangle(bounds.getLocation(), prefferedSize));
-        
+
+        if (p.x < getBounds().x) {
+            p.x = getBounds().x;
+        }
+
+        //		Dimension prefferedSize = textSize.union(bounds.getSize());
+        //        setBounds(new Rectangle(bounds.getLocation(), prefferedSize));
         graphics.setBackgroundColor(new Color(null, 255, 255, 255));
         graphics.fillRectangle(new Rectangle(p, textSize));
         graphics.drawRectangle((new Rectangle(p, textSize.shrink(1, 0))));

src/nl/tudelft/lime/figures/connection/AssociationFigure.java

 
 import org.eclipse.draw2d.PolygonDecoration;
 import org.eclipse.draw2d.PolylineConnection;
+
 import org.eclipse.swt.SWT;
 
 

src/nl/tudelft/lime/figures/port/OutputPortFigure.java

 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+
 import org.eclipse.swt.SWT;
 
 

src/nl/tudelft/lime/layout/DelegatingLayoutManager.java

 package nl.tudelft.lime.layout;
 
-import java.util.Map;
-
 import nl.tudelft.lime.edit.editpart.LimeDiagramEditPart;
 import nl.tudelft.lime.model.component.LimeDiagram;
 
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
 
+import java.util.Map;
+
 
 /**
  * Used to delegate between the GraphyLayoutManager and the GraphXYLayout classes

src/nl/tudelft/lime/layout/DummyEdgeCreator.java

  */
 package nl.tudelft.lime.layout;
 
+import org.eclipse.draw2d.graph.DirectedGraph;
+import org.eclipse.draw2d.graph.Edge;
+import org.eclipse.draw2d.graph.EdgeList;
+import org.eclipse.draw2d.graph.Node;
+import org.eclipse.draw2d.graph.NodeList;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.eclipse.draw2d.graph.DirectedGraph;
-import org.eclipse.draw2d.graph.Edge;
-import org.eclipse.draw2d.graph.EdgeList;
-import org.eclipse.draw2d.graph.Node;
-import org.eclipse.draw2d.graph.NodeList;
-
 
 /**
  * Creates dummy edges between nodes, to be used with NodeJoiningDirectedGraphLayout
         //if node count is only one then we don't have to worry about whether
         // the nodes are connected
         if (nodeCount > 1) {
-        	for (Object node : nodeList){
+            for (Object node : nodeList) {
                 Node sourceNode = (Node) node;
 
                 //we will need to set up a dummy relationship for any table not
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
-
             }
         }
 

src/nl/tudelft/lime/layout/GraphAnimation.java

  */
 package nl.tudelft.lime.layout;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 import org.eclipse.draw2d.Connection;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.Viewport;
 import org.eclipse.draw2d.geometry.PointList;
 import org.eclipse.draw2d.geometry.Rectangle;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 
 /**
  * GraphAnimation class lifted directly from the GEF flow example. The only

src/nl/tudelft/lime/layout/GraphLayoutManager.java

  */
 package nl.tudelft.lime.layout;
 
-import java.util.List;
-
 import nl.tudelft.lime.edit.editpart.LimeDiagramEditPart;
 
 import org.eclipse.draw2d.AbstractLayout;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
 
+import java.util.List;
+
 
 /**
  * Uses the LimeDiagramDirectedGraphLayoutVisitor to automatically lay out figures on diagramEditPart

src/nl/tudelft/lime/layout/LimeDiagramDirectedGraphLayoutVisitor.java

 package nl.tudelft.lime.layout;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import nl.tudelft.lime.edit.editpart.ComponentEditPart;
 import nl.tudelft.lime.edit.editpart.ConnectionEditPart;
 import nl.tudelft.lime.edit.editpart.LimeContainerEditPart;
 import org.eclipse.draw2d.graph.Edge;
 import org.eclipse.draw2d.graph.Node;
 import org.eclipse.draw2d.graph.NodeList;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 
 /**
  * Visitor with support for populating nodes and edges of DirectedGraph
     @SuppressWarnings("unchecked")
     public void layoutDiagramComponents(LimeDiagramEditPart diagram) {
         List<LimeEditPart> children = (List<LimeEditPart>) diagram.getChildren();
+
         for (LimeEditPart child : children) {
             if (child instanceof ComponentEditPart) {
                 layoutComponentContents(child, child);
      * Public method for reading graph nodes
      */
     public void layoutDiagram(LimeDiagramEditPart diagram) {
-
         Map<AbstractGraphicalEditPart, Object> partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
         Map<Node, Set<Node>> processedEdges = new HashMap<Node, Set<Node>>();
 
             } catch (Exception e) {
                 e.printStackTrace();
             }
+
             new ClusterBasedGraphLayout().visit(graph);
             applyResults(diagram, partToNodesMap);
         }
         List<LimeEditPart> children = (List<LimeEditPart>) component.getChildren();
 
         //this is the recursive part
-                for (LimeEditPart child : children) {
-                    if (child instanceof ComponentEditPart) {
-                        layoutComponentContents(mainParent, child);
-                    }
-                }
+        for (LimeEditPart child : children) {
+            if (child instanceof ComponentEditPart) {
+                layoutComponentContents(mainParent, child);
+            }
+        }
 
         //and this is the important part which layouts a component,
         //the rule is that first we check if items are connected together,
             //set the values in the model
             limeEditPart.getLimeSubpart().setLocation(new Point(n.x, n.y));
             limeEditPart.getLimeSubpart().setSize(nodeSize);
-            
+
             Rectangle bounds = new Rectangle(n.x, n.y, nodeSize.width,
                     nodeSize.height);
 
                 }
             }
         }
+
         /*
          This should normally be ignored
          else {

src/nl/tudelft/lime/layout/insidecomponent/InsideComponentClusterEdgeCreator.java

 package nl.tudelft.lime.layout.insidecomponent;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import nl.tudelft.lime.edit.editpart.ComponentEditPart;
 import nl.tudelft.lime.edit.editpart.LimeCodeFragmentEditPart;
 import nl.tudelft.lime.edit.editpart.PortEditPart;
 import org.eclipse.draw2d.graph.Node;
 import org.eclipse.draw2d.graph.NodeList;
 
+import java.util.ArrayList;
+import java.util.List;
+
 
 /**
  * Creates dummy edges between nodes, to be used with NodeJoiningDirectedGraphLayout
  */
 public class InsideComponentClusterEdgeCreator {
     //sets up maximum depth of recursion to set up initial cluster list
-//    private static final int INITIAL_RECURSION_DEPTH = 3;
+    //    private static final int INITIAL_RECURSION_DEPTH = 3;
     NodeList nodeList;
     EdgeList edgeList;
     DirectedGraph graph;
     List<Edge> edgesAdded;
     List<Node> encountered = new ArrayList<Node>();
     List<Cluster> clusters = new ArrayList<Cluster>();
+
     //holds a map for the created clusters based on the name
     //prefix of the components added
     Cluster inputPortCluster = new Cluster();
     Cluster embeddedComponentsCluster = new Cluster();
     Cluster outputPortCluster = new Cluster();
-    
     Cluster currentCluster = null;
 
     /**
             //first input cluster
             //second component cluster
             //third output cluster
-            for (Object item : nodeList){
+            for (Object item : nodeList) {
                 Node node = (Node) item;
 
                 //check whether we have already come across this node
                 if (!encountered.contains(node)) {
                     //create a new cluster for this node
-            		//if it is componentEditPart do somthing else
-                	//first consider the case 
-                	String nodePrefix = "";
-                	if ((node.data instanceof ComponentEditPart) || (node.data instanceof LimeCodeFragmentEditPart)) 
-                		embeddedComponentsCluster.set.add(node);
-                	else if (node.data instanceof PortEditPart){
-                		PortEditPart portEditPart = (PortEditPart)node.data;
-                		if (portEditPart.getModel() instanceof InputPort)
-                			inputPortCluster.set.add(node);
-                		else
-                			outputPortCluster.set.add(node);
-                	}
+                    //if it is componentEditPart do somthing else
+                    //first consider the case 
+                    String nodePrefix = "";
+
+                    if ((node.data instanceof ComponentEditPart) ||
+                            (node.data instanceof LimeCodeFragmentEditPart)) {
+                        embeddedComponentsCluster.set.add(node);
+                    } else if (node.data instanceof PortEditPart) {
+                        PortEditPart portEditPart = (PortEditPart) node.data;
+
+                        if (portEditPart.getModel() instanceof InputPort) {
+                            inputPortCluster.set.add(node);
+                        } else {
+                            outputPortCluster.set.add(node);
+                        }
+                    }
+
                     //inform this object that we have met the node
                     encountered.add(node);
                 }
             }
+
             //we don't use it by now
             coalesceRemainingClusters();
             //for a better layout of ports and components
             //if output ports are less than two then create dummy nodes for them
-//            createDummyNodes();
+            //            createDummyNodes();
             //now connect all the clusters
             joinClusters();
         } catch (RuntimeException e) {
             throw e;
         }
     }
+
     /**
      * Create dummy output nodes for a better layout
      */
-//    private void createDummyNodes() {
-//    	if (outputPortCluster.set.size() == 1){
-//            Node n = new Node();
-//
-//            n.width = 20;
-//            n.height = 100;
-//            n.setPadding(new Insets(10, 10, 10, 10));
-//            outputPortCluster.set.add(n);
-//    	}
-//	}
 
-	/**
-     * If recursion fails to join all the remaining
-     */
+    //    private void createDummyNodes() {
+    //    	if (outputPortCluster.set.size() == 1){
+    //            Node n = new Node();
+    //
+    //            n.width = 20;
+    //            n.height = 100;
+    //            n.setPadding(new Insets(10, 10, 10, 10));
+    //            outputPortCluster.set.add(n);
+    //    	}
+    //	}
+
+    /**
+    * If recursion fails to join all the remaining
+    */
     private void coalesceRemainingClusters() {
     }
 
     private void joinClusters() {