Menu

How to share element among different diagram?

Help
Icy Blue
2008-04-11
2013-03-22
  • Icy Blue

    Icy Blue - 2008-04-11

        In my modeler, I want to define a serials of products and components, and a serials of diagrams. Diagrams represent the relations between products and components. The key points are:

    1) When an element(product or component) is created in diagram with palette, the diagram holds the "entity" of the element. At the same time, a node reprecents the new element should also be created in package explorer.

    2) The element(product or component) in package explorer (, which is defined in an existing digram) can also be draged and droped onto a new diagram. In this case, the diagram holds the "reference" of the element.

    3) When deleting an element from package explorer, or from the diagram which the element is created into, the references of this element should also be deleted in other diagrams within the same project. So should the connections link to these references.

    4) When deleting a reference from diagrams, the entity should not be deleted.

        Does anybody knows how to achieve these goals with GEMS, or with other modelering frameworks of eclipse platform.

        Thanks a lot!

     
    • Jules White

      Jules White - 2008-04-14

      There are two ways that this could work:

      1. If all the elements are contained in the same diagram

         In this case, you should use "subtyping" to create the
         elements that are on the palette. In one view, you have only
         the component types that you are defining. Each component type
         that you want to be able to create instances of, you should
         right-click->subtype->create subtype. This will get 98% of what
         you want but just within one model.

      2. If one model needs to store the types and other models the instances

         In this scenario, you are going to need to write your own infrastructure
         to manage the deletes and updates to the palette. To add elements to
         the palette, you will need to extend the org.gems.designer.dsml.palettebuilder
         extension point and create a class that implements "org.gems.designer.PaletteBuilder".
         This class will dynamically update the palette. To manage deletions across several
         models, you will need to add an event listener using the triggers file that
         listens for deletions and then updates all affected models.

       
      • Icy Blue

        Icy Blue - 2008-04-15

        Thank you for your advice. But I think we have misunderstandings on "type" and "instance".

        First of all, all the diagrams are target at the same model (product and component model). And different diagrams may contain different instance of products and components.

        For "Type", the instance creation tool, is placed in pattlet. And for my scenario, there should always be two types in the pattlet, "Product" and "Component".

        For "Instance", there are two ways to define:

        [1] Use pattlet to create a new instance of a certain type. This step should not only create a new icon in the diagram, but also create a tree node in the package explorer, which represents this new instance.

        [2] Drag and Drop a certain instance (tree node) from the package exploer to the diagram. This step will create a new "instance reference" in the diagram. Pay attention, this diagram might not be the same as the one this instance is create (with pattlet), refer to [1].

         
    • Icy Blue

      Icy Blue - 2008-04-15

      Thank you for your advice. But I think we have misunderstandings on "type" and "instance".

      First of all, all the diagrams are target at the same model (product and component model). And different diagrams may contain different instance of products and components.

      For "Type", the instance creation tool, is placed in pattlet. And for my scenario, there should always be two types in the pattlet, "Product" and "Component".

      For "Instance", there are two ways to define:

      [1] Use pattlet to create a new instance of a certain type. This step should not only create a new icon in the diagram, but also create a tree node in the package explorer, which represents this new instance.

      [2] Drag and Drop a certain instance (tree node) from the package exploer to the diagram. This step will create a new "instance reference" in the diagram. Pay attention, this diagram might not be the same as the one this instance is create (with pattlet), refer to [1].

       
      • Jules White

        Jules White - 2008-04-16

        Ok, I think I understand the requirements now.

        1. You will need to implement the infrastructure to provide the tree nodes for the package explorer...GEMS doesn't currently support this...but this would be a good feature (would you mind adding it as a feature request in bugzilla? We can add it to future releases)

        2. This part will require implementing custom DnD infrastructure...you should look at org.gems.designer.dnd.ModelTemplateTransferDropTargetListener on how to add the drop side of things

        This actually would be a great feature to have...if you can add this to bugzilla, we can add it to the feature queue. My guess is that this will take us a while to implement.

        Thanks,

        Jules

         
        • Icy Blue

          Icy Blue - 2008-04-21

          It seems that GEMS can't meet this simple requirement for now. So we decided to use GME (www.isis.vanderbilt.edu/Projects/gme/). With GME, we can build this simple modleler in no time.

          I will also pay attention to your project and submit some feature requests later.

          BTW, you should check GME out. It is a mature platform for building modelers. I hope GEMS will have similar functions to GME, so that user can easily migrate from GME when GEMS is ready.

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.