Xj3D VRML/X3D Code API

org.web3d.util
Class OpenAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.web3d.util.OpenAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class OpenAction
extends javax.swing.AbstractAction

An action that can be used to open a file.

Version:
$Revision: 1.1 $
Author:
Alan Hudson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
OpenAction(java.awt.Component parent, FileHandler handler, java.lang.String contentDirectory)
          Create an instance of the action class.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          An action has been performed.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenAction

public OpenAction(java.awt.Component parent,
                  FileHandler handler,
                  java.lang.String contentDirectory)
Create an instance of the action class.

Parameters:
parent - The parent component
handler - A handler for opening files
contentDirectory - initial directory to load content from. Must be a full path.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
An action has been performed. This is the Go button being pressed. Grab the URL and check with the file to see if it exists first as a local file, and then try to make a URL of it. Finally, if this all works, call the abstract gotoLocation method.

Parameters:
evt - The event that caused this method to be called.

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium