Issue 894 in moose-technology: Roassal revised ROSelection and example

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

Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 894 by [hidden email]: Roassal revised ROSelection and  
example
http://code.google.com/p/moose-technology/issues/detail?id=894

Initially I contributed ROSelection as part of the rubberbanding feature.  
The attached changeset generalizes it a bit and provides the folllowing  
example of its use.

-------------
activeSelection := ROSelection new
        onInclusion: [ :element | ROHighlightElement on: element color: Color red  
];
        onExclusion: [ :element | ROUnhighlightElement on: element ].
statusBar := (ROElement on: activeSelection) + (ROLabel text: [ :el | el  
model asString ]) + ROBox white.
view stack add: statusBar.
statusBar translateTo: 0 @ 480.

view shape label.
view interaction on: ROMouseLeftClick do:
[   :ann |
     activeSelection clear.
     activeSelection add: ann element.
].
view nodes: #(1 2 3 4 5).
view gridLayout.
---------------

There are two things I need help with:
1. Deselecting all elements when clicking on the background.**
2. Multiple selection, which if I knew the right way to work with the  
announcement events, would conceptually be as simple as the following  
modification...

[   :ann |
     ann isShiftClicked ifFalse: [ activeSelection clear ].
     activeSelection add: ann element.
].

**may also relate to Issue 884 comment #9 .


Attachments:
        ROSelectionAndExample.1.cs  1.4 KB

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology

Comment #1 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

(No comment was entered for this change.)

Attachments:
        ROSelectionAndExample.2.cs  1.5 KB

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology

Comment #2 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

Fixed minor glitch.  Last update ... :) really!

Attachments:
        ROSelectionAndExample.3.cs  1.5 KB

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
Updates:
        Labels: Component-Roassal

Comment #3 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

Ben, there is some 'as yet unclassified' category. Can you provide some  
proper category. Tests are also very welcome

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

Ben Coman



