bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void refresh() { switch (model.getState()) { case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } TreeImageDisplay display = model.getSelectedDisplay(); if (display == null) return; if (!display.hasChildrenDisplay()) return; TreeImageDisplay root = view.getTreeRoot(); display.removeAllChildrenDisplay(); if (root.equals(display)) loadData(); else model.refreshSelectedDisplay(); fireStateChange(); }
public void refresh() { switch (model.getState()) { case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } TreeImageDisplay display = model.getSelectedDisplay(); if (display == null) return; if (!display.hasChildrenDisplay()) return; TreeImageDisplay root = view.getTreeRoot(); display.removeAllChildrenDisplay(); if (root.equals(display)) loadData(); else model.refreshSelectedDisplay(); fireStateChange(); }
3,231,529
void setDefaults() { int maxZ = model.getMaxZ(); int maxT = model.getMaxT(); zSlider.setEnabled(maxZ != 0); startZ.setEnabled(maxZ != 0); endZ.setEnabled(maxZ != 0); tSlider.setEnabled(maxT != 0); startT.setEnabled(maxT != 0); endT.setEnabled(maxT != 0); acrossZ.setEnabled(maxZ != 0); acrossT.setEnabled(maxT != 0); int index = model.getMovieIndex(); if (index == MoviePlayer.ACROSS_Z) { acrossZ.setSelected(true); } else if (index == MoviePlayer.ACROSS_T) { acrossT.setSelected(true); } else if (index == MoviePlayer.ACROSS_ZT) { acrossT.setSelected(true); acrossZ.setSelected(true); } }
void setDefaults() { int maxZ = model.getMaxZ(); int maxT = model.getMaxT(); zSlider.setEnabled(maxZ != 0); startZ.setEnabled(maxZ != 0); endZ.setEnabled(maxZ != 0); tSlider.setEnabled(maxT != 0); startT.setEnabled(maxT != 0); endT.setEnabled(maxT != 0); acrossZ.setEnabled(maxZ != 0); acrossT.setEnabled(maxT != 0); int index = model.getMovieIndex(); if (index == MoviePlayer.ACROSS_Z) { acrossZ.setSelected(true); } else if (index == MoviePlayer.ACROSS_T) { acrossT.setSelected(true); } else if (index == MoviePlayer.ACROSS_ZT) { acrossT.setSelected(true); acrossZ.setSelected(true); } }
3,231,530
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
3,231,535
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
3,231,536
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } System.out.println("creation: "+(System.currentTimeMillis()-s)); //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
public BufferedImage render(PlaneDef pDef) { if (pDef == null) throw new IllegalArgumentException("Plane def cannot be null."); //See if the requested image is in cache. //BufferedImage img = null;//getFromCache(pDef); //if (img == null) { //If not, ask the server to render the plane. RGBBuffer buf = servant.render(pDef); //TO BE modified. if (xyImage == null) { xyImage = new BufferedImage(buf.getSizeX1(), buf.getSizeX2(), BufferedImage.TYPE_INT_RGB); } //See if we can/need work out the XY image size. if (xyImgSize == 0 && pDef.getSlice() == PlaneDef.XY) xyImgSize = buf.getRedBand().length+buf.getGreenBand().length+ buf.getBlueBand().length; //RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); long s = System.currentTimeMillis(); int sizeX1 = buf.getSizeX1(); int sizeX2 = buf.getSizeX2(); int pos = 0; for (int y = sizeX2-1; y >= 0; y--) { for (int x = sizeX1-1; x >= 0; x--) { pos = sizeX1*y+x; xyImage.setRGB(x, y, makeRGB(buf.getRedBand()[pos], buf.getGreenBand()[pos], buf.getBlueBand()[pos])); } } //Then create a Java2D buffer for buf. /* RGBByteBuffer j2DBuf = new RGBByteBuffer(buf); //Now we only need to tell Java2D how to handle the RGB buffer. BandedSampleModel csm = new BandedSampleModel(DataBuffer.TYPE_BYTE, buf.getSizeX1(), buf.getSizeX2(), 3); ColorModel cm = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB), null, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); img = new BufferedImage(cm, Raster.createWritableRaster(csm, j2DBuf, null), false, null); */ //Finally add to cache. // cache(pDef, img); //} //return img; return xyImage; }
3,231,537
public String toString(){ return "ImageInfo"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); }
public String toString(){ return "ImageInfo"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); }
3,231,543
public static RubyModule createKernelModule(IRuby runtime) { RubyModule module = runtime.defineModule("Kernel"); CallbackFactory callbackFactory = runtime.callbackFactory(RubyKernel.class); CallbackFactory objectCallbackFactory = runtime.callbackFactory(RubyObject.class); module.defineModuleFunction("Array", callbackFactory.getSingletonMethod("new_array", IRubyObject.class)); module.defineModuleFunction("Float", callbackFactory.getSingletonMethod("new_float", IRubyObject.class)); module.defineModuleFunction("Integer", callbackFactory.getSingletonMethod("new_integer", IRubyObject.class)); module.defineModuleFunction("String", callbackFactory.getSingletonMethod("new_string", IRubyObject.class)); module.defineModuleFunction("`", callbackFactory.getSingletonMethod("backquote", IRubyObject.class)); module.defineModuleFunction("abort", callbackFactory.getOptSingletonMethod("abort")); module.defineModuleFunction("at_exit", callbackFactory.getSingletonMethod("at_exit")); module.defineModuleFunction("autoload", callbackFactory.getSingletonMethod("autoload", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("autoload?", callbackFactory.getSingletonMethod("autoload_p", IRubyObject.class)); module.defineModuleFunction("binding", callbackFactory.getSingletonMethod("binding")); module.defineModuleFunction("block_given?", callbackFactory.getSingletonMethod("block_given")); // TODO: Implement Kernel#callcc module.defineModuleFunction("caller", callbackFactory.getOptSingletonMethod("caller")); module.defineModuleFunction("catch", callbackFactory.getSingletonMethod("rbCatch", IRubyObject.class)); module.defineModuleFunction("chomp", callbackFactory.getOptSingletonMethod("chomp")); module.defineModuleFunction("chomp!", callbackFactory.getOptSingletonMethod("chomp_bang")); module.defineModuleFunction("chop", callbackFactory.getSingletonMethod("chop")); module.defineModuleFunction("chop!", callbackFactory.getSingletonMethod("chop_bang")); module.defineModuleFunction("eval", callbackFactory.getOptSingletonMethod("eval")); module.defineModuleFunction("exit", callbackFactory.getOptSingletonMethod("exit")); module.defineModuleFunction("exit!", callbackFactory.getOptSingletonMethod("exit_bang")); module.defineModuleFunction("fail", callbackFactory.getOptSingletonMethod("raise")); // TODO: Implement Kernel#fork module.defineModuleFunction("format", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("gets", callbackFactory.getOptSingletonMethod("gets")); module.defineModuleFunction("global_variables", callbackFactory.getSingletonMethod("global_variables")); module.defineModuleFunction("gsub", callbackFactory.getOptSingletonMethod("gsub")); module.defineModuleFunction("gsub!", callbackFactory.getOptSingletonMethod("gsub_bang")); // TODO: Add deprecation to Kernel#iterator? (maybe formal deprecation mech.) module.defineModuleFunction("iterator?", callbackFactory.getSingletonMethod("block_given")); module.defineModuleFunction("lambda", callbackFactory.getSingletonMethod("proc")); module.defineModuleFunction("load", callbackFactory.getOptSingletonMethod("load")); module.defineModuleFunction("local_variables", callbackFactory.getSingletonMethod("local_variables")); module.defineModuleFunction("loop", callbackFactory.getSingletonMethod("loop")); // Note: method_missing is documented as being in Object, but ruby appears to stick it in Kernel. module.defineModuleFunction("method_missing", callbackFactory.getOptSingletonMethod("method_missing")); module.defineModuleFunction("open", callbackFactory.getOptSingletonMethod("open")); module.defineModuleFunction("p", callbackFactory.getOptSingletonMethod("p")); module.defineModuleFunction("print", callbackFactory.getOptSingletonMethod("print")); module.defineModuleFunction("printf", callbackFactory.getOptSingletonMethod("printf")); module.defineModuleFunction("proc", callbackFactory.getSingletonMethod("proc")); // TODO: implement Kernel#putc module.defineModuleFunction("puts", callbackFactory.getOptSingletonMethod("puts")); module.defineModuleFunction("raise", callbackFactory.getOptSingletonMethod("raise")); module.defineModuleFunction("rand", callbackFactory.getOptSingletonMethod("rand")); module.defineModuleFunction("readline", callbackFactory.getOptSingletonMethod("readline")); module.defineModuleFunction("readlines", callbackFactory.getOptSingletonMethod("readlines")); module.defineModuleFunction("require", callbackFactory.getSingletonMethod("require", IRubyObject.class)); module.defineModuleFunction("scan", callbackFactory.getSingletonMethod("scan", IRubyObject.class)); module.defineModuleFunction("select", callbackFactory.getOptSingletonMethod("select")); module.defineModuleFunction("set_trace_func", callbackFactory.getSingletonMethod("set_trace_func", IRubyObject.class)); module.defineModuleFunction("sleep", callbackFactory.getSingletonMethod("sleep", IRubyObject.class)); module.defineModuleFunction("split", callbackFactory.getOptSingletonMethod("split")); module.defineModuleFunction("sprintf", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("srand", callbackFactory.getOptSingletonMethod("srand")); module.defineModuleFunction("sub", callbackFactory.getOptSingletonMethod("sub")); module.defineModuleFunction("sub!", callbackFactory.getOptSingletonMethod("sub_bang")); // Skipping: Kernel#syscall (too system dependent) module.defineModuleFunction("system", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#exec differently? module.defineModuleFunction("exec", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#test (partial impl) module.defineModuleFunction("throw", callbackFactory.getOptSingletonMethod("rbThrow")); // TODO: Implement Kernel#trace_var module.defineModuleFunction("trap", callbackFactory.getOptSingletonMethod("trap")); // TODO: Implement Kernel#untrace_var module.defineModuleFunction("warn", callbackFactory.getSingletonMethod("warn", IRubyObject.class)); // Defined p411 Pickaxe 2nd ed. module.defineModuleFunction("singleton_method_added", callbackFactory.getSingletonMethod("singleton_method_added", IRubyObject.class)); // Object methods module.definePublicModuleFunction("==", objectCallbackFactory.getMethod("equal", IRubyObject.class)); module.defineAlias("===", "=="); module.defineAlias("eql?", "=="); module.definePublicModuleFunction("to_s", objectCallbackFactory.getMethod("to_s")); module.definePublicModuleFunction("nil?", objectCallbackFactory.getMethod("nil_p")); module.definePublicModuleFunction("to_a", callbackFactory.getSingletonMethod("to_a")); module.definePublicModuleFunction("hash", objectCallbackFactory.getMethod("hash")); module.definePublicModuleFunction("id", objectCallbackFactory.getMethod("id")); module.defineAlias("__id__", "id"); module.defineAlias("object_id", "id"); module.definePublicModuleFunction("is_a?", objectCallbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineAlias("kind_of?", "is_a?"); module.definePublicModuleFunction("dup", objectCallbackFactory.getMethod("dup")); module.definePublicModuleFunction("equal?", objectCallbackFactory.getMethod("same", IRubyObject.class)); module.definePublicModuleFunction("type", objectCallbackFactory.getMethod("type_deprecated")); module.definePublicModuleFunction("class", objectCallbackFactory.getMethod("type")); module.definePublicModuleFunction("inspect", objectCallbackFactory.getMethod("inspect")); module.definePublicModuleFunction("=~", objectCallbackFactory.getMethod("match", IRubyObject.class)); module.definePublicModuleFunction("clone", objectCallbackFactory.getMethod("rbClone")); module.definePublicModuleFunction("display", objectCallbackFactory.getOptMethod("display")); module.definePublicModuleFunction("extend", objectCallbackFactory.getOptMethod("extend")); module.definePublicModuleFunction("freeze", objectCallbackFactory.getMethod("freeze")); module.definePublicModuleFunction("frozen?", objectCallbackFactory.getMethod("frozen")); module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class)); module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval")); module.definePublicModuleFunction("instance_of?", objectCallbackFactory.getMethod("instance_of", IRubyObject.class)); module.definePublicModuleFunction("instance_variables", objectCallbackFactory.getMethod("instance_variables")); module.definePublicModuleFunction("instance_variable_get", objectCallbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.definePublicModuleFunction("instance_variable_set", objectCallbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("method", objectCallbackFactory.getMethod("method", IRubyObject.class)); module.definePublicModuleFunction("methods", objectCallbackFactory.getOptMethod("methods")); module.definePublicModuleFunction("private_methods", objectCallbackFactory.getMethod("private_methods")); module.definePublicModuleFunction("protected_methods", objectCallbackFactory.getMethod("protected_methods")); module.definePublicModuleFunction("public_methods", objectCallbackFactory.getOptMethod("public_methods")); module.defineModuleFunction("remove_instance_variable", objectCallbackFactory.getMethod("remove_instance_variable", IRubyObject.class)); module.definePublicModuleFunction("respond_to?", objectCallbackFactory.getOptMethod("respond_to")); module.definePublicModuleFunction("send", objectCallbackFactory.getOptMethod("send")); module.defineAlias("__send__", "send"); module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getMethod("singleton_methods")); module.definePublicModuleFunction("taint", objectCallbackFactory.getMethod("taint")); module.definePublicModuleFunction("tainted?", objectCallbackFactory.getMethod("tainted")); module.definePublicModuleFunction("untaint", objectCallbackFactory.getMethod("untaint")); return module; }
public static RubyModule createKernelModule(IRuby runtime) { RubyModule module = runtime.defineModule("Kernel"); CallbackFactory callbackFactory = runtime.callbackFactory(RubyKernel.class); CallbackFactory objectCallbackFactory = runtime.callbackFactory(RubyObject.class); module.defineModuleFunction("Array", callbackFactory.getSingletonMethod("new_array", IRubyObject.class)); module.defineModuleFunction("Float", callbackFactory.getSingletonMethod("new_float", IRubyObject.class)); module.defineModuleFunction("Integer", callbackFactory.getSingletonMethod("new_integer", IRubyObject.class)); module.defineModuleFunction("String", callbackFactory.getSingletonMethod("new_string", IRubyObject.class)); module.defineModuleFunction("`", callbackFactory.getSingletonMethod("backquote", IRubyObject.class)); module.defineModuleFunction("abort", callbackFactory.getOptSingletonMethod("abort")); module.defineModuleFunction("at_exit", callbackFactory.getSingletonMethod("at_exit")); module.defineModuleFunction("autoload", callbackFactory.getSingletonMethod("autoload", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("autoload?", callbackFactory.getSingletonMethod("autoload_p", IRubyObject.class)); module.defineModuleFunction("binding", callbackFactory.getSingletonMethod("binding")); module.defineModuleFunction("block_given?", callbackFactory.getSingletonMethod("block_given")); // TODO: Implement Kernel#callcc module.defineModuleFunction("caller", callbackFactory.getOptSingletonMethod("caller")); module.defineModuleFunction("catch", callbackFactory.getSingletonMethod("rbCatch", IRubyObject.class)); module.defineModuleFunction("chomp", callbackFactory.getOptSingletonMethod("chomp")); module.defineModuleFunction("chomp!", callbackFactory.getOptSingletonMethod("chomp_bang")); module.defineModuleFunction("chop", callbackFactory.getSingletonMethod("chop")); module.defineModuleFunction("chop!", callbackFactory.getSingletonMethod("chop_bang")); module.defineModuleFunction("eval", callbackFactory.getOptSingletonMethod("eval")); module.defineModuleFunction("exit", callbackFactory.getOptSingletonMethod("exit")); module.defineModuleFunction("exit!", callbackFactory.getOptSingletonMethod("exit_bang")); module.defineModuleFunction("fail", callbackFactory.getOptSingletonMethod("raise")); // TODO: Implement Kernel#fork module.defineModuleFunction("format", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("gets", callbackFactory.getOptSingletonMethod("gets")); module.defineModuleFunction("global_variables", callbackFactory.getSingletonMethod("global_variables")); module.defineModuleFunction("gsub", callbackFactory.getOptSingletonMethod("gsub")); module.defineModuleFunction("gsub!", callbackFactory.getOptSingletonMethod("gsub_bang")); // TODO: Add deprecation to Kernel#iterator? (maybe formal deprecation mech.) module.defineModuleFunction("iterator?", callbackFactory.getSingletonMethod("block_given")); module.defineModuleFunction("lambda", callbackFactory.getSingletonMethod("proc")); module.defineModuleFunction("load", callbackFactory.getOptSingletonMethod("load")); module.defineModuleFunction("local_variables", callbackFactory.getSingletonMethod("local_variables")); module.defineModuleFunction("loop", callbackFactory.getSingletonMethod("loop")); // Note: method_missing is documented as being in Object, but ruby appears to stick it in Kernel. module.defineModuleFunction("method_missing", callbackFactory.getOptSingletonMethod("method_missing")); module.defineModuleFunction("open", callbackFactory.getOptSingletonMethod("open")); module.defineModuleFunction("p", callbackFactory.getOptSingletonMethod("p")); module.defineModuleFunction("print", callbackFactory.getOptSingletonMethod("print")); module.defineModuleFunction("printf", callbackFactory.getOptSingletonMethod("printf")); module.defineModuleFunction("proc", callbackFactory.getSingletonMethod("proc")); // TODO: implement Kernel#putc module.defineModuleFunction("puts", callbackFactory.getOptSingletonMethod("puts")); module.defineModuleFunction("raise", callbackFactory.getOptSingletonMethod("raise")); module.defineModuleFunction("rand", callbackFactory.getOptSingletonMethod("rand")); module.defineModuleFunction("readline", callbackFactory.getOptSingletonMethod("readline")); module.defineModuleFunction("readlines", callbackFactory.getOptSingletonMethod("readlines")); module.defineModuleFunction("require", callbackFactory.getSingletonMethod("require", IRubyObject.class)); module.defineModuleFunction("scan", callbackFactory.getSingletonMethod("scan", IRubyObject.class)); module.defineModuleFunction("select", callbackFactory.getOptSingletonMethod("select")); module.defineModuleFunction("set_trace_func", callbackFactory.getSingletonMethod("set_trace_func", IRubyObject.class)); module.defineModuleFunction("sleep", callbackFactory.getSingletonMethod("sleep", IRubyObject.class)); module.defineModuleFunction("split", callbackFactory.getOptSingletonMethod("split")); module.defineModuleFunction("sprintf", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("srand", callbackFactory.getOptSingletonMethod("srand")); module.defineModuleFunction("sub", callbackFactory.getOptSingletonMethod("sub")); module.defineModuleFunction("sub!", callbackFactory.getOptSingletonMethod("sub_bang")); // Skipping: Kernel#syscall (too system dependent) module.defineModuleFunction("system", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#exec differently? module.defineModuleFunction("exec", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#test (partial impl) module.defineModuleFunction("throw", callbackFactory.getOptSingletonMethod("rbThrow")); // TODO: Implement Kernel#trace_var module.defineModuleFunction("trap", callbackFactory.getOptSingletonMethod("trap")); // TODO: Implement Kernel#untrace_var module.defineModuleFunction("warn", callbackFactory.getSingletonMethod("warn", IRubyObject.class)); // Defined p411 Pickaxe 2nd ed. module.defineModuleFunction("singleton_method_added", callbackFactory.getSingletonMethod("singleton_method_added", IRubyObject.class)); // Object methods module.definePublicModuleFunction("==", objectCallbackFactory.getMethod("equal", IRubyObject.class)); module.defineAlias("===", "=="); module.defineAlias("eql?", "=="); module.definePublicModuleFunction("to_s", objectCallbackFactory.getMethod("to_s")); module.definePublicModuleFunction("nil?", objectCallbackFactory.getMethod("nil_p")); module.definePublicModuleFunction("to_a", callbackFactory.getSingletonMethod("to_a")); module.definePublicModuleFunction("hash", objectCallbackFactory.getMethod("hash")); module.definePublicModuleFunction("id", objectCallbackFactory.getMethod("id")); module.defineAlias("__id__", "id"); module.defineAlias("object_id", "id"); module.definePublicModuleFunction("is_a?", objectCallbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineAlias("kind_of?", "is_a?"); module.definePublicModuleFunction("dup", objectCallbackFactory.getMethod("dup")); module.definePublicModuleFunction("equal?", objectCallbackFactory.getMethod("same", IRubyObject.class)); module.definePublicModuleFunction("type", objectCallbackFactory.getMethod("type_deprecated")); module.definePublicModuleFunction("class", objectCallbackFactory.getMethod("type")); module.definePublicModuleFunction("inspect", objectCallbackFactory.getMethod("inspect")); module.definePublicModuleFunction("=~", objectCallbackFactory.getMethod("match", IRubyObject.class)); module.definePublicModuleFunction("clone", objectCallbackFactory.getMethod("rbClone")); module.definePublicModuleFunction("display", objectCallbackFactory.getOptMethod("display")); module.definePublicModuleFunction("extend", objectCallbackFactory.getOptMethod("extend")); module.definePublicModuleFunction("freeze", objectCallbackFactory.getMethod("freeze")); module.definePublicModuleFunction("frozen?", objectCallbackFactory.getMethod("frozen")); module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class)); module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval")); module.definePublicModuleFunction("instance_of?", objectCallbackFactory.getMethod("instance_of", IRubyObject.class)); module.definePublicModuleFunction("instance_variables", objectCallbackFactory.getMethod("instance_variables")); module.definePublicModuleFunction("instance_variable_get", objectCallbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.definePublicModuleFunction("instance_variable_set", objectCallbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("method", objectCallbackFactory.getMethod("method", IRubyObject.class)); module.definePublicModuleFunction("methods", objectCallbackFactory.getOptMethod("methods")); module.definePublicModuleFunction("private_methods", objectCallbackFactory.getMethod("private_methods")); module.definePublicModuleFunction("protected_methods", objectCallbackFactory.getMethod("protected_methods")); module.definePublicModuleFunction("public_methods", objectCallbackFactory.getOptMethod("public_methods")); module.defineModuleFunction("remove_instance_variable", objectCallbackFactory.getMethod("remove_instance_variable", IRubyObject.class)); module.definePublicModuleFunction("respond_to?", objectCallbackFactory.getOptMethod("respond_to")); module.definePublicModuleFunction("send", objectCallbackFactory.getOptMethod("send")); module.defineAlias("__send__", "send"); module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getOptMethod("singleton_methods")); module.definePublicModuleFunction("taint", objectCallbackFactory.getMethod("taint")); module.definePublicModuleFunction("tainted?", objectCallbackFactory.getMethod("tainted")); module.definePublicModuleFunction("untaint", objectCallbackFactory.getMethod("untaint")); return module; }
3,231,544
private void showMenu() { Point p = currentWin.getPopupPoint(); show(currentWin, p.x, p.y); }
private void showMenu() { Point p = currentWin.getPopupPoint(); Point pNew = SwingUtilities.convertPoint(currentWin, p.x, p.y, null); show(currentWin.getParent(), pNew.x, pNew.y); }
3,231,545
public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return fields.getEntry(i-1); }
public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return fields.getEntry(i-1); }
3,231,546
public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return fields.getEntry(i-1); }
public Object get(int i){ if ((i<1) || (i>fields.size())){ return _tbl.formatError("Invalid index: " + i + ". The column index must be between 1 and " + fields.size()); } return o; }
3,231,547
public RubyObject execute(Ruby ruby, RubyObject receiver, String name, RubyObject[] args, boolean noSuper) { if (args == null) { args = new RubyObject[0]; } RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null) { optionalBlockArg = RubyProc.newProc(ruby, ruby.getClasses().getProcClass()); } ruby.getScope().push(); Namespace savedNamespace = null; if (namespace != null) { savedNamespace = ruby.getNamespace(); ruby.setNamespace(namespace); ruby.getActFrame().setNamespace(namespace); } if (body.getLocalNames() != null) { ruby.getScope().setLocalValues(new ArrayList(Collections.nCopies(body.getLocalNames().size(), ruby.getNil()))); ruby.getScope().setLocalNames(body.getLocalNames()); } RubyVarmap.push(ruby); try { if (argsNode != null) { int i = argsNode.getArgsCount(); if (i > args.length) { throw new ArgumentError(ruby, "Wrong # of arguments(" + args.length + " for " + i + ")"); } if (argsNode.getRestArg() == -1 && argsNode.getOptArgs() != null) { int opt = i; IListNode optNode = argsNode.getOptArgs(); Iterator iter = optNode.iterator(); while (iter.hasNext()) { iter.next(); opt++; } if (opt < args.length) { throw new ArgumentError(ruby, "wrong # of arguments(" + args.length + " for " + opt + ")"); } // XXX ruby.getActFrame().setArgs(Arrays.asList(args)); } if (ruby.getScope().getLocalValues() != null) { if (i > 0) { for (int j = 0; j < i; j++) { ruby.getScope().setValue(j + 2, args[j]); } } if (argsNode.getOptArgs() != null) { IListNode optArgs = argsNode.getOptArgs(); Iterator iter = optArgs.iterator(); for (int j = i; j < args.length && iter.hasNext(); j++) { new AssignmentVisitor(ruby, receiver).assign((INode)iter.next(), args[j], true); i++; } // assign the default values. while (iter.hasNext()) { new EvaluateVisitor(ruby, receiver).eval((INode)iter.next()); } } if (argsNode.getRestArg() >= 0) { RubyArray array = null; if (args.length > i) { array = RubyArray.newArray(ruby, Arrays.asList(args).subList(i, args.length)); } else { array = RubyArray.newArray(ruby, 0); } ruby.getScope().setValue(argsNode.getRestArg(), array); } } } if (optionalBlockArg != null) { ruby.getScope().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } if (ruby.getRuntime().getTraceFunction() != null) { //a lot of complication to try to get a line number and a file name //without a NullPointerException ISourcePosition lPos = null; if (body != null) if (body.getBodyNode() != null) if(body.getBodyNode().getPosition() != null) lPos = body.getBodyNode().getPosition(); else ; else if (body.getPosition() != null) lPos = body.getPosition(); else ; else if (argsNode != null) lPos = argsNode.getPosition(); String lFile = ruby.getSourceFile(); int lLine = ruby.getSourceLine(); if (lPos != null) { lFile = lPos.getFile(); lLine = lPos.getLine(); } ruby.getRuntime().callTraceFunction("call", lFile, lLine, receiver, name, getImplementationClass()); // XXX } return receiver.eval(body.getBodyNode()); // skip scope assignment } catch (ReturnException rExcptn) { return rExcptn.getReturnValue(); } finally { RubyVarmap.pop(ruby); ruby.getScope().pop(); if (savedNamespace != null) { ruby.setNamespace(savedNamespace); } if (ruby.getRuntime().getTraceFunction() != null) { String file = ruby.getFrameStack().getPrevious().getFile(); int line = ruby.getFrameStack().getPrevious().getLine(); if (file == null) { file = ruby.getSourceFile(); line = ruby.getSourceLine(); } ruby.getRuntime().callTraceFunction("return", file, line, receiver, name, getImplementationClass()); // XXX } } }
public RubyObject execute(Ruby ruby, RubyObject receiver, String name, RubyObject[] args, boolean noSuper) { if (args == null) { args = new RubyObject[0]; } RubyProc optionalBlockArg = null; if (argsNode.getBlockArgNode() != null && ruby.isBlockGiven()) { optionalBlockArg = RubyProc.newProc(ruby, ruby.getClasses().getProcClass()); } ruby.getScope().push(); Namespace savedNamespace = null; if (namespace != null) { savedNamespace = ruby.getNamespace(); ruby.setNamespace(namespace); ruby.getActFrame().setNamespace(namespace); } if (body.getLocalNames() != null) { ruby.getScope().setLocalValues(new ArrayList(Collections.nCopies(body.getLocalNames().size(), ruby.getNil()))); ruby.getScope().setLocalNames(body.getLocalNames()); } RubyVarmap.push(ruby); try { if (argsNode != null) { int i = argsNode.getArgsCount(); if (i > args.length) { throw new ArgumentError(ruby, "Wrong # of arguments(" + args.length + " for " + i + ")"); } if (argsNode.getRestArg() == -1 && argsNode.getOptArgs() != null) { int opt = i; IListNode optNode = argsNode.getOptArgs(); Iterator iter = optNode.iterator(); while (iter.hasNext()) { iter.next(); opt++; } if (opt < args.length) { throw new ArgumentError(ruby, "wrong # of arguments(" + args.length + " for " + opt + ")"); } // XXX ruby.getActFrame().setArgs(Arrays.asList(args)); } if (ruby.getScope().getLocalValues() != null) { if (i > 0) { for (int j = 0; j < i; j++) { ruby.getScope().setValue(j + 2, args[j]); } } if (argsNode.getOptArgs() != null) { IListNode optArgs = argsNode.getOptArgs(); Iterator iter = optArgs.iterator(); for (int j = i; j < args.length && iter.hasNext(); j++) { new AssignmentVisitor(ruby, receiver).assign((INode)iter.next(), args[j], true); i++; } // assign the default values. while (iter.hasNext()) { new EvaluateVisitor(ruby, receiver).eval((INode)iter.next()); } } if (argsNode.getRestArg() >= 0) { RubyArray array = null; if (args.length > i) { array = RubyArray.newArray(ruby, Arrays.asList(args).subList(i, args.length)); } else { array = RubyArray.newArray(ruby, 0); } ruby.getScope().setValue(argsNode.getRestArg(), array); } } } if (optionalBlockArg != null) { ruby.getScope().setValue(argsNode.getBlockArgNode().getCount(), optionalBlockArg); } if (ruby.getRuntime().getTraceFunction() != null) { //a lot of complication to try to get a line number and a file name //without a NullPointerException ISourcePosition lPos = null; if (body != null) if (body.getBodyNode() != null) if(body.getBodyNode().getPosition() != null) lPos = body.getBodyNode().getPosition(); else ; else if (body.getPosition() != null) lPos = body.getPosition(); else ; else if (argsNode != null) lPos = argsNode.getPosition(); String lFile = ruby.getSourceFile(); int lLine = ruby.getSourceLine(); if (lPos != null) { lFile = lPos.getFile(); lLine = lPos.getLine(); } ruby.getRuntime().callTraceFunction("call", lFile, lLine, receiver, name, getImplementationClass()); // XXX } return receiver.eval(body.getBodyNode()); // skip scope assignment } catch (ReturnException rExcptn) { return rExcptn.getReturnValue(); } finally { RubyVarmap.pop(ruby); ruby.getScope().pop(); if (savedNamespace != null) { ruby.setNamespace(savedNamespace); } if (ruby.getRuntime().getTraceFunction() != null) { String file = ruby.getFrameStack().getPrevious().getFile(); int line = ruby.getFrameStack().getPrevious().getLine(); if (file == null) { file = ruby.getSourceFile(); line = ruby.getSourceLine(); } ruby.getRuntime().callTraceFunction("return", file, line, receiver, name, getImplementationClass()); // XXX } } }
3,231,548
public Object testLoadCGCIHierarchyCategory(){ setUp(); log.info("loadCGCI-C:"+data.cId); hbw.loadHierarchy(CategoryData.class, data.cId, observer); return observer.result; }
public Object testLoadCGCIHierarchyCategory(){ setUp(); hbw.loadHierarchy(CategoryData.class, data.cId, observer); return observer.result; }
3,231,551
public Object testLoadCGCIHierarchyCategoryGroup(){ setUp(); log.info("loadCGCI-CG:"+data.cgId); hbw.loadHierarchy(CategoryGroupData.class, data.cgId, observer); return observer.result; }
public Object testLoadCGCIHierarchyCategoryGroup(){ setUp(); hbw.loadHierarchy(CategoryGroupData.class, data.cgId, observer); return observer.result; }
3,231,552
public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (new HashSet( cg.eachLinkedCategory( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } }
public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (makeSet( cg.sizeOfCategoryLinks(), cg.eachLinkedCategory( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } }
3,231,554
public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (new HashSet( cg.eachLinkedCategory( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } }
public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper);// Detailsif (cg.getDetails()!=null){this.setOwner((ExperimenterData) mapper.findTarget(cg.getDetails().getOwner()));}// Fields this.setName(cg.getName()); this.setDescription(cg.getDescription());// CollectionssetCategories (new HashSet( cg.eachLinkedCategory( new MapperBlock( mapper ) )));// FIXME this won't work. Needs CGCL as pointer to original// otherwise you get non-referential integrity } else { throw new IllegalArgumentException("CategoryGroupData can only copy from CategoryGroup types"); }}
3,231,555
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree,value,sel,expanded, leaf,row,hasFocus); int nodeType = getNodeType(value); if(nodeType == STRING_NODE) { setIcon(stringIcon); } else if(nodeType == NUMERIC_NODE) { setIcon(numericIcon); } else if(nodeType == ATTRIBUTE_NODE) { setIcon(typeIcon); } else if(nodeType == BOOLEAN_NODE) { setIcon(booleanIcon); } setToolTipText(((SemanticTypeTree.TreeNode)value).getFQName()); return this; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree,value,sel,expanded, leaf,row,hasFocus); int nodeType = getNodeType(value); if(nodeType == STRING_NODE) { setIcon(stringIcon); } else if(nodeType == NUMERIC_NODE) { setIcon(numericIcon); } else if(nodeType == ATTRIBUTE_NODE) { setIcon(typeIcon); } else if(nodeType == BOOLEAN_NODE) { setIcon(booleanIcon); } setToolTipText(getToolTip(value)); return this; }
3,231,556
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enumeration = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
3,231,557
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enumeration.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
3,231,558
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enum.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
final public Object build (BuildContext bc) throws BuildException { StringBuffer str = new StringBuffer(100); QuotedString qs = new QuotedString(); Enumeration enum = elements(); while (enum.hasMoreElements()) { Object txt = enumeration.nextElement(); if (txt instanceof Builder) { txt = ((Builder) txt).build(bc); } if (txt instanceof String) { str.append(txt); } else { qs.addElement(str.toString()); qs.addElement(txt); str.setLength(0); } }
3,231,559
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; }
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids, uc.getUserID()); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; }
3,231,561
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; }
privateCategoryDatagetCategory(intid,booleanwithAnnotation)throwsDSOutOfServiceException,DSAccessException{//RetrievetheuserID.UserCredentialsuc=(UserCredentials)registry.lookup(LookupNames.USER_CREDENTIALS);//Retrievethespecifiedcategory.Criteriac=CategoryMapper.buildClassificationCriteria(id);Categorycategory=(Category)gateway.retrieveSTSData("Category",c);CategoryDatamodel=newCategoryData();if(category!=null)CategoryMapper.fillCategory(category,model,uc.getUserID());if(withAnnotation){Listimgs=model.getImages();if(imgs.size()!=0){//i.e.someclassificationsListids=newArrayList();Iteratori=imgs.iterator();while(i.hasNext())ids.add(newInteger(((ImageSummary)i.next()).getID()));c=AnnotationMapper.buildImageAnnotationCriteria(ids);Listl=(List)gateway.retrieveListSTSData("ImageAnnotation",c);CategoryMapper.fillImageAnnotationInCategory(model.getClassifications(),l,uc.getUserID());}}returnmodel;}
3,231,562
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l, uc.getUserID()); } } return model; }
private CategoryData getCategory(int id, boolean withAnnotation) throws DSOutOfServiceException, DSAccessException { //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); //Retrieve the specified category. Criteria c = CategoryMapper.buildClassificationCriteria(id); Category category = (Category) gateway.retrieveSTSData("Category", c); CategoryData model = new CategoryData(); if (category != null) CategoryMapper.fillCategory(category, model, uc.getUserID()); if (withAnnotation) { List imgs = model.getImages(); if (imgs.size() != 0) { //i.e. some classifications List ids = new ArrayList(); Iterator i = imgs.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageSummary) i.next()).getID())); c = AnnotationMapper.buildImageAnnotationCriteria(ids); List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); CategoryMapper.fillImageAnnotationInCategory( model.getClassifications(), l); } } return model; }
3,231,563
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID(), uc.getUserID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
3,231,564
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
3,231,565
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
public List retrieveCategoriesNotInGroup(CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { //List of categorySummary objects List result = new ArrayList(); Criteria c = CategoryMapper.buildCategoryWithClassificationsCriteria( group.getID()); List l = (List) gateway.retrieveListSTSData("Category", c); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryWithClassifications(l, result, group, uc.getUserID()); return result; }
3,231,566
public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; }
public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; }
3,231,567
public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; }
public List retrieveCategoryGroups() throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildCategoryGroupCriteria(-1); List l = (List) gateway.retrieveListSTSData("CategoryGroup", c); List result = new ArrayList(); UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); if (l != null || l.size() > 0) CategoryMapper.fillCategoryGroup(l, result, uc.getUserID()); return result; }
3,231,568
public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); }
public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids, uc.getUserID()); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); }
3,231,569
public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); }
public Object[] retrieveICGHierarchy(List imageSummaries) throws DSOutOfServiceException, DSAccessException { if (imageSummaries == null) throw new NullPointerException("List of imageSummaries " + "cannot be null"); if (imageSummaries.size() == 0) throw new IllegalArgumentException("List of imageSummaries " + "cannot be of length 0"); Iterator i = imageSummaries.iterator(); ImageSummary is; Map map = new HashMap(); List ids = new ArrayList(); Integer id; while (i.hasNext()) { is = (ImageSummary) i.next(); id = new Integer(is.getID()); map.put(id, is); ids.add(id); } Criteria c = HierarchyMapper.buildICGHierarchyCriteria(ids); List classifications = (List) gateway.retrieveListSTSData("Classification", c); if (classifications == null) return null; UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); return HierarchyMapper.fillICGHierarchy(classifications, map, uc.getUserID()); }
3,231,570
public void updateCategory(CategoryData data, List imgsToRemove, List imgsToAdd) throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); Category category = (Category) gateway.retrieveSTSData("Category", c); category.setName(data.getName()); category.setDescription(data.getDescription()); List toUpdate = new ArrayList(), newAttributes = new ArrayList(); toUpdate.add(category); //Map classifications = data.getClassifications(); Map classifications = data.getImageClassifications(); ClassificationData cData; Classification classification; //Images to declassify if (imgsToRemove != null) { Iterator i = imgsToRemove.iterator(); List l; Iterator k; ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); l = (List) classifications.get(new Integer(is.getID())); if (l != null) { k = l.iterator(); while(k.hasNext()) { cData = (ClassificationData) k.next(); c = CategoryMapper.buildBasicClassificationCriteria( cData.getID()); classification = (Classification) gateway.retrieveSTSData("Classification", c); classification.setValid(Boolean.FALSE); toUpdate.add(classification); } } } } //Images to classify if (imgsToAdd != null) { Iterator j = imgsToAdd.iterator(); Object[] results; while (j.hasNext()) { results = buildClassification(category, ((ImageSummary) j.next()).getID()); classification = (Classification) results[1]; if (((Boolean) results[0]).booleanValue()) { newAttributes.add(classification); gateway.annotateAttributesData(newAttributes); newAttributes.removeAll(newAttributes); } else toUpdate.add(classification); } } if (newAttributes.size() != 0) //to have a mex gateway.annotateAttributesData(newAttributes); gateway.updateAttributes(toUpdate); }
public void updateCategory(CategoryData data, List imgsToRemove, List imgsToAdd) throws DSOutOfServiceException, DSAccessException { UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = CategoryMapper.buildBasicCriteria(data.getID(), uc.getUserID()); Category category = (Category) gateway.retrieveSTSData("Category", c); category.setName(data.getName()); category.setDescription(data.getDescription()); List toUpdate = new ArrayList(), newAttributes = new ArrayList(); toUpdate.add(category); //Map classifications = data.getClassifications(); Map classifications = data.getImageClassifications(); ClassificationData cData; Classification classification; //Images to declassify if (imgsToRemove != null) { Iterator i = imgsToRemove.iterator(); List l; Iterator k; ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); l = (List) classifications.get(new Integer(is.getID())); if (l != null) { k = l.iterator(); while(k.hasNext()) { cData = (ClassificationData) k.next(); c = CategoryMapper.buildBasicClassificationCriteria( cData.getID()); classification = (Classification) gateway.retrieveSTSData("Classification", c); classification.setValid(Boolean.FALSE); toUpdate.add(classification); } } } } //Images to classify if (imgsToAdd != null) { Iterator j = imgsToAdd.iterator(); Object[] results; while (j.hasNext()) { results = buildClassification(category, ((ImageSummary) j.next()).getID()); classification = (Classification) results[1]; if (((Boolean) results[0]).booleanValue()) { newAttributes.add(classification); gateway.annotateAttributesData(newAttributes); newAttributes.removeAll(newAttributes); } else toUpdate.add(classification); } } if (newAttributes.size() != 0) //to have a mex gateway.annotateAttributesData(newAttributes); gateway.updateAttributes(toUpdate); }
3,231,571
public void updateCategoryGroup(CategoryGroupData data, List toAdd) throws DSOutOfServiceException, DSAccessException { Criteria c = CategoryMapper.buildBasicCriteria(data.getID()); CategoryGroup cg = (CategoryGroup) gateway.retrieveSTSData("CategoryGroup", c); cg.setName(data.getName()); cg.setDescription(data.getDescription()); List l = new ArrayList(); l.add(cg); gateway.updateAttributes(l); /* Need to discuss the semantic of the operation //Prepare the categories to add or remove. List categories = data.getCategories(); CategorySummary cs; if (toAdd != null) { Iterator j = toAdd.iterator(); while (j.hasNext()) { cs = (CategorySummary) j.next(); if (!categories.contains(cs)) categories.add(cs); } } Iterator k = categories.iterator(); List newSelection = new ArrayList(); while (k.hasNext()) { cs = (CategorySummary) k.next(); c = CategoryMapper.buildBasicCriteria(cs.getID()); newSelection.add(gateway.retrieveSTSData("Category", c)); } */ }
public void updateCategoryGroup(CategoryGroupData data, List toAdd) throws DSOutOfServiceException, DSAccessException { UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); Criteria c = CategoryMapper.buildBasicCriteria(data.getID(), uc.getUserID()); CategoryGroup cg = (CategoryGroup) gateway.retrieveSTSData("CategoryGroup", c); cg.setName(data.getName()); cg.setDescription(data.getDescription()); List l = new ArrayList(); l.add(cg); gateway.updateAttributes(l); /* Need to discuss the semantic of the operation //Prepare the categories to add or remove. List categories = data.getCategories(); CategorySummary cs; if (toAdd != null) { Iterator j = toAdd.iterator(); while (j.hasNext()) { cs = (CategorySummary) j.next(); if (!categories.contains(cs)) categories.add(cs); } } Iterator k = categories.iterator(); List newSelection = new ArrayList(); while (k.hasNext()) { cs = (CategorySummary) k.next(); c = CategoryMapper.buildBasicCriteria(cs.getID()); newSelection.add(gateway.retrieveSTSData("Category", c)); } */ }
3,231,572
public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } }
public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } }
3,231,573
public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } }
public static void fillImageAnnotationInCategory(Map map, List annotations, int userID) { Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); Iterator i = map.keySet().iterator(); ImageSummary is; while (i.hasNext()) { is = (ImageSummary) i.next(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(is.getID())))); } }
3,231,574
public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; }
public static Criteria buildCategoryWithClassificationsCriteria(int groupID, int userID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; }
3,231,575
public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; }
public static Criteria buildCategoryWithClassificationsCriteria(int groupID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("CategoryGroup"); c.addWantedField("ClassificationList"); c.addWantedField("ClassificationList", "Valid"); c.addWantedField("ClassificationList", "image"); //Fields we want for the images c.addWantedField("ClassificationList", "module_execution"); c.addWantedField("ClassificationList.module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. if (groupID != -1) c.addFilter("CategoryGroup", "!=", new Integer(groupID)); return c; }
3,231,576
public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group, int userID) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } }
public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } }
3,231,578
public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group, int userID) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } }
public static void fillCategoryWithClassifications(List l, List result, CategoryGroupData group, int userID) { //Map of ID of the images contained in the group. Map ids = new HashMap(); CategorySummary cs; Iterator i = group.getCategories().iterator(); Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } i = l.iterator(); Category c; Map categoryMap = new HashMap(); Integer id; while (i.hasNext()) { c = (Category) i.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) categoryMap.get(id); if (cs == null) { cs = createCategorySummary(c, ids); if (cs != null) { categoryMap.put(id, cs); result.add(cs); } } else result.add(cs); } } }
3,231,579
public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } }
public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } }
3,231,580
public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } }
public static void fillCategoryGroup(List l, List result, int userID) { Map cMap = new HashMap(); Iterator i = l.iterator(); CategoryGroup cg; CategoryGroupData cgd; CategorySummary cs; Category c; Iterator j; List categories; Integer id; while (i.hasNext()) { cg = (CategoryGroup) i.next(); if (cg.getModuleExecution().getExperimenter().getID() == userID) { cgd = buildCategoryGroup(cg); categories = new ArrayList(); if (cg.getCategoryList() != null) { j = cg.getCategoryList().iterator(); while (j.hasNext()) { c = (Category) j.next(); if (c.getModuleExecution().getExperimenter().getID() == userID) { id = new Integer(c.getID()); cs = (CategorySummary) cMap.get(id); if (cs == null) { cs = createCategorySummary(c, userID); cMap.put(id, cs); } //Add the categories categories.add(cs); } } } cgd.setCategories(categories); result.add(cgd); } } }
3,231,581
protected int argCount(RubyObject[] args, int min, int max) { int len = args.length; if (len < min || (max > -1 && len > max)) { throw new RubyArgumentException(getRuby(), "wrong number of arguments"); } return len; }
protected int argCount(RubyObject[] args, int min, int max) { int len = args.length; if (len < min || (max > -1 && len > max)) { String msg = "Wrong number of arguments for method '" + ruby.getRubyFrame().getLastFunc() + "' in class " + getRubyClass().toName() + ". " + args.length + " is not in Range " + min + ".." + max; throw new RubyArgumentException(getRuby(), msg); } return len; }
3,231,583
public static Object constructYamlStr(final Constructor ctor, final Node node) { final org.jruby.RubyString str = (org.jruby.RubyString)((JRubyConstructor)ctor).constructRubyScalar(node); return str.getValue().length() == 0 ? str.getRuntime().getNil() : str; }
public static Object constructYamlStr(final Constructor ctor, final Node node) { final org.jruby.RubyString str = (org.jruby.RubyString)((JRubyConstructor)ctor).constructRubyScalar(node); return (str.getValue().length() == 0 && ((org.jvyaml.nodes.ScalarNode)node).getStyle() == 0) ? str.getRuntime().getNil() : str; }
3,231,585
public void invoke(JFrame parentFrame, PreferencesPanel contentPane) { this.prefPanel = contentPane; // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); // Construct Dialog preferenceDialog = new JDialog(parentFrame, "Preferences", true); Object[] options = {"Close"}; pane = new JOptionPane(contentPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); preferenceDialog.pack(); preferenceDialog.setSize(600, 500); preferenceDialog.setContentPane(mainPanel); preferenceDialog.setLocationRelativeTo(SparkManager.getMainWindow()); pane.addPropertyChangeListener(this); preferenceDialog.setVisible(true); }
public void invoke(JFrame parentFrame, PreferencesPanel contentPane) { this.prefPanel = contentPane; // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); // Construct Dialog preferenceDialog = new JDialog(parentFrame, "Preferences", false); Object[] options = {"Close"}; pane = new JOptionPane(contentPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); preferenceDialog.pack(); preferenceDialog.setSize(600, 500); preferenceDialog.setContentPane(mainPanel); preferenceDialog.setLocationRelativeTo(SparkManager.getMainWindow()); pane.addPropertyChangeListener(this); preferenceDialog.setVisible(false); }
3,231,586
protected PropertyEditor createPropertyEditor(String propertyEditor) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if( cl==null ) { cl = XBeanNamespaceHandler.class.getClassLoader(); } try { return (PropertyEditor)cl.loadClass(propertyEditor).newInstance(); } catch (Throwable e){ throw new IllegalArgumentException("Could not load property editor: "+propertyEditor, e); } }
protected PropertyEditor createPropertyEditor(String propertyEditor) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if( cl==null ) { cl = XBeanNamespaceHandler.class.getClassLoader(); } try { return (PropertyEditor)cl.loadClass(propertyEditor).newInstance(); } catch (Throwable e){ throw (IllegalArgumentException)new IllegalArgumentException("Could not load property editor: "+propertyEditor).initCause(e); } }
3,231,587
public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; }
public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG_TIMING) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; }
3,231,588
public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; }
public Object getContents() { long start; if (ChainBuilderAgent.DEBUG) start= System.currentTimeMillis(); ChainDataManager chainDataManager = (ChainDataManager) dataManager; if (chains == null) { chains = chainDataManager.getChains(); } Iterator iter = chains.iterator(); while (iter.hasNext()) { LayoutChainData chain = (LayoutChainData) iter.next(); reconcileChain(chain); chain.layout(); } if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("total time in chain loader"+end); } return chains; }
3,231,589
private void setBackTrace(int lineCount) { List traceLines = new ArrayList(); for (int i=0; i<lineCount; i++) traceLines.add(new RubyString(interpreter, testLine(i))); exception.set_backtrace(RubyArray.newArray(interpreter, traceLines)); }
private void setBackTrace(int lineCount) { List traceLines = new ArrayList(); for (int i=0; i<lineCount; i++) traceLines.add(new RubyString(interpreter, testLine(i))); exception.set_backtrace(RubyArray.newArray(interpreter, traceLines)); }
3,231,590
public void testPrintBacktraceWithHiddenLevels() throws Exception { setBackTrace(19); String[] lines = printError(); assertEquals(expectedTraceLine(1), lines[0]); assertEquals("\t ... 7 levels...", lines[RubyException.TRACE_HEAD]); assertEquals(expectedTraceLine(16), lines[RubyException.TRACE_HEAD + 1]); }
public void testPrintBacktraceWithHiddenLevels() throws Exception { setBackTrace(19); String[] lines = printError(); assertEquals(expectedTraceLine(1), lines[0]); assertEquals("\t ... 7 levels...", lines[RubyException.TRACE_HEAD]); assertEquals(expectedTraceLine(16), lines[RubyException.TRACE_HEAD + 1]); }
3,231,591
private void checkClass(Class klass) { if (klass.equals(ProjectData.class) || klass.equals(CategoryGroup.class)) return; throw new IllegalArgumentException("Root node not supported."); }
private void checkClass(Class klass) { if (klass.equals(ProjectData.class) || klass.equals(CategoryGroupData.class)) return; throw new IllegalArgumentException("Root node not supported."); }
3,231,592
public void load(final IRuby runtime) throws IOException { RubyZlib.createZlibModule(runtime); new BuiltinScript("zlib").load(runtime); }
public void load(final IRuby runtime) throws IOException { RubyZlib.createZlibModule(runtime); }
3,231,593
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
3,231,597
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
3,231,598
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
3,231,599
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } d1.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
3,231,600
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); test = (Dataset) iPojos.updateDataObject( test, null ); }
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); p.linkDataset( d1 ); p.linkDataset( d2 ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.linkedDatasetIterator(); Dataset test = null; while ( it.hasNext() ) { test = (Dataset) it.next(); if ( d1.getId().equals(test.getId())) break; } test.setDescription( name ); Dataset test = (Dataset) iPojos.updateDataObject( d1, null ); }
3,231,601
public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); }
public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); }
3,231,603
public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); }
public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); }
3,231,604
public Object getValue (Context context) throws PropertyException { return context.getProperty(_names[0]); }
public Object getValue (Context context) throws PropertyException { return context.getProperty(_names); }
3,231,605
public void chatRoomOpened(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.isHideChatHistory()) { return; } final String jid = room.getRoomname(); File transcriptFile = ChatTranscripts.getTranscriptFile(jid); if (!transcriptFile.exists()) { return; } final TranscriptWindow roomWindow = room.getTranscriptWindow(); final TranscriptWindow window = new TranscriptWindow(); window.setEditable(false); window.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { room.getChatInputEditor().requestFocusInWindow(); } }); insertHistory(room, roomWindow); if (room instanceof ChatRoomImpl) { // Add History Button ChatRoomButton chatRoomButton = new ChatRoomButton(SparkRes.getImageIcon(SparkRes.HISTORY_24x24_IMAGE)); room.getToolBar().addChatRoomButton(chatRoomButton); chatRoomButton.setToolTipText("View history"); chatRoomButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { ChatRoomImpl roomImpl = (ChatRoomImpl)room; showHistory(roomImpl.getParticipantJID()); } }); } }
public void chatRoomOpened(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (!pref.isChatHistoryEnabled()) { return; } final String jid = room.getRoomname(); File transcriptFile = ChatTranscripts.getTranscriptFile(jid); if (!transcriptFile.exists()) { return; } final TranscriptWindow roomWindow = room.getTranscriptWindow(); final TranscriptWindow window = new TranscriptWindow(); window.setEditable(false); window.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { room.getChatInputEditor().requestFocusInWindow(); } }); insertHistory(room, roomWindow); if (room instanceof ChatRoomImpl) { // Add History Button ChatRoomButton chatRoomButton = new ChatRoomButton(SparkRes.getImageIcon(SparkRes.HISTORY_24x24_IMAGE)); room.getToolBar().addChatRoomButton(chatRoomButton); chatRoomButton.setToolTipText("View history"); chatRoomButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { ChatRoomImpl roomImpl = (ChatRoomImpl)room; showHistory(roomImpl.getParticipantJID()); } }); } }
3,231,606
private void persistChatRoom(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.isHideChatHistory()) { return; } final String jid = room.getRoomname(); List transcripts = room.getTranscripts(); Iterator messages = transcripts.iterator(); ChatTranscript transcript = ChatTranscripts.getChatTranscript(jid); while (messages.hasNext()) { Message message = (Message)messages.next(); HistoryMessage history = new HistoryMessage(); history.setTo(message.getTo()); history.setFrom(message.getFrom()); history.setBody(message.getBody()); Date date = (Date)message.getProperty("date"); if (date != null) { history.setDate(date); } else { history.setDate(new Date()); } transcript.addHistoryMessage(history); } ChatTranscripts.saveTranscript(jid); }
private void persistChatRoom(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (!pref.isChatHistoryEnabled()) { return; } final String jid = room.getRoomname(); List transcripts = room.getTranscripts(); Iterator messages = transcripts.iterator(); ChatTranscript transcript = ChatTranscripts.getChatTranscript(jid); while (messages.hasNext()) { Message message = (Message)messages.next(); HistoryMessage history = new HistoryMessage(); history.setTo(message.getTo()); history.setFrom(message.getFrom()); history.setBody(message.getBody()); Date date = (Date)message.getProperty("date"); if (date != null) { history.setDate(date); } else { history.setDate(new Date()); } transcript.addHistoryMessage(history); } ChatTranscripts.saveTranscript(jid); }
3,231,607
private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { return ChatTranscripts.getChatTranscript(jid); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); }
private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { String bareJID = StringUtils.parseBareAddress(jid); return ChatTranscripts.getChatTranscript(bareJID); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); }
3,231,608
private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { return ChatTranscripts.getChatTranscript(jid); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); }
private void showHistory(final String jid) { SwingWorker transcriptLoader = new SwingWorker() { public Object construct() { return ChatTranscripts.getChatTranscript(jid); } public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); } }; transcriptLoader.start(); }
3,231,609
public Object construct() { return ChatTranscripts.getChatTranscript(jid); }
public Object construct() { String bareJID = StringUtils.parseBareAddress(jid); return ChatTranscripts.getChatTranscript(bareJID); }
3,231,610
public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); Collections.sort(list, dateComparator); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); }
public void finished() { final JPanel mainPanel = new BackgroundPanel(); mainPanel.setLayout(new BorderLayout()); final VCardPanel topPanel = new VCardPanel(jid); mainPanel.add(topPanel, BorderLayout.NORTH); final TranscriptWindow window = new TranscriptWindow(); final JScrollPane pane = new JScrollPane(window); pane.getVerticalScrollBar().setBlockIncrement(50); pane.getVerticalScrollBar().setUnitIncrement(20); mainPanel.add(pane, BorderLayout.CENTER); ChatTranscript transcript = (ChatTranscript)get(); List<HistoryMessage> list = transcript.getMessages(); for (HistoryMessage message : list) { String from = message.getFrom(); String nickname = StringUtils.parseName(from); final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm a"); final String date = formatter.format(message.getDate()); String prefix = nickname + " [" + date + "]"; if (from.equals(SparkManager.getSessionManager().getJID())) { window.insertCustomMessage(prefix, message.getBody()); } else { window.insertCustomOtherMessage(prefix, message.getBody()); } } // Handle no history if (transcript.getMessages().size() == 0) { window.setText("There is no current chat history."); } final JFrame frame = new JFrame("History For " + jid); frame.setIconImage(SparkRes.getImageIcon(SparkRes.HISTORY_16x16).getImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack(); frame.setSize(600, 400); window.setCaretPosition(0); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); }
3,231,611
public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); if (sf != factor) { th.scale(factor); node.setLocation((int) (r.x*factor/sf), (int) (r.y*factor/sf)); } }
public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); if (sf != factor) { th.scale(factor); double ratio = factor/sf; if (ratio < 1) ratio += EPSILON; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } }
3,231,612
public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; }
public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; }
3,231,613
public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; this.unsatisfiedConditions = unsatisfiedConditions; cause = null; }
public ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, ClassLoader classLoader, Object service, Set unsatisfiedConditions) { this.eventId = eventId; this.kernel = kernel; this.serviceName = serviceName; this.serviceFactory = serviceFactory; this.classLoader = classLoader; this.service = service; cause = null; }
3,231,614
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
publicComponentgetTreeCellRendererComponent(JTreetree,Objectvalue,booleansel,booleanexpanded,booleanleaf,introw,booleanhasFocus){super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);DefaultMutableTreeNodenode=(DefaultMutableTreeNode)value;if(node.getLevel()==0){setIcon(icons.getIcon(IconManager.ROOT));returnthis;}ObjectusrObject=node.getUserObject();Colorc=null;intw=0;FontMetricsfm=getFontMetrics(getFont());if(usrObjectinstanceofImageSet){ImageSetset=(ImageSet)usrObject;if(nodeinstanceofTreeViewNode){ w+=fm.stringWidth(((TreeViewNode)node).getNodeName()); setText(((TreeViewNode)node).toString());}elsesetText(set.toString());setValues(set.getHierarchyObject(),null);if(visibleColor){c=((ImageSet)usrObject).getHighlight();if(c==null)c=getForeground();setForeground(c);}}elseif(usrObjectinstanceofImageNode){ImageNodeimgNode=(ImageNode)usrObject;w+=fm.stringWidth(imgNode.toString());if(nodeinstanceofTreeViewNode){ w+=fm.stringWidth(((TreeViewNode)node).getNodeName()); setText(((TreeViewNode)node).toString());} elsesetText(imgNode.toString());if(thumbnail)setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon());elsesetValues(imgNode.getHierarchyObject(),null);if(visibleColor){c=imgNode.getHighlight();if(c==null)c=getForeground();setForeground(c);}}else{setText(node.toString());setValues(usrObject,null);w+=fm.stringWidth(node.toString());}w+=getIcon().getIconWidth();w+=getIconTextGap();setPreferredSize(newDimension(w,fm.getHeight()));returnthis;}
3,231,616
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else { setText(set.toString()); w += fm.stringWidth(getText()); } setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
3,231,617
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
3,231,618
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(getText()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
3,231,619
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if (node.getLevel() == 0) { setIcon(icons.getIcon(IconManager.ROOT)); return this; } Object usrObject = node.getUserObject(); Color c = null; int w = 0; FontMetrics fm = getFontMetrics(getFont()); if (usrObject instanceof ImageSet) { ImageSet set = (ImageSet) usrObject; if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(set.toString()); setValues(set.getHierarchyObject(), null); if (visibleColor) { c = ((ImageSet) usrObject).getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else if (usrObject instanceof ImageNode) { ImageNode imgNode = (ImageNode) usrObject; w += fm.stringWidth(imgNode.toString()); if (node instanceof TreeViewNode) { w += fm.stringWidth(((TreeViewNode) node).getNodeName()); setText(((TreeViewNode) node).toString()); } else setText(imgNode.toString()); if (thumbnail) setValues(imgNode.getHierarchyObject(), imgNode.getThumbnail().getIcon()); else setValues(imgNode.getHierarchyObject(), null); if (visibleColor) { c = imgNode.getHighlight(); if (c == null) c = getForeground(); setForeground(c); } } else { setText(node.toString()); setValues(usrObject, null); w += fm.stringWidth(node.toString()); } if (getIcon() != null) w += getIcon().getIconWidth(); w += getIconTextGap(); setPreferredSize(new Dimension(w, fm.getHeight())); return this; }
3,231,620
private void dumpPackage(PackageData packageData) { logger.debug("Dumping package " + packageData.getName()); double ccn = Util.getCCN(finder.findFile(packageData.getSourceFileName()), false); println("<package name=\"" + packageData.getName() + "\" line-rate=\"" + packageData.getLineCoverageRate() + "\" branch-rate=\"" + packageData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpSourceFiles(packageData); decreaseIndentation(); println("</package>"); }
private void dumpPackage(PackageData packageData) { logger.debug("Dumping package " + packageData.getName()); double ccn = Util.getCCN(finder.findFile(packageData.getSourceFileName()), false); println("<package name=\"" + packageData.getName() + "\" line-rate=\"" + packageData.getLineCoverageRate() + "\" branch-rate=\"" + packageData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpSourceFiles(packageData); decreaseIndentation(); println("</package>"); }
3,231,621
public ArticleBlock(String titleKey, WFTabListener taskbarListener) { super(titleKey); setId(ARTICLE_BLOCK_ID); getTitlebar().setValueRefTitle(true); setMainAreaStyleClass(null); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setId(TASKBAR_ID); add(tb); tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditContainer()); tb.addButtonVB(TASK_ID_PREVIEW, bref + "preview", getPreviewContainer());// tb.addButtonVB(TASK_ID_MESSAGES, bref + "messages", getMessageContainer()); tb.setSelectedButtonId(TASK_ID_EDIT); if (taskbarListener != null) { tb.addTaskbarListener(taskbarListener); } }
public ArticleBlock(String titleKey, WFTabListener taskbarListener) { super(titleKey); setId(ARTICLE_BLOCK_ID); getTitlebar().setValueRefTitle(true); setMainAreaStyleClass(null); String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setId(TASKBAR_ID); add(tb); tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditContainer()); tb.addButtonVB(TASK_ID_PREVIEW, bref + "preview", getPreviewContainer());// tb.addButtonVB(TASK_ID_MESSAGES, bref + "messages", getMessageContainer()); tb.setSelectedButtonId(TASK_ID_EDIT); if (taskbarListener != null) { tb.addTaskbarListener(taskbarListener); } }
3,231,622
private IOModes getModes(IRubyObject object) { if (object instanceof RubyString) { return new IOModes(getRuntime(), ((RubyString)object).getValue()); } else if (object instanceof RubyFixnum) { return new IOModes(getRuntime(), ((RubyFixnum)object).getLongValue()); } throw getRuntime().newTypeError("Invalid type for modes"); }
private IOModes getModes(IRubyObject object) { if (object instanceof RubyString) { return new IOModes(getRuntime(), ((RubyString)object).getValue()); } else if (object instanceof RubyFixnum) { return new IOModes(getRuntime(), ((RubyFixnum)object).getLongValue()); } throw getRuntime().newTypeError("Invalid type for modes"); }
3,231,623
public void hidePalette(BPalette palette) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } }
public void hidePalette(String name) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } }
3,231,627
public void hidePalette(BPalette palette) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } }
public void hidePalette(BPalette palette) { if(palette != null && paletteMap.containsValue(palette)) { for(Iterator iter = modelListeners.iterator(); iter.hasNext();) { BrowserTopModelListener listener = (BrowserTopModelListener)iter.next(); listener.hidePalette(palette); } paletteStatusMap.put(palette,new Integer(PALETTE_HIDDEN)); } }
3,231,628
public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); }
public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG_TIMING) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); }
3,231,630
public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); }
public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); long start; if (ChainBuilderAgent.DEBUG) start = System.currentTimeMillis(); moduleCanvas.layoutContents(); if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); }
3,231,631
public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } }
public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } }
3,231,632
public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } }
public void contentComplete() { if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); buildGUI((ModulesData) modLoader.getContents()); if (ChainBuilderAgent.DEBUG) { long guiTime =System.currentTimeMillis()-guiStart; System.err.println("time spent on module palette .."+guiTime); } uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } dataState = LOADED; } }
3,231,633
public List childNodes() { return Collections.EMPTY_LIST; }
public List childNodes() { return EMPTY_LIST; }
3,231,634
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQualifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
3,231,635
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
3,231,636
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
3,231,637
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
3,231,638
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } HashSet interfaces = new HashSet(); interfaces.addAll( getFullyQulifiedNames( javaClass.getImplementedInterfaces() ) ); System.out.println("Checking: "+javaClass.getFullyQualifiedName()); ArrayList superClasses = new ArrayList(); JavaClass p = javaClass; while( true ) { JavaClass s = javaClass.getSuperJavaClass(); if( s==null || s.equals(p) || "java.lang.Object".equals(s.getFullyQualifiedName()) ) { break; } p=s; superClasses.add(p.getFullyQualifiedName()); interfaces.addAll( getFullyQulifiedNames( p.getImplementedInterfaces() ) ); } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections, superClasses, interfaces); }
3,231,639
public ElementMapping(String namespace, String elementName, String className, String description, boolean rootElement, String initMethod, String destroyMethod, String factoryMethod, String contentProperty, Set attributes, List constructors, List flatProperties, Map maps, Map flatCollections) { if (namespace == null) throw new NullPointerException("namespace"); if (elementName == null) throw new NullPointerException("elementName"); if (className == null) throw new NullPointerException("className"); if (attributes == null) throw new NullPointerException("attributes"); if (constructors == null) throw new NullPointerException("constructors"); this.namespace = namespace; this.elementName = elementName; this.className = className; this.description = description; this.rootElement = rootElement; this.initMethod = initMethod; this.destroyMethod = destroyMethod; this.factoryMethod = factoryMethod; this.contentProperty = contentProperty; this.constructors = constructors; this.attributes = Collections.unmodifiableSet(new TreeSet(attributes)); this.maps = Collections.unmodifiableMap(maps); this.flatProperties = Collections.unmodifiableList(flatProperties); this.flatCollections = Collections.unmodifiableMap(flatCollections); Map attributesByName = new HashMap(); for (Iterator iterator = attributes.iterator(); iterator.hasNext();) { AttributeMapping attribute = (AttributeMapping) iterator.next(); attributesByName.put(attribute.getAttributeName(), attribute); } this.attributesByName = Collections.unmodifiableMap(attributesByName); }
public ElementMapping(String namespace, String elementName, String className, String description, boolean rootElement, String initMethod, String destroyMethod, String factoryMethod, String contentProperty, Set attributes, List constructors, List flatProperties, Map maps, Map flatCollections) { if (namespace == null) throw new NullPointerException("namespace"); if (elementName == null) throw new NullPointerException("elementName"); if (className == null) throw new NullPointerException("className"); if (attributes == null) throw new NullPointerException("attributes"); if (constructors == null) throw new NullPointerException("constructors"); this.namespace = namespace; this.elementName = elementName; this.className = className; this.description = description; this.rootElement = rootElement; this.initMethod = initMethod; this.destroyMethod = destroyMethod; this.factoryMethod = factoryMethod; this.contentProperty = contentProperty; this.constructors = constructors; this.attributes = Collections.unmodifiableSet(new TreeSet(attributes)); this.maps = Collections.unmodifiableMap(maps); this.flatProperties = Collections.unmodifiableList(flatProperties); this.flatCollections = Collections.unmodifiableMap(flatCollections); Map attributesByName = new HashMap(); for (Iterator iterator = attributes.iterator(); iterator.hasNext();) { AttributeMapping attribute = (AttributeMapping) iterator.next(); attributesByName.put(attribute.getAttributeName(), attribute); } this.attributesByName = Collections.unmodifiableMap(attributesByName); }
3,231,640
public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; }
public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids, uc.getUserID()); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; }
3,231,641
public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; }
public List retrieveImagesWithAnnotations(int datasetID, ImageSummary retVal) throws DSOutOfServiceException, DSAccessException { //Create a new dataObject if none provided. //Object used as prototype. if (retVal == null) retVal = new ImageSummary(); //Define the criteria by which the object graph is pulled out. List datasetIDs = new ArrayList(); datasetIDs.add(new Integer(datasetID)); Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs); //Load the graph defined by criteria. Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c); //List of image summary object. List images = new ArrayList(); //Put the server data into the corresponding client object. if (dataset == null) return images; //Retrieve the user ID. UserCredentials uc = (UserCredentials) registry.lookup(LookupNames.USER_CREDENTIALS); List ids = DatasetMapper.prepareListImagesID(dataset); c = AnnotationMapper.buildImageAnnotationCriteria(ids); if (ids != null && ids.size() != 0) { List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c); DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images); } return images; }
3,231,642
public static void fillImage(Image image, ImageData empty) { //Fill in the data coming from OMEDS object. empty.setID(image.getID()); empty.setName(image.getName()); empty.setDescription(image.getDescription()); empty.setCreated(Timestamp.valueOf(image.getCreated())); empty.setInserted(Timestamp.valueOf(image.getInserted())); //Fill in the data coming from Experimenter. Experimenter owner = image.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //dataset summary list. List datasets = new ArrayList(); Iterator i = image.getDatasets().iterator(); Dataset d; while (i.hasNext()) { d = (Dataset) i.next(); datasets.add(new DatasetSummary(d.getID(), d.getName())); } empty.setDatasets(datasets); // pixelsDescription list. if (image.getDefaultPixels() != null) { List pixels = fillPixels(image.getDefaultPixels()); empty.setPixels(pixels); } }
public static void fillImage(Image image, ImageData empty) { //Fill in the data coming from OMEDS object. empty.setID(image.getID()); empty.setName(image.getName()); empty.setDescription(image.getDescription()); empty.setCreated(Timestamp.valueOf(image.getCreated())); empty.setInserted(Timestamp.valueOf(image.getInserted())); //Fill in the data coming from Experimenter. Experimenter owner = image.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //dataset summary list. List datasets = new ArrayList(); Iterator i = image.getDatasets().iterator(); Dataset d; while (i.hasNext()) { d = (Dataset) i.next(); datasets.add(new DatasetSummary(d.getID(), d.getName())); } empty.setDatasets(datasets); // pixelsDescription list. if (image.getDefaultPixels() != null) { List pixels = fillPixels(image.getDefaultPixels()); empty.setPixels(pixels); } }
3,231,643
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, int userID, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; }
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; }
3,231,644
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, int userID, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; }
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, int userID, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations, userID); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); is.setID(id); is.setName(image.getName()); is.setDate(PrimitiveTypesMapper.getTimestamp(image.getCreated())); is.setPixelsIDs(fillListPixelsID(image)); is.setDefaultPixels(fillDefaultPixels(image.getDefaultPixels())); //Add the image summary object to the list. images.add(is); } return images; }
3,231,645
public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, int userID, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; }
public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; }
3,231,646
public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, int userID, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; }
public static List fillListAnnotatedDatasets(List projects, ProjectSummary pProto, DatasetSummary dProto, List annotations, int userID, List projectsList) { Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations, userID); Map datasetsMap = new HashMap(); Iterator i = projects.iterator(); //DataObject. ProjectSummary ps; DatasetSummary ds; Project p; Dataset d; Iterator j; List datasets; Integer id; //For each p in projects... while (i.hasNext()) { p = (Project) i.next(); //Make a new DataObject and fill it up. ps = (ProjectSummary) pProto.makeNew(); ps.setID(p.getID()); ps.setName(p.getName()); j = p.getDatasets().iterator(); datasets = new ArrayList(); while (j.hasNext()) { d = (Dataset) j.next(); id = new Integer(d.getID()); ds = (DatasetSummary) datasetsMap.get(id); if (ds == null) { //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(id.intValue()); ds.setName(d.getName()); ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation( (DatasetAnnotation) ids.get(id))); datasetsMap.put(id, ds); } //object already created this object. //Add the dataset to this project's list. datasets.add(ds); } //Link the datasets to this project. ps.setDatasets(datasets); //Add the project to the list of returned projects. projectsList.add(ps); } return projectsList; }
3,231,647
protected GeneralPath drawBezierCurve(Point2D[] pts) { GeneralPath p = new GeneralPath(); int n = pts.length; //System.err.println("drawing bezier. "+n+" points"); // width of space? int w2=100; double width =w2; double step = 1./width; double t = step; float x; float y; double newx=0; double newy=0; //System.err.println("width is "+width+", step is "+step); double[] pxi = new double[n]; double[] pyi = new double[n]; double[] px = new double[n]; double[] py = new double[n]; //more convenient notation... for (int i = 0; i < n; i++) { px[i] = pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float) px[0],(float) py[0]); for (int k = 1; k < w2; k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for (int j = n-1; j > 0; j--) { // points calculation for (int i = 0; i < j; i++) { px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t += step; } return p; }
protectedGeneralPathdrawBezierCurve(Point2D[]pts){ GeneralPathp=newGeneralPath(); intn=pts.length; //System.err.println("drawingbezier."+n+"points"); //widthofspace? intw2=100; doublewidth=w2; doublestep=1./width; doublet=step; floatx; floaty; doublenewx=0; doublenewy=0; //System.err.println("widthis"+width+",stepis"+step); double[]pxi=newdouble[n]; double[]pyi=newdouble[n]; double[]px=newdouble[n]; double[]py=newdouble[n]; //moreconvenientnotation... for(inti=0;i<n;i++){ px[i]=pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float)px[0],(float)py[0]); for(intk=1;k<w2;k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for(intj=n-1;j>0;j--){//pointscalculation for(inti=0;i<j;i++){ px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t+=step; } returnp; }
3,231,648
protected GeneralPath drawBezierCurve(Point2D[] pts) { GeneralPath p = new GeneralPath(); int n = pts.length; //System.err.println("drawing bezier. "+n+" points"); // width of space? int w2=100; double width =w2; double step = 1./width; double t = step; float x; float y; double newx=0; double newy=0; //System.err.println("width is "+width+", step is "+step); double[] pxi = new double[n]; double[] pyi = new double[n]; double[] px = new double[n]; double[] py = new double[n]; //more convenient notation... for (int i = 0; i < n; i++) { px[i] = pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float) px[0],(float) py[0]); for (int k = 1; k < w2; k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for (int j = n-1; j > 0; j--) { // points calculation for (int i = 0; i < j; i++) { px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t += step; } return p; }
protectedGeneralPathdrawBezierCurve(Point2D[]pts){ GeneralPathp=newGeneralPath(); intn=pts.length; //System.err.println("drawingbezier."+n+"points"); //widthofspace? intw2=100; doublewidth=w2; doublestep=1./width; doublet=step; floatx; floaty; doublenewx=0; doublenewy=0; //System.err.println("widthis"+width+",stepis"+step); double[]pxi=newdouble[n]; double[]pyi=newdouble[n]; double[]px=newdouble[n]; double[]py=newdouble[n]; //moreconvenientnotation... for(inti=0;i<n;i++){ px[i]=pts[i].getX(); py[i]=pts[i].getY(); } p.moveTo((float)px[0],(float)py[0]); for(intk=1;k<w2;k++){ System.arraycopy(px,0,pxi,0,n); System.arraycopy(py,0,pyi,0,n); for(intj=n-1;j>0;j--){//pointscalculation for(inti=0;i<j;i++){ px[i]=(1-t)*pxi[i]+t*pxi[i+1]; py[i]=(1-t)*pyi[i]+t*pyi[i+1]; } } p.lineTo((float)pxi[0],(float)pyi[0]); t+=step; } returnp; }
3,231,649
public void setEndCoords(float x,float y) { //System.err.println("adding link end point "+x+","+y); setPoint(pointCount,new Point2D.Float(x,y)); setLine(); }
publicif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); voidif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); setEndCoords(floatif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); x,floatif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); y)if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); { //System.err.println("addingif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); linkif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); endif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); pointif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); "+x+","+y); setPoint(pointCount,newif (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); Point2D.Float(x,y)); setLine(); }
3,231,650
public void setPoint(int index,Point2D pt) { //System.err.println("setting point # "+index+", # of points is "+points.size()); if (points.size() <= index) { points.add(index,pt); } else points.set(index,pt); updateBounds(); }
publicif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); voidif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); setPoint(intif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); index,Point2Dif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); pt)if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); { //System.err.println("settingif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); pointif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); #if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); "+index+",if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); #if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); ofif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); pointsif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); isif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); "+points.size()); ifif (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); (points.size()if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); <=if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); index)if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); { points.add(index,pt); } else points.set(index,pt); updateBounds(); }
3,231,651
public void setSelected(boolean v) { //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(); }
publicif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); voidif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); setSelected(booleanif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); v)if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); { //System.err.println("if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); settingif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); aif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); linkif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); toif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); beif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); selected.."); LinkTargetif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); startTargetif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); getStartLinkTarget(); LinkTargetif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); endTargetif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); getEndLinkTarget(); startTarget.setSelected(v); endTarget.setSelected(v); targets.removeAllChildren(); ifif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); (vif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); ==if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); true)if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); {if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); //if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); setif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); upif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); childrenif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); bulb.setPaint(Constants.LINK_HIGHLIGHT_COLOR); targets.setVisible(true); intif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); countif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); points.size(); forif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); (intif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); iif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); 1;if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); iif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); <if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); count-1;if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); i++)if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); { LinkSelectionTargetif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); tif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); newif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); LinkSelectionTarget(this,i); targets.addChild(t); Point2Dif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); ptif (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); =if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); (Point2D)if (ChainBuilderAgent.DEBUG) System.err.println(" setting a link to be selected.."); 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,231,652
private UIComponent getCategoryEditor() { WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); if(categoriesUI==null){ //id on the component is set implicitly categoriesUI=new WebDAVCategories(); //we want to set the categories also on the parent ".article" folder: categoriesUI.setCategoriesOnParent(true); categoriesUI.setDisplaySaveButton(false); categoriesUI.setDisplayHeader(false); //categoriesUI.setId(CATEGORY_EDITOR_ID); FacesContext context = getFacesContext(); String setCategories = (String) context.getExternalContext().getRequestParameterMap().get(ContentItemToolbar.PARAMETER_CATEGORIES); if(setCategories!=null){ categoriesUI.setCategories(setCategories); } //Categories are set in encodeBegin: //if(!isInCreateMode()){ //there is no resourcepath set for the article if it's about to be created // categoriesUI.setResourcePath(resourcePath); //} //parent.getChildren().add(categoriesUI); } return categoriesUI; }
private UIComponent getCategoryEditor() { WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); if(categoriesUI==null){ //id on the component is set implicitly categoriesUI=new WebDAVCategories(); //we want to set the categories also on the parent ".article" folder: categoriesUI.setCategoriesOnParent(true); categoriesUI.setDisplaySaveButton(false); categoriesUI.setDisplayHeader(false); //categoriesUI.setId(CATEGORY_EDITOR_ID); FacesContext context = getFacesContext(); String setCategories = (String) context.getExternalContext().getRequestParameterMap().get(ContentItemToolbar.PARAMETER_CATEGORIES); if(setCategories!=null){ categoriesUI.setCategories(setCategories); } //Categories are set in encodeBegin: //if(!isInCreateMode()){ //there is no resourcepath set for the article if it's about to be created // categoriesUI.setResourcePath(resourcePath); //} //parent.getChildren().add(categoriesUI); } return categoriesUI; }
3,231,653