bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
| 8,979
|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
| 8,980
|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
|
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); strokeDescAlt.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()] + ".alt2")); } else { if (macros) { Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); strokeDescAlt.setText(mapper.getKeyStrokeDesc((String)o + ".alt2")); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); strokeDescAlt.setText(mapper.getKeyStrokeDesc(m.getFullName() + ".alt2")); } } if (special) { System.out.println((String)lm.getElementAt(index)); String k = parseSpecialCharacter((String)lm.getElementAt(index)); setKeyInformation(k); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
| 8,981
|
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; }
|
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; 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; }
| 8,982
|
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; }
|
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; }
| 8,983
|
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; }
|
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; }
| 8,984
|
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; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; private if (altKey) k += KeyStroker.altSuffix; void if (altKey) k += KeyStroker.altSuffix; setNewKeyStrokes(KeyEvent if (altKey) k += KeyStroker.altSuffix; ke) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (!macros if (altKey) k += KeyStroker.altSuffix; && if (altKey) k += KeyStroker.altSuffix; !special) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; int if (altKey) k += KeyStroker.altSuffix; index if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; ((KeyDescription)functions.getSelectedValue()).getIndex(); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; String if (altKey) k += KeyStroker.altSuffix; stroke if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; mnemonicData[index]; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (altKey) if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; stroke if (altKey) k += KeyStroker.altSuffix; += if (altKey) k += KeyStroker.altSuffix; ".alt2"; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (isLinux) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(stroke,ke,isAltGr); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(stroke,ke); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (altKey) if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; strokeDescAlt.setText(mapper.getKeyStrokeDesc( if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; stroke)); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; strokeDesc.setText(mapper.getKeyStrokeDesc( if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; stroke)); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (macros) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; Object if (altKey) k += KeyStroker.altSuffix; o if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; functions.getSelectedValue(); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; String if (altKey) k += KeyStroker.altSuffix; macro; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (o if (altKey) k += KeyStroker.altSuffix; instanceof if (altKey) k += KeyStroker.altSuffix; Macro) if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; macro if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; ((Macro)o).getFullName(); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; macro if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; (String)o; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; System.out.println(macro); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (isLinux) if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(macro,ke,isAltGr); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(macro,ke); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; strokeDesc.setText(mapper.getKeyStrokeDesc( if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; macro)); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (special) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; System.out.println((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; String if (altKey) k += KeyStroker.altSuffix; k if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; parseSpecialCharacter((String)functions.getSelectedValue());// if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; k if (altKey) k += KeyStroker.altSuffix; += if (altKey) k += KeyStroker.altSuffix; ((String)functions.getSelectedValue()).charAt(7); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if if (altKey) k += KeyStroker.altSuffix; (isLinux) if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(k,ke,isAltGr); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; else if (altKey) k += KeyStroker.altSuffix; { if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mapper.setKeyStroke(k,ke); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; strokeDesc.setText(mapper.getKeyStrokeDesc(k)); if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; } if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; mods if (altKey) k += KeyStroker.altSuffix; = if (altKey) k += KeyStroker.altSuffix; true; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; if (altKey) k += KeyStroker.altSuffix; }
| 8,985
|
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; }
|
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); } } } mods = true; }
| 8,986
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
| 8,988
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
| 8,989
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
| 8,990
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
| 8,991
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
|
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String) (act.getValue(Action.ACTION_COMMAND_KEY))); }
| 8,992
|
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[] 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"); }
| 8,993
|
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 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; }
| 8,994
|
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 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"); }
| 8,995
|
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); } }
|
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); } }
| 8,996
|
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); } }
|
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); } }
| 8,997
|
public static State from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid enumeration code " + code); } }
|
public static State from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { BAD_OPERATION bad = new BAD_OPERATION("Invalid state " + code); bad.minor = Minor.Enumeration; throw bad; } }
| 9,001
|
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; } }
|
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.", pos); 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; } }
| 9,002
|
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); }
|
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); }
| 9,004
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + phi.toString(); }
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + phi.toString(); }
| 9,005
|
public LineBreakIterator() { iter = null; }
|
public LineBreakIterator() { iter = null; }
| 9,006
|
public Object clone() { return new LineBreakIterator(this); }
|
public Object clone() { return new LineBreakIterator(this); }
| 9,007
|
private final boolean isClose(int type) { return (type == Character.END_PUNCTUATION // Unicode book says "comma, period, ...", which I take to // mean "Po" class. || type == Character.OTHER_PUNCTUATION); }
|
private final boolean isClose(int type) { return (type == Character.END_PUNCTUATION // Unicode book says "comma, period, ...", which I take to // mean "Po" class. || type == Character.OTHER_PUNCTUATION); }
| 9,008
|
private final boolean isIdeo(char c) { return (c >= 0x3040 && c <= 0x309f // Hiragana || c >= 0x30a0 && c <= 0x30ff // Katakana || c >= 0x4e00 && c <= 0x9fff // Han || c >= 0x3100 && c <= 0x312f); // Bopomofo }
|
private final boolean isIdeo(char c) { return (c >= 0x3040 && c <= 0x309f // Hiragana || c >= 0x30a0 && c <= 0x30ff // Katakana || c >= 0x4e00 && c <= 0x9fff // Han || c >= 0x3100 && c <= 0x312f); // Bopomofo }
| 9,009
|
private final boolean isNb(char c) { return (c == 0x00a0 // NO-BREAK SPACE || c == 0x2011 // NON-BREAKING HYPHEN || c == 0xfeff); // ZERO WITH NO-BREAK SPACE }
|
private final boolean isNb(char c) { return (c == 0x00a0 // NO-BREAK SPACE || c == 0x2011 // NON-BREAKING HYPHEN || c == 0xfeff); // ZERO WITH NO-BREAK SPACE }
| 9,010
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,011
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,012
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,013
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,014
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,015
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,016
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,017
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,018
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
|
public int next() { int end = iter.getEndIndex(); if (iter.getIndex() == end) return DONE; while (iter.getIndex() < end) { char c = iter.current(); int type = Character.getType(c); char n = iter.next(); if (n == CharacterIterator.DONE || type == Character.PARAGRAPH_SEPARATOR || type == Character.LINE_SEPARATOR) break; // Handle two cases where we must scan for non-spacing marks. int start = iter.getIndex(); if (type == Character.SPACE_SEPARATOR || type == Character.START_PUNCTUATION || isIdeo(c)) { while (n != CharacterIterator.DONE && Character.getType(n) == Character.NON_SPACING_MARK) n = iter.next(); if (n == CharacterIterator.DONE) break; if (type == Character.SPACE_SEPARATOR) { int nt = Character.getType(n); if (nt != Character.NON_SPACING_MARK && nt != Character.SPACE_SEPARATOR && !isNb(n)) break; } else if (type == Character.START_PUNCTUATION) { if (isIdeo(n)) { // Open punctuation followed by non spacing marks // and then ideograph does not have a break in // it. So skip all this. start = iter.getIndex(); } } else { // Ideograph preceded this character. if (isClose(Character.getType(n))) break; } } iter.setIndex(start); } return iter.getIndex(); }
| 9,019
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,020
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,021
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,022
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,023
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,024
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,025
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
|
public int previous() { int start = iter.getBeginIndex(); if (iter.getIndex() == start) return DONE; while (iter.getIndex() >= start) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); char n = iter.previous(); if (n == CharacterIterator.DONE) break; iter.next(); int nt = Character.getType(n); // Break after paragraph separators. if (nt == Character.PARAGRAPH_SEPARATOR || nt == Character.LINE_SEPARATOR) break; // Skip non-spacing marks. int init = iter.getIndex(); while (n != CharacterIterator.DONE && nt == Character.NON_SPACING_MARK) { n = iter.previous(); nt = Character.getType(n); } if (nt == Character.SPACE_SEPARATOR && type != Character.SPACE_SEPARATOR && type != Character.NON_SPACING_MARK && !isNb(c)) break; if (!isClose(type) && isIdeo(n)) break; if (isIdeo(c) && nt != Character.START_PUNCTUATION) break; iter.setIndex(init); } return iter.getIndex(); }
| 9,026
|
AttributedStringIterator(StringCharacterIterator sci, AttributedString.AttributeRange[] attribs, int begin_index, int end_index, AttributedCharacterIterator.Attribute[] restricts){ this.ci = new StringCharacterIterator(sci, begin_index, end_index); this.attribs = attribs; this.restricts = restricts;}
|
AttributedStringIterator(StringCharacterIterator sci, AttributedString.AttributeRange[] attribs, int begin_index, int end_index, AttributedCharacterIterator.Attribute[] restricts){ this.ci = new StringCharacterIterator(sci, begin_index, end_index); this.attribs = attribs; this.restricts = restricts;}
| 9,027
|
AttributedStringIterator(StringCharacterIterator sci, AttributedString.AttributeRange[] attribs, int begin_index, int end_index, AttributedCharacterIterator.Attribute[] restricts){ this.ci = new StringCharacterIterator(sci, begin_index, end_index); this.attribs = attribs; this.restricts = restricts;}
|
AttributedStringIterator(StringCharacterIterator sci, AttributedString.AttributeRange[] attribs, int begin_index, int end_index, AttributedCharacterIterator.Attribute[] restricts){ this.ci = new StringCharacterIterator(sci, begin_index, end_index); this.attribs = attribs; this.restricts = restricts;}
| 9,028
|
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; }
|
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 = 0; 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; }
| 9,029
|
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; }
|
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; }
| 9,030
|
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; }
|
public double parse() throws NumberFormatException { if (index >= chars.length) throw new NumberFormatException(); char sign = '+'; switch (chars[index]) { case '-': sign = '-'; break; case '+': sign = '+'; break; } if (index >= chars.length) throw new NumberFormatException(); double value; if (chars[index] == '.') { value = parseFractionalPart(true); value = parseExponent(value); } else { value = parseUnsignedInt(); if (index >= chars.length) throw new NumberFormatException(); if (chars[index] != '.') throw new NumberFormatException(); value += parseFractionalPart(false); value = parseExponent(value); } return (sign == '-') ? -value : value; }
| 9,031
|
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; }
|
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 = parseExponent(value); } return (sign == '-') ? -value : value; }
| 9,032
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
| 9,033
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
| 9,034
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
| 9,035
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
|
protected Object clone () { BaseObject cloneObj = null; try { cloneObj = (BaseObject) super.clone();Log.errorln("CLONING Orig:"+this+" Clone:"+cloneObj); // Clone the fields // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while ( keys.hasMoreElements() ) { Object key = keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get((String) key); cloneObj.attribHash.put((String) key, XMLAttributeValue.clone()); }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Error: Clone not supported by class "+this.getClass().toString()); } return (Object) cloneObj; }
| 9,036
|
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; }
|
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 || obj.attribType == Constants.STRING_OR_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; }
| 9,037
|
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; }
|
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; }
| 9,038
|
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value for (int i = 0; i < attrs.getLength (); i++) ((XMLAttribute) this.attribHash.get(attrs.getName(i))).setAttribValue(attrs.getValue(i)); } }
|
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value for (int i = 0; i < attrs.getLength (); i++) ((XMLAttribute) this.attribHash.get(attrs.getName(i))).setAttribValue(attrs.getValue(i)); } }
| 9,039
|
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); }
|
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 !=null) &&(!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); }
| 9,040
|
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); }
|
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); }
| 9,041
|
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); }
|
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); }
| 9,042
|
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); }
|
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) && (childObjs.size() !=0)) 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); }
| 9,043
|
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); }
|
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); }
| 9,044
|
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); }
|
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); }
| 9,045
|
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); }
|
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) { // 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) { 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 (!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); }
| 9,046
|
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); }
|
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+">"); } writeOut(outputstream, "</"+nodeNameString + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; 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 + "/>"); writeOut(outputstream, "</"+nodeNameString + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; } // 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, "/>"); } } writeOut(outputstream, "</"+nodeNameString + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; }
| 9,047
|
protected boolean disablePointer() throws DeviceException { log.debug("disablePointer"); return bus.writeMouseCommand(CMD_DISABLE); }
|
protected boolean disablePointer() throws DeviceException { log.debug("disablePointer"); return bus.writeMouseCommand(CMD_DISABLE); }
| 9,048
|
protected boolean enablePointer() throws DeviceException { log.debug("enablePointer"); return bus.writeMouseCommand(CMD_ENABLE); }
|
protected boolean enablePointer() throws DeviceException { log.debug("enablePointer"); return bus.writeMouseCommand(CMD_ENABLE); }
| 9,049
|
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); } }
|
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); } }
| 9,050
|
private final void setEnabled(boolean on) throws DeviceException { log.debug("Old mode 0x" + NumberUtils.hex(bus.getMode(), 2)); bus.setMouseEnabled(on); log.debug("New mode 0x" + NumberUtils.hex(bus.getMode(), 2)); }
|
private final void setEnabled(boolean on) throws DeviceException { log.debug("Old mode 0x" + NumberUtils.hex(bus.getMode(), 2)); bus.setMouseEnabled(on); log.debug("New mode 0x" + NumberUtils.hex(bus.getMode(), 2)); }
| 9,051
|
protected boolean setRate(int samples) throws DeviceException { return bus.writeMouseCommands(new int[] { CMD_SET_RATE, samples }); }
|
protected boolean setRate(int samples) throws DeviceException { return bus.writeMouseCommands(new int[] { CMD_SET_RATE, samples }); }
| 9,052
|
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(); } }
|
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(); } }
| 9,053
|
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); } }
|
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", oldModel, this.model); } }
| 9,054
|
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); } }
|
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); } }
| 9,055
|
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); } }
|
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); } }
| 9,056
|
public void error(Object message) { if (logLevel <= ERROR) System.err.println("ERROR ["+clazz+"] "+ message); }
|
public void error(Object message) { if (logLevel <= ERROR) System.err.println("ERROR ["+clazz+"] "+ message); }
| 9,057
|
public void fatal(Object message) { if (logLevel <= FATAL) System.err.println("FATAL ["+clazz+"] "+ message); }
|
public void fatal(Object message) { if (logLevel <= FATAL) System.err.println("FATAL ["+clazz+"] "+ message); }
| 9,058
|
public void info(Object message) { if (logLevel <= INFO) System.out.println("INFO ["+clazz+"] "+ message); }
|
public void info(Object message) { if (logLevel <= INFO) System.out.println("INFO ["+clazz+"] "+ message); }
| 9,059
|
public void warn(Object message) { if (logLevel <= WARN) System.out.println("WARN ["+clazz+"] "+ message); }
|
public void warn(Object message) { if (logLevel <= WARN) System.out.println("WARN ["+clazz+"] "+ message); }
| 9,060
|
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(); } }
|
public void addSessionView(String tabText,Session session) { if (hideTabBar && sessionPane.getTabCount() == 0 && !embedded) { this.getContentPane().add(session, BorderLayout.CENTER); session.grabFocus(); session.resizeMe(); session.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(); session.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(); session.repaint(); } }
| 9,061
|
public boolean containsSession(Session session) { return (sessionPane.indexOfComponent(session) >= 0); }
|
public boolean containsSession(Session session) { 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); }
| 9,062
|
public Session getSessionAt( int index) { return (Session)sessionPane.getComponentAt(index); }
|
public Session getSessionAt( int 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); }
| 9,063
|
public int getSessionViewCount() { return sessionPane.getTabCount(); }
|
public int getSessionViewCount() { 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(); }
| 9,064
|
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(); } } }
|
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(); } } }
| 9,065
|
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(); } } }
|
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(); } } }
| 9,066
|
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(); } } }
|
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(); } } }
| 9,067
|
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(); } } }
|
publicvoidremoveSessionView(SessiontargetSession){intindex=sessionPane.indexOfComponent(targetSession);System.out.println("sessionfoundandclosingdown"+index);targetSession.removeSessionListener(this);targetSession.removeSessionJumpListener(this);inttabs=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();}}}
| 9,068
|
protected void removeUpdate(DefaultDocumentEvent event) { reindex(); super.removeUpdate(event); }
|
protected void removeUpdate(DefaultDocumentEvent event) { super.removeUpdate(event); super.removeUpdate(event); }
| 9,069
|
protected void removeUpdate(DefaultDocumentEvent event) { reindex(); super.removeUpdate(event); }
|
protected void removeUpdate(DefaultDocumentEvent event) { reindex(); 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; } }
| 9,070
|
public int getHorizontalAlignment() { return align; }
|
public int getHorizontalAlignment() { return align; }
| 9,074
|
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); }
|
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 OID: " + name); } return new EMSA_PKCS1_V1_5(hash); }
| 9,075
|
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); }
|
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); }
| 9,077
|
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"))); } }
|
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"))); } }
| 9,078
|
public void addLayoutComponent (Component comp, Object constraints) { if (! (constraints instanceof String)) throw new IllegalArgumentException ("Object " + constraints + " is not a string"); tab.put (constraints, comp); }
|
public void addLayoutComponent (Component comp, Object constraints) { if (! (constraints instanceof String)) throw new IllegalArgumentException ("Object " + constraints + " is not a string"); addLayoutComponent ((String) constraints, comp); }
| 9,079
|
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 ); } }
|
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 ); } }
| 9,082
|
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 ); } }
|
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 = KeyMapper.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 ); } }
| 9,083
|
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 ); } }
|
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 ); } }
| 9,084
|
public int getViewIndex(int pos, Position.Bias b) { // FIXME: Handle bias somehow. return getViewIndexAtPosition(pos); }
|
if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; publicif (b == Position.Bias.Backward && pos != 0) pos -= 1; intif (b == Position.Bias.Backward && pos != 0) pos -= 1; getViewIndex(intif (b == Position.Bias.Backward && pos != 0) pos -= 1; pos,if (b == Position.Bias.Backward && pos != 0) pos -= 1; Position.Biasif (b == Position.Bias.Backward && pos != 0) pos -= 1; b)if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; {if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; //if (b == Position.Bias.Backward && pos != 0) pos -= 1; FIXME:if (b == Position.Bias.Backward && pos != 0) pos -= 1; Handleif (b == Position.Bias.Backward && pos != 0) pos -= 1; biasif (b == Position.Bias.Backward && pos != 0) pos -= 1; somehow.if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; returnif (b == Position.Bias.Backward && pos != 0) pos -= 1; getViewIndexAtPosition(pos);if (b == Position.Bias.Backward && pos != 0) pos -= 1; if (b == Position.Bias.Backward && pos != 0) pos -= 1; }
| 9,085
|
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; }
|
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; }
| 9,088
|
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; }
|
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; }
| 9,089
|
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); }
|
public Dimension getPreferredSize(JComponent c) { View v = getRootView(textComponent); float w = v.getPreferredSpan(View.X_AXIS); float h = v.getPreferredSpan(View.Y_AXIS); Insets i = c.getInsets(); return new Dimension((int) w + i.left + i.right, (int) h + i.top + i.bottom); }
| 9,090
|
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 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; }
| 9,091
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.