Browse Source

GUIPrism, GUIPlugin: Provide onInitComponentsCompleted hook for plugins

Allows to take action once all plugins and the GUIPrism initComponents have completed.
accumulation-v4.7
Joachim Klein 7 years ago
committed by Dave Parker
parent
commit
a328b64748
  1. 8
      prism/src/userinterface/GUIPlugin.java
  2. 9
      prism/src/userinterface/GUIPrism.java

8
prism/src/userinterface/GUIPlugin.java

@ -246,6 +246,14 @@ public abstract class GUIPlugin extends JPanel implements GUIEventListener, Pris
* @param e A GUIEvent from elsewhere in the userinterface.
*/
public abstract boolean processGUIEvent(GUIEvent e);
/**
* Hook that is called for each GUIPlugin after the GUI startup has completed.
*/
public void onInitComponentsCompleted()
{
// default: do nothing
}
/** Loads an XML tree stored in 'c'.
* @param c The XML tree

9
prism/src/userinterface/GUIPrism.java

@ -180,7 +180,7 @@ public class GUIPrism extends JFrame
private PrismLog theLog;
//gui components
private ArrayList plugs;
private ArrayList<GUIPlugin> plugs;
private JTabbedPane theTabs;
private GUIPlugin logPlug;
private GUIEventHandler eventHandle;
@ -283,8 +283,7 @@ public class GUIPrism extends JFrame
});
//Setup pluggable screens in here
plugs = getPluginArray(this);
for (int i = 0; i < plugs.size(); i++) {
GUIPlugin plug = (GUIPlugin) plugs.get(i);
for (GUIPlugin plug : plugs) {
if (plug.displaysTab()) {
theTabs.addTab(plug.getTabText(), plug);
theTabs.setEnabledAt(theTabs.getComponentCount() - 1, plug.isEnabled());
@ -397,6 +396,10 @@ public class GUIPrism extends JFrame
setIconImage(GUIPrism.getIconFromImage("smallPrism.png").getImage());
getContentPane().setSize(new java.awt.Dimension(800, 600));
pack();
for (GUIPlugin plug : plugs) {
plug.onInitComponentsCompleted();
}
}
public void passCLArgs(String args[])

Loading…
Cancel
Save