Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selection Listener



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
References: 
 >Selection Listener (From: Elliotte Harold <email@hidden>)
 >Re: Selection Listener (From: Chris Adamson <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.