rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
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); } | DataIOStyleAttribs.clear(); DataIOStyleAttribs = attribListToHashtable(attrs); | 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; } |
String readIdRef = (String) DataIOStyleAttribs.get("readIdRef"); if (readIdRef != null) { XMLDataIOStyle readObj = null; if (ReadObj.containsKey(readIdRef)) { XMLDataIOStyle refReadObj = (XMLDataIOStyle) ReadObj.get(readIdRef); try { readObj = (XMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone XMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\""); Log.warnln("but no previous read node has that id! Ignoring add request."); return (Object) null; } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs.clear(); CurrentFormatObjectList.add(readObj); } | 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; } |
|
DataIOStyleAttribs = new Hashtable (); | if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } DataIOStyleAttribs.clear(); | 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; } |
DataIOStyleAttribs = new Hashtable(); | 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(); | 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; } |
ValueAttribs.clear(); | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name // this special call will find the first parent node name // that doesnt match XDFNodeName.VALUEGROUP String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); // String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue);// } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) )// {//// } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } } |
|
CurrentValueListParameter = new Hashtable(); | CurrentValueListParameter.clear(); | 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; } |
CurrentValueListParameter = attribListToHashtable(attrs); | 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; } |
|
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); } | 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; } |
|
startElementHandlerHashtable.put(XDFNodeName.VALUE, new nullStartElementHandlerFunc()); | startElementHandlerHashtable.put(XDFNodeName.VALUE, new valueStartElementHandlerFunc()); | 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()); } |
JPanel passPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); | JPanel passPanel = new JPanel(); passPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5)); passPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10 , 0)); | 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); } |
setPassButton.setPreferredSize(new Dimension(150, 27)); | 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); } |
|
password.setPreferredSize(new Dimension(password.getWidth(), 27)); | 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); } |
|
public DataFormat getDatatype() | public String getDatatype() | public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); } |
return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); | return (String) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); | public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).getAttribValue(); } |
attribHash.put("units", new XMLAttribute(null, Constants.OBJECT_TYPE)); | attribHash.put("units", new XMLAttribute(new Units(), Constants.OBJECT_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(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)); }; |
public DataFormat setDatatype(DataFormat datatype) | public String setDatatype(String strDatatype) | public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); } |
return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); | if (Utility.isValidDatatype(strDatatype)) return (String) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(strDatatype); else return null; | public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("datatype")).setAttribValue(datatype); } |
+ "Copyright (C) 2005 Free Software Foundation\n" | + "Copyright (C) 2006 Free Software Foundation\n" | 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 void shutdownOutput() | public void shutdownOutput() throws IOException | public void shutdownOutput() { throw new InternalError ("PlainSocketImpl::shutdownOutput not implemented"); } |
Graphics2D g2 = getDrawingArea(); | 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();// } } |
|
Graphics2D g2 = getDrawingArea(); | 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 synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { | public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { | 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(); } } |
System.out.println(" we got a null graphic object "); | 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(); } } |
|
lock.notify(); | lock.notifyAll(); | 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(); } } |
g2d = (Graphics2D)bi.getGraphics(); | g2d = getDrawingArea(); | 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; } |
while (bi == null) | while (bi == null) { System.out.println(" bi = null "); | 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) 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; } } |
|
lock.notifyAll(); | 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; } } |
|
lock.notifyAll(); | public int getHeight() { synchronized (lock) { return bi.getHeight(); } } |
|
if (bi == null || bi.getWidth() != width || bi.getHeight() != height) | if (bi == null || bi.getWidth() != width || bi.getHeight() != height) { | 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; } |
lock.notify(); | lock.notifyAll(); | 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; } |
lock.notifyAll(); | public int getWidth() { synchronized (lock) { return bi.getWidth(); } } |
|
while (bi == null) | while (bi == null) { System.out.println( " bi = null wa "); | 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; } } |
lock.notifyAll(); | 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; } } |
|
lock.notify(); | lock.notifyAll(); | 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(); } } } |
DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS); | Object params = attributes.get(DH_PARAMETERS); | 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(); } |
if (params != null) | if (params instanceof DHGenParameterSpec) | 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(); } |
l = params.getPrimeSize(); m = params.getExponentSize(); | DHGenParameterSpec jceSpec = (DHGenParameterSpec) params; l = jceSpec.getPrimeSize(); m = jceSpec.getExponentSize(); } else if (params instanceof DHParameterSpec) { DHParameterSpec jceSpec = (DHParameterSpec) params; l = jceSpec.getP().bitLength(); m = jceSpec.getL(); | 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(); } |
return currentThread().isInterrupted(); | VmThread current = VmThread.currentThread(); if (current != null) { return current.isInterrupted(true); } else { return false; } | public static boolean interrupted() { return currentThread().isInterrupted(); } |
return vmThread.isInterrupted(); | return vmThread.isInterrupted(false); | public boolean isInterrupted() { return vmThread.isInterrupted(); } |
if (vmThread.isInterrupted(true)) { throw new InterruptedException(); } | public final synchronized void join() throws InterruptedException { while (isAlive()) { /* wait sets this.state = WAITING; */ wait(); /* wait sets this.state = RUNNING; */ } } |
|
return preferredScrollableViewportSize; | return preferredViewportSize; | public Dimension getPreferredScrollableViewportSize() { return preferredScrollableViewportSize; } |
this.preferredScrollableViewportSize = new Dimension(450,400); | this.preferredViewportSize = new Dimension(450,400); | 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()); } |
preferredScrollableViewportSize = p; | preferredViewportSize = p; | public void setPreferredScrollableViewportSize(Dimension p) { preferredScrollableViewportSize = p; revalidate(); repaint(); } |
par.replace(index, 1, new Element[]{ child1, child2 }); | Element[] add = new Element[]{ child1, child2 }; par.replace(index, 1, add); documentEvent.addEdit(new ElementEdit(par, index, new Element[]{ el }, add)); | 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"); } |
Element element = getCharacterElement(position); return element.getParentElement(); | BranchElement root = (BranchElement) getDefaultRootElement(); int start = root.getStartOffset(); int end = root.getEndOffset(); if (position >= end) position = end - 1; else if (position < start) position = start; Element par = root.positionToElement(position); assert par != null : "The paragraph element must not be null"; return par; | public Element getParagraphElement(int position) { Element element = getCharacterElement(position); return element.getParentElement(); } |
fireChangedUpdate(ev); | public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } } |
|
public int getFreeBlocksCount() { | public synchronized int getFreeBlocksCount() { | public int getFreeBlocksCount() { return Ext2Utils.get16(data, 12); } |
public int getFreeInodesCount() { | public synchronized int getFreeInodesCount() { | public int getFreeInodesCount() { return Ext2Utils.get16(data, 14); } |
public int getUsedDirsCount() { | public synchronized int getUsedDirsCount() { | public int getUsedDirsCount() { return Ext2Utils.get16(data, 16); } |
public void setFreeBlocksCount(int count) { | public synchronized void setFreeBlocksCount(int count) { | public void setFreeBlocksCount(int count) { Ext2Utils.set16(data, 12, count); setDirty(true); } |
public void setFreeInodesCount(int count) { | public synchronized void setFreeInodesCount(int count) { | public void setFreeInodesCount(int count) { Ext2Utils.set16(data, 14, count); setDirty(true); } |
public void setUsedDirsCount(int count) { | public synchronized void setUsedDirsCount(int count) { | public void setUsedDirsCount(int count) { Ext2Utils.set16(data, 16, count); setDirty(true); } |
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(); } |
|
synchronized(blockCache) { if(blockCache.containsKey(key)) result=(Block)blockCache.get(key); else{ byte[] data = new byte[blockSize]; getApi().read( nr*blockSize, data, 0, blockSize ); result=new Block(this, nr, data); blockCache.put(key, result); } } return result.getData(); | synchronized(blockCache) { if(blockCache.containsKey(key)) { result=(Block)blockCache.get(key); return result.getData(); } } byte[] data = new byte[blockSize]; getApi().read( nr*blockSize, data, 0, blockSize ); synchronized(blockCache) { if(!blockCache.containsKey(key)) { result=new Block(this, nr, data); blockCache.put(key, result); return result.getData(); } else { result=(Block)blockCache.get(key); 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(); } |
synchronized(gdesc) { gdesc.setFreeBlocksCount( gdesc.getFreeBlocksCount()+diff ); } | gdesc.setFreeBlocksCount( gdesc.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 ); } } |
synchronized(superblock) { superblock.setFreeBlocksCount( superblock.getFreeBlocksCount()+diff ); } | 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 ); } } |
synchronized(gdesc) { gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); } synchronized(superblock) { superblock.setFreeInodesCount( superblock.getFreeInodesCount()+diff ); } | gdesc.setFreeInodesCount( gdesc.getFreeInodesCount()+diff ); 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 ); } } |
synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } | gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); | protected void modifyUsedDirsCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } } |
groupDescriptors[i].updateGroupDescriptors(); | groupDescriptors[i].updateGroupDescriptor(); | 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(); } |
RETokenOneOf(int subIndex, Vector options, boolean negative) { | RETokenOneOf(int subIndex, String optionsStr, boolean negative, boolean insens) { | RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; } |
this.options = options; | options = new Vector(); | RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; } |
for (int i = 0; i < optionsStr.length(); i++) options.addElement(new RETokenChar(subIndex,optionsStr.charAt(i),insens)); | RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; } |
|
Structure structure = new Structure(); | XMLDeclaration xmlDecl = new XMLDeclaration(); DocumentType doctype = new DocumentType(xdf); | 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(); } |
href.setSystemId("xdf_table"); | href.setSystemId("xdf_table.dat"); | 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(); } |
structure.addArray(array); xdf.addStructure(structure); | xdf.addArray(array); | 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(); } |
System.out.println("-----\nPRINT OUT STRUCTURE\n-----"); | 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(); } |
|
System.out.println(nbCopyedFile + " file(s) copyed"); | System.out.println(nbCopyedFile + " file(s) copied"); | public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copyed"); } |
Class iClass = Class.forName(cn); | Class iClass = ObjectCreator.forName(cn); | 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"); } } } } } |
a.addAttribute(Bold, new Boolean(b)); | a.addAttribute(Bold, Boolean.valueOf(b)); | public static void setBold(MutableAttributeSet a, boolean b) { a.addAttribute(Bold, new Boolean(b)); } |
a.addAttribute(Italic, new Boolean(b)); | a.addAttribute(Italic, Boolean.valueOf(b)); | public static void setItalic(MutableAttributeSet a, boolean b) { a.addAttribute(Italic, new Boolean(b)); } |
a.addAttribute(StrikeThrough, new Boolean(b)); | a.addAttribute(StrikeThrough, Boolean.valueOf(b)); | public static void setStrikeThrough(MutableAttributeSet a, boolean b) { a.addAttribute(StrikeThrough, new Boolean(b)); } |
a.addAttribute(Subscript, new Boolean(b)); | a.addAttribute(Subscript, Boolean.valueOf(b)); | public static void setSubscript(MutableAttributeSet a, boolean b) { a.addAttribute(Subscript, new Boolean(b)); } |
a.addAttribute(Superscript, new Boolean(b)); | a.addAttribute(Superscript, Boolean.valueOf(b)); | public static void setSuperscript(MutableAttributeSet a, boolean b) { a.addAttribute(Superscript, new Boolean(b)); } |
a.addAttribute(Underline, new Boolean(b)); | a.addAttribute(Underline, Boolean.valueOf(b)); | public static void setUnderline(MutableAttributeSet a, boolean b) { a.addAttribute(Underline, new Boolean(b)); } |
if (newDoc != null) | public void propertyChange(PropertyChangeEvent e) { String name = e.getPropertyName(); if (name.equals("document")) { Document oldDoc = (Document) e.getOldValue(); oldDoc.removeDocumentListener(documentListener); Document newDoc = (Document) e.getNewValue(); newDoc.addDocumentListener(documentListener); } else if (name.equals("editable")) { active = (((Boolean) e.getNewValue()).booleanValue() && textComponent.isEnabled()); } else if (name.equals("enabled")) { active = (((Boolean) e.getNewValue()).booleanValue() && textComponent.isEditable()); } } |
|
AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; | 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(); } |
|
textComponent.getDocument().addDocumentListener(documentListener); | Document doc = textComponent.getDocument(); if (doc != null) doc.addDocumentListener(documentListener); | 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(); } |
int button = event.getButton(); | 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(); } |
|
if (button == MouseEvent.BUTTON1) if (event.isShiftDown()) | if (SwingUtilities.isLeftMouseButton(event)) { if (event.isShiftDown() && getDot() != -1) { | 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(); } |
else positionCaret(event); else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) 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(); } |
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(); } |
AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; | 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); } } |
|
return null; | if (accessibleContext == null) accessibleContext = new AccessibleJDialog(); return accessibleContext; | public AccessibleContext getAccessibleContext() { return null; } |
return null; | return super.createDefaultEditorKit(); | protected EditorKit createDefaultEditorKit() { return null; // TODO } // createDefaultEditorKit() |
return null; | return super.paramString(); | protected String paramString() { return null; // TODO } // paramString() |
super.replaceSelection(content); | public void replaceSelection(String content) { // TODO } // replaceSelection() |
|
super.setDocument(document); | public void setDocument(Document document) { // TODO } // setDocument() |
|
super.setEditorKit(editor); | public final void setEditorKit(EditorKit editor) { // TODO } // setEditorKit() |
|
if (sPrettyXDFOutput) writeOut(outputstream, indent); | if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); | 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); } |
if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); | if (Specification.getInstance().isPrettyXDFOutput()) 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 (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); } |
String newindent = indent + sPrettyXDFOutputIndentation; | String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); | 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); } |
if (sPrettyXDFOutput) writeOut(outputstream, newindent); | if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, newindent); | 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); } |
protected void resolve() { | protected void resolve(PluginRegistryModel registry) { | protected void resolve() { // Do nothing } |
protected void unresolve() { | protected void unresolve(PluginRegistryModel registry) { | protected void unresolve() { // Do nothing } |
{ | 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; } |
|
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.length() == 0) return null; | 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; } |
return result; | 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); | 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 final Set getNames() | public static synchronized final Set getNames() | public static final Set getNames() { return KeyPairGeneratorFactory.getNames(); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.