📄 guioptionimpl.java
字号:
return locationY; } public void setLocationY(String locationY) { this.locationY = locationY; zeus_LocationYSet = true; } public String getLocationX() { if(locationX == null) return ""; else return locationX; } public void setLocationX(String locationX) { this.locationX = locationX; zeus_LocationXSet = true; } public String getFontName() { if(fontName == null) return ""; else return fontName; } public void setFontName(String fontName) { this.fontName = fontName; zeus_FontNameSet = true; } public String getHeight() { if(height == null) return ""; else return height; } public void setHeight(String height) { this.height = height; zeus_HeightSet = true; } public String getBold() { if(bold == null) return ""; else return bold; } public void setBold(String bold) throws IllegalArgumentException { if (!zeus_BoldInitialized) { zeus_validBold = new java.util.Vector(); zeus_validBold.addElement("true"); zeus_validBold.addElement("false"); zeus_BoldInitialized = true; } if (!zeus_validBold.contains(bold)) { throw new IllegalArgumentException("Illegal value for attribute 'bold'"); } else { this.bold = bold; this.zeus_BoldSet = true; } } public String getWidth() { if(width == null) return ""; else return width; } public void setWidth(String width) { this.width = width; zeus_WidthSet = true; } public String getShowViewBar() { if(showViewBar == null) return ""; else return showViewBar; } public void setShowViewBar(String showViewBar) throws IllegalArgumentException { if (!zeus_ShowViewBarInitialized) { zeus_validShowViewBar = new java.util.Vector(); zeus_validShowViewBar.addElement("true"); zeus_validShowViewBar.addElement("false"); zeus_ShowViewBarInitialized = true; } if (!zeus_validShowViewBar.contains(showViewBar)) { throw new IllegalArgumentException("Illegal value for attribute 'showViewBar'"); } else { this.showViewBar = showViewBar; this.zeus_ShowViewBarSet = true; } } public String getShowTip() { if(showTip == null) return ""; else return showTip; } public void setShowTip(String showTip) throws IllegalArgumentException { if (!zeus_ShowTipInitialized) { zeus_validShowTip = new java.util.Vector(); zeus_validShowTip.addElement("true"); zeus_validShowTip.addElement("false"); zeus_ShowTipInitialized = true; } if (!zeus_validShowTip.contains(showTip)) { throw new IllegalArgumentException("Illegal value for attribute 'showTip'"); } else { this.showTip = showTip; this.zeus_ShowTipSet = true; } } public String getSmallFace() { if(smallFace == null) return ""; else return smallFace; } public void setSmallFace(String smallFace) throws IllegalArgumentException { if (!zeus_SmallFaceInitialized) { zeus_validSmallFace = new java.util.Vector(); zeus_validSmallFace.addElement("true"); zeus_validSmallFace.addElement("false"); zeus_SmallFaceInitialized = true; } if (!zeus_validSmallFace.contains(smallFace)) { throw new IllegalArgumentException("Illegal value for attribute 'smallFace'"); } else { this.smallFace = smallFace; this.zeus_SmallFaceSet = true; } } public void setDocType(String name, String publicID, String systemID) { try { startDTD(name, publicID, systemID); } catch (SAXException neverHappens) { } } public void setOutputEncoding(String outputEncoding) { this.outputEncoding = outputEncoding; } public void marshal(File file) throws IOException { // Delegate to the marshal(Writer) method if (outputEncoding != null) { marshal(new OutputStreamWriter(new FileOutputStream(file), outputEncoding)); } else { marshal(new OutputStreamWriter(new FileOutputStream(file), "utf-8")); } } public void marshal(OutputStream outputStream) throws IOException { // Delegate to the marshal(Writer) method if (outputEncoding != null) { marshal(new OutputStreamWriter(outputStream, outputEncoding)); } else { marshal(new OutputStreamWriter(outputStream, "utf-8")); } } public void marshal(Writer writer) throws IOException { // Write out the XML declaration writer.write("<?xml version=\"1.0\" "); if (outputEncoding != null) { writer.write("encoding=\""); writer.write(outputEncoding); writer.write("\"?>\n\n"); } else { writer.write("encoding=\"UTF-8\"?>\n\n"); } // Handle DOCTYPE declaration writer.write(docTypeString); writer.write("\n"); // Now start the recursive writing writeXMLRepresentation(writer, ""); // Close up writer.flush(); writer.close(); } protected void writeXMLRepresentation(Writer writer, String indent) throws IOException { writer.write(indent); writer.write("<GUIOption"); // Handle namespace mappings (if needed) for (Iterator i = namespaceMappings.keySet().iterator(); i.hasNext(); ) { String prefix = (String)i.next(); String uri = (String)namespaceMappings.get(prefix); writer.write(" xmlns"); if (!prefix.trim().equals("")) { writer.write(":"); writer.write(prefix); } writer.write("=\""); writer.write(uri); writer.write("\"\n "); } // Handle attributes (if needed) if (zeus_BlueSet) { writer.write(" blue=\""); writer.write(escapeAttributeValue(blue)); writer.write("\""); } if (zeus_OnlineTipLocationYSet) { writer.write(" onlineTipLocationY=\""); writer.write(escapeAttributeValue(onlineTipLocationY)); writer.write("\""); } if (zeus_OnlineTipLocationXSet) { writer.write(" onlineTipLocationX=\""); writer.write(escapeAttributeValue(onlineTipLocationX)); writer.write("\""); } if (zeus_FontSizeSet) { writer.write(" fontSize=\""); writer.write(escapeAttributeValue(fontSize)); writer.write("\""); } if (zeus_GroupBackgroundSet) { writer.write(" groupBackground=\""); writer.write(escapeAttributeValue(groupBackground)); writer.write("\""); } if (zeus_ItalicSet) { writer.write(" italic=\""); writer.write(escapeAttributeValue(italic)); writer.write("\""); } if (zeus_ShowOnlineTipSet) { writer.write(" showOnlineTip=\""); writer.write(escapeAttributeValue(showOnlineTip)); writer.write("\""); } if (zeus_RedSet) { writer.write(" red=\""); writer.write(escapeAttributeValue(red)); writer.write("\""); } if (zeus_AutoHideSet) { writer.write(" autoHide=\""); writer.write(escapeAttributeValue(autoHide)); writer.write("\""); } if (zeus_ShowNickSet) { writer.write(" showNick=\""); writer.write(escapeAttributeValue(showNick)); writer.write("\""); } if (zeus_GreenSet) { writer.write(" green=\""); writer.write(escapeAttributeValue(green)); writer.write("\""); } if (zeus_ShowOnlineOnlySet) { writer.write(" showOnlineOnly=\""); writer.write(escapeAttributeValue(showOnlineOnly)); writer.write("\""); } if (zeus_LocationYSet) { writer.write(" locationY=\""); writer.write(escapeAttributeValue(locationY)); writer.write("\""); } if (zeus_LocationXSet) { writer.write(" locationX=\""); writer.write(escapeAttributeValue(locationX)); writer.write("\""); } if (zeus_FontNameSet) { writer.write(" fontName=\""); writer.write(escapeAttributeValue(fontName)); writer.write("\""); } if (zeus_HeightSet) { writer.write(" height=\""); writer.write(escapeAttributeValue(height)); writer.write("\""); } if (zeus_BoldSet) { writer.write(" bold=\""); writer.write(escapeAttributeValue(bold)); writer.write("\""); } if (zeus_WidthSet) { writer.write(" width=\""); writer.write(escapeAttributeValue(width)); writer.write("\""); } if (zeus_ShowViewBarSet) { writer.write(" showViewBar=\""); writer.write(escapeAttributeValue(showViewBar)); writer.write("\""); } if (zeus_ShowTipSet) { writer.write(" showTip=\""); writer.write(escapeAttributeValue(showTip)); writer.write("\""); } if (zeus_SmallFaceSet) { writer.write(" smallFace=\""); writer.write(escapeAttributeValue(smallFace)); writer.write("\""); } writer.write("/>\n"); } private String escapeAttributeValue(String attributeValue) { String returnValue = attributeValue; for (int i = 0; i < returnValue.length(); i++) { char ch = returnValue.charAt(i); if (ch < 0x20) { if ( (ch != 0x09) && (ch != 0x0a) && (ch != 0x0d) ) { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append(' ') .append(returnValue.substring(i+1)) .toString(); } } else if (ch == '"') { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append(""") .append(returnValue.substring(i+1)) .toString(); } else if (ch == '&') { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append("&") .append(returnValue.substring(i+1)) .toString(); } else if (ch == '>') { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append(">") .append(returnValue.substring(i+1)) .toString(); } else if (ch == '<') { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append("<") .append(returnValue.substring(i+1)) .toString(); } } return returnValue; } private String escapeTextValue(String textValue) { String returnValue = textValue; for (int i = 0; i < returnValue.length(); i++) { char ch = returnValue.charAt(i); if (ch < 0x20) { if ( (ch != 0x09) && (ch != 0x0a) && (ch != 0x0d) ) { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append(' ') .append(returnValue.substring(i+1)) .toString(); } } else if (ch == '<') { returnValue = new StringBuffer() .append(returnValue.substring(0, i)) .append("<") .append(returnValue.substring(i+1)) .toString(); } else if (ch == '&') {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -