|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
unbbayes.gui.UnBBayesFrame
public class UnBBayesFrame
This class extends JFrame
and it is responsible for
the UnBBayes main panel.
JFrame
,
Serialized FormNested Class Summary | |
---|---|
protected class |
UnBBayesFrame.ActionListenerSupportingConstructorParam
Inner class for action listener, supporting constructor's param. |
class |
UnBBayesFrame.ListenerCloserFrame
|
class |
UnBBayesFrame.OpenFileUsingModulesActionListener
A listener for opening an existing file using plugins/modules. |
protected class |
UnBBayesFrame.SplitButtonMenuActionListener
This is just an action listener for menu items inserted within the getPluginSplitButton()
or getToolsSplitButton() . |
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected IconController |
iconController
|
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 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 | |
---|---|
UnBBayesFrame(MainController _controller)
Build the main program frame, adjusting the layouts and building the buttons, labels, and others elements of the interface. |
Method Summary | |
---|---|
void |
addWindow(JInternalFrame newWindow)
Adds a new window. |
void |
addWindow(UnBBayesModule newModule)
Adds a new window/module. |
void |
assignActionListeners()
Method responsible for assigning ActionListeners to all buttons available. |
protected Map<String,List<JComponent>> |
buildModuleCategoryToComponentsMap()
This method is called inside the constructor in order to initialize the map, which is to be stored at getModuleCategoryToComponentsMap() . |
void |
createActionListeners()
Method responsible for creating all ActionListeners needed. |
void |
createButtons()
Create the needed buttons and add their respectinve tool tip. |
void |
createMenu()
Method responsible for creating the menu used in this class, JFrame. |
protected void |
createPluginMenu()
This method is used whithin loadPlugins() in order to create the "Plugin" menu. |
protected void |
createPluginToolBars()
This method is used whithin loadPlugins() in order to instantiate the "Plugin" tool bars. |
void |
createToolBars()
Call the method for creating the needed buttons and then create the tool bars and add the buttons to them and finally to the topPanel. |
protected Map<String,Class> |
fillCorePluginMenuAndButtons(org.java.plugin.PluginManager pluginManager,
org.java.plugin.registry.ExtensionPoint point)
Fills up the menu and tool tip buttons using #getPluginManager() . |
String[] |
getAllSupportedFileExtensions(Collection<Class> plugins)
Obtains all file extensions (with no dots) that a list of plugins can handle. |
MainController |
getController()
|
Map<String,Class> |
getCoreUnBBayesModulesClasses()
Obtains the classes of modules' builders (UnBBayesModuleBuilder) which are part of core implementation of unbbayes. |
MDIDesktopPane |
getDesktop()
|
static UnBBayesFrame |
getIUnBBayes()
|
JToolBar |
getJtbFile()
|
JToolBar |
getJtbNew()
|
JToolBar |
getJtbTools()
|
Map<JComponent,JComponent> |
getMapOfComponentsToBeRemovedAtPluginReload()
It stores all modules' components which was not added into the default plugin split button. |
JMenuBar |
getMenu()
|
Map<String,List<JComponent>> |
getModuleCategoryToComponentsMap()
It maps a module category into a menu |
JMenu |
getNewMenu()
This is a sub menu where functionalities like "new BN" or "new MSBN" resides. |
Map<String,Class> |
getPluginMap()
Connected, loaded and activated extensions. |
JMenu |
getPluginMenu()
|
JPopupMenu.Separator |
getPluginMenuSeparator()
This separator separates the "reload plugin" option from other plugins |
String |
getPluginModuleExtensionPoint()
The main extension point of the core plugin (Module). |
SplitToggleButton |
getPluginSplitButton()
This is the split button containing buttons to start plugin-based modules. |
JToolBar |
getPluginToolBar()
|
JMenuItem |
getReloadPluginsItem()
|
JMenu |
getSamplingMenu()
This is a sub menu where sampling modules resides. |
JInternalFrame |
getSelectedWindow()
Returns the selected window. |
JMenu |
getToolsMenu()
This is a menu where tools (e.g. |
SplitToggleButton |
getToolsSplitButton()
|
UnBBayesModule |
getUnBBayesModuleByPluginClass(Class clazz)
Use the parameter "clazz" in order to instantiate a new UnBBayesModule (in this case, "clazz" must provide a default constructor) or as a UnBBayesModuleBuilder (which by UnBBayesModuleBuilder.buildUnBBayesModule() we get the proper UnBBayesModule). |
protected String |
getUnBBayesModuleNameByPluginClass(Class pluginOrBuilderCls)
Extracts the module's name from its class (the class can be a builder or the module itself). |
Map<String,UnBBayesModule> |
getUnBBayesModulesByFile(File file,
Map<String,Class> plugins)
Obtains all modules that can treat a specific file (it looks mainly at file extension) at loading time. |
UnBBayesPluginContextHolder |
getUnbbayesPluginContextHolder()
|
void |
loadPlugins()
Creates the plugin manager, loads UnBBayes' core plugins using JPF, fills the menu items and tool bar's buttons and their listeners. |
protected void |
reloadPlugins()
This method is called when we press the "reload plugin" menu. |
protected void |
removePluginButtonsFromOtherComponents(Map<JComponent,JComponent> map)
This method will use map in order to remove all keys from its mapped object. |
void |
setController(MainController controller)
|
void |
setDesktop(MDIDesktopPane desktop)
|
void |
setJtbNew(JToolBar jtbNew)
|
void |
setJtbTools(JToolBar jtbTools)
|
void |
setMapOfComponentsToBeRemovedAtPluginReload(Map<JComponent,JComponent> listOfBNModulesAtFileJTB)
It stores all modules' components which was not added into the default plugin split button. |
void |
setMenu(JMenuBar menu)
|
void |
setModuleCategoryToComponentsMap(Map<String,List<JComponent>> moduleCategoryToComponentsMap)
It maps a module category into a menu |
void |
setPluginList(Map<String,Class> pluginMap)
Connected, loaded and activated extensions. |
void |
setPluginMenu(JMenu pluginMenu)
|
void |
setPluginMenuSeparator(JPopupMenu.Separator pluginMenuSeparator)
This separator separates the "reload plugin" option from other plugins |
void |
setPluginModuleExtensionPoint(String pluginModuleExtensionPoint)
The main extension point of the core plugin (Module). |
void |
setPluginSplitButton(SplitToggleButton pluginSplitButton)
This is the split button containing buttons to start plugin-based modules. |
void |
setPluginToolBar(JToolBar pluginToolBar)
|
void |
setReloadPluginsItem(JMenuItem reloadPluginsItem)
|
void |
setToolsSplitButton(SplitToggleButton toolsSplitButton)
|
void |
setUnbbayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
|
void |
showPluginDependencyError()
This method displays a dialog if a plugin with dependency error is detected. |
protected void |
updatePluginMenuVisibility()
Hide plugin menu or tool bar if it is empty |
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.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
protected IconController iconController
Constructor Detail |
---|
public UnBBayesFrame(MainController _controller)
ActionListener
,
MouseListener
,
KeyListener
Method Detail |
---|
protected void updatePluginMenuVisibility()
public JInternalFrame getSelectedWindow()
public void addWindow(JInternalFrame newWindow)
newWindow
- nova janela.public void addWindow(UnBBayesModule newModule)
newWindow
- new module to add.public void createActionListeners()
public void createMenu()
protected Map<String,List<JComponent>> buildModuleCategoryToComponentsMap()
getModuleCategoryToComponentsMap()
.
It uses the default menus ("new", "sampling", "tool" and "plugins")
setModuleCategoryToComponentsMap(Map)
getModuleCategoryToComponentsMap()
,
setModuleCategoryToComponentsMap(Map).
protected void createPluginToolBars()
loadPlugins()
in order to instantiate the "Plugin" tool bars.
It does not actually fill the tool bar, since the plugins must be loaded after the creation of the
toolbar.
It is only a initializer.
The contents are created at fillCorePluginMenuAndButtons(PluginManager, ExtensionPoint)
protected void createPluginMenu()
loadPlugins()
in order to create the "Plugin" menu.
It does not actually fill the menu with plugins, since the plugins must be loaded after the creation of the
menu.
It is only a initializer.
The contents are created at fillCorePluginMenuAndButtons(PluginManager, ExtensionPoint)
protected void reloadPlugins()
getMapOfComponentsToBeRemovedAtPluginReload()
,
resets the menu bar, refills the getModuleCategoryToComponentsMap()
,
reloads plugins, updates the menu's visibility (if no plugin is present, some menus and toolbars are hidden),
and finally notifies reload action to UnBBayesPluginContextHolder.notifyReload(Object)
using
this UnBBayesFrame as parameter.
public Map<String,Class> getCoreUnBBayesModulesClasses()
public void showPluginDependencyError()
public void loadPlugins()
protected Map<String,Class> fillCorePluginMenuAndButtons(org.java.plugin.PluginManager pluginManager, org.java.plugin.registry.ExtensionPoint point)
#getPluginManager()
.
pluginManager
- : manager to usepoint:
- extension point to be read in order to fill menu and buttons.
protected String getUnBBayesModuleNameByPluginClass(Class pluginOrBuilderCls)
UnBBayesModule.getModuleName()
or
UnBBayesModuleBuilder.getName()
to do so.
pluginOrBuilderCls
- a class of UnBBayesModule
or UnBBayesModuleBuilder
public UnBBayesModule getUnBBayesModuleByPluginClass(Class clazz) throws InstantiationException, IllegalAccessException
UnBBayesModuleBuilder.buildUnBBayesModule()
we get the proper UnBBayesModule).
clazz
- : class extending UnBBayesModule
or implementing UnBBayesModuleBuilder
IllegalAccessException
InstantiationException
addWindow(JInternalFrame)
public void createToolBars()
protected void removePluginButtonsFromOtherComponents(Map<JComponent,JComponent> map)
map
- public void createButtons()
public void assignActionListeners()
public static UnBBayesFrame getIUnBBayes()
public JToolBar getPluginToolBar()
public void setPluginToolBar(JToolBar pluginToolBar)
pluginToolBar
- the pluginToolBar to setpublic JMenu getPluginMenu()
public void setPluginMenu(JMenu pluginMenu)
pluginMenu
- the pluginMenu to setpublic String getPluginModuleExtensionPoint()
public void setPluginModuleExtensionPoint(String pluginModuleExtensionPoint)
pluginModuleExtensionPoint
- the module's extension ID to setpublic Map<String,Class> getPluginMap()
UnBBayesModule
or UnBBayesModuleBuilder
public void setPluginList(Map<String,Class> pluginMap)
UnBBayesModule
or UnBBayesModuleBuilder
pluginMap
- the pluginMap to setpublic JMenuBar getMenu()
public void setMenu(JMenuBar menu)
menu
- the menu to setpublic JMenuItem getReloadPluginsItem()
public void setReloadPluginsItem(JMenuItem reloadPluginsItem)
reloadPluginsMenuItem
- the reloadPluginsMenuItem to setpublic Map<String,UnBBayesModule> getUnBBayesModulesByFile(File file, Map<String,Class> plugins)
IPersistenceAwareWindow.getIO()
can do the job by using BaseIO.save(File, unbbayes.prs.Graph)
.
file
- : file to be loaded.plugins
- : a map of classes extending UnBBayesModule. The keys are the plugin/module IDs.
public String[] getAllSupportedFileExtensions(Collection<Class> plugins)
plugins
- : a list of classes extending UnBBayesModule or its builder (UnBBayesModuleBuilder)
BaseIO.getSupportedFileExtensions(boolean)
public UnBBayesPluginContextHolder getUnbbayesPluginContextHolder()
public void setUnbbayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
unbbayesPluginContextHolder
- the unbbayesPluginContextHolder to setpublic SplitToggleButton getPluginSplitButton()
getPluginToolBar()
public void setPluginSplitButton(SplitToggleButton pluginSplitButton)
getPluginToolBar()
pluginSplitButton
- the pluginSplitButton to setpublic JMenu getNewMenu()
public JMenu getToolsMenu()
public JMenu getSamplingMenu()
public JToolBar getJtbFile()
public Map<String,List<JComponent>> getModuleCategoryToComponentsMap()
public void setModuleCategoryToComponentsMap(Map<String,List<JComponent>> moduleCategoryToComponentsMap)
moduleCategoryToComponentsMap
- the moduleCategoryToJMenuMap to setpublic JPopupMenu.Separator getPluginMenuSeparator()
public void setPluginMenuSeparator(JPopupMenu.Separator pluginMenuSeparator)
pluginMenuSeparator
- the pluginMenuSeparator to setpublic Map<JComponent,JComponent> getMapOfComponentsToBeRemovedAtPluginReload()
public void setMapOfComponentsToBeRemovedAtPluginReload(Map<JComponent,JComponent> listOfBNModulesAtFileJTB)
mapOfComponentsToBeRemovedAtPluginReload
- the mapOfComponentsToBeRemovedAtPluginReload to setgetJtbFile()
public JToolBar getJtbNew()
public void setJtbNew(JToolBar jtbNew)
jtbNew
- the jtbNew to setpublic MainController getController()
public void setController(MainController controller)
controller
- the controller to setpublic MDIDesktopPane getDesktop()
public void setDesktop(MDIDesktopPane desktop)
desktop
- the desktop to setpublic JToolBar getJtbTools()
public void setJtbTools(JToolBar jtbTools)
jtbTools
- the jtbTools to setpublic SplitToggleButton getToolsSplitButton()
public void setToolsSplitButton(SplitToggleButton toolsSplitButton)
toolsSplitButton
- the toolsSplitButton to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |