Re: Selection Listener
Subject : Re: Selection Listener
From: Elliotte Harold <email@hidden >
Date: Fri, 15 Jul 2005 12:02:51 -0400
Delivered-to: email@hidden
Delivered-to: email@hidden
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)
Thanks. That seems to work. It appears that to distinguish selection
from deselection one checks the duration of the time record in an
mcActionSetSelectionDuration event. If this is 0, then its a deselection
event. Otherwise it's a selection event. Like so:
class SelectionListener extends ActionFilter {
private PlayerFrame frame;
SelectionListener(PlayerFrame frame) {
this.frame = frame;
}
public boolean execute(MovieController controller, int action,
TimeRecord tr) {
if (action == StdQTConstants.mcActionSetSelectionDuration) {
PlayerMenuBar mb = (PlayerMenuBar) (frame.getJMenuBar());
if (tr.getValue() == 0) mb.deselection();
else mb.selection();
}
return super.execute(controller, action, tr);
}
}
You can ignore mcActionSetSelectionBegin for this purpose. I wish this
were actually documented, but it seems to work for now.
--
Elliotte Rusty Harold email@hidden
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.