bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public Object getValue() throws Exception { if (value == unset) value = doExecute(); return value; }
public Object getValue() throws Exception { if (value == UNSET) value = doExecute(); return value; }
10,362
public String toString() { String result = super.toString(); if (value != unset) return value.getClass().getName() + " " + result; return result; }
public String toString() { String result = super.toString(); if (value != UNSET) return value.getClass().getName() + " " + result; return result; }
10,363
final Object doExecute() throws Exception { Class klazz = (target instanceof Class) ? (Class) target : target.getClass(); Object args[] = (arguments == null) ? new Object[0] : arguments; Class argTypes[] = new Class[args.length]; for (int i = 0; i < args.length; i++) argTypes[i] = args[i].getClass(); if (target.getClass().isArray()) { // FIXME: invoke may have to be used. For now, cast to Number // and hope for the best. If caller didn't behave, we go boom // and throw the exception. if (methodName.equals("get") && argTypes.length == 1) return Array.get(target, ((Number)args[0]).intValue()); if (methodName.equals("set") && argTypes.length == 2) { Object obj = Array.get(target, ((Number)args[0]).intValue()); Array.set(target, ((Number)args[0]).intValue(), args[1]); return obj; } throw new NoSuchMethodException("No matching method for statement " + toString()); } // If we already cached the method, just use it. if (method != null) return method.invoke(target, args); else if (ctor != null) return ctor.newInstance(args); // Find a matching method to call. JDK seems to go through all // this to find the method to call. // if method name or length don't match, skip // Need to go through each arg // If arg is wrapper - check if method arg is matchable builtin // or same type or super // - check that method arg is same or super if (methodName.equals("new") && target instanceof Class) { Constructor ctors[] = klazz.getConstructors(); for (int i = 0; i < ctors.length; i++) { // Skip methods with wrong number of args. Class ptypes[] = ctors[i].getParameterTypes(); System.out.println("ptypeslen = " + ptypes.length); System.out.println("ptypes = " + ptypes); System.out.println("ctor = " + ctors[i].getName()); for (int j=0; j < ptypes.length; j++) { System.out.println("param = " + ptypes[i].getName()); } if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (ctor == null) { ctor = ctors[i]; continue; } Class mptypes[] = ctor.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) ctor = ctors[i]; } if (ctor == null) throw new InstantiationException("No matching constructor for statement " + toString()); return ctor.newInstance(args); } Method methods[] = klazz.getMethods(); for (int i = 0; i < methods.length; i++) { // Skip methods with wrong name or number of args. if (!methods[i].getName().equals(methodName)) continue; Class ptypes[] = methods[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (method == null) { method = methods[i]; continue; } Class mptypes[] = method.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) method = methods[i]; } if (method == null) throw new NoSuchMethodException("No matching method for statement " + toString()); return method.invoke(target, args); }
final Object doExecute() throws Exception { Class klazz = (target instanceof Class) ? (Class) target : target.getClass(); Object args[] = (arguments == null) ? new Object[0] : arguments; Class argTypes[] = new Class[args.length]; for (int i = 0; i < args.length; i++) argTypes[i] = args[i].getClass(); if (target.getClass().isArray()) { // FIXME: invoke may have to be used. For now, cast to Number // and hope for the best. If caller didn't behave, we go boom // and throw the exception. if (methodName.equals("get") && argTypes.length == 1) return Array.get(target, ((Number)args[0]).intValue()); if (methodName.equals("set") && argTypes.length == 2) { Object obj = Array.get(target, ((Number)args[0]).intValue()); Array.set(target, ((Number)args[0]).intValue(), args[1]); return obj; } throw new NoSuchMethodException("No matching method for statement " + toString()); } // If we already cached the method, just use it. if (method != null) return method.invoke(target, args); else if (ctor != null) return ctor.newInstance(args); // Find a matching method to call. JDK seems to go through all // this to find the method to call. // if method name or length don't match, skip // Need to go through each arg // If arg is wrapper - check if method arg is matchable builtin // or same type or super // - check that method arg is same or super if (methodName.equals("new") && target instanceof Class) { Constructor ctors[] = klazz.getConstructors(); for (int i = 0; i < ctors.length; i++) { // Skip methods with wrong number of args. Class ptypes[] = ctors[i].getParameterTypes(); System.out.println("ptypeslen = " + ptypes.length); System.out.println("ptypes = " + ptypes); System.out.println("ctor = " + ctors[i].getName()); for (int j=0; j < ptypes.length; j++) { System.out.println("param = " + ptypes[i].getName()); } if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (ctor == null) { ctor = ctors[i]; continue; } Class mptypes[] = ctor.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) ctor = ctors[i]; } if (ctor == null) throw new InstantiationException("No matching constructor for statement " + toString()); return ctor.newInstance(args); } Method methods[] = klazz.getMethods(); for (int i = 0; i < methods.length; i++) { // Skip methods with wrong name or number of args. if (!methods[i].getName().equals(methodName)) continue; Class ptypes[] = methods[i].getParameterTypes(); if (ptypes.length != args.length) continue; // Check if method matches if (!compatible(ptypes, argTypes)) continue; // Use method[i] if it is more specific. // FIXME: should this check both directions and throw if // neither is more specific? if (method == null) { method = methods[i]; continue; } Class mptypes[] = method.getParameterTypes(); if (moreSpecific(ptypes, mptypes)) method = methods[i]; } if (method == null) throw new NoSuchMethodException("No matching method for statement " + toString()); return method.invoke(target, args); }
10,364
public String toString() { String result = target.getClass().getName() + "." + methodName + "("; String sep = ""; for (int i = 0; i < arguments.length; i++) { result = result + sep + arguments[i].getClass().getName(); sep = ", "; } result = result + ")"; return result; }
public String toString() { StringBuffer result = new StringBuffer(); Class klass = target.getClass(); result.append( ((WeakHashMap) classMaps.get(klass)).get(target)); result.append("."); result.append(methodName); result.append("("); String sep = ""; for (int i = 0; i < arguments.length; i++) { result = result + sep + arguments[i].getClass().getName(); sep = ", "; } result = result + ")"; return result; }
10,365
public String toString() { String result = target.getClass().getName() + "." + methodName + "("; String sep = ""; for (int i = 0; i < arguments.length; i++) { result = result + sep + arguments[i].getClass().getName(); sep = ", "; } result = result + ")"; return result; }
public String toString() { String result = target.getClass().getName() + "." + methodName + "("; String sep = ""; for (int i = 0; i < arguments.length; i++) { result.append(sep); result.append(arguments[i].getClass().getName()); sep = ", "; } result = result + ")"; return result; }
10,366
public String toString() { String result = target.getClass().getName() + "." + methodName + "("; String sep = ""; for (int i = 0; i < arguments.length; i++) { result = result + sep + arguments[i].getClass().getName(); sep = ", "; } result = result + ")"; return result; }
public String toString() { String result = target.getClass().getName() + "." + methodName + "("; String sep = ""; for (int i = 0; i < arguments.length; i++) { result = result + sep + arguments[i].getClass().getName(); sep = ", "; } result = result + ")"; return result; }
10,367
public abstract long get ();
public LongBuffer get (long[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; }
10,368
public int hashCode () { // FIXME: Check what SUN calculates here. return super.hashCode (); }
public int hashCode () { // FIXME: Check what SUN calculates here. long hashCode = get(position()) + 31; long multiplier = 1; for (int i = position() + 1; i < limit(); ++i) { multiplier *= 31; hashCode += (get(i) + 30)*multiplier; } return ((int)hashCode); }
10,369
public abstract LongBuffer put (long b);
public LongBuffer put (LongBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining ()); if (src.remaining () > 0) { long[] toPut = new long [src.remaining ()]; src.get (toPut); put (toPut); } return this; }
10,370
final public static LongBuffer wrap (long[] array, int offset, int length) { return new LongBufferImpl (array, 0, array.length, offset + length, offset, -1, false); }
public static final LongBuffer wrap (long[] array, int offset, int length) { return new LongBufferImpl (array, 0, array.length, offset + length, offset, -1, false); }
10,371
public gnuIorInfo(ORB_1_4 an_orb, POA a_poa, IOR an_ior) { orb = an_orb; poa = a_poa; ior = an_ior; }
public gnuIorInfo(ORB_1_4 an_orb, gnuPOA a_poa, IOR an_ior) { orb = an_orb; poa = a_poa; ior = an_ior; }
10,372
short state() { return (short) poa.the_POAManager().get_state().value(); }
public short state() { return (short) poa.the_POAManager().get_state().value(); }
10,373
UnsupportedLookAndFeelException(String a) { super(a); }
public UnsupportedLookAndFeelException(String a) { super(a); }
10,374
public AWTEventListener[] getAWTEventListeners() { return null; }
public AWTEventListener[] getAWTEventListeners() { SecurityManager s = System.getSecurityManager(); if (s != null) s.checkPermission(new AWTPermission("listenToAllAWTEvents")); AWTEventListener[] copy = new AWTEventListener[awtEventListeners.length]; System.arraycopy(awtEventListeners, 0, copy, 0, awtEventListeners.length); return copy; }
10,378
public Insets getScreenInsets(GraphicsConfiguration gc) { return null; }
public Insets getScreenInsets(GraphicsConfiguration gc) { return new Insets(0, 0, 0, 0); }
10,379
private void damageLayout() { updateLayoutStateNeeded = 1; list.revalidate(); }
void damageLayout() { updateLayoutStateNeeded = 1; list.revalidate(); }
10,382
protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { this.keyChar = keyChar; this.keyCode = keyCode; // No need to call extend(), as only trusted code calls this constructor. this.modifiers = modifiers; this.onKeyRelease = onKeyRelease; }
protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { this.keyChar = keyChar; this.keyCode = keyCode; // No need to call extend(), as only trusted code calls this constructor. this.modifiers = modifiers; this.onKeyRelease = onKeyRelease; }
10,383
protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { this.keyChar = keyChar; this.keyCode = keyCode; // No need to call extend(), as only trusted code calls this constructor. this.modifiers = modifiers; this.onKeyRelease = onKeyRelease; }
protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { this.keyChar = keyChar; this.keyCode = keyCode; // No need to call extend(), as only trusted code calls this constructor. this.modifiers = modifiers; this.onKeyRelease = onKeyRelease; }
10,384
public JWindowPopup(Component owner, Component contents, int x, int y) { /* Checks whether contents is null. */ super(owner, contents, x, y); this.contents = contents; window = new JWindow(); window.getContentPane().add(contents); window.setLocation(x, y); window.setFocusableWindowState(false); }
public JWindowPopup(Component owner, Component contents, int x, int y) { /* Checks whether contents is null. */ super(owner, contents, x, y); this.contents = contents; window = new JWindow(SwingUtilities.getWindowAncestor(owner)); window.getContentPane().add(contents); window.setLocation(x, y); window.setFocusableWindowState(false); }
10,385
public JWindow() { this(null); }
public JWindow() { super(null); }
10,386
Container getContentPane() { return getRootPane().getContentPane(); }
public Container getContentPane() { return getRootPane().getContentPane(); }
10,387
public void connect() throws IOException { // Call is ignored if already connected. if (connected) return; // If not connected, then file needs to be openned. file = new File (getURL().getFile()); if (! file.isDirectory()) { if (doInput) inputStream = new BufferedInputStream(new FileInputStream(file)); if (doOutput) outputStream = new BufferedOutputStream(new FileOutputStream(file)); } else { if (doInput) { inputStream = new ByteArrayInputStream(getDirectoryListing()); } if (doOutput) throw new ProtocolException ("file: protocol does not support output on directories"); } connected = true; }
public void connect() throws IOException { // Call is ignored if already connected. if (connected) return; // If not connected, then file needs to be openned. file = new File (unquote(getURL().getFile())); if (! file.isDirectory()) { if (doInput) inputStream = new BufferedInputStream(new FileInputStream(file)); if (doOutput) outputStream = new BufferedOutputStream(new FileOutputStream(file)); } else { if (doInput) { inputStream = new ByteArrayInputStream(getDirectoryListing()); } if (doOutput) throw new ProtocolException ("file: protocol does not support output on directories"); } connected = true; }
10,388
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws IOException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
10,389
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws UnsupportedEncodingException { encoder.reset(); if (!encoder.canEncode(text)) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
10,390
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
10,391
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
10,392
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
10,393
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } return text.getBytes(encoding); }
final byte[] encodeText(String text) throws UnsupportedEncodingException { if (compatibilityMode) { int len = text.length(); StringBuffer buf = null; for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c >= 127) { if (buf == null) { buf = new StringBuffer(text.substring(0, i)); } buf.append('&'); buf.append('#'); buf.append((int) c); buf.append(';'); } else if (buf != null) { buf.append(c); } } if (buf != null) { text = buf.toString(); } } encoded.flip(); int len = encoded.limit() - encoded.position(); byte[] ret = new byte[len]; encoded.get(ret, 0, len); return ret; }
10,394
public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException { super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf)); // The following is unnecessary, because UnicastRemoteObject export itself automatically. //((UnicastServerRef)getRef()).exportObject(this);}
public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException { super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf)); // The following is unnecessary, because UnicastRemoteObject export itself automatically. //((UnicastServerRef)getRef()).exportObject(this);}
10,395
public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) { this(objid); manager = UnicastConnectionManager.getInstance(host, port, csf);}
public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) { this(objid); manager = UnicastConnectionManager.getInstance(host, port, csf);}
10,396
public IllegalAccessError(String s) { super(s); }
public IllegalAccessError() { super(s); }
10,397
public IllegalAccessError(String s) { super(s); }
public IllegalAccessError(String s) { }
10,398
public static SAXParserFactory newInstance() throws FactoryConfigurationError { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = SAXParserFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (SAXParserFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.aelfred2.JAXPFactory(); }
public static SAXParserFactory newInstance() throws FactoryConfigurationError { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = SAXParserFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (SAXParserFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.SAXParserFactory(); }
10,400
public void parse(InputStream stream, DefaultHandler def) throws SAXException, IOException { parse (new InputSource (stream), def); }
public void parse(InputStream stream, HandlerBase handler) throws SAXException, IOException { parse (new InputSource (stream), def); }
10,401
public void parse(InputStream stream, DefaultHandler def) throws SAXException, IOException { parse (new InputSource (stream), def); }
public void parse(InputStream stream, DefaultHandler def) throws SAXException, IOException { parse (new InputSource (stream), handler); }
10,402
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { if (sr == null) sr = new SizeRequirements(); else { sr.maximum = 0; sr.minimum = 0; sr.preferred = 0; sr.alignment = 0.5F; } int count = getViewCount(); // Sum up the sizes of the children along the specified axis. for (int i = 0; i < count; ++i) { View child = getView(i); sr.minimum += child.getMinimumSpan(axis); sr.preferred += child.getPreferredSpan(axis); sr.maximum += child.getMaximumSpan(axis); } return sr; }
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { if (sr == null) sr = new SizeRequirements(); else { sr.maximum = 0; sr.minimum = 0; sr.preferred = 0; sr.alignment = 0.5F; } int count = getViewCount(); // Sum up the sizes of the children along the specified axis. for (int i = 0; i < count; ++i) { View child = getView(i); sr.minimum += child.getMinimumSpan(axis); sr.preferred += child.getPreferredSpan(axis); sr.maximum += child.getMaximumSpan(axis); } return sr; }
10,403
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { if (sr == null) sr = new SizeRequirements(); else { sr.maximum = 0; sr.minimum = 0; sr.preferred = 0; sr.alignment = 0.5F; } int count = getViewCount(); int aboveBaseline = 0; int belowBaseline = 0; int aboveBaselineMin = 0; int belowBaselineMin = 0; int aboveBaselineMax = 0; int belowBaselineMax = 0; for (int i = 0; i < count; ++i) { View child = getView(i); float align = child.getAlignment(axis); int pref = (int) child.getPreferredSpan(axis); int min = (int) child.getMinimumSpan(axis); int max = (int) child.getMaximumSpan(axis); aboveBaseline += (int) (align * pref); belowBaseline += (int) ((1.F - align) * pref); aboveBaselineMin += (int) (align * min); belowBaselineMin += (int) ((1.F - align) * min); aboveBaselineMax += (int) (align * max); belowBaselineMax += (int) ((1.F - align) * max); } sr.minimum = aboveBaselineMin + belowBaselineMin; sr.maximum = aboveBaselineMax + belowBaselineMax; sr.preferred = aboveBaseline + belowBaseline; if (aboveBaseline == 0) sr.alignment = 1.0F; else sr.alignment = (float) (sr.preferred / aboveBaseline); return sr; }
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { if (sr == null) sr = new SizeRequirements(); else { sr.maximum = 0; sr.minimum = 0; sr.preferred = 0; sr.alignment = 0.5F; } int count = getViewCount(); int aboveBaseline = 0; int belowBaseline = 0; int aboveBaselineMin = 0; int belowBaselineMin = 0; int aboveBaselineMax = 0; int belowBaselineMax = 0; for (int i = 0; i < count; ++i) { View child = getView(i); float align = child.getAlignment(axis); int pref = (int) child.getPreferredSpan(axis); int min = (int) child.getMinimumSpan(axis); int max = (int) child.getMaximumSpan(axis); aboveBaseline += (int) (align * pref); belowBaseline += (int) ((1.F - align) * pref); aboveBaselineMin += (int) (align * min); belowBaselineMin += (int) ((1.F - align) * min); aboveBaselineMax += (int) (align * max); belowBaselineMax += (int) ((1.F - align) * max); } sr.minimum = aboveBaselineMin + belowBaselineMin; sr.maximum = aboveBaselineMax + belowBaselineMax; sr.preferred = aboveBaseline + belowBaseline; if (aboveBaseline == 0) sr.alignment = 1.0F; else sr.alignment = (float) (sr.preferred / aboveBaseline); return sr; }
10,404
protected void layout(int width, int height) { this.width = width; this.height = height; if (myAxis == X_AXIS) { layoutMajorAxis(width, X_AXIS, offsetsX, spansX); layoutMinorAxis(height, Y_AXIS, offsetsY, spansY); } else { layoutMajorAxis(height, Y_AXIS, offsetsY, spansY); layoutMinorAxis(width, X_AXIS, offsetsX, spansX); } }
protected void layout(int width, int height) { this.width = width; this.height = height; if (myAxis == X_AXIS) { layoutMajorAxis(width, X_AXIS, offsetsX, spansX); layoutMinorAxis(height, Y_AXIS, offsetsY, spansY); } else { layoutMajorAxis(height, Y_AXIS, offsetsY, spansY); layoutMinorAxis(width, X_AXIS, offsetsX, spansX); } }
10,405
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // Allocate SizeRequirements for each child view. int count = getViewCount(); SizeRequirements[] childReqs = new SizeRequirements[count]; for (int i = 0; i < count; ++i) { View view = getView(i); childReqs[i] = new SizeRequirements((int) view.getMinimumSpan(axis), (int) view.getPreferredSpan(axis), (int) view.getMaximumSpan(axis), view.getAlignment(axis)); } // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); validateLayout(axis); }
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // Allocate SizeRequirements for each child view. int count = getViewCount(); SizeRequirements[] childReqs = new SizeRequirements[count]; for (int i = 0; i < count; ++i) { View view = getView(i); childReqs[i] = new SizeRequirements((int) view.getMinimumSpan(axis), (int) view.getPreferredSpan(axis), (int) view.getMaximumSpan(axis), view.getAlignment(axis)); } // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs, offsets, spans); validateLayout(axis); }
10,406
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // Allocate SizeRequirements for each child view. int count = getViewCount(); SizeRequirements[] childReqs = new SizeRequirements[count]; for (int i = 0; i < count; ++i) { View view = getView(i); childReqs[i] = new SizeRequirements((int) view.getMinimumSpan(axis), (int) view.getPreferredSpan(axis), (int) view.getMaximumSpan(axis), view.getAlignment(axis)); } // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, null, childReqs, offsets, spans); validateLayout(axis); }
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // Allocate SizeRequirements for each child view. int count = getViewCount(); SizeRequirements[] childReqs = new SizeRequirements[count]; for (int i = 0; i < count; ++i) { View view = getView(i); childReqs[i] = new SizeRequirements((int) view.getMinimumSpan(axis), (int) view.getPreferredSpan(axis), (int) view.getMaximumSpan(axis), view.getAlignment(axis)); } // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(targetSpan, null, childReqs, offsets, spans); validateLayout(axis); }
10,407
public SizeRequirements(int min, int pref, int max, float align) { // TODO } // SizeRequirements()
public SizeRequirements() { // TODO } // SizeRequirements()
10,410
protected Rectangle getInsideAllocation(Shape a) { if (a == null) return null; Rectangle alloc = a.getBounds(); // Initialize the inside allocation rectangle. This is done inside // a synchronized block in order to avoid multiple threads creating // this instance simultanously. Rectangle inside; synchronized(this) { inside = insideAllocation; if (inside == null) { inside = new Rectangle(); insideAllocation = inside; } } inside.x = alloc.x - insets.left; inside.y = alloc.y - insets.top; inside.width = alloc.width - insets.left - insets.right; inside.height = alloc.height - insets.top - insets.bottom; return inside; }
protected Rectangle getInsideAllocation(Shape a) { if (a == null) return null; Rectangle alloc = a.getBounds(); // Initialize the inside allocation rectangle. This is done inside // a synchronized block in order to avoid multiple threads creating // this instance simultanously. Rectangle inside; synchronized(this) { inside = insideAllocation; if (inside == null) { inside = new Rectangle(); insideAllocation = inside; } } inside.x = alloc.x - insets.left; inside.y = alloc.y - insets.top; inside.width = alloc.width - insets.left - insets.right; inside.height = alloc.height - insets.top - insets.bottom; return inside; }
10,411
public abstract XMLEventWriter createXMLEventWriter(OutputStream stream) throws XMLStreamException;
public abstract XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException;
10,412
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.XMLInputFactoryImpl(); }
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.XMLInputFactoryImpl(); }
10,413
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.XMLInputFactoryImpl(); }
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.XMLInputFactoryImpl(); }
10,414
public boolean matches(Node node, int pos, int len) { Object ret = expr.evaluate(node, pos, len); if (ret instanceof Double) { // Same as [position() = x] return ((Double) ret).intValue() == pos; } return expr._boolean(node, expr.evaluate(node, pos, len)); }
public boolean matches(Node node, int pos, int len) { Object ret = expr.evaluate(node, pos, len); if (ret instanceof Double) { // Same as [position() = x] return ((Double) ret).intValue() == pos; } return Expr._boolean(node, expr.evaluate(node, pos, len)); }
10,415
protected AccessibleJSplitPane(JSplitPane component) { super(component); // TODO } // AccessibleJSplitPane()
protected AccessibleJSplitPane(JSplitPane component) { super(component); // TODO } // AccessibleJSplitPane()
10,416
public AccessibleRole getAccessibleRole() { return AccessibleRole.SPLIT_PANE; } // getAccessibleRole()
public AccessibleRole getAccessibleRole() { return AccessibleRole.SPLIT_PANE; } // getAccessibleRole()
10,417
public JSplitPane() { // TODO } // JSplitPane()
public JSplitPane() { // TODO } // JSplitPane()
10,418
protected void addImpl(Component value0, Object value1, int value2) { // TODO } // addImpl()
protected void addImpl(Component value0, Object value1, int value2) { // TODO } // addImpl()
10,419
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJSplitPane(this); } // if return accessibleContext; } // getAccessibleContext()
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJSplitPane(this); } // if return accessibleContext; } // getAccessibleContext()
10,420
public Component getBottomComponent() { return null; // TODO } // getBottomComponent()
public Component getBottomComponent() { return null; // TODO } // getBottomComponent()
10,421
public int getDividerLocation() { return 0; // TODO } // getDividerLocation()
public int getDividerLocation() { return 0; // TODO } // getDividerLocation()
10,422
public int getDividerSize() { return 0; // TODO } // getDividerSize()
public int getDividerSize() { return 0; // TODO } // getDividerSize()
10,423
public int getLastDividerLocation() { return 0; // TODO } // getLastDividerLocation()
public int getLastDividerLocation() { return 0; // TODO } // getLastDividerLocation()
10,424
public Component getLeftComponent() { return null; // TODO } // getLeftComponent()
public Component getLeftComponent() { return null; // TODO } // getLeftComponent()
10,425
public int getMaximumDividerLocation() { return 0; // TODO } // getMaximumDividerLocation()
public int getMaximumDividerLocation() { return 0; // TODO } // getMaximumDividerLocation()
10,426
public int getMinimumDividerLocation() { return 0; // TODO } // getMinimumDividerLocation()
public int getMinimumDividerLocation() { return 0; // TODO } // getMinimumDividerLocation()
10,427
public int getOrientation() { return 0; // TODO } // getOrientation()
public int getOrientation() { return 0; // TODO } // getOrientation()
10,428
public double getResizeWeight() { return 0.0; // TODO } // getResizeWeight()
public double getResizeWeight() { return 0.0; // TODO } // getResizeWeight()
10,429
public Component getRightComponent() { return null; // TODO } // getRightComponent()
public Component getRightComponent() { return null; // TODO } // getRightComponent()
10,430
public Component getTopComponent() { return null; // TODO } // getTopComponent()
public Component getTopComponent() { return null; // TODO } // getTopComponent()
10,431
public String getUIClassID() { return uiClassID; } // getUIClassID()
public String getUIClassID() { return uiClassID; } // getUIClassID()
10,432
public boolean isContinuousLayout() { return false; // TODO } // isContinuousLayout()
public boolean isContinuousLayout() { return false; // TODO } // isContinuousLayout()
10,433
public boolean isOneTouchExpandable() { return false; // TODO } // isOneTouchExpandable()
public boolean isOneTouchExpandable() { return false; // TODO } // isOneTouchExpandable()
10,434
public boolean isValidateRoot() { return false; // TODO } // isValidateRoot()
public boolean isValidateRoot() { return false; // TODO } // isValidateRoot()
10,435
protected void paintChildren(Graphics value0) { // TODO } // paintChildren()
protected void paintChildren(Graphics value0) { // TODO } // paintChildren()
10,436
protected String paramString() { return null; // TODO } // paramString()
protected String paramString() { return null; // TODO } // paramString()
10,437
public void remove(Component value0) { // TODO } // remove()
public void remove(Component value0) { // TODO } // remove()
10,438
public void removeAll() { // TODO } // removeAll()
public void removeAll() { // TODO } // removeAll()
10,439
public void resetToPreferredSizes() { // TODO } // resetToPreferredSizes()
public void resetToPreferredSizes() { // TODO } // resetToPreferredSizes()
10,440
public void setBottomComponent(Component value0) { // TODO } // setBottomComponent()
public void setBottomComponent(Component value0) { // TODO } // setBottomComponent()
10,441
public void setContinuousLayout(boolean value0) { // TODO } // setContinuousLayout()
public void setContinuousLayout(boolean value0) { // TODO } // setContinuousLayout()
10,442
public void setDividerLocation(double value0) { // TODO } // setDividerLocation()
public void setDividerLocation(double value0) { // TODO } // setDividerLocation()
10,443
public void setDividerSize(int value0) { // TODO } // setDividerSize()
public void setDividerSize(int value0) { // TODO } // setDividerSize()
10,444
public void setLastDividerLocation(int value0) { // TODO } // setLastDividerLocation()
public void setLastDividerLocation(int value0) { // TODO } // setLastDividerLocation()
10,445
public void setLeftComponent(Component value0) { // TODO } // setLeftComponent()
public void setLeftComponent(Component value0) { // TODO } // setLeftComponent()
10,446
public void setOneTouchExpandable(boolean value0) { // TODO } // setOneTouchExpandable()
public void setOneTouchExpandable(boolean value0) { // TODO } // setOneTouchExpandable()
10,447
public void setOrientation(int value0) { // TODO } // setOrientation()
public void setOrientation(int value0) { // TODO } // setOrientation()
10,448
public void setResizeWeight(double value0) { // TODO } // setResizeWeight()
public void setResizeWeight(double value0) { // TODO } // setResizeWeight()
10,449
public void setRightComponent(Component value0) { // TODO } // setRightComponent()
public void setRightComponent(Component value0) { // TODO } // setRightComponent()
10,450
public void setTopComponent(Component value0) { // TODO } // setTopComponent()
public void setTopComponent(Component value0) { // TODO } // setTopComponent()
10,451
public void updateUI() { setUI((SplitPaneUI) UIManager.get(this)); invalidate(); } // updateUI()
public void updateUI() { setUI((SplitPaneUI) UIManager.get(this)); invalidate(); } // updateUI()
10,452
protected TreeNode[] getPathToRoot(TreeNode node, int depth) { if (node == null) { if (depth == 0) return null; return new TreeNode[depth]; } TreeNode[] path = getPathToRoot(node.getParent(), depth + 1); path[depth] = node; return path; }
protected TreeNode[] getPathToRoot(TreeNode node, int depth) { if (node == null) { if (depth == 0) return null; return new TreeNode[depth]; } TreeNode[] path = getPathToRoot(node.getParent(), depth + 1); path[path.length - depth - 1] = node; return path; }
10,453
public boolean isRoot() { return (parent == null); }
public boolean isRoot() { return parent == null; }
10,454
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
public void endEntity(String name) throws SAXException if ("[dtd]".equals(name) || name.charAt(0) == '%') // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) ctx.appendChild(child); } } else Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
10,457
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
10,458
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
10,459
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
10,460
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
public void endEntity(String name) throws SAXException { if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity Entity entity = popEntity(); // TODO resolve external entities to ensure that entity has content if (expandEntityReferences) { // Get entity content for (Node child = entity.getFirstChild(); child != null; child = child.getNextSibling()) { ctx.appendChild(child); } } else { Node entityReference = doc.createEntityReference(name); ctx.appendChild(entityReference); } }
10,461
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
10,465
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
10,466
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); pushEntity(entity);
10,467
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } pushEntity(entity); }
public void startEntity(String name) throws SAXException { DocumentType doctype = doc.getDoctype(); if (doctype == null) { throw new SAXException("SAX parser error: " + "reference to entity in undeclared doctype"); } if ("[dtd]".equals(name) || name.charAt(0) == '%') { // Ignore DTD and parameter entities ctx = doctype; return; } if ("lt".equals(name) || "gt".equals(name) || "amp".equals(name) || "apos".equals(name) || "quot".equals(name)) { return; } // Get entity NamedNodeMap entities = doctype.getEntities(); Entity entity = (Entity) entities.getNamedItem(name); if (entity == null) { throw new SAXException("SAX parser error: " + "reference to undeclared entity: " + name); } EntityReference ref = doc.createEntityReference(name); Node child = ref.getFirstChild(); while (child != null) { Node nextChild = child.getNextSibling(); ref.removeChild(child); child = nextChild; } ctx.appendChild(ref); ctx = ref; }
10,468
public String getUIClassID() { return "JLabel"; }
public String getUIClassID() { return "JLabel"; }
10,470
protected AbstractGraphics2D() { transform = new AffineTransform(); background = Color.WHITE; composite = AlphaComposite.SrcOver; stroke = new BasicStroke(); HashMap hints = new HashMap(); hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT); hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_DEFAULT); renderingHints = new RenderingHints(hints); pixel = new int[4]; }
protected AbstractGraphics2D() { transform = new AffineTransform(); background = Color.WHITE; composite = AlphaComposite.SrcOver; stroke = new BasicStroke(); HashMap hints = new HashMap(); hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT); hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_DEFAULT); renderingHints = new RenderingHints(hints); }
10,471
public void copyArea(int x, int y, int width, int height, int dx, int dy) { // FIXME: Implement this. throw new UnsupportedOperationException("Not yet implemented"); }
public void copyArea(int x, int y, int width, int height, int dx, int dy) { // FIXME: Implement this. if (isOptimized) rawCopyArea(x, y, width, height, dx, dy); else copyAreaImpl(x, y, width, height, dx, dy); }
10,473
public void drawGlyphVector(GlyphVector gv, float x, float y) { int numGlyphs = gv.getNumGlyphs(); AffineTransform t = new AffineTransform(); t.translate(x, y);// // TODO: We could use fill(gv.getOutline()), but that seems to be // slightly more inefficient. for (int i = 0; i < numGlyphs; i++) { //fill(gv.getGlyphVisualBounds(i)); GeneralPath p = new GeneralPath(gv.getGlyphOutline(i)); p.transform(t); //Shape clipped = clipShape(p); //if (clipped != null) // fillShape(clipped, true); // FIXME: Clipping doesn't seem to work correctly. fillShape(p, true); } }
public void drawGlyphVector(GlyphVector gv, float x, float y) { int numGlyphs = gv.getNumGlyphs(); AffineTransform t = new AffineTransform(); t.translate(x, y);// // TODO: We could use fill(gv.getOutline()), but that seems to be // slightly more inefficient. for (int i = 0; i < numGlyphs; i++) { //fill(gv.getGlyphVisualBounds(i)); GeneralPath p = new GeneralPath(gv.getGlyphOutline(i)); p.transform(t); //Shape clipped = clipShape(p); //if (clipped != null) // fillShape(clipped, true); // FIXME: Clipping doesn't seem to work correctly. fillShape(p, true); } }
10,474
public void drawGlyphVector(GlyphVector gv, float x, float y) { int numGlyphs = gv.getNumGlyphs(); AffineTransform t = new AffineTransform(); t.translate(x, y);// // TODO: We could use fill(gv.getOutline()), but that seems to be // slightly more inefficient. for (int i = 0; i < numGlyphs; i++) { //fill(gv.getGlyphVisualBounds(i)); GeneralPath p = new GeneralPath(gv.getGlyphOutline(i)); p.transform(t); //Shape clipped = clipShape(p); //if (clipped != null) // fillShape(clipped, true); // FIXME: Clipping doesn't seem to work correctly. fillShape(p, true); } }
public void drawGlyphVector(GlyphVector gv, float x, float y) { int numGlyphs = gv.getNumGlyphs(); AffineTransform t = new AffineTransform(); t.translate(x, y);// // TODO: We could use fill(gv.getOutline()), but that seems to be // slightly more inefficient. for (int i = 0; i < numGlyphs; i++) { //fill(gv.getGlyphVisualBounds(i)); GeneralPath p = new GeneralPath(gv.getGlyphOutline(i)); p.transform(t); //Shape clipped = clipShape(p); //if (clipped != null) // fillShape(clipped, true); // FIXME: Clipping doesn't seem to work correctly. fillShape(p, true); } }
10,475
public boolean drawImage(Image image, AffineTransform xform, ImageObserver obs) { // FIXME: Implement this. throw new UnsupportedOperationException("Not yet implemented"); }
public boolean drawImage(Image image, AffineTransform xform, ImageObserver obs) { // FIXME: Implement this. boolean ret = false; Rectangle areaOfInterest = new Rectangle(0, 0, image.getWidth(obs), image.getHeight(obs)); return drawImageImpl(image, xform, obs, areaOfInterest); }
10,477