Class JDialogInstallPlugin

  • All Implemented Interfaces:
    DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogInstallPlugin
    extends JDialogBase
    implements java.awt.event.ActionListener
    Simple dialog to install a plugin. The user selects which .class file to install using a file chooser. The file is copied into MIPAV's class directory and the mipav.preferences file is updated accordingly. The menubars are also updated.
    Version:
    1.0 July 19, 2000
    Author:
    Harman Singh, senseneyj
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  JDialogInstallPlugin.ClassSelectorPanel  
      private class  JDialogInstallPlugin.FileCellRenderer  
      (package private) class  JDialogInstallPlugin.JFileTreeNode
      A node in the file tree.
      class  JDialogInstallPlugin.JFileTreePanel
      A generic file tree.
      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Constructor Description
      JDialogInstallPlugin​(javax.swing.JFrame theParentFrame)
      Creates new dialog.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Calls various methods depending on the action.
      private java.util.Vector<java.awt.Color> buildColorTable​(java.util.Vector<java.io.File> allFiles)
      Attempted to find dependencies of used files after they were temporarily added to the class path (included unpacking jars)
      private boolean examineClass​(java.lang.Class c)  
      private java.lang.Class[] gatherDependents​(java.lang.Class c)
      Gets the dependents of a given class, defined as those classes which exist solely in the pluginDir path and should be uninstalled.
      private java.util.ArrayList<java.lang.Class> gatherSubClassDependents​(java.lang.Class c, int level)
      Attempts to go no further than third level.
      static java.io.InputStream getInputStream​(java.lang.String tarFileName)
      DOCUMENT ME!
      private void init()
      Sets up GUI dialog.
      private void installPlugins()  
      static boolean isImageJPluginClass​(java.lang.Class c)
      Deprecated.
      Use PluginUtil methods.
      private boolean isInPluginFolder​(java.lang.Class c)
      Deprecated.
      Use PluginUtil method.
      private boolean isInPluginFolder​(java.lang.String className)
      Deprecated.
      Use PluginUtil method.
      static boolean isMipavPluginClass​(java.lang.Class c)
      Deprecated.
      Use PluginUtil methods.
      static boolean isPluginClass​(java.lang.Class c)
      Deprecated.
      Use PluginUtil methods.
      private java.util.ArrayList<java.io.File> moveFiles()  
      static java.util.ArrayList<java.io.File> readTar​(java.io.InputStream in, java.lang.String untarDir)
      DOCUMENT ME!
      private void removeEmptyDirs()  
      private void removeFiles​(java.util.ArrayList<java.io.File> allFiles)  
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • fileSystem

        private static javax.swing.filechooser.FileSystemView fileSystem
        File system view.
      • initTreeLoc

        private static java.lang.String initTreeLoc
      • files

        private java.util.Vector<java.io.File> files
        The class, zip, jar etc files that were selected before they were unzipped
      • filesColor

        private java.util.Vector<java.awt.Color> filesColor
        The results of working with the files in a temporary class environment
      • checkShow

        private javax.swing.JCheckBox checkShow
        Check box for whether to display files that are not likely sources of MIPAV plugins.*
      • checkUnpack

        private javax.swing.JCheckBox checkUnpack
        Check box for unpacking container files
    • Constructor Detail

      • JDialogInstallPlugin

        public JDialogInstallPlugin​(javax.swing.JFrame theParentFrame)
        Creates new dialog.
        Parameters:
        theParentFrame - Parent frame
    • Method Detail

      • getInputStream

        public static java.io.InputStream getInputStream​(java.lang.String tarFileName)
                                                  throws java.io.IOException
        DOCUMENT ME!
        Parameters:
        tarFileName - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
        Throws:
        java.io.IOException - DOCUMENT ME!
      • readTar

        public static java.util.ArrayList<java.io.File> readTar​(java.io.InputStream in,
                                                                java.lang.String untarDir)
                                                         throws java.io.IOException
        DOCUMENT ME!
        Parameters:
        in - DOCUMENT ME!
        untarDir - DOCUMENT ME!
        Throws:
        java.io.IOException - DOCUMENT ME!
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Calls various methods depending on the action.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - event that triggered function
      • installPlugins

        private void installPlugins()
      • gatherDependents

        private java.lang.Class[] gatherDependents​(java.lang.Class c)
        Gets the dependents of a given class, defined as those classes which exist solely in the pluginDir path and should be uninstalled.
        Parameters:
        c -
        Returns:
      • gatherSubClassDependents

        private java.util.ArrayList<java.lang.Class> gatherSubClassDependents​(java.lang.Class c,
                                                                              int level)
        Attempts to go no further than third level.
        Parameters:
        c -
        level -
        Returns:
      • init

        private void init()
        Sets up GUI dialog.
      • moveFiles

        private java.util.ArrayList<java.io.File> moveFiles()
      • removeFiles

        private void removeFiles​(java.util.ArrayList<java.io.File> allFiles)
      • removeEmptyDirs

        private void removeEmptyDirs()
      • isInPluginFolder

        @Deprecated
        private boolean isInPluginFolder​(java.lang.String className)
        Deprecated.
        Use PluginUtil method.
        Determines whether the className is in the plugin folder.
        Parameters:
        className -
        Returns:
      • isInPluginFolder

        @Deprecated
        private boolean isInPluginFolder​(java.lang.Class c)
        Deprecated.
        Use PluginUtil method.
        Determines whether c is in the current plugin folder.
        Parameters:
        c -
        Returns:
      • isPluginClass

        @Deprecated
        public static final boolean isPluginClass​(java.lang.Class c)
        Deprecated.
        Use PluginUtil methods.
        Returns whether the given class is a MIPAV/ImageJ plugin.
        Parameters:
        c - A class.
        Returns:
        True, if the given class is a MIPAV/ImageJ plugin.
      • isMipavPluginClass

        @Deprecated
        public static final boolean isMipavPluginClass​(java.lang.Class c)
        Deprecated.
        Use PluginUtil methods.
        Returns whether the given class is a MIPAV plugin.
        Parameters:
        c - A class.
        Returns:
        True, if the given class is a MIPAV plugin.
      • isImageJPluginClass

        @Deprecated
        public static final boolean isImageJPluginClass​(java.lang.Class c)
        Deprecated.
        Use PluginUtil methods.
        Returns whether the given class is an ImageJ plugin.
        Parameters:
        c - A class.
        Returns:
        True, if the given class is an ImageJ plugin.
      • examineClass

        private boolean examineClass​(java.lang.Class c)
      • buildColorTable

        private java.util.Vector<java.awt.Color> buildColorTable​(java.util.Vector<java.io.File> allFiles)
        Attempted to find dependencies of used files after they were temporarily added to the class path (included unpacking jars)
        Parameters:
        allFiles -
        Returns:
        See Also:
        moveFiles(), removeFiles(ArrayList)