Author: mvw
Date: 2007-07-22 11:55:23-0700
New Revision: 13109
Modified:
trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java
Log:
Correction on last commit.
Reduce the dependency on org.argouml.notation.providers.uml from the UI.
Move the StereotypeUtility class to the org.argouml.uml package.
Modified: trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java?view=diff&rev=13109&p1=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&r1=13108&r2=13109
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java (original)
+++ trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java 2007-07-22 11:55:23-0700
@@ -394,162 +394,6 @@
}
}
-
-// /**
-// * This function shall replace the previous set of stereotypes
-// * of the given modelelement with a new set,
-// * given in the form of a "," seperated string of stereotype names.
-// *
-// * @param umlobject the UML element to adapt
-// * @param stereotype comma seperated stereotype names
-// * @param full false if stereotypes are only added,
-// * true if removal should be done, too.
-// */
-// public static void dealWithStereotypes(Object umlobject, String stereotype,
-// boolean full) {
-// String token;
-// MyTokenizer mst;
-// Collection stereotypes = new ArrayList();
-//
-// /* Convert the string (e.g. "aaa,bbb,ccc")
-// * into seperate stereotype-names (e.g. "aaa", "bbb", "ccc").
-// */
-// if (stereotype != null) {
-// mst = new MyTokenizer(stereotype, " ,\\,");
-// while (mst.hasMoreTokens()) {
-// token = mst.nextToken();
-// if (!",".equals(token) && !" ".equals(token)) {
-// stereotypes.add(token);
-// }
-// }
-// }
-//
-// if (full) {
-// // collect the to be removed stereotypes
-// Collection toBeRemoved = new ArrayList();
-// Iterator i = Model.getFacade().getStereotypes(umlobject).iterator();
-// while (i.hasNext()) {
-// String stereotypename = Model.getFacade().getName(i.next());
-// if (stereotypename != null
-// && !stereotypes.contains(stereotypename)) {
-// toBeRemoved.add(getStereotype(umlobject, stereotypename));
-// }
-// }
-//
-// // and now remove them
-// i = toBeRemoved.iterator();
-// while (i.hasNext()) {
-// Model.getCoreHelper().removeStereotype(umlobject, i.next());
-// }
-// }
-//
-// // add stereotypes
-// if (!stereotypes.isEmpty()) {
-// Iterator i = stereotypes.iterator();
-// while (i.hasNext()) {
-// String stereotypename = (String) i.next();
-// Object umlstereo = getStereotype(umlobject, stereotypename);
-// if (umlstereo != null) {
-// Model.getCoreHelper().addStereotype(umlobject, umlstereo);
-// }
-// }
-// }
-// }
-//
-// /**
-// * Finds a stereotype named name either in the subtree of the model rooted
-// * at root, or in the the ProfileJava model.
-// *
-// * @param obj
-// * A ModelElement to find a suitable stereotype for.
-// * @param name
-// * The name of the stereotype to search for.
-// * @return A stereotype named name, or possibly null.
-// */
-// private static Object getStereotype(Object obj, String name) {
-// Object root = Model.getFacade().getModel(obj);
-// Object stereo;
-//
-// stereo = recFindStereotype(obj, root, name);
-// if (stereo != null) {
-// return stereo;
-// }
-//
-// try {
-// Project project = ProjectManager.getManager().getCurrentProject();
-// Profile profile = project.getProfile();
-// stereo = recFindStereotype(obj, profile.getProfileModel(), name);
-// } catch (ProfileException e) {
-// // TODO: How are we going to handle exceptions here?
-// // I suspect the profile should be part of the project
-// // and not a singleton.
-// }
-//
-// if (stereo != null) {
-// return Model.getModelManagementHelper().getCorrespondingElement(
-// stereo, root);
-// }
-//
-// if (root != null && name.length() > 0) {
-// stereo =
-// Model.getExtensionMechanismsFactory().buildStereotype(
-// obj, name, root);
-// }
-//
-// return stereo;
-// }
-//
-// /**
-// * Recursively search a hive of a model for a stereotype with the name given
-// * in name.
-// *
-// * @param obj
-// * The model element to be suitable for.
-// * @param root
-// * The model element to search from.
-// * @param name
-// * The name of the stereotype to search for.
-// * @return An stereotype named name, or null if none is found.
-// */
-// private static Object recFindStereotype(
-// Object obj, Object root, String name) {
-// Object stereo;
-//
-// if (root == null) {
-// return null;
-// }
-//
-// if (Model.getFacade().isAStereotype(root)
-// && name.equals(Model.getFacade().getName(root))) {
-// if (Model.getExtensionMechanismsHelper().isValidStereoType(obj,
-// /* (MStereotype) */root)) {
-// return root;
-// }
-// }
-//
-// if (!Model.getFacade().isANamespace(root)) {
-// return null;
-// }
-//
-// Collection ownedElements = Model.getFacade().getOwnedElements(root);
-//
-// if (ownedElements == null) {
-// return null;
-// }
-//
-// // Loop through each element in the namespace, recursing.
-//
-// Iterator iter = ownedElements.iterator();
-//
-// while (iter.hasNext()) {
-// stereo = recFindStereotype(obj, iter.next(), name);
-// if (stereo != null) {
-// return stereo;
-// }
-// }
-// return null;
-// }
-
/**
* Returns a visibility String eihter for a MVisibilityKind (according to
* the definition in NotationProvider2), but also for a model element.
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.