bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public boolean isAccessibleChildSelected(int i) throws NotImplementedException { return false; }
|
public boolean isAccessibleChildSelected(int i) { return false; }
| 4,153
|
public boolean isAccessibleChildSelected(int i) throws NotImplementedException { return false; }
|
public boolean isAccessibleChildSelected(int i) throws NotImplementedException { return i == getSelectedIndex(); }
| 4,154
|
public void removeAccessibleSelection(int i) throws NotImplementedException { // TODO: Implement this properly. }
|
public void removeAccessibleSelection(int i) { // TODO: Implement this properly. }
| 4,155
|
public void selectAllAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. }
|
public void selectAllAccessibleSelection() { // TODO: Implement this properly. }
| 4,156
|
public void stateChanged(ChangeEvent e) throws NotImplementedException { // Implement this properly. }
|
public void stateChanged(ChangeEvent e) { // Implement this properly. }
| 4,157
|
public int getAccessibleIndexInParent() throws NotImplementedException { // FIXME: Implement this properly. return 0; }
|
public int getAccessibleIndexInParent() { // FIXME: Implement this properly. return 0; }
| 4,159
|
public int getAccessibleIndexInParent() throws NotImplementedException { // FIXME: Implement this properly. return 0; }
|
public int getAccessibleIndexInParent() throws NotImplementedException { // FIXME: Implement this properly. return indexOfTab(title); }
| 4,160
|
public AccessibleStateSet getAccessibleStateSet() throws NotImplementedException { // FIXME: Implement this properly. return null; }
|
public AccessibleStateSet getAccessibleStateSet() { // FIXME: Implement this properly. return null; }
| 4,161
|
public AccessibleStateSet getAccessibleStateSet() throws NotImplementedException { // FIXME: Implement this properly. return null; }
|
public AccessibleStateSet getAccessibleStateSet() throws NotImplementedException { // FIXME: Implement this properly. AccessibleContext parentCtx = JTabbedPane.this.getAccessibleContext(); AccessibleStateSet state = parentCtx.getAccessibleStateSet(); state.add(AccessibleState.SELECTABLE); if (component == getSelectedComponent()) state.add(AccessibleState.SELECTED); return state; }
| 4,162
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJTabbedPane(); return accessibleContext; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { AccessibleJTabbedPane ctx = new AccessibleJTabbedPane(); addChangeListener(ctx); accessibleContext = ctx; } return accessibleContext; }
| 4,163
|
protected String paramString() { return "JTabbedPane"; }
|
protected String paramString() { StringBuffer sb = new StringBuffer(super.paramString()); sb.append(",tabPlacement="); if (tabPlacement == TOP) sb.append("TOP"); if (tabPlacement == BOTTOM) sb.append("BOTTOM"); if (tabPlacement == LEFT) sb.append("LEFT"); if (tabPlacement == RIGHT) sb.append("RIGHT"); return sb.toString(); }
| 4,164
|
public Object run() { proxyHostname = System.getProperty("http.proxyHost"); if (proxyHostname != null && proxyHostname.length() > 0) { String port = System.getProperty("http.proxyPort"); if (port != null && port.length() > 0) { proxyPort = Integer.parseInt(port); } else { proxyHostname = null; proxyPort = -1; } } agent = System.getProperty("http.agent"); String ka = System.getProperty("http.keepAlive"); keepAlive = !(ka != null && "false".equals(ka)); String mc = System.getProperty("http.maxConnections"); maxConnections = (mc != null && mc.length() > 0) ? Math.max(Integer.parseInt(mc), 1) : 5; return null; }
|
public Object run() { proxyHostname = System.getProperty("http.proxyHost"); if (proxyHostname != null && proxyHostname.length() > 0) { String port = System.getProperty("http.proxyPort"); if (port != null && port.length() > 0) { proxyPort = Integer.parseInt(port); } else { proxyHostname = null; proxyPort = -1; } } agent = System.getProperty("http.agent"); String ka = System.getProperty("http.keepAlive"); keepAlive = !(ka != null && "false".equals(ka)); String mc = System.getProperty("http.maxConnections"); maxConnections = (mc != null && mc.length() > 0) ? Math.max(Integer.parseInt(mc), 1) : 5; return null; }
| 4,165
|
HTTPConnection getConnection(String host, int port, boolean secure) throws IOException { HTTPConnection connection; if (keepAlive) { Object key = HTTPConnection.getPoolKey(host, port, secure); synchronized (connectionPool) { connection = (HTTPConnection) connectionPool.remove(key); if (connection == null) { connection = new HTTPConnection(host, port, secure); connection.setPool(connectionPool); } } } else { connection = new HTTPConnection(host, port, secure); } return connection; }
|
HTTPConnection getConnection(String host, int port, boolean secure) throws IOException { HTTPConnection connection; if (keepAlive) { Object key = HTTPConnection.getPoolKey(host, port, secure); synchronized (connectionPool) { connection = (HTTPConnection) connectionPool.remove(key); if (connection == null) { connection = new HTTPConnection(host, port, secure); connection.setPool(connectionPool); } } } else { connection = new HTTPConnection(host, port, secure); } return connection; }
| 4,166
|
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span == 0. We need to layout the row as if it had // a span of Integer.MAX_VALUE. if (span == 0) span = Integer.MAX_VALUE; while (span > 0) { if (logicalView.getViewIndex(offset, Position.Bias.Forward) == -1) break; View view = createView(fv, offset, span, rowIndex); if (view == null) break; int viewSpan = (int) view.getPreferredSpan(axis); row.append(view); int breakWeight = view.getBreakWeight(axis, x, span); if (breakWeight >= View.ForcedBreakWeight) break; x += viewSpan; span -= viewSpan; offset += (view.getEndOffset() - view.getStartOffset()); } if (span < 0) { int flowStart = fv.getFlowStart(axis); int flowSpan = fv.getFlowSpan(axis); adjustRow(fv, rowIndex, flowSpan, flowStart); int rowViewCount = row.getViewCount(); offset = row.getView(rowViewCount - 1).getEndOffset(); } return offset; }
|
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span == 0. We need to layout the row as if it had // a span of Integer.MAX_VALUE. if (span == 0) span = Integer.MAX_VALUE; while (span > 0) { if (logicalView.getViewIndex(offset, Position.Bias.Forward) == -1) break; View view = createView(fv, offset, span, rowIndex); if (view == null) break; int viewSpan = (int) view.getPreferredSpan(axis); row.append(view); int breakWeight = view.getBreakWeight(axis, x, span); if (breakWeight >= View.ForcedBreakWeight) break; x += viewSpan; span -= viewSpan; offset += (view.getEndOffset() - view.getStartOffset()); } if (span < 0) { int flowStart = fv.getFlowStart(axis); int flowSpan = fv.getFlowSpan(axis); adjustRow(fv, rowIndex, flowSpan, flowStart); int rowViewCount = row.getViewCount(); offset = row.getView(rowViewCount - 1).getEndOffset(); } return offset != pos ? offset : -1; }
| 4,167
|
LogicalView(Element el) { super(el); children = new Vector(); }
|
LogicalView(Element el) { super(el); children = new Vector(); }
| 4,168
|
protected void loadChildren(ViewFactory vf) { if (layoutPool == null) { layoutPool = new LogicalView(getElement()); layoutPool.setParent(this); Element el = getElement(); int count = el.getElementCount(); for (int i = 0; i < count; ++i) { Element childEl = el.getElement(i); View childView = vf.create(childEl); layoutPool.append(childView); } } }
|
protected void loadChildren(ViewFactory vf) { if (layoutPool == null) { layoutPool = new LogicalView(getElement(), getAxis()); layoutPool.setParent(this); Element el = getElement(); int count = el.getElementCount(); for (int i = 0; i < count; ++i) { Element childEl = el.getElement(i); View childView = vf.create(childEl); layoutPool.append(childView); } } }
| 4,169
|
protected void loadChildren(ViewFactory vf) { if (layoutPool == null) { layoutPool = new LogicalView(getElement()); layoutPool.setParent(this); Element el = getElement(); int count = el.getElementCount(); for (int i = 0; i < count; ++i) { Element childEl = el.getElement(i); View childView = vf.create(childEl); layoutPool.append(childView); } } }
|
protected void loadChildren(ViewFactory vf) { if (layoutPool == null) { layoutPool = new LogicalView(getElement()); layoutPool.setParent(this); Element el = getElement(); int count = el.getElementCount(); for (int i = 0; i < count; ++i) { Element childEl = el.getElement(i); View childView = vf.create(childEl); layoutPool.append(childView); } } }
| 4,170
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); DerUtil.checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
| 4,171
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); DerUtil.checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
| 4,172
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); DerUtil.checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
| 4,173
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
| 4,174
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger n, e; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(RSA_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] spkBytes = ((BitString) val.getValue()).toByteArray(); der = new DERReader(spkBytes); val = der.read(); checkIsConstructed(derAlgorithmID, "Wrong subjectPublicKey field"); val = der.read(); checkIsBigInteger(val, "Wrong modulus field"); n = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong publicExponent field"); e = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException y = new InvalidParameterException(); y.initCause(x); throw y; } return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }
| 4,175
|
public final boolean writeClassInitialize(VmMethod method) { // Only for static methods (non <clinit>) if (method.isStatic() && !method.isInitializer()) { // Only when class is not initialize final VmType< ? > cls = method.getDeclaringClass(); if (!cls.isInitialized()) { final GPR aax = this.AAX; final int size = os.getMode().getSize(); // Save eax os.writePUSH(aax); // Do the is initialized test // Move method.declaringClass -> EAX final int typeOfs = getSharedStaticsOffset(method .getDeclaringClass()); os.writeMOV(size, aax, STATICS, typeOfs); // Test declaringClass.modifiers os.writeTEST(BITS32, aax, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(method.getMangledName() + "$$after-classinit"); os.writeJCC(afterInit, X86Constants.JNZ); // Call cls.initialize os.writePUSH(aax); invokeJavaMethod(entryPoints.getVmTypeInitialize()); os.setObjectRef(afterInit); // Restore eax os.writePOP(aax); return true; } } return false; }
|
public final boolean writeClassInitialize(VmMethod method) { // Only for static methods (non <clinit>) if (method.isStatic() && !method.isInitializer()) { // Only when class is not initialize final VmType< ? > cls = method.getDeclaringClass(); if (!cls.isInitialized()) { final GPR aax = this.AAX; final Label label = genLabel("$$class-init"); // Save eax os.writePUSH(aax); // Do the is initialized test // Move method.declaringClass -> EAX final int typeOfs = getSharedStaticsOffset(method .getDeclaringClass()); os.writeMOV(size, aax, STATICS, typeOfs); // Test declaringClass.modifiers os.writeTEST(BITS32, aax, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(method.getMangledName() + "$$after-classinit"); os.writeJCC(afterInit, X86Constants.JNZ); // Call cls.initialize os.writePUSH(aax); invokeJavaMethod(entryPoints.getVmTypeInitialize()); os.setObjectRef(afterInit); // Restore eax os.writePOP(aax); return true; } } return false; }
| 4,176
|
public final boolean writeClassInitialize(VmMethod method) { // Only for static methods (non <clinit>) if (method.isStatic() && !method.isInitializer()) { // Only when class is not initialize final VmType< ? > cls = method.getDeclaringClass(); if (!cls.isInitialized()) { final GPR aax = this.AAX; final int size = os.getMode().getSize(); // Save eax os.writePUSH(aax); // Do the is initialized test // Move method.declaringClass -> EAX final int typeOfs = getSharedStaticsOffset(method .getDeclaringClass()); os.writeMOV(size, aax, STATICS, typeOfs); // Test declaringClass.modifiers os.writeTEST(BITS32, aax, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(method.getMangledName() + "$$after-classinit"); os.writeJCC(afterInit, X86Constants.JNZ); // Call cls.initialize os.writePUSH(aax); invokeJavaMethod(entryPoints.getVmTypeInitialize()); os.setObjectRef(afterInit); // Restore eax os.writePOP(aax); return true; } } return false; }
|
public final boolean writeClassInitialize(VmMethod method) { // Only for static methods (non <clinit>) if (method.isStatic() && !method.isInitializer()) { // Only when class is not initialize final VmType< ? > cls = method.getDeclaringClass(); if (!cls.isInitialized()) { final GPR aax = this.AAX; final int size = os.getMode().getSize(); // Save eax os.writePUSH(aax); // Do the is initialized test // Move method.declaringClass -> EAX final int typeOfs = getSharedStaticsOffset(method .getDeclaringClass()); os.writeMOV(size, aax, STATICS, typeOfs); // Test declaringClass.modifiers os.writeTEST(BITS32, aax, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(method.getMangledName() + "$$after-classinit"); os.writeJCC(afterInit, X86Constants.JNZ); // Call cls.initialize os.writePUSH(aax); invokeJavaMethod(entryPoints.getVmTypeInitialize()); os.setObjectRef(afterInit); // Restore eax os.writePOP(aax); return true; } } return false; }
| 4,177
|
public final void writeLoadIsolatedStatics(Label curInstrLabel, String labelPrefix, GPR dst) { final int offset = entryPoints.getVmProcessorIsolatedStaticsTable() .getOffset(); if (os.isCode32()) { os.writeXOR(dst, dst); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, dst, dst, offset); } else { os.writeMOV(BITS64, dst, PROCESSOR64, offset); } }
|
public final void writeLoadIsolatedStatics(Label curInstrLabel, String labelPrefix, GPR dst) { final int offset = entryPoints.getVmProcessorIsolatedStaticsTable() .getOffset(); if (os.isCode32()) { Vm.getVm().getCounter("### load " + dst.getName()).inc(); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, dst, dst, offset); } else { os.writeMOV(BITS64, dst, PROCESSOR64, offset); } }
| 4,178
|
public final void writeLoadIsolatedStatics(Label curInstrLabel, String labelPrefix, GPR dst) { final int offset = entryPoints.getVmProcessorIsolatedStaticsTable() .getOffset(); if (os.isCode32()) { os.writeXOR(dst, dst); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, dst, dst, offset); } else { os.writeMOV(BITS64, dst, PROCESSOR64, offset); } }
|
public final void writeLoadIsolatedStatics(Label curInstrLabel, String labelPrefix, GPR dst) { final int offset = entryPoints.getVmProcessorIsolatedStaticsTable() .getOffset(); if (os.isCode32()) { os.writeXOR(dst, dst); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(dst, offset); } else { os.writeMOV(BITS64, dst, PROCESSOR64, offset); } }
| 4,179
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
| 4,181
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
| 4,182
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
| 4,183
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
|
protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); action = new ListAction(); Object keys[] = focusInputMap.allKeys(); // Register key bindings in the UI InputMap-ActionMap pair for (int i = 0; i < keys.length; i++) { KeyStroke stroke = (KeyStroke) keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString); parentActionMap.put(actionString, new ActionListenerProxy(action, actionString)); } // Register the new InputMap-ActionMap as the parents of the list's // InputMap and ActionMap parentInputMap.setParent(list.getInputMap().getParent()); parentActionMap.setParent(list.getActionMap().getParent()); list.getInputMap().setParent(parentInputMap); list.getActionMap().setParent(parentActionMap); }
| 4,184
|
protected void paintCell(Graphics g, int row, Rectangle bounds, ListCellRenderer rend, ListModel data, ListSelectionModel sel, int lead) { boolean isSel = list.isSelectedIndex(row); boolean hasFocus = (list.getLeadSelectionIndex() == row) && BasicListUI.this.list.hasFocus(); Component comp = rend.getListCellRendererComponent(list, data.getElementAt(row), 0, isSel, hasFocus); rendererPane.paintComponent(g, comp, list, bounds); }
|
protected void paintCell(Graphics g, int row, Rectangle bounds, ListCellRenderer rend, ListModel data, ListSelectionModel sel, int lead) { boolean isSel = list.isSelectedIndex(row); boolean hasFocus = (list.getLeadSelectionIndex() == row) && BasicListUI.this.list.hasFocus(); Component comp = rend.getListCellRendererComponent(list, data.getElementAt(row), row, isSel, hasFocus); rendererPane.paintComponent(g, comp, list, bounds); }
| 4,185
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); // just something here to try. if (vector.size() >= 10) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); } // we have the lock and state we're seeking return vector.remove(0); } }
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); // just something here to try. if (vector.size() >= 20) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); } // we have the lock and state we're seeking return vector.remove(0); } }
| 4,187
|
public AccessibleStateSet getAccessibleStateSet() { // TODO: What state shoiuld be returned here? return new AccessibleStateSet(); }
|
public AccessibleStateSet getAccessibleStateSet() { // TODO: What state shoiuld be returned here? AccessibleStateSet state = new AccessibleStateSet(); Rectangle visibleRect = getVisibleRect(); Rectangle cellRect = getCellRect(row, column, false); if (visibleRect.intersects(cellRect)) state.add(AccessibleState.SHOWING); if (isCellSelected(row, column)) state.add(AccessibleState.SELECTED); if (row == getSelectedRow() && column == getSelectedColumn()) state.add(AccessibleState.ACTIVE); state.add(AccessibleState.TRANSIENT); return state; }
| 4,189
|
protected AccessibleJTable() { getModel().addTableModelListener(this); getSelectionModel().addListSelectionListener(this); getColumnModel().addColumnModelListener(this); getCellEditor().addCellEditorListener(this); }
|
protected AccessibleJTable() { getModel().addTableModelListener(this); getSelectionModel().addListSelectionListener(this); getColumnModel().addColumnModelListener(this); lastSelectedRow = getSelectedRow(); lastSelectedColumn = getSelectedColumn(); TableCellEditor editor = getCellEditor(); if (editor != null) editor.addCellEditorListener(this); }
| 4,190
|
public Accessible getAccessibleAt(int r, int c) { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleAt(int r, int c) { // TODO Auto-generated method stub return getAccessibleChild(r * getAccessibleColumnCount() + c); }
| 4,198
|
public Accessible getAccessibleCaption() { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleCaption() { // TODO Auto-generated method stub return caption; }
| 4,199
|
public int getAccessibleColumn(int index) { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleColumn(int index) { // TODO Auto-generated method stub return getAccessibleColumnAtIndex(index); }
| 4,200
|
public int getAccessibleColumnCount() { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleColumnCount() { // TODO Auto-generated method stub return getColumnCount(); }
| 4,201
|
public Accessible getAccessibleColumnDescription(int c) { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleColumnDescription(int c) { // TODO Auto-generated method stub Accessible descr = null; if (columnDescriptions != null) descr = columnDescriptions[c]; return descr; }
| 4,202
|
public int getAccessibleColumnExtentAt(int r, int c) { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleColumnExtentAt(int r, int c) { // TODO Auto-generated method stub return 1; }
| 4,203
|
public AccessibleTable getAccessibleColumnHeader() { // TODO Auto-generated method stub return null; }
|
public AccessibleTable getAccessibleColumnHeader() { // TODO Auto-generated method stub JTableHeader h = getTableHeader(); AccessibleTable header = null; if (h != null) header = new AccessibleTableHeader(h); return header; }
| 4,204
|
public int getAccessibleIndex(int r, int c) { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleIndex(int r, int c) { // TODO Auto-generated method stub return getAccessibleIndexAt(r, c); }
| 4,205
|
public int getAccessibleRow(int index) { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleRow(int index) { // TODO Auto-generated method stub return getAccessibleRowAtIndex(index); }
| 4,206
|
public int getAccessibleRowCount() { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleRowCount() { // TODO Auto-generated method stub return getRowCount(); }
| 4,207
|
public Accessible getAccessibleRowDescription(int r) { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleRowDescription(int r) { // TODO Auto-generated method stub Accessible descr = null; if (rowDescriptions != null) descr = rowDescriptions[r]; return descr; }
| 4,208
|
public int getAccessibleRowExtentAt(int r, int c) { // TODO Auto-generated method stub return 0; }
|
public int getAccessibleRowExtentAt(int r, int c) { // TODO Auto-generated method stub return 1; }
| 4,209
|
public Accessible getAccessibleSelection(int i) { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleSelection(int i) { // TODO Auto-generated method stub Accessible found = null; int[] selectedRows = getSelectedRows(); int[] selectedColumns = getSelectedColumns(); int numCols = getColumnCount(); int numRows = getRowCount(); if (getRowSelectionAllowed() && getColumnSelectionAllowed()) { int current = -1; int newIndex = current; int lastSelectedRow = -1; for (int j = 0; i < selectedRows.length; i++) { int selectedRow = selectedRows[j]; int r = -1; int ci = -1; for (r = lastSelectedRow + 1; r < selectedRow && current < i; r++) { for (ci = 0; ci < selectedColumns.length && current < i; ci++) { current++; } } if (current == i) { found = getAccessibleChild(r * numCols + selectedColumns[ci]); break; } if (current < i && current + numCols >= i) { found = getAccessibleChild(r * numCols + (i - current)); break; } current += numCols; } if (found == null) { int r = 0; int ci = 0; for (r = lastSelectedRow + 1; r < numRows && current < i; r++) { for (ci = 0; ci < selectedColumns.length && current < i; ci++) { current++; } } if (current == i) { found = getAccessibleChild(r * numCols + selectedColumns[ci]); } } } else if (getRowSelectionAllowed()) { int c = i % numCols; int r = selectedRows[i / numCols]; found = getAccessibleChild(r * numCols + c); } else if (getRowSelectionAllowed()) { int numSelectedColumns = selectedColumns.length; int c = selectedColumns[i % numSelectedColumns]; int r = i / numSelectedColumns; found = getAccessibleChild(r * numCols + c); } return found; }
| 4,210
|
public Accessible getAccessibleSummary() { // TODO Auto-generated method stub return null; }
|
public Accessible getAccessibleSummary() { // TODO Auto-generated method stub return summary; }
| 4,211
|
public int[] getSelectedAccessibleColumns() { // TODO Auto-generated method stub return null; }
|
public int[] getSelectedAccessibleColumns() { // TODO Auto-generated method stub return getSelectedColumns(); }
| 4,212
|
public int[] getSelectedAccessibleRows() { // TODO Auto-generated method stub return null; }
|
public int[] getSelectedAccessibleRows() { // TODO Auto-generated method stub return getSelectedRows(); }
| 4,213
|
public boolean isAccessibleChildSelected(int i) { // TODO Auto-generated method stub return false; }
|
public boolean isAccessibleChildSelected(int i) { // TODO Auto-generated method stub int r = getAccessibleRowAtIndex(i); int c = getAccessibleColumnAtIndex(i); return isCellSelected(r, c); }
| 4,214
|
public boolean isAccessibleColumnSelected(int c) { // TODO Auto-generated method stub return false; }
|
public boolean isAccessibleColumnSelected(int c) { // TODO Auto-generated method stub return isColumnSelected(c); }
| 4,215
|
public boolean isAccessibleRowSelected(int r) { // TODO Auto-generated method stub return false; }
|
public boolean isAccessibleRowSelected(int r) { // TODO Auto-generated method stub return isRowSelected(r); }
| 4,216
|
public boolean isAccessibleSelected(int r, int c) { // TODO Auto-generated method stub return false; }
|
public boolean isAccessibleSelected(int r, int c) { // TODO Auto-generated method stub return isCellSelected(r, c); }
| 4,217
|
public void setAccessibleCaption(Accessible caption) { // TODO Auto-generated method stub }
|
public void setAccessibleCaption(Accessible c) { // TODO Auto-generated method stub }
| 4,220
|
public void setAccessibleSummary(Accessible summary) { // TODO Auto-generated method stub }
|
public void setAccessibleSummary(Accessible s) { // TODO Auto-generated method stub }
| 4,224
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Icon) { Icon iconValue = (Icon) value; setIcon(iconValue); setText(""); } return this; }
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Icon) { Icon iconValue = (Icon) value; setIcon(iconValue); } return this; }
| 4,229
|
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
|
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
| 4,232
|
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
|
public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); }
| 4,233
|
protected void createDefaultEditors() { JCheckBox box = new BooleanCellRenderer().getCheckBox(); setDefaultEditor(Boolean.class, new DefaultCellEditor(box)); }
|
protected void createDefaultEditors() { JCheckBox box = new BooleanCellRenderer().getCheckBox(); box.setBorder(BorderFactory.createLineBorder(getGridColor(), 2)); box.setBorderPainted(true); booleanInvertingEditor = new DefaultCellEditor(box); setDefaultEditor(Boolean.class, booleanInvertingEditor); }
| 4,234
|
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getPreferredWidth(); prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpillResizing(cols, spill, resizingColumn); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: // Subtract the width of the non-resized columns from the spill. int w = 0; int wp = 0; TableColumn column; for (int i = 0; i < rCol; i++) { column = columnModel.getColumn(i); w += column.getWidth(); wp+= column.getPreferredWidth(); } // The number of columns right from the column being resized. int n = ncols-rCol-1; if (n>0) { // If there are any columns on the right sied to resize. spill = (getWidth()-w) - (prefSum-wp); int average = spill / n; // For all columns right from the column being resized: for (int i = rCol+1; i < ncols; i++) { column = columnModel.getColumn(i); column.setWidth(column.getPreferredWidth() + average); } } resizingColumn.setWidth(resizingColumn.getPreferredWidth()); break; case AUTO_RESIZE_OFF: default: int prefWidth = resizingColumn.getPreferredWidth(); resizingColumn.setWidth(prefWidth); } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } if (editorComp!=null) moveToCellBeingEdited(editorComp); // Repaint fixes the invalid view after the first keystroke if the cell // editing is started immediately after the program start or cell // resizing. repaint(); if (tableHeader!=null) tableHeader.repaint(); }
|
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getPreferredWidth(); prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpillResizing(cols, spill, resizingColumn); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: // Subtract the width of the non-resized columns from the spill. int w = 0; int wp = 0; TableColumn column; for (int i = 0; i < rCol; i++) { column = columnModel.getColumn(i); w += column.getWidth(); wp+= column.getPreferredWidth(); } // The number of columns right from the column being resized. int n = ncols-rCol-1; if (n>0) { // If there are any columns on the right sied to resize. spill = (getWidth()-w) - (prefSum-wp); int average = spill / n; // For all columns right from the column being resized: for (int i = rCol+1; i < ncols; i++) { column = columnModel.getColumn(i); column.setWidth(column.getPreferredWidth() + average); } } resizingColumn.setWidth(resizingColumn.getPreferredWidth()); break; case AUTO_RESIZE_OFF: default: int prefWidth = resizingColumn.getPreferredWidth(); resizingColumn.setWidth(prefWidth); } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } if (editorComp!=null) moveToCellBeingEdited(editorComp); // Repaint fixes the invalid view after the first keystroke if the cell // editing is started immediately after the program start or cell // resizing. repaint(); if (tableHeader!=null) tableHeader.repaint(); }
| 4,235
|
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
|
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(editor); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
| 4,236
|
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; }
|
public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return editor.shouldSelectCell(null); } }
| 4,237
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
| 4,239
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
| 4,240
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
| 4,241
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
| 4,242
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
|
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(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; }
| 4,243
|
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
|
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
| 4,244
|
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
|
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; setRowHeight(16); this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; }
| 4,245
|
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
|
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int r; int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
| 4,246
|
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
|
public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; }
| 4,247
|
public void setValueAt(Object value, int row, int column) { if (!isCellEditable(row, column)) return; dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); repaint(getCellRect(row, column, true)); }
|
public void setValueAt(Object value, int row, int column) { if (!isCellEditable(row, column)) return; dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); repaint(getCellRect(row, column, true)); }
| 4,252
|
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
|
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
| 4,254
|
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
|
public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); }
| 4,255
|
public void dumpInfo() { System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds()); }
|
public void dumpInfo() { System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds()); }
| 4,257
|
public InterruptedException() { super(); }
|
public InterruptedException() { super(); }
| 4,258
|
public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false; }
|
public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false; }
| 4,263
|
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
|
public boolean next() { boolean outOfDataCells = true; HasNext = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
| 4,264
|
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
|
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outOfDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
| 4,265
|
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; }
|
public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } if (outOfDataCells) HasNext = false; return !outOfDataCells; }
| 4,266
|
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
|
public boolean prev() { boolean outOfDataCells = true; HasNext = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
| 4,267
|
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
|
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outOfDataCells = false; break; //get out of the for loop } } return !outofDataCell; }
| 4,268
|
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; }
|
public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } if (outOfDataCells) HasNext = false; return !outOfDataCells; }
| 4,269
|
public void setParent(View parent) { if (parent == null) { int numChildren = getViewCount(); for (int i = 0; i < numChildren; i++) getView(i).setParent(this); } this.parent = parent; }
|
public void setParent(View parent) { if (parent == null) { int numChildren = getViewCount(); for (int i = 0; i < numChildren; i++) getView(i).setParent(null); } this.parent = parent; }
| 4,270
|
public byte[] getData() { throw new Error("not implemented"); }
|
public byte[] getData() { int size = getSize(); byte[] data = new byte[size]; System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE); byte[] tt = getTagTable(); System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length); Enumeration e = tagTable.elements(); while (e.hasMoreElements()) { TagEntry tag = (TagEntry) e.nextElement(); System.arraycopy(tag.getData(), 0, data, tag.getOffset(), tag.getSize()); } return data; }
| 4,272
|
public static ICC_Profile getInstance(byte[] data) { throw new Error("not implemented"); }
|
public static ICC_Profile getInstance(byte[] data) { ProfileHeader header = new ProfileHeader(data); header.verifyHeader(data.length); Hashtable tags = createTagTable(data); if (isRGBProfile(header, tags)) return new ICC_ProfileRGB(data); if (isGrayProfile(header, tags)) return new ICC_ProfileGray(data); return new ICC_Profile(header, tags); }
| 4,273
|
public int getMajorVersion() { throw new Error("not implemented"); }
|
public int getMajorVersion() { return header.getMajorVersion(); }
| 4,274
|
public int getMinorVersion() { throw new Error("not implemented"); }
|
public int getMinorVersion() { return header.getMinorVersion(); }
| 4,275
|
public int getPCSType() { throw new Error("not implemented"); }
|
public int getPCSType() { return header.getProfileColorSpace(); }
| 4,276
|
public int getProfileClass() { throw new Error("not implemented"); }
|
public int getProfileClass() { return header.getProfileClass(); }
| 4,277
|
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("not implemented"); }
|
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); String predef = (String) s.readObject(); byte[] data = (byte[]) s.readObject(); if (data != null) { header = new ProfileHeader(data); tagTable = createTagTable(data); profileID = -1; } if (predef != null) { predef = predef.intern(); if (predef.equals("CS_sRGB")) createProfile(ColorSpace.CS_sRGB); if (predef.equals("CS_LINEAR_RGB")) createProfile(ColorSpace.CS_LINEAR_RGB); if (predef.equals("CS_CIEXYZ")) createProfile(ColorSpace.CS_CIEXYZ); if (predef.equals("CS_GRAY")) createProfile(ColorSpace.CS_GRAY); if (predef.equals("CS_PYCC")) createProfile(ColorSpace.CS_PYCC); } }
| 4,278
|
protected Object readResolve() throws ObjectStreamException { throw new Error("not implemented"); }
|
protected Object readResolve() throws ObjectStreamException { if (isRGBProfile(header, tagTable)) return new ICC_ProfileRGB(getData()); if (isGrayProfile(header, tagTable)) return new ICC_ProfileGray(getData()); return this; }
| 4,279
|
public void setData(int tagSignature, byte[] data) { throw new Error("not implemented"); }
|
public void setData(int tagSignature, byte[] data) { profileID = -1; if (tagSignature == icSigHead) header = new ProfileHeader(data); else { TagEntry t = new TagEntry(tagSignature, data); tagTable.put(t.hashKey(), t); } }
| 4,280
|
public void write(String filename) throws IOException { write(new FileOutputStream(filename)); }
|
public void write(String filename) throws IOException { FileOutputStream out = new FileOutputStream(filename); write(out); out.flush(); out.close(); }
| 4,281
|
private void writeObject(ObjectOutputStream s) throws IOException { throw new Error("not implemented"); }
|
private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); if (profileID == ColorSpace.CS_sRGB) s.writeObject("CS_sRGB"); else if (profileID == ColorSpace.CS_LINEAR_RGB) s.writeObject("CS_LINEAR_RGB"); else if (profileID == ColorSpace.CS_CIEXYZ) s.writeObject("CS_CIEXYZ"); else if (profileID == ColorSpace.CS_GRAY) s.writeObject("CS_GRAY"); else if (profileID == ColorSpace.CS_PYCC) s.writeObject("CS_PYCC"); else { s.writeObject(null); s.writeObject(getData()); return; } s.writeObject(null); }
| 4,282
|
public static String unquote(String str) throws MalformedURLException { if (str == null) return null; final int MAX_BYTES_PER_UTF_8_CHAR = 3; byte[] buf = new byte[str.length()*MAX_BYTES_PER_UTF_8_CHAR]; int pos = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '%') { if (i + 2 >= str.length()) throw new MalformedURLException(str + " : Invalid quoted character"); int hi = Character.digit(str.charAt(++i), 16); int lo = Character.digit(str.charAt(++i), 16); if (lo < 0 || hi < 0) throw new MalformedURLException(str + " : Invalid quoted character"); buf[pos++] = (byte) (hi * 16 + lo); } else if (c > 127) { try { byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } } else buf[pos++] = (byte) c; } try { return new String(buf, 0, pos, "utf-8"); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } }
|
public static String unquote(String str) throws MalformedURLException { if (str == null) return null; final int MAX_BYTES_PER_UTF_8_CHAR = 3; byte[] buf = new byte[str.length()*MAX_BYTES_PER_UTF_8_CHAR]; int pos = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '%') { if (i + 2 >= str.length()) throw new MalformedURLException(str + " : Invalid quoted character"); int hi = Character.digit(str.charAt(++i), 16); int lo = Character.digit(str.charAt(++i), 16); if (lo < 0 || hi < 0) throw new MalformedURLException(str + " : Invalid quoted character"); buf[pos++] = (byte) (hi * 16 + lo); } else if (c > 127) { try { byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); final int c_length = c_as_bytes.length; System.arraycopy(c_as_bytes, 0, buf, pos, c_length); pos += c_length; } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } } else buf[pos++] = (byte) c; } try { return new String(buf, 0, pos, "utf-8"); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } }
| 4,283
|
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
|
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
| 4,284
|
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
|
protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); }
| 4,285
|
public static ServiceDetail extract(Any a) { try { return ((ServiceDetailHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
|
public static ServiceDetail extract(Any a) { try { return ((ServiceDetailHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
| 4,286
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.