📄 jawetypes.java
字号:
} else if (el == WorkflowProcess.class) { if (workflowProcessTypes.size() > 0) { return ((JaWEType) workflowProcessTypes.get(0)).getTypeId(); } } return ""; } protected void loadTypes(Class typeClass, String name, List list, JaWEComponent controller, Properties properties) { List types = ResourceManager.getResourceStrings(properties, "JaWETypes." + name + ".Id.", false); String orderStr = properties.getProperty("JaWETypes." + name + ".Order", ""); String[] order = Utils.tokenize(orderStr, ","); for (int i = 0; i < order.length; i++) { order[i] = order[i].trim(); } if (order.length > 0) { List types2 = new ArrayList(); for (int i = 0; i < order.length; i++) { if (types.contains(order[i])) { types2.add(order[i]); } } for (int i = 0; i < types.size(); i++) { if (!types2.contains(types.get(i))) { types2.add(types.get(i)); } } types = types2; } for (int i = 0; i < types.size(); i++) { String id = ResourceManager.getResourceString(properties, "JaWETypes." + name + ".Id." + types.get(i)); if (id.trim().equals("")) { if (allTypesMapping.containsKey("JaWETypes." + name + ".Id." + types.get(i))) { String defId = (String) allTypesMapping.get("JaWETypes." + name + ".Id." + types.get(i)); JaWEType jtype = (JaWEType) allTypes.get(defId); if (list.contains(jtype)) { list.remove(jtype); } allTypes.remove(defId); } continue; } String dispName = null; ImageIcon icon = null; Color color = null; try { String langDepName = ResourceManager.getResourceString(properties, "JaWETypes." + name + ".LangDepName." + types.get(i)); dispName = controller.getSettings().getLanguageDependentString(langDepName); } catch (Exception e) { System.err.println("JaWETypes->locaTypes: Failed to load type " + typeClass + " for name " + name); } try { icon = new ImageIcon(ResourceManager.getResource(properties, "JaWETypes." + name + ".Icon." + types.get(i))); } catch (Exception e) { } try { color = Utils.getColor(ResourceManager.getResourceString(properties, "JaWETypes." + name + ".Color." + types.get(i))); } catch (Exception e) { } JaWEType jtype; if (allTypes.containsKey(id)) { jtype = (JaWEType) allTypes.get(id); if (list.contains(jtype)) list.remove(jtype); } else { jtype = new JaWEType(typeClass, id); if (color == null) color = Color.DARK_GRAY; } if (dispName != null) jtype.setDisplayName(dispName); if (icon != null) jtype.setIcon(icon); if (color != null) jtype.setColor(color); list.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes." + name + ".Id." + types.get(i), id); try { String templateXML = ResourceManager.getResourceString(properties, "JaWETypes." + name + "." + XPDL_TEMPLATE + "." + types.get(i)); if (templateXML != null && !templateXML.equals("")) { Document doc = parseDocument(templateXML, true); XMLElement tmpl = createTemplateElement(doc); templateMap.put(id, tmpl); } } catch (Exception e) { } } } protected void loadCollections(Properties properties, JaWEComponent controller) { loadCollection(Activities.class, "Activities", controller, properties); loadCollection(ActivitySets.class, "ActivitySets", controller, properties); loadCollection(Applications.class, "Applications", controller, properties); loadCollection(DataFields.class, "DataFields", controller, properties); loadCollection(ExternalPackages.class, "ExternalPackages", controller, properties); loadCollection(FormalParameters.class, "FormalParameters", controller, properties); loadCollection(Participants.class, "Participants", controller, properties); loadCollection(WorkflowProcesses.class, "Processes", controller, properties); loadCollection(Transitions.class, "Transitions", controller, properties); loadCollection(TypeDeclarations.class, "TypeDeclarations", controller, properties); } protected void loadCollection(Class typeClass, String name, JaWEComponent controller, Properties properties) { String id = ResourceManager.getResourceString(properties, "JaWETypes." + name + ".Id"); if (id == null) return; String dispName = ""; ImageIcon icon = null; Color color = Color.DARK_GRAY; try { String langDepName = ResourceManager.getResourceString(properties, "JaWETypes." + name + ".LangDepName"); dispName = controller.getSettings().getLanguageDependentString(langDepName); icon = new ImageIcon(ResourceManager.getResource(properties, "JaWETypes." + name + ".Icon")); color = Utils.getColor(ResourceManager.getResourceString(properties, "JaWETypes." + name + ".Color")); } catch (Exception e) { System.err.println("JaWETypes->loadCollection: Failed to load collection " + typeClass + " with name " + name); } JaWEType jtype = new JaWEType(typeClass, id, dispName, icon, color); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes." + name + ".Id", id); } public void loadDefault(JaWEComponent controller, Properties properties) { fullTemplateCheckForNonStandardTypes = new Boolean(properties.getProperty("JaWETypes.FullTemplateCheckForNonStandardTypes", "true")).booleanValue(); // check Activity String id; String dispName = ""; // defaults ImageIcon defIcon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/default.gif")); Color defColor = Color.LIGHT_GRAY; id = JaWEConstants.ACTIVITY_TYPE_NO; dispName = controller.getSettings().getLanguageDependentString("NoKey"); ImageIcon icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/genericactivity.gif")); Color color = new Color(187, 247, 190); JaWEType jtype = new JaWEType(Activity.class, id, dispName, icon, color); activityTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivityType.Id.no_impl", id); id = JaWEConstants.ACTIVITY_TYPE_TOOL; dispName = controller.getSettings().getLanguageDependentString("ToolKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/activitytool.gif")); color = new Color(225, 255, 225); jtype = new JaWEType(Activity.class, id, dispName, icon, color); activityTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivityType.Id.tool", id); id = JaWEConstants.ACTIVITY_TYPE_BLOCK; dispName = controller.getSettings().getLanguageDependentString("BlockActivityKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/blockactivity.gif")); color = new Color(197, 231, 235); jtype = new JaWEType(Activity.class, id, dispName, icon, color); activityTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivityType.Id.block", id); id = JaWEConstants.ACTIVITY_TYPE_ROUTE; dispName = controller.getSettings().getLanguageDependentString("RouteKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/routeactivity.gif")); color = new Color(251, 172, 172); jtype = new JaWEType(Activity.class, id, dispName, icon, color); activityTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivityType.Id.route", id); id = JaWEConstants.ACTIVITY_TYPE_SUBFLOW; dispName = controller.getSettings().getLanguageDependentString("SubFlowKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/subflowactivity.gif")); color = new Color(207, 208, 250); jtype = new JaWEType(Activity.class, id, dispName, icon, color); activityTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivityType.Id.subflow", id); id = JaWEConstants.ACTIVITY_SET_TYPE_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("ActivitySetKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/activityset.gif")); jtype = new JaWEType(ActivitySet.class, id, dispName, icon, defColor); activitySetTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActivitySetType.Id.default", id); id = JaWEConstants.ACTUAL_PARAMETER_DEFAULT; dispName = controller.getSettings() .getLanguageDependentString("ActualParameterKey"); jtype = new JaWEType(ActualParameter.class, id, dispName, defIcon, defColor); actualParameterTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ActualParameterType.Id.default", id); id = JaWEConstants.APPLICATION_TYPE_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("ApplicationKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/applications.gif")); jtype = new JaWEType(Application.class, id, dispName, icon, defColor); applicationTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ApplicationType.Id.default", id); id = JaWEConstants.DATA_FIELD_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("DataFieldKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/workflowrelevantdata.gif")); jtype = new JaWEType(DataField.class, id, dispName, icon, defColor); dataFieldTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.DataFieldType.Id.default", id); id = JaWEConstants.DEADLINE_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("DeadlineKey"); jtype = new JaWEType(Deadline.class, id, dispName, defIcon, defColor); deadlineTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.DeadlineType.Id.default", id); id = JaWEConstants.ENUMERATION_VALUE_DEFAULT; dispName = controller.getSettings() .getLanguageDependentString("EnumerationValueKey"); jtype = new JaWEType(EnumerationValue.class, id, dispName, defIcon, defColor); enumerationValueTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.EnumerationValueType.Id.default", id); id = JaWEConstants.EXTENDED_ATTRIBUTE_DEFAULT; dispName = controller.getSettings() .getLanguageDependentString("ExtendedAttributeKey"); jtype = new JaWEType(ExtendedAttribute.class, id, dispName, defIcon, defColor); extendedAttributeTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ExtendedAttributeType.Id.default", id); id = JaWEConstants.EXTERNAL_PACKAGE_DEFAULT; dispName = controller.getSettings() .getLanguageDependentString("ExternalPackageKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/externalpackages.gif")); jtype = new JaWEType(ExternalPackage.class, id, dispName, icon, defColor); externalPackageTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.ExternalPackageType.Id.default", id); id = JaWEConstants.FORMAL_PARAMETER_DEFAULT; dispName = controller.getSettings() .getLanguageDependentString("FormalParameterKey"); icon = new ImageIcon(JaWETypes.class.getClassLoader() .getResource("org/enhydra/jawe/images/formalparameters.gif")); jtype = new JaWEType(FormalParameter.class, id, dispName, icon, defColor); formalParameterTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.FormalParameterType.Id.default", id); id = JaWEConstants.MEMBER_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("MemberKey"); jtype = new JaWEType(Member.class, id, dispName, defIcon, defColor); memberTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.MemeberType.Id.default", id); id = JaWEConstants.NAMESPACE_DEFAULT; dispName = controller.getSettings().getLanguageDependentString("NamespaceKey"); jtype = new JaWEType(Namespace.class, id, dispName, defIcon, defColor); namespaceTypes.add(jtype); allTypes.put(id, jtype); allTypesMapping.put("JaWETypes.NamespaceType.Id.default", id);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -