javax.media.bean.playerbean
Class MediaPlayerMediaLocationEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--javax.media.bean.playerbean.MediaPlayerMediaLocationEditor

public class MediaPlayerMediaLocationEditor
extends java.awt.Panel
implements java.beans.PropertyEditor, java.awt.event.ActionListener, java.awt.event.ItemListener

Special case property editor for the media location property of a MediaPlayer bean. Invoked by Java Beans application builders.

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
MediaPlayerMediaLocationEditor()
          Default constructor that adds the KeyListener for the visual text field.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Determines which controls have had the specified action performed and acts accordingly.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Registers a listener for the PropertyChangeEvent .
 java.lang.String getAsText()
          Gets the mediaLocation property.
 java.awt.Component getCustomEditor()
          Gets the panel that supports the media location editing.
 java.lang.String getJavaInitializationString()
          Generates a code fragment that can be used to initialize a variable with the current mediaLocation property value.
 java.awt.Dimension getPreferredSize()
          Gets the preferred dimensions for this media location editor.
 java.lang.String[] getTags()
          Determines whether or not this is a tagged value.
 java.lang.Object getValue()
          Gets the value from the media location property.
 boolean isPaintable()
          Determines whether or not this class honors the paintValue method.
 void itemStateChanged(java.awt.event.ItemEvent evt)
          Determines which protocol is selected and acts accordingly.
 void paintValue(java.awt.Graphics g, java.awt.Rectangle area)
          Paints the media location's editor box.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the specified listener from the property change listener list.
 void setAsText(java.lang.String s)
          Sets the property value to the specified string.
 void setValue(java.lang.Object o)
          Sets the value for the media location property.
 boolean supportsCustomEditor()
          Determines whether or not this property editor supports a custom editor.
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaPlayerMediaLocationEditor

public MediaPlayerMediaLocationEditor()
Default constructor that adds the KeyListener for the visual text field.
Method Detail

getJavaInitializationString

public java.lang.String getJavaInitializationString()
Generates a code fragment that can be used to initialize a variable with the current mediaLocation property value.
Specified by:
getJavaInitializationString in interface java.beans.PropertyEditor
Returns:
The initialization String.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred dimensions for this media location editor.
Overrides:
getPreferredSize in class java.awt.Container
Returns:
A Dimension that contains the preferred dimensions.

setValue

public void setValue(java.lang.Object o)
Sets the value for the media location property.
Specified by:
setValue in interface java.beans.PropertyEditor
Parameters:
o - The new media location property object.

getValue

public java.lang.Object getValue()
Gets the value from the media location property.
Specified by:
getValue in interface java.beans.PropertyEditor
Returns:
The media location property value.

setAsText

public void setAsText(java.lang.String s)
Sets the property value to the specified string.
Specified by:
setAsText in interface java.beans.PropertyEditor
Parameters:
s - The String to set the media location property value to.

getAsText

public java.lang.String getAsText()
Gets the mediaLocation property.
Specified by:
getAsText in interface java.beans.PropertyEditor
Returns:
The value of the media location property as a String.

isPaintable

public boolean isPaintable()
Determines whether or not this class honors the paintValue method. Used by bean builders.
Specified by:
isPaintable in interface java.beans.PropertyEditor
Returns:
true if it honors the paintValue method, false if it does not.

paintValue

public void paintValue(java.awt.Graphics g,
                       java.awt.Rectangle area)
Paints the media location's editor box.
Specified by:
paintValue in interface java.beans.PropertyEditor
Parameters:
g - The graphics context in which to paint the editor box.
area - The area in which the editor box should be rendered.

getTags

public java.lang.String[] getTags()
Determines whether or not this is a tagged value.
Specified by:
getTags in interface java.beans.PropertyEditor
Returns:
null to tell the bean builder that this is not a tagged value property.

getCustomEditor

public java.awt.Component getCustomEditor()
Gets the panel that supports the media location editing.
Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Parameters:
The - panel as a Component.

supportsCustomEditor

public boolean supportsCustomEditor()
Determines whether or not this property editor supports a custom editor.
Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Returns:
true since the media location property can provide a custom editor.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a listener for the PropertyChangeEvent .
Specified by:
addPropertyChangeListener in interface java.beans.PropertyEditor
Overrides:
addPropertyChangeListener in class java.awt.Component
Parameters:
listener - An object to be invoked when a PropertyChangeEvent is fired.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified listener from the property change listener list.
Specified by:
removePropertyChangeListener in interface java.beans.PropertyEditor
Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
listener - The PropertyChangeListener to be removed.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Determines which controls have had the specified action performed and acts accordingly.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - The ActionEvent.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Determines which protocol is selected and acts accordingly.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
evt - The ItemEvent.


Submit a bug or feature
Copyright 1994-2004 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.