Author: mvw Date: 2008-04-28 03:17:55-0700 New Revision: 14497 Modified: trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java
Log: Corrected helptext for NodeInstance: Notation for NodeInstance does not support stereotypes. Corrected inheritance for Node and NodeInstance regarding NotationProvider - no functional change. Comments, generics, style. Modified: trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties?view=diff&rev=14497&p1=trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties&p2=trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties&r1=14496&r2=14497 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties (original) +++ trunk/src/argouml-app/src/org/argouml/i18n/parsing.properties 2008-04-28 03:17:55-0700 @@ -1,5 +1,5 @@ # $Id$ -# Copyright (c) 1996-2007 The Regents of the University of California. All +# Copyright (c) 1996-2008 The Regents of the University of California. All # Rights Reserved. Permission to use, copy, modify, and distribute this # software and its documentation without fee, and without a written # agreement is hereby granted, provided that the above copyright notice @@ -80,7 +80,7 @@ parsing.help.fig-node = Enter the name of the node according: \ [ "<<" stereotype ">>" ] name parsing.help.fig-nodeinstance = Enter the name of the nodeinstance according: \ - [ "<<" stereotype ">>" ] name [ ":" type [ "," type]*] + name [ ":" type [ "," type]*] parsing.help.fig-nodemodelelement = Enter the name of this modelelement according: \ [ "<<" stereotype ">>" ] [ "+" | "-" | "#" ] [ full_pathname "::" ] [ name ] parsing.help.fig-object = Enter the name of the object according: \ Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java?view=diff&rev=14497&p1=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java&p2=trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java&r1=14496&r2=14497 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java (original) +++ trunk/src/argouml-app/src/org/argouml/notation/providers/uml/NodeInstanceNotationUml.java 2008-04-28 03:17:55-0700 @@ -1,5 +1,5 @@ // $Id$ -// Copyright (c) 2005-2007 The Regents of the University of California. All +// Copyright (c) 2005-2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice @@ -35,6 +35,8 @@ import org.argouml.notation.providers.NodeInstanceNotation; /** + * Notation for a NodeInstance. + * * @author Michiel */ public class NodeInstanceNotationUml extends NodeInstanceNotation { @@ -49,7 +51,11 @@ } /** - * Parse a line of the form: "name : base-node". + * Parse a line of the form: "name : base-node". + * <p> + * The base-node part is a comma separated list of Nodes. <p> + * + * Note that stereotypes are not supported. * * [EMAIL PROTECTED] */ @@ -76,7 +82,7 @@ tokenizer = new StringTokenizer(bases, ","); - List classifiers = new ArrayList(); + List<Object> classifiers = new ArrayList<Object>(); Object ns = Model.getFacade().getNamespace(modelElement); if (ns != null) { while (tokenizer.hasMoreElements()) { Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java?view=diff&rev=14497&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java&r1=14496&r2=14497 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java 2008-04-28 03:17:55-0700 @@ -231,13 +231,6 @@ } @Override - protected void textEditStarted(FigText ft) { - if (ft == getNameFig()) { - showHelp("parsing.help.fig-node"); - } - } - - @Override public boolean getUseTrapRect() { return true; } Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java?view=diff&rev=14497&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java&r1=14496&r2=14497 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigMNode.java 2008-04-28 03:17:55-0700 @@ -1,5 +1,5 @@ // $Id$ -// Copyright (c) 1996-2007 The Regents of the University of California. All +// Copyright (c) 1996-2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice @@ -28,6 +28,7 @@ import java.util.Vector; import org.tigris.gef.graph.GraphModel; +import org.tigris.gef.presentation.FigText; /** * Class to display graphics for a UML Node in a diagram. @@ -53,6 +54,12 @@ super(gm, node); } + @Override + protected void textEditStarted(FigText ft) { + if (ft == getNameFig()) { + showHelp("parsing.help.fig-node"); + } + } /* * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent) Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java?view=diff&rev=14497&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&r1=14496&r2=14497 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java 2008-04-28 03:17:55-0700 @@ -1,5 +1,5 @@ // $Id$ -// Copyright (c) 1996-2007 The Regents of the University of California. All +// Copyright (c) 1996-2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice @@ -24,20 +24,15 @@ package org.argouml.uml.diagram.deployment.ui; -import java.awt.Rectangle; -import java.beans.PropertyVetoException; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import org.argouml.model.Model; -import org.argouml.notation.NotationProvider; import org.argouml.notation.NotationProviderFactory2; import org.argouml.uml.diagram.ui.FigEdgeModelElement; import org.tigris.gef.base.Selection; import org.tigris.gef.graph.GraphModel; import org.tigris.gef.presentation.Fig; -import org.tigris.gef.presentation.FigText; /** * Class to display graphics for a UML NodeInstance in a diagram.<p> @@ -46,10 +41,6 @@ */ public class FigNodeInstance extends AbstractFigNode { - - - private NotationProvider notationProvider; - /** * Main constructor - used for file loading. */ @@ -66,19 +57,12 @@ */ public FigNodeInstance(GraphModel gm, Object node) { super(gm, node); + getNameFig().setUnderline(true); } - /* - * @see org.argouml.uml.diagram.ui.FigNodeModelElement#initNotationProviders(java.lang.Object) - */ @Override - protected void initNotationProviders(Object own) { - super.initNotationProviders(own); - if (Model.getFacade().isANodeInstance(own)) { - notationProvider = - NotationProviderFactory2.getInstance().getNotationProvider( - NotationProviderFactory2.TYPE_NODEINSTANCE, own); - } + protected int getNotationProviderType() { + return NotationProviderFactory2.TYPE_NODEINSTANCE; } @Override @@ -132,9 +116,7 @@ if (getLayer() != null) { // elementOrdering(figures); Collection contents = new ArrayList(getLayer().getContents()); - Iterator it = contents.iterator(); - while (it.hasNext()) { - Object o = it.next(); + for (Object o : contents) { if (o instanceof FigEdgeModelElement) { FigEdgeModelElement figedge = (FigEdgeModelElement) o; figedge.getLayer().bringToFront(figedge); @@ -143,28 +125,7 @@ } } - /* - * @see org.argouml.uml.diagram.ui.FigNodeModelElement#textEdited(org.tigris.gef.presentation.FigText) - */ - @Override - protected void textEdited(FigText ft) throws PropertyVetoException { - if (ft == getNameFig()) { - notationProvider.parse(getOwner(), ft.getText()); - ft.setText(notationProvider.toString(getOwner(), null)); - } - } - - /* - * @see org.argouml.uml.diagram.ui.FigNodeModelElement#textEditStarted(org.tigris.gef.presentation.FigText) - */ - @Override - protected void textEditStarted(FigText ft) { - if (ft == getNameFig()) { - showHelp(notationProvider.getParsingHelp()); - } - } - - /* + /* * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateListeners(java.lang.Object) */ @Override @@ -178,16 +139,4 @@ } } - /* - * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateNameText() - */ - @Override - protected void updateNameText() { - if (isReadyToEdit()) { - getNameFig().setText(notationProvider.toString(getOwner(), null)); - } - Rectangle r = getBounds(); - setBounds(r.x, r.y, r.width, r.height); - } - } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
