Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding a compartment to my node(According to GMF_Tutorial_Part_2)
Adding a compartment to my node [message #671213] Tue, 17 May 2011 07:11 Go to next message
nicolas h is currently offline nicolas hFriend
Messages: 60
Registered: February 2011
Location: Grenoble, France
Member
Hi all,
I'm following this tutorial in order to add SubSystems into my node System.

My ecore model is actually :

RootElement <>---->[1] System <>---->[*] SubSystem

I managed to add a compartment to my System and add SubSystems into, but I can't drag and drop my new SubSystem into. I can't resize it either. If I add a second SubSystem, it will be placed below the first one. Can't move neither.

How can I modify this behaviour please ?

My GMFgraph :

<?xml version="1.0" encoding="UTF-8"?>
<gmfgraph:Canvas xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="systemModel">
  <figures
      name="Default">
    <descriptors
        name="SystemFigure">
      <actualFigure
          xsi:type="gmfgraph:Rectangle"
          name="SystemFigure">
        <foregroundColor
            xsi:type="gmfgraph:RGBColor"
            red="220"
            green="220"
            blue="250"/>
        <children
            xsi:type="gmfgraph:Label"
            name="SystemNameFigure"
            text="&lt;...>"/>
      </actualFigure>
      <accessors
          figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
    </descriptors>
    <descriptors
        name="SubSystemFigure">
      <actualFigure
          xsi:type="gmfgraph:Rectangle"
          name="SubSystemFigure"
          outline="false">
        <layout
            xsi:type="gmfgraph:FlowLayout"
            vertical="true"
            matchMinorSize="true"
            forceSingleLine="true"
            minorAlignment="CENTER"
            majorSpacing="0"
            minorSpacing="0"/>
        <backgroundColor
            xsi:type="gmfgraph:RGBColor"
            red="250"
            green="250"
            blue="190"/>
      </actualFigure>
    </descriptors>
  </figures>
  <nodes
      name="System"
      figure="SystemFigure"/>
  <nodes
      name="SubSystem (SubSystemFigure)"
      figure="SubSystemFigure"/>
  <compartments
      name="SubSystemCompartment"
      figure="SystemFigure"
      collapsible="true"/>
  <labels
      name="SystemName"
      figure="SystemFigure"
      accessor="//@figures.0/@descriptors.0/@accessors.0"/>
</gmfgraph:Canvas>



Best regards,

--
Nicolas

[Updated on: Tue, 17 May 2011 07:12]

Report message to a moderator

Re: Adding a compartment to my node [message #671219 is a reply to message #671213] Tue, 17 May 2011 07:25 Go to previous messageGo to next message
Rahma  is currently offline Rahma Friend
Messages: 7
Registered: February 2011
Junior Member
Hi,

In the class xxxcompartementEditPart you have:
/**
* @generated
*/
public class xxxxxcompartementEditPart extends ListCompartmentEditPart {

you should modifiy to:

/**
* @generated NOT
*/
public class xxxxxcompartementEditPart extends ShapeCompartmentEditPart {


--
Rahma
[SOLVED] Adding a compartment to my node [message #671235 is a reply to message #671219] Tue, 17 May 2011 08:41 Go to previous message
nicolas h is currently offline nicolas hFriend
Messages: 60
Registered: February 2011
Location: Grenoble, France
Member
That works very well, thank you very much Wink

--
Nicolas
Previous Topic:GMF - Drag Drop on Connection
Next Topic:Open Editor from DB
Goto Forum:
  


Current Time: Thu Apr 25 06:43:10 GMT 2024

Powered by FUDForum. Page generated in 0.03334 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top