bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } rwl.writeLock().unlock(); }
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } rwl.writeLock().unlock(); }
3,235,814
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } rwl.writeLock().unlock(); }
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } rwl.writeLock().unlock(); }
3,235,815
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } rwl.writeLock().unlock(); }
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setQuantizationMap(w, family, coefficient, noiseReduction); } }
3,235,816
public void setRGBA(int w, int red, int green, int blue, int alpha) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setRGBA(w, red, green, blue, alpha); } rwl.writeLock().unlock(); }
public void setRGBA(int w, int red, int green, int blue, int alpha) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setRGBA(w, red, green, blue, alpha); } rwl.writeLock().unlock(); }
3,235,817
public void setRGBA(int w, int red, int green, int blue, int alpha) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setRGBA(w, red, green, blue, alpha); } rwl.writeLock().unlock(); }
} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); public} finally { rwl.writeLock().unlock(); void} finally { rwl.writeLock().unlock(); setRGBA(int} finally { rwl.writeLock().unlock(); w,} finally { rwl.writeLock().unlock(); int} finally { rwl.writeLock().unlock(); red,} finally { rwl.writeLock().unlock(); int} finally { rwl.writeLock().unlock(); green,} finally { rwl.writeLock().unlock(); int} finally { rwl.writeLock().unlock(); blue,} finally { rwl.writeLock().unlock(); int} finally { rwl.writeLock().unlock(); alpha)} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); {} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); rwl.writeLock().lock();} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); {} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); if} finally { rwl.writeLock().unlock(); (renderer} finally { rwl.writeLock().unlock(); ==} finally { rwl.writeLock().unlock(); null)} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); throw} finally { rwl.writeLock().unlock(); new} finally { rwl.writeLock().unlock(); IllegalStateException(NULL_RENDERER);} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); renderer.setRGBA(w,} finally { rwl.writeLock().unlock(); red,} finally { rwl.writeLock().unlock(); green,} finally { rwl.writeLock().unlock(); blue,} finally { rwl.writeLock().unlock(); alpha);} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); }} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); rwl.writeLock().unlock();} finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); } finally { rwl.writeLock().unlock(); }
3,235,818
public void setRGBA(int w, int red, int green, int blue, int alpha) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setRGBA(w, red, green, blue, alpha); } rwl.writeLock().unlock(); }
public void setRGBA(int w, int red, int green, int blue, int alpha) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.setRGBA(w, red, green, blue, alpha); } }
3,235,819
public void updateCodomainMap(CodomainMapContext mapCtx) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.getCodomainChain().update(mapCtx.copy()); } rwl.writeLock().unlock(); }
public void updateCodomainMap(CodomainMapContext mapCtx) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.getCodomainChain().update(mapCtx.copy()); } rwl.writeLock().unlock(); }
3,235,820
public void updateCodomainMap(CodomainMapContext mapCtx) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.getCodomainChain().update(mapCtx.copy()); } rwl.writeLock().unlock(); }
public void updateCodomainMap(CodomainMapContext mapCtx) { rwl.writeLock().lock(); { if (renderer == null) throw new IllegalStateException(NULL_RENDERER); renderer.getCodomainChain().update(mapCtx.copy()); } }
3,235,821
public void usePixels(Pixels pixels) { rwl.writeLock().lock(); { this.pixelsObj = pixels; this.renderer = null; } rwl.writeLock().unlock(); }
public void usePixels(Pixels pixels) try { rwl.writeLock().lock(); try { this.pixelsObj = pixels; this.renderer = null; } rwl.writeLock().unlock(); }
3,235,822
public void usePixels(Pixels pixels) { rwl.writeLock().lock(); { this.pixelsObj = pixels; this.renderer = null; } rwl.writeLock().unlock(); }
public void usePixels(Pixels pixels) { rwl.writeLock().lock(); { this.pixelsObj = pixels; this.renderer = null; } if (log.isDebugEnabled()) log.debug("Using pixels: "+this.pixelsObj); }
3,235,823
public ClassMetaClass(IRuby runtime, RubyClass superClass) { super(runtime, null, superClass, runtime.getObject(), "Class", RubyClass.class); }
public ClassMetaClass(IRuby runtime, RubyClass superClass) { super(runtime, null, superClass, runtime.getObject().getCRef(), "Class", RubyClass.class); }
3,235,824
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
3,235,826
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
3,235,827
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane. initAxesSize(planeDef, renderer.getMetadata()); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderHSBWaveTask[] tasks = makeRndTasks(planeDef); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. //CmdProcessor processor = Env.getProcessor(); ExecutorService processor = Executors.newCachedThreadPool();//j.m while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); //j.m exec(tasks[n]); RGBBuffer rndDataBuf = null; byte[] red = null, green = null, blue = null; if (n == 0) { rndDataBuf = (RGBBuffer) tasks[0].call(); red = rndDataBuf.getRedBand(); green = rndDataBuf.getGreenBand(); blue = rndDataBuf.getBlueBand(); } //Wait for all forked tasks (if any) to complete. //When a task completes, assemble its RGB buffer into rndDataBuf. RGBBuffer taskBuffer; int x1, x2, pix; byte[] r, g, b; for (n = 1; n < rndTskFutures.length; ++n) { try { taskBuffer = (RGBBuffer) rndTskFutures[n].get();//j.m getResult(); r = taskBuffer.getRedBand(); g = taskBuffer.getGreenBand(); b = taskBuffer.getBlueBand(); for (x2 = 0; x2 < sizeX2; ++x2) { for (x1 = 0; x1 < sizeX1; ++x1) { pix = sizeX1*x2+x1; red[pix] = (byte) (red[pix]+r[pix]); green[pix] = (byte) (green[pix]+g[pix]); blue[pix] = (byte) (blue[pix]+b[pix]); } } } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); if (rndDataBuf == null) //No active channel, return a black image. return new RGBBuffer(sizeX1, sizeX2); //Done. return rndDataBuf; }
3,235,828
public CGCILoader(HiViewer viewer, Set images) { super(viewer); this.images = images; }
public CGCILoader(HiViewer viewer, Set images, boolean refresh) { super(viewer); this.images = images; }
3,235,829
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false); }
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false, refresh); }
3,235,831
EvalThread(String name, String script) { this.name = RubyString.newString(ruby, name); this.script = RubyString.newString(ruby, script); }
EvalThread(String name, String script) { this.name = RubyString.newString(ruby, name); this.script = RubyString.newString(ruby, script); }
3,235,832
public void run() { ruby.getRuntime().loadScript(name, script, false); out.close(); }
public void run() { ruby.getRuntime().loadScript(name, script, false); out.close(); }
3,235,833
public TestRubyBase(String name) { super(name); }
public TestRubyBase(String name) { super(name); }
3,235,834
protected String eval(String script) { pipeIn = new PipedInputStream(); in = new BufferedReader(new InputStreamReader(pipeIn)); String output = null; StringBuffer result = new StringBuffer(); try { out = new PrintStream(new PipedOutputStream(pipeIn), true); // ruby.getRuntime().setOutputStream(out); // ruby.getRuntime().setErrorStream(out); RubyIO lStream = new RubyIO(ruby); lStream.initIO(null, out, null); ruby.setGlobalVar("$stdout", lStream); ruby.setGlobalVar("$>", lStream); lStream = (RubyIO) ruby.getGlobalVar("$stderr"); lStream.initIO(null, out, null); ruby.setGlobalVar("$stderr", lStream); new EvalThread("test", script).start(); while ((output = in.readLine()) != null) { result.append(output); } } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } return result.toString(); }
protected String eval(String script) { pipeIn = new PipedInputStream(); in = new BufferedReader(new InputStreamReader(pipeIn)); String output = null; StringBuffer result = new StringBuffer(); try { out = new PrintStream(new PipedOutputStream(pipeIn), true); // ruby.getRuntime().setOutputStream(out); // ruby.getRuntime().setErrorStream(out); RubyIO lStream = new RubyIO(ruby); lStream.initIO(null, out, null); ruby.setGlobalVar("$stdout", lStream); ruby.setGlobalVar("$>", lStream); lStream = (RubyIO) ruby.getGlobalVar("$stderr"); lStream.initIO(null, out, null); ruby.setGlobalVar("$stderr", lStream); new EvalThread("test", script).start(); while ((output = in.readLine()) != null) { result.append(output); } } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } return result.toString(); }
3,235,835
protected String eval(String script) { pipeIn = new PipedInputStream(); in = new BufferedReader(new InputStreamReader(pipeIn)); String output = null; StringBuffer result = new StringBuffer(); try { out = new PrintStream(new PipedOutputStream(pipeIn), true); // ruby.getRuntime().setOutputStream(out); // ruby.getRuntime().setErrorStream(out); RubyIO lStream = new RubyIO(ruby); lStream.initIO(null, out, null); ruby.setGlobalVar("$stdout", lStream); ruby.setGlobalVar("$>", lStream); lStream = (RubyIO) ruby.getGlobalVar("$stderr"); lStream.initIO(null, out, null); ruby.setGlobalVar("$stderr", lStream); new EvalThread("test", script).start(); while ((output = in.readLine()) != null) { result.append(output); } } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } return result.toString(); }
protected String eval(String script) { pipeIn = new PipedInputStream(); in = new BufferedReader(new InputStreamReader(pipeIn)); String output = null; StringBuffer result = new StringBuffer(); try { out = new PrintStream(new PipedOutputStream(pipeIn), true); // ruby.getRuntime().setOutputStream(out); // ruby.getRuntime().setErrorStream(out); RubyIO lStream = new RubyIO(ruby); lStream.initIO(null, out, null); ruby.setGlobalVar("$stdout", lStream); ruby.setGlobalVar("$>", lStream); lStream = (RubyIO) ruby.getGlobalVar("$stderr"); lStream.initIO(null, out, null); ruby.setGlobalVar("$stderr", lStream); new EvalThread("test", script).start(); while ((output = in.readLine()) != null) { result.append(output); } } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } return result.toString(); }
3,235,836
public void tearDown() { try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) { } }
public void tearDown() { try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) { } }
3,235,837
public void eventFired(AgentEvent ae) { if (ae instanceof ShowProperties) handleShowProperties((ShowProperties) ae); }
public void eventFired(AgentEvent ae) { if (ae instanceof ShowProperties) handleShowProperties((ShowProperties) ae); }
3,235,838
final public String toString () { StringBuffer sb = new StringBuffer(); String eol = java.lang.System.getProperty("line.separator"); for (Enumeration enum = _request.getParameterNames(); enum.hasMoreElements();) { String key = (String) enum.nextElement(); String[] value = _request.getParameterValues(key); for (int x = 0; value != null && x < value.length; x++) { sb.append(key).append("=").append(value[x]).append(eol); } }
final public String toString () { StringBuffer sb = new StringBuffer(); String eol = java.lang.System.getProperty("line.separator"); for (Enumeration enumeration = _request.getParameterNames(); enumeration.hasMoreElements();) { String key = (String) enum.nextElement(); String[] value = _request.getParameterValues(key); for (int x = 0; value != null && x < value.length; x++) { sb.append(key).append("=").append(value[x]).append(eol); } }
3,235,839
final public String toString () { StringBuffer sb = new StringBuffer(); String eol = java.lang.System.getProperty("line.separator"); for (Enumeration enum = _request.getParameterNames(); enum.hasMoreElements();) { String key = (String) enum.nextElement(); String[] value = _request.getParameterValues(key); for (int x = 0; value != null && x < value.length; x++) { sb.append(key).append("=").append(value[x]).append(eol); } }
final public String toString () { StringBuffer sb = new StringBuffer(); String eol = java.lang.System.getProperty("line.separator"); for (Enumeration enum = _request.getParameterNames(); enum.hasMoreElements();) { String key = (String) enumeration.nextElement(); String[] value = _request.getParameterValues(key); for (int x = 0; value != null && x < value.length; x++) { sb.append(key).append("=").append(value[x]).append(eol); } }
3,235,840
public void loadPlugins() { // Add presence and message listeners // we listen for these to force open a 1-1 peer chat window from other operators if // one isn't already open PacketFilter workspaceMessageFilter = new PacketTypeFilter(Message.class); // Add the packetListener to this instance SparkManager.getSessionManager().getConnection().addPacketListener(this, workspaceMessageFilter); // Make presence available to anonymous requests, if from anonymous user in the system. PacketListener workspacePresenceListener = new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getProperty("anonymous") != null) { boolean isAvailable = statusBox.getPresence().getMode() == Presence.Mode.available; Presence reply = new Presence(Presence.Type.available); if (!isAvailable) { reply.setType(Presence.Type.unavailable); } reply.setTo(presence.getFrom()); SparkManager.getSessionManager().getConnection().sendPacket(reply); } } }; SparkManager.getSessionManager().getConnection().addPacketListener(workspacePresenceListener, new PacketTypeFilter(Presence.class)); // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); // Load Plugins SwingWorker worker = new SwingWorker() { public Object construct() { try { Thread.sleep(100); } catch (InterruptedException e) { Log.error("Unable to sleep thread.", e); } return "ok"; } public void finished() { final PluginManager pluginManager = PluginManager.getInstance(); pluginManager.loadPlugins(); pluginManager.initializePlugins(); } }; worker.start(); int numberOfMillisecondsInTheFuture = 5000; // 5 sec Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator offlineMessage = offlineMessages.iterator(); while (offlineMessage.hasNext()) { Message offline = (Message)offlineMessage.next(); handleOfflineMessage(offline); } } }); } }, timeToRun); }
public void loadPlugins() { // Add presence and message listeners // we listen for these to force open a 1-1 peer chat window from other operators if // one isn't already open PacketFilter workspaceMessageFilter = new PacketTypeFilter(Message.class); // Add the packetListener to this instance SparkManager.getSessionManager().getConnection().addPacketListener(this, workspaceMessageFilter); // Make presence available to anonymous requests, if from anonymous user in the system. PacketListener workspacePresenceListener = new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getProperty("anonymous") != null) { boolean isAvailable = statusBox.getPresence().getMode() == Presence.Mode.available; Presence reply = new Presence(Presence.Type.available); if (!isAvailable) { reply.setType(Presence.Type.unavailable); } reply.setTo(presence.getFrom()); SparkManager.getSessionManager().getConnection().sendPacket(reply); } } }; SparkManager.getSessionManager().getConnection().addPacketListener(workspacePresenceListener, new PacketTypeFilter(Presence.class)); // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); // Load Plugins SwingWorker worker = new SwingWorker() { public Object construct() { try { Thread.sleep(100); } catch (InterruptedException e) { Log.error("Unable to sleep thread.", e); } return "ok"; } public void finished() { final PluginManager pluginManager = PluginManager.getInstance(); pluginManager.loadPlugins(); pluginManager.initializePlugins(); } }; worker.start(); int numberOfMillisecondsInTheFuture = 10000; // 5 sec Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator offlineMessage = offlineMessages.iterator(); while (offlineMessage.hasNext()) { Message offline = (Message)offlineMessage.next(); handleOfflineMessage(offline); } } }); } }, timeToRun); }
3,235,842
public ModelBased map (Filterable source){ // TODO take any object. just like filter() Filterable o = this.filter("MAPPING...",source); return (ModelBased) model2target.get(o); }
public ModelBased map (Filterable source){ // TODO take any object. just like filter() Filterable o = this.filter("MAPPING...",source); return (ModelBased) model2target.get(o); }
3,235,843
public AnnotateAction(TreeViewer model) { super(model); name = NAME; //putValue(Action.NAME, NAME); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); IconManager im = IconManager.getInstance(); putValue(Action.SMALL_ICON, im.getIcon(IconManager.ANNOTATION)); }
publicAnnotateAction(TreeViewermodel){super(model);name=NAME;//putValue(Action.NAME,NAME);putValue(Action.SHORT_DESCRIPTION,UIUtilities.formatToolTipText(DESCRIPTION));IconManagerim=IconManager.getInstance();putValue(Action.SMALL_ICON,im.getIcon(IconManager.ANNOTATION));}
3,235,844
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } Browser browser = model.getSelectedBrowser(); if (browser != null) { if (browser.getSelectedDisplays().length > 1) { Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); return; } } Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); }
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } Browser browser = model.getSelectedBrowser(); if (browser != null) { if (browser.getSelectedDisplays().length > 1) { Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); return; } } Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); }
3,235,846
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } Browser browser = model.getSelectedBrowser(); if (browser != null) { if (browser.getSelectedDisplays().length > 1) { Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); return; } } Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); }
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } Browser browser = model.getSelectedBrowser(); if (browser != null) { if (browser.getSelectedDisplays().length > 1) { Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); return; } } Object ho = selectedDisplay.getUserObject(); setEnabled((ho instanceof ImageData) || (ho instanceof DatasetData)); }
3,235,847
int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*(x-tW)+b); }
int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*(x-tW)+b); }
3,235,848
public void setPaneIndex(int index) { if (index != SEARCH_PANEL && index != ANNOTATION_PANEL) throw new IllegalArgumentException("Pane index not valid."); if (model.getPaneIndex() == index) return; model.setPaneIndex(index); view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); view.setSelectedPane(index); if (index != ANNOTATION_PANEL) discardAnnotation(); }
public void setPaneIndex(int index, ImageDisplay node) { if (index != SEARCH_PANEL && index != ANNOTATION_PANEL) throw new IllegalArgumentException("Pane index not valid."); if (model.getPaneIndex() == index) return; model.setPaneIndex(index); view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); view.setSelectedPane(index); if (index != ANNOTATION_PANEL) discardAnnotation(); }
3,235,849
public void setPaneIndex(int index) { if (index != SEARCH_PANEL && index != ANNOTATION_PANEL) throw new IllegalArgumentException("Pane index not valid."); if (model.getPaneIndex() == index) return; model.setPaneIndex(index); view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); view.setSelectedPane(index); if (index != ANNOTATION_PANEL) discardAnnotation(); }
public void setPaneIndex(int index) { if (index != SEARCH_PANEL && index != ANNOTATION_PANEL) throw new IllegalArgumentException("Pane index not valid."); if (model.getPaneIndex() == index) return; model.setPaneIndex(index); view.onDisplayChange( model.getParentModel().getBrowser().getSelectedDisplay()); view.setSelectedPane(index); if (index != ANNOTATION_PANEL) discardAnnotation(); }
3,235,850
public void visitForNode(ForNode iVisited) { threadContext.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self); threadContext.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { SourcePosition position = threadContext.getPosition(); Block tmpBlock = threadContext.beginCallArgs(); IRubyObject recv = null; try { recv = eval(iVisited.getIterNode()); } finally { threadContext.setPosition(position); threadContext.endCallArgs(tmpBlock); } result = recv.getMetaClass().call(recv, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); return; } catch (RetryJump retry) { } } } catch (BreakJump bExcptn) { IRubyObject breakValue = bExcptn.getBreakValue(); result = breakValue == null ? runtime.getNil() : breakValue; } finally { threadContext.getIterStack().pop(); threadContext.getBlockStack().pop(); } }
public void visitForNode(ForNode iVisited) { threadContext.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode(), iVisited.getVarNode()), self); threadContext.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { SourcePosition position = threadContext.getPosition(); Block tmpBlock = threadContext.beginCallArgs(); IRubyObject recv = null; try { recv = eval(iVisited.getIterNode()); } finally { threadContext.setPosition(position); threadContext.endCallArgs(tmpBlock); } result = recv.getMetaClass().call(recv, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); return; } catch (RetryJump retry) { } } } catch (BreakJump bExcptn) { IRubyObject breakValue = bExcptn.getBreakValue(); result = breakValue == null ? runtime.getNil() : breakValue; } finally { threadContext.getIterStack().pop(); threadContext.getBlockStack().pop(); } }
3,235,852
public void visitIterNode(IterNode iVisited) { threadContext.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self); threadContext.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { result = eval(iVisited.getIterNode()); return; } catch (RetryJump rExcptn) { } } } catch (BreakJump bExcptn) { IRubyObject breakValue = bExcptn.getBreakValue(); result = breakValue == null ? runtime.getNil() : breakValue; } finally { threadContext.getIterStack().pop(); threadContext.getBlockStack().pop(); } }
public void visitIterNode(IterNode iVisited) { threadContext.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode(), iVisited.getVarNode()), self); threadContext.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { result = eval(iVisited.getIterNode()); return; } catch (RetryJump rExcptn) { } } } catch (BreakJump bExcptn) { IRubyObject breakValue = bExcptn.getBreakValue(); result = breakValue == null ? runtime.getNil() : breakValue; } finally { threadContext.getIterStack().pop(); threadContext.getBlockStack().pop(); } }
3,235,853
public List childNodes() { return Collections.EMPTY_LIST; }
public List childNodes() { return EMPTY_LIST; }
3,235,855
public static IRubyObject method_missing(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); if (args.length == 0) { throw recv.getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = recv.callMethod(runtime.getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = runtime.getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : recv.getType().getName()}); throw lastCallType == CallType.VARIABLE ? runtime.newNameError(msg) : runtime.newNoMethodError(msg); }
public static IRubyObject method_missing(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); if (args.length == 0) { throw recv.getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = recv.callMethod(runtime.getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = runtime.getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : recv.getType().getName()}); throw lastCallType == CallType.VARIABLE ? runtime.newNameError(msg, name) : runtime.newNoMethodError(msg, name); }
3,235,856
public static IRubyObject rbThrow(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); String tag = args[0].asSymbol(); String[] catches = runtime.getCurrentContext().getActiveCatches(); String message = "uncaught throw '" + tag + '\''; //Ordering of array traversal not important, just intuitive for (int i = catches.length - 1 ; i >= 0 ; i--) { if (tag.equals(catches[i])) { //Catch active, throw for catch to handle JumpException je = new JumpException(JumpException.JumpType.ThrowJump); je.setPrimaryData(tag); je.setSecondaryData(args.length > 1 ? args[1] : runtime.getNil()); throw je; } } //No catch active for this throw throw runtime.newNameError(message); }
public static IRubyObject rbThrow(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); String tag = args[0].asSymbol(); String[] catches = runtime.getCurrentContext().getActiveCatches(); String message = "uncaught throw '" + tag + '\''; //Ordering of array traversal not important, just intuitive for (int i = catches.length - 1 ; i >= 0 ; i--) { if (tag.equals(catches[i])) { //Catch active, throw for catch to handle JumpException je = new JumpException(JumpException.JumpType.ThrowJump); je.setPrimaryData(tag); je.setSecondaryData(args.length > 1 ? args[1] : runtime.getNil()); throw je; } } //No catch active for this throw throw runtime.newNameError(message, tag); }
3,235,857
public void actionPerformed(ActionEvent e) { ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } } }
public void actionPerformed(ActionEvent e) { ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } } }
3,235,859
public void actionPerformed(ActionEvent e) { for (ChatRoom rooms : getStaleChatRooms()) { closeTab(rooms); } }
public void actionPerformed(ActionEvent e) { for (ChatRoom rooms : getStaleChatRooms()) { closeTab(rooms); } }
3,235,861
public void run() { final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasJoined(room, userid); } }
public void run() { final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasJoined(room, userid); } }
3,235,862
public void run() { final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasLeft(room, userid); } }
public void run() { final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasJoined(room, userid); } }
3,235,863
public void run() { try { final int index = indexOfComponent(room); if (index != -1) { room.increaseUnreadMessageCount(); int unreadMessageCount = room.getUnreadMessageCount(); String appendedMessage = ""; if (unreadMessageCount > 1) { appendedMessage = " (" + unreadMessageCount + ")"; } SparkTab tab = getTabAt(index); tab.getTitleLabel().setText(room.getTabTitle() + appendedMessage); // Check notifications. if (room instanceof ChatRoomImpl) { checkNotificationPreferences(room); } makeTabRed(room); } boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); } }
public void run() { try { final int index = indexOfComponent(room); if (index != -1) { room.increaseUnreadMessageCount(); int unreadMessageCount = room.getUnreadMessageCount(); String appendedMessage = ""; if (unreadMessageCount > 1) { appendedMessage = " (" + unreadMessageCount + ")"; } SparkTab tab = getTabAt(index); tab.getTitleLabel().setText(room.getTabTitle() + appendedMessage); // Check notifications. if (room instanceof ChatRoomImpl) { checkNotificationPreferences(room); } makeTabRed(room); } boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); } }
3,235,864
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); }
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); }
3,235,865
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); }
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); }
3,235,866
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); }
public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } }
3,235,867
public RubyObject reverse_bang() { modify(); Collections.reverse(list); return this; }
public RubyObject reverse_bang() { modify(); Collections.reverse(list); return this; }
3,235,869
public void visitCallNode(CallNode iVisited) { EvaluateVisitor evaluator = EvaluateVisitor.createVisitor(self); IRubyObject receiver = evaluator.eval(iVisited.getReceiverNode()); if (iVisited.getArgsNode() == null) { // attribute set. receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), new IRubyObject[] {value}, 0); } else { // element set RubyArray args = (RubyArray) evaluator.eval(iVisited.getArgsNode()); args.append(value); receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), args.toJavaArray(), 0); } }
public void visitCallNode(CallNode iVisited) { EvaluateVisitor evaluator = EvaluateVisitor.createVisitor(self); IRubyObject receiver = evaluator.eval(iVisited.getReceiverNode()); if (iVisited.getArgsNode() == null) { // attribute set. receiver.getInternalClass().call(receiver, iVisited.getName(), new IRubyObject[] {value}, 0); } else { // element set RubyArray args = (RubyArray) evaluator.eval(iVisited.getArgsNode()); args.append(value); receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), args.toJavaArray(), 0); } }
3,235,870
public void visitCallNode(CallNode iVisited) { EvaluateVisitor evaluator = EvaluateVisitor.createVisitor(self); IRubyObject receiver = evaluator.eval(iVisited.getReceiverNode()); if (iVisited.getArgsNode() == null) { // attribute set. receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), new IRubyObject[] {value}, 0); } else { // element set RubyArray args = (RubyArray) evaluator.eval(iVisited.getArgsNode()); args.append(value); receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), args.toJavaArray(), 0); } }
public void visitCallNode(CallNode iVisited) { EvaluateVisitor evaluator = EvaluateVisitor.createVisitor(self); IRubyObject receiver = evaluator.eval(iVisited.getReceiverNode()); if (iVisited.getArgsNode() == null) { // attribute set. receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), new IRubyObject[] {value}, 0); } else { // element set RubyArray args = (RubyArray) evaluator.eval(iVisited.getArgsNode()); args.append(value); receiver.getInternalClass().call(receiver, iVisited.getName(), args.toJavaArray(), 0); } }
3,235,871
public void loadDataset(int datasetID) { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette modePalette = PaletteFactory.getMainPalette(model,topModel); topModel.addPalette("Modes",modePalette); BPalette paintPalette = PaletteFactory.getPaintModePalette(model,topModel); topModel.addPalette("Overlays",paintPalette); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); modePalette.setOffset(0,0); paintPalette.setOffset(0,75); zoomPalette.setOffset(0,125); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); int count = env.getBrowserManager().getBrowserCount(); env.getBrowserManager().addBrowser(controller); final int browserIndex = count; final BrowserInternalFrame bif = new BrowserInternalFrame(controller); StatusBar status = controller.getStatusView(); tf.addToDesktop(bif,TopFrame.PALETTE_LAYER); bif.setClosable(true); bif.setIconifiable(true); bif.setMaximizable(true); bif.setResizable(true); bif.show(); final int theDataset = datasetID; Thread retrieveThread = new Thread() { public void run() { try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { // pop up new login window (eventually caught) throw new RuntimeException(dsoe); } } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
public void loadDataset(int datasetID) { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette modePalette = PaletteFactory.getMainPalette(model,topModel); topModel.addPalette("Modes",modePalette); BPalette paintPalette = PaletteFactory.getPaintModePalette(model,topModel); topModel.addPalette("Overlays",paintPalette); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); modePalette.setOffset(0,0); paintPalette.setOffset(0,75); zoomPalette.setOffset(0,125); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); int count = env.getBrowserManager().getBrowserCount(); final int browserIndex = count; final BrowserInternalFrame bif = new BrowserInternalFrame(controller); StatusBar status = controller.getStatusView(); tf.addToDesktop(bif,TopFrame.PALETTE_LAYER); bif.setClosable(true); bif.setIconifiable(true); bif.setMaximizable(true); bif.setResizable(true); bif.show(); final int theDataset = datasetID; Thread retrieveThread = new Thread() { public void run() { try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { // pop up new login window (eventually caught) throw new RuntimeException(dsoe); } } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
3,235,872
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
3,235,874
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
3,235,875
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
public void run() { int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ImageData data = new ImageData(); data.setID(sum.getID()); data.setName(sum.getName()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ImageData data = new ImageData(); data.setID(pix.getID()); ThumbnailDataModel tdm = new ThumbnailDataModel(data); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; String message = ProgressMessageFormatter.format("Loaded image %n of %t...", count,total); status.processAdvanced(message); } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; }
3,235,876
public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); }
public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); }
3,235,879
public void run() { model.addThumbnail(t); }
public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); }
3,235,880
public void loadImage(int imageID) { // TODO: fill in loadImage(int) }
public void loadImage(Thumbnail t) { // TODO: fill in loadImage(int) }
3,235,881
public void loadImage(int imageID) { // TODO: fill in loadImage(int) }
ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); publicThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); voidThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); loadImage(intThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); imageID)ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); {ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); //ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); TODO:ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); fillThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); inThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); loadImage(int)ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); ThumbnailDataModel tdm = t.getModel(); int imageID = tdm.getID(); Pixels pixels = (Pixels)tdm.getAttributeMap().getAttribute("Pixels"); int pixelsID = pixels.getID(); loadImage(imageID,pixelsID); }
3,235,882
public void write(FastWriter out, Context context) throws PropertyException, IOException { Broker broker = context.getBroker(); // the filename arg passed to us was a Macro, so // evaluate and check it now if (_macFilename != null) { _strFilename = _macFilename.evaluate(context).toString(); if (_strFilename == null || _strFilename.length() == 0) { throw makePropertyException("Filename cannot be null or empty"); } } if (_log.loggingDebug() && context.getCurrentLocation().indexOf(_strFilename) > -1) { // when in debug mode, output a warning if a template tries to include itself // there are situtations where this is desired, but it's good to make // the user aware of what they're doing _log.warning(context.getCurrentLocation() + " includes itself."); } // this should only be true if StrictCompatibility is set to false // and "as <something>" wasn't specified in the arg list if (_type == TYPE_DYNAMIC) _type = guessType(broker, _strFilename); if (_log.loggingDebug()) { _log.debug("Including '" + _strFilename + "' as " + ((_type == TYPE_MACRO) ? "MACRO" : (_type == TYPE_TEMPLATE) ? "TEMPLATE" : (_type == TYPE_TEXT) ? "TEXT" : "UNKNOWN. Throwing exceptin")); } Object toInclude = getThingToInclude(broker, _type, _strFilename); switch (_type) { case TYPE_MACRO: // during runtime evaluation of a template, // a TYPE_MACRO doesn't really work as expected. // we logged a warning above in build(), but // we still need to write it out as a template // so just fall through case TYPE_TEMPLATE: ((Template) toInclude).write(out, context); break; case TYPE_TEXT: // static types are strings out.write(toInclude.toString()); break; default: // should never happen throw makePropertyException("Unrecognized file type: " + _type); } }
public void write(FastWriter out, Context context) throws PropertyException, IOException { Broker broker = context.getBroker(); // the filename arg passed to us was a Macro, so // evaluate and check it now if (_macFilename != null) { _strFilename = _macFilename.evaluate(context).toString(); if (_strFilename == null || _strFilename.length() == 0) { throw makePropertyException("Filename cannot be null or empty"); } } if (_log.loggingDebug() && context.getCurrentLocation().indexOf(_strFilename) > -1) { // when in debug mode, output a warning if a template tries to include itself // there are situtations where this is desired, but it's good to make // the user aware of what they're doing _log.warning(context.getCurrentLocation() + " includes itself."); } // this should only be true if StrictCompatibility is set to false // and "as <something>" wasn't specified in the arg list if (_type == TYPE_DYNAMIC) _type = guessType(broker, _strFilename); if (_log.loggingDebug()) { _log.debug("Including '" + _strFilename + "' as " + ((_type == TYPE_MACRO) ? "MACRO" : (_type == TYPE_TEMPLATE) ? "TEMPLATE" : (_type == TYPE_TEXT) ? "TEXT" : "UNKNOWN. Throwing exception")); } Object toInclude = getThingToInclude(broker, _type, _strFilename); switch (_type) { case TYPE_MACRO: // during runtime evaluation of a template, // a TYPE_MACRO doesn't really work as expected. // we logged a warning above in build(), but // we still need to write it out as a template // so just fall through case TYPE_TEMPLATE: ((Template) toInclude).write(out, context); break; case TYPE_TEXT: // static types are strings out.write(toInclude.toString()); break; default: // should never happen throw makePropertyException("Unrecognized file type: " + _type); } }
3,235,883
int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*(x-tW)+b); }
int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*(x-tW)+b); }
3,235,884
public void add(int index, Object element) { autoResize(Math.max(0, index + position - 1)); delegate.add(index + position, element); }
public void add(int index, Object element) { autoResize(Math.max(0, index + position)); delegate.add(index + position, element); }
3,235,885
protected void autoResize(int index) { if (!autoResize) { return; } else if (index < 0) { delegate.addAll(0, Collections.nCopies(-index, autoResizeObject)); position += -index; } else if (index >= delegate.size()) { delegate.ensureCapacity(index); for (int i = delegate.size(); i <= index; i++) { delegate.add(autoResizeObject); } } }
protected void autoResize(int index) { if (!autoResize) { return; } else if (index < 0) { delegate.addAll(0, Collections.nCopies(-index, autoResizeObject)); position += -index; } else if (index >= delegate.size()) { delegate.ensureCapacity(index); for (int i = delegate.size(); i <= index; i++) { delegate.add(autoResizeObject); } } }
3,235,886
protected void autoResize(int index) { if (!autoResize) { return; } else if (index < 0) { delegate.addAll(0, Collections.nCopies(-index, autoResizeObject)); position += -index; } else if (index >= delegate.size()) { delegate.ensureCapacity(index); for (int i = delegate.size(); i <= index; i++) { delegate.add(autoResizeObject); } } }
protected void autoResize(int index) { if (!autoResize) { return; } else if (index < 0) { delegate.addAll(0, Collections.nCopies(-index, autoResizeObject)); position += -index; } else if (index >= delegate.size()) { delegate.ensureCapacity(index); for (int i = delegate.size(); i < index; i++) { delegate.add(autoResizeObject); } } }
3,235,887
public Object get(int index) { autoResize(index + position); return delegate.get(index + position); }
public Object get(int index) { autoResize(index + position + 1); return delegate.get(index + position); }
3,235,888
public Object set(int index, Object element) { autoResize(index + position); return delegate.set(index + position, element); }
public Object set(int index, Object element) { autoResize(index + position + 1); return delegate.set(index + position, element); }
3,235,889
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = wm.getContext(); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } try { context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); context.put("today", new Date()); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); FastWriter w = new FastWriter(System.out, "UTF8"); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = wm.getContext(); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } try { context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); context.put("today", new Date()); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); FastWriter w = new FastWriter(System.out, context.getEncoding()); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
3,235,890
private void init() { env = BrowserEnvironment.getInstance(); setBackground(new Color(192,192,192)); layoutMap = new HashMap(); footprint = new Rectangle2D.Double(0,0,0,0); // here we disable zoom/pan (TODO: save for later, reinstate on mode) removeInputEventListener(getZoomEventHandler()); removeInputEventListener(getPanEventHandler()); panHandler = new BoundedDragPanHandler(null); addInputEventListener(panHandler); }
private void init() { env = BrowserEnvironment.getInstance(); setBackground(new Color(192,192,192)); layoutMap = new HashMap(); footprint = new Rectangle2D.Double(0,0,0,0); // here we disable zoom/pan (TODO: save for later, reinstate on mode) removeInputEventListener(getZoomEventHandler()); removeInputEventListener(getPanEventHandler()); panHandler = new BoundedEdgePanHandler(); addInputEventListener(panHandler); }
3,235,891
public String toString(){ return "ImageDimension"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); }
public String toString(){ return "ImageDimension"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); }
3,235,892
public PojosLoadHierarchyQueryDefinition(QueryParameter... parameters) { super(parameters); }
public PojosLoadHierarchyQueryDefinition(QueryParameter... parameters) { super( defs, parameters); }
3,235,893
protected static Method findMethod(String name) { Class type = PropertyEditorHelper.loadClass("org.apache.xbean.spring.context.impl.QNameHelper"); if (type != null) { Method[] methods = type.getMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().equals(name)) { return method; } } } return null; }
protected static Method findMethod(String name) { Class type = PropertyEditorHelper.loadClass("org.apache.xbean.spring.context.impl.QNameHelper"); if (type != null) { Method[] methods = type.getMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().equals(name)) { return method; } } } return null; }
3,235,894
public static RubyObject m_print(Ruby ruby, RubyObject args[]) { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.print(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } return ruby.getNil(); }
public static RubyObject m_print(Ruby ruby, RubyModule rubyClass, RubyObject args[]) { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.print(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } return ruby.getNil(); }
3,235,896
public static RubyObject m_puts(Ruby ruby, RubyObject args[]) { if (args.length == 0) { System.out.println(); } else { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } } return ruby.getNil(); }
public static RubyObject m_puts(Ruby ruby, RubyModule rubyClass, RubyObject args[]) { if (args.length == 0) { System.out.println(); } else { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } } return ruby.getNil(); }
3,235,897
public Object invoke(MethodInvocation arg0) throws Throwable { CurrentDetails.clear(); setDetails(); try { Object retVal = arg0.proceed(); ht.flush(); // TODO performance? but HInterceptor is flushing // after finally { clear } return retVal; } finally { CurrentDetails.clear(); } }
public Object invoke(MethodInvocation arg0) throws Throwable { CurrentDetails.clear(); setDetails(); try { Object retVal = arg0.proceed(); // TODO performance? but HInterceptor is flushing // after finally { clear } return retVal; } finally { CurrentDetails.clear(); } }
3,235,898
public void run() { Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); removeContactItem(jid); } }
public void run() { Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; if (getContactGroup(group.getName()) == null) { ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
3,235,899
public void entriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
public void entriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
3,235,900
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
public void run() { Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
3,235,901
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
3,235,902
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
3,235,903
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
3,235,904
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); SparkManager.getWorkspace().removeAlert(layoutPanel); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
3,235,905
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
3,235,906
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
private void subscriptionRequest(final String jid) { final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(jid); if (entry != null && entry.getType() == RosterPacket.ItemType.TO) { Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); return; } String message = jid + " would like to see your online presence and add you to their roster. Do you accept?"; final JFrame dialog = new JFrame("Subscription Request"); dialog.setIconImage(SparkManager.getMainWindow().getIconImage()); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); WrappedLabel messageLabel = new WrappedLabel(); messageLabel.setText(message); layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JButton acceptButton = new JButton("Accept"); JButton viewInfoButton = new JButton("Profile"); JButton denyButton = new JButton("Deny"); layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } } }); denyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); } }); viewInfoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SparkManager.getVCardManager().viewProfile(jid, getGUI()); } }); // show dialog dialog.getContentPane().add(layoutPanel); dialog.pack(); dialog.setSize(450, 125); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); SparkManager.getChatManager().getChatContainer().blinkFrameIfNecessary(dialog); }
3,235,907
public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } }
3,235,908
public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); }
public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
3,235,910
private <T extends IObject> T lookup( T argument ) { if ( argument == null ) return null; if ( argument.getId() == null ) return argument; return (T) serviceFactory.getQueryService().get( argument.getClass(), argument.getId()); }
private <T extends IObject> T lookup( T argument ) { if ( argument == null ) return null; if ( argument.getId() == null ) return argument; return (T) localQuery.get( argument.getClass(), argument.getId()); }
3,235,911
public void saveCurrentSettings() { delegate.saveCurrentSettings(); LocalUpdate localUpdate = (LocalUpdate) serviceFactory .getContext().getBean(LocalUpdate.class.getName()); localUpdate.flush(); }
public void saveCurrentSettings() { delegate.saveCurrentSettings(); LocalUpdate localUpdate = (LocalUpdate) serviceFactory .getContext().getBean(LocalUpdate.class.getName()); localUpdate.flush(); }
3,235,912
public RubyFixnum hash() { return newFixnum(hashCode()); }
public RubyFixnum hash() { return newFixnum((int) value ^ (int) (value >> 32)); }
3,235,913
public RubyObject m_initialize(RubyFixnum size, RubyObject value) { modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, value); for (int i = array.size(); i < len; i++) { array.add(value); } return this; }
public RubyObject m_initialize(RubyObject[] args) { if (args.length < 2) { return this; } RubyFixnum size = (RubyFixnum)args[0]; modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, value); for (int i = array.size(); i < len; i++) { array.add(value); } return this; }
3,235,914
public RubyObject m_initialize(RubyFixnum size, RubyObject value) { modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, value); for (int i = array.size(); i < len; i++) { array.add(value); } return this; }
public RubyObject m_initialize(RubyFixnum size, RubyObject value) { modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, args[1]); for (int i = array.size(); i < len; i++) { array.add(value); } return this; }
3,235,915
public RubyObject m_initialize(RubyFixnum size, RubyObject value) { modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, value); for (int i = array.size(); i < len; i++) { array.add(value); } return this; }
public RubyObject m_initialize(RubyFixnum size, RubyObject value) { modify(); long len = size.getValue(); if (len < 0) { throw new RubyArgumentException("negative array size"); } if (len > Integer.MAX_VALUE) { throw new RubyArgumentException("array size too big"); } Collections.fill(array, value); for (int i = array.size(); i < len; i++) { array.add(args[1]); } return this; }
3,235,916
public RubyObject m_slice(RubyObject[] args) { if (args.length == 2) { long beg = ((RubyFixnum)args[0]).getValue(); long len = ((RubyFixnum)args[1]).getValue(); if (beg < 0) { beg += array.size(); } return subseq(beg, len); } if (args.length == 1) { if (args[0] instanceof RubyFixnum) { return entry(((RubyFixnum)args[0]).getValue()); }/* if (args[0] instanceof RubyBignum) { throw new RubyIndexException("index too big"); } if (args[0] instanceof RubyRange) { }*/ } return getRuby().getNil(); }
public RubyObject m_slice(RubyObject[] args) { if (args.length == 2) { long beg = ((RubyFixnum)args[0]).getValue(); long len = ((RubyFixnum)args[1]).getValue(); if (beg < 0) { beg += array.size(); } return subseq(beg, len); } if (args.length == 1) { if (args[0] instanceof RubyFixnum) { return entry(((RubyFixnum)args[0]).getValue()); }if (args[0] instanceof RubyBignum) { throw new RubyIndexException("index too big"); } if (args[0] instanceof RubyRange) { }*/ } return getRuby().getNil(); }
3,235,918
public RubyObject m_slice(RubyObject[] args) { if (args.length == 2) { long beg = ((RubyFixnum)args[0]).getValue(); long len = ((RubyFixnum)args[1]).getValue(); if (beg < 0) { beg += array.size(); } return subseq(beg, len); } if (args.length == 1) { if (args[0] instanceof RubyFixnum) { return entry(((RubyFixnum)args[0]).getValue()); }/* if (args[0] instanceof RubyBignum) { throw new RubyIndexException("index too big"); } if (args[0] instanceof RubyRange) { }*/ } return getRuby().getNil(); }
public RubyObject m_slice(RubyObject[] args) { if (args.length == 2) { long beg = ((RubyFixnum)args[0]).getValue(); long len = ((RubyFixnum)args[1]).getValue(); if (beg < 0) { beg += array.size(); } return subseq(beg, len); } if (args.length == 1) { if (args[0] instanceof RubyFixnum) { return entry(((RubyFixnum)args[0]).getValue()); }/* if (args[0] instanceof RubyBignum) { throw new RubyIndexException("index too big"); } if (args[0] instanceof RubyRange) { long[] begLength = ((RubyRange)args[0]).getBeginLength(length()); if (begLength == null) { return getRuby().getNil(); } else { return subseq(begLength[0], begLength[1]); } } } return getRuby().getNil(); }
3,235,919
public void store(long idx, RubyObject value) { modify(); if (idx < 0) { idx += array.size(); if (idx < 0) { throw new RubyIndexException("index " + (idx - array.size()) + " out of array"); } } if (idx > array.size()) { array.ensureCapacity((int)idx + 1); for (int i = array.size(); i < idx; i++) { array.add(getRuby().getNil()); } } if (idx == array.size()) { array.add(value); } array.set((int)idx, value); }
public void store(long idx, RubyObject value) { modify(); if (idx < 0) { idx += array.size(); if (idx < 0) { throw new RubyIndexException("index " + (idx - array.size()) + " out of array"); } } if (idx > array.size()) { array.ensureCapacity((int)idx + 1); for (int i = array.size(); i < idx; i++) { array.add(getRuby().getNil()); } } if (idx == array.size()) { array.add(value); } array.set((int)idx, value); }
3,235,920
public void store(long idx, RubyObject value) { modify(); if (idx < 0) { idx += array.size(); if (idx < 0) { throw new RubyIndexException("index " + (idx - array.size()) + " out of array"); } } if (idx > array.size()) { array.ensureCapacity((int)idx + 1); for (int i = array.size(); i < idx; i++) { array.add(getRuby().getNil()); } } if (idx == array.size()) { array.add(value); } array.set((int)idx, value); }
public void store(long idx, RubyObject value) { modify(); if (idx < 0) { idx += array.size(); if (idx < 0) { throw new RubyIndexException("index " + (idx - array.size()) + " out of array"); } } if (idx > array.size()) { array.ensureCapacity((int)idx + 1); for (int i = array.size(); i < idx; i++) { array.add(getRuby().getNil()); } } if (idx == array.size()) { array.add(value); } }
3,235,921
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { PropertyException e = new PropertyException( "#bean usage error: session scope is only valid with servlets!"); _broker.getEvaluationExceptionHandler().evaluate( target, context, e); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } _log.debug("BeanDirective: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { this._broker.getEvaluationExceptionHandler().evaluate(target, context, e); } catch (Exception e) { String errorText = "BeanDirective: Unable to load bean " + target + " of type " + _className; _log.error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
public void write(FastWriter out, Context context) throws PropertyException, IOException { Map globalBeans = BeanConf.globalBeans; Map appBeans = beanConf.appBeans; boolean isNew = false; try { while (initArgObj instanceof Macro && initArgObj != UNDEF) initArgObj = ((Macro) initArgObj).evaluate(context); // store init args in array if (initArgObj == null || initArgObj.getClass().isArray()){ initArgs = (Object[])initArgObj; } else { initArgs = new Object[1]; initArgs[0] = initArgObj; } Object o = null; Class c = null; switch (scope){ case BEAN_SCOPE_GLOBAL: synchronized (globalBeans){ o = globalBeans.get(targetName); if (o == null){ if (isStaticClass){ c = context.getBroker().classForName(_className); o = new org.webmacro.engine.StaticClassWrapper(c); } else { //c = Class.forName(_className); //o = c.newInstance(); o = instantiate(_className, initArgs); } isNew = true; globalBeans.put(targetName,o); } } break; case BEAN_SCOPE_APPLICATION: synchronized (appBeans){ o = appBeans.get(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; appBeans.put(targetName, o); } } break; case BEAN_SCOPE_SESSION: javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)context.getProperty("Session"); //if (context instanceof WebContext){ if (session != null){ synchronized(session){ o = session.getAttribute(targetName); if (o == null){ o = instantiate(_className, initArgs); isNew = true; session.setAttribute(targetName, o); } } } else { PropertyException e = new PropertyException( "#bean usage error: session scope is only valid with servlets!"); _broker.getEvaluationExceptionHandler().evaluate( target, context, e); } break; default: // make "page" the default scope //case BEAN_SCOPE_PAGE: // NOTE: page beans always overwrite anything in the context // with the same name o = instantiate(_className, initArgs); isNew = true; if (o != null){ Class[] paramTypes = { Context.class }; try { java.lang.reflect.Method m = o.getClass().getMethod("init", paramTypes); if (m != null){ Object[] args = { context }; m.invoke(o, args); } } catch (Exception e){ // ignore } } break; } _log.debug("BeanDirective: Class " + _className + " loaded."); target.setValue(context, o); } catch (PropertyException e) { this._broker.getEvaluationExceptionHandler().evaluate(target, context, e); } catch (Exception e) { String errorText = "BeanDirective: Unable to load bean " + target + " of type " + _className; _log.error(errorText, e); writeWarning(errorText, context, out); } if (isNew && onNewBlock != null) onNewBlock.write(out, context); }
3,235,928
public boolean isReadable() { return (modes & RDWR) != 0 || modes == RDONLY; }
public boolean isReadable() { return (modes & RDWR) != 0 || modes == RDONLY || modes == BINARY; }
3,235,930
public Dispatcher(DisplayedDocument dd) { controllers = new LinkedList<Controller>(); controllers.add(new MainController(dd)); controllers.add(new MainMenuController(dd)); controllers.add(new TreeContextMenuController(dd)); controllers.add(new TreeController(dd)); }
public Dispatcher(DisplayedDocument dd) { controllers = new LinkedList<Controller>(); controllers.add(new MainController(dd)); controllers.add(new MainMenuController(dd)); controllers.add(new TreeContextMenuController(dd)); controllers.add(new TreeController(dd)); }
3,235,931
public void invokeControllerMethod(String methodDescriptor, Event e) { // Get the controller and method. Controller controller = null; Method method = null; Iterator<Controller> iter = controllers.iterator(); while (iter.hasNext() && (method == null)) { controller = iter.next(); method = controller.getMethod(methodDescriptor); } if (method == null) { throw new KoalaException("Koala Notes could not find method '" + methodDescriptor + "'."); } // Invoke the method. try { method.invoke(controller, new Object[] {e}); } catch (IllegalAccessException iaex) { throw new KoalaException("Koala Notes could not access method '" + methodDescriptor + "'.", iaex); } catch (InvocationTargetException itex) { if (itex.getCause() instanceof RuntimeException) { throw (RuntimeException) itex.getCause(); } else throw new KoalaException(itex.getCause()); } }
public void invokeControllerMethod(String methodDescriptor, Event e) { // Get the controller and method. Controller controller = null; Method method = null; Iterator<Controller> iter = controllers.iterator(); while (iter.hasNext() && (method == null)) { controller = iter.next(); method = controller.getMethod(methodDescriptor); } if (method == null) { throw new KoalaException("Koala Notes could not find method '" + methodDescriptor + "'."); } // Invoke the method. try { method.invoke(controller, new Object[] {e}); } catch (IllegalAccessException iaex) { throw new KoalaException("Koala Notes could not access method '" + methodDescriptor + "'.", iaex); } catch (InvocationTargetException itex) { if (itex.getCause() instanceof RuntimeException) { throw (RuntimeException) itex.getCause(); } else throw new KoalaException(itex.getCause()); } }
3,235,932
final protected void doPost (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doRequest (req,resp); }
protected void doPost (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doRequest (req,resp); }
3,235,934
final protected void execute (Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming (); try { if (timing) c.startTiming ("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse (); Locale locale = (Locale) tmpl.getParam ( WMConstants.TEMPLATE_LOCALE); if (_log.loggingDebug ()) _log.debug ("TemplateLocale="+locale); if (locale != null) { setLocale (resp, locale); } String encoding = (String) tmpl.getParam ( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding (); } if (_log.loggingDebug ()) _log.debug ("Using output encoding "+encoding); fw = FastWriter.getInstance (_broker, resp.getOutputStream (), encoding); tmpl.write (fw, c); } finally { if (timing) c.stopTiming (); } if (timing) c.startTiming ("FastWriter.close()"); try { fw.close (); fw = null; } finally { if (timing) c.stopTiming (); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning (error,e); try { Template errorTemplate = error (c, "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": ") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")) + "\n<pre>" + e + "</pre>\n"); fw.reset (fw.getOutputStream ()); errorTemplate.write (fw, c); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush (); fw.close (); fw = null; } } catch (Exception e3) { // ignore disconnect } } }
final protected void execute (Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming (); try { if (timing) c.startTiming ("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse (); Locale locale = (Locale) tmpl.getParam ( WMConstants.TEMPLATE_LOCALE); if (_log.loggingDebug ()) _log.debug ("TemplateLocale="+locale); if (locale != null) { setLocale (resp, locale); } String encoding = (String) tmpl.getParam ( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding (); } if (_log.loggingDebug ()) _log.debug ("Using output encoding "+encoding); fw = FastWriter.getInstance (_broker, resp.getOutputStream (), encoding); tmpl.write (fw, c); } finally { if (timing) c.stopTiming (); } if (timing) c.startTiming ("FastWriter.close()"); try { fw.close (); fw = null; } finally { if (timing) c.stopTiming (); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning (error,e); try { Template errorTemplate = error (c, "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": ") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")) + "\n<pre>" + e + "</pre>\n"); fw.reset (fw.getOutputStream ()); errorTemplate.write (fw, c); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush (); fw.close (); fw = null; } } catch (Exception e3) { // ignore disconnect } } }
3,235,935
final protected void execute (Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming (); try { if (timing) c.startTiming ("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse (); Locale locale = (Locale) tmpl.getParam ( WMConstants.TEMPLATE_LOCALE); if (_log.loggingDebug ()) _log.debug ("TemplateLocale="+locale); if (locale != null) { setLocale (resp, locale); } String encoding = (String) tmpl.getParam ( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding (); } if (_log.loggingDebug ()) _log.debug ("Using output encoding "+encoding); fw = FastWriter.getInstance (_broker, resp.getOutputStream (), encoding); tmpl.write (fw, c); } finally { if (timing) c.stopTiming (); } if (timing) c.startTiming ("FastWriter.close()"); try { fw.close (); fw = null; } finally { if (timing) c.stopTiming (); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning (error,e); try { Template errorTemplate = error (c, "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": ") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")) + "\n<pre>" + e + "</pre>\n"); fw.reset (fw.getOutputStream ()); errorTemplate.write (fw, c); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush (); fw.close (); fw = null; } } catch (Exception e3) { // ignore disconnect } } }
final protected void execute (Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming (); try { if (timing) c.startTiming ("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse (); Locale locale = (Locale) tmpl.getParam ( WMConstants.TEMPLATE_LOCALE); if (_log.loggingDebug ()) _log.debug ("TemplateLocale="+locale); if (locale != null) { setLocale (resp, locale); } String encoding = (String) tmpl.getParam ( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding (); } if (_log.loggingDebug ()) _log.debug ("Using output encoding "+encoding); fw = FastWriter.getInstance (_broker, resp.getOutputStream (), encoding); tmpl.write (fw, c); } finally { if (timing) c.stopTiming (); } if (timing) c.startTiming ("FastWriter.close()"); try { fw.close (); fw = null; } finally { if (timing) c.stopTiming (); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning (error,e); try { Template errorTemplate = error (c, "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": ") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")) + "\n<pre>" + e + "</pre>\n"); fw.reset (fw.getOutputStream ()); errorTemplate.write (fw, c); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush (); fw.close (); fw = null; } } catch (Exception e3) { // ignore disconnect } } }
3,235,936