kernel
Class Plugin

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by kernel.Plugin
All Implemented Interfaces:
MouseListener, ImageObserver, MenuContainer, Serializable, Comparable<Plugin>, EventListener, Accessible
Direct Known Subclasses:
PluginFilenames, PluginText

public abstract class Plugin
extends JPanel
implements MouseListener, Comparable<Plugin>

All plugins have to extend one of its subclasses.

Author:
Michel Deriaz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 int compareTo(Plugin plugin)
          Callback method, do not call it directly.
abstract  void execute()
          This method will be automatically called when the user clicks on this plugin.
 String getAppLanguage()
          Returns the ISO 639-1 language code of the main application.
 String getDescription()
          Returns a full html description of the plugin.
 Dialog getOwner()
          Returns a Dialog object that can be used as the owner window for a dialog box.
 String getPluginsDir()
          Returns the relative directory path to the plugins.
 String getSummary()
          Returns a short summary of the plugin.
 void mouseClicked(MouseEvent e)
          Callback method, do not call it directly.
 void mouseEntered(MouseEvent e)
          Callback method, do not call it directly.
 void mouseExited(MouseEvent e)
          Callback method, do not call it directly.
 void mousePressed(MouseEvent e)
          Callback method, do not call it directly.
 void mouseReleased(MouseEvent e)
          Callback method, do not call it directly.
 String readFile(String filename)
          Reads the specified file and returns its content in a String.
 void setDescription(String description)
          Sets the full html description of the plugin.
 void setSummary(String summary)
          Sets a short summary of the plugin.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

execute

public abstract void execute()
This method will be automatically called when the user clicks on this plugin.


getDescription

public String getDescription()
Returns a full html description of the plugin.

Returns:
the description

getSummary

public String getSummary()
Returns a short summary of the plugin.

Returns:
the summary

getOwner

public Dialog getOwner()
Returns a Dialog object that can be used as the owner window for a dialog box. A typical use is when then plugin shows a dialog box (extension of the JDialog class), the constructor will require an owner Frame or Dialog.

Returns:
an owner window

getAppLanguage

public String getAppLanguage()
Returns the ISO 639-1 language code of the main application. Can be used to internationalize a plugin.

Returns:
the ISO 639-1 language code of the main application

getPluginsDir

public String getPluginsDir()
Returns the relative directory path to the plugins.

Returns:
the relative directory path to the plugins

setDescription

public void setDescription(String description)
Sets the full html description of the plugin. All current html tags can be used.

Parameters:
description - an html description of the plugin

setSummary

public void setSummary(String summary)
Sets a short summary of the plugin.

Parameters:
summary - a short summary of the plugin

readFile

public String readFile(String filename)
Reads the specified file and returns its content in a String.

Parameters:
filename - the filename of the file
Returns:
the content of the file, or null if the file does not exist

mouseEntered

public void mouseEntered(MouseEvent e)
Callback method, do not call it directly.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Callback method, do not call it directly.

Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Callback method, do not call it directly.

Specified by:
mousePressed in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
Callback method, do not call it directly.

Specified by:
mouseClicked in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Callback method, do not call it directly.

Specified by:
mouseReleased in interface MouseListener

compareTo

public int compareTo(Plugin plugin)
Callback method, do not call it directly.

Specified by:
compareTo in interface Comparable<Plugin>