[hidden email] wrote:
> Updates:
>     Labels: Component-Roassal
>
> Comment #3 on issue 894 by [hidden email]: Roassal revised
> ROSelection and example
> http://code.google.com/p/moose-technology/issues/detail?id=894
>
> Ben, there is some 'as yet unclassified' category. Can you provide
> some proper category.
I have not been confident in my familiarity with choosing categories -
so I ignored it :(
Though I suppose giving it a go and being corrected is the best way to
learn.
ROSelection methods have been classified in attached fileout.  Please
advise if any of them seem out of order.

> Tests are also very welcome
>
I'd love to be a better citizen and provide some tests to avoid looking
like a hack, but right now I am at the pointy end of writing my
dissertation.  At least after that I do want to revisit all my
contributions and tidy them up with tests and documentation. I will get
there.

'From Pharo1.4 of 18 April 2012 [Latest update: #14457] on 12 December 2012 at 8:54:56 pm'!
ROInteraction subclass: #ROSelection
        instanceVariableNames: 'filter inclusionAction exclusionAction selectedElements'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Roassal-Interaction'!

!ROSelection methodsFor: 'comparing' stamp: 'BenComan 10/15/2012 22:23'!
contains: aROElement
        selectedElements do: [ :element | (element = aROElement) ifTrue: [ ^true] ].
        ^false.! !


!ROSelection methodsFor: 'events-registering' stamp: 'BenComan 10/15/2012 22:05'!
for: aBlock
        filter := aBlock.
        ! !

!ROSelection methodsFor: 'events-registering' stamp: 'BenComan 10/15/2012 22:09'!
onExclusion: aBlock
        exclusionAction := aBlock.
        ! !

!ROSelection methodsFor: 'events-registering' stamp: 'BenComan 10/15/2012 22:09'!
onInclusion: aBlock
        inclusionAction := aBlock.
        ! !


!ROSelection methodsFor: 'initialize-release' stamp: 'BenComan 10/15/2012 22:12'!
initialize
        super initialize.
        filter := [ :source :target | false ].
        selectedElements := OrderedCollection new.
! !


!ROSelection methodsFor: 'printing' stamp: 'BenComan 12/9/2012 11:38'!
printOn: aStream
        super printOn: aStream.
        aStream nextPutAll: '[' .
        selectedElements do:
        [ :el |
                aStream nextPutAll: el model asString.
                aStream nextPutAll: ' '.
        ].
        aStream nextPutAll: ']' .
        ! !


!ROSelection methodsFor: 'events-triggering' stamp: 'BenComan 12/9/2012 13:19'!
add: targetElement
        targetElement ifNotNil:
        [
                selectedElements add: targetElement .
                inclusionAction ifNotNil: [ inclusionAction value: targetElement ].
        ].

! !

!ROSelection methodsFor: 'events-triggering' stamp: 'BenComan 10/15/2012 22:08'!
clear
        exclusionAction ifNotNil: [ selectedElements do: [ :element | exclusionAction value: element ] ].
        selectedElements := OrderedCollection new.
! !

!ROSelection methodsFor: 'events-triggering' stamp: 'BenComan 12/9/2012 12:05'!
source: sourceElement target: targetElement
        (filter value: sourceElement value: targetElement) ifTrue:
        [
                self add: targetElement.
        ]! !

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
In reply to this post by moose-technology

Comment #4 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

ROSelection methods categorized in attachment.

Attachments:
        ROSelection.st  2.0 KB

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
Updates:
        Status: Fixed

Comment #5 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

In 1.236

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology

Comment #6 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

Can this be reopened?  I agree that it was fixed per successful integration  
of  cs and st files I provided, but I would like to expand the scope to  
address points (1.) and (2.) above.

First regarding point (2.), the following script demonstrates multiple  
selection using attached RoassalMorphic-BenComan.81.mcz &  
Roassal-BenComan.387.mcz (I wasn't sure if you also needed the intermediate  
mczs so I included them also. One auxillary thing that slipped is  
the 'position' I added to ROElement>>printOn: which you may want to revert.)
---------
activeSelection := ROSelection new
        onInclusion: [ :element | ROHighlightElement on: element color: Color red  
];
        onExclusion: [ :element | ROUnhighlightElement on: element ].
statusBar := (ROElement on: activeSelection) + (ROLabel text: [ :el | el  
model asString ]) + ROBox white.
view stack add: statusBar.
statusBar translateTo: 0 @ 480.

view shape label.
view interaction on: ROMouseLeftClick do:
[   :ann |
     ann shiftKeyPressed ifFalse: [ activeSelection clear ].
     activeSelection add: ann element.
].
view nodes: #(1 2 3 4 5).
view gridLayout.
-------------

Regarding point (1.) I haven't a clue. It would really good if someone  
could assist with that to complete ROSelection example.

Sorry no tests yet, but I updated the ROExample.


Attachments:
        RoassalMorphic-BenComan.81.mcz  110 KB
        Roassal-BenComan.387.mcz  272 KB
        Roassal-BenComan.386.mcz  272 KB
        Roassal-BenComan.385.mcz  271 KB
        Roassal-BenComan.384.mcz  271 KB

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
Updates:
        Status: Accepted

Comment #7 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

(No comment was entered for this change.)

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

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology

Comment #8 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

Is this still an issue?

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology

Comment #9 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

I'm not sure.  I think I remember Alex integrating my contribution for CTRL  
and SHIFT key modifiers to do the multiple selection, but there is no  
record here, and its too long ago (wow! has it been that long).  As far as  
I know the issue of resetting the selection to empty by clicking on the  
background (point 1. above) has not been addressed.

I think the multiple-selection would be a really good feature for Roassal,  
however... * I haven't been very attentive to it.  I plan to have it in my  
application but its on the backburner until I finish a few other things.
* I think Roassal has moved on a lot since then, so I'm not sure how much  
love it will need now.

So perhaps for now it should be closed again.  Once I get my dissertation  
submitted, I plan to move my application to latest Moose.  Then this will  
probably arise again, but I can open a new issue at that time once I have  
something more definite and time to assist.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

moose-technology
Updates:
        Status: Fixed

Comment #10 on issue 894 by [hidden email]: Roassal revised  
ROSelection and example
http://code.google.com/p/moose-technology/issues/detail?id=894

hi Ben,

your code is indeed part of Roassal. I have the impression however that we  
do not fully exploit the possibilities of this.
I fix this.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 894 in moose-technology: Roassal revised ROSelection and example

Ben Coman
cool. Thanks for the update.

[hidden email] wrote:

> Updates:
>     Status: Fixed
>
> Comment #10 on issue 894 by [hidden email]: Roassal revised
> ROSelection and example
> http://code.google.com/p/moose-technology/issues/detail?id=894
>
> hi Ben,
>
> your code is indeed part of Roassal. I have the impression however
> that we do not fully exploit the possibilities of this.
> I fix this.
>

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