rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
strokeDesc.setText(mapper.getKeyStrokeDesc( macro));
setKeyInformation(macro);
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += ".alt2"; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } if (altKey) strokeDescAlt.setText(mapper.getKeyStrokeDesc( stroke)); else strokeDesc.setText(mapper.getKeyStrokeDesc( stroke)); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); strokeDesc.setText(mapper.getKeyStrokeDesc( macro)); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue());// k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
if (altKey) k += KeyStroker.altSuffix;
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += ".alt2"; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } if (altKey) strokeDescAlt.setText(mapper.getKeyStrokeDesc( stroke)); else strokeDesc.setText(mapper.getKeyStrokeDesc( stroke)); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); strokeDesc.setText(mapper.getKeyStrokeDesc( macro)); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue());// k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
strokeDesc.setText(mapper.getKeyStrokeDesc(k));
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += ".alt2"; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } if (altKey) strokeDescAlt.setText(mapper.getKeyStrokeDesc( stroke)); else strokeDesc.setText(mapper.getKeyStrokeDesc( stroke)); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); strokeDesc.setText(mapper.getKeyStrokeDesc( macro)); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue());// k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
setKeyInformation(k);
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += ".alt2"; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } if (altKey) strokeDescAlt.setText(mapper.getKeyStrokeDesc( stroke)); else strokeDesc.setText(mapper.getKeyStrokeDesc( stroke)); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); strokeDesc.setText(mapper.getKeyStrokeDesc( macro)); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue());// k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
public byte[] getINodeTableBlock(int blockNo) throws FileSystemException, IOException{
public synchronized byte[] getINodeTableBlock(int blockNo) throws FileSystemException, IOException{
public byte[] getINodeTableBlock(int blockNo) throws FileSystemException, IOException{ if(blockNo < blockCount) return fs.getBlock(firstBlock+blockNo); else throw new FileSystemException("Trying to get block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
public byte[] getInodeData(int index) throws IOException, FileSystemException{
public synchronized byte[] getInodeData(int index) throws IOException, FileSystemException{
public byte[] getInodeData(int index) throws IOException, FileSystemException{ byte data[] = new byte[INode.INODE_LENGTH]; int indexCopied = 0; while(indexCopied<INode.INODE_LENGTH) { int blockNo = (index*INode.INODE_LENGTH+indexCopied) / blockSize; int blockOffset = (index*INode.INODE_LENGTH+indexCopied) % blockSize; int copyLength = Math.min(blockSize-blockOffset, INode.INODE_LENGTH); System.arraycopy( getINodeTableBlock(blockNo), blockOffset, data, indexCopied, copyLength); indexCopied+=copyLength; } return data; }
public void writeINodeTableBlock(byte[] data, int blockNo) throws FileSystemException, IOException {
public synchronized void writeINodeTableBlock(byte[] data, int blockNo) throws FileSystemException, IOException {
public void writeINodeTableBlock(byte[] data, int blockNo) throws FileSystemException, IOException { if(blockNo < blockCount) fs.writeBlock(firstBlock+blockNo, data, false); else throw new FileSystemException("Trying to write block #"+blockNo+ "of an inode table that only has "+blockCount+" blocks"); }
public void writeInodeData(int index, byte[] data) throws IOException, FileSystemException {
public synchronized void writeInodeData(int index, byte[] data) throws IOException, FileSystemException {
public void writeInodeData(int index, byte[] data) throws IOException, FileSystemException { int indexCopied = 0; while(indexCopied<INode.INODE_LENGTH) { int blockNo = (index*INode.INODE_LENGTH+indexCopied) / blockSize; int blockOffset = (index*INode.INODE_LENGTH+indexCopied) % blockSize; int copyLength = Math.min(blockSize-blockOffset, INode.INODE_LENGTH); byte[] originalBlock = getINodeTableBlock(blockNo); System.arraycopy( data, indexCopied, originalBlock, blockOffset, copyLength); indexCopied+=copyLength; writeINodeTableBlock(originalBlock, blockNo); } }
checkValidInput();
public void insertString(DocumentFilter.FilterBypass bypass, int offset, String text, AttributeSet attributes) throws BadLocationException { super.insertString(bypass, offset, text, attributes); commitIfAllowed(); }
checkValidInput();
public void remove(DocumentFilter.FilterBypass bypass, int offset, int length) throws BadLocationException { super.remove(bypass, offset, length); commitIfAllowed(); }
checkValidInput();
public void replace(DocumentFilter.FilterBypass bypass, int offset, int length, String text, AttributeSet attributes) throws BadLocationException { super.replace(bypass, offset, length, text, attributes); commitIfAllowed(); }
throw new BAD_OPERATION("Invalid enumeration code " + code);
BAD_OPERATION bad = new BAD_OPERATION("Invalid state " + code); bad.minor = Minor.Enumeration; throw bad;
public static State from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid enumeration code " + code); } }
+ "when allocation area is empty.", 5);
+ "when allocation area is empty.", pos);
public Shape modelToView(int pos, Shape a, Bias b) throws BadLocationException { Rectangle rect = a.getBounds(); // Throwing a BadLocationException is an observed behavior of the RI. if (rect.isEmpty()) throw new BadLocationException("Unable to calculate view coordinates " + "when allocation area is empty.", 5); Segment s = getLineBuffer(); int lineHeight = metrics.getHeight(); // Return a rectangle with width 1 and height equal to the height // of the text rect.height = lineHeight; rect.width = 1; int currLineStart = getStartOffset(); int end = getEndOffset(); if (pos < currLineStart || pos >= end) throw new BadLocationException("invalid offset", pos); while (true) { int currLineEnd = calculateBreakPosition(currLineStart, end); // If pos is between currLineStart and currLineEnd then just find // the width of the text from currLineStart to pos and add that // to rect.x if (pos >= currLineStart && pos < currLineEnd) { try { getDocument().getText(currLineStart, pos - currLineStart, s); } catch (BadLocationException ble) { // Shouldn't happen } rect.x += Utilities.getTabbedTextWidth(s, metrics, rect.x, WrappedPlainView.this, currLineStart); return rect; } // Increment rect.y so we're checking the next logical line rect.y += lineHeight; // Increment currLineStart to the model position of the start // of the next logical line if (currLineEnd == currLineStart) currLineStart = end; else currLineStart = currLineEnd; } }
if (lh != null) { if (currEnd == end) lh.paintLayeredHighlights(g, currStart, currEnd - 1, s, tc, this); else lh.paintLayeredHighlights(g, currStart, currEnd, s, tc, this); }
public void paint(Graphics g, Shape s) { Rectangle rect = s.getBounds(); int end = getEndOffset(); int currStart = getStartOffset(); int currEnd; int count = 0; while (currStart < end) { currEnd = calculateBreakPosition(currStart, end); drawLine(currStart, currEnd, g, rect.x, rect.y + metrics.getAscent()); rect.y += lineHeight; if (currEnd == currStart) currStart ++; else currStart = currEnd; count++; } if (count != numLines) { numLines = count; preferenceChanged(this, false, true); } }
return Utilities.getBreakLocation(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, p0);
return p0 + Utilities.getBreakLocation(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, 0);
protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); int li = getLeftInset(); int ti = getTopInset(); Rectangle alloc = new Rectangle(li, ti, getWidth()-getRightInset()-li, getHeight()-getBottomInset()-ti); // Mimic a behavior observed in the RI. if (alloc.isEmpty()) return 0; updateMetrics(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch (BadLocationException ble) { // this shouldn't happen throw new InternalError("Invalid offsets p0: " + p0 + " - p1: " + p1); } if (wordWrap) return Utilities.getBreakLocation(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, p0); else return p0 + Utilities.getTabbedTextOffset(lineBuffer, metrics, alloc.x, alloc.x + alloc.width, this, 0, true); }
return getAddress() + ": " + getLHS().toString() + " = " + phi.toString();
if (isDeadCode()) { return getAddress() + ": " + " nop (pruned phi)"; } else { return getAddress() + ": " + getLHS() + " = " + phi; }
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + phi.toString(); }
double value;
double value = 0;
public double parse() throws NumberFormatException { if (index >= chars.length) throw new NumberFormatException(); char sign = '+'; switch (chars[index]) { case '-': sign = '-'; index++; break; case '+': sign = '+'; index++; break; } if (index >= chars.length) throw new NumberFormatException(); double value; if (chars[index] == '.') { index++; value = parseFractionalPart(true); value = parseExponent(value); } else { value = parseUnsignedInt(); if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException(); index++; value += parseFractionalPart(false); value = parseExponent(value); } return (sign == '-') ? -value : value; }
if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException();
if (index < chars.length){ if(chars[index] == '.'){ index++; value += parseFractionalPart(false); } }
public double parse() throws NumberFormatException { if (index >= chars.length) throw new NumberFormatException(); char sign = '+'; switch (chars[index]) { case '-': sign = '-'; index++; break; case '+': sign = '+'; index++; break; } if (index >= chars.length) throw new NumberFormatException(); double value; if (chars[index] == '.') { index++; value = parseFractionalPart(true); value = parseExponent(value); } else { value = parseUnsignedInt(); if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException(); index++; value += parseFractionalPart(false); value = parseExponent(value); } return (sign == '-') ? -value : value; }
index++;
public double parse() throws NumberFormatException { if (index >= chars.length) throw new NumberFormatException(); char sign = '+'; switch (chars[index]) { case '-': sign = '-'; index++; break; case '+': sign = '+'; index++; break; } if (index >= chars.length) throw new NumberFormatException(); double value; if (chars[index] == '.') { index++; value = parseFractionalPart(true); value = parseExponent(value); } else { value = parseUnsignedInt(); if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException(); index++; value += parseFractionalPart(false); value = parseExponent(value); } return (sign == '-') ? -value : value; }
value += parseFractionalPart(false);
public double parse() throws NumberFormatException { if (index >= chars.length) throw new NumberFormatException(); char sign = '+'; switch (chars[index]) { case '-': sign = '-'; index++; break; case '+': sign = '+'; index++; break; } if (index >= chars.length) throw new NumberFormatException(); double value; if (chars[index] == '.') { index++; value = parseFractionalPart(true); value = parseExponent(value); } else { value = parseUnsignedInt(); if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException(); index++; value += parseFractionalPart(false); value = parseExponent(value); } return (sign == '-') ? -value : value; }
if(obj.attribType == Constants.NUMBER_TYPE) {
if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) {
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); for (int i = 0; i < attribHash.size(); i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// it's an obj ref, add to list Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item);
else { if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); }
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); for (int i = 0; i < attribHash.size(); i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// it's an obj ref, add to list Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
if (!XMLDeclAttribs.isEmpty()) {
if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) {
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE);
if ((sPrettyXDFOutput) && (pcdata == null) && (childObjs.size() !=0)) writeOut(outputstream, Constants.NEW_LINE);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (sPrettyXDFOutput) writeOut(outputstream, indent);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE);
writeOut(outputstream, "</"+nodeNameString + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ;
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
return bus.writeMouseCommand(CMD_DISABLE);
return bus.writeMouseCommands(CMD_DISABLE, null, 0);
protected boolean disablePointer() throws DeviceException { log.debug("disablePointer"); return bus.writeMouseCommand(CMD_DISABLE); }
return bus.writeMouseCommand(CMD_ENABLE);
return bus.writeMouseCommands(CMD_ENABLE, null, 0);
protected boolean enablePointer() throws DeviceException { log.debug("enablePointer"); return bus.writeMouseCommand(CMD_ENABLE); }
if (!bus.writeMouseCommand(CMD_GET_ID)) {
if (!bus.writeMouseCommands(CMD_GET_ID, null, 1)) {
protected int getPointerId() throws DriverException { try { if (!bus.writeMouseCommand(CMD_GET_ID)) { throw new DriverException("Cannot request Pointer ID"); } return channel.read(50); } catch (DeviceException ex) { throw new DriverException("Error in requesting Pointer ID", ex); } catch (IOException ex) { throw new DriverException("Error in requesting Pointer ID", ex); } catch (TimeoutException ex) { throw new DriverException("Timeout in requesting Pointer ID", ex); } catch (InterruptedException ex) { throw new DriverException("Interrupted in requesting Pointer ID", ex); } }
return bus.writeMouseCommands(new int[] { CMD_SET_RATE, samples });
return bus.writeMouseCommands(CMD_SET_RATE, new int[] { samples }, 0);
protected boolean setRate(int samples) throws DeviceException { return bus.writeMouseCommands(new int[] { CMD_SET_RATE, samples }); }
bus.processQueues();
bus.flush();
protected synchronized void startDevice() throws DriverException { irq = bus.claimResources(getDevice(), MOUSE_IRQ); try { // Set the mode setEnabled(true); } catch (DeviceException ex) { throw new DriverException("Cannot enable keyboard", ex); } super.startDevice(); // Make sure all queues are empty bus.processQueues(); final PointerInterpreter interpreter = getPointerInterpreter(); if (interpreter != null) { interpreter.reset(); } }
firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, this.model);
firePropertyChange("model", oldModel, this.model);
public void setModel(SingleSelectionModel model) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, this.model); } }
firePropertyChange(TAB_LAYOUT_POLICY_CHANGED_PROPERTY, oldPolicy, layoutPolicy);
firePropertyChange("tabLayoutPolicy", oldPolicy, layoutPolicy);
public void setTabLayoutPolicy(int tabLayoutPolicy) { if (tabLayoutPolicy != SCROLL_TAB_LAYOUT && tabLayoutPolicy != WRAP_TAB_LAYOUT) throw new IllegalArgumentException("tabLayoutPolicy is not valid."); if (tabLayoutPolicy != layoutPolicy) { int oldPolicy = layoutPolicy; layoutPolicy = tabLayoutPolicy; firePropertyChange(TAB_LAYOUT_POLICY_CHANGED_PROPERTY, oldPolicy, layoutPolicy); } }
firePropertyChange(TAB_PLACEMENT_CHANGED_PROPERTY, oldPlacement, this.tabPlacement);
firePropertyChange("tabPlacement", oldPlacement, this.tabPlacement);
public void setTabPlacement(int tabPlacement) { if (tabPlacement != TOP && tabPlacement != BOTTOM && tabPlacement != RIGHT && tabPlacement != LEFT) throw new IllegalArgumentException("tabPlacement is not valid."); if (tabPlacement != this.tabPlacement) { int oldPlacement = this.tabPlacement; this.tabPlacement = tabPlacement; firePropertyChange(TAB_PLACEMENT_CHANGED_PROPERTY, oldPlacement, this.tabPlacement); } }
repaint();
session.repaint();
public void addSessionView(String tabText,Session session) { if (hideTabBar && sessionPane.getTabCount() == 0 && !embedded) { this.getContentPane().add(session, BorderLayout.CENTER); session.grabFocus(); session.resizeMe(); repaint(); if (packFrame) pack(); else validate(); embedded = true; } else { if (hideTabBar && sessionPane.getTabCount() == 0 ) { Session ses = null; for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { ses = (Session)(this.getContentPane().getComponent(x)); this.getContentPane().remove(x); break; } } //ses = (Session)(this.getContentPane().getComponent(0)); sessionPane.addTab(tabText,focused,ses); ses.grabFocus(); ses.resizeMe(); repaint(); if (ses.getAllocDeviceName() != null) sessionPane.setTitleAt(0,ses.getAllocDeviceName()); else sessionPane.setTitleAt(0,ses.getSessionName()); ses.addSessionListener(this); ses.addSessionJumpListener(this); this.getContentPane().add(sessionPane, BorderLayout.CENTER); } sessionPane.addTab(tabText,focused,session); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.black); sessionPane.setIconAt(sessionPane.getSelectedIndex(),unfocused); sessionPane.setSelectedIndex(sessionPane.getTabCount()-1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); session.addSessionListener(this); session.addSessionJumpListener(this); session.grabFocus(); session.resizeMe(); repaint(); } }
return (sessionPane.indexOfComponent(session) >= 0);
if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { return ((Session)getContentPane().getComponent(x)).equals(session); } } return false; } else return (sessionPane.indexOfComponent(session) >= 0);
public boolean containsSession(Session session) { return (sessionPane.indexOfComponent(session) >= 0); }
return (Session)sessionPane.getComponentAt(index);
if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { return (Session)getContentPane().getComponent(x); } } return null; } else return (Session)sessionPane.getComponentAt(index);
public Session getSessionAt( int index) { return (Session)sessionPane.getComponentAt(index); }
return sessionPane.getTabCount();
if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < this.getContentPane().getComponentCount(); x++) { if (this.getContentPane().getComponent(x) instanceof Session) { return 1; } } return 0; } else return sessionPane.getTabCount();
public int getSessionViewCount() { return sessionPane.getTabCount(); }
int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--;
if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) {
public void removeSessionView(Session targetSession) { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } }
if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus();
if (getContentPane().getComponent(x) instanceof Session) { getContentPane().remove(x); } }
public void removeSessionView(Session targetSession) { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } }
if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus();
int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus();
public void removeSessionView(Session targetSession) { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } }
reindex();
super.removeUpdate(event);
protected void removeUpdate(DefaultDocumentEvent event) { reindex(); super.removeUpdate(event); }
super.removeUpdate(event);
int p0 = event.getOffset(); int p1 = event.getLength() + p0; int len = event.getLength(); int i1 = rootElement.getElementIndex(p0); int i2 = rootElement.getElementIndex(p1); if (i1 != i2) { Element el1 = rootElement.getElement(i1); Element el2 = rootElement.getElement(i2); int start = el1.getStartOffset(); int end = el2.getEndOffset(); Element newEl = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, start, end - len); rootElement.replace(start, end - start, new Element[]{ newEl }); } else { LeafElement el1 = (LeafElement) rootElement.getElement(i1); el1.end -= len; } for (int i = rootElement.getElementIndex(p0) + 1; i < rootElement.getElementCount(); i++) { LeafElement el = (LeafElement) rootElement.getElement(i); el.start -= len; el.end -= len; }
protected void removeUpdate(DefaultDocumentEvent event) { reindex(); super.removeUpdate(event); }
getContainer().repaint();
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Shape newAlloc = adjustAllocation(shape); super.removeUpdate(ev, newAlloc, vf); }
getContainer().repaint();
public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Shape newAlloc = adjustAllocation(shape); super.insertUpdate(ev, newAlloc, vf); }
getContainer().repaint();
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Shape newAlloc = adjustAllocation(shape); super.removeUpdate(ev, newAlloc, vf); }
throw new UnsupportedOperationException("hash with no ID");
throw new UnsupportedOperationException("hash with no OID: " + name);
public static final EMSA_PKCS1_V1_5 getInstance(final String mdName) { final IMessageDigest hash = HashFactory.getInstance(mdName); final String name = hash.name(); if (!(name.equals(Registry.MD2_HASH) || name.equals(Registry.MD5_HASH) || name.equals(Registry.SHA160_HASH) || name.equals(Registry.SHA256_HASH) || name.equals(Registry.SHA384_HASH) || name.equals(Registry.SHA512_HASH))) { throw new UnsupportedOperationException("hash with no ID"); } return new EMSA_PKCS1_V1_5(hash); }
updateColorSelection(newSelection);
private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProperty("font",(String)fontsList.getSelectedItem()); } String newSelection = (String)colorList.getSelectedItem(); if (colorSchema != null) { if (!getColorProperty("colorBg").equals(colorSchema.getColorBg())) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), colorSchema.getColorBg()); setProperty("colorBg",Integer.toString(colorSchema.getColorBg().getRGB())); } if (!getColorProperty("colorBlue").equals(colorSchema.getColorBlue())) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), colorSchema.getColorBlue()); setProperty("colorBlue",Integer.toString(colorSchema.getColorBlue().getRGB())); } if (!getColorProperty("colorRed").equals(colorSchema.getColorRed())) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), colorSchema.getColorRed()); setProperty("colorRed",Integer.toString(colorSchema.getColorRed().getRGB())); } if (!getColorProperty("colorPink").equals(colorSchema.getColorPink())) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), colorSchema.getColorPink()); setProperty("colorPink",Integer.toString(colorSchema.getColorPink().getRGB())); } if (!getColorProperty("colorGreen").equals(colorSchema.getColorGreen())) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), colorSchema.getColorGreen()); setProperty("colorGreen",Integer.toString(colorSchema.getColorGreen().getRGB())); } if (!getColorProperty("colorTurq").equals(colorSchema.getColorTurq())) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), colorSchema.getColorTurq()); setProperty("colorTurq",Integer.toString(colorSchema.getColorTurq().getRGB())); } if (!getColorProperty("colorYellow").equals(colorSchema.getColorYellow())) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), colorSchema.getColorYellow()); setProperty("colorYellow",Integer.toString(colorSchema.getColorYellow().getRGB())); } if (!getColorProperty("colorWhite").equals(colorSchema.getColorWhite())) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), colorSchema.getColorWhite()); setProperty("colorWhite",Integer.toString(colorSchema.getColorWhite().getRGB())); } if (!getColorProperty("colorGUIField").equals(colorSchema.getColorGuiField())) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), colorSchema.getColorGuiField()); setProperty("colorGUIField",Integer.toString(colorSchema.getColorGuiField().getRGB())); } if (!getColorProperty("colorCursor").equals(colorSchema.getColorCursor())) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), colorSchema.getColorCursor()); setProperty("colorCursor",Integer.toString(colorSchema.getColorCursor().getRGB())); } if (!getColorProperty("colorSep").equals(colorSchema.getColorSeparator())) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), colorSchema.getColorSeparator()); setProperty("colorSep", Integer.toString(colorSchema.getColorSeparator().getRGB())); } if (!getColorProperty("colorHexAttr").equals(colorSchema.getColorHexAttr())) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), colorSchema.getColorHexAttr()); setProperty("colorHexAttr", Integer.toString(colorSchema.getColorHexAttr().getRGB())); } } else { Color nc = jcc.getColor(); if (newSelection.equals(LangTool.getString("sa.bg"))) { if (!getColorProperty("colorBg").equals(nc)) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), nc); setProperty("colorBg",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.blue"))) { if (!getColorProperty("colorBlue").equals(nc)) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), nc); setProperty("colorBlue",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.red"))) { if (!getColorProperty("colorRed").equals(nc)) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), nc); setProperty("colorRed",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.pink"))) { if (!getColorProperty("colorPink").equals(nc)) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), nc); setProperty("colorPink",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.green"))) { if (!getColorProperty("colorGreen").equals(nc)) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), nc); setProperty("colorGreen",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.turq"))) { if (!getColorProperty("colorTurq").equals(nc)) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), nc); setProperty("colorTurq",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.yellow"))) { if (!getColorProperty("colorYellow").equals(nc)) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), nc); setProperty("colorYellow",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.white"))) { if (!getColorProperty("colorWhite").equals(nc)) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), nc); setProperty("colorWhite",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.guiField"))) { if (!getColorProperty("colorGUIField").equals(nc)) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), nc); setProperty("colorGUIField",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { if (!getColorProperty("colorSep").equals(nc)) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), nc); setProperty("colorSep",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { if (!getColorProperty("colorHexAttr").equals(nc)) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), nc); setProperty("colorHexAttr",Integer.toString(nc.getRGB())); } } } if (csLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Line"); setProperty("colSeparator","Line"); } else if (csShortLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "ShortLine"); setProperty("colSeparator","ShortLine"); } else { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Dot"); setProperty("colSeparator","Dot"); } if (cFull.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Half"); setProperty("cursorSize","Half"); } if (cLine.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Line"); setProperty("cursorSize","Line"); } if (chNone.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "None"); setProperty("crossHair","None"); } if (chHorz.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Horz"); setProperty("crossHair","Horz"); } if (chVert.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Vert"); setProperty("crossHair","Vert"); } if (chCross.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Both"); setProperty("crossHair","Both"); } if (rulerFixed.isSelected()) { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "Yes"); setProperty("rulerFixed","Yes"); } else { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "No"); setProperty("rulerFixed","No"); } if (saNormal.isSelected()) { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Normal"); setProperty("showAttr","Normal"); } else { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Hex"); setProperty("showAttr","Hex"); } if (dceCheck.isSelected()) { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "Yes"); setProperty("doubleClick","Yes"); } else { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "No"); setProperty("doubleClick","No"); } if (guiCheck.isSelected()) { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "Yes"); setProperty("guiInterface","Yes"); } else { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "No"); setProperty("guiInterface","No"); } if (guiShowUnderline.isSelected()) { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "Yes"); setProperty("guiShowUnderline","Yes"); } else { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "No"); setProperty("guiShowUnderline","No"); } if (hsCheck.isSelected()) { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "Yes"); setProperty("hotspots","Yes"); } else { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "No"); setProperty("hotspots","No"); } if (kpCheck.isSelected()) { changes.firePropertyChange("keypad", getStringProperty("keypad"), "Yes"); setProperty("keypad","Yes"); } else { changes.firePropertyChange("keypad", getStringProperty("keypad"), "No"); setProperty("keypad","No"); } changes.firePropertyChange("hsMore", getStringProperty("hsMore"), hsMore.getText()); setProperty("hsMore",hsMore.getText()); changes.firePropertyChange("connectMacro", getStringProperty("connectMacro"), connectMacro.getText()); setProperty("connectMacro",connectMacro.getText()); changes.firePropertyChange("hsBottom", getStringProperty("hsBottom"), hsBottom.getText()); setProperty("hsBottom",hsBottom.getText()); changes.firePropertyChange("fontScaleHeight", getStringProperty("fontScaleHeight"), verticalScale.getText()); setProperty("fontScaleHeight",verticalScale.getText()); changes.firePropertyChange("fontScaleWidth", getStringProperty("fontScaleWidth"), horizontalScale.getText()); setProperty("fontScaleWidth",horizontalScale.getText()); changes.firePropertyChange("fontPointSize", getStringProperty("fontPointSize"), pointSize.getText()); setProperty("fontPointSize",pointSize.getText()); changes.firePropertyChange("cursorBottOffset", getStringProperty("cursorBottOffset"), cursorBottOffset.getText()); setProperty("cursorBottOffset",cursorBottOffset.getText()); setProperty("saveme","yes"); }
if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); }
updateColorSelection(newSelection);
private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); // define double click as enter JPanel bottOffPanel = new JPanel(); bottOffPanel.setBorder(BorderFactory.createTitledBorder( LangTool.getString("sa.curBottOffset"))); cursorBottOffset = new JTextField(5); try { int i = Integer.parseInt(getStringProperty("cursorBottOffset","0")); cursorBottOffset.setText(Integer.toString(i)); } catch (NumberFormatException ne) { cursorBottOffset.setText("0"); } bottOffPanel.add(cursorBottOffset); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); cuPanel.add(bottOffPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); }
if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); }
updateColorSelection(newSelection);
public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } }
tab.put (constraints, comp);
addLayoutComponent ((String) constraints, comp);
public void addLayoutComponent (Component comp, Object constraints) { if (! (constraints instanceof String)) throw new IllegalArgumentException ("Object " + constraints + " is not a string"); tab.put (constraints, comp); }
if (num == 1) { comps[0].setVisible(true); return; }
private void gotoComponent (Container parent, int what) { synchronized (parent.getTreeLock ()) { int num = parent.ncomponents; // This is more efficient than calling getComponents(). Component[] comps = parent.component; int choice = -1; if (what == FIRST) choice = 0; else if (what == LAST) choice = num - 1; for (int i = 0; i < num; ++i) { if (comps[i].isVisible ()) { if (what == NEXT) { choice = i + 1; if (choice == num) choice = 0; } else if (what == PREV) { choice = i - 1; if (choice < 0) choice = num - 1; } else if (choice == i) { // Do nothing if we're already looking at the right // component. return; } comps[i].setVisible (false); if (choice >= 0) break; } } if (choice >= 0 && choice < num) comps[choice].setVisible (true); } }
Container parent = comp.getParent(); next(parent);
public void removeLayoutComponent (Component comp) { Enumeration e = tab.keys (); while (e.hasMoreElements ()) { Object key = e.nextElement (); if (tab.get (key) == comp) { tab.remove (key); break; } } }
if (keyMap.isKeyStrokeDefined(action)) {
if (KeyMapper.isKeyStrokeDefined(action)) {
protected void setKeyStroke(String action, KeyStroke ks, KeyMapper keyMap) { if (keyMap.isKeyStrokeDefined(action)) {// ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,KeyEvent.ALT_MASK);// }// else { ks = keyMap.getKeyStroke(action); } session.getInputMap().put(ks,action); session.getActionMap().put(action, this ); // check for alternate if (keyMap.isKeyStrokeDefined(action + ".alt2")) { ks = keyMap.getKeyStroke(action + ".alt2"); session.getInputMap().put(ks,action); session.getActionMap().put(action,this ); } }
ks = keyMap.getKeyStroke(action);
ks = KeyMapper.getKeyStroke(action);
protected void setKeyStroke(String action, KeyStroke ks, KeyMapper keyMap) { if (keyMap.isKeyStrokeDefined(action)) {// ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,KeyEvent.ALT_MASK);// }// else { ks = keyMap.getKeyStroke(action); } session.getInputMap().put(ks,action); session.getActionMap().put(action, this ); // check for alternate if (keyMap.isKeyStrokeDefined(action + ".alt2")) { ks = keyMap.getKeyStroke(action + ".alt2"); session.getInputMap().put(ks,action); session.getActionMap().put(action,this ); } }
if (keyMap.isKeyStrokeDefined(action + ".alt2")) { ks = keyMap.getKeyStroke(action + ".alt2");
if (KeyMapper.isKeyStrokeDefined(action + ".alt2")) { ks = KeyMapper.getKeyStroke(action + ".alt2");
protected void setKeyStroke(String action, KeyStroke ks, KeyMapper keyMap) { if (keyMap.isKeyStrokeDefined(action)) {// ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,KeyEvent.ALT_MASK);// }// else { ks = keyMap.getKeyStroke(action); } session.getInputMap().put(ks,action); session.getActionMap().put(action, this ); // check for alternate if (keyMap.isKeyStrokeDefined(action + ".alt2")) { ks = keyMap.getKeyStroke(action + ".alt2"); session.getInputMap().put(ks,action); session.getActionMap().put(action,this ); } }
if (b == Position.Bias.Backward && pos != 0) pos -= 1;
public int getViewIndex(int pos, Position.Bias b) { // FIXME: Handle bias somehow. return getViewIndexAtPosition(pos); }
if (axisIdRefOrder.size() == 0) { return (String) null; }
protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 1. open this node, print its simple XML attributes if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(indent); // indent node if desired outputWriter.write("<" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(Constants.NEW_LINE); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(newindent); // indent node if desired outputWriter.write("<" + indexNodeName + " axisIdRef=\""); writeOutAttribute(outputWriter, axisIdRef); outputWriter.write( "\"/>"); if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(Constants.NEW_LINE); } // 3. Close this node if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write(indent); // indent node if desired outputWriter.write("</" + nodeNameString + ">"); // print opening statement// if (Specification.getInstance().isPrettyXDFOutput()) outputWriter.write( Constants.NEW_LINE); return nodeNameString; }
break; case PLANE_ATTR: System.arraycopy(screenAttr, from, planeChars, 0, len);
protected synchronized char[] getPlaneData(int from, int to, int plane) { int len = to - from; char[] planeChars = new char[len + 1]; switch (plane) { case PLANE_TEXT: System.arraycopy(screen, from, planeChars, 0, len); break; case PLANE_COLOR:// fillColorPlane(planeChars,from,len); System.arraycopy(screenColor, from, planeChars, 0, len); break; case PLANE_EXTENDED: System.arraycopy(screenExtended, from, planeChars, 0, len);// fillExtendedPlane(planeChars,from,len); break; case PLANE_EXTENDED_GRAPHIC: System.arraycopy(screenGUI, from, planeChars, 0, len);// fillExtendedGraphicPlane(screenGUI,from,len); break; case PLANE_EXTENDED_FIELD: System.arraycopy(screenField, from, planeChars, 0, len);// fillExtendedFieldPlane(screenField,from,len); break; default: System.arraycopy(screen, from, planeChars, 0, len); } return planeChars; }
{
protected Keymap createKeymap() { JTextComponent.KeyBinding[] bindings = null; String prefix = getPropertyPrefix(); InputMapUIResource m = (InputMapUIResource) UIManager.get(prefix + ".focusInputMap"); if (m != null) { KeyStroke[] keys = m.keys(); int len = keys.length; bindings = new JTextComponent.KeyBinding[len]; for (int i = 0; i < len; i++) { KeyStroke curr = keys[i]; bindings[i] = new JTextComponent.KeyBinding(curr, (String) m.get(curr)); } } if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; UIManager.put(prefix + ".focusInputMap", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
UIManager.put(prefix + ".focusInputMap", bindings); }
protected Keymap createKeymap() { JTextComponent.KeyBinding[] bindings = null; String prefix = getPropertyPrefix(); InputMapUIResource m = (InputMapUIResource) UIManager.get(prefix + ".focusInputMap"); if (m != null) { KeyStroke[] keys = m.keys(); int len = keys.length; bindings = new JTextComponent.KeyBinding[len]; for (int i = 0; i < len; i++) { KeyStroke curr = keys[i]; bindings[i] = new JTextComponent.KeyBinding(curr, (String) m.get(curr)); } } if (bindings == null) { bindings = new JTextComponent.KeyBinding[0]; UIManager.put(prefix + ".focusInputMap", bindings); } Keymap km = JTextComponent.addKeymap(getKeymapName(), JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP)); JTextComponent.loadKeymap(km, bindings, textComponent.getActions()); return km; }
return new Dimension((int) w, (int) h);
Insets i = c.getInsets(); return new Dimension((int) w + i.left + i.right, (int) h + i.top + i.bottom);
public Dimension getPreferredSize(JComponent c) { View v = getRootView(textComponent); float w = v.getPreferredSpan(View.X_AXIS); float h = v.getPreferredSpan(View.Y_AXIS); return new Dimension((int) w, (int) h); }
int origin = mymatch.index;
boolean match(CharIndexed input, REMatch mymatch) { if (num >= mymatch.start.length) return false; if (num >= mymatch.end.length) return false; int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... int origin = mymatch.index; for (int i=b; i<e; i++) { char c1 = input.charAt(mymatch.index+i-b); char c2 = input.charAt(i); if (c1 != c2) { if (insens) { if (c1 != Character.toLowerCase(c2) && c1 != Character.toUpperCase(c2)) { return false; } } else { return false; } } } mymatch.index += e-b; boolean result = next(input, mymatch); if (result) mymatch.empty = (mymatch.index == origin); return result; }
boolean result = next(input, mymatch); if (result) mymatch.empty = (mymatch.index == origin); return result;
return next(input, mymatch);
boolean match(CharIndexed input, REMatch mymatch) { if (num >= mymatch.start.length) return false; if (num >= mymatch.end.length) return false; int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... int origin = mymatch.index; for (int i=b; i<e; i++) { char c1 = input.charAt(mymatch.index+i-b); char c2 = input.charAt(i); if (c1 != c2) { if (insens) { if (c1 != Character.toLowerCase(c2) && c1 != Character.toUpperCase(c2)) { return false; } } else { return false; } } } mymatch.index += e-b; boolean result = next(input, mymatch); if (result) mymatch.empty = (mymatch.index == origin); return result; }
list.setFocusable(false);
protected void configureList() { list.setModel(comboBox.getModel()); list.setVisibleRowCount(comboBox.getMaximumRowCount()); installListListeners(); }
String subVer= ".2b";
String subVer= ".3 RC1";
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); String release = "0"; String version = ".5"; String subVer= ".2b"; if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + release + version + subVer); else setTitle("tn5250j - " + release + version + subVer); sessionPane.setBorder(BorderFactory.createEtchedBorder()); sessionPane.setBounds(new Rectangle(78, 57, 5, 5)); sessionPane.setOpaque(false); sessionPane.setRequestFocusEnabled(false); sessionPane.setDoubleBuffered(true); this.getContentPane().add(sessionPane, BorderLayout.CENTER); sessionPane.addChangeListener(this); centerFrame(); }
if (getSize().width > max.width) setSize(max.width,getSize().height); if (getSize().height > max.height) setSize(getSize().width,max.height);
private void jbInit() throws Exception { try { setIconImage(My5250.tnicon.getImage()); // set title setTitle(LangTool.getString("xtfr.wizardTitle")); // Load the JDBC driver. Driver driver2 = (Driver)Class.forName("com.ibm.as400.access.AS400JDBCDriver").newInstance(); DriverManager.registerDriver(driver2); // Get a connection to the database. Since we do not // provide a user id or password, a prompt will appear. connection = new SQLConnection("jdbc:as400://" + host, name, password); // Create an SQLQueryBuilderPane // object. Assume that "connection" // is an SQLConnection object that is // created and initialized elsewhere. queryBuilder = new SQLQueryBuilderPane(connection); queryBuilder.setTableSchemas(new String[] {"*USRLIBL"}); // Load the data needed for the query // builder. queryBuilder.load(); JButton done = new JButton(LangTool.getString("xtfr.tableDone")); done.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { fillQueryTextArea(); } }); JPanel panel = new JPanel(); panel.add(done); getContentPane().add(queryBuilder, BorderLayout.CENTER); getContentPane().add(panel, BorderLayout.SOUTH); pack(); //Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); setVisible(true); } catch (ClassNotFoundException cnfe) { JOptionPane.showMessageDialog(null,"Error loading AS400 JDBC Driver", "Error", JOptionPane.ERROR_MESSAGE); } }
NumberFormat currency = NumberFormat.getCurrencyInstance (locale); return currency.getMaximumFractionDigits();
return fractionDigits;
public int getDefaultFractionDigits () { NumberFormat currency = NumberFormat.getCurrencyInstance (locale); return currency.getMaximumFractionDigits(); }
newCurrency = (Currency) cache.get(locale); if (newCurrency == null)
String code = (String) countryMap.get(country); if (code == null)
public static Currency getInstance (Locale locale) { /** * The new instance must be the only available instance * for the currency it supports. We ensure this happens, * while maintaining a suitable performance level, by * creating the appropriate object on the first call to * this method, and returning the cached instance on * later calls. */ Currency newCurrency; /* Attempt to get the currency from the cache */ newCurrency = (Currency) cache.get(locale); if (newCurrency == null) { /* Create the currency for this locale */ newCurrency = new Currency (locale); /* Cache it */ cache.put(locale, newCurrency); } /* Return the instance */ return newCurrency; }
newCurrency = new Currency (locale);
newCurrency = new Currency(locale); code = newCurrency.getCurrencyCode(); if (code == null) { return null; } else {
public static Currency getInstance (Locale locale) { /** * The new instance must be the only available instance * for the currency it supports. We ensure this happens, * while maintaining a suitable performance level, by * creating the appropriate object on the first call to * this method, and returning the cached instance on * later calls. */ Currency newCurrency; /* Attempt to get the currency from the cache */ newCurrency = (Currency) cache.get(locale); if (newCurrency == null) { /* Create the currency for this locale */ newCurrency = new Currency (locale); /* Cache it */ cache.put(locale, newCurrency); } /* Return the instance */ return newCurrency; }
cache.put(locale, newCurrency);
countryMap.put(country, code); cache.put(code, newCurrency); } } else { newCurrency = (Currency) cache.get(code);
public static Currency getInstance (Locale locale) { /** * The new instance must be the only available instance * for the currency it supports. We ensure this happens, * while maintaining a suitable performance level, by * creating the appropriate object on the first call to * this method, and returning the cached instance on * later calls. */ Currency newCurrency; /* Attempt to get the currency from the cache */ newCurrency = (Currency) cache.get(locale); if (newCurrency == null) { /* Create the currency for this locale */ newCurrency = new Currency (locale); /* Cache it */ cache.put(locale, newCurrency); } /* Return the instance */ return newCurrency; }
try { return res.getString ("currencySymbol"); } catch (Exception _) { return null; }
return currencySymbol == null ? getCurrencyCode() : currencySymbol;
public String getSymbol() { try { /* What does this return if there is no mapping? */ return res.getString ("currencySymbol"); } catch (Exception _) { return null; } }
if(CharacterAttributeTranslator.translateTag(charAttr, t, a)) return;
public void start(HTML.Tag t, MutableAttributeSet a) { // Put the old attribute set on the stack. pushCharacterStyle(); // Translate tag.. return if succesful. if(CharacterAttributeTranslator.translateTag(charAttr, t, a)) return; // Just add the attributes in <code>a</code>. if (a != null) charAttr.addAttribute(t, a.copyAttributes()); }
if (a != null)
public void start(HTML.Tag t, MutableAttributeSet a) { // Put the old attribute set on the stack. pushCharacterStyle(); // Translate tag.. return if succesful. if(CharacterAttributeTranslator.translateTag(charAttr, t, a)) return; // Just add the attributes in <code>a</code>. if (a != null) charAttr.addAttribute(t, a.copyAttributes()); }
DefaultStyledDocument.ElementSpec spec; spec = new DefaultStyledDocument.ElementSpec(copy,
DefaultStyledDocument.ElementSpec spec = new DefaultStyledDocument.ElementSpec(copy,
protected void addSpecialElement(HTML.Tag t, MutableAttributeSet a) { a.addAttribute(StyleConstants.NameAttribute, t); // Migrate from the rather htmlAttributeSet to the faster, lighter and // unchangeable alternative implementation. AttributeSet copy = a.copyAttributes(); // TODO: Figure out why we must always insert this single character // (otherwise the element does not appear). Either fix or add explaining // comment or at least report a normal bug. DefaultStyledDocument.ElementSpec spec; spec = new DefaultStyledDocument.ElementSpec(copy, DefaultStyledDocument.ElementSpec.ContentType, new char[] {' '}, 0, 1 ); parseBuffer.add(spec); }
new char[] {' '}, 0, 1 );
new char[] {' ', ' '}, 0, 2 );
protected void addSpecialElement(HTML.Tag t, MutableAttributeSet a) { a.addAttribute(StyleConstants.NameAttribute, t); // Migrate from the rather htmlAttributeSet to the faster, lighter and // unchangeable alternative implementation. AttributeSet copy = a.copyAttributes(); // TODO: Figure out why we must always insert this single character // (otherwise the element does not appear). Either fix or add explaining // comment or at least report a normal bug. DefaultStyledDocument.ElementSpec spec; spec = new DefaultStyledDocument.ElementSpec(copy, DefaultStyledDocument.ElementSpec.ContentType, new char[] {' '}, 0, 1 ); parseBuffer.add(spec); }
else if (parseStack.peek() == HTML.Tag.IMPLIED) { element = new DefaultStyledDocument.ElementSpec(null, DefaultStyledDocument.ElementSpec.EndTagType); parseBuffer.addElement(element); if (parseStack.size() > 0) parseStack.pop(); }
protected void blockClose(HTML.Tag t) { printBuffer(); DefaultStyledDocument.ElementSpec element; // If the previous tag is a start tag then we insert a synthetic // content tag. DefaultStyledDocument.ElementSpec prev; prev = (DefaultStyledDocument.ElementSpec) parseBuffer.get(parseBuffer.size() - 1); if (prev.getType() == DefaultStyledDocument.ElementSpec.StartTagType) { AbstractDocument.AttributeContext ctx = getAttributeContext(); AttributeSet attributes = ctx.getEmptySet(); attributes = ctx.addAttribute(attributes, StyleConstants.NameAttribute, HTML.Tag.CONTENT); element = new DefaultStyledDocument.ElementSpec(attributes, DefaultStyledDocument.ElementSpec.ContentType, new char[0], 0, 0); parseBuffer.add(element); } // If the previous tag is content and the parent is p-implied, then // we must also close the p-implied. else if (parseStack.peek() == HTML.Tag.IMPLIED) { element = new DefaultStyledDocument.ElementSpec(null, DefaultStyledDocument.ElementSpec.EndTagType); parseBuffer.addElement(element); if (parseStack.size() > 0) parseStack.pop(); } element = new DefaultStyledDocument.ElementSpec(null, DefaultStyledDocument.ElementSpec.EndTagType); parseBuffer.addElement(element); printBuffer(); if (parseStack.size() > 0) parseStack.pop(); }
if (parseStack.size() > 0 && parseStack.peek() == HTML.Tag.IMPLIED) { element = new DefaultStyledDocument.ElementSpec(null, DefaultStyledDocument.ElementSpec.EndTagType); parseBuffer.addElement(element); parseStack.pop(); }
protected void blockOpen(HTML.Tag t, MutableAttributeSet attr) { printBuffer(); DefaultStyledDocument.ElementSpec element; // If the previous tag is content and the parent is p-implied, then // we must also close the p-implied. if (parseStack.size() > 0 && parseStack.peek() == HTML.Tag.IMPLIED) { element = new DefaultStyledDocument.ElementSpec(null, DefaultStyledDocument.ElementSpec.EndTagType); parseBuffer.addElement(element); parseStack.pop(); } parseStack.push(t); AbstractDocument.AttributeContext ctx = getAttributeContext(); AttributeSet copy = attr.copyAttributes(); copy = ctx.addAttribute(copy, StyleConstants.NameAttribute, t); element = new DefaultStyledDocument.ElementSpec(copy, DefaultStyledDocument.ElementSpec.StartTagType); parseBuffer.addElement(element); printBuffer(); }
if (endHTMLEncountered) return;
if (shouldInsert()) {
public void handleComment(char[] data, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get(HTML.Tag.COMMENT); if (action != null) { action.start(HTML.Tag.COMMENT, new SimpleAttributeSet()); action.end (HTML.Tag.COMMENT); } }
action.start(HTML.Tag.COMMENT, new SimpleAttributeSet()); action.end (HTML.Tag.COMMENT);
action.start(HTML.Tag.COMMENT, htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET); action.end(HTML.Tag.COMMENT); }
public void handleComment(char[] data, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get(HTML.Tag.COMMENT); if (action != null) { action.start(HTML.Tag.COMMENT, new SimpleAttributeSet()); action.end (HTML.Tag.COMMENT); } }
throws NotImplementedException
public void handleEndOfLineString(String eol) throws NotImplementedException { // FIXME: Implement. print ("HTMLReader.handleEndOfLineString not implemented yet"); }
if (endHTMLEncountered) return;
if (shouldInsert()) {
public void handleEndTag(HTML.Tag t, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; // If this is the </html> tag we need to stop calling the Actions if (t == HTML.Tag.HTML) endHTMLEncountered = true; TagAction action = (TagAction) tagToAction.get(t); if (action != null) action.end(t); }
}
public void handleEndTag(HTML.Tag t, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; // If this is the </html> tag we need to stop calling the Actions if (t == HTML.Tag.HTML) endHTMLEncountered = true; TagAction action = (TagAction) tagToAction.get(t); if (action != null) action.end(t); }
if (endHTMLEncountered) return;
if (t == insertTag) insertTagEncountered = true;
public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get (t); if (action != null) { action.start(t, a); action.end(t); } }
TagAction action = (TagAction) tagToAction.get (t);
if (shouldInsert()) { TagAction action = (TagAction) tagToAction.get(t);
public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get (t); if (action != null) { action.start(t, a); action.end(t); } }
}
public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get (t); if (action != null) { action.start(t, a); action.end(t); } }
if (endHTMLEncountered) return;
if (t == insertTag) insertTagEncountered = true;
public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get(t); if (action != null) action.start(t, a); }
}
public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) { // Don't call the Action if we've already seen </html>. if (endHTMLEncountered) return; TagAction action = (TagAction) tagToAction.get(t); if (action != null) action.start(t, a); }
ConvertAction convertAction = new ConvertAction();
void initTags() { tagToAction = new HashMap(72); CharacterAction characterAction = new CharacterAction(); HiddenAction hiddenAction = new HiddenAction(); AreaAction areaAction = new AreaAction(); BaseAction baseAction = new BaseAction(); BlockAction blockAction = new BlockAction(); SpecialAction specialAction = new SpecialAction(); ParagraphAction paragraphAction = new ParagraphAction(); HeadAction headAction = new HeadAction(); FormAction formAction = new FormAction(); IsindexAction isindexAction = new IsindexAction(); LinkAction linkAction = new LinkAction(); MapAction mapAction = new MapAction(); PreAction preAction = new PreAction(); MetaAction metaAction = new MetaAction(); StyleAction styleAction = new StyleAction(); TitleAction titleAction = new TitleAction(); tagToAction.put(HTML.Tag.A, characterAction); tagToAction.put(HTML.Tag.ADDRESS, characterAction); tagToAction.put(HTML.Tag.APPLET, hiddenAction); tagToAction.put(HTML.Tag.AREA, areaAction); tagToAction.put(HTML.Tag.B, characterAction); tagToAction.put(HTML.Tag.BASE, baseAction); tagToAction.put(HTML.Tag.BASEFONT, characterAction); tagToAction.put(HTML.Tag.BIG, characterAction); tagToAction.put(HTML.Tag.BLOCKQUOTE, blockAction); tagToAction.put(HTML.Tag.BODY, blockAction); tagToAction.put(HTML.Tag.BR, specialAction); tagToAction.put(HTML.Tag.CAPTION, blockAction); tagToAction.put(HTML.Tag.CENTER, blockAction); tagToAction.put(HTML.Tag.CITE, characterAction); tagToAction.put(HTML.Tag.CODE, characterAction); tagToAction.put(HTML.Tag.DD, blockAction); tagToAction.put(HTML.Tag.DFN, characterAction); tagToAction.put(HTML.Tag.DIR, blockAction); tagToAction.put(HTML.Tag.DIV, blockAction); tagToAction.put(HTML.Tag.DL, blockAction); tagToAction.put(HTML.Tag.DT, paragraphAction); tagToAction.put(HTML.Tag.EM, characterAction); tagToAction.put(HTML.Tag.FONT, characterAction); tagToAction.put(HTML.Tag.FORM, blockAction); tagToAction.put(HTML.Tag.FRAME, specialAction); tagToAction.put(HTML.Tag.FRAMESET, blockAction); tagToAction.put(HTML.Tag.H1, paragraphAction); tagToAction.put(HTML.Tag.H2, paragraphAction); tagToAction.put(HTML.Tag.H3, paragraphAction); tagToAction.put(HTML.Tag.H4, paragraphAction); tagToAction.put(HTML.Tag.H5, paragraphAction); tagToAction.put(HTML.Tag.H6, paragraphAction); tagToAction.put(HTML.Tag.HEAD, headAction); tagToAction.put(HTML.Tag.HR, specialAction); tagToAction.put(HTML.Tag.HTML, blockAction); tagToAction.put(HTML.Tag.I, characterAction); tagToAction.put(HTML.Tag.IMG, specialAction); tagToAction.put(HTML.Tag.INPUT, formAction); tagToAction.put(HTML.Tag.ISINDEX, isindexAction); tagToAction.put(HTML.Tag.KBD, characterAction); tagToAction.put(HTML.Tag.LI, blockAction); tagToAction.put(HTML.Tag.LINK, linkAction); tagToAction.put(HTML.Tag.MAP, mapAction); tagToAction.put(HTML.Tag.MENU, blockAction); tagToAction.put(HTML.Tag.META, metaAction); tagToAction.put(HTML.Tag.NOFRAMES, blockAction); tagToAction.put(HTML.Tag.OBJECT, specialAction); tagToAction.put(HTML.Tag.OL, blockAction); tagToAction.put(HTML.Tag.OPTION, formAction); tagToAction.put(HTML.Tag.P, paragraphAction); tagToAction.put(HTML.Tag.PARAM, hiddenAction); tagToAction.put(HTML.Tag.PRE, preAction); tagToAction.put(HTML.Tag.SAMP, characterAction); tagToAction.put(HTML.Tag.SCRIPT, hiddenAction); tagToAction.put(HTML.Tag.SELECT, formAction); tagToAction.put(HTML.Tag.SMALL, characterAction); tagToAction.put(HTML.Tag.STRIKE, characterAction); tagToAction.put(HTML.Tag.S, characterAction); tagToAction.put(HTML.Tag.STRONG, characterAction); tagToAction.put(HTML.Tag.STYLE, styleAction); tagToAction.put(HTML.Tag.SUB, characterAction); tagToAction.put(HTML.Tag.SUP, characterAction); tagToAction.put(HTML.Tag.TABLE, blockAction); tagToAction.put(HTML.Tag.TD, blockAction); tagToAction.put(HTML.Tag.TEXTAREA, formAction); tagToAction.put(HTML.Tag.TH, blockAction); tagToAction.put(HTML.Tag.TITLE, titleAction); tagToAction.put(HTML.Tag.TR, blockAction); tagToAction.put(HTML.Tag.TT, characterAction); tagToAction.put(HTML.Tag.U, characterAction); tagToAction.put(HTML.Tag.UL, blockAction); tagToAction.put(HTML.Tag.VAR, characterAction); }
tagToAction.put(HTML.Tag.FONT, characterAction);
tagToAction.put(HTML.Tag.FONT, convertAction);
void initTags() { tagToAction = new HashMap(72); CharacterAction characterAction = new CharacterAction(); HiddenAction hiddenAction = new HiddenAction(); AreaAction areaAction = new AreaAction(); BaseAction baseAction = new BaseAction(); BlockAction blockAction = new BlockAction(); SpecialAction specialAction = new SpecialAction(); ParagraphAction paragraphAction = new ParagraphAction(); HeadAction headAction = new HeadAction(); FormAction formAction = new FormAction(); IsindexAction isindexAction = new IsindexAction(); LinkAction linkAction = new LinkAction(); MapAction mapAction = new MapAction(); PreAction preAction = new PreAction(); MetaAction metaAction = new MetaAction(); StyleAction styleAction = new StyleAction(); TitleAction titleAction = new TitleAction(); tagToAction.put(HTML.Tag.A, characterAction); tagToAction.put(HTML.Tag.ADDRESS, characterAction); tagToAction.put(HTML.Tag.APPLET, hiddenAction); tagToAction.put(HTML.Tag.AREA, areaAction); tagToAction.put(HTML.Tag.B, characterAction); tagToAction.put(HTML.Tag.BASE, baseAction); tagToAction.put(HTML.Tag.BASEFONT, characterAction); tagToAction.put(HTML.Tag.BIG, characterAction); tagToAction.put(HTML.Tag.BLOCKQUOTE, blockAction); tagToAction.put(HTML.Tag.BODY, blockAction); tagToAction.put(HTML.Tag.BR, specialAction); tagToAction.put(HTML.Tag.CAPTION, blockAction); tagToAction.put(HTML.Tag.CENTER, blockAction); tagToAction.put(HTML.Tag.CITE, characterAction); tagToAction.put(HTML.Tag.CODE, characterAction); tagToAction.put(HTML.Tag.DD, blockAction); tagToAction.put(HTML.Tag.DFN, characterAction); tagToAction.put(HTML.Tag.DIR, blockAction); tagToAction.put(HTML.Tag.DIV, blockAction); tagToAction.put(HTML.Tag.DL, blockAction); tagToAction.put(HTML.Tag.DT, paragraphAction); tagToAction.put(HTML.Tag.EM, characterAction); tagToAction.put(HTML.Tag.FONT, characterAction); tagToAction.put(HTML.Tag.FORM, blockAction); tagToAction.put(HTML.Tag.FRAME, specialAction); tagToAction.put(HTML.Tag.FRAMESET, blockAction); tagToAction.put(HTML.Tag.H1, paragraphAction); tagToAction.put(HTML.Tag.H2, paragraphAction); tagToAction.put(HTML.Tag.H3, paragraphAction); tagToAction.put(HTML.Tag.H4, paragraphAction); tagToAction.put(HTML.Tag.H5, paragraphAction); tagToAction.put(HTML.Tag.H6, paragraphAction); tagToAction.put(HTML.Tag.HEAD, headAction); tagToAction.put(HTML.Tag.HR, specialAction); tagToAction.put(HTML.Tag.HTML, blockAction); tagToAction.put(HTML.Tag.I, characterAction); tagToAction.put(HTML.Tag.IMG, specialAction); tagToAction.put(HTML.Tag.INPUT, formAction); tagToAction.put(HTML.Tag.ISINDEX, isindexAction); tagToAction.put(HTML.Tag.KBD, characterAction); tagToAction.put(HTML.Tag.LI, blockAction); tagToAction.put(HTML.Tag.LINK, linkAction); tagToAction.put(HTML.Tag.MAP, mapAction); tagToAction.put(HTML.Tag.MENU, blockAction); tagToAction.put(HTML.Tag.META, metaAction); tagToAction.put(HTML.Tag.NOFRAMES, blockAction); tagToAction.put(HTML.Tag.OBJECT, specialAction); tagToAction.put(HTML.Tag.OL, blockAction); tagToAction.put(HTML.Tag.OPTION, formAction); tagToAction.put(HTML.Tag.P, paragraphAction); tagToAction.put(HTML.Tag.PARAM, hiddenAction); tagToAction.put(HTML.Tag.PRE, preAction); tagToAction.put(HTML.Tag.SAMP, characterAction); tagToAction.put(HTML.Tag.SCRIPT, hiddenAction); tagToAction.put(HTML.Tag.SELECT, formAction); tagToAction.put(HTML.Tag.SMALL, characterAction); tagToAction.put(HTML.Tag.STRIKE, characterAction); tagToAction.put(HTML.Tag.S, characterAction); tagToAction.put(HTML.Tag.STRONG, characterAction); tagToAction.put(HTML.Tag.STYLE, styleAction); tagToAction.put(HTML.Tag.SUB, characterAction); tagToAction.put(HTML.Tag.SUP, characterAction); tagToAction.put(HTML.Tag.TABLE, blockAction); tagToAction.put(HTML.Tag.TD, blockAction); tagToAction.put(HTML.Tag.TEXTAREA, formAction); tagToAction.put(HTML.Tag.TH, blockAction); tagToAction.put(HTML.Tag.TITLE, titleAction); tagToAction.put(HTML.Tag.TR, blockAction); tagToAction.put(HTML.Tag.TT, characterAction); tagToAction.put(HTML.Tag.U, characterAction); tagToAction.put(HTML.Tag.UL, blockAction); tagToAction.put(HTML.Tag.VAR, characterAction); }
this(null);
this(new GapContent(BUFFER_SIZE_DEFAULT), new StyleSheet());
public HTMLDocument() { this(null); }
return styleSheet;
return (StyleSheet) getAttributeContext();
public StyleSheet getStyleSheet() { return styleSheet; }
throws BadLocationException, IOException, NotImplementedException
throws BadLocationException, IOException
public void insertAfterEnd(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertAfterEnd not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("insertAfterEnd not implemented");
HTMLEditorKit.ParserCallback reader = getInsertingReader( elem.getEndOffset(), 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true);
public void insertAfterEnd(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertAfterEnd not implemented"); }
throws BadLocationException, IOException, NotImplementedException
throws BadLocationException, IOException
public void insertAfterStart(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertAfterStart not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("insertAfterStart not implemented");
HTMLEditorKit.ParserCallback reader = getInsertingReader( elem.getStartOffset(), 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true);
public void insertAfterStart(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertAfterStart not implemented"); }
throws BadLocationException, IOException, NotImplementedException
throws BadLocationException, IOException
public void insertBeforeEnd(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertBeforeEnd not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("insertBeforeEnd not implemented");
HTMLEditorKit.ParserCallback reader = getInsertingReader( elem.getEndOffset(), 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true);
public void insertBeforeEnd(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertBeforeEnd not implemented"); }
throws BadLocationException, IOException, NotImplementedException
throws BadLocationException, IOException
public void insertBeforeStart(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertBeforeStart not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("insertBeforeStart not implemented");
HTMLEditorKit.ParserCallback reader = getInsertingReader( elem.getStartOffset(), 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true);
public void insertBeforeStart(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("insertBeforeStart not implemented"); }