MediaPlayerBeanInfopublic class MediaPlayerBeanInfo extends SimpleBeanInfo Provides explicit bean information for the
MediaPlayer . It provides descriptions of each property and
indicates which MediaPlayer properties are bound.
Invoked by JavaBeansTM application builders. |
Fields Summary |
---|
private static final Class | beanClass |
Methods Summary |
---|
public java.beans.BeanDescriptor | getBeanDescriptor()Gets the bean descriptor for this bean, which defines information
about MediaPlayer such as its displayName .
BeanDescriptor bd = new BeanDescriptor(MediaPlayer.class);
bd.setDisplayName(MediaPlayerResource.getString("MEDIA_PLAYER")+
" " + MediaPlayerResource.getString("BEAN"));
//"MediaPlayer Bean");
return bd;
| public int | getDefaultPropertyIndex()Gets the default property index for this bean.
The "mediaLocation" property is the default property
for the MediaPlayer .
return 1;
| public java.beans.EventSetDescriptor[] | getEventSetDescriptors()Gets a list of the events fired by this bean.
try
{
EventSetDescriptor cl = new EventSetDescriptor(beanClass,
"controllerUpdate",
javax.media.ControllerListener.class,
"controllerUpdate");
EventSetDescriptor pc = new EventSetDescriptor(beanClass,
"propertyChange",
java.beans.PropertyChangeListener.class,
"propertyChange");
cl.setDisplayName("Controller Events");
EventSetDescriptor[] rv = {cl, pc};
return rv;
}
catch (IntrospectionException e)
{
throw new Error(e.toString());
}
| public java.awt.Image | getIcon(int ic)Gets the icon to be used in the bean tool for this bean.
switch (ic) {
case BeanInfo.ICON_COLOR_16x16:
return loadImage("MediaPlayerColor16.gif");
case BeanInfo.ICON_COLOR_32x32:
return loadImage("MediaPlayerColor32.gif");
case BeanInfo.ICON_MONO_16x16:
return loadImage("MediaPlayerMono16.gif");
case BeanInfo.ICON_MONO_32x32:
return loadImage("MediaPlayerMono32.gif");
default:
return null;
}
| public java.beans.PropertyDescriptor[] | getPropertyDescriptors()Gets a list of bean PropertyDescriptor objects, one for
each public property in the MediaPlayer .
try
{
/* general UI properties */
PropertyDescriptor background = new
PropertyDescriptor("background", beanClass);
PropertyDescriptor foreground = new
PropertyDescriptor("foreground", beanClass);
PropertyDescriptor font = new
PropertyDescriptor("font", beanClass);
/* Behavior & appearance properties for the bean */
PropertyDescriptor Url =
new PropertyDescriptor("mediaLocation", beanClass);
Url.setDisplayName(MediaPlayerResource.getString("MEDIA_LOCATION"));
Url.setBound(true);
Url.setPropertyEditorClass(MediaPlayerMediaLocationEditor.class);
PropertyDescriptor PanelVisible =
new PropertyDescriptor("controlPanelVisible", beanClass);
PanelVisible.setDisplayName(
MediaPlayerResource.getString("CONTROL_PANEL_VISIBLE"));
PanelVisible.setBound(true);
PropertyDescriptor CacheVisible =
new PropertyDescriptor("cachingControlVisible", beanClass);
CacheVisible.setDisplayName(
MediaPlayerResource.getString("CACHING_CONTROL_VISIBLE"));
CacheVisible.setBound(true);
PropertyDescriptor FixedAspectRatio =
new PropertyDescriptor("fixedAspectRatio", beanClass);
FixedAspectRatio.setDisplayName(
MediaPlayerResource.getString("FIXED_ASPECT_RATIO"));
FixedAspectRatio.setBound(true);
PropertyDescriptor loop =
new PropertyDescriptor("playbackLoop", beanClass);
loop.setBound(true);
loop.setDisplayName(MediaPlayerResource.getString("LOOP"));
PropertyDescriptor volume =
new PropertyDescriptor("volumeLevel", beanClass);
volume.setBound(true);
volume.setDisplayName(MediaPlayerResource.getString("VOLUME"));
volume.setPropertyEditorClass(MediaPlayerVolumePropertyEditor.class);
/* build an array of property descriptors */
PropertyDescriptor rv[] = { Url, PanelVisible, CacheVisible,
FixedAspectRatio,loop, volume,
background, foreground, font};
return rv;
}
catch (IntrospectionException e)
{
throw new Error(e.toString());
}
|
|