org.freehep.application.studio
Class Studio

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.freehep.application.Application
                      extended by org.freehep.application.mdi.MDIApplication
                          extended by org.freehep.application.studio.Studio
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Studio
extends MDIApplication

Swing application that supports plugins.

Version:
$Id: Studio.java 15975 2014-05-08 21:08:33Z onoprien $
Author:
tonyj
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.freehep.application.Application
Application.ApplicationCommandProcessor, Application.AppPrintPreview, Application.InitializationException, Application.InitializationListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
Field Summary
static String LOADDIR
           
 
Fields inherited from class org.freehep.application.mdi.MDIApplication
TOOLBAR_AUTO, TOOLBAR_DEFAULT, TOOLBAR_INVISIBLE, TOOLBAR_PROGRAM, TOOLBAR_VISIBLE
 
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
 EventSender getEventSender()
           
 ExtensionClassLoader getExtensionLoader()
           
 String getExtensionsDir(PluginDir dir)
          Returns a path to the specified extension directory.
 String getGroupExtensionsDir()
          Deprecated. 
 org.freehep.util.FreeHEPLookup getLookup()
           
 PluginInfo getPlugin(String name)
          Returns plugin descriptor from the list of loaded plugins with the specified name.
 PluginMap getPluginMap()
          Returns a map of installed plugins.
 List<PluginInfo> getPlugins()
          Return a list of loaded plugins.
 String getSystemExtensionsDir()
          Deprecated. 
 String getUserExtensionsDir()
          Deprecated. 
 boolean isBlacklisted(PluginInfo plugin)
          Returns true if the specified plugin is blacklisted and should be ignored by this application.
 boolean isLoaded(File file)
          Returns true if the specified file is on the extension loader classpath.
 boolean loadPlugins(Collection<PluginInfo> plugins)
          Loads and initializes the specified plugins using the default extensions class loader.
 boolean loadPlugins(Collection<PluginInfo> plugins, ExtensionClassLoader loader)
          Loads and initializes the specified plugins.
static void main(String[] args)
           
 void reportPluginException()
          Reports the latest exception thrown while loading plugins, if any.
 void startPlugin(PluginInfo plugin)
          Starts and initializes a plugin.
 void stopPlugin(PluginInfo plugin)
          Stops a plugin.
 
Methods inherited from class org.freehep.application.mdi.MDIApplication
addToolBar, addToolBar, getConsoleManager, getControlManager, getPageManager, removeToolBar, selectedPageManager, setConsoleManager, setControlManager, setPageManager, setSelectedPageManager
 
Methods inherited from class org.freehep.application.Application
about, addApplicationListener, createFrame, createPrintPreview, error, error, error, error, error, error, exit, getApplication, getAppName, getAppProperties, getCommandLine, getCommandProcessor, getCommandTargetManager, getFullVersion, getMenuBar, getRecentFileList, getServiceManager, getShowStatusBar, getShowToolBar, getStatusBar, getToolBarHolder, getUserProperties, getVersion, getXMLMenuBuilder, removeApplicationListener, restart, setLookAndFeel, setShowStatusBar, setShowToolBar, setStatusMessage, showDialog, showHelpContents, showHelpIndex, showHelpSearch, showHelpTopic, showHelpTopic, updateComponentTreeUI, updateUI, versionNumberCompare, whenAvailable
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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
 

Field Detail

LOADDIR

public static final String LOADDIR
See Also:
Constant Field Values
Method Detail

main

public static void main(String[] args)

isBlacklisted

public boolean isBlacklisted(PluginInfo plugin)
Returns true if the specified plugin is blacklisted and should be ignored by this application.


isLoaded

public boolean isLoaded(File file)
Returns true if the specified file is on the extension loader classpath.


getEventSender

public EventSender getEventSender()

getLookup

public final org.freehep.util.FreeHEPLookup getLookup()

getUserExtensionsDir

@Deprecated
public String getUserExtensionsDir()
Deprecated. 


getGroupExtensionsDir

@Deprecated
public String getGroupExtensionsDir()
Deprecated. 


getSystemExtensionsDir

@Deprecated
public String getSystemExtensionsDir()
Deprecated. 


getExtensionsDir

public String getExtensionsDir(PluginDir dir)
Returns a path to the specified extension directory.

We look for extensions:

The following defaults apply if the property is not specified
  • USER: {user.home}/.FreeHEPPlugins
  • GROUP: none
  • SYSTEM: {java.home}/.FreeHEPPlugins


  • getExtensionLoader

    public ExtensionClassLoader getExtensionLoader()

    getPlugins

    public List<PluginInfo> getPlugins()
    Return a list of loaded plugins.


    getPlugin

    public PluginInfo getPlugin(String name)
    Returns plugin descriptor from the list of loaded plugins with the specified name. Returns null if there is no loaded plugin with matching name.


    getPluginMap

    public PluginMap getPluginMap()
    Returns a map of installed plugins.


    reportPluginException

    public void reportPluginException()
    Reports the latest exception thrown while loading plugins, if any. Clears stored exception so subsequent calls to this method will do nothing unless new plugin loading failures happen.


    stopPlugin

    public void stopPlugin(PluginInfo plugin)
    Stops a plugin. Calls stop() method on the specified plugin and removes a reference to a Plugin object from the PluginInfo. The PluginInfo object supplied as an argument is used to identify a loaded plugin with the same name. If no matching loaded plugin is found, this method returns immediately without doing anything.

    Throws:
    IllegalArgumentException - if the plugin cannot be shut down.

    startPlugin

    public void startPlugin(PluginInfo plugin)
                     throws Throwable
    Starts and initializes a plugin. Loads the plugin class with the extension class loader, creates an instance, and calls its initialization methods The PluginInfo object supplied as an argument is used to identify a loaded plugin with the same name. If no matching loaded plugin is found, this method returns immediately without doing anything.

    Throws:
    Throwable - Re-throws any exceptions thrown by the plugin class code.

    loadPlugins

    public boolean loadPlugins(Collection<PluginInfo> plugins)
    Loads and initializes the specified plugins using the default extensions class loader.

    Returns:
    True if at least one plugin was not loaded due to presence of an identically named loaded plugin.

    loadPlugins

    public boolean loadPlugins(Collection<PluginInfo> plugins,
                               ExtensionClassLoader loader)
    Loads and initializes the specified plugins.

    Returns:
    True if at least one plugin was not loaded due to presence of an identically named loaded plugin.


    Copyright © 2000-2014 FreeHEP. All Rights Reserved.