Hello,
A large part of this pset relies on our PS3 code working fine. Â If it doesn't, then a) how much would be deducted for improper PS3 code, and b) would it be possible to get a working copy?
This is a "drag and drop", but should this be considered a "clicking" so that it still clear the selection?
I suppose it should clear the selection. Anyone knows an official answer? Thanks!
________________________________________
From: 68...@googlegroups.com [68...@googlegroups.com] On Behalf Of Steven Bartel [sba...@MIT.EDU]
Sent: Sunday, April 04, 2010 3:15 AM
To: 68...@googlegroups.com
Subject: Re: [6831staff] If PS3 didn't work...
I don't see the problem here - you are supposed to select after things are dragged and dropped. The fact that clicking on a checker results in a drag drop makes this even easier, since you can just handle the selection once at the end of the drop event.
-Steve
--
Steven Bartel
Department of Electrical Engineering and Computer Science
Massachusetts Institute of Technology 2010
Phone: (617) 312-7225
On Apr 4, 2010, at 1:22 AM, Tony Tran wrote:
Question on part 3 (more like clarification)
Clicking on the square in either view (without hit-testing, which is optional) basically starts the drag & drop operation. So when we "select" a square, that's basically the same as picking up the piece and immediately dropping it down on the same square isn't it? Currently, I can't think of a way to click the square and not having the UI think you're trying to drag&drop the checker.
Am I missing something? The implications are you can literally only "select a piece" if that piece has just been dragged and dropped.
On Sun, Apr 4, 2010 at 1:10 AM, Ted Tomlinson <zum...@gmail.com<mailto:zum...@gmail.com>> wrote:
It sounds like you are talking about the first part of the pset with the stroke model. You don't (and probably shouldn't) be using the generic CheckerboardInteractor class since you are binding click events to only the checkboard (since there are no children). This means you shouldn't have to worry about the event.target or current target since you are writing it inside the checkerboard class and can just use this.mouseX and this.mouseY to get the mouse position inside the checkerboard. With the stroke model I used the same technique you used by redrawing the board, then all the checkers but the active one (based on its location), and then the active checker that should be moving. When the user initially clicks on the board I add event listeners for MouseMove (to redraw the enire board every time the mouse moves with the active checker in the new "dragged location") and Mouseup to end the drag drop interface and check if the new spot is open. Drawing in the order you gave should have the circle on top. Not sure if this helps.
Ted
On Sat, Apr 3, 2010 at 11:29 PM, Shawn Conrad <shw...@gmail.com<mailto:shw...@gmail.com>> wrote:
Readdressing the second post to this thread, I'm having trouble getting around not using a sprite. In fact, I can't even get a circle to draw where I click. I assume its because the order that my graphics are being drawn is causing my desired circle to be drawn under everything else. This confuses me, because I think the order of what I'm doing is:
check for mouseDown/mouseDrag
find if there is a checker in the row/column where I clicked
if there is, remove it (this should call checkerListener, which repaints the other squares/checkers)
draw a circle centered where I clicked (to show that I've made a "draggable" checker)
This is as far as I've gotten because I can't make the circle in the last step. From there, I figure its easy enough to continually remove and redraw the last made circle as one drags their mouse.
Could anyone show me where I'm going wrong or give me a pointer?
Thanks
Shawn
On Thu, Apr 1, 2010 at 2:57 PM, Brianna Veenstra <veen...@mit.edu<mailto:veen...@mit.edu>> wrote:
I think it's reasonable to say that once you aren't viewing the board it doesn't have a selection?
On Thu, Apr 1, 2010 at 1:39 PM, Ted Tomlinson <zum...@gmail.com<mailto:zum...@gmail.com>> wrote:
The problem is that a component that is not selected on the view that isn't visible can be changed if both views share the same model. Clicking "make king" will make the selected checker on that view a king, and change the associated board model to reflect that. The problem is that when the board model changes it triggers the change event for all views attached to it. Thus the piece on the non visible view will change to a king even though it isn't selected. I think this is probably the right behavior, since the view should always be consistent with the model, but it is confusing from a UI perspective because the non visible board will change independently of its selection.
On Thu, Apr 1, 2010 at 1:27 PM, Angela N Chang <nih...@mit.edu<mailto:nih...@mit.edu>> wrote:
Someone from the course staff should probably answer this question to be safe, but they way I see it, the two boards just need to share the model when that option is selected, and not any intermediary state of the view. It could get tricky having one board listen to (or notify) the other board since events aren't caught in the one that is not currently in view... and the fact that there is only ever one board in view at any time means that changing both seems to add unnecesary complexity to functionality that will never actually be seen by the user.
Since the model is only supposed to be updated when a valid move is made (i.e. when the user is done dragging a checker around), two boards with a shared model should just show the same board configuration at any point in time, and I don't think we have to worry about one view changing of its own accord before the model changes.
Angela
On 4/1/2010 12:55 PM, Ted Tomlinson wrote:
Ok.
For the third part of the problem set since we can have different selections on each view, what do we do if the user clicks "remove checker" or "make king" on the stroke view, but it has a different selection than the pixel view and the two view are sharing the same model? I presume that we are supposed to update the model when we change the view, but this could mean that when the model is shared, a change according to the selection unique to one view will change the component on the other view even though it isn't selected. Is that okay behavior? I'm not sure if I've described the situation well, but it basically comes down to the inconsistency of selection being unique to the view and generating changes in a model that is not unique to the view.
On Thu, Apr 1, 2010 at 11:11 AM, Rob Miller <r...@mit.edu<mailto:r...@mit.edu>> wrote:
No, a sprite is effectively a component with event-handling capability built-in. Part of the point of Problem 1, StrokeCheckerboard, is to learn how to write the input-handling code when you're drawing things yourself, not representing them as components.
On Thu, Apr 1, 2010 at 11:04 AM, Ted Tomlinson <zum...@gmail.com<mailto:zum...@gmail.com>> wrote:
Are we allowed to use a sprite for the first part of the problem set for the checker as we are moving it? The sprite is still drawn with the graphics component in the spirit of the stroke model, but it is a child of the stage. Or do we have to do all of our drawing only on the checkerboard graphics component?
On Thu, Apr 1, 2010 at 3:53 AM, Michael Bernstein <msbe...@mit.edu<mailto:msbe...@mit.edu>> wrote:
Good question. You'll need to fix enough bugs in PS3 for the PS4 functionality to work and be testable. If you're worried about whether it will be testable, show it to one of us in class on Friday.
- Michael
Hello,
A large part of this pset relies on our PS3 code working fine. If it doesn't, then a) how much would be deducted for improper PS3 code, and b) would it be possible to get a working copy?
--
Angela N. Chang
department of electrical engineering & computer science
massachusetts institute of technology || class of 2011
nih...@mit.edu<mailto:nih...@mit.edu> || 305.215.6586 || http://nihwey.scripts.mit.edu
> <mailto:68...@googlegroups.com> [68...@googlegroups.com
> <mailto:68...@googlegroups.com>] On Behalf Of Steven
> Bartel [sba...@MIT.EDU <mailto:sba...@MIT.EDU>]
> Sent: Sunday, April 04, 2010 3:15 AM
> To: 68...@googlegroups.com <mailto:68...@googlegroups.com>
> <mailto:zum...@gmail.com><mailto:zum...@gmail.com
> <mailto:zum...@gmail.com>>> wrote:
> It sounds like you are talking about the first part of
> the pset with the stroke model. You don't (and
> probably shouldn't) be using the generic
> CheckerboardInteractor class since you are binding
> click events to only the checkboard (since there are
> no children). This means you shouldn't have to worry
> about the event.target or current target since you are
> writing it inside the checkerboard class and can just
> use this.mouseX and this.mouseY to get the mouse
> position inside the checkerboard. With the stroke
> model I used the same technique you used by redrawing
> the board, then all the checkers but the active one
> (based on its location), and then the active checker
> that should be moving. When the user initially clicks
> on the board I add event listeners for MouseMove (to
> redraw the enire board every time the mouse moves with
> the active checker in the new "dragged location") and
> Mouseup to end the drag drop interface and check if
> the new spot is open. Drawing in the order you gave
> should have the circle on top. Not sure if this helps.
> Ted
>
> On Sat, Apr 3, 2010 at 11:29 PM, Shawn Conrad
> <shw...@gmail.com
> <mailto:shw...@gmail.com><mailto:shw...@gmail.com
> <mailto:veen...@mit.edu><mailto:veen...@mit.edu
> <mailto:veen...@mit.edu>>> wrote:
> I think it's reasonable to say that once you aren't
> viewing the board it doesn't have a selection?
>
>
> On Thu, Apr 1, 2010 at 1:39 PM, Ted Tomlinson
> <zum...@gmail.com
> <mailto:zum...@gmail.com><mailto:zum...@gmail.com
> <mailto:zum...@gmail.com>>> wrote:
> The problem is that a component that is not selected
> on the view that isn't visible can be changed if both
> views share the same model. Clicking "make king" will
> make the selected checker on that view a king, and
> change the associated board model to reflect that. The
> problem is that when the board model changes it
> triggers the change event for all views attached to
> it. Thus the piece on the non visible view will change
> to a king even though it isn't selected. I think this
> is probably the right behavior, since the view should
> always be consistent with the model, but it is
> confusing from a UI perspective because the non
> visible board will change independently of its selection.
>
>
> On Thu, Apr 1, 2010 at 1:27 PM, Angela N Chang
> <nih...@mit.edu
> <mailto:nih...@mit.edu><mailto:nih...@mit.edu
> <r...@mit.edu <mailto:r...@mit.edu><mailto:r...@mit.edu
> <mailto:r...@mit.edu>>> wrote:
> No, a sprite is effectively a component with
> event-handling capability built-in. Part of the point
> of Problem 1, StrokeCheckerboard, is to learn how to
> write the input-handling code when you're drawing
> things yourself, not representing them as components.
>
>
> On Thu, Apr 1, 2010 at 11:04 AM, Ted Tomlinson
> <zum...@gmail.com
> <mailto:zum...@gmail.com><mailto:zum...@gmail.com
> <mailto:zum...@gmail.com>>> wrote:
> Are we allowed to use a sprite for the first part of
> the problem set for the checker as we are moving it?
> The sprite is still drawn with the graphics component
> in the spirit of the stroke model, but it is a child
> of the stage. Or do we have to do all of our drawing
> only on the checkerboard graphics component?
>
>
> On Thu, Apr 1, 2010 at 3:53 AM, Michael Bernstein
> <msbe...@mit.edu
> <mailto:msbe...@mit.edu><mailto:msbe...@mit.edu
> <mailto:msbe...@mit.edu>>> wrote:
> Good question. You'll need to fix enough bugs in PS3
> for the PS4 functionality to work and be testable. If
> you're worried about whether it will be testable, show
> it to one of us in class on Friday.
> - Michael
>
> Hello,
>
> A large part of this pset relies on our PS3 code
> working fine. If it doesn't, then a) how much would
> be deducted for improper PS3 code, and b) would it be
> possible to get a working copy?
>
>
>
>
>
>
> --
> Angela N. Chang
> department of electrical engineering & computer science
> massachusetts institute of technology || class of 2011
> nih...@mit.edu
> <mailto:nih...@mit.edu><mailto:nih...@mit.edu
--
To unsubscribe, reply using "remove me" as the subject.
Is there a simple way to do bind the button enabled="{}" to if a selection has been made?
Sean Liu (Gmail) wrote:
> Thanks, Olay! That worked. I made it possibly less complicated...
>
> Added a Bindable boolean variable in Checkerboard.
> I named the various boards by adding an /id/ property in the Main.mxml.
> Then I made the /change/ event handler for the tabNavigator, which
> just toggled the binding between the stroke and pixel boards' boolean.
>
> Thanks so much!
> Sean
>
> On Sun, Apr 4, 2010 at 6:25 PM, Olayemi A F Oyebode <olay...@mit.edu
> <mailto:olay...@mit.edu>> wrote:
>
> My solution was multi part:
>
> 1.) Based on a TA's suggestion, I defined separate functions that
> get called by strokeCheckerboard and pixelCheckerboard on
> creationcomplete. This function then uses BindingUtils to set the
> bindings. I used specifically BindingUtils.bindSetter(...) so that
> I could call /another/ function that detected which
> board/checkerboard was visible and changed it.
>
> 2.) Whenever you switch between views, the tabnavigator generates
> change events. So I edited the tabnavigator to call a function
> for /change/. This function detected which board is visible (if
> there is one) and turns on/off the buttons.
>
> Hope that helps.
>
> 2010/4/4 Sean Liu (Gmail) <sean....@gmail.com
> <mailto:sean....@gmail.com>>
>>> <mailto:msbe...@mit.edu
>>> <mailto:msbe...@mit.edu>>> wrote:
>>>
>>> I would call it on the component's
>>> parent, which you can get out
>>> of the component. You can also ask
>>> the component to tell you how
>>> many children it has, which will be
>>> helpful in getting it the
>>> highest in the Z-order.
>>> - Michael
>>>
>>>
>>> On Sun, Apr 4, 2010 at 3:17 PM, Maria
>>> Rodriguez <mar...@mit.edu
>>> <mailto:mar...@mit.edu>
>>> <mailto:mar...@mit.edu
>>> <mailto:mar...@mit.edu>>> wrote:
>>>
>>> Anyone know how/where to use
>>> addChildAt() to make the
>>> component being dragged show up
>>> on top? I want to put it
>>> inside my pickUp method in
>>> CheckerboardMoveInteractor, but I
>>> don't know what to call
>>> .addChildAt(checker,1) on...
>>>
>>> Thanks!
>>> Maria
>>>
>>>
>>> On Sun, Apr 4, 2010 at 2:51 PM,
>>> Michael Bernstein
>>> <msbe...@mit.edu
>>> <mailto:msbe...@mit.edu>
>>> <mailto:msbe...@mit.edu
>>> <mailto:msbe...@mit.edu>>> wrote:
>>>
>>> Zhilei, I would think that it
>>> would clear the selection.
>>> I'd imagine that this makes things much
>>> easier to
>>> implement, too.
>>> - Michael
>>>
>>> On Sun, Apr 4, 2010 at 12:34
>>> PM, Zhilei Xu <ti...@mit.edu
>>> <mailto:ti...@mit.edu>
>>> <mailto:ti...@mit.edu
>>> <mailto:ti...@mit.edu>>> wrote:
>>>
>>> But the tricky things
>>> happen when you press your mouse
>>> button on an empty
>>> square, then move a little bit, and
>>> then release your mouse
>>> button.
>>>
>>> This is a "drag and
>>> drop", but should this be
>>> considered a "clicking"
>>> so that it still clear the
>>> selection?
>>>
>>> I suppose it should clear
>>> the selection. Anyone knows
>>> an official answer? Thanks!
>>>
>>> ________________________________________
>>> From:
>>> 68...@googlegroups.com
>>> <mailto:68...@googlegroups.com>
>>>
>>> <mailto:68...@googlegroups.com
>>> <mailto:68...@googlegroups.com>>
>>> [68...@googlegroups.com
>>> <mailto:68...@googlegroups.com>
>>>
>>> <mailto:68...@googlegroups.com
>>> <mailto:68...@googlegroups.com>>] On
>>> Behalf Of Steven
>>> Bartel [sba...@MIT.EDU
>>> <mailto:sba...@MIT.EDU>
>>> <mailto:sba...@MIT.EDU
>>> <mailto:sba...@MIT.EDU>>]
>>>
>>> Sent: Sunday, April 04,
>>> 2010 3:15 AM
>>> To: 68...@googlegroups.com
>>> <mailto:68...@googlegroups.com>
>>> <mailto:68...@googlegroups.com
>>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>>> <mailto:shw...@gmail.com>><mailto:shw...@gmail.com
>>> <mailto:veen...@mit.edu>><mailto:veen...@mit.edu
>>> <mailto:veen...@mit.edu>
>>>
>>> <mailto:veen...@mit.edu
>>> <mailto:veen...@mit.edu>>>> wrote:
>>> I think it's reasonable
>>> to say that once you aren't
>>> viewing the board it
>>> doesn't have a selection?
>>>
>>>
>>> On Thu, Apr 1, 2010 at
>>> 1:39 PM, Ted Tomlinson
>>> <zum...@gmail.com
>>> <mailto:zum...@gmail.com>
>>> <mailto:zum...@gmail.com
>>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>>> <mailto:zum...@gmail.com>
>>>
>>> <mailto:zum...@gmail.com
>>> <mailto:nih...@mit.edu>><mailto:nih...@mit.edu
>>> <mailto:r...@mit.edu>><mailto:r...@mit.edu
>>> <mailto:r...@mit.edu>
>>>
>>> <mailto:r...@mit.edu
>>> <mailto:r...@mit.edu>>>> wrote:
>>> No, a sprite is
>>> effectively a component with
>>> event-handling capability
>>> built-in. Part of the point
>>> of Problem 1,
>>> StrokeCheckerboard, is to learn how to
>>> write the input-handling
>>> code when you're drawing
>>> things yourself, not
>>> representing them as components.
>>>
>>>
>>> On Thu, Apr 1, 2010 at
>>> 11:04 AM, Ted Tomlinson
>>> <zum...@gmail.com
>>> <mailto:zum...@gmail.com>
>>> <mailto:zum...@gmail.com
>>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>>> <mailto:zum...@gmail.com>
>>>
>>> <mailto:zum...@gmail.com
>>> <mailto:zum...@gmail.com>>>> wrote:
>>> Are we allowed to use a
>>> sprite for the first part of
>>> the problem set for the
>>> checker as we are moving it?
>>> The sprite is still drawn
>>> with the graphics component
>>> in the spirit of the
>>> stroke model, but it is a child
>>> of the stage. Or do we
>>> have to do all of our drawing
>>> only on the checkerboard
>>> graphics component?
>>>
>>>
>>> On Thu, Apr 1, 2010 at
>>> 3:53 AM, Michael Bernstein
>>> <msbe...@mit.edu
>>> <mailto:msbe...@mit.edu>
>>> <mailto:msbe...@mit.edu
>>> <mailto:msbe...@mit.edu>><mailto:msbe...@mit.edu
>>> <mailto:nih...@mit.edu>><mailto:nih...@mit.edu
>>> <mailto:nih...@mit.edu>
>>>
>>> <mailto:nih...@mit.edu
> (916) 220-4326 | sean...@mit.edu <mailto:sean...@mit.edu>
>
>
>
>
> --
> Mr Olayemi A F Oyebode
>
>
>
>
> --
> Sean Liu
> Massachusetts Institute of Technology
> Department of Electrical Engineering & Computer Science '10
> (916) 220-4326 | sean...@mit.edu <mailto:sean...@mit.edu>
Did anyone have this error or knows how to fix it?
Thanks,
Alex
>> <mailto:msbe...@mit.edu
>> <mailto:msbe...@mit.edu>>> wrote:
>>
>> I would call it on the component's parent,
>> which you can get out
>> of the component. You can also ask the
>> component to tell you how
>> many children it has, which will be
>> helpful in getting it the
>> highest in the Z-order.
>> - Michael
>>
>>
>> On Sun, Apr 4, 2010 at 3:17 PM, Maria
>> Rodriguez <mar...@mit.edu
>> <mailto:mar...@mit.edu>
>> <mailto:mar...@mit.edu
>> <mailto:mar...@mit.edu>>> wrote:
>>
>> Anyone know how/where to use
>> addChildAt() to make the
>> component being dragged show up on
>> top? I want to put it
>> inside my pickUp method in
>> CheckerboardMoveInteractor, but I
>> don't know what to call
>> .addChildAt(checker,1) on...
>>
>> Thanks!
>> Maria
>>
>>
>> On Sun, Apr 4, 2010 at 2:51 PM,
>> Michael Bernstein
>> <msbe...@mit.edu
>> <mailto:msbe...@mit.edu>
>> <mailto:msbe...@mit.edu
>> <mailto:msbe...@mit.edu>>> wrote:
>>
>> Zhilei, I would think that it
>> would clear the selection. I'd
>> imagine that this makes things much easier to
>> implement, too.
>> - Michael
>>
>> On Sun, Apr 4, 2010 at 12:34 PM,
>> Zhilei Xu <ti...@mit.edu <mailto:ti...@mit.edu>
>> <mailto:ti...@mit.edu
>> <mailto:ti...@mit.edu>>> wrote:
>>
>> But the tricky things happen
>> when you press your mouse
>> button on an empty square,
>> then move a little bit, and
>> then release your mouse button.
>>
>> This is a "drag and drop", but
>> should this be
>> considered a "clicking" so
>> that it still clear the
>> selection?
>>
>> I suppose it should clear the
>> selection. Anyone knows
>> an official answer? Thanks!
>>
>> ________________________________________
>> From: 68...@googlegroups.com
>> <mailto:68...@googlegroups.com>
>> <mailto:68...@googlegroups.com
>> <mailto:68...@googlegroups.com>>
>> [68...@googlegroups.com
>> <mailto:68...@googlegroups.com>
>> <mailto:68...@googlegroups.com
>> <mailto:68...@googlegroups.com>>] On Behalf Of
>> Steven
>> Bartel [sba...@MIT.EDU
>> <mailto:sba...@MIT.EDU>
>> <mailto:sba...@MIT.EDU
>> <mailto:sba...@MIT.EDU>>]
>>
>> Sent: Sunday, April 04, 2010
>> 3:15 AM
>> To: 68...@googlegroups.com
>> <mailto:68...@googlegroups.com>
>> <mailto:68...@googlegroups.com
>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>> <mailto:shw...@gmail.com>><mailto:shw...@gmail.com
>> <mailto:veen...@mit.edu>><mailto:veen...@mit.edu
>> <mailto:veen...@mit.edu>
>>
>> <mailto:veen...@mit.edu
>> <mailto:veen...@mit.edu>>>> wrote:
>> I think it's reasonable to say
>> that once you aren't
>> viewing the board it doesn't
>> have a selection?
>>
>>
>> On Thu, Apr 1, 2010 at 1:39
>> PM, Ted Tomlinson
>> <zum...@gmail.com
>> <mailto:zum...@gmail.com>
>> <mailto:zum...@gmail.com
>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>> <mailto:zum...@gmail.com>
>>
>> <mailto:zum...@gmail.com
>> <mailto:nih...@mit.edu>><mailto:nih...@mit.edu
>> <mailto:r...@mit.edu>><mailto:r...@mit.edu
>> <mailto:r...@mit.edu>
>>
>> <mailto:r...@mit.edu
>> <mailto:r...@mit.edu>>>> wrote:
>> No, a sprite is effectively a
>> component with
>> event-handling capability
>> built-in. Part of the point
>> of Problem 1,
>> StrokeCheckerboard, is to learn how to
>> write the input-handling code
>> when you're drawing
>> things yourself, not
>> representing them as components.
>>
>>
>> On Thu, Apr 1, 2010 at 11:04
>> AM, Ted Tomlinson
>> <zum...@gmail.com
>> <mailto:zum...@gmail.com>
>> <mailto:zum...@gmail.com
>> <mailto:zum...@gmail.com>><mailto:zum...@gmail.com
>> <mailto:zum...@gmail.com>
>>
>> <mailto:zum...@gmail.com
>> <mailto:zum...@gmail.com>>>> wrote:
>> Are we allowed to use a sprite
>> for the first part of
>> the problem set for the
>> checker as we are moving it?
>> The sprite is still drawn with
>> the graphics component
>> in the spirit of the stroke
>> model, but it is a child
>> of the stage. Or do we have to
>> do all of our drawing
>> only on the checkerboard
>> graphics component?
>>
>>
>> On Thu, Apr 1, 2010 at 3:53
>> AM, Michael Bernstein
>> <msbe...@mit.edu
>> <mailto:msbe...@mit.edu>
>> <mailto:msbe...@mit.edu
>> <mailto:msbe...@mit.edu>><mailto:msbe...@mit.edu
>> <mailto:nih...@mit.edu>><mailto:nih...@mit.edu
>> <mailto:nih...@mit.edu>
>>
>> <mailto:nih...@mit.edu