Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365536

Summary: Using BoxRelativeAnchor with relativeWidth = 1 display ellipsis in related Text
Product: [Modeling] Graphiti Reporter: Patrick Talbot <ptalbot>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.gorning, michael.wenz
Version: 0.8.0Flags: matthias.gorning: juno+
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
Whiteboard: Juno M6 Theme_bugs
Attachments:
Description Flags
AddFeature snippet
none
Capture of the resulting figure
none
PropertyUtil used in the snippet
none
StyleUtil used by the snippet
none
Patch for tutorial to reproduce none

Description Patrick Talbot CLA 2011-12-04 20:06:11 EST
Build Identifier: Graphiti 0.8.1

As explained on the forum (http://www.eclipse.org/forums/index.php/t/263097/)
I'm having trouble with BoxRelativeAnchor.

As soon as I add a BoxRelativeAnchor with setRelativeWidth(1.0) to my shape, the related text show ellipsis where there is plenty of room to display full text.

See the attached snippet for the code I use.

Here's a dump of a figure that is not displaying correctly:

Pictogram Model Tree()
*PE* ContainerShapeImpl (active) (visible)
  RectangleImpl (100, 50, 100, 80)
  *PE* ShapeImpl (inactive) (visible)
    PolylineImpl (0, 0, 101, 1)
  *PE* ShapeImpl (inactive) (visible)
    TextImpl (0, 0, 100, 16)
  *PE* ContainerShapeImpl (active) (visible)
    TextImpl (3, 16, 94, 16)
    *PE* ChopboxAnchorImpl (inactive) (invisible)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (-2, 0, 1, 1)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (2, 0, 1, 1)
  *PE* ContainerShapeImpl (active) (visible)
    TextImpl (3, 32, 94, 16)
    *PE* ChopboxAnchorImpl (inactive) (invisible)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (-2, 0, 1, 1)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (2, 0, 1, 1)
  *PE* ContainerShapeImpl (active) (visible)
    TextImpl (3, 48, 94, 16)
    *PE* ChopboxAnchorImpl (inactive) (invisible)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (-2, 0, 1, 1)
    *PE* BoxRelativeAnchorImpl (active) (invisible)
      RectangleImpl (2, 0, 1, 1)
  *PE* ChopboxAnchorImpl (inactive) (invisible)

Edit Part Tree()
ContainerShapeEditPart (RectangleImpl)
  ContainerShapeEditPart (TextImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)
  ContainerShapeEditPart (TextImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)
  ContainerShapeEditPart (TextImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)
    BoxRelativeAnchorEditPart (RectangleImpl)

Figure Tree
GFRectangleFigure (Rectangle(100, 50, 100, 80))
  GFPolyline (Rectangle(100, 66, 101, 1))
  GFText (text: solution_names) (Rectangle(100, 50, 100, 16))
  GFText (text: solution_id) (Rectangle(103, 66, 94, 16))
    GFRectangleFigure (NOT visible) (Rectangle(101, 74, 1, 1))
    GFRectangleFigure (NOT visible) (Rectangle(199, 74, 1, 1))
  GFText (text: solution_name) (Rectangle(103, 82, 94, 16))
    GFRectangleFigure (NOT visible) (Rectangle(101, 90, 1, 1))
    GFRectangleFigure (NOT visible) (Rectangle(199, 90, 1, 1))
  GFText (text: display_name) (Rectangle(103, 98, 94, 16))
    GFRectangleFigure (NOT visible) (Rectangle(101, 106, 1, 1))
    GFRectangleFigure (NOT visible) (Rectangle(199, 106, 1, 1))

See the result in the capture attached

Reproducible: Always
Comment 1 Patrick Talbot CLA 2011-12-04 20:07:07 EST
Created attachment 207893 [details]
AddFeature snippet
Comment 2 Patrick Talbot CLA 2011-12-04 20:08:39 EST
Created attachment 207894 [details]
Capture of the resulting figure
Comment 3 Michael Wenz CLA 2011-12-05 07:20:55 EST
Could you also append the coding for your PropertyUtil and StyleUtil classes?
Comment 4 Patrick Talbot CLA 2011-12-05 10:29:25 EST
Created attachment 207925 [details]
PropertyUtil used in the snippet
Comment 5 Patrick Talbot CLA 2011-12-05 10:31:45 EST
Created attachment 207926 [details]
StyleUtil used by the snippet
Comment 6 Patrick Talbot CLA 2011-12-05 10:32:24 EST
I've added PropertyUtil and StyleUtil. There's not much to it though...
Thanks for having a look.
Comment 7 Michael Wenz CLA 2011-12-30 05:08:51 EST
Reproducable in tutorial after applying the following patch
Comment 8 Michael Wenz CLA 2011-12-30 05:11:05 EST
Created attachment 208868 [details]
Patch for tutorial to reproduce
Comment 9 Michael Wenz CLA 2011-12-30 05:11:47 EST
Patrick,
this is a really strange issue, we will have a closer look.
Comment 10 Patrick Talbot CLA 2011-12-30 05:43:41 EST
Yes, it is strange.
Actually in the meantime, I've found a workaround (still doesn't explain why it happened first, though)

In the AddFeature, changing the line:
gaService.setLocationAndSize(rect, 0, 0, 1, 1);
to
gaService.setLocationAndSize(rect, -1, 0, 1, 1);
does the trick for me, maybe this will give you a clue?
Comment 11 Matthias Gorning CLA 2012-02-10 09:09:12 EST
Fixed.

commit 29abf44418dc6f642611b46ebfb483b93d622122
Author: mgorning <matthias.gorning@sap.com> 2012-02-10 15:04:17
Committer: mgorning <matthias.gorning@sap.com> 2012-02-10 15:04:17
Parent: 866e1b1802569ac4b289e9d950a8a8db60c4481b (Bug 370457: Removed license from feature properties since it's imported from the central license feature)
Branches: origin/master, master
Comment 12 Michael Wenz CLA 2012-04-11 10:54:47 EDT
Bookkeeping: Set target release
Comment 13 Michael Wenz CLA 2012-06-29 04:20:56 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)