Author: tfmorris
Date: 2007-07-23 12:46:07-0700
New Revision: 13121
Modified:
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Log:
Style cleanup - remove tabs, wrap long lines, remove unused imports
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java 2007-07-23 12:46:07-0700
@@ -64,9 +64,6 @@
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.Usage;
import org.eclipse.uml2.uml.VisibilityKind;
-import org.eclipse.uml2.uml.internal.impl.AssociationImpl;
-import org.eclipse.uml2.uml.internal.impl.PropertyImpl;
-import org.eclipse.uml2.uml.internal.impl.TypeImpl;
/**
@@ -78,9 +75,9 @@
* The model implementation.
*/
private EUMLModelImplementation modelImpl;
-
+
private EditingDomain editingDomain;
-
+
private UMLFactory uml = UMLFactory.eINSTANCE;
/**
@@ -93,7 +90,8 @@
editingDomain = implementation.getEditingDomain();
}
- public Abstraction buildAbstraction(String name, Object supplier, Object client) {
+ public Abstraction buildAbstraction(String name, Object supplier,
+ Object client) {
Abstraction abstraction = uml.createAbstraction();
abstraction.setName(name);
abstraction.getSuppliers().add((NamedElement) supplier);
@@ -101,57 +99,57 @@
return abstraction;
}
- @SuppressWarnings("all")
- public Association buildAssociation(final Object type1,
- final Boolean navigability1, final Object aggregationKind1,
- final String name1, final Object type2,
- final Boolean navigability2, final Object aggregationKind2,
- final String name2, final String associationName) {
-
- RunnableClass run = new RunnableClass() {
- public void run() {
- Association assoc = ((Type) type1).createAssociation(
- navigability1,
- aggregationKind1 == null ? AggregationKind.NONE_LITERAL
- : (AggregationKind) aggregationKind1, name1, 0,
- 1, (Type) type2, navigability2,
- aggregationKind2 == null ? AggregationKind.NONE_LITERAL
- : (AggregationKind) aggregationKind2, name2, 0,
- 1);
- for (Property p : assoc.getMemberEnds()) {
- p.setLowerValue(null);
- p.setUpperValue(null);
- }
- if (associationName != null) {
- assoc.setName(associationName);
- }
- getParams().add(assoc);
- }
- };
- editingDomain.getCommandStack().execute(
- new ChangeCommand(editingDomain, run));
+ Association buildAssociation(final Object type1,
+ final Boolean navigability1, final Object aggregationKind1,
+ final String name1, final Object type2,
+ final Boolean navigability2, final Object aggregationKind2,
+ final String name2, final String associationName) {
+
+ RunnableClass run = new RunnableClass() {
+ public void run() {
+ Association assoc = ((Type) type1).createAssociation(
+ navigability1,
+ aggregationKind1 == null ? AggregationKind.NONE_LITERAL
+ : (AggregationKind) aggregationKind1, name1, 0,
+ 1, (Type) type2, navigability2,
+ aggregationKind2 == null ? AggregationKind.NONE_LITERAL
+ : (AggregationKind) aggregationKind2, name2, 0,
+ 1);
+ for (Property p : assoc.getMemberEnds()) {
+ p.setLowerValue(null);
+ p.setUpperValue(null);
+ }
+ if (associationName != null) {
+ assoc.setName(associationName);
+ }
+ getParams().add(assoc);
+ }
+ };
+ editingDomain.getCommandStack().execute(
+ new ChangeCommand(editingDomain, run));
- return (Association) run.getParams().get(0);
+ return (Association) run.getParams().get(0);
}
-
+
public Association buildAssociation(Object fromClassifier,
- Object aggregationKind1, Object toClassifier,
- Object aggregationKind2, Boolean unidirectional) {
+ Object aggregationKind1, Object toClassifier,
+ Object aggregationKind2, Boolean unidirectional) {
- return buildAssociation(fromClassifier, true, aggregationKind1, null,
- toClassifier, !unidirectional, aggregationKind2, null, null);
+ return buildAssociation(fromClassifier, true, aggregationKind1, null,
+ toClassifier, !unidirectional, aggregationKind2, null, null);
}
- public Association buildAssociation(Object classifier1, Object classifier2) {
- return buildAssociation(classifier1, true,
- AggregationKind.NONE_LITERAL, null, classifier2, true,
- AggregationKind.NONE_LITERAL, null, null);
+ public Association buildAssociation(Object classifier1,
+ Object classifier2) {
+ return buildAssociation(classifier1, true,
+ AggregationKind.NONE_LITERAL, null, classifier2, true,
+ AggregationKind.NONE_LITERAL, null, null);
}
public Association buildAssociation(Object c1, boolean nav1, Object c2,
- boolean nav2, String name) {
- return buildAssociation(c1, nav1, AggregationKind.NONE_LITERAL, null,
- c2, nav2, AggregationKind.NONE_LITERAL, null, name);
+ boolean nav2, String name) {
+ return buildAssociation(c1, nav1, AggregationKind.NONE_LITERAL, null,
+ c2, nav2, AggregationKind.NONE_LITERAL, null, name);
}
public Association buildAssociationClass(Object end1, Object end2) {
@@ -171,8 +169,8 @@
// TODO Auto-generated method stub
return null;
}
-
- public Property buildAttribute() {
+
+ Property buildAttribute() {
Property attr = createAttribute();
attr.setName("newAttr");
attr.setLower(1);
@@ -189,6 +187,7 @@
return attr;
}
+ @SuppressWarnings("deprecation")
public Property buildAttribute(Object handle, Object model, Object type) {
// TODO Auto-generated method stub
return null;
@@ -222,14 +221,14 @@
}
public org.eclipse.uml2.uml.Class buildClass(final String name,
- final Object owner) {
- org.eclipse.uml2.uml.Class cls = uml.createClass();
- if (name != null) {
- cls.setName(name);
- }
- if (owner != null)
- modelImpl.getCoreHelper().addOwnedElement(owner, cls);
- return cls;
+ final Object owner) {
+ org.eclipse.uml2.uml.Class cls = uml.createClass();
+ if (name != null) {
+ cls.setName(name);
+ }
+ if (owner != null)
+ modelImpl.getCoreHelper().addOwnedElement(owner, cls);
+ return cls;
}
public Comment buildComment(Object element, Object model) {
@@ -286,7 +285,8 @@
return enumer;
}
- public EnumerationLiteral buildEnumerationLiteral(String name, Object enumeration) {
+ public EnumerationLiteral buildEnumerationLiteral(String name,
+ Object enumeration) {
return ((Enumeration) enumeration).createOwnedLiteral(name);
}
@@ -299,8 +299,8 @@
public Generalization buildGeneralization(Object child, Object parent) {
Generalization generalization =
- ((BehavioredClassifier) child)
- .createGeneralization((Classifier) parent);
+ ((BehavioredClassifier) child)
+ .createGeneralization((Classifier) parent);
return generalization;
}
@@ -329,6 +329,7 @@
return null;
}
+ @SuppressWarnings("deprecation")
public Operation buildOperation(Object classifier, Object model,
Object returnType) {
// TODO Auto-generated method stub
@@ -340,17 +341,20 @@
return null;
}
+ @SuppressWarnings("deprecation")
public Operation buildOperation(Object cls, Object model,
Object returnType, String name) {
// TODO Auto-generated method stub
return null;
}
- public Operation buildOperation2(Object cls, Object returnType, String name) {
+ public Operation buildOperation2(Object cls, Object returnType,
+ String name) {
// TODO Auto-generated method stub
return null;
}
+ @SuppressWarnings("deprecation")
public Parameter buildParameter(Object o, Object model, Object type) {
// TODO Auto-generated method stub
return null;
@@ -370,8 +374,8 @@
Object supplier, Object namespace) {
// TODO: namespace is ignored
InterfaceRealization realization =
- ((BehavioredClassifier) client).createInterfaceRealization(
- null, (Interface) supplier);
+ ((BehavioredClassifier) client).createInterfaceRealization(
+ null, (Interface) supplier);
return realization;
}
@@ -515,7 +519,7 @@
public PrimitiveType createPrimitiveType() {
return uml.createPrimitiveType();
}
-
+
@SuppressWarnings("deprecation")
public Object createProgrammingLanguageDataType() {
// Removed from UML 2.x & unused by ArgoUML.
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java 2007-07-23 12:46:07-0700
@@ -26,12 +26,14 @@
/*
* This implementation uses ideas and code snippets from the
- * "org.eclipse.uml2.uml.editor.presentation" package
+ * "org.eclipse.uml2.uml.editor.presentation" package.
*
* The package "org.eclipse.uml2.uml.editor.presentation" is part of the
- * Eclipse UML2 plugin and it is available under the terms of the Eclipse Public License v1.0
+ * Eclipse UML2 plugin and it is available under the terms of
+ * the Eclipse Public License v1.0.
*
- * The Eclipse Public License v1.0 is available at http://www.eclipse.org/legal/epl-v10.html
+ * The Eclipse Public License v1.0 is available at
+ * http://www.eclipse.org/legal/epl-v10.html.
*/
package org.argouml.model.euml;
@@ -40,9 +42,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
-import java.util.ArrayList;
import java.util.EventObject;
-import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
@@ -117,10 +117,10 @@
* @since ArgoUML 0.25.4, May 2007
*/
public class EUMLModelImplementation implements ModelImplementation {
-
+
private static final Logger LOG =
- Logger.getLogger(EUMLModelImplementation.class);
-
+ Logger.getLogger(EUMLModelImplementation.class);
+
private ActivityGraphsFactory theActivityGraphsFactory;
private ActivityGraphsHelper theActivityGraphsHelper;
@@ -174,9 +174,9 @@
private ScopeKind theScopeKind;
private StateMachinesFactory theStateMachinesFactory;
-
+
private StateMachinesHelper theStateMachinesHelper;
-
+
private UmlFactory theUmlFactory;
private UmlHelper theUmlHelper;
@@ -188,32 +188,35 @@
private VisibilityKind theVisibilityKind;
/**
- * This keeps track of the editing domain that is used to track all changes to the model.
+ * This keeps track of the editing domain that is used to track all changes
+ * to the model.
*/
private AdapterFactoryEditingDomain editingDomain;
-
+
/**
* Constructor.
*/
public EUMLModelImplementation() {
- initializeEditingDomain();
- LOG.debug("EUML Init - editing domain initialized"); //$NON-NLS-1$
+ initializeEditingDomain();
+ LOG.debug("EUML Init - editing domain initialized"); //$NON-NLS-1$
}
-
+
/**
- * Verifies if the editing domain can undo the last changes in the UML model
+ * Verifies if the editing domain can undo the last changes in the UML
+ * model.
+ *
* @return true if undo is possible, false otherwise
*/
public boolean canUndo() {
- return editingDomain.getCommandStack().canUndo();
+ return editingDomain.getCommandStack().canUndo();
}
-
+
/**
- * Verifies if the editing domain can redo the last undone command
+ * Verifies if the editing domain can redo the last undone command.
* @return true if redo is possible, false otherwise
*/
public boolean canRedo() {
- return editingDomain.getCommandStack().canRedo();
+ return editingDomain.getCommandStack().canRedo();
}
/**
@@ -222,121 +225,125 @@
* If {@link #canUndo()} returns false, nothing will happen
*/
public void undo() {
- editingDomain.getCommandStack().undo();
+ editingDomain.getCommandStack().undo();
}
-
+
/**
* Redo the last command
* <p>
* If {@link #canRedo()} returns false, nothing will happen
*/
public void redo() {
- editingDomain.getCommandStack().redo();
+ editingDomain.getCommandStack().redo();
}
-
+
/**
* This sets up the editing domain for the model editor.
*/
private void initializeEditingDomain() {
- // If the eUML.resources system property is defined then we are in a
- // stand alone application, else we're in an Eclipse plug in.
- // The eUML.resource should contain the path to the
- // org.eclipse.uml2.uml.resource jar plugin.
- String path = System.getProperty("eUML.resources"); //$NON-NLS-1$
-
- ComposedAdapterFactory adapterFactory = null;
-
- BasicCommandStack commandStack = new BasicCommandStack() {
-
- @Override
- protected void handleError(Exception exception) {
- super.handleError(exception);
- exception.printStackTrace();
- throw new RuntimeException(exception);
- }
-
- };
-
- commandStack.addCommandStackListener(new CommandStackListener() {
-
- public void commandStackChanged(final EventObject event) {
- LOG.debug("Command stack changed"); //$NON-NLS-1$
- Command mostRecentCommand = ((CommandStack) event.getSource())
- .getMostRecentCommand();
- if (mostRecentCommand != null) {
- LOG.debug("Affected objects: " //$NON-NLS-1$
- + mostRecentCommand.getAffectedObjects());
- }
- }
-
- });
-
- if (path == null) {
- // TODO: figure out how to use the ItemProviders - delayed until the ArgoEclipse version will be out
-// List<AdapterFactory> factories = new ArrayList<AdapterFactory>();
-// factories.add(new UMLResourceItemProviderAdapterFactory());
-// factories.add(new UMLItemProviderAdapterFactory());
-// factories.add(new EcoreItemProviderAdapterFactory());
-// factories.add(new UMLReflectiveItemProviderAdapterFactory());
-// adapterFactory = new ComposedAdapterFactory(factories);
- }
-
- editingDomain = new UML2AdapterFactoryEditingDomain(adapterFactory,
- commandStack);
-
- ResourceSet resourceSet = editingDomain.getResourceSet();
- Map<String, Object> extensionToFactoryMap = resourceSet
- .getResourceFactoryRegistry().getExtensionToFactoryMap();
- Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
-
- if (path != null) {
- try {
- FileInputStream in = new FileInputStream(path);
- in.close();
- } catch (IOException e) {
- throw (new RuntimeException(e));
- }
-
- path = path.replace('\\', '/');
- if (Character.isLetter(path.charAt(0))) {
- path = '/' + path;
- }
- URI uri = URI.createURI("jar:file:" + path + "!/"); //$NON-NLS-1$ //$NON-NLS-2$
- LOG.debug("eUML.resource URI --> " + uri); //$NON-NLS-1$
-
- resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
- UMLPackage.eINSTANCE);
- resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,
- EcorePackage.eINSTANCE);
- extensionToFactoryMap.put(UMLResource.FILE_EXTENSION,
- UMLResource.Factory.INSTANCE);
- uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri
- .appendSegment("libraries").appendSegment("")); //$NON-NLS-1$ //$NON-NLS-2$
- uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri
- .appendSegment("metamodels").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
- uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri
- .appendSegment("profiles").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- extensionToFactoryMap.put(UML22UMLResource.FILE_EXTENSION,
- UML22UMLResource.Factory.INSTANCE);
- extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
- XMI2UMLResource.Factory.INSTANCE);
- uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
- uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
+ // If the eUML.resources system property is defined then we are in a
+ // stand alone application, else we're in an Eclipse plug in.
+ // The eUML.resource should contain the path to the
+ // org.eclipse.uml2.uml.resource jar plugin.
+ String path = System.getProperty("eUML.resources"); //$NON-NLS-1$
+
+ ComposedAdapterFactory adapterFactory = null;
+
+ BasicCommandStack commandStack = new BasicCommandStack() {
+
+ @Override
+ protected void handleError(Exception exception) {
+ super.handleError(exception);
+ exception.printStackTrace();
+ throw new RuntimeException(exception);
+ }
+
+ };
+
+ commandStack.addCommandStackListener(new CommandStackListener() {
+
+ public void commandStackChanged(final EventObject event) {
+ LOG.debug("Command stack changed"); //$NON-NLS-1$
+ Command mostRecentCommand =
+ ((CommandStack) event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ LOG.debug("Affected objects: " //$NON-NLS-1$
+ + mostRecentCommand.getAffectedObjects());
+ }
+ }
+
+ });
+
+ if (path == null) {
+ // TODO: figure out how to use the ItemProviders -
+ // delayed until the ArgoEclipse version will be out
+// List<AdapterFactory> factories = new ArrayList<AdapterFactory>();
+// factories.add(new UMLResourceItemProviderAdapterFactory());
+// factories.add(new UMLItemProviderAdapterFactory());
+// factories.add(new EcoreItemProviderAdapterFactory());
+// factories.add(new UMLReflectiveItemProviderAdapterFactory());
+// adapterFactory = new ComposedAdapterFactory(factories);
+ }
+
+ editingDomain = new UML2AdapterFactoryEditingDomain(adapterFactory,
+ commandStack);
+
+ ResourceSet resourceSet = editingDomain.getResourceSet();
+ Map<String, Object> extensionToFactoryMap =
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap();
+ Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
+
+ if (path != null) {
+ try {
+ FileInputStream in = new FileInputStream(path);
+ in.close();
+ } catch (IOException e) {
+ throw (new RuntimeException(e));
+ }
+
+ path = path.replace('\\', '/');
+ if (Character.isLetter(path.charAt(0))) {
+ path = '/' + path;
+ }
+ URI uri = URI.createURI("jar:file:" + path + "!/"); //$NON-NLS-1$ //$NON-NLS-2$
+ LOG.debug("eUML.resource URI --> " + uri); //$NON-NLS-1$
+
+ resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
+ UMLPackage.eINSTANCE);
+ resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,
+ EcorePackage.eINSTANCE);
+ extensionToFactoryMap.put(UMLResource.FILE_EXTENSION,
+ UMLResource.Factory.INSTANCE);
+ uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri
+ .appendSegment("libraries").appendSegment("")); //$NON-NLS-1$ //$NON-NLS-2$
+ uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri
+ .appendSegment("metamodels").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+ uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri
+ .appendSegment("profiles").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ extensionToFactoryMap.put(UML22UMLResource.FILE_EXTENSION,
+ UML22UMLResource.Factory.INSTANCE);
+ extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
+ XMI2UMLResource.Factory.INSTANCE);
+ uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
+ uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
}
-
+
/**
* Getter for {@link #editingDomain the Editing Domain}
- * @return the editing domain of the current EUMLModelImplementation instance
+ *
+ * @return the editing domain of the current EUMLModelImplementation
+ * instance
*/
public EditingDomain getEditingDomain() {
- return editingDomain;
+ return editingDomain;
}
public ActivityGraphsFactory getActivityGraphsFactory() {
if (theActivityGraphsFactory == null) {
- theActivityGraphsFactory = new ActivityGraphsFactoryEUMLlImpl(this);
+ theActivityGraphsFactory =
+ new ActivityGraphsFactoryEUMLlImpl(this);
}
return theActivityGraphsFactory;
}
@@ -443,7 +450,7 @@
public ExtensionMechanismsFactory getExtensionMechanismsFactory() {
if (theExtensionMechanismsFactory == null) {
theExtensionMechanismsFactory =
- new ExtensionMechanismsFactoryEUMLImpl(this);
+ new ExtensionMechanismsFactoryEUMLImpl(this);
}
return theExtensionMechanismsFactory;
}
@@ -451,7 +458,7 @@
public ExtensionMechanismsHelper getExtensionMechanismsHelper() {
if (theExtensionMechanismsHelper == null) {
theExtensionMechanismsHelper =
- new ExtensionMechanismsHelperEUMLImpl(this);
+ new ExtensionMechanismsHelperEUMLImpl(this);
}
return theExtensionMechanismsHelper;
}
@@ -480,7 +487,7 @@
public ModelManagementFactory getModelManagementFactory() {
if (theModelManagementFactory == null) {
theModelManagementFactory =
- new ModelManagementFactoryEUMLImpl(this);
+ new ModelManagementFactoryEUMLImpl(this);
}
return theModelManagementFactory;
}
@@ -528,7 +535,7 @@
}
return theStateMachinesHelper;
}
-
+
public UmlFactory getUmlFactory() {
if (theUmlFactory == null) {
theUmlFactory = new UmlFactoryEUMLImpl(this);
@@ -569,7 +576,7 @@
}
public XmiWriter getXmiWriter(Object model, Writer writer, String version)
- throws UmlException {
+ throws UmlException {
return new XmiWriterEUMLImpl(this, model, writer, version);
}
@@ -577,7 +584,7 @@
String version) throws UmlException {
return new XmiWriterEUMLImpl(this, model, stream, version);
}
-
+
public DiagramInterchangeModel getDiagramInterchangeModel() {
// TODO Auto-generated method stub
return null;
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java 2007-07-23 12:46:07-0700
@@ -106,7 +106,6 @@
import org.eclipse.uml2.uml.StructuralFeature;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.TimeEvent;
-import org.eclipse.uml2.uml.TimeExpression;
import org.eclipse.uml2.uml.Transition;
import org.eclipse.uml2.uml.Trigger;
import org.eclipse.uml2.uml.TypedElement;
@@ -299,7 +298,7 @@
if (((Property) handle).isReadOnly()) {
return modelImpl.getChangeableKind().getFrozen();
} else {
- return modelImpl.getChangeableKind().getChangeable();
+ return modelImpl.getChangeableKind().getChangeable();
}
}
throw new NotYetImplementedException();
@@ -349,8 +348,9 @@
public Collection<Collaboration> getCollaborations(Object handle) {
Set<Collaboration> result = new HashSet<Collaboration>();
if (handle instanceof Classifier) {
- for (CollaborationUse cu : ((Classifier) handle).getCollaborationUses()) {
- result.add(cu.getType());
+ for (CollaborationUse cu
+ : ((Classifier) handle).getCollaborationUses()) {
+ result.add(cu.getType());
}
}
return result;
@@ -454,6 +454,7 @@
throw new NotYetImplementedException();
}
+ @SuppressWarnings("deprecation")
public Object getDiscriminator(Object handle) {
// Gone from UML 2.x
// throw new NotImplementedException();
@@ -473,8 +474,8 @@
}
public Collection getElementImports(Object handle) {
- return Collections.EMPTY_LIST;
-// throw new NotYetImplementedException();
+ return Collections.EMPTY_LIST;
+// throw new NotYetImplementedException();
}
public Collection getElementImports2(Object handle) {
@@ -685,7 +686,7 @@
// MultiplicityElement is now an interface implemented
// by element types that support multiplicities - tfm
if (handle instanceof MultiplicityElement) {
- return (MultiplicityElement)handle;
+ return (MultiplicityElement) handle;
} else {
throw new IllegalArgumentException();
}
@@ -701,7 +702,7 @@
// no longer named. For a transitional period we'll
// return a String to debug can continue, but the
// calling code should probably be fixed. - tfm 20070607
- return "";
+ return ""; //$NON-NLS-1$
}
// throw new IllegalArgumentException();
}
@@ -761,13 +762,13 @@
if (((Property) handle).isOrdered()) {
return modelImpl.getOrderingKind().getOrdered();
} else {
- return modelImpl.getOrderingKind().getUnordered();
+ return modelImpl.getOrderingKind().getUnordered();
}
} else if (handle instanceof MultiplicityElement) {
if (((MultiplicityElement) handle).isOrdered()) {
return modelImpl.getOrderingKind().getOrdered();
} else {
- return modelImpl.getOrderingKind().getUnordered();
+ return modelImpl.getOrderingKind().getUnordered();
}
}
throw new NotYetImplementedException();
@@ -885,7 +886,8 @@
}
public Collection getReceptions(Object handle) {
- // TODO: Signal -> Receptions association not navigable in this direction
+ // TODO: Signal -> Receptions association not navigable in this
+ // direction
return Collections.EMPTY_SET;
}
@@ -1224,6 +1226,7 @@
return handle instanceof AggregationKind;
}
+ @SuppressWarnings("deprecation")
public boolean isAArgListsExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1284,6 +1287,7 @@
throw new NotYetImplementedException();
}
+ @SuppressWarnings("deprecation")
public boolean isABooleanExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1477,6 +1481,7 @@
return handle instanceof Interface;
}
+ @SuppressWarnings("deprecation")
public boolean isAIterationExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1501,6 +1506,7 @@
throw new NotYetImplementedException();
}
+ @SuppressWarnings("deprecation")
public boolean isAMappingExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1566,6 +1572,7 @@
return false;
}
+ @SuppressWarnings("deprecation")
public boolean isAObjectSetExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1600,6 +1607,7 @@
return handle instanceof PrimitiveType;
}
+ @SuppressWarnings("deprecation")
public boolean isAProcedureExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1737,6 +1745,7 @@
return handle instanceof TimeEvent;
}
+ @SuppressWarnings("deprecation")
public boolean isATimeExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
@@ -1746,6 +1755,7 @@
return handle instanceof Transition;
}
+ @SuppressWarnings("deprecation")
public boolean isATypeExpression(Object handle) {
// TODO: Fallback for UML 1.4
return isAExpression(handle);
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java 2007-07-23 12:46:07-0700
@@ -109,20 +109,22 @@
// TODO: get/setRootModel aren't specific to the Model implementation
// they could probably be moved elsewhere - tfm - 20070530
public void setRootModel(Object rootModel) {
- if (rootModel != null && !(rootModel instanceof org.eclipse.uml2.uml.Package)) {
- throw new IllegalArgumentException(
- "The rootModel supplied must be a Package. Got a "
- + rootModel.getClass().getName());
- }
+ if (rootModel != null
+ && !(rootModel instanceof org.eclipse.uml2.uml.Package)) {
+ throw new IllegalArgumentException(
+ "The rootModel supplied must be a Package. Got a "
+ + rootModel.getClass().getName());
+ }
if (theRootModel != null && theRootModel.eResource() != null) {
EcoreUtil.remove(theRootModel);
}
- theRootModel = (org.eclipse.uml2.uml.Package) rootModel;
+ theRootModel = (org.eclipse.uml2.uml.Package) rootModel;
if (rootModel != null) {
- Resource r = editingDomain.createResource("http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
- r.getContents().add(theRootModel);
+ Resource r = editingDomain.createResource(
+ "http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
+ r.getContents().add(theRootModel);
}
- modelImpl.getModelEventPump().setRootContainer(theRootModel);
+ modelImpl.getModelEventPump().setRootContainer(theRootModel);
}
public org.eclipse.uml2.uml.Package getRootModel() {
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java 2007-07-23 12:46:07-0700
@@ -54,8 +54,8 @@
* @param pump The ModelEventPump instance
*/
public RootContainerAdapter(ModelEventPumpEUMLImpl pump) {
- super();
- this.pump = pump;
+ super();
+ this.pump = pump;
}
/**
@@ -63,7 +63,7 @@
* @param value True for delivering events, false otherwise
*/
public void setDeliverEvents(boolean value) {
- deliverEvents = value;
+ deliverEvents = value;
}
/**
@@ -71,49 +71,49 @@
* @param n the new root container
*/
public void setRootContainer(Notifier n) {
- if (n == rootContainer) {
- return;
- }
-
- removeAllAdapters();
- if (n != null) {
- rootContainer = n;
- rootContainer.eAdapters().add(this);
- }
+ if (n == rootContainer) {
+ return;
+ }
+
+ removeAllAdapters();
+ if (n != null) {
+ rootContainer = n;
+ rootContainer.eAdapters().add(this);
+ }
}
-
+
@Override
protected void addAdapter(Notifier notifier) {
- notifiers.add(notifier);
- super.addAdapter(notifier);
+ notifiers.add(notifier);
+ super.addAdapter(notifier);
}
@Override
protected void removeAdapter(Notifier notifier) {
- notifiers.remove(notifier);
- super.removeAdapter(notifier);
+ notifiers.remove(notifier);
+ super.removeAdapter(notifier);
}
/**
* Removes this listener from all the notifiers' eAdapters list.
*/
public void removeAllAdapters() {
- for (Notifier n : notifiers) {
- super.removeAdapter(n);
- }
- if (rootContainer != null) {
- super.removeAdapter(rootContainer);
- rootContainer = null;
- }
- notifiers.clear();
+ for (Notifier n : notifiers) {
+ super.removeAdapter(n);
+ }
+ if (rootContainer != null) {
+ super.removeAdapter(rootContainer);
+ rootContainer = null;
+ }
+ notifiers.clear();
}
@Override
public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- if (deliverEvents) {
- pump.notifyChanged(notification);
- }
+ super.notifyChanged(notification);
+ if (deliverEvents) {
+ pump.notifyChanged(notification);
+ }
}
}
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RunnableClass.java 2007-07-23 12:46:07-0700
@@ -41,8 +41,8 @@
* into a Runnable instance.
*/
private ArrayList<Object> params = new ArrayList<Object>();
-
+
public ArrayList<Object> getParams() {
- return params;
+ return params;
}
}
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&rev=13121&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&r1=13120&r2=13121
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java 2007-07-23 12:46:07-0700
@@ -43,7 +43,8 @@
*/
class XmiReaderEUMLImpl implements XmiReader {
- private static Logger LOG = Logger.getLogger(XmiReaderEUMLImpl.class);
+ private static final Logger LOG =
+ Logger.getLogger(XmiReaderEUMLImpl.class);
/**
* The model implementation.
@@ -80,20 +81,22 @@
}
public Collection parse(InputSource inputSource, boolean profile)
- throws UmlException {
- EditingDomain editingDomain = modelImpl.getEditingDomain();
- for (Resource resource : editingDomain.getResourceSet().getResources()) {
- resource.unload();
- }
-
- Resource r = editingDomain.createResource("http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
- try {
- r.load(inputSource.getByteStream(), null);
- } catch (IOException e) {
- throw new UmlException(e);
- }
-
- return r.getContents();
+ throws UmlException {
+ EditingDomain editingDomain = modelImpl.getEditingDomain();
+ for (Resource resource
+ : editingDomain.getResourceSet().getResources()) {
+ resource.unload();
+ }
+
+ Resource r = editingDomain.createResource(
+ "http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
+ try {
+ r.load(inputSource.getByteStream(), null);
+ } catch (IOException e) {
+ throw new UmlException(e);
+ }
+
+ return r.getContents();
}
public boolean setIgnoredElements(String[] elementNames) {
@@ -102,9 +105,9 @@
}
public String getTagName() {
- // This is not quite right
- // TODO: Solve this
- return "uml:Model";
+ // This is not quite right
+ // TODO: Solve this
+ return "uml:Model"; //$NON-NLS-1$
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.