A while back I decided to define an interface that extended the JUMP
PlugIn interface so I could consolidate some behavior common to all of
my plug-ins. This would include behavior like:

- Showing the user a GUI through which they interact with the plug-in.
- Showing the user help on the use of the plug-in.
- Showing the user a GUI trough which they can configure the behavior
of the plug-in.

Although I'm not doing anything special with this interface now, I
thought I could use it to provide an abstract plug-in that made it
easier to implement global improvements to these behaviors. For
example, if I can successfully integrate JavaHelp into OpenJUMP, I can
modify the getUserHelp method defined in this interface to add help to
a global helpset and then display it to the user. Or, I might modify
the showConfigureGui(JPanel argPanel) method defined in this interface
to implement a master configuration dialog for my plug-ins.

I have attached the current version of this interface to this e-mail.
If anyone else is interested in implementing it in their own plug-ins
so they can benefit future developments please let me know. I can
provide the small JAR file that contains this interface and related
source code.

The Sunburned Surveyor
/*
 * Project Name: SurveyOS BizzJUMP Plug-In Framework
 * Original Organization Name: The SurveyOs Project
 * Original Programmer Name: The Sunburned Surveyor
 * Current Maintainer Name: The SurveyOS Project
 * Current Maintainer Contact Information
 *    E-Mail Address: The Sunburned Surveyor
 * Copyright Holder: The SurveyOS Project
 * Date Last Modified: October 7, 2008
 * Current Version Number: 1001
 * IDE Name: Eclipse
 * IDE Version: 3.4.1
 * Type: Java Interface
 */
package net.surveyos.sourceforge.openjump.plugin.surveyosmain;

import javax.swing.JPanel;

import com.vividsolutions.jump.workbench.plugin.PlugIn;

/**
 * An extension of the normal JUMP plug-in interface that provides some 
 * additional methods that work with the SurveyOS plug-in framework.
 */
public interface SurveyOsPlugIn extends PlugIn
{
        /**
         * Returns the minimum SurveyOsMain version required to run this 
         * plug-in successfully.
         */
        public int getMinimumSurveyOsMainVersion();
        
        /**
         * Returns the current version of this SurveyOS plug-in for OpenJUMP.
         * @return
         */
        public int getPlugInVersion();
        
        /**
         * Indicates if the dependencies this plug-in has on other plug-ins has
         * been met.
         */
        public boolean dependenciesAreMet();
        
        /**
         * Returns a brief description of this plug-in.
         */
        public String getDescription();
        
        /**
         * Returns a short "one line" description of this plug-in. The String
         * returned by this method should be 80 characters or less.
         */
        public String getOneLineDescription();
        
        /**
         * Sets the SurveyOSMainPlugIn object in this plug-in. This method is 
called
         * when initialization of all plug-ins in OpenJUMP is complete.
         */
        public void setSurveyOsMainPlugIn(SurveyOsMainPlugIn argPlugIn);
        
        /**
         * Shows the GUI of this plug-in to the user. Plug-ins that do 
         * not interact through a GUI with a user will not implement this
         * method.
         * 
         * The plug-in GUI should be passed to this method as a JPanel.
         * The plug-in can then decide how the JPanel will be displayed.
         * It might be displayed in a JInternalFrame or added as a tab
         * to the docking window system. Use of this method will allow 
         * the SurveyOS plug-in framework to manage and react to the
         * display of plug-in GUIs.
         */
        public abstract void showGui(JPanel argPanel);
        
        /**
         * Provides help on using the plug-in to the user.
         */
        public abstract void getUserHelp();
        
        /**
         * Configures the behavior of the plug-in using information
         * supplied by the user. This information might be supplied
         * by the user in a configuration file, or via a GUI.
         */
        public abstract void configure();
        
        /**
         * Shows a GUI that allows the user to configure the plug-in.
         * Plug-ins that do not support configuration will not
         * implement this method.
         *
         * The plug-in can then decide how the JPanel will be displayed.
         * It might be displayed in a JInternalFrame, added as a tab
         * to the docking window system, or added as a page of a master
         * configuration dialog. Use of this method will allow 
         * the SurveyOS plug-in framework to manage and react to the
         * display of plug-in GUIs.
         */
        public abstract void showConfigurationGui(JPanel argPanel);
        
        /**
         * Indicates if this plug-in interacts with the user trough a
         * GUI. If this method returns true the showGui method declared
         * in this interface should be implemented.
         */
        public abstract boolean hasGui();
        
        /**
         * Indicates if this plug-in can be configured by the user.
         * This configuration might take place trough a GUI, or by
         * having the user edit a configuration file.
         * 
         * @see SurveyOsPlugIn.showConfigurationGui method.
         * @see SurveyOsPlugIn.hasConfigurationGui method.
         */
        public abstract boolean canBeConfiguredByUser();
        
        /**
         * 
         * @return
         */
        public abstract boolean hasConfigurationGui();
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to