Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent evt)Determines which controls have had the specified
action performed and acts accordingly.
String command = evt.getActionCommand();
String filename;
if (command.equals(browseString))
{
if (isFile==true)
{
FileDialog fd = new FileDialog(getFrame(editPanel),
MediaPlayerResource.getString("SET_MEDIA_LOCATION"),
FileDialog.LOAD);
fd.setDirectory("c:\\");
fd.setTitle(MediaPlayerResource.getString("SET_MEDIA_LOCATION"));
fd.show();
filename = fd.getFile();
if (filename != null && fd.getDirectory() != null)
{
filename = fd.getDirectory() + filename;
}
if (filename != null) {
filename = filename.replace('\\", '/");
String tmp = "file:///"+filename;
mediaLocationTextField.setText(tmp);
setAsText(tmp);
// readyB.setEnabled(true);
}
}
else
{
MediaPlayerRTPDialog rtpDlg= new MediaPlayerRTPDialog(getFrame(editPanel));
rtpDlg.show();
filename = rtpDlg.getRTPAdr();
if (filename !=null)
{
String tmp = "rtp://"+filename;
mediaLocationTextField.setText(tmp);
setAsText(tmp);
}
}
}
//The code below is to handle Ready button
/*
else if (command.equals(readyString))
{
String tmp = mediaLocationString;
String choiceSelection = protocolChooser.getSelectedItem();
setAsText(tmp);
support.firePropertyChange("mediaLocation",
null,
mediaLocationString);
}
*/
|
public void | addPropertyChangeListener(java.beans.PropertyChangeListener listener)Registers a listener for the PropertyChangeEvent .
support.addPropertyChangeListener(listener);
|
public java.lang.String | getAsText()Gets the mediaLocation property.
return this.mediaLocationString;
|
public java.awt.Component | getCustomEditor()Gets the panel that supports the media location
editing.
return editPanel;
|
java.awt.Frame | getFrame(java.awt.Component comp)Sets up a Frame at the position where the specified
Component located.
Point p = comp.getLocationOnScreen();
Frame f = new Frame();
f.setLocation(p);
return f;
|
public java.lang.String | getJavaInitializationString()Generates a code fragment that can be used
to initialize a variable with the current mediaLocation
property value.
String initString;
if (mediaLocationString.length() == 0)
{
initString = "new java.lang.String(\"\\\")";
}
else
{
initString = "new java.lang.String(\""
+ mediaLocationString
+ "\")";
}
return initString;
|
public java.awt.Dimension | getPreferredSize()Gets the preferred dimensions for this media location editor.
return new Dimension(400, 100);
|
public java.lang.String[] | getTags()Determines whether or not this is a tagged value.
return null;
|
public java.lang.Object | getValue()Gets the value from the media location property.
return getAsText();
|
public boolean | isPaintable()Determines whether or not this class honors
the paintValue method. Used by bean builders.
return true;
|
public void | itemStateChanged(java.awt.event.ItemEvent evt)Determines which protocol is selected and acts accordingly.
String item = (String)evt.getItem();
if (!item.equals(chooseOneString) )
{
mediaLocationTextField.setEnabled(true);
if (item.equals(fileString))
{
browseB.setEnabled(true);
isFile=true;
}
else if (item.equals(rtpString))
{
browseB.setEnabled(true);
}
else
{
browseB.setEnabled(false);
}
if (!item.equals(codeString))
{
mediaLocationTextField.setText(item);
}
else
{
mediaLocationTextField.setText("");
}
// readyB.setEnabled(false);
mediaLocationString = mediaLocationTextField.getText();
}
else
{
mediaLocationTextField.setEnabled(false);
browseB.setEnabled(false);
// readyB.setEnabled(false);
}
|
public void | paintValue(java.awt.Graphics g, java.awt.Rectangle area)Paints the media location's editor box.
Color c = g.getColor();
g.setColor(Color.black);
g.drawString(mediaLocationString,
area.x, area.y + area.height - 6);
g.setColor(c);
|
public void | removePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes the specified listener from the property change listener list.
support.removePropertyChangeListener(listener);
|
public void | setAsText(java.lang.String s)Sets the property value to the specified string.
mediaLocationString = s;
|
public void | setValue(java.lang.Object o)Sets the value for the media location property.
setAsText(o.toString());
|
public boolean | supportsCustomEditor()Determines whether or not this property editor supports a custom editor.
return true;
|