Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Bordered Nodes looks like a List of SubNodes
Bordered Nodes looks like a List of SubNodes [message #1773138] Fri, 22 September 2017 07:18 Go to next message
M V is currently offline M VFriend
Messages: 31
Registered: July 2017
Member
Hallo,

My goal is that I have nodes that look like in this:

index.php/fa/30796/0/

Functionally, I managed to do this by turning the children elements into bordered nodes. But then i have not the look i want. I'd like to have them neatly arranged in a list. This looks like I get it when I make a container element and insert the children as SubNodes there. But then it is no longer possible to combine this with Edges.

My first approach to solving this problem was with an IStyleConfigrationProvider. But if I understood correctly, I can only change the existing style of the element there, but I can't present it in the way I would like to.

My next approach would now be to use a GMF extension points. That seems to me to be very complicated and I wanted to ask if this is the right thing to do before I put energy into it?

Maybe there is a simple build in option that I missed.

Thanks for helping
  • Attachment: target.png
    (Size: 13.52KB, Downloaded 513 times)

[Updated on: Fri, 22 September 2017 07:34]

Report message to a moderator

Re: Bordered Nodes looks like a List of SubNodes [message #1773148 is a reply to message #1773138] Fri, 22 September 2017 08:41 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

There is a feature request for what you seek: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455056

I don't see a solution for your problem.

Regards,

Pierre


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Bordered Nodes looks like a List of SubNodes [message #1773233 is a reply to message #1773148] Mon, 25 September 2017 08:13 Go to previous messageGo to next message
M V is currently offline M VFriend
Messages: 31
Registered: July 2017
Member
Thanks for your answer, but this is not a good news.

Pierre Guilet wrote on Fri, 22 September 2017 08:41
Hi,

There is a feature request for what you seek: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455056

I don't see a solution for your problem.


My new approach is it to make it look like this from the documentation:

 https://www.eclipse.org/sirius/doc/specifier/diagrams/images/styles/Graphical_Vocabulary_Bordered_Node.png

I use an Image Node with my Icon and define the Label Position as border. To move the Label on the west border of the node I make my own StyleConfigurationProvider.

But if I Override the method the Label of the first Element is showing on the north boarder and all following are on the east.

    @Override
    public IBorderItemLocator getNameBorderItemLocator(DNode node, IFigure mainFigure) {
      final BorderItemLocator locator = new DBorderItemLocator(mainFigure, PositionConstants.WEST);
      locator.setBorderItemOffset(IBorderItemOffsets.DEFAULT_OFFSET);
      locator.setCurrentSideOfParent(PositionConstants.WEST);
      return locator;
    }



As Workaround I make my own derivation of DBorderItemLocator and override the relocate method so it works.

  @Override
  public void relocate(IFigure borderItem) {
    super.relocate(borderItem);
    

    setPreferredSideOfParent(PositionConstants.WEST);
  }


Maybe I make something wrong or it is a bug?

Thanks again for any help!
Re: Bordered Nodes looks like a List of SubNodes [message #1773244 is a reply to message #1773233] Mon, 25 September 2017 10:26 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
HI,
This seems normal to me that you have to customize the locator for label positioning.
The DBorderLocator takes in consideration the Sirius authorized size option and not the original preferred size.

Tried extending default BorderItemLocator to see if it works without overriding the relocate method.

Otherwise if your solution works, not better option.

Regards,

Pierre


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Disable marquee select tool for specific node
Next Topic:How to control the elements in a fragment
Goto Forum:
  


Current Time: Sat Apr 04 16:35:18 GMT 2020

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

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

Back to the top