bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public Node parse(String content, String file) { return parser.parse(file, content); }
public Node parse(Reader content, String file) { return parser.parse(file, content); }
3,227,555
public static synchronized JavaObject wrap(Ruby runtime, Object value) { if (value == null) { return new NullJavaObject(runtime); } JavaObject wrapper = runtime.getJavaSupport().getJavaObjectFromCache(value); if (wrapper == null) { if (value.getClass().isArray()) { wrapper = new JavaArray(runtime, value); } else { wrapper = new JavaObject(runtime, value); } runtime.getJavaSupport().putJavaObjectIntoCache(wrapper); } return wrapper; }
public static synchronized JavaObject wrap(Ruby runtime, Object value) { if (value == null) { return new NullJavaObject(runtime); } JavaObject wrapper = runtime.getJavaSupport().getJavaObjectFromCache(value); if (wrapper == null) { if (value.getClass().isArray()) { wrapper = new JavaArray(runtime, value); } else { wrapper = new JavaObject(runtime, value); } runtime.getJavaSupport().putJavaObjectIntoCache(wrapper); } return wrapper; }
3,227,556
public static synchronized JavaObject wrap(Ruby runtime, Object value) { if (value == null) { return new NullJavaObject(runtime); } JavaObject wrapper = runtime.getJavaSupport().getJavaObjectFromCache(value); if (wrapper == null) { if (value.getClass().isArray()) { wrapper = new JavaArray(runtime, value); } else { wrapper = new JavaObject(runtime, value); } runtime.getJavaSupport().putJavaObjectIntoCache(wrapper); } return wrapper; }
public static synchronized JavaObject wrap(Ruby runtime, Object value) { if (value == null) { return new NullJavaObject(runtime); } JavaObject wrapper = runtime.getJavaSupport().getJavaObjectFromCache(value); if (wrapper == null) { if (value != null && value.getClass().isArray()) { wrapper = new JavaArray(runtime, value); } else { wrapper = new JavaObject(runtime, value); } runtime.getJavaSupport().putJavaObjectIntoCache(wrapper); } return wrapper; }
3,227,557
void showImages(List images) { removeAll(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(Box.createRigidArea(DataManagerUIF.VBOX)); add(componentsPanel); add(Box.createRigidArea(DataManagerUIF.VBOX)); if (images != null && images.size() != 0) { add(buildImagesPanel(images)); setButtonsEnabled(true); } setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10)); repaint(); }
void showImages(List images) { removeAll(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(Box.createRigidArea(DataManagerUIF.VBOX)); add(componentsPanel); add(Box.createRigidArea(DataManagerUIF.VBOX)); if (images != null && images.size() != 0) { add(buildImagesPanel(images)); setButtonsEnabled(true); } setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10)); repaint(); }
3,227,558
public static Code create(String lang) { if (lang == null) { return NIL; } else if (lang.charAt(0) == 'n' || lang.charAt(0) == 'N') { return NONE; } else if (lang.charAt(0) == 'u' || lang.charAt(0) == 'U') { return UTF8; } else if (lang.charAt(0) == 's' || lang.charAt(0) == 'S') { return SJIS; } return NIL; }
public static Code create(String lang) { if (lang == null) { return NIL; } else if (lang.charAt(0) == 'n' || lang.charAt(0) == 'N') { return NONE; } else if (lang.charAt(0) == 'u' || lang.charAt(0) == 'U') { return UTF8; } else if (lang.charAt(0) == 's' || lang.charAt(0) == 'S') { return SJIS; } return NIL; }
3,227,559
public RubyString inspect() { final String regex = pattern.pattern(); final int length = regex.length(); StringBuffer sb = new StringBuffer(length + 2); sb.append('/'); for (int i = 0; i < length; i++) { char c = regex.charAt(i); if (RubyString.isAlnum(c)) { sb.append(c); } else if (c == '/') { sb.append('\\').append(c); } else if (RubyString.isPrint(c)) { sb.append(c); } else if (c == '\n') { sb.append('\\').append('n'); } else if (c == '\r') { sb.append('\\').append('r'); } else if (c == '\t') { sb.append('\\').append('t'); } else if (c == '\f') { sb.append('\\').append('f'); } else if (c == '\u000B') { sb.append('\\').append('v'); } else if (c == '\u0007') { sb.append('\\').append('a'); } else if (c == '\u001B') { sb.append('\\').append('e'); } else { sb.append(new PrintfFormat("\\%.3o").sprintf(c)); } } sb.append('/'); if ((pattern.flags() & Pattern.CASE_INSENSITIVE) > 0) { sb.append('i'); } if ((pattern.flags() & Pattern.DOTALL) > 0) { sb.append('m'); } if ((pattern.flags() & Pattern.COMMENTS) > 0) { sb.append('x'); } return RubyString.newString(getRuntime(), sb.toString()); }
public RubyString inspect() { final String regex = pattern.pattern(); final int length = regex.length(); StringBuffer sb = new StringBuffer(length + 2); sb.append('/'); for (int i = 0; i < length; i++) { char c = regex.charAt(i); if (RubyString.isAlnum(c)) { sb.append(c); } else if (c == '/') { sb.append('\\').append(c); } else if (RubyString.isPrint(c)) { sb.append(c); } else if (c == '\n') { sb.append('\\').append('n'); } else if (c == '\r') { sb.append('\\').append('r'); } else if (c == '\t') { sb.append('\\').append('t'); } else if (c == '\f') { sb.append('\\').append('f'); } else if (c == '\u000B') { sb.append('\\').append('v'); } else if (c == '\u0007') { sb.append('\\').append('a'); } else if (c == '\u001B') { sb.append('\\').append('e'); } else { sb.append(new PrintfFormat("\\%.3o").sprintf(c)); } } sb.append('/'); if ((pattern.flags() & Pattern.CASE_INSENSITIVE) > 0) { sb.append('i'); } if ((pattern.flags() & Pattern.DOTALL) > 0) { sb.append('m'); } if ((pattern.flags() & Pattern.COMMENTS) > 0) { sb.append('x'); } return RubyString.newString(getRuntime(), sb.toString()); }
3,227,562
public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
public String sprintf(Object[] o) { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
3,227,564
public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
public String sprintf(int x) throws IllegalArgumentException { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { if (cs.isPositionalSpecification()) { i = cs.getArgumentPosition() - 1; } if (cs.isPositionalFieldWidth()) { int ifw = cs.getArgumentPositionForFieldWidth() - 1; cs.setFieldWidthWithArg(((Number) o[ifw]).intValue()); } else if (cs.isVariableFieldWidth() && !cs.isPositionalSpecification()) { cs.setFieldWidthWithArg(((Number) o[i]).intValue()); i++; } if (cs.isPositionalPrecision()) { int ipr = cs.getArgumentPositionForPrecision() - 1; cs.setPrecisionWithArg(((Number) o[ipr]).intValue()); } else if (cs.isVariablePrecision() && !cs.isPositionalSpecification()) { cs.setPrecisionWithArg(((Number) o[i]).intValue()); i++; } if (o[i] == null) { } else if (o[i] instanceof Byte) { sb.append(cs.internalsprintf(((Byte) o[i]).byteValue())); } else if (o[i] instanceof Short) { sb.append(cs.internalsprintf(((Short) o[i]).shortValue())); } else if (o[i] instanceof Integer) { sb.append(cs.internalsprintf(((Integer) o[i]).intValue())); } else if (o[i] instanceof Long) { sb.append(cs.internalsprintf(((Long) o[i]).longValue())); } else if (o[i] instanceof Float) { sb.append(cs.internalsprintf(((Float) o[i]).floatValue())); } else if (o[i] instanceof Double) { sb.append(cs.internalsprintf(((Double) o[i]).doubleValue())); } else if (o[i] instanceof Character) { sb.append(cs.internalsprintf(((Character) o[i]).charValue())); } else if (o[i] instanceof String) { sb.append(cs.internalsprintf((String) o[i])); } else { sb.append(cs.internalsprintf(o[i])); } i++; } } return sb.toString(); }
3,227,565
public static RubyClass createIntegerClass(Ruby ruby) { RubyClass integerClass = ruby.defineClass("Integer", ruby.getClasses().getNumericClass()); integerClass.defineMethod("chr", CallbackFactory.getMethod(RubyInteger.class, "chr")); integerClass.defineMethod("integer?", CallbackFactory.getMethod(RubyInteger.class, "int_p")); integerClass.defineMethod("to_i", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("to_int", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("ceil", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("floor", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("round", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("truncate", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("next", CallbackFactory.getMethod(RubyInteger.class, "succ")); integerClass.defineMethod("succ", CallbackFactory.getMethod(RubyInteger.class, "succ")); integerClass.defineMethod("downto", CallbackFactory.getMethod(RubyInteger.class, "downto", RubyNumeric.class)); integerClass.defineMethod( "step", CallbackFactory.getMethod(RubyInteger.class, "step", RubyNumeric.class, RubyNumeric.class)); integerClass.defineMethod("times", CallbackFactory.getMethod(RubyInteger.class, "times")); integerClass.defineMethod("upto", CallbackFactory.getMethod(RubyInteger.class, "upto", RubyNumeric.class)); return integerClass; }
public static RubyClass createIntegerClass(Ruby ruby) { RubyClass integerClass = ruby.defineClass("Integer", ruby.getClasses().getNumericClass()); integerClass.defineMethod("chr", CallbackFactory.getMethod(RubyInteger.class, "chr")); integerClass.defineMethod("integer?", CallbackFactory.getMethod(RubyInteger.class, "int_p")); integerClass.defineMethod("to_i", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("to_int", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("ceil", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("floor", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("round", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("truncate", CallbackFactory.getMethod(RubyInteger.class, "to_i")); integerClass.defineMethod("next", CallbackFactory.getMethod(RubyInteger.class, "succ")); integerClass.defineMethod("succ", CallbackFactory.getMethod(RubyInteger.class, "succ")); integerClass.defineMethod("downto", CallbackFactory.getMethod(RubyInteger.class, "downto", RubyNumeric.class)); integerClass.defineMethod( "step", CallbackFactory.getMethod(RubyInteger.class, "step", RubyNumeric.class, RubyNumeric.class)); integerClass.defineMethod("times", CallbackFactory.getMethod(RubyInteger.class, "times")); integerClass.defineMethod("upto", CallbackFactory.getMethod(RubyInteger.class, "upto", RubyNumeric.class)); return integerClass; }
3,227,566
public RubyRegexp(Ruby ruby) { super(ruby, ruby.getRubyClass("Regexp")); try { matcher = (IRegexpAdapter) ruby.getRegexpAdapterClass().newInstance(); } catch (Exception ex) { // can't happen if JRuby is invoked via Main class throw new RubyBugException("Couldn't create regexp adapter"); } }
public RubyRegexp(Ruby ruby) { super(ruby, ruby.getRubyClass("Regexp")); try { matcher = (IRegexpAdapter) ruby.getRegexpAdapterClass().newInstance(); } catch (Exception ex) { // can't happen if JRuby is invoked via Main class Asserts.assertNotReached("Couldn't create regexp adapter"); } }
3,227,567
public IRubyObject upto(IRubyObject str, boolean excl) { RubyString current = this; RubyString end = stringValue(str); while (current.cmp(end) <= 0) { getRuntime().yield(current); if (current.cmp(end) == 0) { break; } current = current.succ(false); if (excl && current.cmp(end) == 0) { break; } if (current.getValue().length() > end.getValue().length()) { break; } } return this; }
public IRubyObject upto(IRubyObject str, boolean excl) { RubyString current = this; RubyString end = stringValue(str); while (current.cmp(end) <= 0) { getRuntime().yield(current); if (current.cmp(end) == 0) { break; } current = current.succ(false); if (excl && current.cmp(end) == 0) { break; } if (current.getValue().length() > end.getValue().length()) { break; } } return this; }
3,227,569
public RangeError(Ruby ruby, String msg) { super(ruby, ruby.getExceptions().getNameError(), msg); }
public RangeError(Ruby ruby, String msg) { super(ruby, ruby.getExceptions().getRangeError(), msg); }
3,227,570
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("Foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("Foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "Foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("#foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("Foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "Foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
3,227,572
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("Foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("Foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "Foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("Foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("#foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "Foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
3,227,573
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("Foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("Foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "Foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (limit instanceof Macro) limit = ((Macro) limit).evaluate(context); if (Expression.isNumber(limit)) loopLimit = Expression.numberValue(limit); else throw new ContextException("Foreach: Cannot evaluate limit"); } if (index != null && indexFromExpr != null) { from = indexFromExpr; while (from instanceof Macro) from = ((Macro) from).evaluate(context); if (Expression.isNumber(from)) loopStart = Expression.numberValue(from); else throw new ContextException("Foreach: Cannot evaluate loop start"); } try { if (l instanceof Object[]) { Object[] alist = (Object[]) l; for (int i = 0; i < alist.length; i++) { target.setValue(context, alist[i]); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } else { Iterator iter; try { iter = PropertyOperator.getIterator(l); } catch (Exception e) { throw new ContextException("The object used as the list of values in a foreach statement must have some way of returning a list type, or be a list type itself. See the documentation for PropertyOperator.getIterator() for more details. No such property was found on the supplied object: " + l + ": ", e); } while(iter.hasNext()) { target.setValue(context, iter.next()); if (index != null) index.setValue(context, new Long(loopIndex + loopStart)); body.write(out, context); ++loopIndex; if (loopLimit > 0 && loopIndex >= loopLimit) break; } } } catch (ContextException e) { String errorText = "#foreach: Unable to set list index"; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
3,227,574
public Object getArg(int argId, BuildContext bc) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
public Object getArg(int argId) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
3,227,575
public Object getArg(int argId, BuildContext bc) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
public Object getArg(int argId, BuildContext bc) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
3,227,576
public static void createObjectClass(RubyModule kernelModule) { // TODO: convert to CallbackFactory invokes. Callback clone = new ReflectionCallbackMethod(RubyObject.class, "rbClone"); Callback dup = new ReflectionCallbackMethod(RubyObject.class, "dup"); Callback equal = new ReflectionCallbackMethod(RubyObject.class, "equal", RubyObject.class); Callback respond_to = new ReflectionCallbackMethod(RubyObject.class, "respond_to", RubySymbol.class); Callback extend = new ReflectionCallbackMethod(RubyObject.class, "extend", RubyObject[].class, true); Callback freeze = new ReflectionCallbackMethod(RubyObject.class, "freeze"); Callback frozen = new ReflectionCallbackMethod(RubyObject.class, "frozen"); Callback id = new ReflectionCallbackMethod(RubyObject.class, "id"); Callback inspect = new ReflectionCallbackMethod(RubyObject.class, "inspect"); Callback instance_eval = new ReflectionCallbackMethod(RubyObject.class, "instance_eval", RubyObject[].class, true); Callback instance_of = new ReflectionCallbackMethod(RubyObject.class, "instance_of", RubyModule.class); Callback kind_of = new ReflectionCallbackMethod(RubyObject.class, "kind_of", RubyModule.class); Callback method = new ReflectionCallbackMethod(RubyObject.class, "method", RubyObject.class); Callback methods = new ReflectionCallbackMethod(RubyObject.class, "methods"); Callback private_methods = new ReflectionCallbackMethod(RubyObject.class, "private_methods"); Callback protected_methods = new ReflectionCallbackMethod(RubyObject.class, "protected_methods"); Callback taint = new ReflectionCallbackMethod(RubyObject.class, "taint"); Callback tainted = new ReflectionCallbackMethod(RubyObject.class, "tainted"); Callback to_a = new ReflectionCallbackMethod(RubyObject.class, "to_a"); Callback to_s = new ReflectionCallbackMethod(RubyObject.class, "to_s"); Callback type = new ReflectionCallbackMethod(RubyObject.class, "type"); Callback untaint = new ReflectionCallbackMethod(RubyObject.class, "untaint"); kernelModule.defineMethod("=~", CallbackFactory.getFalseMethod()); kernelModule.defineMethod("==", equal); kernelModule.defineMethod("respond_to?", respond_to); kernelModule.defineMethod("class", type); kernelModule.defineMethod("clone", clone); kernelModule.defineMethod("dup", dup); kernelModule.defineMethod("eql?", equal); kernelModule.defineMethod("extend", extend); kernelModule.defineMethod("freeze", freeze); kernelModule.defineMethod("frozen?", frozen); kernelModule.defineMethod("hash", id); kernelModule.defineMethod("id", id); kernelModule.defineMethod("__id__", id); kernelModule.defineMethod("inspect", inspect); kernelModule.defineMethod("instance_eval", instance_eval); kernelModule.defineMethod("instance_of?", instance_of); kernelModule.defineMethod("is_a?", kind_of); kernelModule.defineMethod("kind_of?", kind_of); kernelModule.defineMethod("method", method); kernelModule.defineMethod("methods", methods); kernelModule.defineMethod("private_methods", private_methods); kernelModule.defineMethod("protected_methods", protected_methods); kernelModule.defineMethod("public_methods", methods); kernelModule.defineMethod("nil?", CallbackFactory.getFalseMethod()); kernelModule.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyString.class)); kernelModule.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyString.class)); kernelModule.defineMethod("taint", taint); kernelModule.defineMethod("tainted?", tainted); kernelModule.defineMethod("to_a", to_a); kernelModule.defineMethod("to_s", to_s); kernelModule.defineMethod("type", type); kernelModule.defineMethod("untaint", untaint); kernelModule.defineAlias("===", "=="); kernelModule.defineAlias("equal?", "=="); Ruby ruby = kernelModule.getRuby(); ruby.defineGlobalFunction("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", RubyObject.class)); }
public static void createObjectClass(RubyModule kernelModule) { // TODO: convert to CallbackFactory invokes. Callback clone = new ReflectionCallbackMethod(RubyObject.class, "rbClone"); Callback dup = new ReflectionCallbackMethod(RubyObject.class, "dup"); Callback equal = new ReflectionCallbackMethod(RubyObject.class, "equal", RubyObject.class); Callback respond_to = new ReflectionCallbackMethod(RubyObject.class, "respond_to", RubySymbol.class); Callback extend = new ReflectionCallbackMethod(RubyObject.class, "extend", RubyObject[].class, true); Callback freeze = new ReflectionCallbackMethod(RubyObject.class, "freeze"); Callback frozen = new ReflectionCallbackMethod(RubyObject.class, "frozen"); Callback id = new ReflectionCallbackMethod(RubyObject.class, "id"); Callback inspect = new ReflectionCallbackMethod(RubyObject.class, "inspect"); Callback instance_eval = new ReflectionCallbackMethod(RubyObject.class, "instance_eval", RubyObject[].class, true); Callback instance_of = new ReflectionCallbackMethod(RubyObject.class, "instance_of", RubyModule.class); Callback kind_of = new ReflectionCallbackMethod(RubyObject.class, "kind_of", RubyModule.class); Callback method = new ReflectionCallbackMethod(RubyObject.class, "method", RubyObject.class); Callback methods = new ReflectionCallbackMethod(RubyObject.class, "methods"); Callback private_methods = new ReflectionCallbackMethod(RubyObject.class, "private_methods"); Callback protected_methods = new ReflectionCallbackMethod(RubyObject.class, "protected_methods"); Callback taint = new ReflectionCallbackMethod(RubyObject.class, "taint"); Callback tainted = new ReflectionCallbackMethod(RubyObject.class, "tainted"); Callback to_a = new ReflectionCallbackMethod(RubyObject.class, "to_a"); Callback to_s = new ReflectionCallbackMethod(RubyObject.class, "to_s"); Callback type = new ReflectionCallbackMethod(RubyObject.class, "type"); Callback untaint = new ReflectionCallbackMethod(RubyObject.class, "untaint"); kernelModule.defineMethod("=~", CallbackFactory.getFalseMethod()); kernelModule.defineMethod("==", equal); kernelModule.defineMethod("respond_to?", respond_to); kernelModule.defineMethod("class", type); kernelModule.defineMethod("clone", clone); kernelModule.defineMethod("dup", dup); kernelModule.defineMethod("eql?", equal); kernelModule.defineMethod("extend", extend); kernelModule.defineMethod("freeze", freeze); kernelModule.defineMethod("frozen?", frozen); kernelModule.defineMethod("hash", id); kernelModule.defineMethod("id", id); kernelModule.defineMethod("__id__", id); kernelModule.defineMethod("inspect", inspect); kernelModule.defineMethod("instance_eval", instance_eval); kernelModule.defineMethod("instance_of?", instance_of); kernelModule.defineMethod("is_a?", kind_of); kernelModule.defineMethod("kind_of?", kind_of); kernelModule.defineMethod("method", method); kernelModule.defineMethod("methods", methods); kernelModule.defineMethod("private_methods", private_methods); kernelModule.defineMethod("protected_methods", protected_methods); kernelModule.defineMethod("public_methods", methods); kernelModule.defineMethod("nil?", CallbackFactory.getFalseMethod()); kernelModule.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyString.class)); kernelModule.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyString.class)); kernelModule.defineMethod("taint", taint); kernelModule.defineMethod("tainted?", tainted); kernelModule.defineMethod("to_a", to_a); kernelModule.defineMethod("to_s", to_s); kernelModule.defineMethod("type", type); kernelModule.defineMethod("untaint", untaint); kernelModule.defineAlias("===", "=="); kernelModule.defineAlias("equal?", "=="); Ruby ruby = kernelModule.getRuby(); ruby.defineGlobalFunction("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", RubyObject.class)); }
3,227,577
public RubyBoolean kind_of(RubyModule type) { RubyClass currType = getRubyClass(); while (currType != null) { if (currType == type || currType.getMethods().keySet().retainAll(type.getMethods().keySet())) { return getRuby().getTrue(); } currType = currType.getSuperClass(); } return getRuby().getFalse(); }
public RubyBoolean kind_of(RubyModule type) { RubyClass currType = getRubyClass(); while (currType != null) { if (currType == type || currType.getMethods().keySet().containsAll(type.getMethods().keySet())) { return getRuby().getTrue(); } currType = currType.getSuperClass(); } return getRuby().getFalse(); }
3,227,578
public RubyObject method_missing(RubyObject symbol, RubyObject[] args) { // +++ // IMPLEMENT THIS METHOD // --- Ruby ruby = getRuby(); throw new NameError( ruby, ruby.getSourceFile() + ":" + ruby.getSourceLine() + " undefined method '" + symbol.toId() + "' for " + type().toName()); }
public RubyObject method_missing(RubyObject symbol, RubyObject[] args) { // +++ // IMPLEMENT THIS METHOD // --- Ruby ruby = getRuby(); throw new NameError( ruby, ruby.getSourceFile() + ":" + ruby.getSourceLine() + " undefined method '" + symbol.toId() + "' for '" + type().toName() + '\''); }
3,227,579
public RubyObject send(RubyString method, RubyObject[] args) { try { getRuby().getIter().push(getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); return getRubyClass().call(this, method.getValue(), new RubyPointer(args), 1); } finally { getRuby().getIter().pop(); } }
public RubyObject send(RubyObject method, RubyObject[] args) { try { getRuby().getIter().push(getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); return getRubyClass().call(this, method.getValue(), new RubyPointer(args), 1); } finally { getRuby().getIter().pop(); } }
3,227,580
public RubyObject send(RubyString method, RubyObject[] args) { try { getRuby().getIter().push(getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); return getRubyClass().call(this, method.getValue(), new RubyPointer(args), 1); } finally { getRuby().getIter().pop(); } }
public RubyObject send(RubyString method, RubyObject[] args) { try { getRuby().getIter().push(getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); return getRubyClass().call(this, method.toId(), new RubyPointer(args), 1); } finally { getRuby().getIter().pop(); } }
3,227,581
public static Callback getFalseMethod() { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return ruby.getFalse(); } }; }
public static Callback getFalseMethod(final int arity) { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return ruby.getFalse(); } }; }
3,227,582
public IRubyObject eval(IRubyObject src, IRubyObject scope, String file, int line) { ThreadContext threadContext = runtime.getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); Iter iter = threadContext.getCurrentFrame().getIter(); if (file == null) { file = threadContext.getSourceFile(); } if (scope.isNil()) { FrameStack frameStack = threadContext.getFrameStack(); if (frameStack.getPrevious() != null) { ((Frame) frameStack.peek()).setIter(frameStack.getPrevious().getIter()); } } threadContext.pushClass(threadContext.getCBase()); IRubyObject result = getRuntime().getNil(); try { INode node = getRuntime().parse(src.toString(), file); result = eval(node); } finally { threadContext.popClass(); if (scope.isNil()) { threadContext.getCurrentFrame().setIter(iter); } threadContext.setPosition(savedPosition); } return result; }
public IRubyObject eval(IRubyObject src, IRubyObject scope, String file, int line) { ThreadContext threadContext = runtime.getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); Iter iter = threadContext.getCurrentFrame().getIter(); if (file == null) { file = threadContext.getSourceFile(); } if (scope.isNil()) { FrameStack frameStack = threadContext.getFrameStack(); if (frameStack.getPrevious() != null) { ((Frame) frameStack.peek()).setIter(frameStack.getPrevious().getIter()); } } threadContext.pushClass(threadContext.getCBase()); IRubyObject result = getRuntime().getNil(); try { INode node = getRuntime().parse(src.toString(), file); result = eval(node); } finally { threadContext.popClass(); if (scope.isNil()) { threadContext.getCurrentFrame().setIter(iter); } threadContext.setPosition(savedPosition); } return result; }
3,227,584
public NODE searchMethod(RubyId id) { RubyModule rubyModule = getMethodOrigin(id); if (rubyModule != null) { return (NODE)rubyModule.getMethods().get(id); } return null; }
public NODE searchMethod(RubyId id) { RubyModule rubyModule = getMethodOrigin(id); if (rubyModule != null) { return (NODE)rubyModule.getMethods().get(id); } return null; }
3,227,585
public NODE searchMethod(RubyId id) { RubyModule rubyModule = getMethodOrigin(id); if (rubyModule != null) { return (NODE)rubyModule.getMethods().get(id); } return null; }
public NODE searchMethod(RubyId id) { RubyModule rubyModule = getMethodOrigin(id); if (rubyModule != null) { return (NODE)rubyModule.getMethods().get(id); } }
3,227,586
public RubyModule getSingletonClassClone() { if (!isSingleton()) { return this; } RubyModule clone = new RubyClass(getRuby(), null, getSuperClass()); clone.setupClone(this); clone.setInstanceVariables(getInstanceVariables().cloneRubyMap()); //clone.setMethods(); // st_foreach(RCLASS(klass)->m_tbl, clone_method, clone->m_tbl); clone.setSingleton(true); return clone; }
public RubyModule getSingletonClassClone() { if (!isSingleton()) { return this; } RubyModule clone = new RubyClass(getRuby(), getSuperClass()); clone.setupClone(this); clone.setInstanceVariables(getInstanceVariables().cloneRubyMap()); //clone.setMethods(); // st_foreach(RCLASS(klass)->m_tbl, clone_method, clone->m_tbl); clone.setSingleton(true); return clone; }
3,227,587
public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
public RubyFixnum hash() { return getRuntime().newFixnum(value.hashCode()); }
3,227,588
public abstract RubyNumeric multiplyWith(RubyInteger value);
public abstract RubyNumeric multiplyWith(RubyInteger value);
3,227,589
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object o = builder.getArg(PARSE_TEMPLATE, bc); if (o instanceof Macro) { template = (Macro) o; return this; } else try { return bc.getBroker().get("template", o.toString()); } catch (NotFoundException ne) { throw new BuildException("Template " + o + " not found: ", ne); } }
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object o = builder.getArg(PARSE_TEMPLATE, bc); if (o instanceof Macro) { template = (Macro) o; return this; } else try { return bc.getBroker().get("template", o.toString()); } catch (NotFoundException ne) { throw new BuildException("#parse: Template " + o + " not found: ", ne); } }
3,227,591
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "Error reading template: " + fname; context.getLog("engine").warning(warning, e); writeWarning(warning, out); } catch (Exception e) { String warning = "Template not found: " + fname; context.getLog("engine").warning(warning,e); writeWarning(warning, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "#parse: Error reading template: " + fname; context.getLog("engine").warning(warning, e); writeWarning(warning, out); } catch (Exception e) { String warning = "Template not found: " + fname; context.getLog("engine").warning(warning,e); writeWarning(warning, out); } }
3,227,592
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "Error reading template: " + fname; context.getLog("engine").warning(warning, e); writeWarning(warning, out); } catch (Exception e) { String warning = "Template not found: " + fname; context.getLog("engine").warning(warning,e); writeWarning(warning, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "Error reading template: " + fname; context.getLog("engine").warning(warning, e); writeWarning(warning, out); } catch (Exception e) { String warning = "#parse: Template not found: " + fname; context.getLog("engine").warning(warning,e); writeWarning(warning, out); } }
3,227,593
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
3,227,594
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
protected String getFile(Broker b, String name) throws PropertyException { try { url = b.getResource(name); if (url == null) throw makePropertyException("Resource not found by URL provider or Broker"); URLConnection conn = url.openConnection(); StringBuffer sb = new StringBuffer (); InputStream in = conn.getInputStream(); String enc = conn.getContentEncoding(); if (enc == null) enc = b.getSetting("TemplateEncoding"); int cnt=0; byte[] buff = new byte[4096]; while ( (cnt = in.read(buff)) > 0) { sb.append (new String (buff, 0, cnt, enc)); } in.close(); return sb.toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us url = b.getResource(name); if (url == null) throw makePropertyException("Resource not found by URL provider or Broker"); URLConnection conn = url.openConnection(); StringBuffer sb = new StringBuffer (); InputStream in = conn.getInputStream(); String enc = conn.getContentEncoding(); if (enc == null) enc = b.getSetting("TemplateEncoding"); int cnt=0; byte[] buff = new byte[4096]; while ( (cnt = in.read(buff)) > 0) { sb.append (new String (buff, 0, cnt, enc)); } in.close(); return sb.toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
3,227,595
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
3,227,596
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us return b.get("url", name).toString(); } catch (NullPointerException npe) { throw npe; } catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from url provider", e); } }
3,227,597
public void setSelected(boolean v) { if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); LinkTarget startTarget = getStartLinkTarget(); LinkTarget endTarget = getEndLinkTarget(); startTarget.setSelected(v); endTarget.setSelected(v); targets.removeAllChildren(); if (v == true) { // set up children bulb.setPaint(Constants.LINK_HIGHLIGHT_COLOR); targets.setVisible(true); int count = points.size(); for (int i = 1; i < count-1; i++) { LinkSelectionTarget t = new LinkSelectionTarget(this,i); targets.addChild(t); Point2D pt = (Point2D) points.get(i); t.setOffset((float)pt.getX()-Constants.LINK_TARGET_HALF_SIZE, (float)pt.getY()-Constants.LINK_TARGET_HALF_SIZE); t.setSelected(v); } } else bulb.setPaint(Constants.DEFAULT_COLOR); repaint(); }
public void setSelected(boolean v) { if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); LinkTarget startTarget = getStartLinkTarget(); LinkTarget endTarget = getEndLinkTarget(); startTarget.setSelected(v); endTarget.setSelected(v); targets.removeAllChildren(); if (v == true) { // set up children bulb.setPaint(Constants.LINK_HIGHLIGHT_COLOR); targets.setVisible(true); int count = points.size(); for (int i = 1; i < count-1; i++) { LinkSelectionTarget t = new LinkSelectionTarget(this,i); targets.addChild(t); Point2D pt = (Point2D) points.get(i); t.setOffset((float)pt.getX()-Constants.LINK_TARGET_HALF_SIZE, (float)pt.getY()-Constants.LINK_TARGET_HALF_SIZE); t.setSelected(v); } } else bulb.setPaint(Constants.DEFAULT_COLOR); repaint(); }
3,227,598
public void execute() throws BuildException { Map fileMap = new HashMap(); FileNameMapper mapper = null; if (mapperElement != null) { mapper = mapperElement.getImplementation(); } else { mapper = new GlobPatternMapper(); mapper.setFrom("*.rb"); mapper.setTo("*.rb.ast.ser"); } SourceFileScanner sfs = new SourceFileScanner(this); for (int i = 0, size = fileSets.size(); i < size; i++) { FileSet fs = (FileSet) fileSets.get(i); DirectoryScanner ds = fs.getDirectoryScanner(project); File dir = fs.getDir(project); String[] files = ds.getIncludedFiles(); files = sfs.restrict(files, dir, destdir, mapper); for (int j = 0; j < files.length; j++) { File src = new File(dir, files[j]); File dest = new File(destdir, mapper.mapFileName(files[j])[0]); fileMap.put(src, dest); } } if (fileMap.size() > 0) { log( "Serializing " + fileMap.size() + " file" + (fileMap.size() == 1 ? "" : "s") + " to " + destdir.getAbsolutePath()); Iterator iter = fileMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); try { ((File) entry.getValue()).mkdirs(); ASTSerializer.serialize((File) entry.getKey(), (File) entry.getValue()); } catch (IOException ioExcpn) { } } } }
public void execute() throws BuildException { Map fileMap = new HashMap(); FileNameMapper mapper = null; if (mapperElement != null) { mapper = mapperElement.getImplementation(); } else { mapper = new GlobPatternMapper(); mapper.setFrom("*.rb"); mapper.setTo("*.rb.ast.ser"); } SourceFileScanner sfs = new SourceFileScanner(this); for (int i = 0, size = fileSets.size(); i < size; i++) { FileSet fs = (FileSet) fileSets.get(i); DirectoryScanner ds = fs.getDirectoryScanner(project); File dir = fs.getDir(project); String[] files = ds.getIncludedFiles(); files = sfs.restrict(files, dir, destdir, mapper); for (int j = 0; j < files.length; j++) { File src = new File(dir, files[j]); File dest = new File(destdir, mapper.mapFileName(files[j])[0]); fileMap.put(src, dest); } } if (fileMap.size() > 0) { log( "Serializing " + fileMap.size() + " file" + (fileMap.size() == 1 ? "" : "s") + " to " + destdir.getAbsolutePath()); Iterator iter = fileMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); try { ((File) entry.getValue()).getParentFile().mkdirs(); ASTSerializer.serialize((File) entry.getKey(), (File) entry.getValue()); } catch (IOException ioExcpn) { } } } }
3,227,599
public void addClassData(ClassData classData) { // this method aggregates data if classData is an inner class // with the data from the top level class that it is contained in LOGGER.debug("addClassData: " + classData.getName()); String parentClassName = getClassNameIgnoreInner(classData.getName()); LOGGER.debug("\tparentClassName = " + parentClassName); String keyName = new ClassData(parentClassName).getBaseName(); LOGGER.debug("\tkeyName = " + keyName); ClassData parent = getClassData(classData.getName()); if (parent == null) { LOGGER.debug("\tno parent"); parent = new ClassData(parentClassName); } classData.merge(parent); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. LOGGER.debug("putting " + keyName + " = " + classData.getName()); children.put(keyName, classData); }
public void addClassData(ClassData classData) { // this method aggregates data if classData is an inner class // with the data from the top level class that it is contained in LOGGER.debug("addClassData: " + classData.getName()); String parentClassName = getClassNameIgnoreInner(classData.getName()); LOGGER.debug("\tparentClassName = " + parentClassName); String keyName = new ClassData(parentClassName).getBaseName(); LOGGER.debug("\tkeyName = " + keyName); ClassData parent = getClassData(classData.getName()); if (parent == null) { LOGGER.debug("\tno parent"); parent = new ClassData(parentClassName); } classData.merge(parent); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. LOGGER.debug("putting " + keyName + " = " + classData.getName()); children.put(keyName, classData); }
3,227,600
public void create() { super.create(); delegate = (IPojos) applicationContext.getBean( IPojos.class.getName()); }
public void create() { super.create(); delegate = (IPojos) applicationContext.getBean( IPojos.class.getName()); }
3,227,601
public Object invoke( InvocationContext context ) throws Exception { return wrap( context, "&pojosService" ); }
public Object invoke( InvocationContext context ) throws Exception { return wrap( context, IPojos.class ); }
3,227,602
public static IRubyObject each_object(IRubyObject recv, IRubyObject[] args) { RubyModule rubyClass; if (args.length == 0) { rubyClass = recv.getRuntime().getObject(); } else { rubyClass = (RubyModule) args[0]; } int count = 0; Iterator iter = recv.getRuntime().getObjectSpace().iterator(rubyClass); while (iter.hasNext()) { count++; recv.getRuntime().getCurrentContext().yield(((IRubyObject) iter.next())); } return recv.getRuntime().newFixnum(count); }
public static IRubyObject each_object(IRubyObject recv, IRubyObject[] args) { RubyModule rubyClass; if (args.length == 0) { rubyClass = recv.getRuntime().getObject(); } else { rubyClass = (RubyModule) args[0]; } int count = 0; Iterator iter = recv.getRuntime().getObjectSpace().iterator(rubyClass); IRubyObject obj = null; while ((obj = (IRubyObject)iter.next()) != null) { count++; recv.getRuntime().getCurrentContext().yield(((IRubyObject) iter.next())); } return recv.getRuntime().newFixnum(count); }
3,227,603
public static IRubyObject each_object(IRubyObject recv, IRubyObject[] args) { RubyModule rubyClass; if (args.length == 0) { rubyClass = recv.getRuntime().getObject(); } else { rubyClass = (RubyModule) args[0]; } int count = 0; Iterator iter = recv.getRuntime().getObjectSpace().iterator(rubyClass); while (iter.hasNext()) { count++; recv.getRuntime().getCurrentContext().yield(((IRubyObject) iter.next())); } return recv.getRuntime().newFixnum(count); }
public static IRubyObject each_object(IRubyObject recv, IRubyObject[] args) { RubyModule rubyClass; if (args.length == 0) { rubyClass = recv.getRuntime().getObject(); } else { rubyClass = (RubyModule) args[0]; } int count = 0; Iterator iter = recv.getRuntime().getObjectSpace().iterator(rubyClass); while (iter.hasNext()) { count++; recv.getRuntime().getCurrentContext().yield(obj); } return recv.getRuntime().newFixnum(count); }
3,227,604
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
3,227,605
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
3,227,606
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG_TIMING) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
3,227,607
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
3,227,608
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
public void layoutContents() { // the current chain LayoutChainData chain; PaletteChainView view; Collection chains = dataManager.getChains(); long start; long end; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ArrayList views = buildChainViews(chains); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("in chain layout contents. time for chain view "+end); } int num = views.size(); // The display should be roughly square, // in terms of the number of rows vs. # of columns rowSize = (int) Math.floor(Math.sqrt(num)); count=0; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); // draw each of them. Iterator iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); ChainBox box = buildChain(view); if (box != null) { placeChain(box); } } if (x > maxRowWidth) { maxRowWidth = x; } if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for boxes and placing.."+end); } // fix up the last row. row.setHeight(rowHeight); rows.add(row); start = System.currentTimeMillis(); adjustSizes(); if (ChainBuilderAgent.DEBUG) { end = System.currentTimeMillis()-start; System.err.println("time for adjusting size.."+end); } }
3,227,609
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
3,227,610
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
3,227,611
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
private void scaleAreas(ArrayList views) { PaletteChainView view; Collections.sort(views); /* // get smallest area PaletteChainView smallest= (PaletteChainView) views.get(0); double logSmallestArea = Math.log(smallest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = 3*logArea/logSmallestArea; newArea = smallest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); System.err.println("\nchain..."+view.getChain().getName()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); double newWidth = scale*view.getWidth(); System.err.println(" scaled width is "+newWidth); }*/ // get largest area PaletteChainView largest= (PaletteChainView) views.get(views.size()-1); if (ChainBuilderAgent.DEBUG) { System.err.println("largest chain is "+largest.getChain().getName()+ ", area is "+largest.getArea()); System.err.println("largest width is "+largest.getWidth()+","+largest.getHeight()); } double logLargestArea = Math.log(largest.getArea()); double logArea; double ratio; double newArea; double scale; Iterator iter = views.iterator(); iter = views.iterator(); while (iter.hasNext()) { view = (PaletteChainView) iter.next(); logArea = Math.log(view.getArea()); ratio = logArea/logLargestArea; newArea = largest.getArea()*ratio; scale = newArea/view.getArea(); view.setScale(scale); if (ChainBuilderAgent.DEBUG) { System.err.println("\nchain..."+view.getChain().getName()); System.err.println("original area is "+view.getArea()); System.err.println("chain width is "+view.getWidth()); System.err.println(" scale is "+scale); } double newWidth = scale*view.getWidth(); if (ChainBuilderAgent.DEBUG) { System.err.println(" scaled width is "+newWidth); System.err.println("new area is "+newArea); } } }
3,227,612
public PaletteChainView(LayoutChainData chain,ChainDataManager dataManager) { super(chain); this.registry = dataManager.getRegistry(); this.executions = dataManager.getChainExecutionsByChainID(chain.getID()); if (executions != null) { System.err.println("palette chain.."+chain.getName()+"...executions.." +executions.size()); } drawChain(); setPickable(false); }
public PaletteChainView(LayoutChainData chain,ChainDataManager dataManager) { super(chain); this.registry = dataManager.getRegistry(); this.executions = dataManager.getChainExecutionsByChainID(chain.getID()); if (executions != null) { System.err.println("palette chain.."+chain.getName()+"...executions.." +executions.size()); } drawChain(); setPickable(false); }
3,227,613
private void rest() { serviceNotificationErrorCalled = false; }
private void rest() { notificationCalled = false; }
3,227,614
public void serviceNotificationError(ServiceMonitor serviceMonitor, ServiceEvent serviceEvent, Throwable throwable) { assertFalse(serviceNotificationErrorCalled); serviceNotificationErrorCalled = true; assertSame(SERVICE_MONITOR, serviceMonitor); assertSame(SERVICE_EVENT, serviceEvent); assertSame(THROWABLE, throwable); }
public void serviceNotificationError(ServiceMonitor serviceMonitor, ServiceEvent serviceEvent, Throwable throwable) { assertFalse(serviceNotificationErrorCalled); serviceNotificationErrorCalled = true; assertSame(SERVICE_MONITOR, serviceMonitor); assertSame(SERVICE_EVENT, serviceEvent); assertSame(THROWABLE, throwable); }
3,227,615
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); // note the mock monitor asserts that it is only called once before requreing a reset assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); }
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); // note the mock monitor asserts that it is only called once before requreing a reset assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); }
3,227,616
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); // note the mock monitor asserts that it is only called once before requreing a reset assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); }
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); // note the mock monitor asserts that it is only called once before requreing a reset assertNotificationCorrect(); }
3,227,617
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
3,227,618
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
3,227,619
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); kernelMonitor1.rest(); kernelMonitor2.rest(); kernelMonitor3.rest(); kernelMonitor4.rest(); kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertFalse(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); kernelMonitor1.rest(); kernelMonitor2.rest(); kernelMonitor3.rest(); kernelMonitor4.rest(); kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertFalse(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
3,227,620
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); kernelMonitor1.rest(); kernelMonitor2.rest(); kernelMonitor3.rest(); kernelMonitor4.rest(); kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertFalse(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); kernelMonitor1.rest(); kernelMonitor2.rest(); kernelMonitor3.rest(); kernelMonitor4.rest(); kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertFalse(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); }
3,227,621
public void testRemoveUnassociated() { kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor1); }
public void testRemoveUnassociated() { kernelMonitorBroadcaster.removeKernelMonitor(new MockKernelMonitor("unassociated monitor")); }
3,227,622
public void addKernelMonitor(KernelMonitor kernelMonitor) { kernelMonitors.add(kernelMonitor); }
public void addKernelMonitor(KernelMonitor kernelMonitor) { kernelMonitors.addIfAbsent(kernelMonitor); }
3,227,623
private void evaluatePopup(PInputEvent e) { postPopup=true; PNode n = e.getPickedNode(); PNode p = n.getParent(); if (ChainBuilderAgent.DEBUG) System.err.println("popup. zooming out of "+n); if (n instanceof BufferedObject && (p == canvas.getLayer() || p instanceof ChainView)) { // if I'm on a module that's not in a chain or not. // I should zoom to view of whole canvas PBounds b = canvas.getBufferedBounds(); PCamera camera =canvas.getCamera(); camera.animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); setModulesDisplayMode(); } else { double scaleFactor = 1/Constants.SCALE_FACTOR; zoom(scaleFactor,e); } e.setHandled(true); }
private void evaluatePopup(PInputEvent e) { postPopup=true; PNode n = e.getPickedNode(); PNode p = n.getParent(); if (ChainBuilderAgent.DEBUG) System.err.println("popup. zooming out of "+n); if (n instanceof BufferedObject && (p == canvas.getLayer() || p instanceof ChainView)) { // if I'm on a module that's not in a chain or not. // I should zoom to view of whole canvas PBounds b = canvas.getBufferedBounds(); PCamera camera =canvas.getCamera(); camera.animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); setModulesDisplayMode(); } else { double scaleFactor = 1/Constants.SCALE_FACTOR; zoom(scaleFactor,e); } e.setHandled(true); }
3,227,625
public void mouseDragged(PInputEvent e) { if (ChainBuilderAgent.DEBUG) { System.err.println("CHAIN HANDLER:got a drag event in chain canvas"); System.err.println("mouse dragged..."+e.getPickedNode()); } mouseMoved(e); super.mouseDragged(e); }
public void mouseDragged(PInputEvent e) { if (ChainBuilderAgent.DEBUG) { System.err.println("CHAIN HANDLER:got a drag event in chain canvas"); System.err.println("mouse dragged..."+e.getPickedNode()); } mouseMoved(e); super.mouseDragged(e); }
3,227,627
public void mouseDragged(PInputEvent e) { if (ChainBuilderAgent.DEBUG) { System.err.println("CHAIN HANDLER:got a drag event in chain canvas"); System.err.println("mouse dragged..."+e.getPickedNode()); } mouseMoved(e); super.mouseDragged(e); }
public void mouseDragged(PInputEvent e) { if (ChainBuilderAgent.DEBUG) { System.err.println("CHAIN HANDLER:got a drag event in chain canvas"); System.err.println("mouse dragged..."+e.getPickedNode()); } mouseMoved(e); super.mouseDragged(e); }
3,227,628
private void startModuleTargetLink(ModuleLinkTarget modLink) { moduleLinkOriginTarget = modLink; if (ChainBuilderAgent.DEBUG) System.err.println("starting mmodule target link..."+modLink); moduleLink = new ModuleLink(linkLayer,moduleLinkOriginTarget); moduleLink.setPickable(false); linkState = LINKING_MODULE_TARGETS; }
private void startModuleTargetLink(ModuleLinkTarget modLink) { moduleLinkOriginTarget = modLink; if (ChainBuilderAgent.DEBUG) System.err.println("starting mmodule target link..."+modLink); moduleLink = new ModuleLink(linkLayer,moduleLinkOriginTarget); moduleLink.setPickable(false); linkState = LINKING_MODULE_TARGETS; }
3,227,632
public boolean isLinkable() { return labelNodes.getVisible(); }
public boolean isLinkable() { return labelNodes.getVisible(); }
3,227,633
private ModuleLink findModuleLink(ModuleView start,ModuleView end) { ModuleLink lnk = null; Iterator iter = modules.getChildrenIterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof ModuleLink) { lnk = (ModuleLink) obj; ModuleView s = lnk.getStart(); ModuleView e = lnk.getEnd(); if (start == s && end == e) return lnk; } } return null; }
private ModuleLink findModuleLink(ModuleView start,ModuleView end) { ModuleLink lnk = null; Iterator iter = modules.getChildrenIterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof ModuleLink) { lnk = (ModuleLink) obj; ModuleView s = lnk.getStart(); ModuleView e = lnk.getEnd(); if (start == s && end == e) return lnk; } } return null; }
3,227,634
private ModuleLink findModuleLink(ModuleView start,ModuleView end) { ModuleLink lnk = null; Iterator iter = modules.getChildrenIterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof ModuleLink) { lnk = (ModuleLink) obj; ModuleView s = lnk.getStart(); ModuleView e = lnk.getEnd(); if (start == s && end == e) return lnk; } } return null; }
private ModuleLink findModuleLink(ModuleView start,ModuleView end) { ModuleLink lnk = null; Iterator iter = modules.getChildrenIterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof ModuleLink) { lnk = (ModuleLink) obj; ModuleView s = lnk.getStart(); ModuleView e = lnk.getEnd(); if (start == s && end == e || start == e && end == s ) return lnk; } } return null; }
3,227,635
public FormalOutput getOutput() { if (start instanceof FormalOutput) return (FormalOutput) start; else if (end != null) return (FormalOutput) end; return null; }
public FormalOutput getOutput() { if (start instanceof FormalOutput) return (FormalOutput) start; else if (end != null) return (FormalOutput) end; return null; }
3,227,636
public void showOverview() { if (!overview.getVisible()) { overview.setVisible(true); overview.setChildrenPickable(true); setBounds(overview.getBounds()); } overview.setVisible(true); if (detail.getParent() == this && detail.getVisible() == true) detail.setVisible(false); }
public void showOverview() { if (!overview.getVisible()) { overview.setVisible(true); overview.setChildrenPickable(true); setBounds(overview.getBounds()); } overview.setVisible(true); if (detail.getParent() == this && detail.getVisible() == true) detail.setVisible(false); }
3,227,638
public void showOverview() { if (!overview.getVisible()) { overview.setVisible(true); overview.setChildrenPickable(true); setBounds(overview.getBounds()); } overview.setVisible(true); if (detail.getParent() == this && detail.getVisible() == true) detail.setVisible(false); }
public void showOverview() { if (!overview.getVisible()) { overview.setVisible(true); overview.setChildrenPickable(true); setBounds(overview.getBounds()); } overview.setVisible(true); if (detail.getParent() == this && detail.getVisible() == true) detail.setVisible(false); }
3,227,639
private void onClick(MouseEvent me, boolean released) { Point p = me.getPoint(); int row = treeDisplay.getRowForLocation(p.x, p.y); if (row != -1) { //treeDisplay.setSelectionRow(row); model.setClickPoint(p); if (me.getClickCount() == 1) { if (me.isPopupTrigger()) controller.showPopupMenu(); //if (!released) controller.onClick(); } else if (me.getClickCount() == 2 && released) { model.viewDataObject(); } } }
private void onClick(MouseEvent me, boolean released) { Point p = me.getPoint(); JTree tree = getSelectedTree(); int row = tree.getRowForLocation(p.x, p.y); if (row != -1) { //treeDisplay.setSelectionRow(row); model.setClickPoint(p); if (me.getClickCount() == 1) { if (me.isPopupTrigger()) controller.showPopupMenu(); //if (!released) controller.onClick(); } else if (me.getClickCount() == 2 && released) { model.viewDataObject(); } } }
3,227,640
private void onClick(MouseEvent me, boolean released) { Point p = me.getPoint(); int row = treeDisplay.getRowForLocation(p.x, p.y); if (row != -1) { //treeDisplay.setSelectionRow(row); model.setClickPoint(p); if (me.getClickCount() == 1) { if (me.isPopupTrigger()) controller.showPopupMenu(); //if (!released) controller.onClick(); } else if (me.getClickCount() == 2 && released) { model.viewDataObject(); } } }
private void onClick(MouseEvent me, boolean released) { Point p = me.getPoint(); int row = treeDisplay.getRowForLocation(p.x, p.y); if (row != -1) { //treeDisplay.setSelectionRow(row); if (me.getClickCount() == 1) { if (me.isPopupTrigger()) controller.showPopupMenu(); //if (!released) controller.onClick(); } else if (me.getClickCount() == 2 && released) { model.viewDataObject(); } } }
3,227,641
public TreeCellRenderer() { this(true); }
public TreeCellRenderer() { this(true); }
3,227,643
public ThreadService(IRuby runtime) { this.runtime = runtime; this.mainContext = new ThreadContext(runtime); this.localContext = new ThreadContextLocal(mainContext); this.rubyThreadGroup = new ThreadGroup("Ruby Threads#" + runtime.hashCode()); this.rubyThreadList = Collections.synchronizedList(new ArrayList()); // Must be called from main thread (it is currently, but this bothers me) rubyThreadList.add(Thread.currentThread()); }
public ThreadService(IRuby runtime) { this.runtime = runtime; this.mainContext = new ThreadContext(runtime); this.localContext = new ThreadContextLocal(mainContext); this.rubyThreadGroup = new ThreadGroup("Ruby Threads#" + runtime.hashCode()); this.rubyThreadList = Collections.synchronizedList(new ArrayList()); // Must be called from main thread (it is currently, but this bothers me) mainThread = Thread.currentThread(); rubyThreadList.add(mainThread); }
3,227,645
public ThreadContext getCurrentContext() { return (ThreadContext) localContext.get(); }
public ThreadContext getCurrentContext() { ThreadContext tc = (ThreadContext) localContext.get(); if (tc == mainContext && Thread.currentThread() != mainThread) { tc = adoptCurrentThread(); } return tc; }
3,227,646
private void createMenuBar() { menuBar = new JToolBar(); menuBar.setBorder(null); menuBar.setRollover(true); menuBar.setFloatable(false); JButton button = new JButton( controller.getAction(BrowserControl.BACKWARD_NAV)); button.setBorderPainted(false); menuBar.add(button); //button = new JButton( // controller.getAction(BrowserControl.FORWARD_NAV)); //menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.SORT)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.SORT_DATE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.FILTER_MENU)); button.addMouseListener((FilterMenuAction) controller.getAction(BrowserControl.FILTER_MENU)); button.setBorderPainted(false); menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.COLLAPSE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.CLOSE)); button.setBorderPainted(false); menuBar.add(button); }
button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); private void createMenuBar()button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); {button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar = new JToolBar();button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.setBorder(null);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.setRollover(true);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.setFloatable(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); JButton button = new JButton(button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); controller.getAction(BrowserControl.BACKWARD_NAV));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); //button = new JButton(button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); //button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); controller.getAction(BrowserControl.FORWARD_NAV));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); //menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.SORT));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.SORT_DATE));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.FILTER_MENU));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.addMouseListener((FilterMenuAction)button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); controller.getAction(BrowserControl.FILTER_MENU));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.COLLAPSE));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.CLOSE));button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button.setBorderPainted(false);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); menuBar.add(button);button = new JButton( controller.getAction(BrowserControl.FORWARD_NAV)); menuBar.add(button); }
3,227,647
private void createMenuBar() { menuBar = new JToolBar(); menuBar.setBorder(null); menuBar.setRollover(true); menuBar.setFloatable(false); JButton button = new JButton( controller.getAction(BrowserControl.BACKWARD_NAV)); button.setBorderPainted(false); menuBar.add(button); //button = new JButton( // controller.getAction(BrowserControl.FORWARD_NAV)); //menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.SORT)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.SORT_DATE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.FILTER_MENU)); button.addMouseListener((FilterMenuAction) controller.getAction(BrowserControl.FILTER_MENU)); button.setBorderPainted(false); menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.COLLAPSE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.CLOSE)); button.setBorderPainted(false); menuBar.add(button); }
private void createMenuBar() { menuBar = new JToolBar(); menuBar.setBorder(null); menuBar.setRollover(true); menuBar.setFloatable(false); JButton button = new JButton( controller.getAction(BrowserControl.BACKWARD_NAV)); button.setBorderPainted(false); menuBar.add(button); //button = new JButton( // controller.getAction(BrowserControl.FORWARD_NAV)); //menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.SORT)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.SORT_DATE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.FILTER_MENU)); button.addMouseListener((FilterMenuAction) controller.getAction(BrowserControl.FILTER_MENU)); button.setBorderPainted(false); menuBar.add(button); menuBar.add(new JSeparator(SwingConstants.VERTICAL)); button = new JButton(controller.getAction(BrowserControl.COLLAPSE)); button.setBorderPainted(false); menuBar.add(button); button = new JButton(controller.getAction(BrowserControl.CLOSE)); button.setBorderPainted(false); menuBar.add(button); }
3,227,648
public void execute() throws BuildException { CommandLineBuilder builder = null; try { builder = new CommandLineBuilder(); if (dataFile != null) builder.addArg("--datafile", dataFile); if (toDir != null) builder.addArg("--destination", toDir.getAbsolutePath()); // ignoreRegex.setRegex() is never called, but that's ok // because ant sets it somehow, I think for (int i = 0; i < ignoreRegexs.size(); i++) { Ignore ignoreRegex = (Ignore)ignoreRegexs.get(i); builder.addArg("--ignore", ignoreRegex.getRegex()); } createArgumentsForFilesets(builder); builder.saveArgs(); } catch (IOException ioe) { getProject().log("Error creating commands file.", Project.MSG_ERR); throw new BuildException("Unable to create the commands file.", ioe); } // Execute GPL licensed code in separate virtual machine getJava().createArg().setValue("--commandsfile"); getJava().createArg().setValue(builder.getCommandLineFile()); if (getJava().executeJava() != 0) { throw new BuildException( "Error instrumenting classes. See messages above."); } builder.dispose(); }
public void execute() throws BuildException { CommandLineBuilder builder = null; try { builder = new CommandLineBuilder(); if (dataFile != null) builder.addArg("--datafile", dataFile); if (toDir != null) builder.addArg("--destination", toDir.getAbsolutePath()); // ignoreRegex.setRegex() is never called, but that's ok // because ant sets it somehow, I think for (int i = 0; i < ignoreRegexs.size(); i++) { Ignore ignoreRegex = (Ignore)ignoreRegexs.get(i); builder.addArg("--ignore", ignoreRegex.getRegex()); } createArgumentsForFilesets(builder); builder.saveArgs(); } catch (IOException ioe) { getProject().log("Error creating commands file.", Project.MSG_ERR); throw new BuildException("Unable to create the commands file.", ioe); } // Execute GPL licensed code in separate virtual machine getJava().createArg().setValue("--commandsfile"); getJava().createArg().setValue(builder.getCommandLineFile()); if (getJava().executeJava() != 0) { throw new BuildException( "Error instrumenting classes. See messages above."); } builder.dispose(); }
3,227,649
public void execute() throws BuildException { CommandLineBuilder builder = null; try { builder = new CommandLineBuilder(); if (dataFile != null) builder.addArg("--datafile", dataFile); if (toDir != null) builder.addArg("--destination", toDir.getAbsolutePath()); // ignoreRegex.setRegex() is never called, but that's ok // because ant sets it somehow, I think for (int i = 0; i < ignoreRegexs.size(); i++) { Ignore ignoreRegex = (Ignore)ignoreRegexs.get(i); builder.addArg("--ignore", ignoreRegex.getRegex()); } createArgumentsForFilesets(builder); builder.saveArgs(); } catch (IOException ioe) { getProject().log("Error creating commands file.", Project.MSG_ERR); throw new BuildException("Unable to create the commands file.", ioe); } // Execute GPL licensed code in separate virtual machine getJava().createArg().setValue("--commandsfile"); getJava().createArg().setValue(builder.getCommandLineFile()); if (getJava().executeJava() != 0) { throw new BuildException( "Error instrumenting classes. See messages above."); } builder.dispose(); }
public void execute() throws BuildException { CommandLineBuilder builder = null; try { builder = new CommandLineBuilder(); if (dataFile != null) builder.addArg("--datafile", dataFile); if (toDir != null) builder.addArg("--destination", toDir.getAbsolutePath()); // ignoreRegex.setRegex() is never called, but that's ok // because ant sets it somehow, I think for (int i = 0; i < ignoreRegexs.size(); i++) { Ignore ignoreRegex = (Ignore)ignoreRegexs.get(i); builder.addArg("--ignore", ignoreRegex.getRegex()); } createArgumentsForFilesets(builder); builder.saveArgs(); } catch (IOException ioe) { getProject().log("Error creating commands file.", Project.MSG_ERR); throw new BuildException("Unable to create the commands file.", ioe); } // Execute GPL licensed code in separate virtual machine getJava().createArg().setValue("--commandsfile"); getJava().createArg().setValue(builder.getCommandLineFile()); if (getJava().executeJava() != 0) { throw new BuildException( "Error instrumenting classes. See messages above."); } builder.dispose(); }
3,227,650
public CategoryGroup(Integer attributeId, String name, String description, org.openmicroscopy.omero.model.ModuleExecution moduleExecution, Set categories) { this.attributeId = attributeId; this.name = name; this.description = description; this.moduleExecution = moduleExecution; this.categories = categories; }
public CategoryGroup(Integer attributeId, String name, String description, org.openmicroscopy.omero.model.ModuleExecution moduleExecution, Set categories) { this.attributeId = attributeId; this.name = name; this.description = description; this.moduleExecution = moduleExecution; this.categories = categories; }
3,227,652
public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { return this.moduleExecution; }
public ModuleExecution getModuleExecution() { return this.moduleExecution; }
3,227,653
public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
public void setModuleExecution(ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
3,227,654
public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } }
public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } }
3,227,655
public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } }
public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } }
3,227,656
public static PiccoloAction getSemanticEnterAction(final SemanticLayer layer) { PiccoloAction action = new PiccoloAction() { public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } } }; return action; }
public static PiccoloAction getSemanticEnterAction(final HoverManager layer) { PiccoloAction action = new PiccoloAction() { public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } } }; return action; }
3,227,658
public static PiccoloAction getSemanticEnterAction(final SemanticLayer layer) { PiccoloAction action = new PiccoloAction() { public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } } }; return action; }
public static PiccoloAction getSemanticEnterAction(final SemanticLayer layer) { PiccoloAction action = new PiccoloAction() { public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.hideSemanticNode(e.getCamera()); layer.nodeEntered(e.getCamera(),semanticNode); } } }; return action; }
3,227,659
public void execute(PInputEvent e) { layer.nodeExited(); }
public void execute(PInputEvent e) { Thumbnail t = (Thumbnail)e.getPickedNode(); double width = t.getWidth()*e.getCamera().getViewScale(); double height = t.getHeight()*e.getCamera().getViewScale(); if(width < SemanticZoomNode.getStandardWidth() && height < SemanticZoomNode.getStandardHeight()) { Image image = t.getImage(); SemanticZoomNode semanticNode = new SemanticZoomNode(t); Point2D point = new Point2D.Double(t.getOffset().getX()+ t.getBounds().getCenter2D().getX(), t.getOffset().getY()+ t.getBounds().getCenter2D().getY()); Point2D dummyPoint = new Point2D.Double(point.getX(),point.getY()); Dimension2D size = semanticNode.getBounds().getSize(); Point2D viewPoint = e.getCamera().viewToLocal(dummyPoint); semanticNode.setOffset(viewPoint.getX()-size.getWidth()/2, viewPoint.getY()-size.getHeight()/2); double offRight = semanticNode.getOffset().getX()+ semanticNode.getBounds().getWidth()- e.getCamera().getBounds().getWidth(); double offBottom = semanticNode.getOffset().getY()+ semanticNode.getBounds().getHeight()- e.getCamera().getBounds().getHeight(); double offLeft = semanticNode.getOffset().getX(); double offTop = semanticNode.getOffset().getY(); if(offRight > 0) { offLeft = offLeft-offRight-4; semanticNode.setOffset(offLeft,offTop); } if(offBottom > 0) { offTop = offBottom-offTop-4; semanticNode.setOffset(offLeft,offTop); } if(offLeft < 4) { offLeft = 4; semanticNode.setOffset(offLeft,offTop); } if(offTop < 4) { offTop = 4; semanticNode.setOffset(offLeft,offTop); } layer.nodeEntered(e.getCamera(),semanticNode,200); } }
3,227,660
public void nodeEntered(final PCamera target, final PNode node, int delayInMillis) { if(awaitingDisplay) { pendingTask.cancel(); } if(displayingNode) { hideSemanticNode(target); } pendingTask = new TimerTask() { public void run() { target.addChild(node); awaitingDisplay = false; displayingNode = true; displayedNode = node; target.repaint(); // TODO fix this hack if(displayedNode instanceof SemanticZoomNode) { SemanticZoomNode node = (SemanticZoomNode)displayedNode; node.loadCompositeImages(); System.err.println(node.getOffset()); Point parentPoint = parentComponent.getLocationOnScreen(); Point2D offset = node.getOffset(); int x = (int)Math.round(offset.getX()); int y = (int)Math.round(offset.getY()); node.setAbsoluteLocation(new Point(parentPoint.x+x, parentPoint.y+y)); } } }; showNodeTimer.schedule(pendingTask,delayInMillis); awaitingDisplay = true; }
public void nodeEntered(final PCamera target, final PNode node, int delayInMillis) { if(awaitingDisplay) { pendingTask.cancel(); } if(displayingNode) { hideSemanticNode(target); } pendingTask = new TimerTask() { public void run() { target.addChild(node); awaitingDisplay = false; displayingNode = true; displayedNode = node; target.repaint(); // TODO fix this hack if(displayedNode instanceof SemanticZoomNode) { SemanticZoomNode node = (SemanticZoomNode)displayedNode; node.loadCompositeImages(); Point parentPoint = parentComponent.getLocationOnScreen(); Point2D offset = node.getOffset(); int x = (int)Math.round(offset.getX()); int y = (int)Math.round(offset.getY()); node.setAbsoluteLocation(new Point(parentPoint.x+x, parentPoint.y+y)); } } }; showNodeTimer.schedule(pendingTask,delayInMillis); awaitingDisplay = true; }
3,227,661
public SemanticZoomNode(Thumbnail parent) { super(); if(!loadedCompositeInfo) { loadSizeInfo(); } if(parent == null) { throw new IllegalArgumentException("null parent to" + "SemanticZoomNode"); } multipleModeOn = parent.isMultipleThumbnail(); if(!multipleModeOn) { Image scaledImage; Image originalImage = parent.getImage(); int width = originalImage.getWidth(null); int height = originalImage.getHeight(null); if(width < height) { scaledImage = originalImage.getScaledInstance(-1,compositeHeight, Image.SCALE_DEFAULT); } else { scaledImage = originalImage.getScaledInstance(compositeWidth,-1, Image.SCALE_DEFAULT); } setImage(scaledImage); } else { Image[] originalImages = parent.getMultipleImages(); thumbnailImages = new Image[originalImages.length]; for(int i=0;i<originalImages.length;i++) { int width = originalImages[i].getWidth(null); int height = originalImages[i].getHeight(null); if(width < height) { thumbnailImages[i] = originalImages[i].getScaledInstance(-1,compositeHeight, Image.SCALE_DEFAULT); } else { thumbnailImages[i] = originalImages[i].getScaledInstance(compositeWidth,-1, Image.SCALE_DEFAULT); } } setImage(thumbnailImages[parent.getMultipleImageIndex()]); } int xDiff = getImage().getWidth(null)-compositeWidth; // should be only negative... int yDiff = getImage().getHeight(null)-compositeHeight; // should be only negative... parentThumbnail = parent; border = new Rectangle2D.Double(-4,-4, getImage().getWidth(null)+8, getImage().getHeight(null)+8); initOverlayShapes(); setBounds(border); }
public SemanticZoomNode(Thumbnail parent, BrowserModel parentInfo) { super(); if(!loadedCompositeInfo) { loadSizeInfo(); } if(parent == null) { throw new IllegalArgumentException("null parent to" + "SemanticZoomNode"); } multipleModeOn = parent.isMultipleThumbnail(); if(!multipleModeOn) { Image scaledImage; Image originalImage = parent.getImage(); int width = originalImage.getWidth(null); int height = originalImage.getHeight(null); if(width < height) { scaledImage = originalImage.getScaledInstance(-1,compositeHeight, Image.SCALE_DEFAULT); } else { scaledImage = originalImage.getScaledInstance(compositeWidth,-1, Image.SCALE_DEFAULT); } setImage(scaledImage); } else { Image[] originalImages = parent.getMultipleImages(); thumbnailImages = new Image[originalImages.length]; for(int i=0;i<originalImages.length;i++) { int width = originalImages[i].getWidth(null); int height = originalImages[i].getHeight(null); if(width < height) { thumbnailImages[i] = originalImages[i].getScaledInstance(-1,compositeHeight, Image.SCALE_DEFAULT); } else { thumbnailImages[i] = originalImages[i].getScaledInstance(compositeWidth,-1, Image.SCALE_DEFAULT); } } setImage(thumbnailImages[parent.getMultipleImageIndex()]); } int xDiff = getImage().getWidth(null)-compositeWidth; // should be only negative... int yDiff = getImage().getHeight(null)-compositeHeight; // should be only negative... parentThumbnail = parent; border = new Rectangle2D.Double(-4,-4, getImage().getWidth(null)+8, getImage().getHeight(null)+8); initOverlayShapes(); setBounds(border); }
3,227,662
private JPanel buildButtonPanel() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(viewButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.add(saveButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.add(addButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.setOpaque(false); //make panel transparent return p; }
private JPanel buildButtonPanel() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(viewButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.add(saveButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.add(addButton); p.add(Box.createRigidArea(DataManagerUIF.HBOX)); p.setOpaque(false); //make panel transparent return p; }
3,227,664
private void initButtons() { saveButton = new JButton("Save"); saveButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); saveButton.setToolTipText( UIUtilities.formatToolTipText("Save data in the DB.")); saveButton.setEnabled(false); addButton = new JButton("Add images"); addButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); addButton.setToolTipText( UIUtilities.formatToolTipText("Add images to the dataset.")); viewButton = new JButton("Browse"); viewButton.setToolTipText(UIUtilities.formatToolTipText("Browse the" + " dataset.")); }
private void initButtons() { saveButton = new JButton("Save"); saveButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); saveButton.setToolTipText( UIUtilities.formatToolTipText("Save data in the DB.")); saveButton.setEnabled(false); addButton = new JButton("Add images"); addButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); addButton.setToolTipText( UIUtilities.formatToolTipText("Add images to the dataset.")); viewButton = new JButton("Browse"); viewButton.setToolTipText(UIUtilities.formatToolTipText("Browse the" + " dataset.")); }
3,227,666
public static RubyProc newProc(Ruby ruby, RubyClass rubyClass) { if (!ruby.isBlockGiven() && !ruby.isFBlockGiven()) { throw new RubyArgumentException(ruby, "tried to create Proc object without a block"); } RubyProc newProc = new RubyProc(ruby, rubyClass); newProc.block = ruby.getBlock().cloneBlock(); newProc.wrapper = ruby.getWrapper(); newProc.block.iter = newProc.block.prev != null ? 1 : 0; newProc.block.frame = ruby.getRubyFrame(); newProc.block.scope = ruby.getScope(); // +++ return newProc; }
public static RubyProc newProc(Ruby ruby, RubyClass rubyClass) { if (!ruby.isBlockGiven() && !ruby.isFBlockGiven()) { throw new RubyArgumentException(ruby, "tried to create Proc object without a block"); } RubyProc newProc = new RubyProc(ruby, rubyClass); newProc.block = ruby.getBlock().cloneBlock(); newProc.wrapper = ruby.getWrapper(); newProc.block.iter = newProc.block.prev != null ? 1 : 0; newProc.block.frame = ruby.getRubyFrame(); newProc.block.scope = (Scope)ruby.getScope().getTop(); // +++ return newProc; }
3,227,667
protected void onDisplayChange(ImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } if (selectedDisplay.getParentDisplay() == null) { setEnabled(false); return; } if (!(selectedDisplay.getHierarchyObject() instanceof ImageData)) { setEnabled(false); return; } if (model.getBrowser() == null) { setEnabled(false); return; } int n = model.getBrowser().getSelectedDisplays().size(); setEnabled(!(n > 1)); }
protected void onDisplayChange(ImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } if (selectedDisplay.getParentDisplay() == null) { setEnabled(false); return; } if (!(selectedDisplay.getHierarchyObject() instanceof ImageData)) { setEnabled(false); return; } if (model.getBrowser() == null) { setEnabled(false); return; } int n = model.getBrowser().getSelectedDisplays().size(); setEnabled(!(n > 1)); }
3,227,668
protected void onDisplayChange(ImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } if (selectedDisplay.getParentDisplay() == null) { setEnabled(false); return; } if (!(selectedDisplay.getHierarchyObject() instanceof ImageData)) { setEnabled(false); return; } if (model.getBrowser() == null) { setEnabled(false); return; } int n = model.getBrowser().getSelectedDisplays().size(); setEnabled(!(n > 1)); }
protected void onDisplayChange(ImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } if (selectedDisplay.getParentDisplay() == null) { setEnabled(false); return; } if (!(selectedDisplay.getHierarchyObject() instanceof ImageData)) { setEnabled(false); return; } if (model.getBrowser() == null) { setEnabled(false); return; } int n = model.getBrowser().getSelectedDisplays().size(); setEnabled(!(n > 1)); }
3,227,669
private void fillCollection(Collection source, Collection target){ for (Iterator it = source.iterator(); it.hasNext();) { Object o = it.next(); target.add(this.findTarget(o)); } }
private void fillCollection(Collection source, Collection target){ for (Iterator it = source.iterator(); it.hasNext();) { Object o = it.next(); target.add(this.findTarget(o)); } }
3,227,670
private void fillMap(Map source, Map target){ for (Iterator it = source.keySet().iterator(); it.hasNext();) { Object o = it.next(); target.put(findTarget(o),findTarget(source.get(o))); } }
private void fillMap(Map source, Map target){ for (Iterator it = source.keySet().iterator(); it.hasNext();) { Object o = it.next(); target.put(findTarget(o),findTarget(source.get(o))); } }
3,227,671
private void fillTarget(Filterable source, ModelBased target){ target.copy(((OMEModel)source),this); }
private void fillTarget(Filterable source, ModelBased target){ target.copy(((OMEModel)source),this); }
3,227,672
public ModelBased map (Filterable source){ // TODO take any object. just like filter() Filterable o = super.filter("MAPPING...",source); ModelBased target = (ModelBased) findTarget(source); fillTarget(source,target); return (ModelBased) model2target.get(o); }
public ModelBased map (Filterable source){ // TODO take any object. just like filter() Filterable o = super.filter("MAPPING...",source); ModelBased target = (ModelBased) findTarget(source); fillTarget(source,target); return (ModelBased) model2target.get(o); }
3,227,673