Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uml class shape aligned the rectangles #446

Closed
seandenigris opened this issue Aug 3, 2015 · 9 comments
Closed

uml class shape aligned the rectangles #446

seandenigris opened this issue Aug 3, 2015 · 9 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 446

Using this script:

| builder |
builder := MOFormsBuilder new.
builder column; fill.
builder row; fill; row; fill; row; fill.
builder x: 1 y: 1 add: ((MORectangleShape new withText) text: [ :cls | cls name ];
fontSize: 10; textPadding: 2; textAlignment: #center).
builder x: 1 y: 2 add: (MORectangleShape new text: [ :cls |
    cls attributes asArray inject: '' into: [ :sum :el | sum , el name , String cr ] ];
fontSize: 6; textVerticalPadding: 2; textAlignment: #left).
builder x: 1 y: 3 add: (MORectangleShape new text: [ :cls |
    cls methods asArray inject: '' into: [ :sum :el | sum , el name , String cr ] ]; fontSize:
6; textVerticalPadding: 2; textAlignment: #left).
^ view shape: builder shape

that basically visualized not only the methods but also the attributes of the class
i have the following results:

on a single class the result is perfect (See attached file singleClass.png). If there
are more than one classes instead is possible to see that actually the rectangles composing
a UML class are aligned (See attached file MooreThanOne.png)

I'm working on the build 39 of Moose for cog using the vm Squeak5.8b4.

Reported by fabrizio.perin on 2010-09-01 14:33:13


- _Attachment: singleClass.png
![singleClass.png](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-446/comment-0/singleClass.png)_ - _Attachment: moreThanOne.png
![moreThanOne.png](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-446/comment-0/moreThanOne.png)_
@seandenigris
Copy link
Contributor Author

| builder |
builder := MOFormsBuilder new.
builder column; fill.
builder row; fill; row; fill; row; fill.
builder x: 1 y: 1 add: (MORectangleShape new text: [ :x | (1 to: x) inject: '' into:
[ :sum :el | sum , el printString , String cr ] ]; fontSize: 6; textVerticalPadding:
2; textAlignment: #left).
builder x: 1 y: 2 add: (MORectangleShape new text: [ :x | (1 to: x) inject: '' into:
[ :sum :el | sum , el printString , String cr ] ]; fontSize: 6; textVerticalPadding:
2; textAlignment: #left).
builder x: 1 y: 3 add: (MORectangleShape new text: [ :x | (1 to: x) inject: '' into:
[ :sum :el | sum , el printString , String cr ] ]; fontSize: 6; textVerticalPadding:
2; textAlignment: #left).
view shape: builder shape.
view nodes: (1 to: 5)


You can get a different bug by executing:


view nodes: (1 to: 5) reversed

Reported by tudor.girba on 2010-09-01 14:45:32

  • Labels added: Component-Mondrian

@seandenigris
Copy link
Contributor Author

Easier script, which also has the advantage to not depend on text font size (tests are
hardly portable):


    | view builder umlShape form form2 canvas2 shape1 shape2 nodes |
    view := MOViewRenderer new.
    builder := MOFormsBuilder new.
    builder column; fill.
    builder row; fill; row; fill.
    builder x: 1 y: 1 add: 
        (shape1 := MORectangleShape new width: 30; height: #first; fillColor: Color green).
    builder x: 1 y: 2 add: 
        (shape2 := MORectangleShape new width: 60; height: #second; fillColor: Color blue).
    umlShape := builder shape.

    view shape: umlShape.
    nodes := view nodes: {{30 . 80} . {15 . 90} . {40 . 100}}.

Reported by alexandre.bergel on 2010-09-01 18:22:14

@seandenigris
Copy link
Contributor Author

This has been fixed some times ago.

Reported by alexandre.bergel on 2010-09-13 13:12:31

  • Status changed: Fixed

@seandenigris
Copy link
Contributor Author

A form of the problem is still around. This is an important issue that prevents us from
actually using the FormsBuilder.

Here is an example with a ChildrenShape inside. The green shape on top should have
a constant minimum size. Instead its height increases together with the height of the
children shape below:

| builder |
builder := MOFormsBuilder new.
builder column; fill.
builder row; fill; row; fill.
builder x: 1 y: 1 add: 
    (MORectangleShape new width: 30; fillColor: Color green).
builder x: 1 y: 2 add: (MORectangleShape new).
builder x: 1 y: 2 add: (MOChildrenShape new).
view shape:  builder shape.
view nodes: (1 to: 5) forEach: [:each |
    view nodes: (1 to: each).
    view verticalLineLayout ]

Reported by tudor.girba on 2011-03-06 21:05:25

  • Status changed: Accepted
  • Labels added: Priority-High
  • Labels removed: Priority-Medium

@seandenigris
Copy link
Contributor Author

I tested some more and when we have only rectangle shapes, it seems to work just fine.
So, the problem could be related to the ChildrenShape:

| builder |
builder := MOFormsBuilder new.
builder column; fill.
builder row; fill; row; fill.
builder x: 1 y: 1 add: 
    (MORectangleShape new width: 30; fillColor: Color green).
builder x: 1 y: 2 add: (MORectangleShape new height: [:x | x * 100] ).
view shape:  builder shape.
view nodes: (1 to: 5) 

Reported by tudor.girba on 2011-03-06 21:06:10

@seandenigris
Copy link
Contributor Author

Yeah, this is an important issue. I will work on it this week.

Reported by alexandre.bergel on 2011-03-07 11:37:12

@seandenigris
Copy link
Contributor Author

Hi Guys,

This issue is still on my todo list. Unfortunately, I have been "seriously busy". And
I will remain busy until the beginning of April. 
Deadline are coming fast. I promise to work on it in a couple of weeks. 

I am sincerely sorry to not be able to do more. Really.

Cheers,
Alexandre

Reported by alexandre.bergel on 2011-03-17 13:37:04

@seandenigris
Copy link
Contributor Author

Don't take it so seriously :). Have fun and good luck with the deadlines.

Reported by tudor.girba on 2011-03-17 13:58:10

@seandenigris
Copy link
Contributor Author

I fixed this a couple of days ago

Reported by alexandre.bergel on 2011-04-11 18:38:03

  • Status changed: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant