public interface Controllable
| Modifier and Type | Method and Description |
|---|---|
Control |
getControl(java.lang.String controlType)
Obtain the object that implements the specified
Control interface. |
Control[] |
getControls()
Obtain the collection of
Controls from the object that
implements this interface. |
Control[] getControls()
Controls from the object that
implements this interface.
Since a single object can implement multiple Control
interfaces, it's necessary to check each object against different
Control types. For example:
Controllable controllable;
// ...
Control cs[];
cs = controllable.getControls();
for (int i = 0; i < cs.length; i++) {
if (cs[i] instanceof ControlTypeA)
doSomethingA();
if (cs[i] instanceof ControlTypeB)
doSomethingB();
// etc.
}
|
The list of Control objects returned will not contain any
duplicates. And the list will not change over time.
If no Control is supported, a zero length array is returned.
Control objectsjava.lang.IllegalStateException - if getControls is
called in a wrong state. See Player for more details.Control getControl(java.lang.String controlType)
Control interface.
If the specified Control interface is not supported then
null is returned.
If the Controllable supports multiple objects that implement
the same specified Control interface, only one of them will
be returned. To obtain all the Controls of that type, use
the getControls() method and check
the list for the requested type.
controlType - the class name of the Control. The class
name should be given either as the fully-qualified name of the
class; or if the package of the class is not given, the package
javax.microedition.media.control is assumed.nulljava.lang.IllegalArgumentException - if controlType is nulljava.lang.IllegalStateException - if getControl is called in a
wrong state. See Player for more details.Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.