Class ImportAccessorAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class ImportAccessorAction
    extends javax.swing.AbstractAction
    An Action to import an Internet of Things (IoT) accessor.

    This action presents a dialog box that permits specifying a URL or local directory. If the URL or local directory contains a file named index.json, then it presents a list of the options given in that file, which it assumes are all accessors. To manually specify a particular accessor on the local file system, you can browse to its directory, but then you have to manually type in the file name of the accessor.

    This package is optional. To add the "Import Accessor" menu choice to the GraphEditor, add the following to the configuration:

       <property name="_importActionClassNames"
       class="ptolemy.data.expr.Parameter"
       value="{"ptolemy.vergil.basic.imprt.accessor.ImportAccessorAction"}"/>
       

    BasicGraphFrame checks for this parameter and adds the "Import Accessor" menu choice if the class named by that parameter exists.

    The $PTII/ptolemy/configs/defaultFullConfiguration.xml file already has this parameter. The ptiny configuration does not have this parameter so that we have a smaller download.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks, Patricia Derler.
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Summary

      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Constructor Summary

      Constructors 
      Constructor Description
      ImportAccessorAction​(Top frame)
      Create a new action to import an accessor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Import an accessor.
      • 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
      • Methods inherited from interface javax.swing.Action

        accept
    • Constructor Detail

      • ImportAccessorAction

        public ImportAccessorAction​(Top frame)
        Create a new action to import an accessor. The initial default value for last location is "https://accessors.org".
        Parameters:
        frame - The Top that gets the menu.
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Import an accessor.
        Parameters:
        event - The Action Event.