📄 componentmanager.java
字号:
componentMap.put(jc.getName(), jc); treeComponentAdded = true; } catch (Throwable thr) { if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) { JaWEManager.getInstance() .getLoggingManager() .error("ComponentManager -> error while adding JaWE component " + component + "!", thr); } } } } // other components String ocomp = ResourceManager.getResourceString(properties, "Other.ComponentOrder"); String[] ocomps = Utils.tokenize(ocomp, " "); for (int i = 0; i < ocomps.length; i++) { int pos = shoudBeAdded(compToAdd, ocomps[i]); if (pos != -1) { compToAdd.remove(pos); String component = ResourceManager.getResourceString(properties, "Component.Add." + ocomps[i]); String settings = ResourceManager.getResourceString(properties, "Settings." + ocomps[i]); try { JaWEComponentSettings set = (JaWEComponentSettings) cl.loadClass(settings) .newInstance(); set.setPropertyMgr(propertyMgr); Constructor c = Class.forName(component).getConstructor(new Class[] { JaWEComponentSettings.class }); JaWEComponent jc = (JaWEComponent) c.newInstance(new Object[] { set }); jc.setType(JaWEComponent.OTHER_COMPONENT); registerComponents(jc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component " + jc.getName() + " added to JaWE"); componentMap.put(jc.getName(), jc); } catch (Throwable thr) { if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) { JaWEManager.getInstance() .getLoggingManager() .error("ComponentManager -> error while adding JaWE component " + component + "!", thr); } } } } for (int i = 0; i < compToAdd.size(); i++) { String component = ResourceManager.getResourceString(properties, "Component.Add." + compToAdd.get(i)); String settings = ResourceManager.getResourceString(properties, "Settings." + compToAdd.get(i)); try { JaWEComponentSettings set = (JaWEComponentSettings) cl.loadClass(settings) .newInstance(); set.setPropertyMgr(propertyMgr); Constructor c = Class.forName(component).getConstructor(new Class[] { JaWEComponentSettings.class }); JaWEComponent jc = (JaWEComponent) c.newInstance(new Object[] { set }); registerComponents(jc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component " + jc.getName() + " added to JaWE"); componentMap.put(jc.getName(), jc); } catch (Throwable thr) { if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) { JaWEManager.getInstance() .getLoggingManager() .error("ComponentManager -> error while adding JaWE component " + component + "!", thr); } } } String upperComponent = ResourceManager.getResourceString(properties, "UpperStatus"); String upperSettings = ResourceManager.getResourceString(properties, "UpperStatus.Settings"); if (null != upperComponent && !"".equals(upperComponent)) { try { JaWEComponentSettings set = (JaWEComponentSettings) cl.loadClass(upperSettings) .newInstance(); set.setPropertyMgr(propertyMgr); Constructor c = Class.forName(upperComponent).getConstructor(new Class[] { JaWEComponentSettings.class }); JaWEComponent jc = (JaWEComponent) c.newInstance(new Object[] { set }); jc.setType(JaWEComponent.UPPER_STATUS_COMPONENT); registerComponents(jc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component " + jc.getName() + " added to JaWE"); componentMap.put(jc.getName(), jc); } catch (Throwable thr) { if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) { JaWEManager.getInstance() .getLoggingManager() .error("ComponentManager -> error while adding JaWE component " + upperComponent + "!", thr); } } } String lowerComponent = ResourceManager.getResourceString(properties, "LowerStatus"); String lowerSettings = ResourceManager.getResourceString(properties, "LowerStatus.Settings"); if (null != lowerComponent && !"".equals(lowerComponent)) { try { JaWEComponentSettings set = (JaWEComponentSettings) cl.loadClass(lowerSettings) .newInstance(); set.setPropertyMgr(propertyMgr); Constructor c = Class.forName(lowerComponent).getConstructor(new Class[] { JaWEComponentSettings.class }); JaWEComponent jc = (JaWEComponent) c.newInstance(new Object[] { set }); jc.setType(JaWEComponent.LOWER_STATUS_COMPONENT); registerComponents(jc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component " + jc.getName() + " added to JaWE"); componentMap.put(jc.getName(), jc); } catch (Throwable thr) { if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) { JaWEManager.getInstance() .getLoggingManager() .error("ComponentManager -> error while adding JaWE component " + lowerComponent + "!", thr); } } } } else { initDefault(); } if (!treeComponentAdded && JaWE.getJaWEVersion() == JaWE.COMMUNITY_VERSION) { try { SimpleNavigator snc = new SimpleNavigator(new SimpleNavigatorSettings()); addComponent(snc); registerComponents(snc); } catch (Exception ex) { String msg = "ComponentManager --> Problems while instantiating SimpleNavigator - working without it!"; JaWEManager.getInstance().getLoggingManager().error(msg, ex); } } JaWEManager.getInstance().getJaWEController().getJaWEFrame().rearrangeFrame(); } protected int shoudBeAdded(List compList, String compName) { if (compName == null) return -1; for (int i = 0; i < compList.size(); i++) { String name = (String) compList.get(i); if (compName.equals(name)) return i; } return -1; } protected void initDefault() { try { GraphController gc = new GraphController(new GraphSettings()); addComponent(gc); registerComponents(gc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component "+ gc.getName() + " added to JaWE"); } catch (Exception ex) { String msg = "ComponentManager --> Problems while instantiating GraphController - working without it!"; JaWEManager.getInstance().getLoggingManager().error(msg, ex); } try { XPDLViewController xpdlc = new XPDLViewController(new XPDLViewSettings()); addComponent(xpdlc); registerComponents(xpdlc); JaWEManager.getInstance() .getLoggingManager() .debug("ComponentManager -> component "+ xpdlc.getName() + " added to JaWE"); } catch (Exception ex) { String msg = "ComponentManager --> Problems while instantiating XPDLViewController - working without it!"; JaWEManager.getInstance().getLoggingManager().error(msg, ex); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -