bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,842
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
privatevoidinsertContentTag(ElementSpectag){prepareContentInsertion();intlen=tag.getLength();intdir=tag.getDirection();if(dir==ElementSpec.JoinPreviousDirection){//ThemauveteststothisclassshowthataJoinPreviousinsertion//doesnotaddanyeditstothedocumentevent.Tomethismeans//thatnothingisdonehere.Thepreviouselementnaturallyshould//expandsothatitcoversthenewcharacters.}elseif(dir==ElementSpec.JoinNextDirection){BranchElementparagraph=(BranchElement)elementStack.peek();intcurrentIndex=paragraph.getElementIndex(offset);Elementcurrent=paragraph.getElement(currentIndex);Elementnext=paragraph.getElement(currentIndex+1);ElementnewEl1=createLeafElement(paragraph,current.getAttributes(),current.getStartOffset(),offset);ElementnewEl2=createLeafElement(paragraph,current.getAttributes(),offset,next.getEndOffset());Element[]add=newElement[]{newEl1,newEl2};Element[]remove=newElement[]{current,next};paragraph.replace(currentIndex,2,add);//Addthisactiontothedocumentevent.addEdit(paragraph,currentIndex,remove,add);}else{BranchElementparagraph=(BranchElement)elementStack.peek();intindex=paragraph.getElementIndex(offset);Elementcurrent=paragraph.getElement(index);Element[]added;Element[]removed;Element[]splitRes=split(current,offset,length);//Specialcaseforwhenoffset==startOffsetoroffset==endOffset.if(splitRes[0]==null){added=newElement[2];added[0]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[1]=splitRes[1];removed=newElement[0];index++;}elseif(current.getStartOffset()==offset){added=newElement[2];added[0]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[1]=splitRes[1];removed=newElement[]{current};}elseif(current.getEndOffset()-length==offset){added=newElement[2];added[0]=splitRes[0];added[1]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);removed=newElement[]{current};}else{added=newElement[3];added[0]=splitRes[0];added[1]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[2]=splitRes[1];removed=newElement[]{current};}paragraph.replace(index,removed.length,added);addEdit(paragraph,index,removed,added);}offset+=len;}
| 4,843
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed = new Element[] {current}; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,844
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
privatevoidinsertContentTag(ElementSpectag){prepareContentInsertion();intlen=tag.getLength();intdir=tag.getDirection();if(dir==ElementSpec.JoinPreviousDirection){//ThemauveteststothisclassshowthataJoinPreviousinsertion//doesnotaddanyeditstothedocumentevent.Tomethismeans//thatnothingisdonehere.Thepreviouselementnaturallyshould//expandsothatitcoversthenewcharacters.}elseif(dir==ElementSpec.JoinNextDirection){BranchElementparagraph=(BranchElement)elementStack.peek();intcurrentIndex=paragraph.getElementIndex(offset);Elementcurrent=paragraph.getElement(currentIndex);Elementnext=paragraph.getElement(currentIndex+1);ElementnewEl1=createLeafElement(paragraph,current.getAttributes(),current.getStartOffset(),offset);ElementnewEl2=createLeafElement(paragraph,current.getAttributes(),offset,next.getEndOffset());Element[]add=newElement[]{newEl1,newEl2};Element[]remove=newElement[]{current,next};paragraph.replace(currentIndex,2,add);//Addthisactiontothedocumentevent.addEdit(paragraph,currentIndex,remove,add);}else{BranchElementparagraph=(BranchElement)elementStack.peek();intindex=paragraph.getElementIndex(offset);Elementcurrent=paragraph.getElement(index);Element[]added;Element[]removed;Element[]splitRes=split(current,offset,length);//Specialcaseforwhenoffset==startOffsetoroffset==endOffset.if(splitRes[0]==null){added=newElement[2];added[0]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[1]=splitRes[1];removed=newElement[0];index++;}elseif(current.getStartOffset()==offset){added=newElement[2];added[0]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[1]=splitRes[1];removed=newElement[]{current};}elseif(current.getEndOffset()-length==offset){added=newElement[2];added[0]=splitRes[0];added[1]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);removed=newElement[]{current};}else{added=newElement[3];added[0]=splitRes[0];added[1]=createLeafElement(paragraph,tag.getAttributes(),offset,offset+length);added[2]=splitRes[1];removed=newElement[]{current};}paragraph.replace(index,removed.length,added);addEdit(paragraph,index,removed,added);}offset+=len;}
| 4,845
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,846
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,847
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,848
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() == endOffset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,849
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,850
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,851
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
|
private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; }
| 4,852
|
public String getName() { return "section"; }
|
public String getName() { return SectionElementName; }
| 4,853
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); paragraph.setResolveParent(getStyle(StyleContext.DEFAULT_STYLE)); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) createBranchElement(section, null); paragraph.setResolveParent(getStyle(StyleContext.DEFAULT_STYLE)); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
| 4,854
|
public Style getLogicalStyle(int position) { Element paragraph = getParagraphElement(position); AttributeSet attributes = paragraph.getAttributes(); return (Style) attributes.getResolveParent(); }
|
public Style getLogicalStyle(int position) { Element paragraph = getParagraphElement(position); AttributeSet attributes = paragraph.getAttributes(); AttributeSet a = attributes.getResolveParent(); if (a instanceof Style) return (Style) a; return null; }
| 4,855
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,856
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,857
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(paragraphAttributes, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,858
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,859
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,860
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,861
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
|
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; 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(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); }
| 4,862
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
| 4,863
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
| 4,864
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
| 4,865
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
| 4,866
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); }
|
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } }
| 4,867
|
public void setLogicalStyle(int position, Style style) { Element el = getParagraphElement(position); if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; ael.setResolveParent(style); } else throw new AssertionError("paragraph elements are expected to be" + "instances of javax.swing.text.AbstractDocument.AbstractElement"); }
|
public void setLogicalStyle(int position, Style style) { Element el = getParagraphElement(position); if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; ael.setResolveParent(style); } else throw new AssertionError("paragraph elements are expected to be" + "instances of javax.swing.text.AbstractDocument.AbstractElement"); }
| 4,868
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
| 4,869
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
| 4,870
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
| 4,871
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); try { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } catch (BadLocationException ex) { throw new AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); } }
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); try { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } catch (BadLocationException ex) { throw new AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); } }
| 4,872
|
void setParagraphAttributes(int offset, int length, AttributeSet set, boolean replace);
|
void setParagraphAttributes(int offset, int length, AttributeSet set, boolean replace);
| 4,874
|
public String getContentTypeFor(String filename) { int index = filename.lastIndexOf("."); if (index != -1) { if (index == filename.length()) return ("application/octet-stream"); else filename = filename.substring(index + 1); } String type = (String) mime_types.get(filename); if (type == null) return ("application/octet-stream"); else return (type); }
|
public String getContentTypeFor(String filename) { int index = filename.lastIndexOf("."); if (index != -1) { if (index == filename.length()) return ("application/octet-stream"); else filename = filename.substring(index + 1); } String type = (String) mime_types.get(filename); if (type == null) return ("application/octet-stream"); else return (type); }
| 4,875
|
public String getContentTypeFor(String filename) { int index = filename.lastIndexOf("."); if (index != -1) { if (index == filename.length()) return ("application/octet-stream"); else filename = filename.substring(index + 1); } String type = (String) mime_types.get(filename); if (type == null) return ("application/octet-stream"); else return (type); }
|
public String getContentTypeFor(String filename) { int index = filename.lastIndexOf("."); if (index != -1) { if (index == filename.length()) return ("application/octet-stream"); else filename = filename.substring(index + 1); } String type = (String) mime_types.get(filename); if (type == null) return ("application/octet-stream"); else return (type); }
| 4,876
|
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); // Add enter as default key for connect with this session KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0); sessions.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { doActionConnect(); } },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(interfacePanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do this.setVisible(true); }
|
sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); voidsessions.requestFocus(); jbInit()sessions.requestFocus(); throwssessions.requestFocus(); Exceptionsessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); makesessions.requestFocus(); itsessions.requestFocus(); nonsessions.requestFocus(); resizablesessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); setResizable(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); createsessions.requestFocus(); somesessions.requestFocus(); reusablesessions.requestFocus(); borderssessions.requestFocus(); andsessions.requestFocus(); layoutssessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); Bordersessions.requestFocus(); etchedBordersessions.requestFocus(); =sessions.requestFocus(); BorderFactory.createEtchedBorder();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); BorderLayoutsessions.requestFocus(); borderLayoutsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); BorderLayout();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); getsessions.requestFocus(); ansessions.requestFocus(); instancesessions.requestFocus(); ofsessions.requestFocus(); oursessions.requestFocus(); tablesessions.requestFocus(); modelsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ctmsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); ConfigureTableModel();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); createsessions.requestFocus(); asessions.requestFocus(); tablesessions.requestFocus(); usingsessions.requestFocus(); oursessions.requestFocus(); customsessions.requestFocus(); tablesessions.requestFocus(); modelsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionssessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); JTable(ctm);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); Addsessions.requestFocus(); entersessions.requestFocus(); assessions.requestFocus(); defaultsessions.requestFocus(); keysessions.requestFocus(); forsessions.requestFocus(); connectsessions.requestFocus(); withsessions.requestFocus(); thissessions.requestFocus(); sessionsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); KeyStrokesessions.requestFocus(); entersessions.requestFocus(); =sessions.requestFocus(); KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.registerKeyboardAction(newsessions.requestFocus(); ActionListener()sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); publicsessions.requestFocus(); voidsessions.requestFocus(); actionPerformed(ActionEventsessions.requestFocus(); e)sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); doActionConnect();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.setPreferredScrollableViewportSize(newsessions.requestFocus(); Dimension(500,200));sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.setShowGrid(false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //Createsessions.requestFocus(); thesessions.requestFocus(); scrollsessions.requestFocus(); panesessions.requestFocus(); andsessions.requestFocus(); addsessions.requestFocus(); thesessions.requestFocus(); tablesessions.requestFocus(); tosessions.requestFocus(); it.sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); scrollPanesessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); JScrollPane(sessions);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //Setupsessions.requestFocus(); oursessions.requestFocus(); selectionsessions.requestFocus(); modelsessions.requestFocus(); listenersessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); rowSMsessions.requestFocus(); =sessions.requestFocus(); sessions.getSelectionModel();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); rowSM.addListSelectionListener(newsessions.requestFocus(); ListSelectionListener()sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); publicsessions.requestFocus(); voidsessions.requestFocus(); valueChanged(ListSelectionEventsessions.requestFocus(); e)sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //Ignoresessions.requestFocus(); extrasessions.requestFocus(); messages.sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (e.getValueIsAdjusting())sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); return;sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ListSelectionModelsessions.requestFocus(); lsmsessions.requestFocus(); =sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); (ListSelectionModel)e.getSource();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (lsm.isSelectionEmpty())sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //nosessions.requestFocus(); rowssessions.requestFocus(); aresessions.requestFocus(); selectedsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); editButton.setEnabled(false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); removeButton.setEnabled(false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); connectButton.setEnabled(false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); elsesessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intsessions.requestFocus(); selectedRowsessions.requestFocus(); =sessions.requestFocus(); lsm.getMinSelectionIndex();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //selectedRowsessions.requestFocus(); issessions.requestFocus(); selectedsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); editButton.setEnabled(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); removeButton.setEnabled(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); connectButton.setEnabled(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); });sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); setupsessions.requestFocus(); thesessions.requestFocus(); framesessions.requestFocus(); interfacesessions.requestFocus(); panelsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); interfacePanelsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); JPanel();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); TitledBordersessions.requestFocus(); tbsessions.requestFocus(); =sessions.requestFocus(); BorderFactory.createTitledBorder(sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); LangTool.getString("conf.labelPresentation"));sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); interfacePanel.setBorder(tb);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ButtonGroupsessions.requestFocus(); intGroupsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); ButtonGroup();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intTABSsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); JRadioButton(LangTool.getString("conf.labelTABS"));sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intTABS.setSelected(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intTABS.addItemListener(newsessions.requestFocus(); java.awt.event.ItemListener()sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); publicsessions.requestFocus(); voidsessions.requestFocus(); itemStateChanged(ItemEventsessions.requestFocus(); e)sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intTABS_itemStateChanged(e);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); });sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intMDIsessions.requestFocus(); =sessions.requestFocus(); newsessions.requestFocus(); JRadioButton(LangTool.getString("conf.labelMDI"));sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); addsessions.requestFocus(); thesessions.requestFocus(); interfacesessions.requestFocus(); optionssessions.requestFocus(); tosessions.requestFocus(); thesessions.requestFocus(); groupsessions.requestFocus(); controlsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intGroup.add(intTABS);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intGroup.add(intMDI);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (props.containsKey("emul.interface"))sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (props.getProperty("emul.interface").equalsIgnoreCase("MDI"))sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); intMDI.setSelected(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); interfacePanel.add(intTABS);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); interfacePanel.add(intMDI);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //Setupsessions.requestFocus(); panelssessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); configOptions.setLayout(borderLayout);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionPanel.setLayout(borderLayout);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); configOptions.add(sessionPanel,sessions.requestFocus(); BorderLayout.CENTER);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionOpts.add(scrollPane,sessions.requestFocus(); BorderLayout.CENTER);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionPanel.add(sessionOpts,sessions.requestFocus(); BorderLayout.NORTH);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionPanel.add(sessionOptPanel,sessions.requestFocus(); BorderLayout.SOUTH);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder());sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); addsessions.requestFocus(); thesessions.requestFocus(); optionsessions.requestFocus(); buttonssessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); removeButtonsessions.requestFocus(); =sessions.requestFocus(); addOptButton(LangTool.getString("ss.optDelete"),sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); "REMOVE",sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionOptPanel,sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); editButtonsessions.requestFocus(); =sessions.requestFocus(); addOptButton(LangTool.getString("ss.optEdit"),sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); "EDIT",sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessionOptPanel,sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); connectButtonsessions.requestFocus(); =sessions.requestFocus(); addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); addsessions.requestFocus(); thesessions.requestFocus(); panelssessions.requestFocus(); tosessions.requestFocus(); oursessions.requestFocus(); dialogsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); getContentPane().add(sessionPanel,BorderLayout.CENTER);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); getContentPane().add(options,sessions.requestFocus(); BorderLayout.SOUTH);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); getContentPane().add(interfacePanel,BorderLayout.NORTH);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); packsessions.requestFocus(); itsessions.requestFocus(); andsessions.requestFocus(); centersessions.requestFocus(); itsessions.requestFocus(); onsessions.requestFocus(); thesessions.requestFocus(); screensessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); pack();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); Dimensionsessions.requestFocus(); screenSizesessions.requestFocus(); =sessions.requestFocus(); Toolkit.getDefaultToolkit().getScreenSize();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); Dimensionsessions.requestFocus(); frameSizesessions.requestFocus(); =sessions.requestFocus(); getSize();sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (frameSize.heightsessions.requestFocus(); >sessions.requestFocus(); screenSize.height)sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); frameSize.heightsessions.requestFocus(); =sessions.requestFocus(); screenSize.height;sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (frameSize.widthsessions.requestFocus(); >sessions.requestFocus(); screenSize.width)sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); frameSize.widthsessions.requestFocus(); =sessions.requestFocus(); screenSize.width;sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); setLocation((screenSize.widthsessions.requestFocus(); -sessions.requestFocus(); frameSize.width)sessions.requestFocus(); /sessions.requestFocus(); 2,sessions.requestFocus(); (screenSize.heightsessions.requestFocus(); -sessions.requestFocus(); frameSize.height)sessions.requestFocus(); /sessions.requestFocus(); 2);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); setsessions.requestFocus(); defaultsessions.requestFocus(); selectionsessions.requestFocus(); valuesessions.requestFocus(); assessions.requestFocus(); thesessions.requestFocus(); firstsessions.requestFocus(); rowsessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); ifsessions.requestFocus(); (sessions.getRowCount()sessions.requestFocus(); >sessions.requestFocus(); 0)sessions.requestFocus(); {sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.getSelectionModel().setSelectionInterval(0,0);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); //sessions.requestFocus(); nowsessions.requestFocus(); showsessions.requestFocus(); thesessions.requestFocus(); worldsessions.requestFocus(); whatsessions.requestFocus(); wesessions.requestFocus(); andsessions.requestFocus(); theysessions.requestFocus(); cansessions.requestFocus(); dosessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); this.setVisible(true);sessions.requestFocus(); sessions.requestFocus(); sessions.requestFocus(); }
| 4,877
|
private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProperty("font",(String)fontsList.getSelectedItem()); } String newSelection = (String)colorList.getSelectedItem(); if (colorSchema != null) { if (!getColorProperty("colorBg").equals(colorSchema.getColorBg())) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), colorSchema.getColorBg()); setProperty("colorBg",Integer.toString(colorSchema.getColorBg().getRGB())); } if (!getColorProperty("colorBlue").equals(colorSchema.getColorBlue())) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), colorSchema.getColorBlue()); setProperty("colorBlue",Integer.toString(colorSchema.getColorBlue().getRGB())); } if (!getColorProperty("colorRed").equals(colorSchema.getColorRed())) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), colorSchema.getColorRed()); setProperty("colorRed",Integer.toString(colorSchema.getColorRed().getRGB())); } if (!getColorProperty("colorPink").equals(colorSchema.getColorPink())) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), colorSchema.getColorPink()); setProperty("colorPink",Integer.toString(colorSchema.getColorPink().getRGB())); } if (!getColorProperty("colorGreen").equals(colorSchema.getColorGreen())) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), colorSchema.getColorGreen()); setProperty("colorGreen",Integer.toString(colorSchema.getColorGreen().getRGB())); } if (!getColorProperty("colorTurq").equals(colorSchema.getColorTurq())) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), colorSchema.getColorTurq()); setProperty("colorTurq",Integer.toString(colorSchema.getColorTurq().getRGB())); } if (!getColorProperty("colorYellow").equals(colorSchema.getColorYellow())) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), colorSchema.getColorYellow()); setProperty("colorYellow",Integer.toString(colorSchema.getColorYellow().getRGB())); } if (!getColorProperty("colorWhite").equals(colorSchema.getColorWhite())) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), colorSchema.getColorWhite()); setProperty("colorWhite",Integer.toString(colorSchema.getColorWhite().getRGB())); } if (!getColorProperty("colorGUIField").equals(colorSchema.getColorGuiField())) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), colorSchema.getColorGuiField()); setProperty("colorGUIField",Integer.toString(colorSchema.getColorGuiField().getRGB())); } if (!getColorProperty("colorCursor").equals(colorSchema.getColorCursor())) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), colorSchema.getColorCursor()); setProperty("colorCursor",Integer.toString(colorSchema.getColorCursor().getRGB())); } if (!getColorProperty("colorSep").equals(colorSchema.getColorSeparator())) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), colorSchema.getColorSeparator()); setProperty("colorSep", Integer.toString(colorSchema.getColorSeparator().getRGB())); } if (!getColorProperty("colorHexAttr").equals(colorSchema.getColorHexAttr())) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), colorSchema.getColorHexAttr()); setProperty("colorHexAttr", Integer.toString(colorSchema.getColorHexAttr().getRGB())); } updateColorSelection(newSelection); } else { Color nc = jcc.getColor(); if (newSelection.equals(LangTool.getString("sa.bg"))) { if (!getColorProperty("colorBg").equals(nc)) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), nc); setProperty("colorBg",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.blue"))) { if (!getColorProperty("colorBlue").equals(nc)) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), nc); setProperty("colorBlue",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.red"))) { if (!getColorProperty("colorRed").equals(nc)) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), nc); setProperty("colorRed",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.pink"))) { if (!getColorProperty("colorPink").equals(nc)) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), nc); setProperty("colorPink",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.green"))) { if (!getColorProperty("colorGreen").equals(nc)) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), nc); setProperty("colorGreen",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.turq"))) { if (!getColorProperty("colorTurq").equals(nc)) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), nc); setProperty("colorTurq",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.yellow"))) { if (!getColorProperty("colorYellow").equals(nc)) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), nc); setProperty("colorYellow",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.white"))) { if (!getColorProperty("colorWhite").equals(nc)) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), nc); setProperty("colorWhite",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.guiField"))) { if (!getColorProperty("colorGUIField").equals(nc)) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), nc); setProperty("colorGUIField",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { if (!getColorProperty("colorSep").equals(nc)) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), nc); setProperty("colorSep",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { if (!getColorProperty("colorHexAttr").equals(nc)) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), nc); setProperty("colorHexAttr",Integer.toString(nc.getRGB())); } } } if (csLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Line"); setProperty("colSeparator","Line"); } else if (csShortLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "ShortLine"); setProperty("colSeparator","ShortLine"); } else { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Dot"); setProperty("colSeparator","Dot"); } if (cFull.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Half"); setProperty("cursorSize","Half"); } if (cLine.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Line"); setProperty("cursorSize","Line"); } if (chNone.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "None"); setProperty("crossHair","None"); } if (chHorz.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Horz"); setProperty("crossHair","Horz"); } if (chVert.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Vert"); setProperty("crossHair","Vert"); } if (chCross.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Both"); setProperty("crossHair","Both"); } if (rulerFixed.isSelected()) { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "Yes"); setProperty("rulerFixed","Yes"); } else { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "No"); setProperty("rulerFixed","No"); } if (saNormal.isSelected()) { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Normal"); setProperty("showAttr","Normal"); } else { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Hex"); setProperty("showAttr","Hex"); } if (dceCheck.isSelected()) { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "Yes"); setProperty("doubleClick","Yes"); } else { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "No"); setProperty("doubleClick","No"); } if (guiCheck.isSelected()) { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "Yes"); setProperty("guiInterface","Yes"); } else { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "No"); setProperty("guiInterface","No"); } if (guiShowUnderline.isSelected()) { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "Yes"); setProperty("guiShowUnderline","Yes"); } else { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "No"); setProperty("guiShowUnderline","No"); } if (hsCheck.isSelected()) { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "Yes"); setProperty("hotspots","Yes"); } else { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "No"); setProperty("hotspots","No"); } if (kpCheck.isSelected()) { changes.firePropertyChange("keypad", getStringProperty("keypad"), "Yes"); setProperty("keypad","Yes"); } else { changes.firePropertyChange("keypad", getStringProperty("keypad"), "No"); setProperty("keypad","No"); } changes.firePropertyChange("hsMore", getStringProperty("hsMore"), hsMore.getText()); setProperty("hsMore",hsMore.getText()); changes.firePropertyChange("connectMacro", getStringProperty("connectMacro"), connectMacro.getText()); setProperty("connectMacro",connectMacro.getText()); changes.firePropertyChange("hsBottom", getStringProperty("hsBottom"), hsBottom.getText()); setProperty("hsBottom",hsBottom.getText()); changes.firePropertyChange("fontScaleHeight", getStringProperty("fontScaleHeight"), verticalScale.getText()); setProperty("fontScaleHeight",verticalScale.getText()); changes.firePropertyChange("fontScaleWidth", getStringProperty("fontScaleWidth"), horizontalScale.getText()); setProperty("fontScaleWidth",horizontalScale.getText()); changes.firePropertyChange("fontPointSize", getStringProperty("fontPointSize"), pointSize.getText()); setProperty("fontPointSize",pointSize.getText()); changes.firePropertyChange("cursorBottOffset", getStringProperty("cursorBottOffset"), cursorBottOffset.getText()); setProperty("cursorBottOffset",cursorBottOffset.getText()); setProperty("saveme","yes"); }
|
private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProperty("font",(String)fontsList.getSelectedItem()); } String newSelection = (String)colorList.getSelectedItem(); if (colorSchema != null) { if (!getColorProperty("colorBg").equals(colorSchema.getColorBg())) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), colorSchema.getColorBg()); setProperty("colorBg",Integer.toString(colorSchema.getColorBg().getRGB())); } if (!getColorProperty("colorBlue").equals(colorSchema.getColorBlue())) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), colorSchema.getColorBlue()); setProperty("colorBlue",Integer.toString(colorSchema.getColorBlue().getRGB())); } if (!getColorProperty("colorRed").equals(colorSchema.getColorRed())) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), colorSchema.getColorRed()); setProperty("colorRed",Integer.toString(colorSchema.getColorRed().getRGB())); } if (!getColorProperty("colorPink").equals(colorSchema.getColorPink())) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), colorSchema.getColorPink()); setProperty("colorPink",Integer.toString(colorSchema.getColorPink().getRGB())); } if (!getColorProperty("colorGreen").equals(colorSchema.getColorGreen())) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), colorSchema.getColorGreen()); setProperty("colorGreen",Integer.toString(colorSchema.getColorGreen().getRGB())); } if (!getColorProperty("colorTurq").equals(colorSchema.getColorTurq())) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), colorSchema.getColorTurq()); setProperty("colorTurq",Integer.toString(colorSchema.getColorTurq().getRGB())); } if (!getColorProperty("colorYellow").equals(colorSchema.getColorYellow())) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), colorSchema.getColorYellow()); setProperty("colorYellow",Integer.toString(colorSchema.getColorYellow().getRGB())); } if (!getColorProperty("colorWhite").equals(colorSchema.getColorWhite())) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), colorSchema.getColorWhite()); setProperty("colorWhite",Integer.toString(colorSchema.getColorWhite().getRGB())); } if (!getColorProperty("colorGUIField").equals(colorSchema.getColorGuiField())) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), colorSchema.getColorGuiField()); setProperty("colorGUIField",Integer.toString(colorSchema.getColorGuiField().getRGB())); } if (!getColorProperty("colorCursor").equals(colorSchema.getColorCursor())) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), colorSchema.getColorCursor()); setProperty("colorCursor",Integer.toString(colorSchema.getColorCursor().getRGB())); } if (!getColorProperty("colorSep").equals(colorSchema.getColorSeparator())) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), colorSchema.getColorSeparator()); setProperty("colorSep", Integer.toString(colorSchema.getColorSeparator().getRGB())); } if (!getColorProperty("colorHexAttr").equals(colorSchema.getColorHexAttr())) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), colorSchema.getColorHexAttr()); setProperty("colorHexAttr", Integer.toString(colorSchema.getColorHexAttr().getRGB())); } } else { Color nc = jcc.getColor(); if (newSelection.equals(LangTool.getString("sa.bg"))) { if (!getColorProperty("colorBg").equals(nc)) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), nc); setProperty("colorBg",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.blue"))) { if (!getColorProperty("colorBlue").equals(nc)) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), nc); setProperty("colorBlue",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.red"))) { if (!getColorProperty("colorRed").equals(nc)) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), nc); setProperty("colorRed",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.pink"))) { if (!getColorProperty("colorPink").equals(nc)) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), nc); setProperty("colorPink",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.green"))) { if (!getColorProperty("colorGreen").equals(nc)) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), nc); setProperty("colorGreen",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.turq"))) { if (!getColorProperty("colorTurq").equals(nc)) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), nc); setProperty("colorTurq",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.yellow"))) { if (!getColorProperty("colorYellow").equals(nc)) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), nc); setProperty("colorYellow",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.white"))) { if (!getColorProperty("colorWhite").equals(nc)) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), nc); setProperty("colorWhite",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.guiField"))) { if (!getColorProperty("colorGUIField").equals(nc)) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), nc); setProperty("colorGUIField",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { if (!getColorProperty("colorSep").equals(nc)) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), nc); setProperty("colorSep",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { if (!getColorProperty("colorHexAttr").equals(nc)) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), nc); setProperty("colorHexAttr",Integer.toString(nc.getRGB())); } } } if (csLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Line"); setProperty("colSeparator","Line"); } else if (csShortLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "ShortLine"); setProperty("colSeparator","ShortLine"); } else { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Dot"); setProperty("colSeparator","Dot"); } if (cFull.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Half"); setProperty("cursorSize","Half"); } if (cLine.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Line"); setProperty("cursorSize","Line"); } if (chNone.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "None"); setProperty("crossHair","None"); } if (chHorz.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Horz"); setProperty("crossHair","Horz"); } if (chVert.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Vert"); setProperty("crossHair","Vert"); } if (chCross.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Both"); setProperty("crossHair","Both"); } if (rulerFixed.isSelected()) { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "Yes"); setProperty("rulerFixed","Yes"); } else { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "No"); setProperty("rulerFixed","No"); } if (saNormal.isSelected()) { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Normal"); setProperty("showAttr","Normal"); } else { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Hex"); setProperty("showAttr","Hex"); } if (dceCheck.isSelected()) { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "Yes"); setProperty("doubleClick","Yes"); } else { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "No"); setProperty("doubleClick","No"); } if (guiCheck.isSelected()) { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "Yes"); setProperty("guiInterface","Yes"); } else { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "No"); setProperty("guiInterface","No"); } if (guiShowUnderline.isSelected()) { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "Yes"); setProperty("guiShowUnderline","Yes"); } else { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "No"); setProperty("guiShowUnderline","No"); } if (hsCheck.isSelected()) { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "Yes"); setProperty("hotspots","Yes"); } else { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "No"); setProperty("hotspots","No"); } if (kpCheck.isSelected()) { changes.firePropertyChange("keypad", getStringProperty("keypad"), "Yes"); setProperty("keypad","Yes"); } else { changes.firePropertyChange("keypad", getStringProperty("keypad"), "No"); setProperty("keypad","No"); } changes.firePropertyChange("hsMore", getStringProperty("hsMore"), hsMore.getText()); setProperty("hsMore",hsMore.getText()); changes.firePropertyChange("connectMacro", getStringProperty("connectMacro"), connectMacro.getText()); setProperty("connectMacro",connectMacro.getText()); changes.firePropertyChange("hsBottom", getStringProperty("hsBottom"), hsBottom.getText()); setProperty("hsBottom",hsBottom.getText()); changes.firePropertyChange("fontScaleHeight", getStringProperty("fontScaleHeight"), verticalScale.getText()); setProperty("fontScaleHeight",verticalScale.getText()); changes.firePropertyChange("fontScaleWidth", getStringProperty("fontScaleWidth"), horizontalScale.getText()); setProperty("fontScaleWidth",horizontalScale.getText()); changes.firePropertyChange("fontPointSize", getStringProperty("fontPointSize"), pointSize.getText()); setProperty("fontPointSize",pointSize.getText()); changes.firePropertyChange("cursorBottOffset", getStringProperty("cursorBottOffset"), cursorBottOffset.getText()); setProperty("cursorBottOffset",cursorBottOffset.getText()); setProperty("saveme","yes"); }
| 4,878
|
private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); updateColorSelection(newSelection); } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); // define double click as enter JPanel bottOffPanel = new JPanel(); bottOffPanel.setBorder(BorderFactory.createTitledBorder( LangTool.getString("sa.curBottOffset"))); cursorBottOffset = new JTextField(5); try { int i = Integer.parseInt(getStringProperty("cursorBottOffset","0")); cursorBottOffset.setText(Integer.toString(i)); } catch (NumberFormatException ne) { cursorBottOffset.setText("0"); } bottOffPanel.add(cursorBottOffset); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); cuPanel.add(bottOffPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); }
|
private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); // define double click as enter JPanel bottOffPanel = new JPanel(); bottOffPanel.setBorder(BorderFactory.createTitledBorder( LangTool.getString("sa.curBottOffset"))); cursorBottOffset = new JTextField(5); try { int i = Integer.parseInt(getStringProperty("cursorBottOffset","0")); cursorBottOffset.setText(Integer.toString(i)); } catch (NumberFormatException ne) { cursorBottOffset.setText("0"); } bottOffPanel.add(cursorBottOffset); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); cuPanel.add(bottOffPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); }
| 4,881
|
public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); updateColorSelection(newSelection); }
|
public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } }
| 4,883
|
public static NotFoundReason extract(Any a) { try { return ((NotFoundReasonHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
|
public static NotFoundReason extract(Any a) { try { return ((NotFoundReasonHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
| 4,885
|
US_ASCII () { super ("US-ASCII", new String[]{"ISO646-US"}); }
|
US_ASCII () { /* Canonical charset name chosen according to: * http: */ super ("US-ASCII", new String[] { /* These names are provided by * http: */ "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "ASCII", "ISO646-US", "ASCII", "us", "IBM367", "cp367", "csASCII", /* These names are provided by * http: */ "ANSI_X3.4-1968", "iso_646.irv:1983", "ascii7", "646", "windows-20127" }); }
| 4,886
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
| 4,888
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } } else { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
| 4,889
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } }
| 4,890
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { JInternalFrame f = (JInternalFrame) c; if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); // fill the border background g.fillRect(x, y, w, 5); g.fillRect(x, y, 5, h); g.fillRect(x + w - 5, y, 5, h); g.fillRect(x, y + h - 5, w, 5); // draw a dot in each corner g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); // draw the lines g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 14, y + 2, x + w - 15, y + 2); g.drawLine(x + 14, y + h - 3, x + w - 15, y + h - 3); g.drawLine(x + 2, y + 14, x + 2, y + h - 15); g.drawLine(x + w - 3, y + 14, x + w - 3, y + h - 15); // draw the line highlights g.setColor(MetalLookAndFeel.getControl()); g.drawLine(x + 15, y + 3, x + w - 14, y + 3); g.drawLine(x + 15, y + h - 2, x + w - 14, y + h - 2); g.drawLine(x + 3, y + 15, x + 3, y + h - 14); g.drawLine(x + w - 2, y + 15, x + w - 2, y + h - 14); }
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { JInternalFrame f = (JInternalFrame) c; if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); // fill the border background g.fillRect(x, y, w, 5); g.fillRect(x, y, 5, h); g.fillRect(x + w - 5, y, 5, h); g.fillRect(x, y + h - 5, w, 5); // draw a dot in each corner if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); // draw the lines g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 14, y + 2, x + w - 15, y + 2); g.drawLine(x + 14, y + h - 3, x + w - 15, y + h - 3); g.drawLine(x + 2, y + 14, x + 2, y + h - 15); g.drawLine(x + w - 3, y + 14, x + w - 3, y + h - 15); // draw the line highlights if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x + 15, y + 3, x + w - 14, y + 3); g.drawLine(x + 15, y + h - 2, x + w - 14, y + h - 2); g.drawLine(x + 3, y + 15, x + 3, y + h - 14); g.drawLine(x + w - 2, y + 15, x + w - 2, y + h - 14); }
| 4,891
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (c.isEnabled()) super.paintBorder(c, g, x, y, w, h); else { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawRect(x, y, w - 1, h - 1); g.setColor(savedColor); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (c.isEnabled()) super.paintBorder(c, g, x, y, w, h); else { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawRect(x, y, w - 1, h - 1); g.setColor(savedColor); } }
| 4,892
|
protected void addImpl(Component comp, Object constraints, int index) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components disallowed."); super.addImpl(comp, constraints, index); }
|
protected void addImpl(Component comp, Object constraints, int index) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components disallowed."); super.addImpl(comp, constraints, index); }
| 4,893
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); }
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); }
| 4,895
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); }
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); }
| 4,896
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); }
|
initStageDone = true; initStageDone = true; protected initStageDone = true; void initStageDone = true; dialogInit() initStageDone = true; initStageDone = true; { initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; // initStageDone = true; FIXME: initStageDone = true; Do initStageDone = true; a initStageDone = true; check initStageDone = true; on initStageDone = true; GraphicsEnvironment.isHeadless() initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; setRootPaneCheckingEnabled(false); initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; setLocale(JComponent.getDefaultLocale()); initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; getRootPane(); initStageDone = true; // initStageDone = true; will initStageDone = true; do initStageDone = true; set/create initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; setRootPaneCheckingEnabled(true); initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; invalidate(); initStageDone = true; initStageDone = true; initStageDone = true; initStageDone = true; }
| 4,897
|
public void remove(Component comp) { // The path changes if the component == root. if (comp == rootPane) super.remove(rootPane); else getContentPane().remove(comp); }
|
public void remove(Component comp) { // The path changes if the component == root. if (comp == rootPane) super.remove(rootPane); else getContentPane().remove(comp); }
| 4,898
|
public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementation does close_action = DO_NOTHING_ON_CLOSE; }
|
public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementation does close_action = DO_NOTHING_ON_CLOSE; }
| 4,899
|
public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementation does close_action = DO_NOTHING_ON_CLOSE; }
|
public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementation does close_action = DO_NOTHING_ON_CLOSE; }
| 4,900
|
public void setLayout(LayoutManager manager) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - cannot set layout."); super.setLayout(manager); }
|
public void setLayout(LayoutManager manager) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
| 4,901
|
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());}
|
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());}
| 4,902
|
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());}
|
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());}
| 4,903
|
public AccessibleContext getAccessibleContext() { // FIXME //return null; throw new Error ("Not implemented"); }
|
public AccessibleContext getAccessibleContext() { // FIXME //return null; /* Create the context if this is the first request */ if (accessibleContext == null) accessibleContext = new AccessibleAWTWindow(); return accessibleContext; }
| 4,905
|
void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized && isShowing ()) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 4,906
|
void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
|
void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved && isShowing ()) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 4,907
|
private void getFocusForMe() { this.requestFocus(); }
|
private void getFocusForMe() { this.grabFocus(); }
| 4,908
|
public Throwable() { this("", null); }
|
public Throwable() { this("", null); }
| 4,909
|
public static void configure(String configFileName) { Properties props = new Properties(); //the property hashtable try { FileInputStream istream = new FileInputStream(configFileName); props.load(istream); istream.close(); } catch (IOException e) { System.err.println("Could not read configuration file [" + configFileName+ "]."); System.err.println("Ignoring configuration file [" + configFileName+"]."); System.err.println("using default config"); defaultConfig(); return; } // If we reach here, then the config file is alright. System.out.println("Reading configuration."); configure(props); }
|
public static void configure(String configFileName) { Properties props = new Properties(); //the property hashtable try { FileInputStream istream = new FileInputStream(configFileName); props.load(istream); istream.close(); } catch (IOException e) { System.err.println("Could not read configuration file [" + configFileName+ "]."); System.err.println("Ignoring configuration file [" + configFileName+"]."); System.err.println("using default config"); defaultConfig(); return; } // If we reach here, then the config file is alright. configure(props); }
| 4,910
|
public Edit(Element e, int i, Element[] removed, Element[] added) { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); }
|
Edit(Element el, int i) { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); }
| 4,911
|
public Edit(Element e, int i, Element[] removed, Element[] added) { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); }
|
public Edit(Element e, int i, Element[] removed, Element[] added) { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); }
| 4,912
|
public ElementBuffer(Element root) { this.root = root; elementStack = new Stack(); }
|
public ElementBuffer(Element root) { this.root = root; }
| 4,913
|
public void change(int offset, int length, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.length = length; documentEvent = ev; changeUpdate(); }
|
public void change(int offset, int length, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.length = length; documentEvent = ev; changeUpdate(); }
| 4,914
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,916
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,917
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,918
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,919
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,920
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
|
protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0, el.getElementIndex(offset)); BranchElement par = (BranchElement) el.getParentElement(); int index = par.getElementIndex(offset); Edit edit = getEditForParagraphAndIndex(par, index); if (res[1] != null) { Element[] removed; Element[] added; if (res[0] == null) { removed = new Element[0]; added = new Element[] { res[1] }; index++; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } int endOffset = offset + length; el = getCharacterElement(endOffset); res = split(el, endOffset, 0, el.getElementIndex(endOffset)); par = (BranchElement) el.getParentElement(); if (res[0] != null) { Element[] removed; Element[] added; if (res[1] == null) { removed = new Element[0]; added = new Element[] { res[1] }; } else { removed = new Element[] { el }; added = new Element[] { res[0], res[1] }; } edit.addRemovedElements(removed); edit.addAddedElements(added); } }
| 4,921
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
| 4,922
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newChild = createLeafElement(edit.e, child.getAttributes(), child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
| 4,923
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
|
private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = child.getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } }
| 4,924
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.endOffset = offset + length; this.length = length; documentEvent = ev; edits.removeAllElements(); elementStack.removeAllElements(); lastFractured = null; fracNotCreated = false; insertUpdate(data); // This for loop applies all the changes that were made and updates the // DocumentEvent. int size = edits.size(); for (int i = 0; i < size; i++) { Edit curr = (Edit) edits.get(i); BranchElement e = (BranchElement) curr.e; Element[] removed = curr.getRemovedElements(); Element[] added = curr.getAddedElements(); // FIXME: We probably shouldn't create the empty Element[] in the // first place. if (removed.length > 0 || added.length > 0) { if (curr.index + removed.length <= e.getElementCount()) { e.replace(curr.index, removed.length, added); ElementEdit ee = new ElementEdit(e, curr.index, removed, added); ev.addEdit(ee); } else { System.err.println("WARNING: Tried to replace elements "); System.err.print("beyond boundaries: elementCount: "); System.err.println(e.getElementCount()); System.err.print("index: " + curr.index); System.err.println(", removed.length: " + removed.length); } } } }
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.endOffset = offset + length; this.length = length; documentEvent = ev; edits.removeAllElements(); elementStack.removeAllElements(); lastFractured = null; fracNotCreated = false; insertUpdate(data); // This for loop applies all the changes that were made and updates the // DocumentEvent. int size = edits.size(); for (int i = 0; i < size; i++) { Edit curr = (Edit) edits.get(i); BranchElement e = (BranchElement) curr.e; Element[] removed = curr.getRemovedElements(); Element[] added = curr.getAddedElements(); // FIXME: We probably shouldn't create the empty Element[] in the // first place. if (removed.length > 0 || added.length > 0) { if (curr.index + removed.length <= e.getElementCount()) { e.replace(curr.index, removed.length, added); ElementEdit ee = new ElementEdit(e, curr.index, removed, added); ev.addEdit(ee); } else { System.err.println("WARNING: Tried to replace elements "); System.err.print("beyond boundaries: elementCount: "); System.err.println(e.getElementCount()); System.err.print("index: " + curr.index); System.err.println(", removed.length: " + removed.length); } } } }
| 4,926
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.endOffset = offset + length; this.length = length; documentEvent = ev; edits.removeAllElements(); elementStack.removeAllElements(); lastFractured = null; fracNotCreated = false; insertUpdate(data); // This for loop applies all the changes that were made and updates the // DocumentEvent. int size = edits.size(); for (int i = 0; i < size; i++) { Edit curr = (Edit) edits.get(i); BranchElement e = (BranchElement) curr.e; Element[] removed = curr.getRemovedElements(); Element[] added = curr.getAddedElements(); // FIXME: We probably shouldn't create the empty Element[] in the // first place. if (removed.length > 0 || added.length > 0) { if (curr.index + removed.length <= e.getElementCount()) { e.replace(curr.index, removed.length, added); ElementEdit ee = new ElementEdit(e, curr.index, removed, added); ev.addEdit(ee); } else { System.err.println("WARNING: Tried to replace elements "); System.err.print("beyond boundaries: elementCount: "); System.err.println(e.getElementCount()); System.err.print("index: " + curr.index); System.err.println(", removed.length: " + removed.length); } } } }
|
public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.pos = offset; this.endOffset = offset + length; this.length = length; documentEvent = ev; edits.removeAllElements(); elementStack.removeAllElements(); lastFractured = null; fracNotCreated = false; insertUpdate(data); // This for loop applies all the changes that were made and updates the // DocumentEvent. int size = edits.size(); for (int i = 0; i < size; i++) { Edit curr = (Edit) edits.get(i); BranchElement e = (BranchElement) curr.e; Element[] removed = curr.getRemovedElements(); Element[] added = curr.getAddedElements(); // FIXME: We probably shouldn't create the empty Element[] in the // first place. if (removed.length > 0 || added.length > 0) { if (curr.index + removed.length <= e.getElementCount()) { e.replace(curr.index, removed.length, added); ElementEdit ee = new ElementEdit(e, curr.index, removed, added); ev.addEdit(ee); else { System.err.println("WARNING: Tried to replace elements "); System.err.print("beyond boundaries: elementCount: "); System.err.println(e.getElementCount()); System.err.print("index: " + curr.index); System.err.println(", removed.length: " + removed.length); }
| 4,927
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag, Edit edit) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,928
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,929
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,930
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,931
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,932
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,933
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,934
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,935
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 4,936
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); } else { Element leaf = createLeafElement(edit.e, tag.getAttributes(), pos, pos + len); edit.added.add(leaf); } pos += len; }
| 4,937
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,939
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,940
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != firstEndOffset && ! onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,941
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(edit.e, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(edit.e, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(edit.e, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,942
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,943
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,944
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(edit.e, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(edit.e, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(edit.e, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,945
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,946
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,947
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,948
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,949
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,950
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(edit.e, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,951
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
|
private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(pos); Element current = paragraph.getElement(index); int newEndOffset = pos + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (pos != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), pos, newEndOffset); pos = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != pos) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), pos); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), pos, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } }
| 4,952
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.