bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
---|---|---|
public Element getBidiRootElement() { return null; }
|
public Element getBidiRootElement() { return bidiRoot; }
| 1,490 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). Position p; try { public int getOffset() { return getLength(); } }; }
| 1,491 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { p = createPosition(content.length()); } catch (BadLocationException ex) { return getLength(); } }; }
| 1,492 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { p = null; } }; }
| 1,493 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } return p; }
| 1,494 |
public Element[] getRootElements() { Element[] elements = new Element[1]; elements[0] = getDefaultRootElement(); return elements; }
|
public Element[] getRootElements() { Element[] elements = new Element[2]; elements[0] = getDefaultRootElement(); return elements; }
| 1,495 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). Position p; try { public int getOffset() { return 0; } }; }
| 1,497 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { p = createPosition(0); } catch (BadLocationException ex) { return 0; } }; }
| 1,498 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { p = null; } }; }
| 1,499 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } return p; }
| 1,500 |
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
|
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
| 1,502 |
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
|
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
| 1,503 |
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) { // Do nothing here. Subclasses may want to override this. }
|
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); protectedif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); voidif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); insertUpdate(DefaultDocumentEventif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); chng,if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); AttributeSetif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); attr)if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); {if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); //if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); Doif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); nothingif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); here.if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); Subclassesif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); mayif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); wantif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); toif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); overrideif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); this.if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); }
| 1,504 |
protected void postRemoveUpdate(DefaultDocumentEvent chng) { // Do nothing here. Subclasses may want to override this. }
|
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); protectedif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); voidif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); postRemoveUpdate(DefaultDocumentEventif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); chng)if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); {if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); //if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); Doif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); nothingif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); here.if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); Subclassesif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); mayif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); wantif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); toif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); overrideif (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); this.if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); }
| 1,505 |
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
|
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
| 1,508 |
public void replace(int offset, int length, String text, AttributeSet attributes) throws BadLocationException { // Bail out if we have a bogus replacement (Behavior observed in RI). if (length == 0 && (text == null || text.length() == 0)) return; if (documentFilter == null) { // It is important to call the methods which again do the checks // of the arguments and the DocumentFilter because subclasses may // have overridden these methods and provide crucial behavior // which would be skipped if we call the non-checking variants. // An example for this is PlainDocument where insertString can // provide a filtering of newlines. remove(offset, length); insertString(offset, text, attributes); } else documentFilter.replace(getBypass(), offset, length, text, attributes); }
|
} finally { writeUnlock(); } } finally { writeUnlock(); } public} finally { writeUnlock(); } void} finally { writeUnlock(); } replace(int} finally { writeUnlock(); } offset,} finally { writeUnlock(); } int} finally { writeUnlock(); } length,} finally { writeUnlock(); } String} finally { writeUnlock(); } text, } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } AttributeSet} finally { writeUnlock(); } attributes)} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } throws} finally { writeUnlock(); } BadLocationException} finally { writeUnlock(); } } finally { writeUnlock(); } {} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } Bail} finally { writeUnlock(); } out} finally { writeUnlock(); } if} finally { writeUnlock(); } we} finally { writeUnlock(); } have} finally { writeUnlock(); } a} finally { writeUnlock(); } bogus} finally { writeUnlock(); } replacement} finally { writeUnlock(); } (Behavior} finally { writeUnlock(); } observed} finally { writeUnlock(); } in} finally { writeUnlock(); } RI).} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } if} finally { writeUnlock(); } (length} finally { writeUnlock(); } ==} finally { writeUnlock(); } 0} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } &&} finally { writeUnlock(); } (text} finally { writeUnlock(); } ==} finally { writeUnlock(); } null} finally { writeUnlock(); } ||} finally { writeUnlock(); } text.length()} finally { writeUnlock(); } ==} finally { writeUnlock(); } 0))} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } return;} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } if} finally { writeUnlock(); } (documentFilter} finally { writeUnlock(); } ==} finally { writeUnlock(); } null)} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } {} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } It} finally { writeUnlock(); } is} finally { writeUnlock(); } important} finally { writeUnlock(); } to} finally { writeUnlock(); } call} finally { writeUnlock(); } the} finally { writeUnlock(); } methods} finally { writeUnlock(); } which} finally { writeUnlock(); } again} finally { writeUnlock(); } do} finally { writeUnlock(); } the} finally { writeUnlock(); } checks} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } of} finally { writeUnlock(); } the} finally { writeUnlock(); } arguments} finally { writeUnlock(); } and} finally { writeUnlock(); } the} finally { writeUnlock(); } DocumentFilter} finally { writeUnlock(); } because} finally { writeUnlock(); } subclasses} finally { writeUnlock(); } may} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } have} finally { writeUnlock(); } overridden} finally { writeUnlock(); } these} finally { writeUnlock(); } methods} finally { writeUnlock(); } and} finally { writeUnlock(); } provide} finally { writeUnlock(); } crucial} finally { writeUnlock(); } behavior} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } which} finally { writeUnlock(); } would} finally { writeUnlock(); } be} finally { writeUnlock(); } skipped} finally { writeUnlock(); } if} finally { writeUnlock(); } we} finally { writeUnlock(); } call} finally { writeUnlock(); } the} finally { writeUnlock(); } non-checking} finally { writeUnlock(); } variants.} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } An} finally { writeUnlock(); } example} finally { writeUnlock(); } for} finally { writeUnlock(); } this} finally { writeUnlock(); } is} finally { writeUnlock(); } PlainDocument} finally { writeUnlock(); } where} finally { writeUnlock(); } insertString} finally { writeUnlock(); } can} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } //} finally { writeUnlock(); } provide} finally { writeUnlock(); } a} finally { writeUnlock(); } filtering} finally { writeUnlock(); } of} finally { writeUnlock(); } newlines.} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } remove(offset,} finally { writeUnlock(); } length);} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } insertString(offset,} finally { writeUnlock(); } text,} finally { writeUnlock(); } attributes);} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } }} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } else} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } documentFilter.replace(getBypass(),} finally { writeUnlock(); } offset,} finally { writeUnlock(); } length,} finally { writeUnlock(); } text,} finally { writeUnlock(); } attributes);} finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } } finally { writeUnlock(); } }
| 1,510 |
public void setAsynchronousLoadPriority(int p) { // TODO: Implement this properly. }
|
Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); publicInteger val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); voidInteger val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); setAsynchronousLoadPriority(intInteger val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); p)Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); {Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); //Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); TODO:Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); ImplementInteger val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); thisInteger val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); properly.Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); }
| 1,511 |
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
|
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
| 1,512 |
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
|
public UndoableEditEvent(Object source, UndoableEdit edit) { super(source); this.edit = edit; } // UndoableEditEvent()
| 1,513 |
public PrincipalHolder(Principal initial_value) { value = initial_value; }
|
public PrincipalHolder() { value = initial_value; }
| 1,514 |
public PrincipalHolder(Principal initial_value) { value = initial_value; }
|
public PrincipalHolder(Principal initial_value) { }
| 1,515 |
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } }
|
protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart == gapStart) return; else if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } }
| 1,517 |
private byte[] assembleEM(final byte[] PS, final byte[] M) { // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. baos.reset(); baos.write(0x00); baos.write(0x02); baos.write(PS, 0, PS.length); baos.write(0x00); baos.write(M, 0, M.length); final byte[] result = baos.toByteArray(); baos.reset(); return result; }
|
privatebyte[]assembleEM(finalbyte[]PS,finalbyte[]M){//b.ConcatenatePS,themessageM,andotherpaddingtoforman//encodedmessageEMoflengthkoctetsas////EM=0x00||0x02||PS||0x00||M.baos.reset();baos.write(0x00);baos.write(0x02);baos.write(PS,0,PS.length);baos.write(0x00);baos.write(M,0,M.length);finalbyte[]result=baos.toByteArray();baos.reset();returnresult;}
| 1,518 |
public byte[] encode(final byte[] M) { // a. Generate an octet string PS of length k - mLen - 3 consisting // of pseudo-randomly generated nonzero octets. The length of PS // will be at least eight octets. final byte[] PS = new byte[k - M.length - 3]; // FIXME. This should be configurable, somehow. SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS); int i = 0; for (; i < PS.length; i++) { if (PS[i] == 0) PS[i] = 1; } // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. return assembleEM(PS, M); }
|
public byte[] encode(final byte[] M) { // a. Generate an octet string PS of length k - mLen - 3 consisting // of pseudo-randomly generated nonzero octets. The length of PS // will be at least eight octets. final byte[] PS = new byte[k - M.length - 3]; // FIXME. This should be configurable, somehow. SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS); int i = 0; for (; i < PS.length; i++) { if (PS[i] == 0) PS[i] = 1; } // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. return assembleEM(PS, M); }
| 1,519 |
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
|
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
| 1,520 |
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
|
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); else { new SecureRandom ().nextBytes(buffer); }
| 1,521 |
public BigInteger add(BigInteger val) { return add(this, val, 1); }
|
private static BigInteger add(int x, int y) { return add(this, val, 1); }
| 1,522 |
public BigInteger add(BigInteger val) { return add(this, val, 1); }
|
public BigInteger add(BigInteger val) { return valueOf((long) x + (long) y); }
| 1,523 |
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
|
private static void divide(long x, long y, BigInteger quotient, BigInteger remainder, int rounding_mode) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
| 1,524 |
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
|
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
| 1,525 |
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
|
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
| 1,526 |
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
|
public TransformerException(String msg) { this(msg, null, cause); }
| 1,527 |
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
|
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
| 1,528 |
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
| 1,529 |
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
| 1,530 |
protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
|
protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
| 1,531 |
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs); }
|
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs); }
| 1,532 |
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
|
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
| 1,533 |
public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); align = requirements[axis].alignment; } return align; }
|
public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); align = requirements[axis].alignment; } return align; }
| 1,534 |
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
|
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
| 1,535 |
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
|
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
| 1,536 |
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
|
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
| 1,537 |
public float getMinimumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].minimum; }
|
public float getMinimumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].minimum; }
| 1,538 |
public float getPreferredSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].preferred; }
|
public float getPreferredSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].preferred; }
| 1,539 |
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
|
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
| 1,540 |
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
|
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
| 1,541 |
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
|
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
| 1,542 |
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
|
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
| 1,543 |
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
|
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
| 1,544 |
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
| 1,545 |
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, requirements[axis], childReqs[axis], offsets, spans); layoutValid[axis] = true; }
| 1,546 |
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); }
| 1,547 |
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
| 1,548 |
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
|
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
| 1,549 |
public void preferenceChanged (View child, boolean width, boolean height) { if (width) layoutValid[X_AXIS] = false; if (height) layoutValid[Y_AXIS] = false; super.preferenceChanged(child, width, height); }
|
public void preferenceChanged(View child, boolean width, boolean height) { if (width) layoutValid[X_AXIS] = false; if (height) layoutValid[Y_AXIS] = false; super.preferenceChanged(child, width, height); }
| 1,551 |
public float getAlignment(int axis) { return 0.5f; }
|
public float getAlignment(int axis) { return 0.5f; }
| 1,552 |
public float getAlignment(int axis) { return 0.5f; }
|
public float getAlignment(int axis) { return 0.5f; }
| 1,553 |
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
|
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
| 1,554 |
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
|
public boolean hitClip(int x, int y, int width, int height){ return getClip().intersects(x, y, width, height);}
| 1,555 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,556 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,557 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,558 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,559 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,560 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,561 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,562 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,563 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents int x = left; for (int c = c0; c <= cn; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); int x = left; for (int c = c0; c <= cn; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,564 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,565 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,566 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; int y = top; for (int r = r0; r <= rn; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); int y = top; for (int r = r0; r <= rn; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
| 1,567 |
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; } gfx.setColor(save); } }
| 1,568 |
public int rowAtPoint(Point point) { if (point != null) { int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; } } return -1; }
|
public int rowAtPoint(Point point) { if (point != null) { int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; } } return -1; }
| 1,569 |
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
|
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
| 1,570 |
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
|
public int columnAtPoint(Point point) { if (point != null) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } } return -1; }
| 1,571 |
public int getClickCountToStart() { return 0; // TODO } // getClickCountToStart()
|
public int getClickCountToStart() { return 0; // TODO } // getClickCountToStart()
| 1,572 |
void removeSelectionInterval(int index0, int index1);
|
void removeSelectionInterval(int index0, int index1);
| 1,573 |
void addSelectionInterval(int index0, int index1);
|
void addSelectionInterval(int index0, int index1);
| 1,574 |
public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) { x += columnModel.getColumn(i).getWidth(); x += x_gap; } if (includeSpacing) return new Rectangle(x, y, width, height); else return new Rectangle(x, y, width - x_gap, height - y_gap); }
|
public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) { x += columnModel.getColumn(i).getWidth(); x += x_gap; } if (includeSpacing) return new Rectangle(x, y, width, height); else return new Rectangle(x, y, width - x_gap, height - y_gap); }
| 1,575 |
public int getMaxWidth() { return maxWidth; }
|
public int getMaxWidth() { return maxWidth; }
| 1,576 |
public int getMinWidth() { return minWidth; }
|
public int getMinWidth() { return minWidth; }
| 1,577 |
public int getWidth() { return width; }
|
public int getWidth() { return width; }
| 1,578 |
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
|
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
| 1,580 |
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
|
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
| 1,581 |
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
|
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
| 1,582 |
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
|
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
| 1,583 |
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("renderer")) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
| 1,584 |
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals("dataModel")) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
| 1,585 |
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 1,586 |
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); boolean fit = true; Dimension size; // Determine the size of the popup menu if (this.getSize().width == 0 && this.getSize().width == 0) size = this.getPreferredSize(); else size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else popup = new HeavyWeightPopup(this); } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker) .getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); SwingUtilities.convertPointFromScreen(p, layeredPane); popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 1,587 |
public void setPopupSize(int width, int height) { super.setSize(width, height); }
|
public void setPopupSize(Dimension size) { super.setSize(width, height); }
| 1,588 |
public void setPopupSize(int width, int height) { super.setSize(width, height); }
|
public void setPopupSize(int width, int height) { super.setSize(size); }
| 1,589 |
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
|
protected void installKeyboardActions() { // FIXME: implement }
| 1,591 |
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
|
Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); protected Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); void Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); installKeyboardActions() Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); throws Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); NotImplementedException Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); { Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); // Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); FIXME: Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); implement Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap()); }
| 1,592 |
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
|
protected void uninstallKeyboardActions() { // FIXME: implement. }
| 1,593 |
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
|
SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); protectedSwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); voidSwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); uninstallKeyboardActions()SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); throwsSwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); NotImplementedExceptionSwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); {SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); //SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); FIXME:SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); implement.SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); }
| 1,594 |
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
|
public AbstractAction() { this(name, null); // TODO: default icon?? }
| 1,595 |
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
|
public AbstractAction(String name) { this(""); // TODO: default icon?? }
| 1,596 |
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
|
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
| 1,597 |
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
|
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
| 1,598 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.