org.openbp.jaspira.gui.plugin
Class JaspiraPageContainer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.openbp.jaspira.gui.plugin.JaspiraPageContainer
All Implemented Interfaces:
java.awt.event.WindowFocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, DropPaneContainer, InteractionClient, PluginContainer, Plugin

public class JaspiraPageContainer
extends javax.swing.JFrame
implements PluginContainer, InteractionClient, DropPaneContainer, Plugin, java.awt.event.WindowFocusListener

The page container is a frame that hold a number of JaspiraPage pages. You can't add components to this frame directly, only pages. Jaspira pages are areas that contain plugins. Only one page can be visible at a time.

Author:
Jens Ferchland
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
 
Field Summary
static java.awt.Dimension MIN_FRAME_SIZE
          An application has a minimum size, also if the application is empty
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.openbp.jaspira.gui.plugin.PluginContainer
CENTER, EAST, NORTH, REGION_CENTER, REGION_EAST, REGION_NORTH, REGION_SOUTH, REGION_WEST, SOUTH, WEST
 
Fields inherited from interface org.openbp.jaspira.plugin.Plugin
ID_DELIMETER, LEVEL_APPLICATION, LEVEL_FRAME, LEVEL_PAGE, LEVEL_PLUGIN
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JaspiraPageContainer(java.lang.String title, java.awt.GraphicsConfiguration gc)
          Creates a new frame with the given title.
 
Method Summary
 void addDropClient(InteractionClient client)
          Adds a drop client to the list of the container's drop clients.
 void addPage(JaspiraPage page)
          Adds a page to the frame.
 void addPlugin(Plugin child)
          Adds a plugin as child plugin of this plugin.
 void addPlugin(VisiblePlugin p)
          Adds a plugin to the container.
 void addToPeerGroup(java.lang.String key, java.lang.Object group)
          Adds the plugin to a peer group given by key and object.
 void buildMenu()
          Rebuild the frame's menu by polling for entries.
 boolean canClose()
          Checks, whether this plugin can be closed.
 boolean containsPage(JaspiraPage page)
          Checks if the given page is hosted by this container.
 boolean containsStackedEvent(java.lang.String eventName)
          Checks if the event stack contains a particular event.
 void dragActionTriggered(java.lang.Object regionId, java.awt.Point p)
          Is called, when a region triggers an action.
 void dragEnded(java.awt.datatransfer.Transferable transferable)
          Is called when a dragging action has been initialized (to be precise: when a dragging event has entered our frame.
 void dragStarted(java.awt.datatransfer.Transferable transferable)
          Is called when either the dragging process ended inside our frame or left the frame.
 boolean fireEvent(JaspiraEvent je)
          Fires the given event using the event queue.
 boolean fireEvent(java.lang.String eventname)
          Creates a new client event using the given event name and fires it.
 boolean fireEvent(java.lang.String eventname, java.lang.Object data)
          Creates a new client event using the given event name and event object and fires it.
 JaspiraAction getAction(java.lang.String name)
          This convenience method retrieves an action from the action manager.
 JaspiraPage getActivePage()
          Gets the active page of this frame.
 VisiblePlugin getActivePlugin()
          Returns the active plugin of this frame (in the visible page).
 java.util.List getAllDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of all regions of this client AND possible sub clients.
 java.util.List getAllImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client or one of its sub clients.
 java.util.List getChildPlugins()
          Returns a list of all children of this plugin.
 java.lang.String getClassName()
          Returns the class name of the plugin.
 java.lang.String getCondition()
          Gets the conditional expression that determines if the plugin should be active.
 java.util.List getDescendantPlugins(java.util.List plugins)
          Returns a list of all children and further descendants of this plugin.
 java.lang.String getDescription()
          Gets the description.
 DragDropPane getDragDropPane()
          Returns the drad and drop page of this container.
 java.util.List getDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          The regions of a page container consist of the page switch zones and the 'open in new frame' zone.
 java.util.List getEventActionNames()
          Gets a list of the action names of the event actions of this plugin.
 MultiIcon getIcon()
          Gets the icon.
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 int getLevel()
          Returns the level of this plugin in the plugin tree.
 JaspiraPage getPage()
          Returns the page level parent plugin of this plugin.
 java.util.List getPages()
          Gets a list of all pages of this container.
 PluginContainer getParentContainer()
          Returns null.
 Plugin getParentPlugin()
          Returns the parent plugin of this plugin.
 java.lang.Object getPeerGroup(java.lang.String key)
          Gets the peer group for the given group name.
 java.util.Set getPeerGroupNames()
          Returns the names of all peergroups that this plugin has been added to.
 java.util.Set getPeerGroups()
          Returns the peer groups this plugin has been added to.
 ResourceCollection getPluginResourceCollection()
          Gets the plugin resource.
 java.util.List getPlugins()
          Returns the list of plugins held by this frame.
 PluginState getPluginState()
          Returns the state of this plugin.
 java.util.List getSubClients()
          Returns all sub clients.
 java.lang.String getSubTitle()
          Returns the sub title of this plugin.
 JaspiraToolbar getToolbar()
          Gets the main toolbar.
 java.lang.String getUniqueId()
          Returns the unique id of this plugin.
protected  java.util.List getUserRegions(java.util.List flavors)
          Override to implemnt own regions.
 java.lang.String getVendor()
          Gets the plugin vendor.
 java.lang.String getVersion()
          Gets the plugin version.
 java.util.List getVisiblePlugins()
          Returns all plugins of the active page that are currently visible, i\.e\. shown in their tabbed containers.
 boolean handleEvent(JaspiraEvent je)
          Tries to handles the event for this plugin without passing it on.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports data into the frame.
 boolean inheritEvent(JaspiraEvent je)
          Receives an event incoming from a parent.
 void initializePlugin()
          Initializes the plugin.
 void installFirstPlugin()
          This template method is called before the first plugin instance of this kind is installed.
 void installPlugin()
          Installs the plugin and all its modules.
 boolean matchesPeerGroup(java.lang.String key, java.lang.Object group, boolean strict)
          Check if the plugin is a member of the given peer group.
 boolean matchesPeerGroups(Plugin plugin, boolean strict)
          Matches all peer groups of one plugin against another.
 void openInNewFrame(JaspiraPage page)
          Opens the page in a new frame.
 boolean receiveEvent(JaspiraEvent je)
          Handles an incoming event that is received from a child plugin.
 void removeDropClient(InteractionClient client)
          Removes a drop client to the list of the container's drop clients.
 void removeFromPeerGroup(java.lang.String key)
          Removes the plugin from a peer group.
 void removePage(JaspiraPage page)
          Removes a page from the frame.
 void removePlugin(Plugin child)
          Removes a child plugin from this plugin.
 void removePlugin(VisiblePlugin p)
          Removes the plugin in the frame.
 boolean requestClose()
          Request the plugin to be closed.
 void setDragDropPane(DragDropPane pane)
          Sets up the given drag and drop pane as glass pane of the container.
 void setPageActive(JaspiraPage page)
          Activates the given page.
 void setParentPlugin(Plugin plugin)
          Sets the parent plugin of this plugin.
 void setPluginState(PluginState state)
          Rebuilds the state of the plugin using the given state object.
 void sliceContainer(PluginContainer toInsert, PluginContainer currentContainer, java.lang.String constraint)
          Does nothing.
 void stackEvent(JaspiraEvent je)
          Adds a stackable event to the event stack.
 java.lang.String toString()
          Returns a string representation of this object.
 void uninstallLastPlugin()
          This is called after uninstall for the last instance has been uninstalled.
 void uninstallPlugin()
          Uninstalls the plugin and all of its modules.
 void windowGainedFocus(java.awt.event.WindowEvent e)
          Called when this frame gains the focus.
 void windowLostFocus(java.awt.event.WindowEvent e)
          Called when this frame lost the focus.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.RootPaneContainer
getContentPane, getGlassPane, getLayeredPane, getRootPane, setContentPane, setGlassPane, setLayeredPane
 
Methods inherited from interface org.openbp.jaspira.plugin.Plugin
getName, getTitle
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

MIN_FRAME_SIZE

public static final java.awt.Dimension MIN_FRAME_SIZE
An application has a minimum size, also if the application is empty

Constructor Detail

JaspiraPageContainer

public JaspiraPageContainer(java.lang.String title,
                            java.awt.GraphicsConfiguration gc)
Creates a new frame with the given title.

Parameters:
title - Window title of the frame
gc - Graphics context to use
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.awt.Component

buildMenu

public final void buildMenu()
Rebuild the frame's menu by polling for entries.


addPage

public void addPage(JaspiraPage page)
Adds a page to the frame.

Parameters:
page - Page to add

removePage

public void removePage(JaspiraPage page)
Removes a page from the frame.

Parameters:
page - Page to remove

openInNewFrame

public void openInNewFrame(JaspiraPage page)
Opens the page in a new frame.

Parameters:
page - Page to move to a new frame

getPages

public java.util.List getPages()
Gets a list of all pages of this container.

Returns:
A list of JaspiraPage objects

getActivePage

public JaspiraPage getActivePage()
Gets the active page of this frame.

Returns:
The active page or null if this container does not have any pages

setPageActive

public void setPageActive(JaspiraPage page)
Activates the given page. The method will fire a global.page.askchange veto event and then - if successful - a global.page.changed event. The focus of the new page will be restored to the plugin that had the focus when the page was deactivated.

Parameters:
page - Page to activate

containsPage

public boolean containsPage(JaspiraPage page)
Checks if the given page is hosted by this container.


getToolbar

public JaspiraToolbar getToolbar()
Gets the main toolbar.


getPage

public JaspiraPage getPage()
Description copied from interface: PluginContainer
Returns the page level parent plugin of this plugin.

Specified by:
getPage in interface PluginContainer
Returns:
The page that holds this plugin or null

addPlugin

public void addPlugin(VisiblePlugin p)
Description copied from interface: PluginContainer
Adds a plugin to the container.

Specified by:
addPlugin in interface PluginContainer
Parameters:
p - Plugin to add

removePlugin

public void removePlugin(VisiblePlugin p)
Removes the plugin in the frame.

Specified by:
removePlugin in interface PluginContainer
Parameters:
p - Plugin to remove

getActivePlugin

public VisiblePlugin getActivePlugin()
Returns the active plugin of this frame (in the visible page).

Specified by:
getActivePlugin in interface PluginContainer
Returns:
The plugin or null if the container does not contain a plugin

getParentContainer

public PluginContainer getParentContainer()
Returns null.

Specified by:
getParentContainer in interface PluginContainer
Returns:
The parent container or null

getPlugins

public java.util.List getPlugins()
Returns the list of plugins held by this frame.

Specified by:
getPlugins in interface PluginContainer
Returns:
A list of VisiblePlugin objects

getVisiblePlugins

public java.util.List getVisiblePlugins()
Returns all plugins of the active page that are currently visible, i\.e\. shown in their tabbed containers.

Specified by:
getVisiblePlugins in interface PluginContainer
Returns:
A list of VisiblePlugin objects or null

sliceContainer

public void sliceContainer(PluginContainer toInsert,
                           PluginContainer currentContainer,
                           java.lang.String constraint)
Does nothing.

Specified by:
sliceContainer in interface PluginContainer
Parameters:
toInsert - Containert to insert
currentContainer - Currrent container that shall be replaced
constraint - The constraint determines where to place the new container:
PluginContainer.CENTER/PluginContainer.NORTH/PluginContainer.SOUTH/PluginContainer.EAST/PluginContainer.WEST

dragActionTriggered

public void dragActionTriggered(java.lang.Object regionId,
                                java.awt.Point p)
Is called, when a region triggers an action. In our case, when a dragging operation hovers above a page-button for some time.

Specified by:
dragActionTriggered in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
p - Current mouse position in screen coordinates

dragStarted

public void dragStarted(java.awt.datatransfer.Transferable transferable)
Is called when either the dragging process ended inside our frame or left the frame.

Specified by:
dragStarted in interface InteractionClient
Parameters:
transferable - Transferable to be dragged

dragEnded

public void dragEnded(java.awt.datatransfer.Transferable transferable)
Is called when a dragging action has been initialized (to be precise: when a dragging event has entered our frame.

Specified by:
dragEnded in interface InteractionClient
Parameters:
transferable - Transferable that has been dragged

getAllDropRegions

public final java.util.List getAllDropRegions(java.util.List flavors,
                                              java.awt.datatransfer.Transferable data,
                                              java.awt.event.MouseEvent mouseEvent)
Description copied from interface: InteractionClient
Returns a list of all regions of this client AND possible sub clients.

Specified by:
getAllDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to import
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client or one of its sub clients cannot satisfy at least one of the supplied data flavors
See Also:
InteractionClient.getAllDropRegions(List, Transferable, MouseEvent)

getDropRegions

public final java.util.List getDropRegions(java.util.List flavors,
                                           java.awt.datatransfer.Transferable data,
                                           java.awt.event.MouseEvent mouseEvent)
The regions of a page container consist of the page switch zones and the 'open in new frame' zone. In order to register your own zones, do not override this, override getUserRegions () instead.

Specified by:
getDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to be imported
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client cannot satisfy at least one of the supplied data flavors.
The list will contain only regions that belong directly to this drop client.
See Also:
InteractionClient.getDropRegions(List, Transferable, MouseEvent)

getImportersAt

public java.util.List getImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client.

Specified by:
getImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null

getAllImportersAt

public java.util.List getAllImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client or one of its sub clients.

Specified by:
getAllImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null

getUserRegions

protected java.util.List getUserRegions(java.util.List flavors)
Override to implemnt own regions.

Parameters:
flavors - Flavors the regions should be suitable for
Returns:
A list of user regions or null

getSubClients

public java.util.List getSubClients()
Returns all sub clients.

Specified by:
getSubClients in interface InteractionClient
Returns:
A list of InteractionClient objects or null if this drop client doesn't have sub drop clients.
These are any visible Plugins.

importData

public boolean importData(java.lang.Object regionId,
                          java.awt.datatransfer.Transferable data,
                          java.awt.Point p)
Imports data into the frame. Standard import is a page into the page list.

Specified by:
importData in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
data - Transferable to import
p - Drop point in glass coordinates
Returns:
true The data was successfully imported.
false An error occured while importing the data.

addDropClient

public void addDropClient(InteractionClient client)
Description copied from interface: DropPaneContainer
Adds a drop client to the list of the container's drop clients.

Specified by:
addDropClient in interface DropPaneContainer
Parameters:
client - Client to add
See Also:
DropPaneContainer.addDropClient(InteractionClient)

removeDropClient

public void removeDropClient(InteractionClient client)
Description copied from interface: DropPaneContainer
Removes a drop client to the list of the container's drop clients.

Specified by:
removeDropClient in interface DropPaneContainer
Parameters:
client - Client to remove
See Also:
DropPaneContainer.removeDropClient(InteractionClient)

getDragDropPane

public DragDropPane getDragDropPane()
Description copied from interface: DropPaneContainer
Returns the drad and drop page of this container. This is simply a casted wrapper for getGlassPane ().

Specified by:
getDragDropPane in interface DropPaneContainer
See Also:
DropPaneContainer.getDragDropPane()

setDragDropPane

public void setDragDropPane(DragDropPane pane)
Description copied from interface: DropPaneContainer
Sets up the given drag and drop pane as glass pane of the container.

Specified by:
setDragDropPane in interface DropPaneContainer
Parameters:
pane - The new glass pane
See Also:
DropPaneContainer.setDragDropPane(DragDropPane)

getClassName

public java.lang.String getClassName()
Description copied from interface: Plugin
Returns the class name of the plugin.

Specified by:
getClassName in interface Plugin
Returns:
The name of the plugin class (the class that implements this interface)

getPluginResourceCollection

public ResourceCollection getPluginResourceCollection()
Description copied from interface: Plugin
Gets the plugin resource.

Specified by:
getPluginResourceCollection in interface Plugin

getLevel

public int getLevel()
Description copied from interface: Plugin
Returns the level of this plugin in the plugin tree. The level corresponds to the hierarchy level in the plugin tree. The level of a child plugin is always 1 higher as the level of its parent.

Specified by:
getLevel in interface Plugin
Returns:
The level with Plugin.LEVEL_APPLICATION being the lowest. Defaults to Plugin.LEVEL_PLUGIN.

getParentPlugin

public Plugin getParentPlugin()
Description copied from interface: Plugin
Returns the parent plugin of this plugin. Each plugin except ApplicationBase must have a parent.

Specified by:
getParentPlugin in interface Plugin
Returns:
Parent of this plugin or null in case of ApplicationBase

initializePlugin

public void initializePlugin()
Description copied from interface: Plugin
Initializes the plugin. Should only be called by the plugin manager.

Specified by:
initializePlugin in interface Plugin

getIcon

public MultiIcon getIcon()
Description copied from interface: Plugin
Gets the icon.

Specified by:
getIcon in interface Plugin

getSubTitle

public java.lang.String getSubTitle()
Description copied from interface: Plugin
Returns the sub title of this plugin. This defaults to the title itself.

Specified by:
getSubTitle in interface Plugin

getPeerGroup

public java.lang.Object getPeerGroup(java.lang.String key)
Description copied from interface: Plugin
Gets the peer group for the given group name.

Specified by:
getPeerGroup in interface Plugin
Parameters:
key - Name of the peer group
Returns:
The peer group or null if this group is not defined for the plugin

canClose

public boolean canClose()
Description copied from interface: Plugin
Checks, whether this plugin can be closed. Note that this method does not necessarily mean that the plugin WILL be closed. Overwrite this method to handle unsafe states or user interaction. Calling of this method is always followed by either preClose () or closeCanceled ().

Specified by:
canClose in interface Plugin
Returns:
True if this plugin can be closed right now

fireEvent

public boolean fireEvent(JaspiraEvent je)
Description copied from interface: Plugin
Fires the given event using the event queue.

Specified by:
fireEvent in interface Plugin
Parameters:
je - Event to fire
Returns:
true If the event was consumed by a plugin
false Otherwise

fireEvent

public boolean fireEvent(java.lang.String eventname)
Description copied from interface: Plugin
Creates a new client event using the given event name and fires it.

Specified by:
fireEvent in interface Plugin
Parameters:
eventname - Name of the event
Returns:
true If the event was consumed by a plugin
false Otherwise

fireEvent

public boolean fireEvent(java.lang.String eventname,
                         java.lang.Object data)
Description copied from interface: Plugin
Creates a new client event using the given event name and event object and fires it.

Specified by:
fireEvent in interface Plugin
Parameters:
eventname - Name of the event
data - Event object
Returns:
true If the event was consumed by a plugin
false Otherwise

getChildPlugins

public java.util.List getChildPlugins()
Description copied from interface: Plugin
Returns a list of all children of this plugin.

Specified by:
getChildPlugins in interface Plugin
Returns:
The child plugin list or null if there are no child plugins

getDescendantPlugins

public java.util.List getDescendantPlugins(java.util.List plugins)
Description copied from interface: Plugin
Returns a list of all children and further descendants of this plugin.

Specified by:
getDescendantPlugins in interface Plugin
Parameters:
plugins - The children of this plugin will be added to this list, if given
Returns:
The list argument or a new linked list if null

handleEvent

public boolean handleEvent(JaspiraEvent je)
Description copied from interface: Plugin
Tries to handles the event for this plugin without passing it on. Stackable events will be stacked.

Specified by:
handleEvent in interface Plugin
Parameters:
je - The event to handle
Returns:
true If the event was consumed by the plugin
false Otherwise

inheritEvent

public boolean inheritEvent(JaspiraEvent je)
Description copied from interface: Plugin
Receives an event incoming from a parent. This event is first passed down to the children, than handeled by the plugin itself. It is not passed upwards.

Specified by:
inheritEvent in interface Plugin
Parameters:
je - The event to handle
Returns:
true If the event was consumed by the plugin
false Otherwise

receiveEvent

public boolean receiveEvent(JaspiraEvent je)
Description copied from interface: Plugin
Handles an incoming event that is received from a child plugin. Passes this event to all other children if necessary (flood events).

Specified by:
receiveEvent in interface Plugin
Parameters:
je - The event to handle
Returns:
true If the event was consumed by the plugin
false Otherwise

setParentPlugin

public void setParentPlugin(Plugin plugin)
Description copied from interface: Plugin
Sets the parent plugin of this plugin. Each plugin except ApplicationBase must have a parent.

Specified by:
setParentPlugin in interface Plugin
Parameters:
plugin - New parent of this plugin or null in case of ApplicationBase

addPlugin

public void addPlugin(Plugin child)
Description copied from interface: Plugin
Adds a plugin as child plugin of this plugin.

Specified by:
addPlugin in interface Plugin
Parameters:
child - Child plugin to add

removePlugin

public void removePlugin(Plugin child)
Description copied from interface: Plugin
Removes a child plugin from this plugin.

Specified by:
removePlugin in interface Plugin
Parameters:
child - Child plugin to remove

stackEvent

public void stackEvent(JaspiraEvent je)
Description copied from interface: Plugin
Adds a stackable event to the event stack. If the event is already part of the stack, moves it to the end.

Specified by:
stackEvent in interface Plugin
Parameters:
je - The event to stack

containsStackedEvent

public boolean containsStackedEvent(java.lang.String eventName)
Description copied from interface: Plugin
Checks if the event stack contains a particular event.

Specified by:
containsStackedEvent in interface Plugin
Parameters:
eventName - Event to look for
Returns:
true The event stack contains an event of this type.
false The event stack does not contain such an event.

requestClose

public boolean requestClose()
Description copied from interface: Plugin
Request the plugin to be closed. The plugin should check whether this is currently possible an if so do it.

Specified by:
requestClose in interface Plugin
Returns:
true If the plugin has been closed
false Otherwise

addToPeerGroup

public void addToPeerGroup(java.lang.String key,
                           java.lang.Object group)
Description copied from interface: Plugin
Adds the plugin to a peer group given by key and object.

Specified by:
addToPeerGroup in interface Plugin
Parameters:
key - Peer group name
group - Peer group object

getDescription

public java.lang.String getDescription()
Description copied from interface: Plugin
Gets the description.

Specified by:
getDescription in interface Plugin

getPeerGroups

public java.util.Set getPeerGroups()
Description copied from interface: Plugin
Returns the peer groups this plugin has been added to.

Specified by:
getPeerGroups in interface Plugin
Returns:
A set of objects denoting the peer groups

getPeerGroupNames

public java.util.Set getPeerGroupNames()
Description copied from interface: Plugin
Returns the names of all peergroups that this plugin has been added to.

Specified by:
getPeerGroupNames in interface Plugin
Returns:
A set of strings (peer group names)

getUniqueId

public java.lang.String getUniqueId()
Description copied from interface: Plugin
Returns the unique id of this plugin.

Specified by:
getUniqueId in interface Plugin

getVendor

public java.lang.String getVendor()
Description copied from interface: Plugin
Gets the plugin vendor.

Specified by:
getVendor in interface Plugin

getVersion

public java.lang.String getVersion()
Description copied from interface: Plugin
Gets the plugin version.

Specified by:
getVersion in interface Plugin

getCondition

public java.lang.String getCondition()
Description copied from interface: Plugin
Gets the conditional expression that determines if the plugin should be active.

Specified by:
getCondition in interface Plugin

installPlugin

public void installPlugin()
Description copied from interface: Plugin
Installs the plugin and all its modules. Should only be called by the plugin manager.

Specified by:
installPlugin in interface Plugin

installFirstPlugin

public void installFirstPlugin()
Description copied from interface: Plugin
This template method is called before the first plugin instance of this kind is installed. Can be used to implement peer group behaviour.
Should only be called by the plugin manager.

Specified by:
installFirstPlugin in interface Plugin

matchesPeerGroup

public boolean matchesPeerGroup(java.lang.String key,
                                java.lang.Object group,
                                boolean strict)
Description copied from interface: Plugin
Check if the plugin is a member of the given peer group. Eithe the group or the group name must be given.

Specified by:
matchesPeerGroup in interface Plugin
Parameters:
key - Name of the peer group to check
group - Peer group to check
strict - true The peergroups must be exactly met.
false null as group on one side is sufficient.
Returns:
true If the peer group matches.
false Otherwise

matchesPeerGroups

public boolean matchesPeerGroups(Plugin plugin,
                                 boolean strict)
Description copied from interface: Plugin
Matches all peer groups of one plugin against another.

Specified by:
matchesPeerGroups in interface Plugin
Parameters:
plugin - Plugin to match agains this plugin
strict - true All peer groups must match.
false A single peer group must match.
Returns:
true If both plugins contain at least one common peergroup.
If the strict parameter is true, there may not be any different groups.
Plugins with empty peergroups ALWAYS match! false Otherwise

removeFromPeerGroup

public void removeFromPeerGroup(java.lang.String key)
Description copied from interface: Plugin
Removes the plugin from a peer group.

Specified by:
removeFromPeerGroup in interface Plugin
Parameters:
key - Peer group name

getPluginState

public PluginState getPluginState()
Description copied from interface: Plugin
Returns the state of this plugin.

Specified by:
getPluginState in interface Plugin

setPluginState

public void setPluginState(PluginState state)
Description copied from interface: Plugin
Rebuilds the state of the plugin using the given state object.

Specified by:
setPluginState in interface Plugin

uninstallPlugin

public void uninstallPlugin()
Description copied from interface: Plugin
Uninstalls the plugin and all of its modules. Should only be called by the plugin manager.

Specified by:
uninstallPlugin in interface Plugin

uninstallLastPlugin

public void uninstallLastPlugin()
Description copied from interface: Plugin
This is called after uninstall for the last instance has been uninstalled. Should only be called by the plugin manager.

Specified by:
uninstallLastPlugin in interface Plugin

getAction

public JaspiraAction getAction(java.lang.String name)
Description copied from interface: Plugin
This convenience method retrieves an action from the action manager.

Specified by:
getAction in interface Plugin
Parameters:
name - Action name
Returns:
The action or null if no such action exists

getEventActionNames

public java.util.List getEventActionNames()
Description copied from interface: Plugin
Gets a list of the action names of the event actions of this plugin.

Specified by:
getEventActionNames in interface Plugin
Returns:
A list of strings or null if this module does not contain action event handlers

windowGainedFocus

public void windowGainedFocus(java.awt.event.WindowEvent e)
Called when this frame gains the focus.

Specified by:
windowGainedFocus in interface java.awt.event.WindowFocusListener
See Also:
WindowFocusListener.windowGainedFocus(WindowEvent)

windowLostFocus

public void windowLostFocus(java.awt.event.WindowEvent e)
Called when this frame lost the focus.

Specified by:
windowLostFocus in interface java.awt.event.WindowFocusListener
See Also:
WindowFocusListener.windowLostFocus(WindowEvent)


Copyright © 2011. All Rights Reserved.