javax.media.bean.playerbean
Class MediaPlayerMediaLocationEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--javax.media.bean.playerbean.MediaPlayerMediaLocationEditor
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.beans.PropertyEditor, java.io.Serializable

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.

Version:
1.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  java.awt.Panel editPanel
           
(package private)  java.lang.String mediaLocationString
           
(package private)  java.awt.TextField mediaLocationTextField
           
(package private)  java.beans.PropertyChangeSupport support
           
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
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.
(package private)  java.awt.Frame getFrame(java.awt.Component comp)
          Sets up a Frame at the position where the specified Component located.
 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, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

support

java.beans.PropertyChangeSupport support

mediaLocationString

java.lang.String mediaLocationString

mediaLocationTextField

java.awt.TextField mediaLocationTextField

editPanel

java.awt.Panel editPanel
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

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.Container
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.

getFrame

java.awt.Frame getFrame(java.awt.Component comp)
Sets up a Frame at the position where the specified Component located.

Parameters:
comp - The Component where the Frame will be located.