Login | Register
My pages Projects Community openCollabNet

Discussions > dev > FW: A small structural change. Comments requested.

gef
Discussion topic

Back to topic list

FW: A small structural change. Comments requested.

Reply

Author Eugenio Alvarez <eugenio-a at dataaccess dot com>
Full name Eugenio Alvarez <eugenio-a at dataaccess dot com>
Date 2000-06-16 06:04:14 PDT
Message Sorry, if this is message is duplicated. I am not sure if it went through
the first time.
Eugenio



> -----Original Message-----
> From: Eugenio Alvarez
> Sent: Monday, June 12, 2000 9:29 AM
> To: 'dev at argouml dot tigris dot org'
> Cc: 'wienberg@informatik​.uni-hamburg.de'
> Subject: A small structural change. Comments requested.
>
> Hi All,
>
> I have been working on fixing the cut/paste ModelElement view feature in
> Argo.
> While working on the fix I realized that a small structural changes seems
> appropriate.
>
> I would like to add a new Class uci.gef.LayerPerspec​tiveMutable.java. This
> class would function just like
> a LayerPerspective except that it would notify its underlying
> MutableGraphModel of additions and deletions.
> Currently, a layer only knows that it has a GraphModel, but no
> notification of addition is sent to the underlying GraphModel.
>
> Comments?
>
> Eugenio
>
> Code included for inspection:
>
> /**
> * LayerPerspectiveMutable.java
> *
> * A LayerPerspective with an underlying MutableGraphModel.
> * As figures are added and removed the underlying MutableGraphModel is
> * updated.
> *
> * @author Eugenio Alvarez
> * Data Access Technologies
> *
> */
>
> package uci.gef;
>
> import java.util.*;
> import java.awt.*;
> import uci.graph.*;
>
>
> public class LayerPerspectiveMutable extends LayerPerspective {
>
> ////////////////////​////////////////////​////////////////////​////
> // instance variables
>
> /** The underlying connected graph to be visualized. */
> MutableGraphModel _mgm;
>
> ////////////////////​////////////////////​////////////////////​////
> // constructors
>
> public LayerPerspectiveMutable(String name, MutableGraphModel mgm) {
> super(name,(GraphModel)mgm);
> _mgm = mgm;
> }
>
>
> ////////////////////​////////////////////​////////////////////​////
> // accessors
>
> public GraphModel getGraphModel() {
> return(GraphModel)ge​tMutableGraphModel()​;
> }
> public void setGraphModel(GraphModel gm) {
> setMutableGraphModel​((MutableGraphModel)​gm);
> }
>
> public MutableGraphModel getMutableGraphModel() { return _mgm; }
> public void setMutableGraphModel​(MutableGraphModel mgm) {
> super.setGraphModel(​(GraphModel)mgm);
> _mgm = mgm;
> }
>
> ////////////////////​////////////////////​////////////////////​////
> // Layer API
>
> public void add(Fig f) {
> Object owner = f.getOwner();
> // prevents duplicate nodes.
> // To allow multiple views in one diagram, remove the following two
> lines.
> if (owner != null && f instanceof FigNode && _mgm.containsNode(owner))
> return;
> super.add(f);
> if ( owner != null && _mgm.canAddNode(owner))
> _mgm.addNode(owner);
> // FigEdges are added by the underlying MutableGraphModel.
> }
>
> public void remove(Fig f) {
> super.remove(f);
> Object owner = f.getOwner();
> if (owner != null) {
> if (f instanceof FigEdge && _mgm.containsEdge(owner))
> _mgm.removeEdge(owner);
> else if (_mgm.containsNode(owner))
> _mgm.removeNode(owner);
> }
> }
>
> } /* end class LayerPerspectiveMutable */
>
>
> -----Original Message-----
> From: Toby Baier [SMTP:Toby dot Baier at gmx dot net]
> Sent: Saturday, June 10, 2000 4:22 PM
> To: Eugenio Alvarez
> Subject: Re: AddToDiagram fix
>
> Eugenio Alvarez schrieb:
> >
> > Hi Toby,
> >
> > I have isolated the problem with the cut/paste to diagrams. I want to
> talk
> > to you about what I am going to be adding to argo's source. A new file
> > called uci.gef.LayerPerspec​tiveMutable.java
> > This is a layer for Figures to reside in. It is different from
> > LayerPerspective in that it knows that its model is a MutableGraphModel.
> > LayerPerspectiveMutable notifies its MutableGraphModel of
> > additions and deletions. This type of layer should be used with all the
> UML
> > diagrams. The previous code that I added to
> > uci.uml.visual.FigNo​deModelElement and
> uci.uml.visual.FigEd​geModelElement
> > are not needed anymore because of this new class. I have also added a
> check
> > to not let multiple views of the same element reside in the same
> diagram.
> > Currently, you can cut and paste the same element in the same diagram. I
> > think this is confusing to a new user because they think that it is a
> > complete new copy of the element.
> >
> > Just wanted to let you know about the changes before committing to CVS.
> > Also, I would like to send a message to the mailing list to let them
> know
> > about the new class.
>
> Hi Eugenio,
> thanks for asking me before doing that change. In general, you can just
> put into CVS whatever fixes bugs, like the MM fixes about Namespaces and
> stuff. But this one is a change in architecture, and that's a larger
> issue. Moreover, it changes GEF, not Argo, so the GEF people (mostly
> Edwin Park) should be involved. I myself am not so familiar with GEF at
> all, so all I can say about this one is that it sounds good, and I have
> no objections. But me not knowing very much about that is another reason
> to ask the list, Edwin, and maybe Frank Wienberg, he's quite firm with
> GEF as well (wienberg@informatik​.uni-hamburg.de).
>
> The copy[Visual|Model] problem is not new and has been discussed before.
> There should be a mechanism to have multiple views on one Element in one
> diagram, so that larger Diagrams don't need to have lines drawn over the
> whole page, but this should be made very clear somehow, maybe by writing
> the name in grey or something. Then there could be a mechanism of
> copying the class so you have a new one with the same attributes and
> stuff, but as a new ModelElement, say copying a class "Person" to
> "NewPerson". We can discuss this on the list as well, but I think it
> should be scheduled for 0.9, we really should have 0.8 soon.
>
> Regards,
> Toby
>
> --
> Tobias Baier - Brahmsallee 31 - 20144 Hamburg - Germany
> Tel: +49 X-Mozilla-Status: 0009 Fax: +49 40 4291 0502
> mailto:Toby dot Baier at gmx dot net - ICQ#: 12164930
> http://www.stud.uni-​hamburg.de/users/tob​y (last updated 26.7.98)
>

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

FW: A small structural change. Comments requested. Eugenio Alvarez <eugenio-a at dataaccess dot com> Eugenio Alvarez <eugenio-a at dataaccess dot com> 2000-06-16 06:04:14 PDT
Messages per page: