org.openbp.jaspira.gui.plugin
Class PluginDivider

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 org.openbp.swing.components.JMultiSplitPane
                      extended by org.openbp.jaspira.gui.plugin.PluginDivider
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, InteractionClient, PluginContainer

public class PluginDivider
extends JMultiSplitPane
implements PluginContainer, InteractionClient

This class is a container for Plugins. It contains a number of Slots. each slot can contain eihter a single plugin or a pluginCOntainer.

Author:
Stephan Moritz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Fields inherited from class org.openbp.swing.components.JMultiSplitPane
HORIZONTAL_SPLIT, VERTICAL_SPLIT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PluginDivider()
          Constructor.
PluginDivider(int orientation)
          Constructor.
 
Method Summary
 void addContainer(PluginContainer pc)
          Inserts a child plugin container at the end of this divider (right or bottom).
 void addPlugin(VisiblePlugin p)
          Wraps a TabbedPluginContainer around a plugin panel and adds it.
 void dragActionTriggered(java.lang.Object regionId, java.awt.Point p)
          We do not react to any action events per default.
 void dragEnded(java.awt.datatransfer.Transferable transferable)
          We do not react to any drag events per default.
 void dragStarted(java.awt.datatransfer.Transferable transferable)
          We do not react to any drag events per default.
 VisiblePlugin getActivePlugin()
          Returns the currently active plugin.
 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 getDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Right now, a plugin divider has no regions
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 JaspiraPage getPage()
          Returns the page level parent plugin of this plugin.
 PluginContainer getParentContainer()
          Returns our parent container.
 java.util.List getPlugins()
          Returns all plugins of this component
 java.util.List getSubClients()
          Returns all sub clients.
 java.util.List getVisiblePlugins()
          Returns all plugins that are currently visible, i\.e\. shown in their tabbed containers.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports the data from the given DragAwareRegion.
 void insertContainerAt(PluginContainer pc, int slot)
          Adds a child plugin container.
 void removePlugin(VisiblePlugin p)
          Removes the given plugin.
 void sliceContainer(PluginContainer toInsert, PluginContainer currentContainer, java.lang.String constraint)
          Slices the component at the given edge, i\.e\. replaces the entry with a new PluginDivider consisting of the old component and the new container.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class org.openbp.swing.components.JMultiSplitPane
addClient, addClient, addClientAfter, addClientBefore, componentHidden, componentMoved, componentResized, componentShown, createDefaultProportions, getClient, getClientCount, getClientProportions, getClients, getIndexOfClient, getOrientation, insertAllClients, layoutDividers, main, removeClient, removeClient, replaceClient, replaceClient, setClientProportions
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginDivider

public PluginDivider()
Constructor.


PluginDivider

public PluginDivider(int orientation)
Constructor.

Parameters:
orientation - Orientation of the container (JMultiSplitPane.VERTICAL_SPLIT/JMultiSplitPane.HORIZONTAL_SPLIT)
Method Detail

toString

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

Overrides:
toString in class JMultiSplitPane

addPlugin

public void addPlugin(VisiblePlugin p)
Wraps a TabbedPluginContainer around a plugin panel and adds it.

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

addContainer

public void addContainer(PluginContainer pc)
Inserts a child plugin container at the end of this divider (right or bottom).

Parameters:
pc - Container to add

insertContainerAt

public void insertContainerAt(PluginContainer pc,
                              int slot)
Adds a child plugin container.

Parameters:
pc - Container to add
slot - Slot to add the plugin into

sliceContainer

public void sliceContainer(PluginContainer toInsert,
                           PluginContainer currentContainer,
                           java.lang.String constraint)
Description copied from interface: PluginContainer
Slices the component at the given edge, i\.e\. replaces the entry with a new PluginDivider consisting of the old component and the new container.

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

removePlugin

public void removePlugin(VisiblePlugin p)
Removes the given plugin.

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

getActivePlugin

public VisiblePlugin getActivePlugin()
Returns the currently active plugin. Not yet implemented.

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

getParentContainer

public PluginContainer getParentContainer()
Returns our parent container.

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

getPlugins

public java.util.List getPlugins()
Returns all plugins of this component

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

getVisiblePlugins

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

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

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

dragStarted

public void dragStarted(java.awt.datatransfer.Transferable transferable)
We do not react to any drag events per default.

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

dragEnded

public void dragEnded(java.awt.datatransfer.Transferable transferable)
We do not react to any drag events per default.

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

dragActionTriggered

public void dragActionTriggered(java.lang.Object regionId,
                                java.awt.Point p)
We do not react to any action events per default.

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

getDropRegions

public java.util.List getDropRegions(java.util.List flavors,
                                     java.awt.datatransfer.Transferable data,
                                     java.awt.event.MouseEvent mouseEvent)
Right now, a plugin divider has no regions

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)

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)

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

importData

public boolean importData(java.lang.Object regionId,
                          java.awt.datatransfer.Transferable data,
                          java.awt.Point p)
Imports the data from the given DragAwareRegion.

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:
Always false

getSubClients

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

Specified by:
getSubClients in interface InteractionClient
Returns:
A list of the components (clients) of this divider


Copyright © 2011. All Rights Reserved.