bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
static List checkGettersAndSetters(Method[] methods) { List goodMethods = new ArrayList(); if (null == methods) return goodMethods; for (int i = 0; i < methods.length; i++) { boolean ok = true; Method method = methods[i]; int mod = method.getModifiers(); if (!Modifier.isPublic(mod) || Modifier.isStatic(mod)) { ok = false; } if (method.getName().startsWith("get")) { if (0 != method.getParameterTypes().length) { ok = false; } } else if (method.getName().startsWith("set")) { // No constaints yet on setters. } else { ok = false; } if (ok) goodMethods.add(method); } return goodMethods; }
|
staticListcheckGettersAndSetters(Method[]methods){ListgoodMethods=newArrayList();if(null==methods)returngoodMethods;for(inti=0;i<methods.length;i++){booleanok=true;Methodmethod=methods[i];intmod=method.getModifiers();if(!Modifier.isPublic(mod)||Modifier.isStatic(mod)){ok=false;}if(method.getName().startsWith("get")){if(0!=method.getParameterTypes().length){ok=false;}}elseif(method.getName().startsWith("set")){//Noconstaintsyetonsetters.}else{ok=false;}if(ok)goodMethods.add(method);}returngoodMethods;}
| 3,234,521
|
final public Object get(String field) { Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {}// System.out.println("Creating Locale: "// +parts[0]+"-"+parts[1]+"-"+parts[2]); locale = new Locale(parts[0], parts[1], parts[2]); }// System.out.println("Returning locale for "+field+" -> "+locale); return locale; }
|
final public Object get(String field) { Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {}// System.out.println("Creating Locale: "// +parts[0]+"-"+parts[1]+"-"+parts[2]); locale = new Locale(parts[0], parts[1], parts[2]); }// System.out.println("Returning locale for "+field+" -> "+locale); return locale; }
| 3,234,523
|
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
|
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
| 3,234,524
|
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
|
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
| 3,234,525
|
public Node compileFile(String f, RubyObject file, int start) { rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(start - 1); return yycompile(f, start); }
|
public Node compileFile(String f, RubyObject file, int start) { /*rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(start - 1); return yycompile(f, start); }
| 3,234,526
|
public Node compileFile(String f, RubyObject file, int start) { rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(start - 1); return yycompile(f, start); }
|
public Node compileFile(String f, RubyObject file, int start) { rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0);*/ ruby.setSourceLine(start - 1); return yycompile(f, start); }
| 3,234,527
|
public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); }
|
public Node compileString(String f, RubyObject s, int line) { /*rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); }
| 3,234,528
|
public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); }
|
public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0);*/ ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); }
| 3,234,529
|
public URL getTemplate(String name) { if (_templatePrefix == null) return getTemplate(name); else { URL u = getResource(_templatePrefix + name); return (u != null) ? u : getResource(name); } }
|
public URL getTemplate(String name) { if (_templatePrefix == null) return getResource(name); else { URL u = getResource(_templatePrefix + name); return (u != null) ? u : getResource(name); } }
| 3,234,531
|
public TestRuby(String name) { super(name); }
|
public TestRuby(String name) { super(name); }
| 3,234,532
|
private void assertTrue(RubyObject iObj) { assertTrue(iObj.isTrue()); }
|
private void assertTrue(RubyObject iObj) { assertTrue(iObj.isTrue()); }
| 3,234,533
|
public void setUp() { ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); }
|
public void setUp() { ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); }
| 3,234,534
|
public void tearDown() { super.tearDown(); }
|
public void tearDown() { super.tearDown(); }
| 3,234,535
|
public void testFindFile() { ArrayList list = new ArrayList(); ruby.initLoad(list); list.clear(); File testFile = new File("fib.rb"); try { ruby.findFile(testFile); fail("should have thrown an exception, the file fib.rb is not in the search path"); } catch (Exception e) { } list.add("./samples"); //now we valuate the path ruby.initLoad(list); assertEquals(new File("./samples/fib.rb"), ruby.findFile(testFile)); }
|
public void testFindFile() { ArrayList list = new ArrayList(); ruby.initLoad(list); list.clear(); File testFile = new File("fib.rb"); try { ruby.findFile(testFile); fail("should have thrown an exception, the file fib.rb is not in the search path"); } catch (Exception e) { } list.add("./samples"); //now we valuate the path ruby.initLoad(list); assertEquals(new File("./samples/fib.rb"), ruby.findFile(testFile)); }
| 3,234,536
|
public void testInitLoad() { ArrayList list = new ArrayList(); //check without a RubyHome and with one parameter list.add("toto"); ruby.initLoad(list); //check that the global vars are correctly valuated RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray)lLoad; //check that we have 2 non null element assertTrue(((RubyFixnum)lLoadA.nitems()).getValue()== 2); //check that it is what we expect, a RubyString of the correct type assertTrue(new RubyString(ruby,"toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby,".").equal(lLoadA.shift())); //check the case when RubyHome is valuated System.setProperty("jruby.home", "RubyHome"); //MRI result /*C:\dev\jruby>ruby -e "puts $:"/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin/cygdrive/d/ruby/lib/ruby/site_ruby/cygdrive/d/ruby/lib/ruby/1.6/cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin. */ ruby.initLoad(new ArrayList()); String wanted; if (File.separatorChar == '/') { wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + ".\n"; } else { wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; } assertEquals(wanted, eval("puts $:")); }
|
public void testInitLoad() { ArrayList list = new ArrayList(); //check without a RubyHome and with one parameter list.add("toto"); ruby.initLoad(list); //check that the global vars are correctly valuated RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray)lLoad; //check that we have 2 non null element assertTrue(((RubyFixnum)lLoadA.nitems()).getValue()== 2); //check that it is what we expect, a RubyString of the correct type assertTrue(new RubyString(ruby,"toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby,".").equal(lLoadA.shift())); //check the case when RubyHome is valuated System.setProperty("jruby.home", "RubyHome"); //MRI result /*C:\dev\jruby>ruby -e "puts $:"/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin/cygdrive/d/ruby/lib/ruby/site_ruby/cygdrive/d/ruby/lib/ruby/1.6/cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin. */ ruby.initLoad(new ArrayList()); String wanted; if (File.separatorChar == '/') { wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + ".\n"; } else { wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; } assertEquals(wanted, eval("puts $:")); }
| 3,234,537
|
public void testVarAndMet() { ArrayList list = new ArrayList(); ruby.initLoad(list); eval("load './test/testVariableAndMethod.rb'"); assertEquals("Hello World", eval("puts($a)")); assertEquals("dlroW olleH", eval("puts $b")); assertEquals("Hello World", eval("puts $d.reverse, $c, $e.reverse")); assertEquals("135 20 3", eval("puts $f, \" \", $g, \" \", $h")); }
|
public void testVarAndMet() { ArrayList list = new ArrayList(); ruby.initLoad(list); eval("load './test/testVariableAndMethod.rb'"); assertEquals("Hello World", eval("puts($a)")); assertEquals("dlroW olleH", eval("puts $b")); assertEquals("Hello World", eval("puts $d.reverse, $c, $e.reverse")); assertEquals("135 20 3", eval("puts $f, \" \", $g, \" \", $h")); }
| 3,234,538
|
public void write(FastWriter out, Context context) throws ContextException, IOException { boolean done=false; try { if (result instanceof Macro) target.setValue(context, ((Macro) result).evaluate(context)); else target.setValue(context, result); } catch (ContextException e) { String errorText = "Set: Unable to set value: " + target; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
|
public void write(FastWriter out, Context context) throws ContextException, IOException { boolean done=false; try { if (result instanceof Macro) target.setValue(context, ((Macro) result).evaluate(context)); else target.setValue(context, result); } catch (ContextException e) { String errorText = "#set: Unable to set value: " + target; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
| 3,234,539
|
protected void checkParameters(){ if (defs == null) throw new IllegalStateException( "Query parameter definitions not set."); if (qps == null) throw new IllegalArgumentException( "Null arrays "+ "are not valid for definitions."); if (! qps.keySet().containsAll( defs.keySet() ) ) throw new IllegalArgumentException( "Required parameters missing from query:"+ new HashSet( qps.keySet() ).removeAll( defs.keySet() )); for (String name : defs.keySet()) { QueryParameter parameter = qps.get( name ); QueryParameterDef def = defs.get( name ); def.errorIfInvalid( parameter ); } }
|
protected void checkParameters(){ if (defs == null) throw new IllegalStateException( "Query parameter definitions not set."); if (qps == null) throw new IllegalArgumentException( "Null arrays "+ "are not valid for definitions."); if (! qps.keySet().containsAll( defs.keySet() ) ) throw new IllegalArgumentException( "Required parameters missing from query: "+ new HashSet( qps.keySet() ).removeAll( defs.keySet() )); for (String name : defs.keySet()) { QueryParameter parameter = qps.get( name ); QueryParameterDef def = defs.get( name ); def.errorIfInvalid( parameter ); } }
| 3,234,540
|
private void userMarshal(IRubyObject value) throws IOException { out.write(TYPE_USERDEF); dumpObject(RubySymbol.newSymbol(runtime, value.getMetaClass().getName())); RubyString marshaled = (RubyString) value.callMethod("_dump", runtime.newFixnum(depthLimit)); dumpString(marshaled.getValue()); }
|
private void userMarshal(IRubyObject value) throws IOException { out.write(TYPE_USERDEF); dumpObject(RubySymbol.newSymbol(runtime, value.getMetaClass().getName())); RubyString marshaled = (RubyString) value.callMethod("_dump", runtime.newFixnum(depthLimit)); dumpString(marshaled.toString()); }
| 3,234,541
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
| 3,234,542
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
| 3,234,543
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
|
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
| 3,234,544
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
| 3,234,545
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
| 3,234,546
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
|
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
| 3,234,547
|
private void checkNotificationPreferences(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.getWindowTakesFocus()) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); } if (pref.getShowToasterPopup()) { SparkToaster toaster = new SparkToaster(); toaster.setCustomAction(new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); } }); toaster.setDisplayTime(5000); toaster.setBorder(BorderFactory.createBevelBorder(0)); String nickname = ((ChatRoomImpl)room).getParticipantNickname(); toaster.setTitle(nickname); toaster.setToasterHeight(150); toaster.setToasterWidth(200); int size = room.getTranscripts().size(); if (size > 0) { Message message = (Message)room.getTranscripts().get(size - 1); toaster.showToaster(room.getTabIcon(), message.getBody()); } } }
|
private void checkNotificationPreferences(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.getWindowTakesFocus()) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); if (tabLocation != -1) { setSelectedIndex(tabLocation); } } if (pref.getShowToasterPopup()) { SparkToaster toaster = new SparkToaster(); toaster.setCustomAction(new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); if (tabLocation != -1) { setSelectedIndex(tabLocation); } } }); toaster.setDisplayTime(5000); toaster.setBorder(BorderFactory.createBevelBorder(0)); String nickname = ((ChatRoomImpl)room).getParticipantNickname(); toaster.setTitle(nickname); toaster.setToasterHeight(150); toaster.setToasterWidth(200); int size = room.getTranscripts().size(); if (size > 0) { Message message = (Message)room.getTranscripts().get(size - 1); toaster.showToaster(room.getTabIcon(), message.getBody()); } } }
| 3,234,548
|
public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); }
|
public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); if (tabLocation != -1) { setSelectedIndex(tabLocation); } }
| 3,234,549
|
protected void loadServletSettings(String prefix) throws InitException { Properties p = new Properties(); Enumeration e = _servletContext.getInitParameterNames(); String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) .substring(dotPrefix.length())); } _config.load(p, prefix); }
|
protected void loadServletSettings(String prefix) throws InitException { Properties p = new Properties(); Enumeration e = _servletContext.getInitParameterNames(); String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) .substring(dotPrefix.length())); } _config.load(p, prefix); }
| 3,234,550
|
protected void loadServletSettings(String prefix) throws InitException { Properties p = new Properties(); Enumeration e = _servletContext.getInitParameterNames(); String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) .substring(dotPrefix.length())); } _config.load(p, prefix); }
|
protectedvoidloadServletSettings(Stringprefix)throwsInitException{Propertiesp=newProperties();Enumeratione=_servletContext.getInitParameterNames();StringdotPrefix=(prefix==null)?"":prefix+".";while(e.hasMoreElements()){Stringkey=(String)e.nextElement();if(prefix==null)p.setProperty(key,_servletContext.getInitParameter(key));elseif(key.startsWith(dotPrefix))p.setProperty(key,_servletContext.getInitParameter(key).substring(dotPrefix.length()));}_config.load(p,prefix);}
| 3,234,551
|
BufferedImage getZoomedLensImage() { return lens.getZoomedImage(); }
|
BufferedImage getZoomedLensImage() { return lens.getZoomedImage(); }
| 3,234,552
|
void setChannelsSelection() { controlPane.setChannelsSelection(); }
|
void setChannelsSelection() { controlPane.setChannelsSelection(); }
| 3,234,553
|
void setImageZoomFactor(float factor) { lens.setImageZoomFactor(factor); }
|
void setImageZoomFactor(float factor) { lens.setImageZoomFactor(factor); }
| 3,234,554
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
| 3,234,556
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
| 3,234,557
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getDisplayedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
| 3,234,558
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); }
|
void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); repaint(); }
| 3,234,559
|
void showMenu(int menuID, Component source, Point location) { if (menuID !=ImViewer.COLOR_PICKER_MENU) return; ChannelMetadata[] data = model.getChannelData(); ChannelMetadata d; JPopupMenu menu = new JPopupMenu(); ChannelColorMenuItem item; for (int j = 0; j < data.length; j++) { d = data[j]; item = new ChannelColorMenuItem( "Wavelength "+d.getEmissionWavelength(), model.getChannelColor(j), j); menu.add(item); item.addPropertyChangeListener(controller); } menu.show(source, location.x, location.y); }
|
void showMenu(int menuID, Component source, Point location) { if (menuID !=ImViewer.COLOR_PICKER_MENU) return; ChannelMetadata[] data = model.getChannelData(); ChannelMetadata d; JPopupMenu menu = new JPopupMenu(); ChannelColorMenuItem item; for (int j = 0; j < data.length; j++) { d = data[j]; item = new ChannelColorMenuItem( "Wavelength "+d.getEmissionWavelength(), model.getChannelColor(j), j); menu.add(item); item.addPropertyChangeListener(controller); } menu.show(source, location.x, location.y); }
| 3,234,560
|
void showMenu(int menuID, Component source, Point location) { if (menuID !=ImViewer.COLOR_PICKER_MENU) return; ChannelMetadata[] data = model.getChannelData(); ChannelMetadata d; JPopupMenu menu = new JPopupMenu(); ChannelColorMenuItem item; for (int j = 0; j < data.length; j++) { d = data[j]; item = new ChannelColorMenuItem( "Wavelength "+d.getEmissionWavelength(), model.getChannelColor(j), j); menu.add(item); item.addPropertyChangeListener(controller); } menu.show(source, location.x, location.y); }
|
voidshowMenu(intmenuID,Componentsource,Pointlocation) { if(menuID!=ImViewer.COLOR_PICKER_MENU)return; ChannelMetadata[]data=model.getChannelData(); ChannelMetadatad; JPopupMenumenu=newJPopupMenu(); ChannelColorMenuItemitem; for(intj=0;j<data.length;j++){ d=data[j]; item=newChannelColorMenuItem( "Wavelength"+d.getEmissionWavelength(), model.getChannelColor(j),j); menu.add(item);item.addPropertyChangeListener(controller);} menu.show(source,location.x,location.y); }
| 3,234,561
|
private void addInstrumentation(File baseDir, String filename) { logger.debug("filename: " + filename); File file; if (baseDir == null) file = new File(filename); else file = new File(baseDir, filename); addInstrumentation(file); }
|
private void addInstrumentation(File baseDir, String filename) { logger.debug("filename: " + filename); File file; if (baseDir == null) file = new File(filename); else file = new File(baseDir, filename); addInstrumentation(file); }
| 3,234,564
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
| 3,234,565
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
| 3,234,566
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
| 3,234,567
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
| 3,234,568
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
|
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } }
| 3,234,569
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
| 3,234,570
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
| 3,234,571
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
| 3,234,572
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
| 3,234,573
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
|
private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
| 3,234,574
|
private static boolean isArchive(File file) { String name = file.getName(); return name.endsWith(".jar") || name.endsWith(".zip") || name.endsWith(".war") || name.endsWith(".ear") || name.endsWith(".sar"); }
|
private static boolean isArchive(File file) { String name = file.getName(); return name.endsWith(".jar") || name.endsWith(".zip") || name.endsWith(".war") || name.endsWith(".ear") || name.endsWith(".sar"); }
| 3,234,575
|
private static boolean isClass(File file) { return file.getName().endsWith(".class"); }
|
private static boolean isClass(File file) { return file.getName().endsWith(".class"); }
| 3,234,576
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,577
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,578
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,579
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,580
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,581
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,582
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,583
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,584
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
|
public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); }
| 3,234,585
|
public RubyObject execute(RubyObject recv, RubyObject args[], Ruby ruby) { 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 RubyObject execute(RubyObject recv, RubyObject args[], Ruby ruby) { 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,234,586
|
public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group }
|
public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group }
| 3,234,588
|
public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group }
|
public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group }
| 3,234,589
|
final public Object[] FormalArgList() throws ParseException { ArrayList list=new ArrayList(); Token name; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: case WS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[43] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[44] = jj_gen; ; } list.add(name.image); label_5: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[45] = jj_gen; break label_5; } jj_consume_token(COMMA); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[46] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[47] = jj_gen; ; } list.add(name); } break; default: jj_la1[48] = jj_gen; ; } jj_consume_token(RPAREN); break; default: jj_la1[49] = jj_gen; ; } {if (true) return list.toArray();} throw new Error("Missing return statement in function"); }
|
final public Object[] FormalArgList() throws ParseException { ArrayList list=new ArrayList(); Token name; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: case WS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[43] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[44] = jj_gen; ; } list.add(name.image); label_5: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[45] = jj_gen; break label_5; } jj_consume_token(COMMA); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[46] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[47] = jj_gen; ; } list.add(name.image); } break; default: jj_la1[48] = jj_gen; ; } jj_consume_token(RPAREN); break; default: jj_la1[49] = jj_gen; ; } {if (true) return list.toArray();} throw new Error("Missing return statement in function"); }
| 3,234,590
|
public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); 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; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } 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); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
|
public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); 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; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } 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); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
| 3,234,591
|
public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); 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; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } 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); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
|
public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); 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; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } 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); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); }
| 3,234,592
|
public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); 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++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } 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; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); 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); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } 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); 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); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); }
|
public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); 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++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } 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; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); 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); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } 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); 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); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); }
| 3,234,593
|
public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); 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++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } 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; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); 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); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } 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); 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); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); }
|
public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); 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++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } 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; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); 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); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } 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); 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); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); }
| 3,234,594
|
public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); }
|
public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); }
| 3,234,595
|
public void run() { thumbnails.add(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,234,597
|
public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); }
|
public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); }
| 3,234,598
|
public void run() { addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); // TODO: figure out strategy for adding attributes. do it here? final Thumbnail t = new Thumbnail(image,tdm); 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; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); }
|
public void run() { addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); // TODO: figure out strategy for adding attributes. do it here? final Thumbnail t = new Thumbnail(image,tdm); 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; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); }
| 3,234,599
|
public void run() { addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); // TODO: figure out strategy for adding attributes. do it here? final Thumbnail t = new Thumbnail(image,tdm); 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; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); }
|
public void run() { addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); // TODO: figure out strategy for adding attributes. do it here? final Thumbnail t = new Thumbnail(image,tdm); 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; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); }
| 3,234,600
|
public void run() { status.processSucceeded("All images loaded."); }
|
public void run() { status.processSucceeded("All images loaded."); }
| 3,234,601
|
public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); }
|
public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); }
| 3,234,602
|
public void setContext(Registry ctx) { this.registry = ctx; this.eventBus = ctx.getEventBus(); this.tf = ctx.getTopFrame(); env.setIconManager(IconManager.getInstance(ctx)); Boolean extractionMode = (Boolean)registry.lookup(THUMBNAIL_MODE_KEY); this.useServerThumbs = extractionMode.booleanValue(); Integer thumbWidth = (Integer)registry.lookup(THUMBNAIL_WIDTH_KEY); Integer thumbHeight = (Integer)registry.lookup(THUMBNAIL_HEIGHT_KEY); this.thumbnailWidth = 120;//thumbWidth.intValue(); this.thumbnailHeight = 120;//thumbHeight.intValue(); eventBus.register(this,LoadDataset.class); eventBus.register(this,ImageAnnotated.class); /* JMenuItem testItem = new JMenuItem("Browser"); testItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { Integer dummyID = (Integer)registry.lookup(DUMMY_DATASET_KEY); loadDataset(dummyID.intValue()); } }); tf.addToMenu(TopFrame.VIEW,testItem); testItem.setEnabled(true); */ JMenuItem heatItem = new JMenuItem("HeatMap"); heatItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { HeatMapManager manager = env.getHeatMapManager(); HeatMapUI ui = manager.getUI(); if(!ui.isShowing()) { tf.addToDesktop(ui,TopFrame.PALETTE_LAYER); ui.show(); ui.setClosable(true); ui.setIconifiable(true); ui.setResizable(false); ui.setMaximizable(false); } else { try { ui.setSelected(true); } catch(PropertyVetoException ex) {} } } }); tf.addToMenu(TopFrame.VIEW,heatItem); heatItem.setEnabled(true); // test code to check for image STs SemanticTypesService sts = registry.getSemanticTypesService(); try { List typeList = sts.getAvailableImageTypes(); for(Iterator iter = typeList.iterator(); iter.hasNext();) { SemanticType st = (SemanticType)iter.next(); imageTypeList.add(st); } } catch(DSOutOfServiceException dso) { dso.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Connection Error",dso.getMessage(),dso); } catch(DSAccessException dsa) { dsa.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Server Error",dsa.getMessage(),dsa); } }
|
public void setContext(Registry ctx) { this.registry = ctx; this.eventBus = ctx.getEventBus(); this.tf = ctx.getTopFrame(); env.setIconManager(IconManager.getInstance(ctx)); Boolean extractionMode = (Boolean)registry.lookup(THUMBNAIL_MODE_KEY); this.useServerThumbs = extractionMode.booleanValue(); Integer thumbWidth = (Integer)registry.lookup(THUMBNAIL_WIDTH_KEY); Integer thumbHeight = (Integer)registry.lookup(THUMBNAIL_HEIGHT_KEY); this.thumbnailWidth = 120;//thumbWidth.intValue(); this.thumbnailHeight = 120;//thumbHeight.intValue(); eventBus.register(this,LoadDataset.class); eventBus.register(this,ImageAnnotated.class); /* JMenuItem testItem = new JMenuItem("Browser"); testItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { Integer dummyID = (Integer)registry.lookup(DUMMY_DATASET_KEY); loadDataset(dummyID.intValue()); } }); tf.addToMenu(TopFrame.VIEW,testItem); testItem.setEnabled(true); */ JMenuItem heatItem = new JMenuItem("HeatMap"); heatItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { HeatMapManager manager = env.getHeatMapManager(); HeatMapUI ui = manager.getUI(); if(!ui.isShowing()) { tf.addToDesktop(ui,TopFrame.PALETTE_LAYER); ui.show(); ui.setClosable(true); ui.setIconifiable(true); ui.setResizable(false); ui.setMaximizable(false); } else { try { ui.setSelected(true); } catch(PropertyVetoException ex) {} } } }); tf.addToMenu(TopFrame.VIEW,heatItem); heatItem.setEnabled(true); // test code to check for image STs SemanticTypesService sts = registry.getSemanticTypesService(); try { List typeList = sts.getAvailableImageTypes(); for(Iterator iter = typeList.iterator(); iter.hasNext();) { SemanticType st = (SemanticType)iter.next(); imageTypeList.add(st); } } catch(DSOutOfServiceException dso) { dso.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Connection Error",dso.getMessage(),dso); } catch(DSAccessException dsa) { dsa.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Server Error",dsa.getMessage(),dsa); } }
| 3,234,603
|
public void run() { status.setLeftText(message); }
|
public void run() { try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); browser.setBrowserTitle("Image Browser: "+dataset.getName()); loadDataset(theIndex,dataset); } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { throw new RuntimeException(dsoe); } }
| 3,234,604
|
public IRubyObject initialize(IRubyObject[] args) { this.value = new BigDecimal(args[0].toString()); return this; }
|
public IRubyObject initialize(IRubyObject[] args) { String ss = args[0].toString(); if(ss.trim().equals("")) { ss = "0"; } this.value = new BigDecimal(ss); return this; }
| 3,234,608
|
public void propertyChange(PropertyChangeEvent pce) { String name = pce.getPropertyName(); if (name.equals(TreeViewer.CANCEL_LOADING_PROPERTY)) { Browser browser = model.getSelectedBrowser(); if (browser != null) browser.cancel(); } else if (name.equals(Browser.POPUP_MENU_PROPERTY)) { Component c = (Component) pce.getNewValue(); Browser browser = model.getSelectedBrowser(); if (browser != null && c != null) view.showPopup(c, browser.getClickPoint()); } else if (name.equals(Browser.CLOSE_PROPERTY)) { Browser browser = (Browser) pce.getNewValue(); if (browser != null) view.removeBrowser(browser); } else if (name.equals(Editor.CLOSE_EDITOR_PROPERTY) || name.equals(Classifier.CLOSE_CLASSIFIER_PROPERTY)) { model.removeEditor(); model.onComponentStateChange(true); } else if (name.equals(TreeViewer.FINDER_VISIBLE_PROPERTY)) { Boolean b = (Boolean) pce.getNewValue(); if (!b.booleanValue()) { model.clearFoundResults(); model.onComponentStateChange(true); } } else if (name.equals(TreeViewer.SELECTED_BROWSER_PROPERTY)) { Browser b = model.getSelectedBrowser(); Iterator i = model.getBrowsers().values().iterator(); Browser browser; while (i.hasNext()) { browser = (Browser) i.next(); browser.setSelected(browser.equals(b)); } } else if (name.equals(TreeViewer.THUMBNAIL_LOADING_PROPERTY)) { model.retrieveThumbnail((ImageData) pce.getNewValue()); } else if (name.equals(Browser.SELECTED_DISPLAY_PROPERTY)) { model.onSelectedDisplay(); } else if (name.equals(TreeViewer.HIERARCHY_ROOT_PROPERTY)) { Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } else if (name.equals( AddExistingObjectsDialog.EXISTING_ADD_PROPERTY)) { model.addExistingObjects((Set) pce.getNewValue()); } }
|
public void propertyChange(PropertyChangeEvent pce) { String name = pce.getPropertyName(); if (name.equals(TreeViewer.CANCEL_LOADING_PROPERTY)) { Browser browser = model.getSelectedBrowser(); if (browser != null) browser.cancel(); } else if (name.equals(Browser.POPUP_MENU_PROPERTY)) { Component c = (Component) pce.getNewValue(); Browser browser = model.getSelectedBrowser(); if (browser != null && c != null) view.showPopup(c, browser.getClickPoint()); } else if (name.equals(Browser.CLOSE_PROPERTY)) { Browser browser = (Browser) pce.getNewValue(); if (browser != null) view.removeBrowser(browser); } else if (name.equals(Editor.CLOSE_EDITOR_PROPERTY) || name.equals(Classifier.CLOSE_CLASSIFIER_PROPERTY)) { model.removeEditor(); model.onComponentStateChange(true); } else if (name.equals(TreeViewer.FINDER_VISIBLE_PROPERTY)) { Boolean b = (Boolean) pce.getNewValue(); if (!b.booleanValue()) { model.clearFoundResults(); model.onComponentStateChange(true); } } else if (name.equals(TreeViewer.SELECTED_BROWSER_PROPERTY)) { Browser b = model.getSelectedBrowser(); Iterator i = model.getBrowsers().values().iterator(); Browser browser; while (i.hasNext()) { browser = (Browser) i.next(); browser.setSelected(browser.equals(b)); } } else if (name.equals(TreeViewer.THUMBNAIL_LOADING_PROPERTY)) { model.retrieveThumbnail((ImageData) pce.getNewValue()); } else if (name.equals(Browser.SELECTED_DISPLAY_PROPERTY)) { model.onSelectedDisplay(); } else if (name.equals(TreeViewer.HIERARCHY_ROOT_PROPERTY)) { Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } else if (name.equals( AddExistingObjectsDialog.EXISTING_ADD_PROPERTY)) { model.addExistingObjects((Set) pce.getNewValue()); } }
| 3,234,610
|
public RubyObject callIndexed(int index, RubyObject[] args) { switch (index) { case M_INSPECT: return inspect(); case M_TO_S: return to_s(); case M_FROZEN: return frozen(); case M_EQUAL: return equal(args[0]); case M_EQL: return eql(args[0]); case M_AREF: return aref(args); case M_ASET: return aset(args); case M_FIRST: return first(); case M_LAST: return last(); case M_CONCAT: return concat(args[0]); case M_APPEND: return append(args[0]); case M_PUSH: return push(args); case M_POP: return pop(); case M_SHIFT: return shift(); case M_UNSHIFT: return unshift(args); case M_EACH: return each(); case M_EACH_INDEX: return each_index(); case M_REVERSE_EACH: return reverse_each(); case M_LENGTH: return length(); case M_EMPTY_P: return empty_p(); case M_INDEX: return index(args[0]); case M_RINDEX: return rindex(args[0]); case M_INDICES: return indices(args); case M_REVERSE: return reverse(); case M_REVERSE_BANG: return reverse_bang(); case M_SORT: return sort(); case M_SORT_BANG: return sort_bang(); case M_COLLECT: return collect(); case M_COLLECT_BANG: return collect_bang(); case M_DELETE: return delete(args[0]); case M_DELETE_AT: return delete_at(args[0]); case M_DELETE_IF: return delete_if(); case M_REJECT_BANG: return reject_bang(); case M_REPLACE: return replace(args[0]); case M_CLEAR: return clear(); case M_INCLUDE_P: return include_p(args[0]); case M_CLONE: return rbClone(); } Asserts.assertNotReached(); return null; }
|
public RubyObject callIndexed(int index, RubyObject[] args) { switch (index) { case M_INSPECT: return inspect(); case M_TO_S: return to_s(); case M_FROZEN: return frozen(); case M_EQUAL: return equal(args[0]); case M_EQL: return eql(args[0]); case M_AREF: return aref(args); case M_ASET: return aset(args); case M_FIRST: return first(); case M_LAST: return last(); case M_CONCAT: return concat(args[0]); case M_APPEND: return append(args[0]); case M_PUSH: return push(args); case M_POP: return pop(); case M_SHIFT: return shift(); case M_UNSHIFT: return unshift(args); case M_EACH: return each(); case M_EACH_INDEX: return each_index(); case M_REVERSE_EACH: return reverse_each(); case M_LENGTH: return length(); case M_EMPTY_P: return empty_p(); case M_INDEX: return index(args[0]); case M_RINDEX: return rindex(args[0]); case M_INDICES: return indices(args); case M_REVERSE: return reverse(); case M_REVERSE_BANG: return reverse_bang(); case M_SORT: return sort(); case M_SORT_BANG: return sort_bang(); case M_COLLECT: return collect(); case M_COLLECT_BANG: return collect_bang(); case M_DELETE: return delete(args[0]); case M_DELETE_AT: return delete_at(args[0]); case M_DELETE_IF: return delete_if(); case M_REJECT_BANG: return reject_bang(); case M_REPLACE: return replace(args[0]); case M_CLEAR: return clear(); case M_INCLUDE_P: return include_p(args[0]); case M_CLONE: return rbClone(); } Asserts.assertNotReached(); return null; }
| 3,234,611
|
public static RubyClass createArrayClass(Ruby ruby) { RubyClass arrayClass = ruby.defineClass("Array", ruby.getClasses().getObjectClass()); arrayClass.includeModule(ruby.getRubyModule("Enumerable")); arrayClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyArray.class, "newInstance")); arrayClass.defineSingletonMethod("[]", CallbackFactory.getOptSingletonMethod(RubyArray.class, "create")); arrayClass.defineMethod("initialize", CallbackFactory.getOptMethod(RubyArray.class, "initialize")); arrayClass.defineMethod("inspect", IndexedCallback.create(M_INSPECT, 0)); arrayClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); arrayClass.defineMethod("to_a", CallbackFactory.getSelfMethod(0)); arrayClass.defineMethod("to_ary", CallbackFactory.getSelfMethod(0)); arrayClass.defineMethod("frozen?", IndexedCallback.create(M_FROZEN, 0)); arrayClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); arrayClass.defineMethod("eql?", IndexedCallback.create(M_EQL, 1)); arrayClass.defineMethod("===", IndexedCallback.create(M_EQUAL, 1)); arrayClass.defineMethod("[]", IndexedCallback.createOptional(M_AREF)); arrayClass.defineMethod("[]=", IndexedCallback.createOptional(M_ASET)); arrayClass.defineMethod("at", CallbackFactory.getMethod(RubyArray.class, "at", RubyFixnum.class)); arrayClass.defineMethod("first", IndexedCallback.create(M_FIRST, 0)); arrayClass.defineMethod("last", IndexedCallback.create(M_LAST, 0)); arrayClass.defineMethod("concat", IndexedCallback.create(M_CONCAT, 1)); arrayClass.defineMethod("<<", IndexedCallback.create(M_APPEND, 1)); arrayClass.defineMethod("push", IndexedCallback.createOptional(M_PUSH, 1)); arrayClass.defineMethod("pop", IndexedCallback.create(M_POP, 0)); arrayClass.defineMethod("shift", IndexedCallback.create(M_SHIFT, 0)); arrayClass.defineMethod("unshift", IndexedCallback.createOptional(M_UNSHIFT)); arrayClass.defineMethod("each", IndexedCallback.create(M_EACH, 0)); arrayClass.defineMethod("each_index", IndexedCallback.create(M_EACH_INDEX, 0)); arrayClass.defineMethod("reverse_each", IndexedCallback.create(M_REVERSE_EACH, 0)); arrayClass.defineMethod("length", IndexedCallback.create(M_LENGTH, 0)); arrayClass.defineMethod("size", IndexedCallback.create(M_LENGTH, 0)); arrayClass.defineMethod("empty?", IndexedCallback.create(M_EMPTY_P, 0)); arrayClass.defineMethod("index", IndexedCallback.create(M_INDEX, 1)); arrayClass.defineMethod("rindex", IndexedCallback.create(M_RINDEX, 1)); arrayClass.defineMethod("indexes", IndexedCallback.createOptional(M_INDICES)); arrayClass.defineMethod("indices", IndexedCallback.createOptional(M_INDICES)); arrayClass.defineMethod("clone", IndexedCallback.create(M_CLONE, 0)); arrayClass.defineMethod("join", CallbackFactory.getOptMethod(RubyArray.class, "join")); arrayClass.defineMethod("reverse", IndexedCallback.create(M_REVERSE, 0)); arrayClass.defineMethod("reverse!", IndexedCallback.create(M_REVERSE_BANG, 0)); arrayClass.defineMethod("sort", IndexedCallback.create(M_SORT, 0)); arrayClass.defineMethod("sort!", IndexedCallback.create(M_SORT_BANG, 0)); arrayClass.defineMethod("collect", IndexedCallback.create(M_COLLECT, 0)); arrayClass.defineMethod("collect!", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("map!", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("filter", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("delete", IndexedCallback.create(M_DELETE, 1)); arrayClass.defineMethod("delete_at", IndexedCallback.create(M_DELETE_AT, 1)); arrayClass.defineMethod("delete_if", IndexedCallback.create(M_DELETE_IF, 0)); arrayClass.defineMethod("reject!", IndexedCallback.create(M_REJECT_BANG, 0)); arrayClass.defineMethod("replace", IndexedCallback.create(M_REPLACE, 1)); arrayClass.defineMethod("clear", IndexedCallback.create(M_CLEAR, 0)); arrayClass.defineMethod("fill", CallbackFactory.getOptMethod(RubyArray.class, "fill")); arrayClass.defineMethod("include?", IndexedCallback.create(M_INCLUDE_P, 1)); arrayClass.defineMethod("<=>", CallbackFactory.getMethod(RubyArray.class, "op_cmp", RubyObject.class)); arrayClass.defineMethod("slice", CallbackFactory.getOptMethod(RubyArray.class, "aref")); arrayClass.defineMethod("slice!", CallbackFactory.getOptMethod(RubyArray.class, "slice_bang")); arrayClass.defineMethod("assoc", CallbackFactory.getMethod(RubyArray.class, "assoc", RubyObject.class)); arrayClass.defineMethod("rassoc", CallbackFactory.getMethod(RubyArray.class, "rassoc", RubyObject.class)); arrayClass.defineMethod("+", CallbackFactory.getMethod(RubyArray.class, "op_plus", RubyObject.class)); arrayClass.defineMethod("*", CallbackFactory.getMethod(RubyArray.class, "op_times", RubyObject.class)); arrayClass.defineMethod("-", CallbackFactory.getMethod(RubyArray.class, "op_diff", RubyObject.class)); arrayClass.defineMethod("&", CallbackFactory.getMethod(RubyArray.class, "op_and", RubyObject.class)); arrayClass.defineMethod("|", CallbackFactory.getMethod(RubyArray.class, "op_or", RubyObject.class)); arrayClass.defineMethod("uniq", CallbackFactory.getMethod(RubyArray.class, "uniq")); arrayClass.defineMethod("uniq!", CallbackFactory.getMethod(RubyArray.class, "uniq_bang")); arrayClass.defineMethod("compact", CallbackFactory.getMethod(RubyArray.class, "compact")); arrayClass.defineMethod("compact!", CallbackFactory.getMethod(RubyArray.class, "compact_bang")); arrayClass.defineMethod("flatten", CallbackFactory.getMethod(RubyArray.class, "flatten")); arrayClass.defineMethod("flatten!", CallbackFactory.getMethod(RubyArray.class, "flatten_bang")); arrayClass.defineMethod("nitems", CallbackFactory.getMethod(RubyArray.class, "nitems")); arrayClass.defineMethod("pack", CallbackFactory.getMethod(RubyArray.class, "pack", RubyString.class)); return arrayClass; }
|
public static RubyClass createArrayClass(Ruby ruby) { RubyClass arrayClass = ruby.defineClass("Array", ruby.getClasses().getObjectClass()); arrayClass.includeModule(ruby.getRubyModule("Enumerable")); arrayClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyArray.class, "newInstance")); arrayClass.defineSingletonMethod("[]", CallbackFactory.getOptSingletonMethod(RubyArray.class, "create")); arrayClass.defineMethod("initialize", CallbackFactory.getOptMethod(RubyArray.class, "initialize")); arrayClass.defineMethod("inspect", IndexedCallback.create(M_INSPECT, 0)); arrayClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); arrayClass.defineMethod("to_a", CallbackFactory.getSelfMethod(0)); arrayClass.defineMethod("to_ary", CallbackFactory.getSelfMethod(0)); arrayClass.defineMethod("frozen?", IndexedCallback.create(M_FROZEN, 0)); arrayClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); arrayClass.defineMethod("eql?", IndexedCallback.create(M_EQL, 1)); arrayClass.defineMethod("===", IndexedCallback.create(M_EQUAL, 1)); arrayClass.defineMethod("[]", IndexedCallback.createOptional(M_AREF)); arrayClass.defineMethod("[]=", IndexedCallback.createOptional(M_ASET)); arrayClass.defineMethod("at", CallbackFactory.getMethod(RubyArray.class, "at", RubyFixnum.class)); arrayClass.defineMethod("first", IndexedCallback.create(M_FIRST, 0)); arrayClass.defineMethod("last", IndexedCallback.create(M_LAST, 0)); arrayClass.defineMethod("concat", IndexedCallback.create(M_CONCAT, 1)); arrayClass.defineMethod("<<", IndexedCallback.create(M_APPEND, 1)); arrayClass.defineMethod("push", IndexedCallback.createOptional(M_PUSH, 1)); arrayClass.defineMethod("pop", IndexedCallback.create(M_POP, 0)); arrayClass.defineMethod("shift", IndexedCallback.create(M_SHIFT, 0)); arrayClass.defineMethod("unshift", IndexedCallback.createOptional(M_UNSHIFT)); arrayClass.defineMethod("each", IndexedCallback.create(M_EACH, 0)); arrayClass.defineMethod("each_index", IndexedCallback.create(M_EACH_INDEX, 0)); arrayClass.defineMethod("reverse_each", IndexedCallback.create(M_REVERSE_EACH, 0)); arrayClass.defineMethod("length", IndexedCallback.create(M_LENGTH, 0)); arrayClass.defineMethod("size", IndexedCallback.create(M_LENGTH, 0)); arrayClass.defineMethod("empty?", IndexedCallback.create(M_EMPTY_P, 0)); arrayClass.defineMethod("index", IndexedCallback.create(M_INDEX, 1)); arrayClass.defineMethod("rindex", IndexedCallback.create(M_RINDEX, 1)); arrayClass.defineMethod("indexes", IndexedCallback.createOptional(M_INDICES)); arrayClass.defineMethod("indices", IndexedCallback.createOptional(M_INDICES)); arrayClass.defineMethod("clone", IndexedCallback.create(M_CLONE, 0)); arrayClass.defineMethod("join", CallbackFactory.getOptMethod(RubyArray.class, "join")); arrayClass.defineMethod("reverse", IndexedCallback.create(M_REVERSE, 0)); arrayClass.defineMethod("reverse!", IndexedCallback.create(M_REVERSE_BANG, 0)); arrayClass.defineMethod("sort", IndexedCallback.create(M_SORT, 0)); arrayClass.defineMethod("sort!", IndexedCallback.create(M_SORT_BANG, 0)); arrayClass.defineMethod("collect", IndexedCallback.create(M_COLLECT, 0)); arrayClass.defineMethod("collect!", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("map!", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("filter", IndexedCallback.create(M_COLLECT_BANG, 0)); arrayClass.defineMethod("delete", IndexedCallback.create(M_DELETE, 1)); arrayClass.defineMethod("delete_at", IndexedCallback.create(M_DELETE_AT, 1)); arrayClass.defineMethod("delete_if", IndexedCallback.create(M_DELETE_IF, 0)); arrayClass.defineMethod("reject!", IndexedCallback.create(M_REJECT_BANG, 0)); arrayClass.defineMethod("replace", IndexedCallback.create(M_REPLACE, 1)); arrayClass.defineMethod("clear", IndexedCallback.create(M_CLEAR, 0)); arrayClass.defineMethod("fill", CallbackFactory.getOptMethod(RubyArray.class, "fill")); arrayClass.defineMethod("include?", IndexedCallback.create(M_INCLUDE_P, 1)); arrayClass.defineMethod("<=>", CallbackFactory.getMethod(RubyArray.class, "op_cmp", RubyObject.class)); arrayClass.defineMethod("slice", CallbackFactory.getOptMethod(RubyArray.class, "aref")); arrayClass.defineMethod("slice!", CallbackFactory.getOptMethod(RubyArray.class, "slice_bang")); arrayClass.defineMethod("assoc", CallbackFactory.getMethod(RubyArray.class, "assoc", RubyObject.class)); arrayClass.defineMethod("rassoc", CallbackFactory.getMethod(RubyArray.class, "rassoc", RubyObject.class)); arrayClass.defineMethod("+", CallbackFactory.getMethod(RubyArray.class, "op_plus", RubyObject.class)); arrayClass.defineMethod("*", CallbackFactory.getMethod(RubyArray.class, "op_times", RubyObject.class)); arrayClass.defineMethod("-", CallbackFactory.getMethod(RubyArray.class, "op_diff", RubyObject.class)); arrayClass.defineMethod("&", CallbackFactory.getMethod(RubyArray.class, "op_and", RubyObject.class)); arrayClass.defineMethod("|", CallbackFactory.getMethod(RubyArray.class, "op_or", RubyObject.class)); arrayClass.defineMethod("uniq", CallbackFactory.getMethod(RubyArray.class, "uniq")); arrayClass.defineMethod("uniq!", CallbackFactory.getMethod(RubyArray.class, "uniq_bang")); arrayClass.defineMethod("compact", CallbackFactory.getMethod(RubyArray.class, "compact")); arrayClass.defineMethod("compact!", CallbackFactory.getMethod(RubyArray.class, "compact_bang")); arrayClass.defineMethod("flatten", CallbackFactory.getMethod(RubyArray.class, "flatten")); arrayClass.defineMethod("flatten!", CallbackFactory.getMethod(RubyArray.class, "flatten_bang")); arrayClass.defineMethod("nitems", CallbackFactory.getMethod(RubyArray.class, "nitems")); arrayClass.defineMethod("pack", CallbackFactory.getMethod(RubyArray.class, "pack", RubyString.class)); return arrayClass; }
| 3,234,612
|
public RubyFixnum length() { return new RubyFixnum(getRuby(), getLength()); }
|
public RubyFixnum length() { return new RubyFixnum(getRuby(), getLength()); }
| 3,234,613
|
public static String getVersion() { return "1.1.9.3"; }
|
public static String getVersion() { return "1.1.9.4"; }
| 3,234,614
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
| 3,234,615
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
| 3,234,616
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
| 3,234,617
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
|
public void execute() throws BuildException { Header.print(System.out); getJava().createArg().setValue("-i"); getJava().createArg().setValue(coverageDataFileName); getJava().createArg().setValue("-s"); getJava().createArg().setValue(src.toString()); getJava().createArg().setValue("-o"); getJava().createArg().setValue(destDir.toString()); getJava().createArg().setValue("-f"); getJava().createArg().setValue(format); if (getJava().executeJava() != 0) { throw new BuildException(); } }
| 3,234,618
|
public RubyObject eval(Ruby ruby, RubyObject self) { while (getConditionNode().eval(ruby, self).isFalse()) { while (true) { try { getBodyNode().eval(ruby, self); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return ruby.getNil(); } } } return ruby.getNil(); }
|
public RubyObject eval(Ruby ruby, RubyObject self) { while (getConditionNode().eval(ruby, self).isFalse()) { while (true) { try { getBodyNode().eval(ruby, self); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakJump bExcptn) { return ruby.getNil(); } } } return ruby.getNil(); }
| 3,234,620
|
public RubyObject eval(Ruby ruby, RubyObject self) { while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { getBodyNode().eval(ruby, self); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return ruby.getNil(); }
|
public RubyObject eval(Ruby ruby, RubyObject self) { while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { getBodyNode().eval(ruby, self); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakJump bExcptn) { break; } } return ruby.getNil(); }
| 3,234,621
|
public void mouseDragged(MouseEvent event) { // Return if slider disabled or we're not dragging slider. if (!slider.isEnabled() || !isDragging) return; currentMouseX = event.getX(); currentMouseY = event.getY(); slider.setValueIsAdjusting(true); int thumbMiddle; int thumbPosition; switch (slider.getOrientation()) { case JSlider.VERTICAL: thumbMiddle = thumbRect.height/2; thumbPosition = event.getY()-offset; int trackTop = trackRect.y; int trackBottom = trackRect.y+(trackRect.height-1); int MaxYValue = yPositionForValue(slider.getMaximum() -slider.getExtent()); if (drawInverted()) trackBottom = MaxYValue; else trackTop = MaxYValue; thumbPosition = Math.max(thumbPosition, trackTop-thumbMiddle); thumbPosition = Math.min(thumbPosition, trackBottom-thumbMiddle); setThumbLocation(thumbRect.x, thumbPosition); thumbMiddle = thumbPosition+thumbMiddle; slider.setValue(valueForYPosition(thumbMiddle)); break; case JSlider.HORIZONTAL: thumbMiddle = thumbRect.width/2; thumbPosition = event.getX()-offset; int trackLeft = trackRect.x; int trackRight = trackRect.x+(trackRect.width-1); int MaxXValue = xPositionForValue(slider.getMaximum() - slider.getExtent()); if (drawInverted()) trackLeft = MaxXValue; else trackRight = MaxXValue; thumbPosition = Math.max(thumbPosition, trackLeft-thumbMiddle); thumbPosition = Math.min(thumbPosition, trackRight-thumbMiddle); setThumbLocation(thumbPosition, thumbRect.y); thumbMiddle = thumbPosition+thumbMiddle; slider.setValue(valueForXPosition(thumbMiddle)); break; } if (showTipLabel && tipDialog != null && endLabel != null) { Point location = slider.getLocationOnScreen(); location.x += thumbRect.x+TOOLTIP_OFFSET; location.y += thumbRect.y; tipDialog.setTipString( endLabel+" : " + slider.getValue()); tipDialog.setLocation(location); tipDialog.setVisible(true); } }
|
public void mouseDragged(MouseEvent event) { // Return if slider disabled or we're not dragging slider. if (!slider.isEnabled() || !isDragging) return; currentMouseX = event.getX(); currentMouseY = event.getY(); slider.setValueIsAdjusting(true); int thumbMiddle; int thumbPosition; switch (slider.getOrientation()) { case JSlider.VERTICAL: thumbMiddle = thumbRect.height/2; thumbPosition = event.getY()-offset; int trackTop = trackRect.y; int trackBottom = trackRect.y+(trackRect.height-1); int MaxYValue = yPositionForValue(slider.getMaximum() -slider.getExtent()); if (drawInverted()) trackBottom = MaxYValue; else trackTop = MaxYValue; thumbPosition = Math.max(thumbPosition, trackTop-thumbMiddle); thumbPosition = Math.min(thumbPosition, trackBottom-thumbMiddle); setThumbLocation(thumbRect.x, thumbPosition); thumbMiddle = thumbPosition+thumbMiddle; slider.setValue(valueForYPosition(thumbMiddle)); break; case JSlider.HORIZONTAL: thumbMiddle = thumbRect.width/2; thumbPosition = event.getX()-offset; int trackLeft = trackRect.x; int trackRight = trackRect.x+(trackRect.width-1); int MaxXValue = xPositionForValue(slider.getMaximum() - slider.getExtent()); if (drawInverted()) trackLeft = MaxXValue; else trackRight = MaxXValue; thumbPosition = Math.max(thumbPosition, trackLeft-thumbMiddle); thumbPosition = Math.min(thumbPosition, trackRight-thumbMiddle); setThumbLocation(thumbPosition, thumbRect.y); thumbMiddle = thumbPosition+thumbMiddle; slider.setValue(valueForXPosition(thumbMiddle)); break; } if (showTipLabel && tipDialog != null && endLabel != null) { Point location = slider.getLocationOnScreen(); location.x += thumbRect.x+TOOLTIP_OFFSET; location.y += thumbRect.y; tipDialog.setTipString( endLabel+" : " + slider.getValue()); tipDialog.setLocation(location); tipDialog.setVisible(true); } }
| 3,234,622
|
public void mousePressed(MouseEvent event) { // Check to see that the slider is enabled before proceeeding. if (!slider.isEnabled()) return; // Get mouse x, y positions. currentMouseX = event.getX(); currentMouseY = event.getY(); // If the slider has {@link #setFocusEnabled} true then // request focus. if (slider.isRequestFocusEnabled()) slider.requestFocus(); // Check to see if the thumb was clicked. if (thumbRect.contains(currentMouseX, currentMouseY)) { // Depending on orientation of the mouse. switch (slider.getOrientation()) { case JSlider.HORIZONTAL: offset = currentMouseX-thumbRect.x; break; case JSlider.VERTICAL: offset = currentMouseY-thumbRect.y; } isDragging = true; return; } if (showArrows) { if (minArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value > slider.getMinimum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection(OneKnobSliderUI.NEGATIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } if (maxArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value < slider.getMaximum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection( OneKnobSliderUI.POSITIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } } // We have clicked outside of the thumb and onto the track. isDragging = false; slider.repaint(); }
|
public void mousePressed(MouseEvent event) { // Check to see that the slider is enabled before proceeeding. if (!slider.isEnabled()) return; // Get mouse x, y positions. currentMouseX = event.getX(); currentMouseY = event.getY(); // If the slider has {@link #setFocusEnabled} true then // request focus. if (slider.isRequestFocusEnabled()) slider.requestFocus(); // Check to see if the thumb was clicked. if (thumbRect.contains(currentMouseX, currentMouseY)) { // Depending on orientation of the mouse. switch (slider.getOrientation()) { case JSlider.HORIZONTAL: offset = currentMouseX-thumbRect.x; break; case JSlider.VERTICAL: offset = currentMouseY-thumbRect.y; } isDragging = true; return; } if (showArrows) { if (minArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value > slider.getMinimum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection(OneKnobSliderUI.NEGATIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } if (maxArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value < slider.getMaximum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection( OneKnobSliderUI.POSITIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } } // We have clicked outside of the thumb and onto the track. isDragging = false; slider.repaint(); }
| 3,234,623
|
public void mousePressed(MouseEvent event) { // Check to see that the slider is enabled before proceeeding. if (!slider.isEnabled()) return; // Get mouse x, y positions. currentMouseX = event.getX(); currentMouseY = event.getY(); // If the slider has {@link #setFocusEnabled} true then // request focus. if (slider.isRequestFocusEnabled()) slider.requestFocus(); // Check to see if the thumb was clicked. if (thumbRect.contains(currentMouseX, currentMouseY)) { // Depending on orientation of the mouse. switch (slider.getOrientation()) { case JSlider.HORIZONTAL: offset = currentMouseX-thumbRect.x; break; case JSlider.VERTICAL: offset = currentMouseY-thumbRect.y; } isDragging = true; return; } if (showArrows) { if (minArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value > slider.getMinimum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection(OneKnobSliderUI.NEGATIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } if (maxArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value < slider.getMaximum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection( OneKnobSliderUI.POSITIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } } // We have clicked outside of the thumb and onto the track. isDragging = false; slider.repaint(); }
|
public void mousePressed(MouseEvent event) { // Check to see that the slider is enabled before proceeeding. if (!slider.isEnabled()) return; // Get mouse x, y positions. currentMouseX = event.getX(); currentMouseY = event.getY(); // If the slider has {@link #setFocusEnabled} true then // request focus. if (slider.isRequestFocusEnabled()) slider.requestFocus(); // Check to see if the thumb was clicked. if (thumbRect.contains(currentMouseX, currentMouseY)) { // Depending on orientation of the mouse. switch (slider.getOrientation()) { case JSlider.HORIZONTAL: offset = currentMouseX-thumbRect.x; break; case JSlider.VERTICAL: offset = currentMouseY-thumbRect.y; } isDragging = true; return; } if (showArrows) { if (minArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value > slider.getMinimum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection(OneKnobSliderUI.NEGATIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } if (maxArrowRect.contains(currentMouseX, currentMouseY)) { int value = slider.getValue(); if (value < slider.getMaximum()) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); scrollListener.setDirection( OneKnobSliderUI.POSITIVE_SCROLL); scrollTimer.start(); slider.repaint(); } isDragging = false; return; } } // We have clicked outside of the thumb and onto the track. isDragging = false; slider.repaint(); }
| 3,234,624
|
public void mouseReleased(MouseEvent event) { super.mouseReleased(event); if (showTipLabel && tipDialog != null) { if (tipDialog.isVisible()) tipDialog.setVisible(false); } }
|
public void mouseReleased(MouseEvent event) { super.mouseReleased(event); if (showTipLabel && tipDialog != null) { if (tipDialog.isVisible()) tipDialog.setVisible(false); } }
| 3,234,625
|
protected int compareValue(RubyNumeric other) { if (other instanceof RubyBignum) { return -other.compareValue(this); } else if (other instanceof RubyFloat) { final double otherVal = other.getDoubleValue(); return value > otherVal ? 1 : value < otherVal ? -1 : 0; } else { final long otherVal = other.getLongValue(); return value > otherVal ? 1 : value < otherVal ? -1 : 0; } }
|
protected int compareValue(RubyNumeric other) { if (other instanceof RubyBignum) { return -other.compareValue(this); } else if (other instanceof RubyFloat) { final double otherVal = other.getDoubleValue(); return value > otherVal ? 1 : value < otherVal ? -1 : 0; } else { final long otherVal = other.getLongValue(); return value > otherVal ? 1 : value < otherVal ? -1 : 0; } }
| 3,234,628
|
public IRubyObject op_minus(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_minus(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } else { long otherValue = ((RubyNumeric) other).getLongValue(); long result = value - otherValue; if ((value <= 0 && otherValue >= 0 && (result > 0 || result < -MAX)) || (value >= 0 && otherValue <= 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } return newFixnum(result); } }
|
public IRubyObject op_minus(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_minus(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } else if (other instanceof RubyNumeric) { long otherValue = ((RubyNumeric) other).getLongValue(); long result = value - otherValue; if ((value <= 0 && otherValue >= 0 && (result > 0 || result < -MAX)) || (value >= 0 && otherValue <= 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } return newFixnum(result); } }
| 3,234,629
|
public IRubyObject op_minus(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_minus(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } else { long otherValue = ((RubyNumeric) other).getLongValue(); long result = value - otherValue; if ((value <= 0 && otherValue >= 0 && (result > 0 || result < -MAX)) || (value >= 0 && otherValue <= 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } return newFixnum(result); } }
|
public IRubyObject op_minus(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_minus(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } else { long otherValue = ((RubyNumeric) other).getLongValue(); long result = value - otherValue; if ((value <= 0 && otherValue >= 0 && (result > 0 || result < -MAX)) || (value >= 0 && otherValue <= 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } return newFixnum(result); } }
| 3,234,630
|
public IRubyObject op_pow(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } else if (other instanceof RubyNumeric) { long longValue = ((RubyNumeric) other).getLongValue(); if (longValue == 0) { return getRuntime().newFixnum(1); } else if (longValue == 1) { return this; } else if (longValue > 1) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_pow(other); } else { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } } return callCoerced("**", other); }
|
public IRubyObject op_pow(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } else if (other instanceof RubyNumeric) { long longValue = ((RubyNumeric) other).getLongValue(); if (longValue == 0) { return getRuntime().newFixnum(1); } else if (longValue == 1) { return this; } else if (longValue > 1) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_pow(other); } else { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } } return callCoerced("**", other); }
| 3,234,632
|
private ObjectName createObjectName(String name, String type) { Properties props = new Properties(); if (type != null) { props.put("j2eeType", type); } props.put("name", name); props.put("J2EEApplication", applicationName); props.put("J2EEServer", serverName); return ServiceName.createName(domainName, props); }
|
private ObjectName createObjectName(String name, String type) { Properties props = new Properties(); if (type != null) { props.put("j2eeType", type); } props.put("name", name); props.put("J2EEApplication", "null"); props.put("J2EEModule", moduleName); props.put("J2EEServer", serverName); return ServiceName.createName(domainName, props); }
| 3,234,633
|
private List findTrajectoryEntries(Vector mexes) { SemanticTypesService sts = registry.getSemanticTypesService(); try { List instances = sts.retrieveTrajectoryEntriesByMEXs(mexes); System.err.println("# of trajectories..."+instances.size()); return instances; } catch(DSOutOfServiceException dso) { dso.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Connection Error",dso.getMessage(),dso); } catch(DSAccessException dsa) { dsa.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Server Error",dsa.getMessage(),dsa); } return null; }
|
private List findTrajectoryEntries(Vector mexes) { SemanticTypesService sts = registry.getSemanticTypesService(); try { List instances = sts.retrieveTrajectoryEntriesByMEXs(mexes); System.err.println("# of trajectories..."+instances.size()); return instances; } catch(DSOutOfServiceException dso) { dso.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Connection Error",dso.getMessage(),dso); } catch(DSAccessException dsa) { dsa.printStackTrace(); UserNotifier un = registry.getUserNotifier(); un.notifyError("Server Error",dsa.getMessage(),dsa); } return null; }
| 3,234,634
|
protected boolean nextArgsFile() { RubyArray args = (RubyArray)getRuntime().getGlobalVariables().get("$*"); if (args.getLength() == 0) { if (currentFile == null) { currentFile = (RubyIO) getRuntime().getGlobalVariables().get("$stdin"); ((RubyString) getRuntime().getGlobalVariables().get("$FILENAME")).setValue("-"); currentLineNumber = 0; return true; } return false; } String filename = ((RubyString) args.shift()).getValue(); ((RubyString) getRuntime().getGlobalVariables().get("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) getRuntime().getGlobalVariables().get("$stdin"); } else { currentFile = new RubyFile(getRuntime(), filename); } return true; }
|
protected boolean nextArgsFile() { RubyArray args = (RubyArray)getRuntime().getGlobalVariables().get("$*"); if (args.getLength() == 0) { if (currentFile == null) { currentFile = (RubyIO) getRuntime().getGlobalVariables().get("$stdin"); ((RubyString) getRuntime().getGlobalVariables().get("$FILENAME")).setValue(new StringBuffer("-")); currentLineNumber = 0; return true; } return false; } String filename = ((RubyString) args.shift()).getValue(); ((RubyString) getRuntime().getGlobalVariables().get("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) getRuntime().getGlobalVariables().get("$stdin"); } else { currentFile = new RubyFile(getRuntime(), filename); } return true; }
| 3,234,635
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.