Hi,

I saw this before, but we need a bit more because of two things:
1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
2. ideally, resizing the morph should resize the picture.

Doru




On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Within a simple roassal visualization

        | view |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].

        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        view open.
        view canvas camera focusOnCenterScaled: 500.


On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:

> Hi Doru,
>
> Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | b |
> b := RTGraphBuilder new.
>
> b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>
> b edges
>       connectTo: #subclasses;
>       verticalAttachPoint;
>       useInLayout.
>
> b layout tree.
>
> b global
>       minSize: 5;
>       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>
> b addAll: RTObject withAllSubclasses.
> b build.
>
> (RTGroup withAll: b view elements) translateTo: 0 @ 0.
> b view canvas camera focusOnCenterScaled: 500.
> b view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The visualization fits into a 500 x 500 morph.
> Here is the screenshot:
>
> <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>
> If you do not have the last two lines, then you end up with something like:
>
> <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>
>
> https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>
> Cheers,
> Alexandre
>
> On Apr 18, 2014, at 5:30 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
>
>> Hi,
>>
>> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>>
>> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>>
>> Doru
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev@iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
www.tudorgirba.com

"Every thing has its own flow"