bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } }
|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } }
| 4,636
|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } }
|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } }
| 4,637
|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } }
|
protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize;
| 4,638
|
protected void shiftEnd(int newSize) { int delta = (gapEnd - gapStart) - newSize; char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } }
|
protected void shiftEnd(int newSize) { assert newSize > (gapEnd - gapStart) : "The new gap size must be greater " + "than the old gap size"; int delta = newSize - gapEnd + gapStart; Vector v = getPositionsInRange(null, gapEnd, buffer.length - gapEnd); for (Iterator i = v.iterator(); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } }
| 4,639
|
protected void shiftEnd(int newSize) { int delta = (gapEnd - gapStart) - newSize; char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } }
|
protected void shiftEnd(int newSize) { int delta = (gapEnd - gapStart) - newSize; char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } }
| 4,640
|
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } }
|
protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } }
| 4,641
|
public SwingDialogPeer(SwingToolkit toolkit, Dialog dialog) { super(toolkit, dialog, new SwingDialog(dialog)); jComponent.setTitle(dialog.getTitle()); jComponent.getContentPane().setLayout(null); }
|
public SwingDialogPeer(SwingToolkit toolkit, Dialog dialog) { super(toolkit, dialog, new SwingDialog(dialog)); jComponent.setTitle(dialog.getTitle()); jComponent.getContentPane().setLayout(new SwingContainerLayout(this)); }
| 4,642
|
public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { /* Create the context */ accessibleContext = new AccessibleAWTLabel(); } return accessibleContext;}
|
public AccessibleContext getAccessibleContext() /* Create the context if this is the first request */ if (accessibleContext == null) /* Create the context */ accessibleContext = new AccessibleAWTLabel(); } return accessibleContext;}
| 4,643
|
public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { /* Create the context */ accessibleContext = new AccessibleAWTLabel(); } return accessibleContext;}
|
public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { /* Create the context */ accessibleContext = new AccessibleAWTLabel(); return accessibleContext;
| 4,644
|
public static FileSystemView getFileSystemView() { if (defaultFileSystemView == null) { if (File.separator.equals("/")) defaultFileSystemView = new UnixFileSystemView(); // FIXME: need to implement additional views // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); } return defaultFileSystemView; }
|
public static FileSystemView getFileSystemView() { if (defaultFileSystemView == null) { defaultFileSystemView = new UnixFileSystemView(); // FIXME: need to implement additional views // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); } return defaultFileSystemView; }
| 4,645
|
public String getSystemDisplayName(File f) { return null; }
|
public String getSystemDisplayName(File f) { String name = null; if (f != null) name = f.getName(); return name; }
| 4,646
|
protected void fireConfigChanged() { if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionConfigListener target = (SessionConfigListener)listeners.elementAt(i); target.onConfigChanged(sce); } } }
|
protected void fireConfigChanged(SessionConfigEvent sce) { if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionConfigListener target = (SessionConfigListener)listeners.elementAt(i); target.onConfigChanged(sce); } } }
| 4,647
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
| 4,648
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
| 4,649
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); counter--; tag = "d" + counter; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
| 4,650
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; }
|
public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags[i] = tag; } return tags; }
| 4,651
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
| 4,652
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info String[] tags = getAxisTags(); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
| 4,653
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } }
| 4,654
|
public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte) screen52.getRows()); // store the current size sc.write((byte) screen52.getColumns()); // "" int cp = screen52.getCurrentPos(); // save off current position sc.write((byte) (cp >> 8 & 0xff)); // "" sc.write((byte) (cp & 0xff)); // "" sc.write((byte) (screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte) (screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getColumns(); // ""// byte[] sa = new byte[rows * cols]; fillRegenerationBuffer(sc,rows,cols);// fillScreenArray(sa, rows, cols);//// sc.write(sa);// sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte) (sizeFields >> 8 & 0xff)); // "" sc.write((byte) (sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte) sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte) (sp >> 8 & 0xff)); // "" sc.write((byte) (sp & 0xff)); // "" if (sf.mdt) sc.write((byte) 1); else sc.write((byte) 0); sc.write((byte) (sf.getLength() >> 8 & 0xff)); // "" sc.write((byte) (sf.getLength() & 0xff)); // "" sc.write((byte) sf.getFFW1() & 0xff); sc.write((byte) sf.getFFW2() & 0xff); sc.write((byte) sf.getFCW1() & 0xff); sc.write((byte) sf.getFCW2() & 0xff); log.debug("Saved "); log.debug(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out. // screen52.getScreenFields().setCurrentField(null); // set it to null // for GC ? // screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { log.warn(ioe.getMessage()); } sc = null; log.debug("Save Screen end "); }
|
public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte) screen52.getRows()); // store the current size sc.write((byte) screen52.getColumns()); // "" int cp = screen52.getScreenFields().getCurrentFieldPos(); // save off current position sc.write((byte) (cp >> 8 & 0xff)); // "" sc.write((byte) (cp & 0xff)); // "" sc.write((byte) (screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte) (screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getColumns(); // ""// byte[] sa = new byte[rows * cols]; fillRegenerationBuffer(sc,rows,cols);// fillScreenArray(sa, rows, cols);//// sc.write(sa);// sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte) (sizeFields >> 8 & 0xff)); // "" sc.write((byte) (sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte) sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte) (sp >> 8 & 0xff)); // "" sc.write((byte) (sp & 0xff)); // "" if (sf.mdt) sc.write((byte) 1); else sc.write((byte) 0); sc.write((byte) (sf.getLength() >> 8 & 0xff)); // "" sc.write((byte) (sf.getLength() & 0xff)); // "" sc.write((byte) sf.getFFW1() & 0xff); sc.write((byte) sf.getFFW2() & 0xff); sc.write((byte) sf.getFCW1() & 0xff); sc.write((byte) sf.getFCW2() & 0xff); log.debug("Saved "); log.debug(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out. // screen52.getScreenFields().setCurrentField(null); // set it to null // for GC ? // screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { log.warn(ioe.getMessage()); } sc = null; log.debug("Save Screen end "); }
| 4,655
|
public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!signedOn) { signedOn = true;// signOnSave = new char[screen52.getScreenLength()]; signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock) screen52.setKeyboardLocked(false); if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } }
|
public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!signedOn) { signedOn = true;// signOnSave = new char[screen52.getScreenLength()]; signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } }
| 4,656
|
private final void writeErrorCode() throws Exception { screen52.goto_XY(screen52.getErrorLine(),1); // Skip the control byte screen52.saveErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); cursorOn = true; }
|
private final void writeErrorCode() throws Exception { screen52.goto_XY(screen52.getErrorLine(),1); // Skip the control byte screen52.saveErrorLine(); cursorOn = true; }
| 4,659
|
private final void writeErrorCodeToWindow() throws Exception { int fromCol = bk.getNextByte() & 0xff; // from column int toCol = bk.getNextByte() & 0xff; // to column screen52.goto_XY(screen52.getErrorLine(),fromCol); // Skip the control byte screen52.saveErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); cursorOn = true; }
|
private final void writeErrorCodeToWindow() throws Exception { int fromCol = bk.getNextByte() & 0xff; // from column int toCol = bk.getNextByte() & 0xff; // to column screen52.goto_XY(screen52.getErrorLine(),fromCol); // Skip the control byte screen52.saveErrorLine(); cursorOn = true; }
| 4,660
|
public UnresolvedObjectRefException(String s) { super(s); }
|
public UnresolvedObjectRefException(String s) { super(s); }
| 4,661
|
public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", "0.1.5"); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", "0.1.5"); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; }
|
public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", vm.getVersion()); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", "0.1.5"); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; }
| 4,662
|
public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", "0.1.5"); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", "0.1.5"); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; }
|
public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", "0.1.5"); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", vm.getVersion()); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; }
| 4,663
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
| 4,664
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
| 4,665
|
protected void windowInit() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // will do set/create // Now we're done init stage, adds and layouts go to content pane. initStageDone = true; }
|
protected void windowInit() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // will do set/create // Now we're done init stage, adds and layouts go to content pane. setRootPaneCheckingEnabled(true); }
| 4,666
|
private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
|
private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
| 4,669
|
private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
|
private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
| 4,670
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
| 4,672
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
| 4,673
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
| 4,674
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index); this.repaint(); }
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); this.repaint(); }
| 4,676
|
private HashMap getEntries() throws IOException { synchronized(raf) { if (closed) throw new IllegalStateException("ZipFile has closed: " + name); if (entries == null) readEntries(); return entries; } }
|
private HashMap getEntries() throws IOException { synchronized(raf) { if (closed) throw new IllegalStateException("ZipFile has closed: " + name); if (entries == null) readEntries(); return entries; } }
| 4,677
|
private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == lm1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; }
|
private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == lm1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; }
| 4,679
|
private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == lm1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; }
|
private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == em1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; }
| 4,680
|
public void move(int x, int y) { int oldx = this.x; int oldy = this.y; if (this.x == x && this.y == y) return; invalidate (); this.x = x; this.y = y; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight() && width != 0 && height !=0) { parent.repaint(oldx, oldy, width, height); repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
public void move(int x, int y) { int oldx = this.x; int oldy = this.y; if (this.x == x && this.y == y) return; invalidate (); this.x = x; this.y = y; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight() && width != 0 && height !=0) { parent.repaint(oldx, oldy, width, height); repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 4,681
|
public void resize(int width, int height) { int oldwidth = this.width; int oldheight = this.height; if (this.width == width && this.height == height) return; invalidate (); this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(x, y, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
public void resize(int width, int height) { int oldwidth = this.width; int oldheight = this.height; if (this.width == width && this.height == height) return; invalidate (); this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(x, y, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 4,684
|
private void disconnectMe() { me.closeSession((Session)this.getContentPane()); }
|
private void disconnectMe() { Session s = (Session)getContentPane(); me.closeSession(s); }
| 4,685
|
public boolean containsSession(Session session) { return desktop.getIndexOf(session) >= 0; }
|
public boolean containsSession(Session session) { return getIndexOfSession(session) >= 0; }
| 4,686
|
public int getIndexOfSession(Session session) { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); int index = -1; for (int idx = 0; idx < frames.length; idx++) { if (frames[idx].getContentPane().equals(session)) { index = idx; return index; } } return index; }
|
public int getIndexOfSession(Session session) { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); int index = -1; for (int idx = 0; idx < frames.length; idx++) { Session ses = (Session)frames[idx].getContentPane(); if (ses.equals(session)) { index = idx; return index; } } return index; }
| 4,687
|
private void jbInit() throws Exception { desktop = new JDesktopPane(); setContentPane(desktop); // Install our custom desktop manager desktop.setDesktopManager(new MyDesktopMgr()); if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (packFrame) pack(); else validate(); }
|
private void jbInit() throws Exception { desktop = new JDesktopPane(); // Install our custom desktop manager desktop.setDesktopManager(new MyDesktopMgr()); if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (packFrame) pack(); else validate(); }
| 4,688
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
| 4,690
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
|
private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; }
| 4,691
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
| 4,695
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) { ListModel oldModel = (ListModel) e.getOldValue(); oldModel.removeListDataListener(listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) { ListModel newModel = (ListModel) e.getNewValue(); newModel.addListDataListener(BasicListUI.this.listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
| 4,696
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
| 4,697
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; }
| 4,698
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); int width = cellWidth; if (l.getLayoutOrientation() == JList.VERTICAL) width = l.getWidth(); Rectangle bounds = new Rectangle(loc.x, loc.y, width, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
| 4,699
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
|
public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, width, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; }
| 4,700
|
protected void maybeUpdateLayoutState() { if (updateLayoutStateNeeded != 0 || !list.isValid()) { updateLayoutState(); updateLayoutStateNeeded = 0; } }
|
protected void maybeUpdateLayoutState() { if (updateLayoutStateNeeded != 0) { updateLayoutState(); updateLayoutStateNeeded = 0; } }
| 4,701
|
protected void updateLayoutState() { int nrows = list.getModel().getSize(); cellHeight = -1; cellWidth = -1; if (cellHeights == null || cellHeights.length != nrows) cellHeights = new int[nrows]; ListCellRenderer rend = list.getCellRenderer(); // Update the cellHeight(s) fields. int fixedCellHeight = list.getFixedCellHeight(); if (fixedCellHeight > 0) { cellHeight = fixedCellHeight; cellHeights = null; } else { cellHeight = -1; for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellHeights[i] = dim.height; } } // Update the cellWidth field. int fixedCellWidth = list.getFixedCellWidth(); if (fixedCellWidth > 0) cellWidth = fixedCellWidth; else { for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellWidth = Math.max(cellWidth, dim.width); } if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width); } }
|
protected void updateLayoutState() { int nrows = list.getModel().getSize(); cellHeight = -1; cellWidth = -1; if (cellHeights == null || cellHeights.length != nrows) cellHeights = new int[nrows]; ListCellRenderer rend = list.getCellRenderer(); // Update the cellHeight(s) fields. int fixedCellHeight = list.getFixedCellHeight(); if (fixedCellHeight > 0) { cellHeight = fixedCellHeight; cellHeights = null; } else { cellHeight = -1; for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellHeights[i] = dim.height; } } // Update the cellWidth field. int fixedCellWidth = list.getFixedCellWidth(); if (fixedCellWidth > 0) cellWidth = fixedCellWidth; else { for (int i = 0; i < nrows; ++i) { Component flyweight = rend.getListCellRendererComponent(list, list.getModel().getElementAt(i), i, list.isSelectedIndex(i), list.getSelectionModel().getAnchorSelectionIndex() == i); Dimension dim = flyweight.getPreferredSize(); cellWidth = Math.max(cellWidth, dim.width); } if (list.getLayoutOrientation() == JList.VERTICAL) cellWidth = Math.max(cellWidth, list.getSize().width); } }
| 4,702
|
public String[] getCompilerPackages() { return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" }; }
|
public String[] getCompilerPackages() { return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stub" }; }
| 4,703
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
| 4,704
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
| 4,705
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
| 4,706
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { log.debug("provider found"); return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
|
private FontProvider getProvider(Font font) { FontProvider prov = getFirstProvider(); final String firstProvName = prov.getName(); if (prov.provides(font)) { log.debug("using firstProvider "+firstProvName); return prov; } log.debug("getProvider for "+font.getName()+ " ("+providers.size()+" availables)"); for (FontProvider prv : providers.values()) { if(firstProvName.equals(prv.getName())) continue; // skip the first provider log.debug("font="+font+" provider="+prv); if (prv.provides(font)) { return prv; } } log.debug("font="+font+" NO PROVIDER"); return null; }
| 4,707
|
public void paint(Graphics g) { paintComponent(g); }
|
public void paint(Graphics g) { Component view = getView(); if (view == null) return; Point pos = getViewPosition(); Rectangle viewBounds = view.getBounds(); Rectangle portBounds = getBounds(); if (viewBounds.width == 0 || viewBounds.height == 0 || portBounds.width == 0 || portBounds.height == 0) return; switch (getScrollMode()) { case JViewport.BACKINGSTORE_SCROLL_MODE: paintBackingStore(g); break; case JViewport.BLIT_SCROLL_MODE: paintBlit(g); break; case JViewport.SIMPLE_SCROLL_MODE: default: paintSimple(g); break; } damaged = false; }
| 4,709
|
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); isViewSizeSet = true; fireStateChanged(); }
|
public void setViewSize(Dimension newSize) { viewSize = newSize; Component view = getView(); if (view != null) view.setSize(viewSize); fireStateChanged(); }
| 4,713
|
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=(int)fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
|
public INodeTable(Ext2FileSystem fs, int firstBlock) throws IOException { this.fs = fs; this.firstBlock = firstBlock; blockSize=fs.getBlockSize(); blockCount = (int)Math.ceil( (double)(fs.getSuperblock().getINodesPerGroup()*INode.INODE_LENGTH) / (double) blockSize); }
| 4,715
|
final void gc() { // Prepare final VmBootHeap bootHeap = heapManager.getBootHeap(); final VmAbstractHeap firstHeap = heapManager.getFirstHeap(); stats.lastGCTime = System.currentTimeMillis(); final boolean locking = (writeBarrier != null); final boolean verbose = debug; helper.stopThreadsAtSafePoint(); heapManager.setGcActive(true); try { // Mark //helper.stopThreadsAtSafePoint(); //heapManager.setGcActive(true); try { if (verbose) { Unsafe.debug("<mark/>"); } markHeap(bootHeap, firstHeap, locking); } finally { //heapManager.setGcActive(false); //helper.restartThreads(); } // Sweep if (verbose) { Unsafe.debug("<sweep/>"); } sweep(firstHeap); // Cleanup if (verbose) { Unsafe.debug("<cleanup/>"); } cleanup(bootHeap, firstHeap); // Verification if (debug) { if (verbose) { Unsafe.debug("<verify/>"); } verify(bootHeap, firstHeap); } } finally { heapManager.setGcActive(false); heapManager.resetCurrentHeap(); helper.restartThreads(); } // Start the finalization process heapManager.triggerFinalization(); if (verbose) { Unsafe.debug("</gc free="); Unsafe.debug(heapManager.getFreeMemory()); Unsafe.debug("/>"); if (debug) { System.out.println(stats); } } }
|
final void gc() { // Prepare final VmBootHeap bootHeap = heapManager.getBootHeap(); final VmAbstractHeap firstHeap = heapManager.getHeapList(); stats.lastGCTime = System.currentTimeMillis(); final boolean locking = (writeBarrier != null); final boolean verbose = debug; helper.stopThreadsAtSafePoint(); heapManager.setGcActive(true); try { // Mark //helper.stopThreadsAtSafePoint(); //heapManager.setGcActive(true); try { if (verbose) { Unsafe.debug("<mark/>"); } markHeap(bootHeap, firstHeap, locking); } finally { //heapManager.setGcActive(false); //helper.restartThreads(); } // Sweep if (verbose) { Unsafe.debug("<sweep/>"); } sweep(firstHeap); // Cleanup if (verbose) { Unsafe.debug("<cleanup/>"); } cleanup(bootHeap, firstHeap); // Verification if (debug) { if (verbose) { Unsafe.debug("<verify/>"); } verify(bootHeap, firstHeap); } } finally { heapManager.setGcActive(false); heapManager.resetCurrentHeap(); helper.restartThreads(); } // Start the finalization process heapManager.triggerFinalization(); if (verbose) { Unsafe.debug("</gc free="); Unsafe.debug(heapManager.getFreeMemory()); Unsafe.debug("/>"); if (debug) { System.out.println(stats); } } }
| 4,716
|
private final void doExecute() throws BuildException { debug = (getProject().getProperty("jnode.debug") != null); final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG); piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } if (debugFile != null) { debugFile.delete(); } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getPluginList()); //piRegistry = new // PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); if (debug) { log("Building in DEBUG mode", Project.MSG_WARN); } // Create the VM final HeapHelper helper = new HeapHelperImpl(arch); final Vm vm = new Vm(arch, new DefaultHeapManager(clsMgr, helper, clsMgr.getStatics()), clsMgr.getStatics(), debug); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[ i].getName(), systemClasses[ i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmSystemClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(VmStatics.class); loadClass(vm.getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass(HeapHelperImpl.class); loadSystemClasses(); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[ i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit vm", Project.MSG_VERBOSE); blockedObjects.remove(vm); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ log("prepare bootClassArray", Project.MSG_VERBOSE); final VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit clsMgr", Project.MSG_VERBOSE); // Turn auto-compilation on clsMgr.setCompileRequired(); blockedObjects.remove(clsMgr); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit statics", Project.MSG_VERBOSE); blockedObjects.remove(clsMgr.getStatics()); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the remaining objects log("Emit rest; blocked=" + blockedObjects, Project.MSG_VERBOSE); emitObjects(os, arch, null); log("statics table 0x" + NumberUtils.hex(os.getObjectRef( clsMgr.getStatics().getTable()).getOffset()), Project.MSG_VERBOSE); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os .startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[ i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(System.out); logStatistics(os); BytecodeParser.dumpStatistics(); log("Optimized methods : " + totalHighMethods + ", avg size " + (totalHighMethodSize / totalHighMethods) + ", tot size " + totalHighMethodSize); log("Ondemand comp. methods: " + totalLowMethods + ", avg size " + (totalLowMethodSize / totalLowMethods) + ", tot size " + totalLowMethodSize); log("Done."); os.clear(); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
|
private final void doExecute() throws BuildException { debug = (getProject().getProperty("jnode.debug") != null); final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG); piList = getPluginList(); lmPI = piList.lastModified(); } catch (PluginException ex) { throw new BuildException(ex); } catch (IOException ex) { throw new BuildException(ex); } if ((lmJar < lmDest) && (lmKernel < lmDest) && (lmPIL < lmDest) && (lmPI < lmDest)) { // No need to do anything, skip return; } if (debugFile != null) { debugFile.delete(); } try { System.getProperties().setProperty(BUILDTIME_PROPERTY, "1"); // Load the plugin descriptors final PluginRegistry piRegistry; piRegistry = new PluginRegistryModel(piList.getPluginList()); //piRegistry = new // PluginRegistryModel(piList.getDescriptorUrlList()); testPluginPrerequisites(piRegistry); /* Now create the processor */ final VmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this)); blockedObjects.add(clsMgr); blockedObjects.add(clsMgr.getStatics()); blockedObjects.add(clsMgr.getStatics().getTable()); if (debug) { log("Building in DEBUG mode", Project.MSG_WARN); } // Create the VM final HeapHelper helper = new HeapHelperImpl(arch); final Vm vm = new Vm(version, arch, new DefaultHeapManager(clsMgr, helper, clsMgr.getStatics()), clsMgr.getStatics(), debug); blockedObjects.add(vm); final VmProcessor proc = createProcessor(clsMgr.getStatics()); log("Building for " + proc.getCPUID()); final Label clInitCaller = new Label("$$clInitCaller"); VmType systemClasses[] = VmType.initializeForBootImage(clsMgr); for (int i = 0; i < systemClasses.length; i++) { clsMgr.addLoadedClass(systemClasses[ i].getName(), systemClasses[ i]); } // First copy the native kernel file copyKernel(os); os.setObjectRef(bootHeapStart); // Setup a call to our first java method initImageHeader(os, clInitCaller, vm, piRegistry); // Create the initial stack createInitialStack(os, initialStack, initialStackPtr); /* Now load the classes */ loadClass(VmMethodCode.class); loadClass(Unsafe.class); loadClass(VmSystemClassLoader.class); loadClass(VmType[].class); loadClass(Vm.class); loadClass(VmBootHeap.class); loadClass(VmDefaultHeap.class); loadClass(VmHeapManager.class); loadClass(VmStatics.class); loadClass(vm.getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass(HeapHelperImpl.class); loadSystemClasses(); /* Now emit the processor */ os.getObjectRef(proc); /* Let the compilers load its native symbol offsets */ final NativeCodeCompiler[] cmps = arch.getCompilers(); for (int i = 0; i < cmps.length; i++) { final NativeCodeCompiler cmp = cmps[ i]; cmp.initialize(clsMgr); os.getObjectRef(cmp); } // Load the jarfile as byte-array copyJarFile(os); // Now emit all object images to the actual image emitObjects(os, arch, blockedObjects); // Disallow the loading of new classes clsMgr.setFailOnNewLoad(true); emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit vm", Project.MSG_VERBOSE); blockedObjects.remove(vm); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); /* Set the bootclasses */ log("prepare bootClassArray", Project.MSG_VERBOSE); final VmType bootClasses[] = clsMgr.prepareAfterBootstrap(); os.getObjectRef(bootClasses); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit clsMgr", Project.MSG_VERBOSE); // Turn auto-compilation on clsMgr.setCompileRequired(); blockedObjects.remove(clsMgr); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the classmanager log("Emit statics", Project.MSG_VERBOSE); blockedObjects.remove(clsMgr.getStatics()); emitObjects(os, arch, blockedObjects); // Twice, this is intended! emitObjects(os, arch, blockedObjects); // Emit the remaining objects log("Emit rest; blocked=" + blockedObjects, Project.MSG_VERBOSE); emitObjects(os, arch, null); log("statics table 0x" + NumberUtils.hex(os.getObjectRef( clsMgr.getStatics().getTable()).getOffset()), Project.MSG_VERBOSE); /* Write static initializer code */ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image X86Stream.ObjectInfo dummyObjectAtEnd = os .startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); os.setObjectRef(imageEnd); os.setObjectRef(bootHeapEnd); /* Link all native symbols */ linkNativeSymbols(os); // Patch multiboot header patchHeader(os); // Store the image storeImage(os); // Generate the listfile printLabels(os, bootClasses, clsMgr.getStatics()); // Generate debug info for (int i = 0; i < cmps.length; i++) { cmps[ i].dumpStatistics(); } final int bootHeapSize = os.getObjectRef(bootHeapEnd).getOffset() - os.getObjectRef(bootHeapStart).getOffset(); final int bootHeapBitmapSize = (bootHeapSize / ObjectLayout.OBJECT_ALIGN) >> 3; log("Boot heap size " + (bootHeapSize >>> 10) + "K bitmap size " + (bootHeapBitmapSize >>> 10) + "K"); clsMgr.getStatics().dumpStatistics(System.out); logStatistics(os); BytecodeParser.dumpStatistics(); log("Optimized methods : " + totalHighMethods + ", avg size " + (totalHighMethodSize / totalHighMethods) + ", tot size " + totalHighMethodSize); log("Ondemand comp. methods: " + totalLowMethods + ", avg size " + (totalLowMethodSize / totalLowMethods) + ", tot size " + totalLowMethodSize); log("Done."); os.clear(); } catch (Throwable ex) { ex.printStackTrace(); throw new BuildException(ex); } }
| 4,717
|
protected void paintFocus(Graphics g, Rectangle t, Dimension d) { g.setColor(focusColor); g.drawRect(t.x, t.y, t.width, t.height); // FIXME: we seem to be drawing too tight a rectangle here, perhaps there // is some padding to do somewhere??? }
|
protected void paintFocus(Graphics g, Rectangle t, Dimension d) { g.setColor(focusColor); g.drawRect(t.x, t.y, t.width - 2, t.height - 2); // FIXME: we seem to be drawing too tight a rectangle here, perhaps there // is some padding to do somewhere??? }
| 4,718
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIcon = b.getSelectedIcon(); else if (!b.isSelected() && b.isEnabled()) currentIcon = b.getIcon(); else if (b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); else // (!b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? if (b.hasFocus() && b.isFocusPainted()) paintFocus(g, tr, null); }
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIcon = b.getSelectedIcon(); else if (!b.isSelected() && b.isEnabled()) currentIcon = b.getIcon(); else if (b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); else // (!b.isSelected() && !b.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel (c, g.getFontMetrics(f), b.getText(), currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if (currentIcon != null) { currentIcon.paintIcon(c, g, ir.x, ir.y); } if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? if (b.hasFocus() && b.isFocusPainted() && b.isEnabled()) paintFocus(g, tr, null); }
| 4,719
|
protected void init() { super.init(); classXDFNodeName = "field"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0, NOTELIST_XML_ATTRIBUTE_NAME); attribOrder.add(0, RELATION_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNITS_XML_ATTRIBUTE_NAME); attribOrder.add(0, DATAFORMAT_XML_ATTRIBUTE_NAME); attribOrder.add(0, DISABLEDVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNDERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, OVERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NOTANUMBERVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NODATAVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, CLASS_XML_ATTRIBUTE_NAME); attribOrder.add(0, IDREF_XML_ATTRIBUTE_NAME); attribOrder.add(0, ID_XML_ATTRIBUTE_NAME); attribOrder.add(0, DESCRIPTION_XML_ATTRIBUTE_NAME); attribOrder.add(0, NAME_XML_ATTRIBUTE_NAME); //set up the attribute hashtable key with the default initial value attribHash.put(NOTELIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put(RELATION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); //double check attribHash.put(UNITS_XML_ATTRIBUTE_NAME, new Attribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put(DATAFORMAT_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); attribHash.put(CLASS_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DISABLEDVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(OVERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(UNDERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NOTANUMBERVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NODATAVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(IDREF_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(ID_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NAME_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); };
|
protected void init() { super.init(); classXDFNodeName = "field"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0, NOTELIST_XML_ATTRIBUTE_NAME); attribOrder.add(0, RELATION_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNITS_XML_ATTRIBUTE_NAME); attribOrder.add(0, DISABLEDVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, UNDERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, OVERFLOWVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NOTANUMBERVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, NODATAVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, INFINITEVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, GREATERTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, LESSTHANVALUE_XML_ATTRIBUTE_NAME); attribOrder.add(0, CLASS_XML_ATTRIBUTE_NAME); attribOrder.add(0, IDREF_XML_ATTRIBUTE_NAME); attribOrder.add(0, ID_XML_ATTRIBUTE_NAME); attribOrder.add(0, DESCRIPTION_XML_ATTRIBUTE_NAME); attribOrder.add(0, NAME_XML_ATTRIBUTE_NAME); //set up the attribute hashtable key with the default initial value attribHash.put(NOTELIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put(RELATION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); //double check attribHash.put(UNITS_XML_ATTRIBUTE_NAME, new Attribute(new Units(), Constants.OBJECT_TYPE)); attribHash.put(DATAFORMAT_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.OBJECT_TYPE)); attribHash.put(CLASS_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DISABLEDVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(OVERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(UNDERFLOWVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NOTANUMBERVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NODATAVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITENEGATIVEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(INFINITEVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(GREATERTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANOREQUALVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(LESSTHANVALUE_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(IDREF_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(ID_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); attribHash.put(NAME_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE)); };
| 4,720
|
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); //System.out.println("Directory at offset :" + offset); //System.out.println("Length in bytes = " + entries.size() * 32); read(data); resetDirty(); }
|
public synchronized void read(BlockDeviceAPI device, long offset) throws IOException { byte[] data = new byte[entries.size() * 32]; device.read(offset, data, 0, data.length); //System.out.println("Directory at offset :" + offset); //System.out.println("Length in bytes = " + entries.size() * 32); read(data); resetDirty(); }
| 4,722
|
public void run() { try { // System.err.println("Registering shell in new thread."); ShellUtils.getShellManager().registerShell(commandShell);//workaround // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { //somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); //done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cx).usage(); err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
|
public void run() { try { // System.err.println("Registering shell in new thread."); ShellUtils.getShellManager().registerShell(commandShell);//workaround // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { //somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); //done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cx).usage(); err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
| 4,723
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; log.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
| 4,725
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":""), 2); }
|
public Ext2Entry(INode iNode, String name, int type) { this.iNode = iNode; this.name = name; this.type = type; this.valid = true; Ext2Debugger.debug("Ext2Entry(iNode, name): name="+name+ (isDirectory()?" is a directory ":"")+ (isFile()?" is a file ":"")); }
| 4,726
|
public void doDefaultCloseAction() { fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING); switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: hide(); break; case DISPOSE_ON_CLOSE: dispose(); break; } }
|
public void doDefaultCloseAction() { fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING); switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: setVisible(false); break; case DISPOSE_ON_CLOSE: dispose(); break; } }
| 4,727
|
public VariableRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, int rhsIndex) { super(address, block, lhsIndex); this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs }; setDeadCode(true); }
|
public VariableRefAssignQuad(int address, IRBasicBlock block, int lhsIndex, int rhsIndex) { super(address, block, lhsIndex); this.rhs = getOperand(rhsIndex); refs = new Operand[] { rhs }; setDeadCode(true); }
| 4,728
|
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (rhs instanceof Variable) { Variable v = (Variable) rhs; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
|
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (rhs instanceof Variable) { Variable v = (Variable) rhs; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
| 4,729
|
public Operand getRHS() { return rhs; }
|
public Operand getRHS() { return refs[0]; }
| 4,730
|
public Operand propagate(Variable operand) { return rhs; }
|
public Operand propagate(Variable operand) { return refs[0]; }
| 4,731
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + rhs.toString(); }
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + refs[0]; }
| 4,732
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
public boolean gotoField(int f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
| 4,733
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
protected boolean gotoField(ScreenField f) { int sizeFields = screenFields.getSize(); goto_XY(f.startPos()); return true; } else { return false; } }
| 4,734
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
|
protected boolean gotoField(ScreenField f) { if (f != null) { goto_XY(f.startPos()); return true; } else { return false; } }
| 4,735
|
public SwingTextAreaPeer(TextArea textArea) { super(); switch (textArea.getScrollbarVisibility()) { case TextArea.SCROLLBARS_BOTH: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); break; case TextArea.SCROLLBARS_NONE: SwingToolkit.add(textArea, this); break; } SwingToolkit.copyAwtProperties(textArea, this); setText(textArea.getText()); setRows(textArea.getRows()); setColumns(textArea.getColumns()); setEditable(textArea.isEditable()); }
|
public SwingTextAreaPeer(TextArea textArea) { this.textArea = textArea; switch (textArea.getScrollbarVisibility()) { case TextArea.SCROLLBARS_BOTH: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: SwingToolkit.add(textArea, new JScrollPane(this, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); break; case TextArea.SCROLLBARS_NONE: SwingToolkit.add(textArea, this); break; } SwingToolkit.copyAwtProperties(textArea, this); setText(textArea.getText()); setRows(textArea.getRows()); setColumns(textArea.getColumns()); setEditable(textArea.isEditable()); }
| 4,738
|
public float getAlignment(int axis) { // FIXME: This is very likely not 100% correct. Work this out. return 0.0F; }
|
public float getAlignment(int axis) { // FIXME: This is very likely not 100% correct. Work this out. float align; if (axis == X_AXIS) align = 0.0F; else align = super.getAlignment(axis); return align; }
| 4,739
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
public float getAlignment(int axis) { if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else align = super.getAlignment(axis); }
| 4,740
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
| 4,741
|
public float getAlignment(int axis) { if (axis == X_AXIS) return 0.0F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else return 0.0F; }
|
public float getAlignment(int axis) { if (axis == X_AXIS) align = 0.0F; return align; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); return (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
| 4,742
|
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
|
public int[] getSizes() { // Variables int[] array; int index; // Create New Array array = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { array[index] = sizes[index]; } // for // Return Newly created array return array; } // getSizes()
| 4,743
|
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
|
public void setSizes(int[] sizes) { // Variables int index; // Initialize Sizes this.sizes = new int[sizes.length]; for (index = 0; index < sizes.length; index++) { this.sizes[index] = sizes[index]; } // for } // setSizes()
| 4,744
|
public void init(TestConfig config, MockObjectTestCase testCase) throws IOException { // set the current testCase for our factory MockFloppyDeviceFactory factory = (MockFloppyDeviceFactory) FSDriverUtils.getFloppyDeviceFactory(); factory.setTestCase((MockObjectTestCase) testCase); DeviceFinder deviceFinder = new FloppyControllerFinder(); StubDeviceManager.INSTANCE.removeAll(); StubDeviceManager.INSTANCE.add(deviceFinder, new FloppyDeviceToDriverMapper()); FloppyDriver driver = (FloppyDriver) findDriver(deviceFinder, "fd0"); log.debug("findDriver->"+driver); init(null, driver, null); }
|
public void init(TestConfig config, MockObjectTestCase testCase) throws IOException { // set the current testCase for our factory MockFloppyDeviceFactory factory = (MockFloppyDeviceFactory) FSDriverUtils.getFloppyDeviceFactory(); factory.setTestCase((MockObjectTestCase) testCase); DeviceFinder deviceFinder = new FloppyControllerFinder(); StubDeviceManager.INSTANCE.removeAll(); StubDeviceManager.INSTANCE.add(deviceFinder, new FloppyDeviceToDriverMapper()); FloppyDriver driver = (FloppyDriver) findDriver(deviceFinder, "fd0"); log.debug("findDriver->"+driver); init(null, driver, null); }
| 4,745
|
public byte[] getEncoded() { return getEncoded(IKeyPairCodec.RAW_FORMAT); }
|
public byte[] getEncoded() { return getEncoded(defaultFormat); }
| 4,746
|
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public UShortSeqHolder() { value = initial_value; typecode.setLength(value.length); }
| 4,747
|
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public UShortSeqHolder(short[] initial_value) { value = initial_value; typecode.setLength(value.length); }
| 4,748
|
public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
|
public void init() { try { jbInit(); } catch(Exception e) { log.warn("In constructor: ", e); } }
| 4,750
|
private boolean isSpecified(String parm) { if (getParameter(parm) != null) { System.out.println("Parameter " + parm + " is specified as: " + getParameter(parm)); return true; } return false; }
|
private boolean isSpecified(String parm) { if (getParameter(parm) != null) { log.info("Parameter " + parm + " is specified as: " + getParameter(parm)); return true; } return false; }
| 4,751
|
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); System.out.println(" We have loaded a new one"); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); loadSystemProperty("SESSION_CONNECT_USER"); loadSystemProperty("SESSION_CONNECT_PASSWORD"); loadSystemProperty("SESSION_CONNECT_PROGRAM"); loadSystemProperty("SESSION_CONNECT_LIBRARY"); loadSystemProperty("SESSION_CONNECT_MENU"); manager = new SessionManager(); final Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); }
|
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); log.info(" We have loaded a new one"); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); loadSystemProperty("SESSION_CONNECT_USER"); loadSystemProperty("SESSION_CONNECT_PASSWORD"); loadSystemProperty("SESSION_CONNECT_PROGRAM"); loadSystemProperty("SESSION_CONNECT_LIBRARY"); loadSystemProperty("SESSION_CONNECT_MENU"); manager = new SessionManager(); final Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); }
| 4,752
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 4,753
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolygon(dark); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolygon(bright); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 4,754
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
| 4,755
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); // check if the gap is big enough to hold the string if ((gapEnd - gapStart) < strLen) // make room for this string and some more shiftEnd(strLen + DEFAULT_BUFSIZE); // are we at the gap boundary? if (where != gapStart) shiftGap(where); // now we can simple copy the string into the gap and adjust the // gap boundaries System.arraycopy(str.toCharArray(), 0, buffer, gapStart, strLen); gapStart += strLen; return null; }
| 4,756
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
| 4,757
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap gapEnd += nitems; return null; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); // check if we are at the gap boundary if (where != gapStart) shiftGap(where); // now we simply have to enlarge the gap return null; }
| 4,758
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.