bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public void setEnabled(boolean enabled) { if (enabled != this.enabled) { this.enabled = enabled; firePropertyChange(ENABLED_PROPERTY, !this.enabled, this.enabled); } }
|
public void setEnabled(boolean enabled) { if (enabled != this.enabled) { this.enabled = enabled; firePropertyChange("enabled", !this.enabled, this.enabled); } }
| 6,294
|
protected final JTextComponent getFocusedComponent() { return null; // TODO }
|
protected final JTextComponent getFocusedComponent() { KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager(); Component focused = kfm.getPermanentFocusOwner(); JTextComponent textComp = null; if (focused instanceof JTextComponent) textComp = (JTextComponent) focused; return textComp; // TODO }
| 6,295
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
| 6,297
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
| 6,298
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
| 6,299
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on AttributeList. Just dumb copy for now. DataIOStyleAttribs = new Hashtable(); int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String value = attrs.getValue(i); if (value != null) DataIOStyleAttribs.put(name, value); } // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // save these for later, when we know what kind of dataIOstyle we got // Argh we really need a clone on AttributeList. Just dumb copy for now. DataIOStyleAttribs = new Hashtable(); int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String value = attrs.getValue(i); if (value != null) DataIOStyleAttribs.put(name, value); } // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); // this will be used in formatted/delimited reads to // set the iteration order of the locator that will populate // the datacube AxisReadOrder = new ArrayList(); return (Object) null; }
| 6,300
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle(CurrentArray); FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable (); CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj); } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle(CurrentArray); FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); RepeatFormattedIOCmd repeatObj = new RepeatFormattedIOCmd(); repeatObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { CurrentFormatObjectList.add(repeatObj); return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(repeatObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { CurrentFormatObjectList.add(repeatObj); return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(repeatObj); } else { Log.warnln("Warning: cant add RepeatFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
| 6,302
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle(CurrentArray); FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj); } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !DataIOStyleAttribs.isEmpty()) { // FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle(CurrentArray); FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); String readId = readObj.getReadId(); if (readId != null) { if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear(); // clear out table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); SkipCharFormattedIOCmd skipObj = new SkipCharFormattedIOCmd(); skipObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(skipObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(skipObj); } else { Log.warnln("Warning: cant add SkipCharFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
| 6,303
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // 1. re-init CurrentValueListParameter = new Hashtable(); // 2. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(); CurrentValueListParameter.put("parentNodeName", parentNodeName); // 3. populate ValueListparameters from attribute list int size = attrs.getLength(); for (int i = 0; i < size; i++) { String value; if ((value = attrs.getValue(i)) != null) CurrentValueListParameter.put(attrs.getName(i), value); } // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueListParameter.put("isDelimitedCase", "false"); return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // 1. re-init CurrentValueListParameter.clear(); // 2. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(); CurrentValueListParameter.put("parentNodeName", parentNodeName); // 3. populate ValueListparameters from attribute list int size = attrs.getLength(); for (int i = 0; i < size; i++) { String value; if ((value = attrs.getValue(i)) != null) CurrentValueListParameter.put(attrs.getName(i), value); } // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueListParameter.put("isDelimitedCase", "false"); return (Object) null; }
| 6,305
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // 1. re-init CurrentValueListParameter = new Hashtable(); // 2. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(); CurrentValueListParameter.put("parentNodeName", parentNodeName); // 3. populate ValueListparameters from attribute list int size = attrs.getLength(); for (int i = 0; i < size; i++) { String value; if ((value = attrs.getValue(i)) != null) CurrentValueListParameter.put(attrs.getName(i), value); } // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueListParameter.put("isDelimitedCase", "false"); return (Object) null; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // 1. re-init CurrentValueListParameter = new Hashtable(); // 2. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(); CurrentValueListParameter.put("parentNodeName", parentNodeName); // 3. populate ValueListparameters from attribute list int size = attrs.getLength(); for (int i = 0; i < size; i++) { String value; if ((value = attrs.getValue(i)) != null) CurrentValueListParameter.put(attrs.getName(i), value); } // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueListParameter.put("isDelimitedCase", "false"); return (Object) null; }
| 6,307
|
private void initStartHandlerHashtable () { startElementHandlerHashtable.put(XDFNodeName.ARRAY, new arrayStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.AXIS, new axisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.AXISUNITS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.BINARYFLOAT, new binaryFloatFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.BINARYINTEGER, new binaryIntegerFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.DATA, new dataStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.DATAFORMAT, new dataFormatStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.EXPONENT, new exponentFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELD, new fieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDAXIS, new fieldAxisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDRELATIONSHIP, new fieldRelationshipStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIXED, new fixedFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FORNODE, new forStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDGROUP, new fieldGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.INDEX, new noteIndexStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.INTEGER, new integerFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.LOCATIONORDER, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.NOTE, new noteStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.NOTES, new notesStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.PARAMETER, new parameterStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.PARAMETERGROUP, new parameterGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.READ, new readStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.READCELL, new readCellStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.REPEAT, new repeatStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.ROOT, new rootStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.SKIPCHAR, new skipCharStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.STRING, new stringFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.STRUCTURE, new structureStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TAGTOAXIS, new tagToAxisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD0, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD1, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD2, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD3, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD4, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD5, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD6, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD7, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD8, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TEXTDELIMITER, new asciiDelimiterStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNIT, new unitStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNITS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNITLESS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUE, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUEGROUP, new valueGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUELIST, new valueListStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VECTOR, new vectorStartElementHandlerFunc()); }
|
private void initStartHandlerHashtable () { startElementHandlerHashtable.put(XDFNodeName.ARRAY, new arrayStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.AXIS, new axisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.AXISUNITS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.BINARYFLOAT, new binaryFloatFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.BINARYINTEGER, new binaryIntegerFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.DATA, new dataStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.DATAFORMAT, new dataFormatStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.EXPONENT, new exponentFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELD, new fieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDAXIS, new fieldAxisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDRELATIONSHIP, new fieldRelationshipStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIXED, new fixedFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FORNODE, new forStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.FIELDGROUP, new fieldGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.INDEX, new noteIndexStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.INTEGER, new integerFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.LOCATIONORDER, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.NOTE, new noteStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.NOTES, new notesStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.PARAMETER, new parameterStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.PARAMETERGROUP, new parameterGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.READ, new readStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.READCELL, new readCellStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.REPEAT, new repeatStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.ROOT, new rootStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.SKIPCHAR, new skipCharStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.STRING, new stringFieldStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.STRUCTURE, new structureStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TAGTOAXIS, new tagToAxisStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD0, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD1, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD2, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD3, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD4, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD5, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD6, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD7, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TD8, new dataTagStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.TEXTDELIMITER, new asciiDelimiterStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNIT, new unitStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNITS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.UNITLESS, new nullStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUE, new valueStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUEGROUP, new valueGroupStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VALUELIST, new valueListStartElementHandlerFunc()); startElementHandlerHashtable.put(XDFNodeName.VECTOR, new vectorStartElementHandlerFunc()); }
| 6,308
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); setPassButton.setPreferredSize(new Dimension(150, 27)); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); password.setPreferredSize(new Dimension(password.getWidth(), 27)); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(); passPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5)); passPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10 , 0)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); setPassButton.setPreferredSize(new Dimension(150, 27)); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); password.setPreferredSize(new Dimension(password.getWidth(), 27)); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
| 6,309
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); setPassButton.setPreferredSize(new Dimension(150, 27)); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); password.setPreferredSize(new Dimension(password.getWidth(), 27)); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); password.setPreferredSize(new Dimension(password.getWidth(), 27)); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
| 6,310
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); setPassButton.setPreferredSize(new Dimension(150, 27)); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); password.setPreferredSize(new Dimension(password.getWidth(), 27)); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
|
private void createAccessPanel() { accessOptions = new TN5250jMultiSelectList(); if (props.getProperty("emul.accessDigest") != null) accessOptions.setEnabled(false); Vector options = OptionAccessFactory.getInstance().getOptions(); // set up a hashtable of option descriptions to options Hashtable ht = new Hashtable(options.size()); for (int x = 0; x < options.size(); x++) { ht.put(LangTool.getString("key." + options.get(x)), options.get(x)); } // get the sorted descriptions of the options Vector descriptions = OptionAccessFactory.getInstance().getOptionDescriptions(); // set the option descriptions accessOptions.setListData(descriptions); // we now mark the invalid options int num = OptionAccessFactory.getInstance().getNumberOfRestrictedOptions(); int[] si = new int[num]; int i = 0; for (int x = 0; x < descriptions.size(); x++) { if (!OptionAccessFactory .getInstance() .isValidOption((String) ht.get(descriptions.get(x)))) si[i++] = x; } accessOptions.setSelectedIndices(si); accessOptions.setSourceHeader(LangTool.getString("ss.labelActive") ,JLabel.CENTER); accessOptions.setSelectionHeader(LangTool.getString("ss.labelRestricted") ,JLabel.CENTER); // create emulator options panel accessPanel.setLayout(new BorderLayout()); accessPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 5)); accessPanel.add(accessOptions, BorderLayout.CENTER); JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); Action action = new AbstractAction(LangTool.getString("ss.labelSetPass")) { public void actionPerformed(ActionEvent e) { if (password.getPassword().length > 0) { try { DESSHA1 sha = new DESSHA1(); props.setProperty( "emul.accessDigest", sha.digest( new String(password.getPassword()), "tn5205j")); } catch (Exception ex) { } } } }; setPassButton = new JButton(action); setPassButton.setPreferredSize(new Dimension(150, 27)); if (props.getProperty("emul.accessDigest") != null) setPassButton.setEnabled(false); passPanel.add(setPassButton); password = new JPasswordField(15); password.setDocument(new CheckPasswordDocument()); passPanel.add(password); accessPanel.add(passPanel, BorderLayout.NORTH); }
| 6,311
|
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); }
|
public String getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); }
| 6,312
|
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); }
|
public DataFormat getDatatype() { return (String) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); }
| 6,313
|
private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); attribOrder.add(0,"paramId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value attribHash.put("noteList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("units", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("datatype", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("paramIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); //double check k.z. attribHash.put("paramId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); };
|
private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); attribOrder.add(0,"paramId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value attribHash.put("noteList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("units", new XMLAttribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put("datatype", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("paramIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); //double check k.z. attribHash.put("paramId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); };
| 6,314
|
public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); }
|
public String setDatatype(String strDatatype) { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); }
| 6,315
|
public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); }
|
public DataFormat setDatatype(DataFormat datatype) { if (Utility.isValidDatatype(strDatatype)) return (String) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(strDatatype); else return null; }
| 6,316
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final OrbFunctional orb = new OrbFunctional(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args[i].endsWith("ORBInitialPort")) port = Integer.parseInt(args[i + 1]); if (args[i].equals("-ior")) iorf = args[i + 1]; } OrbFunctional.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); // Case with the key "NameService". orb.connect(namer, "NameService".getBytes()); // Storing the IOR reference. String ior = orb.object_to_string(namer); IOR iorr = IOR.parse(ior); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath transient naming service " + "started at " + iorr.Internet.host + ":" + iorr.Internet.port + " key 'NameService'.\n\n" + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent // objects. OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT); }
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final OrbFunctional orb = new OrbFunctional(); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args[i].endsWith("ORBInitialPort")) port = Integer.parseInt(args[i + 1]); if (args[i].equals("-ior")) iorf = args[i + 1]; } OrbFunctional.setPort(port); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); // Case with the key "NameService". orb.connect(namer, "NameService".getBytes()); // Storing the IOR reference. String ior = orb.object_to_string(namer); IOR iorr = IOR.parse(ior); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath transient naming service " + "started at " + iorr.Internet.host + ":" + iorr.Internet.port + " key 'NameService'.\n\n" + "Copyright (C) 2006 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior); new Thread() { public void run() { // Wait for invocations from clients. orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } // Restore the default value for allocating ports for the subsequent // objects. OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT); }
| 6,317
|
public void shutdownOutput() { throw new InternalError ("PlainSocketImpl::shutdownOutput not implemented"); }
|
public void shutdownOutput() throws IOException { throw new InternalError ("PlainSocketImpl::shutdownOutput not implemented"); }
| 6,318
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font,int botOffset) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return;// botOffset = 4; switch (cursorSize) { case 0:// cursor.setRect(// fmWidth * (col),// (fmHeight * (row + 1)),// fmWidth,// 1// ); cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)) - botOffset, fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight - botOffset );// cursor.setRect(// fmWidth * (col),// (fmHeight * row) - lm.getLeading()-5,// fmWidth,// fmHeight// ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor); s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); s.updateImage(0,fmHeight * (row + 1)- botOffset,bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,(fmHeight * (row + 1)) - botOffset,bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font,int botOffset) {// synchronized (lock) { // if (g2 == null)// return;// botOffset = 4; switch (cursorSize) { case 0:// cursor.setRect(// fmWidth * (col),// (fmHeight * (row + 1)),// fmWidth,// 1// ); cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)) - botOffset, fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight - botOffset );// cursor.setRect(// fmWidth * (col),// (fmHeight * row) - lm.getLeading()-5,// fmWidth,// fmHeight// ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor); s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); s.updateImage(0,fmHeight * (row + 1)- botOffset,bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,(fmHeight * (row + 1)) - botOffset,bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 6,320
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) {// System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notify(); } }
|
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) {// System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notify(); } }
| 6,321
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) {// System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notify(); } }
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) {// System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notifyAll(); } }
| 6,323
|
public Graphics2D drawOIA (int fmWidth, int fmHeight, int numRows, int numCols, Font font, Color colorBg, Color colorBlue ) { Graphics2D g2d; // get ourselves a global pointer to the graphics g2d = (Graphics2D)bi.getGraphics(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2d.setFont(font); g2d.setColor(colorBg); g2d.fillRect(0,0,bi.getWidth(null),bi.getHeight(null)); tArea.setRect(0,0,bi.getWidth(null),(fmHeight * (numRows))); cArea.setRect(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1)); aArea.setRect(0,0,bi.getWidth(null),bi.getHeight(null)); sArea.setRect(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight); pArea.setRect(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight); mArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth, fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight); kbArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + (20 * fmWidth), fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight); scriptArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + (16 * fmWidth), fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight);// cArea = new Rectangle2D.Float(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1));// aArea = new Rectangle2D.Float(0,0,bi.getWidth(null),bi.getHeight(null));// sArea = new Rectangle2D.Float(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight);// pArea = new Rectangle2D.Float(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight);// mArea = new Rectangle2D.Float((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth,// fmHeight * (numRows + 1),// fmWidth + fmWidth,// fmHeight); separatorLine.setLine(0, (fmHeight * (numRows + 1)) - (fmHeight / 2), bi.getWidth(null), (fmHeight * (numRows + 1)) - (fmHeight / 2)); g2d.setColor(colorBlue); g2d.draw(separatorLine); return g2d; }
|
public Graphics2D drawOIA (int fmWidth, int fmHeight, int numRows, int numCols, Font font, Color colorBg, Color colorBlue ) { Graphics2D g2d; // get ourselves a global pointer to the graphics g2d = getDrawingArea(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2d.setFont(font); g2d.setColor(colorBg); g2d.fillRect(0,0,bi.getWidth(null),bi.getHeight(null)); tArea.setRect(0,0,bi.getWidth(null),(fmHeight * (numRows))); cArea.setRect(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1)); aArea.setRect(0,0,bi.getWidth(null),bi.getHeight(null)); sArea.setRect(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight); pArea.setRect(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight); mArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth, fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight); kbArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + (20 * fmWidth), fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight); scriptArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + (16 * fmWidth), fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight);// cArea = new Rectangle2D.Float(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1));// aArea = new Rectangle2D.Float(0,0,bi.getWidth(null),bi.getHeight(null));// sArea = new Rectangle2D.Float(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight);// pArea = new Rectangle2D.Float(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight);// mArea = new Rectangle2D.Float((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth,// fmHeight * (numRows + 1),// fmWidth + fmWidth,// fmHeight); separatorLine.setLine(0, (fmHeight * (numRows + 1)) - (fmHeight / 2), bi.getWidth(null), (fmHeight * (numRows + 1)) - (fmHeight / 2)); g2d.setColor(colorBlue); g2d.draw(separatorLine); return g2d; }
| 6,324
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) lock.wait(); // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println(" bi = null "); lock.wait(); // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
| 6,325
|
public BufferedImage getImageBuffer(int width, int height) { synchronized (lock) { if (bi == null || bi.getWidth() != width || bi.getHeight() != height) // allocate a buffer Image with appropriate size bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notify(); } return bi; }
|
public BufferedImage getImageBuffer(int width, int height) { synchronized (lock) { if (bi == null || bi.getWidth() != width || bi.getHeight() != height) { // allocate a buffer Image with appropriate size bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notify(); } return bi; }
| 6,329
|
public BufferedImage getImageBuffer(int width, int height) { synchronized (lock) { if (bi == null || bi.getWidth() != width || bi.getHeight() != height) // allocate a buffer Image with appropriate size bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notify(); } return bi; }
|
public BufferedImage getImageBuffer(int width, int height) { synchronized (lock) { if (bi == null || bi.getWidth() != width || bi.getHeight() != height) // allocate a buffer Image with appropriate size bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notifyAll(); } return bi; }
| 6,330
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) lock.wait(); // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } return g2; } } catch (InterruptedException ie) { System.out.println("getWritingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println( " bi = null wa "); lock.wait(); // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } return g2; } } catch (InterruptedException ie) { System.out.println("getWritingarea : " + ie.getMessage()); return null; } }
| 6,332
|
public void resize(int width, int height) { if (bi.getWidth() != width || bi.getHeight() != height) { synchronized (lock) { bi = null; bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notify(); } } }
|
public void resize(int width, int height) { if (bi.getWidth() != width || bi.getHeight() != height) { synchronized (lock) { bi = null; bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notifyAll(); } } }
| 6,334
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); // find out the desired sizes if (params != null) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? Object params = attributes.get(DH_PARAMETERS); // find out the desired sizes if (params != null) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
| 6,335
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); // find out the desired sizes if (params != null) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); // find out the desired sizes if (params instanceof DHGenParameterSpec) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
| 6,336
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); // find out the desired sizes if (params != null) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
|
public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of Diffie-Hellman generation parameters or we shall // use our own? DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); // find out the desired sizes if (params != null) { l = params.getPrimeSize(); m = params.getExponentSize(); } else { Integer bi = (Integer) attributes.get(PRIME_SIZE); l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue()); bi = (Integer) attributes.get(EXPONENT_SIZE); m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue()); } // if ((L % 256) != 0 || L < 1024) { if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE) { throw new IllegalArgumentException("invalid modulus size"); } if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE) { throw new IllegalArgumentException("invalid exponent size"); } if (m > l) { throw new IllegalArgumentException("exponent size > modulus size"); } // what is the preferred encoding format Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); }
| 6,337
|
public static boolean interrupted() { return currentThread().isInterrupted(); }
|
public static boolean interrupted() { VmThread current = VmThread.currentThread(); if (current != null) { return current.isInterrupted(true); } else { return false; } }
| 6,338
|
public boolean isInterrupted() { return vmThread.isInterrupted(); }
|
public boolean isInterrupted() { return vmThread.isInterrupted(false); }
| 6,339
|
public Dimension getPreferredScrollableViewportSize() { return preferredScrollableViewportSize; }
|
public Dimension getPreferredScrollableViewportSize() { return preferredViewportSize; }
| 6,341
|
protected void initializeLocalVars() { this.autoCreateColumnsFromModel = false; if (columnModel == null) { this.autoCreateColumnsFromModel = true; createColumnsFromModel(); } this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_ALL_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; this.dragEnabled = false; this.preferredScrollableViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; setIntercellSpacing(new Dimension(1,1)); setTableHeader(createDefaultTableHeader()); }
|
protected void initializeLocalVars() { this.autoCreateColumnsFromModel = false; if (columnModel == null) { this.autoCreateColumnsFromModel = true; createColumnsFromModel(); } this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_ALL_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; this.dragEnabled = false; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; setIntercellSpacing(new Dimension(1,1)); setTableHeader(createDefaultTableHeader()); }
| 6,342
|
public void setPreferredScrollableViewportSize(Dimension p) { preferredScrollableViewportSize = p; revalidate(); repaint(); }
|
public void setPreferredScrollableViewportSize(Dimension p) { preferredViewportSize = p; revalidate(); repaint(); }
| 6,343
|
void split(Element el, int offset) { if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; int startOffset = ael.getStartOffset(); int endOffset = ael.getEndOffset(); int len = endOffset - startOffset; if (startOffset != offset && endOffset != offset) { Element paragraph = ael.getParentElement(); if (paragraph instanceof BranchElement) { BranchElement par = (BranchElement) paragraph; Element child1 = createLeafElement(par, ael, startOffset, offset); Element child2 = createLeafElement(par, ael, offset, endOffset); int index = par.getElementIndex(startOffset); par.replace(index, 1, new Element[]{ child1, child2 }); } else throw new AssertionError("paragraph elements are expected to " + "be instances of " + "javax.swing.text.AbstractDocument.BranchElement"); } } else throw new AssertionError("content elements are expected to be " + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); }
|
void split(Element el, int offset) { if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; int startOffset = ael.getStartOffset(); int endOffset = ael.getEndOffset(); int len = endOffset - startOffset; if (startOffset != offset && endOffset != offset) { Element paragraph = ael.getParentElement(); if (paragraph instanceof BranchElement) { BranchElement par = (BranchElement) paragraph; Element child1 = createLeafElement(par, ael, startOffset, offset); Element child2 = createLeafElement(par, ael, offset, endOffset); int index = par.getElementIndex(startOffset); Element[] add = new Element[]{ child1, child2 }; par.replace(index, 1, add); documentEvent.addEdit(new ElementEdit(par, index, new Element[]{ el }, add)); } else throw new AssertionError("paragraph elements are expected to " + "be instances of " + "javax.swing.text.AbstractDocument.BranchElement"); } } else throw new AssertionError("content elements are expected to be " + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); }
| 6,344
|
public Element getParagraphElement(int position) { Element element = getCharacterElement(position); return element.getParentElement(); }
|
public Element getParagraphElement(int position) { Element element = getCharacterElement(position); return element.getParentElement(); }
| 6,345
|
public int getFreeBlocksCount() { return Ext2Utils.get16(data, 12); }
|
public synchronized int getFreeBlocksCount() { return Ext2Utils.get16(data, 12); }
| 6,347
|
public int getFreeInodesCount() { return Ext2Utils.get16(data, 14); }
|
public synchronized int getFreeInodesCount() { return Ext2Utils.get16(data, 14); }
| 6,348
|
public int getUsedDirsCount() { return Ext2Utils.get16(data, 16); }
|
public synchronized int getUsedDirsCount() { return Ext2Utils.get16(data, 16); }
| 6,349
|
public void setFreeBlocksCount(int count) { Ext2Utils.set16(data, 12, count); setDirty(true); }
|
public synchronized void setFreeBlocksCount(int count) { Ext2Utils.set16(data, 12, count); setDirty(true); }
| 6,350
|
public void setFreeInodesCount(int count) { Ext2Utils.set16(data, 14, count); setDirty(true); }
|
public synchronized void setFreeInodesCount(int count) { Ext2Utils.set16(data, 14, count); setDirty(true); }
| 6,351
|
public void setUsedDirsCount(int count) { Ext2Utils.set16(data, 16, count); setDirty(true); }
|
public synchronized void setUsedDirsCount(int count) { Ext2Utils.set16(data, 16, count); setDirty(true); }
| 6,352
|
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); }
|
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); }
| 6,353
|
public byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { //check if the block has already been retrieved if(blockCache.containsKey(key)) result=(Block)blockCache.get(key); else{ byte[] data = new byte[blockSize]; getApi().read( nr*blockSize, data, 0, blockSize ); //timedRead(nr, data); result=new Block(this, nr, data); blockCache.put(key, result); } } return result.getData(); }
|
public byte[] getBlock(long nr) throws IOException{ if(isClosed()) throw new IOException("FS closed (fs instance: "+this+")"); //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { //check if the block has already been retrieved if(blockCache.containsKey(key)) result=(Block)blockCache.get(key); else{ byte[] data = new byte[blockSize]; getApi().read( nr*blockSize, data, 0, blockSize ); //timedRead(nr, data); result=new Block(this, nr, data); blockCache.put(key, result); } } return result.getData(); }
| 6,354
|
protected void modifyFreeBlocksCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); } synchronized(superblock) { superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } }
|
protected void modifyFreeBlocksCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); } synchronized(superblock) { superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } }
| 6,355
|
protected void modifyFreeBlocksCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); } synchronized(superblock) { superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } }
|
protected void modifyFreeBlocksCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); } synchronized(superblock) { superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } }
| 6,356
|
protected void modifyFreeInodesCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); } synchronized(superblock) { superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } }
|
protected void modifyFreeInodesCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); } synchronized(superblock) { superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } }
| 6,357
|
protected void modifyUsedDirsCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } }
|
protected void modifyUsedDirsCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } }
| 6,358
|
protected void updateFS() throws IOException { //updating one group descriptor updates all its copies for(int i=0; i<groupCount; i++) groupDescriptors[i].updateGroupDescriptors(); superblock.update(); }
|
protected void updateFS() throws IOException { //updating one group descriptor updates all its copies for(int i=0; i<groupCount; i++) groupDescriptors[i].updateGroupDescriptor(); superblock.update(); }
| 6,359
|
RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; }
|
RETokenOneOf(int subIndex, String optionsStr, boolean negative, boolean insens) { super(subIndex); this.options = options; this.negative = negative; }
| 6,360
|
RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; }
|
RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); options = new Vector(); this.negative = negative; }
| 6,361
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); XMLDeclaration xmlDecl = new XMLDeclaration(); DocumentType doctype = new DocumentType(xdf); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
| 6,363
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table.dat"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
| 6,364
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
| 6,365
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
|
public static void main (String [] args) throws SetDataException, IOException { XDF xdf = new XDF(); Structure structure = new Structure(); Array array = new Array(); FieldAxis fieldAxis = new FieldAxis(); fieldAxis.setName("Column"); fieldAxis.setAxisId("column_id"); Axis axis = new Axis(ROW); axis.setName("row"); axis.setAxisId("row_id"); FieldGroup fieldGroup = new FieldGroup(); fieldGroup.setName("fieldGroup"); fieldGroup.setDescription("fieldGroup description"); IntegerDataFormat dateFormat = new IntegerDataFormat(); dateFormat.setWidth(new Integer(32)); Field field1 = new Field (); field1.setName("field1"); field1.setDescription("field1-description"); field1.setFieldId ("field1-id"); field1.setDataFormat(dateFormat); Field field2 = new Field (); field2.setName("field2"); field2.setDescription("field2-description"); field2.setFieldId ("field2-id"); field2.setDataFormat(dateFormat); fieldGroup.addMemberObject(field1); fieldGroup.addMemberObject(field2); fieldAxis.addFieldGroup(fieldGroup); fieldAxis.addField(field1); fieldAxis.addField(field2); array.addAxis (axis); array.setFieldAxis (fieldAxis); Locator locator = array.createLocator(); Vector list = new Vector (); list.add(axis); list.add(fieldAxis); locator.setIterationOrder(list); for (int i=0; i<ROW; i++) { for (int j=0; j<COL; j++) { array.setData(locator,i+j); locator.next(); } } // the following 4 lines to declear the data will be written to // a seperate file, xdf_table; Entity href = new Entity(); href.setName("xdf_table"); href.setSystemId("xdf_table"); array.setHref(href); // the following 6 lines to set write out style: formatted style // otherwise, data will be in tagged format /* FormattedXMLDataIOStyle xmlIOStyle = new FormattedXMLDataIOStyle(array); List cmdList = new Vector(); ReadCellFormattedIOCmd readCell = new ReadCellFormattedIOCmd(); cmdList.add(readCell); xmlIOStyle.setFormatCommandList(cmdList); array.setXMLDataIOStyle(xmlIOStyle); */ structure.addArray(array); xdf.addStructure(structure); Specification.getInstance().setPrettyXDFOutput(true); Specification.getInstance().setPrettyXDFOutputIndentation(" "); Writer wo = new OutputStreamWriter(System.out); xdf.toXMLWriter(wo); wo.flush(); wo.close(); }
| 6,366
|
public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copyed"); }
|
public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copied"); }
| 6,367
|
private void checkProperties(Properties props) { if (props == null) { return; } Enumeration names = props.propertyNames(); java.lang.Object key; String sk; while (names.hasMoreElements()) { key = names.nextElement(); if (key != null) { sk = key.toString(); if (sk.startsWith(m_prefix)) { try { String cn = sk.substring(m_prefix.length()); Class iClass = Class.forName(cn); ORBInitializer initializer = (ORBInitializer) iClass.newInstance(); m_initializers.add(initializer); } catch (Exception exc) { // OMG states we should not throw an exception, but // this will help the user to detect his error // in initialiser properties. Should never print during // normal run. System.err.println(sk + " failed"); } } } } }
|
private void checkProperties(Properties props) { if (props == null) { return; } Enumeration names = props.propertyNames(); java.lang.Object key; String sk; while (names.hasMoreElements()) { key = names.nextElement(); if (key != null) { sk = key.toString(); if (sk.startsWith(m_prefix)) { try { String cn = sk.substring(m_prefix.length()); Class iClass = ObjectCreator.forName(cn); ORBInitializer initializer = (ORBInitializer) iClass.newInstance(); m_initializers.add(initializer); } catch (Exception exc) { // OMG states we should not throw an exception, but // this will help the user to detect his error // in initialiser properties. Should never print during // normal run. System.err.println(sk + " failed"); } } } } }
| 6,368
|
public static void setBold(MutableAttributeSet a, boolean b) { a.addAttribute(Bold, new Boolean(b)); }
|
public static void setBold(MutableAttributeSet a, boolean b) { a.addAttribute(Bold, Boolean.valueOf(b)); }
| 6,369
|
public static void setItalic(MutableAttributeSet a, boolean b) { a.addAttribute(Italic, new Boolean(b)); }
|
public static void setItalic(MutableAttributeSet a, boolean b) { a.addAttribute(Italic, Boolean.valueOf(b)); }
| 6,370
|
public static void setStrikeThrough(MutableAttributeSet a, boolean b) { a.addAttribute(StrikeThrough, new Boolean(b)); }
|
public static void setStrikeThrough(MutableAttributeSet a, boolean b) { a.addAttribute(StrikeThrough, Boolean.valueOf(b)); }
| 6,371
|
public static void setSubscript(MutableAttributeSet a, boolean b) { a.addAttribute(Subscript, new Boolean(b)); }
|
public static void setSubscript(MutableAttributeSet a, boolean b) { a.addAttribute(Subscript, Boolean.valueOf(b)); }
| 6,372
|
public static void setSuperscript(MutableAttributeSet a, boolean b) { a.addAttribute(Superscript, new Boolean(b)); }
|
public static void setSuperscript(MutableAttributeSet a, boolean b) { a.addAttribute(Superscript, Boolean.valueOf(b)); }
| 6,373
|
public static void setUnderline(MutableAttributeSet a, boolean b) { a.addAttribute(Underline, new Boolean(b)); }
|
public static void setUnderline(MutableAttributeSet a, boolean b) { a.addAttribute(Underline, Boolean.valueOf(b)); }
| 6,374
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; int dot = getDot(); try { area = getComponent().modelToView(dot); } catch (BadLocationException e) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (area != null) damage(area); } repaint(); }
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; int dot = getDot(); try { area = getComponent().modelToView(dot); } catch (BadLocationException e) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (area != null) damage(area); } repaint(); }
| 6,376
|
public void install(JTextComponent c) { textComponent = c; textComponent.addFocusListener(this); textComponent.addMouseListener(this); textComponent.addMouseMotionListener(this); propertyChangeListener = new PropertyChangeHandler(); textComponent.addPropertyChangeListener(propertyChangeListener); documentListener = new DocumentHandler(); textComponent.getDocument().addDocumentListener(documentListener); active = textComponent.isEditable() && textComponent.isEnabled(); repaint(); }
|
public void install(JTextComponent c) { textComponent = c; textComponent.addFocusListener(this); textComponent.addMouseListener(this); textComponent.addMouseMotionListener(this); propertyChangeListener = new PropertyChangeHandler(); textComponent.addPropertyChangeListener(propertyChangeListener); documentListener = new DocumentHandler(); Document doc = textComponent.getDocument(); if (doc != null) doc.addDocumentListener(documentListener); active = textComponent.isEditable() && textComponent.isEnabled(); repaint(); }
| 6,377
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
|
public void mousePressed(MouseEvent event) { // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
| 6,378
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
| 6,379
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
| 6,380
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
|
public void mousePressed(MouseEvent event) { int button = event.getButton(); // The implementation assumes that consuming the event makes the AWT event // mechanism forget about this event instance and not transfer focus. // By observing how the RI reacts the following behavior has been // implemented (in regard to text components): // - a left-click moves the caret // - a left-click when shift is held down expands the selection // - a right-click or click with any additional mouse button // on a text component is ignored // - a middle-click positions the caret and pastes the clipboard // contents. // - a middle-click when shift is held down is ignored if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) moveCaret(event); else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume(); }
| 6,381
|
public void paint(Graphics g) { JTextComponent comp = getComponent(); if (comp == null) return; // Make sure the dot has a sane position. dot = Math.min(dot, textComponent.getDocument().getLength()); dot = Math.max(dot, 0); Rectangle rect = null; try { rect = textComponent.modelToView(dot); } catch (BadLocationException e) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (rect == null) return; // Check if paint has possibly been called directly, without a previous // call to damage(). In this case we need to do some cleanup first. if ((x != rect.x) || (y != rect.y)) { repaint(); // Erase previous location of caret. x = rect.x; y = rect.y; width = 1; height = rect.height; } // Now draw the caret on the new position if visible. if (visible && active) { g.setColor(textComponent.getCaretColor()); g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height - 1); } }
|
public void paint(Graphics g) { JTextComponent comp = getComponent(); if (comp == null) return; // Make sure the dot has a sane position. dot = Math.min(dot, textComponent.getDocument().getLength()); dot = Math.max(dot, 0); Rectangle rect = null; try { rect = textComponent.modelToView(dot); } catch (BadLocationException e) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (rect == null) return; // Check if paint has possibly been called directly, without a previous // call to damage(). In this case we need to do some cleanup first. if ((x != rect.x) || (y != rect.y)) { repaint(); // Erase previous location of caret. x = rect.x; y = rect.y; width = 1; height = rect.height; } // Now draw the caret on the new position if visible. if (visible && active) { g.setColor(textComponent.getCaretColor()); g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height - 1); } }
| 6,382
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJDialog(); return accessibleContext; }
| 6,383
|
protected EditorKit createDefaultEditorKit() { return null; // TODO } // createDefaultEditorKit()
|
protected EditorKit createDefaultEditorKit() { return super.createDefaultEditorKit(); // TODO } // createDefaultEditorKit()
| 6,384
|
protected String paramString() { return null; // TODO } // paramString()
|
protected String paramString() { return super.paramString(); // TODO } // paramString()
| 6,385
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( 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 (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 6,389
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
| 6,390
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 6,391
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( 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 (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 6,392
|
protected void resolve() { // Do nothing }
|
protected void resolve(PluginRegistryModel registry) { // Do nothing }
| 6,393
|
protected void unresolve() { // Do nothing }
|
protected void unresolve(PluginRegistryModel registry) { // Do nothing }
| 6,394
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
|
public static IKeyPairCodec getInstance(String name) if (name == null) return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
| 6,395
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); return result;
| 6,396
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
| 6,397
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } return result; }
|
public static IKeyPairCodec getInstance(String name) { if (name == null) { return null; } name = name.trim(); IKeyPairCodec result = null; if (name.equalsIgnoreCase(Registry.DSA_KPG) || name.equals(Registry.DSS_KPG)) { result = new DSSKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.RSA_KPG)) { result = new RSAKeyPairRawCodec(); } else if (name.equalsIgnoreCase(Registry.DH_KPG)) { result = makeInstance ("gnu.javax.crypto.key.dh.DHKeyPairRawCodec"); } else if (name.equalsIgnoreCase(Registry.SRP_KPG)) { result = makeInstance ("gnu.javax.crypto.key.srp6.SRPKeyPairRawCodec"); } if (name.startsWith("/")) return null; if (name.endsWith("/")) return getInstance(name.substring(0, name.length() - 1), Registry.RAW_ENCODING_ID); int i = name.indexOf("/"); if (i == -1) return getInstance(name, Registry.RAW_ENCODING_ID); String kpgName = name.substring(0, i); String formatName = name.substring(i + 1); return getInstance(kpgName, formatName); }
| 6,398
|
public static final Set getNames() { return KeyPairGeneratorFactory.getNames(); }
|
public static synchronized final Set getNames() { return KeyPairGeneratorFactory.getNames(); }
| 6,399
|
public static final Set getNames() { return KeyPairGeneratorFactory.getNames(); }
|
public static final Set getNames() { if (names == null) { HashSet hs = new HashSet(); hs.add(Registry.DSS_KPG + "/" + Registry.RAW_ENCODING_SHORT_NAME); hs.add(Registry.DSS_KPG + "/" + Registry.X509_ENCODING_SORT_NAME); hs.add(Registry.DSS_KPG + "/" + Registry.PKCS8_ENCODING_SHORT_NAME); hs.add(Registry.RSA_KPG + "/" + Registry.RAW_ENCODING_SHORT_NAME); hs.add(Registry.RSA_KPG + "/" + Registry.X509_ENCODING_SORT_NAME); hs.add(Registry.RSA_KPG + "/" + Registry.PKCS8_ENCODING_SHORT_NAME); hs.add(Registry.DH_KPG + "/" + Registry.RAW_ENCODING_SHORT_NAME); hs.add(Registry.SRP_KPG + "/" + Registry.RAW_ENCODING_SHORT_NAME); names = Collections.unmodifiableSet(hs); } return names; }
| 6,400
|
public Object clone() throws CloneNotSupportedException { return super.clone(); }
|
public Object clone() throws CloneNotSupportedException { BasePRNG result = (BasePRNG) super.clone(); if (this.buffer != null) result.buffer = (byte[])this.buffer.clone(); return result; }
| 6,401
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); DerUtil.checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,402
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); DerUtil.checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,403
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); DerUtil.checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,404
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,405
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,406
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,407
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dsaPub = new DERReader(yBytes); val = dsaPub.read(); DerUtil.checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y); }
| 6,408
|
public void dump(PrintStream stream, int indent) { String indentStr = ""; for (int i = 0; i < indent; ++i) indentStr += " "; dumpElement(stream, indentStr, this); }
|
public void dump(PrintStream stream, int indent) { StringBuffer b = new StringBuffer(); for (int i = 0; i < indent; ++i) indentStr += " "; dumpElement(stream, indentStr, this); }
| 6,409
|
public void dump(PrintStream stream, int indent) { String indentStr = ""; for (int i = 0; i < indent; ++i) indentStr += " "; dumpElement(stream, indentStr, this); }
|
public void dump(PrintStream stream, int indent) { String indentStr = ""; for (int i = 0; i < indent; ++i) indentStr += " "; dumpElement(stream, indentStr, this); }
| 6,410
|
protected Content getContent() { return content; }
|
protected Content getContent() { return content; }
| 6,411
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.