📄 cardleveltagsdesigner.java
字号:
int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 4, end + 1); } start = s.indexOf("class=\""); if (start > -1) { start = start + 7; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 7, end + 1); } start = s.indexOf("xml:lang=\""); if (start > -1) { start = start + 10; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 10, end + 1); } setUserObject(s); } } /** * This class encapsulates a goNode. It takes care of its own data * and provides mehtods for accessing and updating the data. */ private class goNode extends EnhancedTreeNode { private String href, charset, method, sendref, cache, enctype, extra; /** * Constructs a new Node of type "go." */ public goNode() { super("", "go"); setUserObject(""); setAllowsChildren(true); // postfield, setvar href = ""; charset = ""; method = "N/A"; sendref = "N/A"; cache = "N/A"; enctype = "N/A"; extra = ""; updateNode(); } /** * Sets the data for the Node from a Vector. * @param Vector v - the data to be set. */ public void setData(Vector v) { href = (String) v.get(0); charset = (String) v.get(1); method = (String) v.get(2); sendref = (String) v.get(3); cache = (String) v.get(4); enctype = (String) v.get(5); extra = (String) v.get(6); } /** *Gets the data of the Node and returns it as a Vector. * @return Vector v - the data in the following format:<br> * href<br> * accept-charset<br> * method<br> * sendreferer<br> * cache-control<br> * enctype<br> * extra */ public Vector getData() { Vector v = new Vector(); v.add(href); v.add(charset); v.add(method); v.add(sendref); v.add(cache); v.add(enctype); v.add(extra); return v; } public String getHref() { return href; } public String getCharset() { return charset; } public String getMethod() { return method; } public String getSendref() { return sendref; } public String getCache() { return cache; } public String getEnctype() { return enctype; } public String getExtra() { return extra; } /** * Updates the Node's data and visual component. */ public void updateNode() { String s = "<go"; if (!href.equals("")) s = s + " href=\"" + href + "\""; if (!charset.equals("")) s = s + " accept-charset=\"" + charset + "\""; if (!method.equals("N/A")) s = s + " method=\"" + method + "\""; if (!sendref.equals("N/A")) s = s + " sendreferer=\"" + sendref + "\""; if (!cache.equals("N/A")) s = s + " cache-control=\"" + cache + "\""; if (!enctype.equals("N/A")) s = s + " enctype=\"" + enctype + "\""; if (extra.length() > 0) s = s + " " + extra.trim(); s = s + ">"; setUserObject(s); } /** * Updates a node data from a String. * @param String s - the data to update the node with. */ public void updateNode(String s) { href = ""; charset = ""; method = "N/A"; sendref = "N/A"; cache = "N/A"; enctype = "N/A"; extra = ""; int start = s.indexOf("href"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); href = s.substring(start + 1, end); } } } start = s.indexOf("accept-charset"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); charset = s.substring(start + 1, end); } } } start = s.indexOf("method"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); method = s.substring(start + 1, end); } } } start = s.indexOf("sendreferer"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); sendref = s.substring(start + 1, end); } } } start = s.indexOf("cache-control"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); cache = s.substring(start + 1, end); } } } start = s.indexOf("enctype"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); enctype = s.substring(start + 1, end); } } } start = s.indexOf("id=\""); if (start > -1) { start = start + 4; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 4, end + 1); } start = s.indexOf("class=\""); if (start > -1) { start = start + 7; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 7, end + 1); } start = s.indexOf("xml:lang=\""); if (start > -1) { start = start + 10; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 10, end + 1); } setUserObject(s); } } /** * This class encapsulates a oneventNode. It takes care of its own data * and provides mehtods for accessing and updating the data. */ protected class oneventNode extends EnhancedTreeNode { private String type, extra; /** * Constructs a new Node of type "onevent." */ public oneventNode() { super("", "onevent"); setUserObject(""); setAllowsChildren(true); // same as do type = "ontimer"; extra = ""; updateNode(); } /** * Constructs a new Node of type "onevent" and initializes its type * @param String type - the type of the onevent: * onenterforward<br> * onenterbackward<br> * ontimer<br> * onpick */ public oneventNode(String s) { super("", "onevent"); setUserObject(""); setAllowsChildren(true); // same as do type = s; updateNode("<onevent type=\"" + s + "\">"); } /** * Sets the data for the Node from a Vector. * @param Vector v - the data to be set. */ public void setData(Vector v) { type = (String) v.get(0); extra = (String) v.get(1); } /** * Gets the data of the Node and returns it as a Vector. * @return Vector v - the data in the following format:<br> * type<br> * extra */ public Vector getData() { Vector v = new Vector(); v.add(type); v.add(extra); return v; } public String getType() { return type; } public String getExtra() { return extra; } /** * Updates the Node's data and visual component. */ public void updateNode() { String s = "<onevent"; if (!type.equals("N/A")) s = s + " type=\"" + type + "\""; if (extra.length() > 0) s = s + " " + extra.trim(); s = s + ">"; setUserObject(s); } /** * Updates a node data from a String. * @param String s - the data to update the node with. */ public void updateNode(String s) { type = "N/A"; extra = ""; int start = s.indexOf("type"); if (start > -1) { start = s.indexOf("=" , start + 1); if (start > -1) { start = s.indexOf("\"" , start + 1); if (start > -1) { int end = s.indexOf("\"" , start + 1); if (end < 0) end = s.length(); type = s.substring(start + 1, end); } } } start = s.indexOf("id=\""); if (start > -1) { start = start + 4; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 4, end + 1); } start = s.indexOf("class=\""); if (start > -1) { start = start + 7; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 7, end + 1); } start = s.indexOf("xml:lang=\""); if (start > -1) { start = start + 10; int end = s.indexOf("\"", start); extra = extra + " " + s.substring(start - 10, end + 1); } setUserObject(s); } } /** * This class encapsulates a timerNode. It takes care of its own data * and provides mehtods for accessing and updating the data. */ private class timerNode extends EnhancedTreeNode { private String value, name, extra; /** * Constructs a new Node of type "timer." */ public timerNode() { super("", "timer"); setUserObject(""); setAllowsChildren(false); value = "50"; name = ""; extra = ""; updateNode(); } /** * Sets the data for the Node from a Vector. * @param Vector v - the data to be set. */ public void setData(Vector v) { value = (String) v.get(0); name = (String) v.get(1); extra = (String) v.get(2); } /** *Gets the data of the Node and returns it as a Vector. * @return Vector v - the data in the following format:<br> * value<br> * name<br> * extra */ public Vector getData() { Vector v = new Vector(); v.add(value); v.add(name); v.add(extra); return v; } public String getValue() { return value; } public String getName() { return name; } public String getExtra() { return extra; } /** * Updates the Node's data and visual component. */ public void updateNode() { String s = "<timer"; if (!value.equals("")) s = s + " value=\"" + value + "\""; if (!name.equals("")) s = s + " name=\"" + name + "\""; if (extra.length() > 0) s = s + " " + extra.trim(); s = s + "/>"; setUserObject(s); } /** * Updates a node data from a String. * @param String s - the data to update the node with. */ public void updateNode(String s) { value = ""; name = ""; extra = ""; int start = s.indexOf("value");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -