bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(pos); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
| 13,807
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(pos)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
| 13,808
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (pos >= fracStart && pos < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
| 13,809
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
| 13,810
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, offset, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
|
private void insertFracture(ElementSpec tag) { // insert the fracture at offset. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); AttributeSet parentAtts = parent.getAttributes(); Element toFracture = parent.getElement(parentIndex); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parentIndex); Element frac = toFracture; int leftIns = 0; int indexOfFrac = toFracture.getElementIndex(offset); int size = toFracture.getElementCount(); // gets the leaf that falls along the fracture frac = toFracture.getElement(indexOfFrac); while (!frac.isLeaf()) frac = frac.getElement(frac.getElementIndex(offset)); AttributeSet atts = frac.getAttributes(); int fracStart = frac.getStartOffset(); int fracEnd = frac.getEndOffset(); if (offset > fracStart && offset < fracEnd) { // recreate left-side of branch and all its children before offset // add the fractured leaves to the right branch BranchElement rightBranch = (BranchElement) createBranchElement(parent, parentAtts); // Check if left branch has already been edited. If so, we only // need to create the right branch. BranchElement leftBranch = null; Element[] added = null; if (edit.added.size() > 0 || edit.removed.size() > 0) { added = new Element[] { rightBranch }; // don't try to remove left part of tree parentIndex++; } else { leftBranch = (BranchElement) createBranchElement(parent, parentAtts); added = new Element[] { leftBranch, rightBranch }; // add fracture to leftBranch Element leftFracturedLeaf = createLeafElement(leftBranch, atts, fracStart, offset); leftBranch.replace(leftIns, 0, new Element[] { leftFracturedLeaf }); } if (!toFracture.isLeaf()) { // add all non-fracture elements to the branches if (indexOfFrac > 0 && leftBranch != null) { Element[] add = new Element[indexOfFrac]; for (int i = 0; i < indexOfFrac; i++) add[i] = toFracture.getElement(i); leftIns = add.length; leftBranch.replace(0, 0, add); } int count = size - indexOfFrac - 1; if (count > 0) { Element[] add = new Element[count]; int j = 0; int i = indexOfFrac + 1; while (j < count) add[j++] = toFracture.getElement(i++); rightBranch.replace(0, 0, add); } } // add to fracture to rightBranch // Check if we can join the right frac leaf with the next leaf int rm = 0; int end = fracEnd; Element next = rightBranch.getElement(0); if (next != null && next.isLeaf() && next.getAttributes().isEqual(atts)) { end = next.getEndOffset(); rm = 1; } Element rightFracturedLeaf = createLeafElement(rightBranch, atts, pos, end); rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf }); // recreate those elements after parentIndex and add/remove all // new/old elements to parent int remove = parSize - parentIndex; Element[] removed = new Element[0]; Element[] added2 = new Element[0]; if (remove > 0) { removed = new Element[remove]; int s = 0; for (int j = parentIndex; j < parSize; j++) removed[s++] = parent.getElement(j); edit.addRemovedElements(removed); added2 = recreateAfterFracture(removed, parent, 1, rightBranch.getEndOffset()); } edit.addAddedElements(added); edit.addAddedElements(added2); elementStack.push(rightBranch); lastFractured = rightFracturedLeaf; } else fracNotCreated = true; }
| 13,811
|
protected void insertUpdate(ElementSpec[] data) { // Push the root and the paragraph at offset onto the element stack. Element current = root; int index; while (!current.isLeaf()) { index = current.getElementIndex(offset); elementStack.push(current); current = current.getElement(index); } int i = 0; int type = data[0].getType(); if (type == ElementSpec.ContentType) { // If the first tag is content we must treat it separately to allow // for joining properly to previous Elements and to ensure that // no extra LeafElements are erroneously inserted. insertFirstContentTag(data); pos += data[0].length; i = 1; } else { createFracture(data); i = 0; } // Handle each ElementSpec individually. for (; i < data.length; i++) { BranchElement paragraph = (BranchElement) elementStack.peek(); switch (data[i].getType()) { case ElementSpec.StartTagType: switch (data[i].getDirection()) { case ElementSpec.JoinFractureDirection: // Fracture the tree and ensure the appropriate element // is on top of the stack. fracNotCreated = false; insertFracture(data[i]); if (fracNotCreated) { if (lastFractured != null) elementStack.push(lastFractured.getParentElement()); else elementStack.push(paragraph.getElement(0)); } break; case ElementSpec.JoinNextDirection: // Push the next paragraph element onto the stack so // future insertions are added to it. int ix = paragraph.getElementIndex(pos) + 1; elementStack.push(paragraph.getElement(ix)); break; default: Element br = null; if (data.length > i + 1) { // leaves will be added to paragraph later int x = paragraph.getElementIndex(pos) + 1; Edit e = getEditForParagraphAndIndex(paragraph, x); br = (BranchElement) createBranchElement(paragraph, data[i].getAttributes()); e.added.add(br); elementStack.push(br); } else // need to add leaves to paragraph now br = insertParagraph(paragraph, pos); break; } break; case ElementSpec.EndTagType: elementStack.pop(); break; case ElementSpec.ContentType: insertContentTag(data[i]); offset = pos; break; } } }
|
protected void insertUpdate(ElementSpec[] data) { // Push the root and the paragraph at offset onto the element stack. Element current = root; int index; while (!current.isLeaf()) { index = current.getElementIndex(offset); elementStack.push(current); current = current.getElement(index); } int i = 0; int type = data[0].getType(); if (type == ElementSpec.ContentType) { // If the first tag is content we must treat it separately to allow // for joining properly to previous Elements and to ensure that // no extra LeafElements are erroneously inserted. insertFirstContentTag(data); pos += data[0].length; i = 1; } else { createFracture(data); i = 0; } // Handle each ElementSpec individually. for (; i < data.length; i++) { BranchElement paragraph = (BranchElement) elementStack.peek(); switch (data[i].getType()) { case ElementSpec.StartTagType: switch (data[i].getDirection()) { case ElementSpec.JoinFractureDirection: // Fracture the tree and ensure the appropriate element // is on top of the stack. fracNotCreated = false; insertFracture(data[i]); if (fracNotCreated) { if (lastFractured != null) elementStack.push(lastFractured.getParentElement()); else elementStack.push(paragraph.getElement(0)); } break; case ElementSpec.JoinNextDirection: // Push the next paragraph element onto the stack so // future insertions are added to it. int ix = paragraph.getElementIndex(pos) + 1; elementStack.push(paragraph.getElement(ix)); break; default: Element br = null; if (data.length > i + 1) { // leaves will be added to paragraph later int x = 0; if (paragraph.getElementCount() > 0) x = paragraph.getElementIndex(pos) + 1; Edit e = getEditForParagraphAndIndex(paragraph, x); br = (BranchElement) createBranchElement(paragraph, data[i].getAttributes()); e.added.add(br); elementStack.push(br); } else // need to add leaves to paragraph now br = insertParagraph(paragraph, pos); break; } break; case ElementSpec.EndTagType: elementStack.pop(); break; case ElementSpec.ContentType: insertContentTag(data[i]); offset = pos; break; } } }
| 13,812
|
private void recreateLeaves(int start, BranchElement paragraph, boolean onlyContent) { int index = paragraph.getElementIndex(start); Element child = paragraph.getElement(index); AttributeSet atts = child.getAttributes(); if (!onlyContent) { BranchElement newBranch = (BranchElement) createBranchElement(paragraph, atts); Element newLeaf = createLeafElement(newBranch, atts, start, child.getEndOffset()); newBranch.replace(0, 0, new Element[] { newLeaf }); BranchElement parent = (BranchElement) paragraph.getParentElement(); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parSize); edit.addAddedElement(newBranch); int paragraphSize = paragraph.getElementCount(); Element[] removed = new Element[paragraphSize - (index + 1)]; int s = 0; for (int j = index + 1; j < paragraphSize; j++) removed[s++] = paragraph.getElement(j); edit = getEditForParagraphAndIndex(paragraph, index); edit.addRemovedElements(removed); Element[] added = recreateAfterFracture(removed, newBranch, 0, child.getEndOffset()); newBranch.replace(1, 0, added); lastFractured = newLeaf; offset = newBranch.getEndOffset(); } else { Element newLeaf = createLeafElement(paragraph, atts, start, child.getEndOffset()); Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(newLeaf); } }
|
private void recreateLeaves(int start, BranchElement paragraph, boolean onlyContent) { int index = paragraph.getElementIndex(start); Element child = paragraph.getElement(index); AttributeSet atts = child.getAttributes(); if (!onlyContent) { BranchElement newBranch = (BranchElement) createBranchElement(paragraph, atts); Element newLeaf = createLeafElement(newBranch, atts, start, child.getEndOffset()); newBranch.replace(0, 0, new Element[] { newLeaf }); BranchElement parent = (BranchElement) paragraph.getParentElement(); int parSize = parent.getElementCount(); Edit edit = getEditForParagraphAndIndex(parent, parSize); edit.addAddedElement(newBranch); int paragraphSize = paragraph.getElementCount(); Element[] removed = new Element[paragraphSize - (index + 1)]; int s = 0; for (int j = index + 1; j < paragraphSize; j++) removed[s++] = paragraph.getElement(j); edit = getEditForParagraphAndIndex(paragraph, index); edit.addRemovedElements(removed); Element[] added = recreateAfterFracture(removed, newBranch, 0, child.getEndOffset()); newBranch.replace(1, 0, added); lastFractured = newLeaf; pos = newBranch.getEndOffset(); } else { Element newLeaf = createLeafElement(paragraph, atts, start, child.getEndOffset()); Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(newLeaf); } }
| 13,813
|
private Element[] split(Element el, int offset, int space, int editIndex) { // If we are at an element boundary, then return an empty array. if ((offset == el.getStartOffset() || offset == el.getEndOffset()) && space == 0 && el.isLeaf()) return new Element[2]; // If the element is an instance of BranchElement, then we // recursivly // call this method to perform the split. Element[] res = new Element[2]; if (el instanceof BranchElement) { int index = el.getElementIndex(offset); Element child = el.getElement(index); Element[] result = split(child, offset, space, editIndex); Element[] removed; Element[] added; Element[] newAdded; int count = el.getElementCount(); if (result[1] != null) { // This is the case when we can keep the first element. if (result[0] == null) { removed = new Element[count - index - 1]; newAdded = new Element[count - index - 1]; added = new Element[] {}; } // This is the case when we may not keep the first // element. else { removed = new Element[count - index]; newAdded = new Element[count - index]; added = new Element[] { result[0] }; } newAdded[0] = result[1]; for (int i = index; i < count; i++) { Element el2 = el.getElement(i); int ind = i - count + removed.length; removed[ind] = el2; if (ind != 0) newAdded[ind] = el2; } Edit edit = getEditForParagraphAndIndex((BranchElement) el, editIndex); edit.addRemovedElements(removed); edit.addAddedElements(added); BranchElement newPar = (BranchElement) createBranchElement(el.getParentElement(), el.getAttributes()); newPar.replace(0, 0, newAdded); res = new Element[] { null, newPar }; } else { removed = new Element[count - index]; for (int i = index; i < count; ++i) removed[i - index] = el.getElement(i); Edit edit = getEditForParagraphAndIndex((BranchElement) el, editIndex); edit.addRemovedElements(removed); BranchElement newPar = (BranchElement) createBranchElement(el.getParentElement(), el.getAttributes()); newPar.replace(0, 0, removed); res = new Element[] { null, newPar }; } } else if (el instanceof LeafElement) { BranchElement par = (BranchElement) el.getParentElement(); Element el1 = createLeafElement(par, el.getAttributes(), el.getStartOffset(), offset); Element el2 = createLeafElement(par, el.getAttributes(), offset + space, el.getEndOffset()); res = new Element[] { el1, el2 }; } return res; }
|
privateElement[]split(Elementel,intoffset,intspace,inteditIndex){//Ifweareatanelementboundary,thenreturnanemptyarray.if((offset==el.getStartOffset()||offset==el.getEndOffset())&&space==0&&el.isLeaf())returnnewElement[2];//IftheelementisaninstanceofBranchElement,thenwe//recursivly//callthismethodtoperformthesplit.Element[]res=newElement[2];if(elinstanceofBranchElement){intindex=el.getElementIndex(offset);Elementchild=el.getElement(index);Element[]result=split(child,offset,space,editIndex);Element[]removed;Element[]added;Element[]newAdded;intcount=el.getElementCount();if(result[1]!=null){//Thisisthecasewhenwecankeepthefirstelement.if(result[0]==null){removed=newElement[count-index-1];newAdded=newElement[count-index-1];added=newElement[]{};}//Thisisthecasewhenwemaynotkeepthefirst//element.else{removed=newElement[count-index];newAdded=newElement[count-index];added=newElement[]{result[0]};}newAdded[0]=result[1];for(inti=index;i<count;i++){Elementel2=el.getElement(i);intind=i-count+removed.length;removed[ind]=el2;if(ind!=0)newAdded[ind]=el2;}Editedit=getEditForParagraphAndIndex((BranchElement)el,editIndex);edit.addRemovedElements(removed);edit.addAddedElements(added);BranchElementnewPar=(BranchElement)createBranchElement(el.getParentElement(),el.getAttributes());newPar.replace(0,0,newAdded);res=newElement[]{null,newPar};}else{removed=newElement[count-index];for(inti=index;i<count;++i)removed[i-index]=el.getElement(i);Editedit=getEditForParagraphAndIndex((BranchElement)el,editIndex);edit.addRemovedElements(removed);BranchElementnewPar=(BranchElement)createBranchElement(el.getParentElement(),el.getAttributes());newPar.replace(0,0,removed);res=newElement[]{null,newPar};}}elseif(elinstanceofLeafElement){BranchElementpar=(BranchElement)el.getParentElement();Elementel1=createLeafElement(par,el.getAttributes(),el.getStartOffset(),offset);Elementel2=createLeafElement(par,el.getAttributes(),offset+space,el.getEndOffset());res=newElement[]{el1,el2};}returnres;}
| 13,814
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); Element leaf = createLeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); Element leaf = createLeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
| 13,815
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); Element leaf = createLeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); Element leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
| 13,816
|
short handleInsertAfterNewline(Vector specs, int offset, int endOffset, Element prevParagraph, Element paragraph, AttributeSet a) { if (prevParagraph.getParentElement() == paragraph.getParentElement()) { specs.add(new ElementSpec(a, ElementSpec.EndTagType)); specs.add(new ElementSpec(a, ElementSpec.StartTagType)); if (prevParagraph.getEndOffset() != endOffset) return ElementSpec.JoinFractureDirection; // If there is an Element after this one, use JoinNextDirection. Element parent = paragraph.getParentElement(); if (parent.getElementCount() > (parent.getElementIndex(offset) + 1)) return ElementSpec.JoinNextDirection; } return ElementSpec.OriginateDirection; }
|
short handleInsertAfterNewline(Vector specs, int offset, int endOffset, Element prevParagraph, Element paragraph, AttributeSet a) { if (prevParagraph.getParentElement() == paragraph.getParentElement()) { specs.add(new ElementSpec(a, ElementSpec.EndTagType)); specs.add(new ElementSpec(a, ElementSpec.StartTagType)); if (paragraph.getStartOffset() != endOffset) return ElementSpec.JoinFractureDirection; // If there is an Element after this one, use JoinNextDirection. Element parent = paragraph.getParentElement(); if (parent.getElementCount() > (parent.getElementIndex(offset) + 1)) return ElementSpec.JoinNextDirection; } return ElementSpec.OriginateDirection; }
| 13,817
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes(); Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); ElementSpec finalStartTag = null; short finalStartDirection = ElementSpec.OriginateDirection; boolean prevCharWasNewline = false; Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); Element prevParagraph = getParagraphElement(offset); Element paragraph = getParagraphElement(endOffset); int segmentEnd = txt.offset + txt.count; // Check to see if we're inserting immediately after a newline. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { finalStartDirection = handleInsertAfterNewline(specs, offset, endOffset, prevParagraph, paragraph, paragraphAttributes); prevCharWasNewline = true; // Find the final start tag from the ones just created. for (int i = 0; i < specs.size(); i++) if (((ElementSpec) specs.get(i)).getType() == ElementSpec.StartTagType) finalStartTag = (ElementSpec) specs.get(i); } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { // Add the ElementSpec for the content. specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // Add ElementSpecs for the newline. specs.add(new ElementSpec(null, ElementSpec.EndTagType)); finalStartTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); specs.add(finalStartTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); // Set the direction of the last spec of type StartTagType. // If we are inserting after a newline then this value comes from // handleInsertAfterNewline. if (finalStartTag != null) { if (prevCharWasNewline) finalStartTag.setDirection(finalStartDirection); else if (prevParagraph.getEndOffset() != endOffset) finalStartTag.setDirection(ElementSpec.JoinFractureDirection); else { // If there is an element AFTER this one, then set the // direction to JoinNextDirection. Element parent = prevParagraph.getParentElement(); int index = parent.getElementIndex(offset); if (index + 1 < parent.getElementCount() && !parent.getElement(index + 1).isLeaf()) finalStartTag.setDirection(ElementSpec.JoinNextDirection); } } // If we are at the last index, then check if we could probably be // joined with the next element. // This means: // - we must be a ContentTag // - if there is a next Element, we must have the same attributes // - if there is no next Element, but one will be created, // we must have the same attributes as the higher-level run. ElementSpec last = (ElementSpec) specs.lastElement(); if (last.getType() == ElementSpec.ContentType) { Element currentRun = prevParagraph.getElement(prevParagraph.getElementIndex(offset)); if (currentRun.getEndOffset() == endOffset) { if (endOffset < getLength() && next.getAttributes().isEqual(attr) && last.getType() == ElementSpec.ContentType) last.setDirection(ElementSpec.JoinNextDirection); } else { if (finalStartTag != null && finalStartTag.getDirection() == ElementSpec.JoinFractureDirection && currentRun.getAttributes().isEqual(attr)) { last.setDirection(ElementSpec.JoinNextDirection); } } } // If we are at the first new element, then check if it could be // joined with the previous element. ElementSpec first = (ElementSpec) specs.firstElement(); if (prev.getAttributes().isEqual(attr) && first.getType() == ElementSpec.ContentType) first.setDirection(ElementSpec.JoinPreviousDirection); ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protectedvoidinsertUpdate(DefaultDocumentEventev,AttributeSetattr){super.insertUpdate(ev,attr);//Iftheattributesetisnull,useanemptyattributeset.if(attr==null)attr=SimpleAttributeSet.EMPTY;intoffset=ev.getOffset();intlength=ev.getLength();intendOffset=offset+length;AttributeSetparagraphAttributes=getParagraphElement(endOffset).getAttributes();Segmenttxt=newSegment();try{getText(offset,length,txt);}catch(BadLocationExceptionex){AssertionErrorae=newAssertionError("Unexpectedbadlocation");ae.initCause(ex);throwae;}intlen=0;Vectorspecs=newVector();ElementSpecfinalStartTag=null;shortfinalStartDirection=ElementSpec.OriginateDirection;booleanprevCharWasNewline=false;Elementprev=getCharacterElement(offset);Elementnext=getCharacterElement(endOffset);ElementprevParagraph=getParagraphElement(offset);Elementparagraph=getParagraphElement(endOffset);intsegmentEnd=txt.offset+txt.count;//Checktoseeifwe'reinsertingimmediatelyafteranewline.if(offset>0){try{Strings=getText(offset-1,1);if(s.equals("\n")){finalStartDirection=handleInsertAfterNewline(specs,offset,endOffset,prevParagraph,paragraph,paragraphAttributes);prevCharWasNewline=true;//Findthefinalstarttagfromtheonesjustcreated.for(inti=0;i<specs.size();i++)if(((ElementSpec)specs.get(i)).getType()==ElementSpec.StartTagType)finalStartTag=(ElementSpec)specs.get(i);}}catch(BadLocationExceptionble){//Thisshouldn'thappen.AssertionErrorae=newAssertionError();ae.initCause(ble);throwae;}}for(inti=txt.offset;i<segmentEnd;++i){len++;if(txt.array[i]=='\n'){//AddtheElementSpecforthecontent.specs.add(newElementSpec(attr,ElementSpec.ContentType,len));//AddElementSpecsforthenewline.specs.add(newElementSpec(null,ElementSpec.EndTagType));finalStartTag=newElementSpec(paragraphAttributes,ElementSpec.StartTagType);specs.add(finalStartTag);len=0;}}//Createlastelementiflastcharacterhasn'tbeenanewline.if(len>0)specs.add(newElementSpec(attr,ElementSpec.ContentType,len));//SetthedirectionofthelastspecoftypeStartTagType.//Ifweareinsertingafteranewlinethenthisvaluecomesfrom//handleInsertAfterNewline.if(finalStartTag!=null){if(prevCharWasNewline)finalStartTag.setDirection(finalStartDirection);elseif(prevParagraph.getEndOffset()!=endOffset)finalStartTag.setDirection(ElementSpec.JoinFractureDirection);else{//IfthereisanelementAFTERthisone,thensetthe//directiontoJoinNextDirection.Elementparent=prevParagraph.getParentElement();intindex=parent.getElementIndex(offset);if(index+1<parent.getElementCount()&&!parent.getElement(index+1).isLeaf())finalStartTag.setDirection(ElementSpec.JoinNextDirection);}}//Ifweareatthelastindex,thencheckifwecouldprobablybe//joinedwiththenextelement.//Thismeans://-wemustbeaContentTag//-ifthereisanextElement,wemusthavethesameattributes//-ifthereisnonextElement,butonewillbecreated,//wemusthavethesameattributesasthehigher-levelrun.ElementSpeclast=(ElementSpec)specs.lastElement();if(last.getType()==ElementSpec.ContentType){ElementcurrentRun=prevParagraph.getElement(prevParagraph.getElementIndex(offset));if(currentRun.getEndOffset()==endOffset){if(endOffset<getLength()&&next.getAttributes().isEqual(attr)&&last.getType()==ElementSpec.ContentType)last.setDirection(ElementSpec.JoinNextDirection);}else{if(finalStartTag!=null&&finalStartTag.getDirection()==ElementSpec.JoinFractureDirection&¤tRun.getAttributes().isEqual(attr)){last.setDirection(ElementSpec.JoinNextDirection);}}}//Ifweareatthefirstnewelement,thencheckifitcouldbe//joinedwiththepreviouselement.ElementSpecfirst=(ElementSpec)specs.firstElement();if(prev.getAttributes().isEqual(attr)&&first.getType()==ElementSpec.ContentType)first.setDirection(ElementSpec.JoinPreviousDirection);ElementSpec[]elSpecs=(ElementSpec[])specs.toArray(newElementSpec[specs.size()]);buffer.insert(offset,length,elSpecs,ev);}
| 13,818
|
public static String extract(Any an_any) { if (an_any.type().equal(type())) { an_any.type(tString); return an_any.extract_string(); } else throw new BAD_OPERATION("Contains not a string value type"); }
|
public static String extract(Any an_any) { if (an_any.type().equal(type())) { an_any.type(tString); return an_any.extract_string(); } else { BAD_OPERATION bad = new BAD_OPERATION("String value type expected"); bad.minor = Minor.Any; throw bad; } }
| 13,819
|
public void write_value(OutputStream ostream, Serializable a_string) { try { ostream.write_string((String) a_string); } catch (ClassCastException ex) { throw new MARSHAL("String expected"); } }
|
public void write_value(OutputStream ostream, Serializable a_string) { try { ostream.write_string((String) a_string); } catch (ClassCastException ex) { MARSHAL m = new MARSHAL("String expected"); m.minor = Minor.ClassCast; throw m; } }
| 13,820
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
private void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
| 13,821
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset), new WeakPositionComparator()); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
| 13,822
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
| 13,823
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { WeakReference r = (WeakReference) i.next(); GapContentPosition p = (GapContentPosition) r.get(); if (p == null) continue; if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
| 13,824
|
public Position createPosition(final int offset) throws BadLocationException { if (offset < 0 || offset > length()) throw new BadLocationException("The offset was out of the bounds of this" + " buffer", offset); // We store the actual array index in the GapContentPosition. The real // offset is then calculated in the GapContentPosition. int mark = offset; if (offset >= gapStart) mark += gapEnd - gapStart; GapContentPosition pos = new GapContentPosition(mark); // Add this into our list in a sorted fashion. int index = Collections.binarySearch(positions, pos); if (index < 0) index = -(index + 1); positions.add(index, pos); return pos; }
|
public Position createPosition(final int offset) throws BadLocationException { if (offset < 0 || offset > length()) throw new BadLocationException("The offset was out of the bounds of this" + " buffer", offset); // We store the actual array index in the GapContentPosition. The real // offset is then calculated in the GapContentPosition. int mark = offset; if (offset >= gapStart) mark += gapEnd - gapStart; GapContentPosition pos = new GapContentPosition(mark); // Add this into our list in a sorted fashion. int index = Collections.binarySearch(positions, r, new WeakPositionComparator()); if (index < 0) index = -(index + 1); positions.add(index, pos); return pos; }
| 13,825
|
public Position createPosition(final int offset) throws BadLocationException { if (offset < 0 || offset > length()) throw new BadLocationException("The offset was out of the bounds of this" + " buffer", offset); // We store the actual array index in the GapContentPosition. The real // offset is then calculated in the GapContentPosition. int mark = offset; if (offset >= gapStart) mark += gapEnd - gapStart; GapContentPosition pos = new GapContentPosition(mark); // Add this into our list in a sorted fashion. int index = Collections.binarySearch(positions, pos); if (index < 0) index = -(index + 1); positions.add(index, pos); return pos; }
|
public Position createPosition(final int offset) throws BadLocationException { if (offset < 0 || offset > length()) throw new BadLocationException("The offset was out of the bounds of this" + " buffer", offset); // We store the actual array index in the GapContentPosition. The real // offset is then calculated in the GapContentPosition. int mark = offset; if (offset >= gapStart) mark += gapEnd - gapStart; GapContentPosition pos = new GapContentPosition(mark); // Add this into our list in a sorted fashion. int index = Collections.binarySearch(positions, pos); if (index < 0) index = -(index + 1); positions.add(index, r); return pos; }
| 13,826
|
private void dumpPositions() { for (Iterator i = positions.iterator(); i.hasNext();) { GapContentPosition pos = (GapContentPosition) i.next(); System.err.println("position at: " + pos.mark); } }
|
private void dumpPositions() { for (Iterator i = positions.iterator(); i.hasNext();) { WeakReference r = (WeakReference) i.next(); GapContentPosition pos = (GapContentPosition) r.get(); System.err.println("position at: " + pos.mark); } }
| 13,827
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset), new WeakPositionComparator()); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
| 13,828
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
| 13,829
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { WeakReference r = (WeakReference) i.next(); GapContentPosition p = (GapContentPosition) r.get(); if (p == null) continue; if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
| 13,830
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
|
private void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
| 13,831
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset), new WeakPositionComparator()); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
| 13,832
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
| 13,833
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); if (index1 < 0) index1 = -(index1 + 1); // Search the first index with the specified offset. The binarySearch does // not necessarily find the first one. while (index1 > 0 && ((GapContentPosition) positions.get(index1 - 1)).mark == offset) index1--; for (ListIterator i = positions.listIterator(index1); i.hasNext();) { WeakReference r = (WeakReference) i.next(); GapContentPosition p = (GapContentPosition) r.get(); if (p == null) continue; if (p.mark > endOffset) break; if (p.mark >= offset && p.mark <= endOffset) p.mark = value; } }
| 13,834
|
protected void shiftGapEndUp(int newGapEnd) { if (newGapEnd == gapEnd) return; assert newGapEnd > gapEnd : "The new gap end must be greater than the " + "old gap end."; setPositionsInRange(gapEnd, newGapEnd - gapEnd, newGapEnd + 1); gapEnd = newGapEnd; }
|
protected void shiftGapEndUp(int newGapEnd) { if (newGapEnd == gapEnd) return; assert newGapEnd > gapEnd : "The new gap end must be greater than the " + "old gap end."; setPositionsInRange(gapEnd, newGapEnd - gapEnd, newGapEnd); gapEnd = newGapEnd; }
| 13,835
|
public String toString() { String result = super.toString(); if (value != UNSET) return value.getClass().getName() + " " + result; return result; }
|
public String toString() { String result = super.toString(); if (value != UNSET) return value.getClass().getName() + "=" + result; return result; }
| 13,837
|
public Ext2FileSystem(Device device) throws FileSystemException { if (device == null) { throw new FileSystemException("null device!"); } this.device = device; try { this.api = (BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class); } catch (ApiNotFoundException ex) { throw new FileSystemException("Device is not a block device", ex); } closed = false; byte data[]; //points to the byte where the fs metadata parsing has reached long byteIndex; cache = new BlockCache(50, (float) 0.75); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock byteIndex = 1024; api.read(byteIndex, data, 0, Superblock.SUPERBLOCK_LENGTH); byteIndex += Superblock.SUPERBLOCK_LENGTH; superblock = new Superblock(data); //read the group descriptors groupCount = (int) Math.ceil((double) superblock.getBlocksCount() / (double) superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; for (int i = 0; i < groupCount; i++) { data = new byte[GroupDescriptor.GROUPDESCRIPTOR_LENGTH]; api.read(byteIndex + i * GroupDescriptor.GROUPDESCRIPTOR_LENGTH, data, 0, GroupDescriptor.GROUPDESCRIPTOR_LENGTH); groupDescriptors[i] = new GroupDescriptor(data); } byteIndex += superblock.getBlockSize(); /* * //go through each block group //XXX byteIndex = ... //read the block bitmap //XXX what if it doesn't fit? data = new byte[(int)superblock.getBlockSize()]; api.read( byteIndex, data, 0, * (int)superblock.getBlockSize()); FSBitmap blockBitmap = new FSBitmap(data); byteIndex += superblock.getBlockSize(); * * //read the inode bitmap //XXX what if it doesn't fit? data = new byte[(int)superblock.getBlockSize()]; api.read( byteIndex, data, 0, (int)superblock.getBlockSize()); FSBitmap * inodeBitmap = new FSBitmap(data); byteIndex += superblock.getBlockSize(); * * //read the inode table //XXX what if it doesn't fit? Inode inodeTable[] = new Inode[ (int)superblock.getInodesCount() ]; */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } Ext2Debugger.debug("Ext2fs filesystem constructed sucessfully"); Ext2Debugger.debug( " superblock: #blocks: " + superblock.getBlocksCount() + "\n" + " #blocks/group: " + superblock.getBlocksPerGroup() + "\n" + " #block groups: " + groupCount + "\n" + " block size: " + superblock.getBlockSize() + "\n" + " #inodes: " + superblock.getINodesCount() + "\n" + " #inodes/group: " + superblock.getINodesPerGroup()); }
|
public Ext2FileSystem(Device device) throws FileSystemException { if (device == null) { throw new FileSystemException("null device!"); } this.device = device; try { this.api = (BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class); } catch (ApiNotFoundException ex) { throw new FileSystemException("Device is not a block device", ex); } closed = false; byte data[]; //points to the byte where the fs metadata parsing has reached long byteIndex; cache = new BlockCache(50, (float) 0.75); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock byteIndex = 1024; api.read(byteIndex, data, 0, Superblock.SUPERBLOCK_LENGTH); byteIndex += Superblock.SUPERBLOCK_LENGTH; superblock = new Superblock(data); //read the group descriptors groupCount = (int) Math.ceil((double) superblock.getBlocksCount() / (double) superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; for (int i = 0; i < groupCount; i++) { data = new byte[GroupDescriptor.GROUPDESCRIPTOR_LENGTH]; api.read(byteIndex + i * GroupDescriptor.GROUPDESCRIPTOR_LENGTH, data, 0, GroupDescriptor.GROUPDESCRIPTOR_LENGTH); groupDescriptors[i] = new GroupDescriptor(data); } byteIndex += superblock.getBlockSize(); /* * //go through each block group //XXX byteIndex = ... //read the block bitmap //XXX what if it doesn't fit? data = new byte[(int)superblock.getBlockSize()]; api.read( byteIndex, data, 0, * (int)superblock.getBlockSize()); FSBitmap blockBitmap = new FSBitmap(data); byteIndex += superblock.getBlockSize(); * * //read the inode bitmap //XXX what if it doesn't fit? data = new byte[(int)superblock.getBlockSize()]; api.read( byteIndex, data, 0, (int)superblock.getBlockSize()); FSBitmap * inodeBitmap = new FSBitmap(data); byteIndex += superblock.getBlockSize(); * * //read the inode table //XXX what if it doesn't fit? Inode inodeTable[] = new Inode[ (int)superblock.getInodesCount() ]; */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } Ext2Debugger.debug("Ext2fs filesystem constructed sucessfully"); Ext2Debugger.debug( " superblock: #blocks: " + superblock.getBlocksCount() + "\n" + " #blocks/group: " + superblock.getBlocksPerGroup() + "\n" + " #block groups: " + groupCount + "\n" + " block size: " + superblock.getBlockSize() + "\n" + " #inodes: " + superblock.getINodesCount() + "\n" + " #inodes/group: " + superblock.getINodesPerGroup()); }
| 13,838
|
public FSEntry getRootEntry() throws IOException { Ext2Debugger.debug("Ext2FileSystem.getRootEntry()", 2); try { if (!closed) { return new Ext2Entry(getINode(Ext2Constants.EXT2_ROOT_INO), "/", Ext2Constants.EXT2_FT_DIR); } } catch (FileSystemException e) { throw new IOException(e); } return null; }
|
public FSEntry getRootEntry() throws IOException { Ext2Debugger.debug("Ext2FileSystem.getRootEntry()", 2); try { if (!closed) { return new Ext2Entry(getINode(Ext2Constants.EXT2_ROOT_INO), "/", Ext2Constants.EXT2_FT_DIR); } } catch (FileSystemException e) { throw new IOException(e); } return null; }
| 13,839
|
protected void resolve() throws PluginException { // Do nothing }
|
protected void resolve() throws PluginException { // Do nothing }
| 13,840
|
protected void unresolve() throws PluginException { // Do nothing }
|
protected void unresolve() throws PluginException { // Do nothing }
| 13,841
|
public OutputStream _invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; // We suppose that the next_n should be the most popular. if (method.equals("next_n")) { // The next_n has been invoked. int amount = in.read_ulong(); BindingListHolder a_list = new BindingListHolder(); boolean result = next_n(amount, a_list); out = rh.createReply(); out.write_boolean(result); BindingListHelper.write(out, a_list.value); } else if (method.equals("next_one")) { // The next_one has been invoked. BindingHolder a_binding = new BindingHolder(); boolean result = next_one(a_binding); out = rh.createReply(); out.write_boolean(result); BindingHelper.write(out, a_binding.value); } else if (method.equals("destroy")) { // The destroy has been invoked. destroy(); out = rh.createReply(); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return out; }
|
public OutputStream _invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; // We suppose that the next_n should be the most popular. if (method.equals("next_n")) { // The next_n has been invoked. int amount = in.read_ulong(); BindingListHolder a_list = new BindingListHolder(); boolean result = next_n(amount, a_list); out = rh.createReply(); out.write_boolean(result); BindingListHelper.write(out, a_list.value); } else if (method.equals("next_one")) { // The next_one has been invoked. BindingHolder a_binding = new BindingHolder(); boolean result = next_one(a_binding); out = rh.createReply(); out.write_boolean(result); BindingHelper.write(out, a_binding.value); } else if (method.equals("destroy")) { // The destroy has been invoked. destroy(); out = rh.createReply(); } else throw new BAD_OPERATION(method, Minor.Method, CompletionStatus.COMPLETED_MAYBE); return out; }
| 13,842
|
public Response dispatch() throws IOException { if (dispatched) { throw new ProtocolException("request already dispatched"); } final String CRLF = "\r\n"; final String HEADER_SEP = ": "; final String US_ASCII = "US-ASCII"; final String version = connection.getVersion(); Response response; int contentLength = -1; boolean retry = false; int attempts = 0; boolean expectingContinue = false; if (requestBodyWriter != null) { contentLength = requestBodyWriter.getContentLength(); String expect = getHeader("Expect"); if (expect != null && expect.equals("100-continue")) { expectingContinue = true; } else { setHeader("Content-Length", Integer.toString(contentLength)); } } try { // Loop while authentication fails or continue do { retry = false; // Get socket output and input streams OutputStream out = connection.getOutputStream(); // Request line String requestUri = path; if (connection.isUsingProxy() && !"*".equals(requestUri) && !"CONNECT".equals(method)) { requestUri = getRequestURI(); } String line = method + ' ' + requestUri + ' ' + version + CRLF; out.write(line.getBytes(US_ASCII)); // Request headers for (Iterator i = requestHeaders.keySet().iterator(); i.hasNext(); ) { String name =(String) i.next(); String value =(String) requestHeaders.get(name); line = name + HEADER_SEP + value + CRLF; out.write(line.getBytes(US_ASCII)); } out.write(CRLF.getBytes(US_ASCII)); // Request body if (requestBodyWriter != null && !expectingContinue) { byte[] buffer = new byte[4096]; int len; int count = 0; requestBodyWriter.reset(); do { len = requestBodyWriter.write(buffer); if (len > 0) { out.write(buffer, 0, len); } count += len; } while (len > -1 && count < contentLength); } out.flush(); // Get response while(true) { response = readResponse(connection.getInputStream()); int sc = response.getCode(); if (sc == 401 && authenticator != null) { if (authenticate(response, attempts++)) { retry = true; } } else if (sc == 100) { if (expectingContinue) { requestHeaders.remove("Expect"); setHeader("Content-Length", Integer.toString(contentLength)); expectingContinue = false; retry = true; } else { // A conforming server can send an unsoliceted // Continue response but *should* not (RFC 2616 // sec 8.2.3). Ignore the bogus Continue // response and get the real response that // should follow continue; } } break; } } while (retry); } catch (IOException e) { connection.close(); throw e; } return response; }
|
public Response dispatch() throws IOException { if (dispatched) { throw new ProtocolException("request already dispatched"); } final String CRLF = "\r\n"; final String HEADER_SEP = ": "; final String US_ASCII = "US-ASCII"; final String version = connection.getVersion(); Response response; int contentLength = -1; boolean retry = false; int attempts = 0; boolean expectingContinue = false; if (requestBodyWriter != null) { contentLength = requestBodyWriter.getContentLength(); String expect = getHeader("Expect"); if (expect != null && expect.equals("100-continue")) { expectingContinue = true; } else { setHeader("Content-Length", Integer.toString(contentLength)); } } try { // Loop while authentication fails or continue do { retry = false; // Get socket output and input streams OutputStream out = connection.getOutputStream(); // Request line String requestUri = path; if (connection.isUsingProxy() && !"*".equals(requestUri) && !"CONNECT".equals(method)) { requestUri = getRequestURI(); } String line = method + ' ' + requestUri + ' ' + version + CRLF; out.write(line.getBytes(US_ASCII)); // Request headers for (Iterator i = requestHeaders.keySet().iterator(); i.hasNext(); ) { String name =(String) i.next(); String value =(String) requestHeaders.get(name); line = name + HEADER_SEP + value + CRLF; out.write(line.getBytes(US_ASCII)); } out.write(CRLF.getBytes(US_ASCII)); // Request body if (requestBodyWriter != null && !expectingContinue) { byte[] buffer = new byte[4096]; int len; int count = 0; requestBodyWriter.reset(); do { len = requestBodyWriter.write(buffer); if (len > 0) { out.write(buffer, 0, len); } count += len; } while (len > -1 && count < contentLength); } out.flush(); // Get response while(true) { response = readResponse(connection.getInputStream()); int sc = response.getCode(); if (sc == 401 && authenticator != null) { if (authenticate(response, attempts++)) { retry = true; } } else if (sc == 100) { if (expectingContinue) { requestHeaders.remove("Expect"); setHeader("Content-Length", Integer.toString(contentLength)); expectingContinue = false; retry = true; } else { // A conforming server can send an unsoliceted // Continue response but *should* not (RFC 2616 // sec 8.2.3). Ignore the bogus Continue // response and get the real response that // should follow continue; } } break; } } while (retry); } catch (IOException e) { connection.close(); throw e; } return response; }
| 13,843
|
public Response dispatch() throws IOException { if (dispatched) { throw new ProtocolException("request already dispatched"); } final String CRLF = "\r\n"; final String HEADER_SEP = ": "; final String US_ASCII = "US-ASCII"; final String version = connection.getVersion(); Response response; int contentLength = -1; boolean retry = false; int attempts = 0; boolean expectingContinue = false; if (requestBodyWriter != null) { contentLength = requestBodyWriter.getContentLength(); String expect = getHeader("Expect"); if (expect != null && expect.equals("100-continue")) { expectingContinue = true; } else { setHeader("Content-Length", Integer.toString(contentLength)); } } try { // Loop while authentication fails or continue do { retry = false; // Get socket output and input streams OutputStream out = connection.getOutputStream(); // Request line String requestUri = path; if (connection.isUsingProxy() && !"*".equals(requestUri) && !"CONNECT".equals(method)) { requestUri = getRequestURI(); } String line = method + ' ' + requestUri + ' ' + version + CRLF; out.write(line.getBytes(US_ASCII)); // Request headers for (Iterator i = requestHeaders.keySet().iterator(); i.hasNext(); ) { String name =(String) i.next(); String value =(String) requestHeaders.get(name); line = name + HEADER_SEP + value + CRLF; out.write(line.getBytes(US_ASCII)); } out.write(CRLF.getBytes(US_ASCII)); // Request body if (requestBodyWriter != null && !expectingContinue) { byte[] buffer = new byte[4096]; int len; int count = 0; requestBodyWriter.reset(); do { len = requestBodyWriter.write(buffer); if (len > 0) { out.write(buffer, 0, len); } count += len; } while (len > -1 && count < contentLength); } out.flush(); // Get response while(true) { response = readResponse(connection.getInputStream()); int sc = response.getCode(); if (sc == 401 && authenticator != null) { if (authenticate(response, attempts++)) { retry = true; } } else if (sc == 100) { if (expectingContinue) { requestHeaders.remove("Expect"); setHeader("Content-Length", Integer.toString(contentLength)); expectingContinue = false; retry = true; } else { // A conforming server can send an unsoliceted // Continue response but *should* not (RFC 2616 // sec 8.2.3). Ignore the bogus Continue // response and get the real response that // should follow continue; } } break; } } while (retry); } catch (IOException e) { connection.close(); throw e; } return response; }
|
public Response dispatch() throws IOException { if (dispatched) { throw new ProtocolException("request already dispatched"); } final String CRLF = "\r\n"; final String HEADER_SEP = ": "; final String US_ASCII = "US-ASCII"; final String version = connection.getVersion(); Response response; int contentLength = -1; boolean retry = false; int attempts = 0; boolean expectingContinue = false; if (requestBodyWriter != null) { contentLength = requestBodyWriter.getContentLength(); String expect = getHeader("Expect"); if (expect != null && expect.equals("100-continue")) { expectingContinue = true; } else { setHeader("Content-Length", Integer.toString(contentLength)); } } try { // Loop while authentication fails or continue do { retry = false; // Get socket output and input streams OutputStream out = connection.getOutputStream(); // Request line String requestUri = path; if (connection.isUsingProxy() && !"*".equals(requestUri) && !"CONNECT".equals(method)) { requestUri = getRequestURI(); } String line = method + ' ' + requestUri + ' ' + version + CRLF; out.write(line.getBytes(US_ASCII)); // Request headers for (Iterator i = requestHeaders.keySet().iterator(); i.hasNext(); ) { String name =(String) i.next(); String value =(String) requestHeaders.get(name); line = name + HEADER_SEP + value + CRLF; out.write(line.getBytes(US_ASCII)); } out.write(CRLF.getBytes(US_ASCII)); // Request body if (requestBodyWriter != null && !expectingContinue) { byte[] buffer = new byte[4096]; int len; int count = 0; requestBodyWriter.reset(); do { len = requestBodyWriter.write(buffer); if (len > 0) { out.write(buffer, 0, len); } count += len; } while (len > -1 && count < contentLength); } out.flush(); // Get response while(true) { response = readResponse(connection.getInputStream()); int sc = response.getCode(); if (sc == 401 && authenticator != null) { if (authenticate(response, attempts++)) { retry = true; } } else if (sc == 100) { if (expectingContinue) { requestHeaders.remove("Expect"); setHeader("Content-Length", Integer.toString(contentLength)); expectingContinue = false; retry = true; } else { // A conforming server can send an unsoliceted // Continue response but *should* not (RFC 2616 // sec 8.2.3). Ignore the bogus Continue // response and get the real response that // should follow continue; } } break; } } while (retry); } catch (IOException e) { connection.close(); throw e; } return response; }
| 13,844
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
| 13,845
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
| 13,846
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
| 13,847
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(entry.name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
| 13,848
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
|
void notifyHeaderHandlers(Headers headers) { for (Iterator i = headers.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); String name =(String) entry.getKey(); // Handle Set-Cookie if ("Set-Cookie".equalsIgnoreCase(name)) { String value = (String) entry.getValue(); handleSetCookie(value); } ResponseHeaderHandler handler = (ResponseHeaderHandler) responseHeaderHandlers.get(name); if (handler != null) { String value = (String) entry.getValue(); handler.setValue(value); } } }
| 13,849
|
protected Rectangle getBoundsForIconOf(JInternalFrame frame) { // IconRects has no order to it. // The icon _must_ be placed in the first free slot (working from // the bottom left corner) // The icon also must not be placed where another icon is placed // (regardless whether that frame is an icon currently or not) JDesktopPane desktopPane = frame.getDesktopPane(); Rectangle paneBounds = desktopPane.getBounds(); Insets insets = desktopPane.getInsets(); Dimension pref = frame.getDesktopIcon().getPreferredSize(); if (desktopPane == null) return frame.getDesktopIcon().getBounds(); Component[] frames = desktopPane.getComponents(); int count = 0; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon || frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) count++; iconRects = new Rectangle[count]; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon) iconRects[--count] = frames[i].getBounds(); else if (frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) iconRects[--count] = ((JInternalFrame) frames[i]).getDesktopIcon() .getBounds(); int startingX = insets.left; int startingY = paneBounds.height - insets.bottom - pref.height; Rectangle ideal = new Rectangle(startingX, startingY, pref.width, pref.height); boolean clear = true; while (iconRects.length > 0) { clear = true; for (int i = 0; i < iconRects.length; i++) { if (iconRects[i] != null && iconRects[i].intersects(ideal)) { clear = false; break; } } if (clear) return ideal; startingX += pref.width; if (startingX + pref.width > paneBounds.width - insets.right) { startingX = insets.left; startingY -= pref.height; } ideal.setBounds(startingX, startingY, pref.width, pref.height); } return ideal; }
|
protected Rectangle getBoundsForIconOf(JInternalFrame frame) { // IconRects has no order to it. // The icon _must_ be placed in the first free slot (working from // the bottom left corner) // The icon also must not be placed where another icon is placed // (regardless whether that frame is an icon currently or not) JDesktopPane desktopPane = frame.getDesktopPane(); Rectangle paneBounds = desktopPane.getBounds(); Insets insets = desktopPane.getInsets(); Dimension pref = frame.getDesktopIcon().getPreferredSize(); if (desktopPane == null) return frame.getDesktopIcon().getBounds(); Component[] frames = desktopPane.getComponents(); int count = 0; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon || frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) count++; iconRects = new Rectangle[count]; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon) iconRects[--count] = frames[i].getBounds(); else if (frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) iconRects[--count] = ((JInternalFrame) frames[i]).getDesktopIcon() .getBounds(); int startingX = insets.left; int startingY = paneBounds.height - insets.bottom - pref.height; Rectangle ideal = new Rectangle(startingX, startingY, pref.width, pref.height); boolean clear = true; while (iconRects.length > 0) { clear = true; for (int i = 0; i < iconRects.length; i++) { if (iconRects[i] != null && iconRects[i].intersects(ideal)) { clear = false; break; } } if (clear) return ideal; startingX += pref.width; if (startingX + pref.width > paneBounds.width - insets.right) { startingX = insets.left; startingY -= pref.height; } ideal.setBounds(startingX, startingY, pref.width, pref.height); } return ideal; }
| 13,866
|
protected Rectangle getBoundsForIconOf(JInternalFrame frame) { // IconRects has no order to it. // The icon _must_ be placed in the first free slot (working from // the bottom left corner) // The icon also must not be placed where another icon is placed // (regardless whether that frame is an icon currently or not) JDesktopPane desktopPane = frame.getDesktopPane(); Rectangle paneBounds = desktopPane.getBounds(); Insets insets = desktopPane.getInsets(); Dimension pref = frame.getDesktopIcon().getPreferredSize(); if (desktopPane == null) return frame.getDesktopIcon().getBounds(); Component[] frames = desktopPane.getComponents(); int count = 0; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon || frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) count++; iconRects = new Rectangle[count]; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon) iconRects[--count] = frames[i].getBounds(); else if (frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) iconRects[--count] = ((JInternalFrame) frames[i]).getDesktopIcon() .getBounds(); int startingX = insets.left; int startingY = paneBounds.height - insets.bottom - pref.height; Rectangle ideal = new Rectangle(startingX, startingY, pref.width, pref.height); boolean clear = true; while (iconRects.length > 0) { clear = true; for (int i = 0; i < iconRects.length; i++) { if (iconRects[i] != null && iconRects[i].intersects(ideal)) { clear = false; break; } } if (clear) return ideal; startingX += pref.width; if (startingX + pref.width > paneBounds.width - insets.right) { startingX = insets.left; startingY -= pref.height; } ideal.setBounds(startingX, startingY, pref.width, pref.height); } return ideal; }
|
protected Rectangle getBoundsForIconOf(JInternalFrame frame) { // IconRects has no order to it. // The icon _must_ be placed in the first free slot (working from // the bottom left corner) // The icon also must not be placed where another icon is placed // (regardless whether that frame is an icon currently or not) JDesktopPane desktopPane = frame.getDesktopPane(); Rectangle paneBounds = desktopPane.getBounds(); Insets insets = desktopPane.getInsets(); Dimension pref = frame.getDesktopIcon().getPreferredSize(); if (desktopPane == null) return frame.getDesktopIcon().getBounds(); Component[] frames = desktopPane.getComponents(); int count = 0; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon || frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) count++; iconRects = new Rectangle[count]; for (int i = 0, j = 0; i < frames.length; i++) if (frames[i] instanceof JDesktopIcon) iconRects[--count] = frames[i].getBounds(); else if (frames[i] instanceof JInternalFrame && ((JInternalFrame) frames[i]).getWasIcon() && frames[i] != frame) iconRects[--count] = ((JInternalFrame) frames[i]).getDesktopIcon() .getBounds(); int startingX = insets.left; int startingY = paneBounds.height - insets.bottom - pref.height; Rectangle ideal = new Rectangle(startingX, startingY, pref.width, pref.height); boolean clear = true; while (iconRects.length > 0) { clear = true; for (int i = 0; i < iconRects.length; i++) { if (iconRects[i] != null && iconRects[i].intersects(ideal)) { clear = false; break; } } if (clear) return ideal; startingX += pref.width; if (startingX + pref.width > paneBounds.width - insets.right) { startingX = insets.left; startingY -= pref.height; } ideal.setBounds(startingX, startingY, pref.width, pref.height); } return ideal; }
| 13,867
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 13,868
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 13,869
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") +"\""); ArrayList hrefObjList = findAllChildHrefObjects(); StringBuffer entityString = new StringBuffer (); StringBuffer notationString = new StringBuffer (); if (hrefObjList.size() > 0) { if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Constants.NEW_LINE); synchronized (hrefObjList) { Iterator iter = hrefObjList.iterator(); while (iter.hasNext()) { Href hrefObj = (Href) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Specification.getInstance().getPrettyXDFOutputIndentation()); entityString.append("<!ENTITY " + hrefObj.getName()); if (hrefObj.getPubId() != null) entityString.append(" PUBLIC \"" + hrefObj.getPubId() + "\""); if (hrefObj.getSysId() != null) entityString.append(" SYSTEM \"" + hrefObj.getSysId() + "\""); if (hrefObj.getNdata() != null) entityString.append(" NDATA " + hrefObj.getNdata()); entityString.append(">"); if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Constants.NEW_LINE); } } } synchronized (XMLNotationHash) { Iterator iter = XMLNotationHash.iterator(); while (iter.hasNext()) { Hashtable notationHash = (Hashtable) iter.next(); if (notationHash.containsKey("name")) { if (Specification.getInstance().isPrettyXDFOutput()) notationString.append(Specification.getInstance().getPrettyXDFOutputIndentation()); notationString.append("<!NOTATION " + notationHash.get("name")); if (notationHash.containsKey("publicId")) notationString.append(" PUBLIC \"" + notationHash.get("publicId") + "\""); if (notationHash.containsKey("systemId")) notationString.append(" SYSTEM \"" + notationHash.get("systemId") + "\""); notationString.append(">"); if (Specification.getInstance().isPrettyXDFOutput()) notationString.append(Constants.NEW_LINE); } else { Log.warnln("Notation entry lacks name, ignoring entry\n"); } } } if(entityString.length() > 0 || notationString.length() > 0 ) { writeOut(outputstream, " ["); if(entityString.length() > 0) writeOut(outputstream, entityString.toString()); if (notationString.length() > 0 ) writeOut(outputstream, notationString.toString()); writeOut(outputstream, "]"); } writeOut(outputstream, ">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 13,870
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 13,871
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName or rootName entries, ignoring DOCTYPE line printout"); }
| 13,872
|
protected AccessibleContainerHandler() {}
|
protected AccessibleContainerHandler() {}
| 13,873
|
public void componentAdded(ContainerEvent event) {}
|
public void componentAdded(ContainerEvent event) {}
| 13,874
|
public void componentRemoved(ContainerEvent valevent) {}
|
public void componentRemoved(ContainerEvent valevent) {}
| 13,875
|
protected AccessibleFocusHandler(){}
|
protected AccessibleFocusHandler(){}
| 13,876
|
public void focusGained(FocusEvent event){}
|
public void focusGained(FocusEvent event){}
| 13,877
|
public void focusLost(FocusEvent valevent){}
|
public void focusLost(FocusEvent valevent){}
| 13,878
|
protected AccessibleJComponent() {}
|
protected AccessibleJComponent() {}
| 13,879
|
public void removePropertyChangeListener(PropertyChangeListener listener) {}
|
public void removePropertyChangeListener(PropertyChangeListener listener) {}
| 13,880
|
public void addNotify() { super.addNotify(); // let parents inherit the keybord mapping InputMap input = getInputMap(); ActionMap actions = getActionMap(); Container parent = getParent(); while ((parent != null) && (parent instanceof JComponent)) { JComponent jParent = (JComponent) parent; InputMap parentInput = jParent.getInputMap(); ActionMap parentAction = jParent.getActionMap(); KeyStroke[] ikeys = input.keys(); for (int i = 0; i < ikeys.length; i++) { Object o = input.get(ikeys[i]); parentInput.put(ikeys[i], o); } Object[] akeys = actions.keys(); for (int i = 0; i < akeys.length; i++) { Action a = actions.get(akeys[i]); parentAction.put(akeys[i], a); } parent = jParent.getParent(); } // notify ancestor listeners AncestorListener[] ls = getAncestorListeners(); AncestorEvent ev = new AncestorEvent(this, AncestorEvent.ANCESTOR_ADDED, this, parent); for (int i = 0; i < ls.length; i++) { ls[i].ancestorAdded(ev); } // fire property change event for 'ancestor' firePropertyChange("ancestor", null, parent); }
|
public void addNotify() { super.addNotify(); // let parents inherit the keybord mapping InputMap input = getInputMap(); ActionMap actions = getActionMap(); Container parent = getParent(); while ((parent != null) && (parent instanceof JComponent)) { JComponent jParent = (JComponent) parent; InputMap parentInput = jParent.getInputMap(); ActionMap parentAction = jParent.getActionMap(); KeyStroke[] ikeys = input.keys(); for (int i = 0; i < ikeys.length; i++) { Object o = input.get(ikeys[i]); parentInput.put(ikeys[i], o); } Object[] akeys = actions.keys(); for (int i = 0; i < akeys.length; i++) { Action a = actions.get(akeys[i]); parentAction.put(akeys[i], a); } parent = jParent.getParent(); } // notify ancestor listeners AncestorListener[] ls = getAncestorListeners(); AncestorEvent ev = new AncestorEvent(this, AncestorEvent.ANCESTOR_ADDED, this, parent); for (int i = 0; i < ls.length; i++) { ls[i].ancestorAdded(ev); } // fire property change event for 'ancestor' firePropertyChange("ancestor", null, parent); }
| 13,881
|
protected Graphics getComponentGraphics(Graphics g) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; }
|
protected Graphics getComponentGraphics(Graphics g) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; }
| 13,882
|
public int getDebugGraphicsOptions() { return 0; }
|
public int getDebugGraphicsOptions() { String option = System.getProperty("gnu.javax.swing.DebugGraphics"); int options = debugGraphicsOptions; if (option != null && option.length() != 0) { if (options < 0) options = 0; if (option.equals("LOG")) options |= DebugGraphics.LOG_OPTION; else if (option.equals("FLASH")) options |= DebugGraphics.FLASH_OPTION; } return options; }
| 13,883
|
public void removeNotify() { super.removeNotify(); // let parents inherit the keybord mapping InputMap input = getInputMap(); ActionMap actions = getActionMap(); Container parent = getParent(); while ((parent != null) && (parent instanceof JComponent)) { JComponent jParent = (JComponent) parent; InputMap parentInput = jParent.getInputMap(); ActionMap parentAction = jParent.getActionMap(); KeyStroke[] ikeys = input.allKeys(); for (int i = 0; i < ikeys.length; i++) { parentInput.remove(ikeys[i]); } Object[] akeys = actions.allKeys(); for (int i = 0; i < akeys.length; i++) { parentAction.remove(akeys[i]); } parent = jParent.getParent(); } // notify ancestor listeners AncestorListener[] ls = getAncestorListeners(); AncestorEvent ev = new AncestorEvent(this, AncestorEvent.ANCESTOR_ADDED, this, parent); for (int i = 0; i < ls.length; i++) { ls[i].ancestorAdded(ev); } // fire property change event for 'ancestor' firePropertyChange("ancestor", parent, null); }
|
public void removeNotify() { super.removeNotify(); // let parents inherit the keybord mapping InputMap input = getInputMap(); ActionMap actions = getActionMap(); Container parent = getParent(); while ((parent != null) && (parent instanceof JComponent)) { JComponent jParent = (JComponent) parent; InputMap parentInput = jParent.getInputMap(); ActionMap parentAction = jParent.getActionMap(); KeyStroke[] ikeys = input.allKeys(); for (int i = 0; i < ikeys.length; i++) { parentInput.remove(ikeys[i]); } Object[] akeys = actions.allKeys(); for (int i = 0; i < akeys.length; i++) { parentAction.remove(akeys[i]); } parent = jParent.getParent(); } // notify ancestor listeners AncestorListener[] ls = getAncestorListeners(); AncestorEvent ev = new AncestorEvent(this, AncestorEvent.ANCESTOR_ADDED, this, parent); for (int i = 0; i < ls.length; i++) { ls[i].ancestorAdded(ev); } // fire property change event for 'ancestor' firePropertyChange("ancestor", parent, null); }
| 13,886
|
public MenuSelectionManager getMenuSelectionManager() { return manager; } // getMenuSelectionManager()
|
public MenuSelectionManager getMenuSelectionManager() { return manager; } // getMenuSelectionManager()
| 13,889
|
public MenuSelectionManager getMenuSelectionManager() { return manager; } // getMenuSelectionManager()
|
public MenuSelectionManager getMenuSelectionManager() { return manager; } // getMenuSelectionManager()
| 13,890
|
public MenuElement[] getPath() { return path; } // getPath()
|
public MenuElement[] getPath() { return path; } // getPath()
| 13,891
|
public MenuElement[] getPath() { return path; } // getPath()
|
public MenuElement[] getPath() { return path; } // getPath()
| 13,892
|
public String name() { return schemeName; }
|
public String name() { return schemeName + "-" + md.name(); }
| 13,895
|
public StringContent() { this(1); }
|
public StringContent() { this(10); }
| 13,896
|
public void addRule(String rule) { // FIXME: Not implemented. }
|
CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } publicCssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } voidCssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } addRule(StringCssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } rule)CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } {CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } //CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } FIXME:CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } NotCssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } implemented.CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { } }
| 13,897
|
public void ctx(Context a_context) { m_context = a_context; }
|
public Context ctx() { m_context = a_context; }
| 13,899
|
public void ctx(Context a_context) { m_context = a_context; }
|
public void ctx(Context a_context) { return m_context; }
| 13,900
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
| 13,901
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input, m_rph.service_context); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
| 13,902
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
| 13,903
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
|
private void p_invoke() throws SystemException, ForwardRequest { binaryReply response = submit(); if (m_rph == null) m_rph = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); m_rph.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); switch (m_rph.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } if (m_interceptor != null) m_interceptor.receive_reply(m_info); break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); m_sys_ex = ObjectCreator.readSystemException(input); m_environment.exception(m_sys_ex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); throw m_sys_ex; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } readExceptionId(input); // Prepare an Any that will hold the exception. gnuAny exc = new gnuAny(); exc.setOrb(orb); exc.insert_Streamable(new streamReadyHolder(input)); UnknownUserException unuex = new UnknownUserException(exc); m_environment.exception(unuex); if (m_interceptor != null) m_interceptor.receive_exception(m_info); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { new MARSHAL("Cant read forwarding info", 5103, CompletionStatus.COMPLETED_NO ); } setIor(forwarded); m_forward_ior = forwarded; if (m_interceptor != null) m_interceptor.receive_other(m_info); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status", 8100 + m_rph.reply_status, CompletionStatus.COMPLETED_NO ); } }
| 13,904
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
| 13,905
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { Functional_ORB fo = (Functional_ORB) orb; r =response_header.readMessage(socketInput, socket, fo.TOUT_WHILE_READING, fo.TOUT_AFTER_RECEIVING); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
| 13,906
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
|
public synchronized binaryReply submit() throws ForwardRequest { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.operation = m_operation; rh.object_key = ior.key; // Update interceptor. m_rqh = rh; if (m_interceptor != null) m_interceptor.send_request(m_info); // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets)); request_part.setOrb(orb); request_part.setBigEndian(header.isBigEndian()); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); Socket socket = null; java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port; synchronized (SocketRepository.class) { socket = SocketRepository.get_socket(key); } try { long pause = PAUSE_INITIAL; if (socket == null) { // The BindException may be thrown under very heavy parallel // load. For some time, just wait, exceptiong the socket to free. Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { // Expecting to free a socket via finaliser. System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port, 10000 + ior.Internet.port, CompletionStatus.COMPLETED_NO ); m.initCause(io_ex); throw m; } finally { try { if (socket != null && !socket.isClosed()) { socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS); SocketRepository.put_socket(key, socket); } } catch (IOException scx) { InternalError ierr = new InternalError(); ierr.initCause(scx); throw ierr; } } }
| 13,907
|
protected void write_parameter_buffer(MessageHeader header, cdrBufOutput request_part ) throws MARSHAL { try { if (header.version.since_inclusive(1, 2)) { request_part.align(8); } m_parameter_buffer.buffer.writeTo(request_part); } catch (IOException ex) { throw new MARSHAL("Unable to write method arguments to CDR output."); } }
|
protected void write_parameter_buffer(MessageHeader header, cdrBufOutput request_part ) throws MARSHAL { try { if (header.version.since_inclusive(1, 2)) { request_part.align(8); } m_parameter_buffer.buffer.writeTo(request_part); } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to write method arguments to CDR output."); m.minor = Minor.CDR; throw m; } }
| 13,908
|
public SplitPaneDividerBorder(Color highlight, Color shadow) { this.highlight = (highlight != null) ? highlight : Color.white; this.shadow = (shadow != null) ? shadow : Color.black; }
|
public SplitPaneDividerBorder() { this.highlight = (highlight != null) ? highlight : Color.white; this.shadow = (shadow != null) ? shadow : Color.black; }
| 13,909
|
public SplitPaneDividerBorder(Color highlight, Color shadow) { this.highlight = (highlight != null) ? highlight : Color.white; this.shadow = (shadow != null) ? shadow : Color.black; }
|
public SplitPaneDividerBorder(Color highlight, Color shadow) { this.highlight = (highlight != null) ? highlight : Color.white; this.shadow = (shadow != null) ? shadow : Color.black; }
| 13,910
|
public boolean isBorderOpaque() { return (highlight.getAlpha() == 255) && (shadow.getAlpha() == 255); }
|
public boolean isBorderOpaque() { return true; }
| 13,911
|
public static Border getSplitPaneDividerBorder() { /* See comment in methods above for why this border is not shared. */ return new SplitPaneDividerBorder( UIManager.getColor("SplitPane.highlight"), UIManager.getColor("SplitPane.darkShadow")); }
|
public static Border getSplitPaneDividerBorder() { /* See comment in methods above for why this border is not shared. */ return new SplitPaneDividerBorder( UIManager.getColor("SplitPane.highlight"), UIManager.getColor("SplitPane.darkShadow")); }
| 13,913
|
private void getEditor() { String workingDir = System.getProperty("user.dir"); MyFileChooser pcFileChooser = new MyFileChooser(workingDir); int ret = pcFileChooser.showOpenDialog(this); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); try { editor.setText(file.getCanonicalPath()); } catch (IOException e) { } } }
|
private void getEditor() { String workingDir = System.getProperty("user.dir"); TN5250jFileChooser pcFileChooser = new TN5250jFileChooser(workingDir); int ret = pcFileChooser.showOpenDialog(this); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); try { editor.setText(file.getCanonicalPath()); } catch (IOException e) { } } }
| 13,914
|
private void getIFSFile() {// String workingDir = System.getProperty("user.dir");// MyFileChooser pcFileChooser = new MyFileChooser(workingDir);//// // set the file filters for the file chooser// ExportFileFilter filter;//// if (((String)cvtType.getSelectedItem()).equals(LangTool.getString("spool.toPDF")))// filter = new ExportFileFilter("pdf","PDF Files");// else// filter = new ExportFileFilter("txt","Text Files");//// pcFileChooser.addChoosableFileFilter(filter );//// int ret = pcFileChooser.showSaveDialog(this);//// // check to see if something was actually chosen// if (ret == JFileChooser.APPROVE_OPTION) {// File file = pcFileChooser.getSelectedFile();// pcPathInfo.setText(filter.setExtension(file));//// } IFSFileDialog fd = new IFSFileDialog(this, "Save As", splfile.getSystem()); com.ibm.as400.vaccess.FileFilter[] filterList = new com.ibm.as400.vaccess.FileFilter[2]; filterList[0] = new com.ibm.as400.vaccess.FileFilter("All files (*.*)", "*.*"); // Set up the filter based on the type of export specifed if (cvtType.getSelectedIndex() == 0) { filterList[1] = new com.ibm.as400.vaccess.FileFilter("PDF files (*.pdf)", "*.pdf"); } else { filterList[1] = new com.ibm.as400.vaccess.FileFilter("Text files (*.txt)", "*.txt"); } fd.setFileFilter(filterList, 1); // show the dialog and obtain the file if selected if (fd.showDialog() == IFSFileDialog.OK) { ifsPathInfo.setText(fd.getAbsolutePath()); } }
|
private void getIFSFile() {// String workingDir = System.getProperty("user.dir");// MyFileChooser pcFileChooser = new MyFileChooser(workingDir);//// // set the file filters for the file chooser// ExportFileFilter filter;//// if (((String)cvtType.getSelectedItem()).equals(LangTool.getString("spool.toPDF")))// filter = new ExportFileFilter("pdf","PDF Files");// else// filter = new ExportFileFilter("txt","Text Files");//// pcFileChooser.addChoosableFileFilter(filter );//// int ret = pcFileChooser.showSaveDialog(this);//// // check to see if something was actually chosen// if (ret == JFileChooser.APPROVE_OPTION) {// File file = pcFileChooser.getSelectedFile();// pcPathInfo.setText(filter.setExtension(file));//// } IFSFileDialog fd = new IFSFileDialog(this, "Save As", splfile.getSystem()); com.ibm.as400.vaccess.FileFilter[] filterList = new com.ibm.as400.vaccess.FileFilter[2]; filterList[0] = new com.ibm.as400.vaccess.FileFilter("All files (*.*)", "*.*"); // Set up the filter based on the type of export specifed if (cvtType.getSelectedIndex() == 0) { filterList[1] = new com.ibm.as400.vaccess.FileFilter("PDF files (*.pdf)","*.pdf"); } else { filterList[1] = new com.ibm.as400.vaccess.FileFilter("Text files (*.txt)","*.txt"); } fd.setFileFilter(filterList, 1); // show the dialog and obtain the file if selected if (fd.showDialog() == IFSFileDialog.OK) { ifsPathInfo.setText(fd.getAbsolutePath()); } }
| 13,915
|
private void getPCFile() { String workingDir = System.getProperty("user.dir"); MyFileChooser pcFileChooser = new MyFileChooser(workingDir); // set the file filters for the file chooser ExportFileFilter filter; if (((String)cvtType.getSelectedItem()).equals(LangTool.getString("spool.toPDF"))) filter = new ExportFileFilter("pdf","PDF Files"); else filter = new ExportFileFilter("txt","Text Files"); pcFileChooser.addChoosableFileFilter(filter ); int ret = pcFileChooser.showSaveDialog(this); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); pcPathInfo.setText(filter.setExtension(file)); } }
|
private void getPCFile() { String workingDir = System.getProperty("user.dir"); TN5250jFileChooser pcFileChooser = new TN5250jFileChooser(workingDir); // set the file filters for the file chooser ExportFileFilter filter; if (((String)cvtType.getSelectedItem()).equals(LangTool.getString("spool.toPDF"))) filter = new ExportFileFilter("pdf","PDF Files"); else filter = new ExportFileFilter("txt","Text Files"); pcFileChooser.addChoosableFileFilter(filter ); int ret = pcFileChooser.showSaveDialog(this); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); pcPathInfo.setText(filter.setExtension(file)); } }
| 13,916
|
public void addPropertyChangeListener(PropertyChangeListener listener) {}
|
public void addPropertyChangeListener(PropertyChangeListener listener) {}
| 13,917
|
public AccessibleStateSet getAccessibleStateSet() { return null; }
|
public AccessibleStateSet getAccessibleStateSet() { return super.getAccessibleStateSet(); }
| 13,918
|
public JComponent() { super(); super.setLayout(new FlowLayout()); setDropTarget(new DropTarget()); defaultLocale = Locale.getDefault(); debugGraphicsOptions = DebugGraphics.NONE_OPTION; setRequestFocusEnabled(true); }
|
public JComponent() { super(); super.setLayout(new FlowLayout()); setDropTarget(new DropTarget()); defaultLocale = Locale.getDefault(); debugGraphicsOptions = DebugGraphics.NONE_OPTION; setRequestFocusEnabled(true); }
| 13,919
|
public JComponent() { super(); super.setLayout(new FlowLayout()); setDropTarget(new DropTarget()); defaultLocale = Locale.getDefault(); debugGraphicsOptions = DebugGraphics.NONE_OPTION; setRequestFocusEnabled(true); }
|
public JComponent() { super(); super.setLayout(new FlowLayout()); setDropTarget(new DropTarget()); defaultLocale = Locale.getDefault(); debugGraphicsOptions = DebugGraphics.NONE_OPTION; setRequestFocusEnabled(true); }
| 13,920
|
public void computeVisibleRect(Rectangle rect) { Component c = getParent(); if (c != null && c instanceof JComponent) { ((JComponent) c).computeVisibleRect(rect); rect.translate(-getX(), -getY()); Rectangle2D.intersect(rect, new Rectangle(0, 0, getWidth(), getHeight()), rect); } else rect.setRect(0, 0, getWidth(), getHeight()); }
|
public void computeVisibleRect(Rectangle rect) { Component c = getParent(); if (c != null && c instanceof JComponent) { ((JComponent) c).computeVisibleRect(rect); rect.translate(-getX(), -getY()); Rectangle2D.intersect(rect, new Rectangle(0, 0, getWidth(), getHeight()), rect); } else rect.setRect(0, 0, getWidth(), getHeight()); }
| 13,921
|
public void computeVisibleRect(Rectangle rect) { Component c = getParent(); if (c != null && c instanceof JComponent) { ((JComponent) c).computeVisibleRect(rect); rect.translate(-getX(), -getY()); Rectangle2D.intersect(rect, new Rectangle(0, 0, getWidth(), getHeight()), rect); } else rect.setRect(0, 0, getWidth(), getHeight()); }
|
public void computeVisibleRect(Rectangle rect) { Component c = getParent(); if (c != null && c instanceof JComponent) { ((JComponent) c).computeVisibleRect(rect); rect.translate(-getX(), -getY()); Rectangle2D.intersect(rect, new Rectangle(0, 0, getWidth(), getHeight()), rect); } else rect.setRect(0, 0, getWidth(), getHeight()); }
| 13,922
|
public JToolTip createToolTip() { JToolTip toolTip = new JToolTip(); toolTip.setComponent(this); toolTip.setTipText(toolTipText); return toolTip; }
|
public JToolTip createToolTip() { JToolTip toolTip = new JToolTip(); toolTip.setComponent(this); toolTip.setTipText(toolTipText); return toolTip; }
| 13,923
|
public JToolTip createToolTip() { JToolTip toolTip = new JToolTip(); toolTip.setComponent(this); toolTip.setTipText(toolTipText); return toolTip; }
|
public JToolTip createToolTip() { JToolTip toolTip = new JToolTip(); toolTip.setComponent(this); toolTip.setTipText(toolTipText); return toolTip; }
| 13,924
|
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
|
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
| 13,925
|
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
|
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
| 13,926
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
| 13,927
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
| 13,928
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
| 13,929
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
|
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeListener[] listeners = getVetoableChangeListeners(); PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); for (int i = 0; i < listeners.length; i++) listeners[i].vetoableChange(evt); }
| 13,930
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { return null; }
| 13,931
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.