16 package net.squiz.matrix.core;
19 import javax.swing.Icon;
32 private String typeCode;
33 private String name =
"";
34 private boolean instantiable;
35 private String version;
36 private String allowedAccess;
38 private Set childTypes;
39 private String[] menuPath =
new String[0];
40 private List screens =
new Vector();
46 this.typeCode = typeCode;
49 void setInfo(Element typeElement) {
50 name = typeElement.getAttribute(
"name");
51 instantiable = typeElement.getAttribute(
"instantiable").equals(
"1");
52 version = typeElement.getAttribute(
"version");
53 allowedAccess = typeElement.getAttribute(
"allowed_access");
54 String menuPath = typeElement.getAttribute(
"flash_menu_path");
56 if (!menuPath.trim().equals(
""))
57 this.menuPath = menuPath.split(
"/\\/");
59 NodeList screenNodes = typeElement.getChildNodes();
60 for (
int j = 0; j < screenNodes.getLength(); j++) {
61 if (!(screenNodes.item(j) instanceof Element))
63 Element screenElement = (Element) screenNodes.item(j);
64 String codeName = screenElement.getAttribute(
"code_name");
65 String screenName = screenElement.getFirstChild().getNodeValue();
66 addScreen(codeName, screenName);
77 if (!instantiable || allowedAccess.equals(
"system"))
138 private void addScreen(String codeName, String name) {
148 return screens.iterator();
159 public boolean isAncestor(
AssetType parentType) {
161 while (child != null) {
162 if (child.
equals(parentType))
169 public boolean isAncestor(String assetType) {
170 return isAncestor(AssetManager.getAssetType(assetType));
178 this.parentType = parentType;
186 return typeCode.hashCode();
189 public String toString() {
200 return (((AssetType) obj).typeCode.equals(typeCode));