Substitute for MouseDragged in Roassal 2?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Substitute for MouseDragged in Roassal 2?

Gustavo Santos
Hello everyone,

I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package

In Roassal I could do this:

| view el |
view := ROView new.
el := ROElement sprite.
view add: el.
el
on: ROMouseDragged
do: [ :event | Transcript show: 'ok'; cr ].
view open.

But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?

Other question will come after that, but let's do baby steps.

Cheers,

--
Gustavo Santos
Université de Lille-1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

abergel
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

Leo Perard
I think what Gustavo wanted to show is in Roassal1 the Transcript is shown only once whereas with Roassal2 it is shown at every step.


On Wed, Jun 18, 2014 at 5:09 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Cheers,
Leo Perard
University of Lille 1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

Gustavo Santos
In reply to this post by abergel
Yes, I was trying that (the second example). But, as I said, I only need the event to trigger when I leave the click, which ROMouseDragged did before. That's why Roassal have ROMouseDragging and ROMOuseDragged.

On Wed, Jun 18, 2014 at 5:09 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

abergel
Ah ok. Currently we cannot do that.

Is this urgent?
What are you trying to achieve? Improving the drag and drop support? 

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



On Jun 18, 2014, at 11:21 AM, Gustavo Santos <[hidden email]> wrote:

Yes, I was trying that (the second example). But, as I said, I only need the event to trigger when I leave the click, which ROMouseDragged did before. That's why Roassal have ROMouseDragging and ROMOuseDragged.

On Wed, Jun 18, 2014 at 5:09 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

Gustavo Santos
This visualization is on top of a Moose model. We want to add actions for refactoring the underlying model though the visualization, like moving classes and methods.

An example is shown below. Each blue square is a class and I can expand by clicking and see its methods.
Inline image 1

For now we are using context menus to the elements, copying elements to a "clipboard" etc.

But it would be cooler if we could drag and drop things :)
What I thought was adding an action to the element to call the container it is been moved to.

Thanks for the response and I'll wait for news on this topic.

On Wed, Jun 18, 2014 at 5:55 PM, Alexandre Bergel <[hidden email]> wrote:
Ah ok. Currently we cannot do that.

Is this urgent?
What are you trying to achieve? Improving the drag and drop support? 

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



On Jun 18, 2014, at 11:21 AM, Gustavo Santos <[hidden email]> wrote:

Yes, I was trying that (the second example). But, as I said, I only need the event to trigger when I leave the click, which ROMouseDragged did before. That's why Roassal have ROMouseDragging and ROMOuseDragged.

On Wed, Jun 18, 2014 at 5:09 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substitute for MouseDragged in Roassal 2?

abergel
Drag and drop is indeed important. As Stef said once, Roassal is becoming a new kind of Morphic (with good software engineering practice hopefully :-)

I think Drag and dropping is not a big problem to implement, but I cannot do it right now. Give me a couple of weeks...

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



On Jun 18, 2014, at 1:25 PM, Gustavo Santos <[hidden email]> wrote:

This visualization is on top of a Moose model. We want to add actions for refactoring the underlying model though the visualization, like moving classes and methods.

An example is shown below. Each blue square is a class and I can expand by clicking and see its methods.
<Screenshot 2014-06-12 02.13.47.png>

For now we are using context menus to the elements, copying elements to a "clipboard" etc.

But it would be cooler if we could drag and drop things :)
What I thought was adding an action to the element to call the container it is been moved to.

Thanks for the response and I'll wait for news on this topic.

On Wed, Jun 18, 2014 at 5:55 PM, Alexandre Bergel <[hidden email]> wrote:
Ah ok. Currently we cannot do that.

Is this urgent?
What are you trying to achieve? Improving the drag and drop support? 

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



On Jun 18, 2014, at 11:21 AM, Gustavo Santos <[hidden email]> wrote:

Yes, I was trying that (the second example). But, as I said, I only need the event to trigger when I leave the click, which ROMouseDragged did before. That's why Roassal have ROMouseDragging and ROMOuseDragged.

On Wed, Jun 18, 2014 at 5:09 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Gustavo,

Here is the similar version in Roassal2:
-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

However, you cannot move the square. Since it is not draggable. So, you can have

-=-=-=-=-=-=-=-=
| v el |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.
el when: TRMouseDragging do: [ :evt | Transcript show: 'ok'; cr ].
v open
-=-=-=-=-=-=-=-=

Your example a bit more fancy:
-=-=-=-=-=-=-=-=
| v el lbl |
v := RTView new.
el := (RTBox new size: 20) element.
v add: el.
el @ RTDraggable.

lbl := RTLabel elementOn: 'Move the box!'.
v add: lbl.
lbl translateBy: 0 @ -50.

el when: TRMouseDragging do: [ :evt | lbl trachelShape text: evt positionFromCamera asString. v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=

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



On Jun 18, 2014, at 9:32 AM, Gustavo Santos <[hidden email]> wrote:

> Hello everyone,
>
> I'm working on a small visualisation of packages and classes and basically I want to be able to drag and drop one class to other package
>
> In Roassal I could do this:
>
> | view el |
> view := ROView new.
> el := ROElement sprite.
> view add: el.
> el
> on: ROMouseDragged
> do: [ :event | Transcript show: 'ok'; cr ].
> view open.
>
> But in Roassal 2 I only have TRMouseDragging (equivalent to ROMouseDragging in R1), that executes the block during the whole dragging operation. What's the alternative to MouseDragged in Roassal 2?
>
> Other question will come after that, but let's do baby steps.
>
> Cheers,
>
> --
> Gustavo Santos
> Université de Lille-1
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


--
Gustavo Santos
Université de Lille-1
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev