bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(urlDSS, seisAudit); }
|
void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(urlDSS, seisAudit); }
| 1,118,342
|
void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(urlDSS, seisAudit); }
|
void loadSacFile(Element dsElement, File sacFile) throws IOException, FissuresException { if (excludes.contains(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) if (paramRefs.containsValue(sacFile.getName())) { return; } // end of if (excludes.contains(sacFile.getName())) SacTimeSeries sac = new SacTimeSeries(); sac.read(sacFile.getCanonicalPath()); AuditInfo[] audit = new AuditInfo[1]; audit[0] = new AuditInfo(userName+" via SacDirToDataSet", "seismogram loaded from "+sacFile.getCanonicalPath()); URL seisURL = new URL(dirURL, sacFile.getName()); // System.out.println(" the seisURL is "+seisURL.toString()); // DataInputStream dis = new DataInputStream(new BufferedInputStream(seisURL.openStream())); // SacTimeSeries sac = new SacTimeSeries(); //sac.read(dis); edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); System.out.println("The PATH is "+sacFile.getParent()); edu.sc.seis.fissuresUtil.cache.CacheEvent event = SacToFissures.getEvent(sac); if (event != null && dataset.getParameter(EVENT) == null) { String eventName = event.get_attributes().name; String eName = eventName.replace(' ', '_'); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, StdDataSetParamNames.EVENT, event); AuditInfo[] eventAudit = new AuditInfo[1]; eventAudit[0] = new AuditInfo(System.getProperty("user.name"), "event loaded from sac file."); dataset.addParameter(StdDataSetParamNames.EVENT, event, eventAudit); } // end of if (event != null) Channel channel = SacToFissures.getChannel(sac); String channelParamName = StdDataSetParamNames.CHANNEL+ChannelIdUtil.toString(seis.channel_id); if (channel != null && dataset.getParameter(channelParamName) == null) { // add channel AuditInfo[] chanAudit = new AuditInfo[1]; chanAudit[0] = new AuditInfo(System.getProperty("user.name"), "channel loaded from sac file."); dataset.addParameter(channelParamName, channel, chanAudit); Element paramElement = dsElement.getOwnerDocument().createElement("parameter"); dsElement.appendChild(paramElement); dataSetToXML.insert(paramElement, channelParamName, channel); } String seisName = sacFile.getName(); if (seisName.endsWith(".SAC")) { seisName = seisName.substring(0,seisName.length()-4); } // end of if (seisName.endsWith(".SAC")) seis.setName(seisName); URLDataSetSeismogram urlDSS = new URLDataSetSeismogram(seisURL, SeismogramFileTypes.SAC, dataset); urlDSS.addToCache(seisURL, SeismogramFileTypes.SAC, seis); AuditInfo[] seisAudit = new AuditInfo[1]; seisAudit[0] = new AuditInfo(System.getProperty("user.name"), "seismogram loaded from sac file."); dataset.addDataSetSeismogram(memDSS, seisAudit); System.out.println("Done with "+seisName); }
| 1,118,343
|
public static void main (String[] args) { if (args.length < 4) { System.err.println("Usage: java edu.sc.seis.fissuresUtil.sac.SacDirToDataSet -base url -dir directoryPath -name datasetname [-exclude file] [-paramRef name file]"); return; } // end of if (args.length != 2) String dirName = null; URL base = null; String baseStr = ""; String dsName = "default dataset name"; LinkedList excludes = new LinkedList(); HashMap params = new HashMap(); int i=0; while (i<args.length) { System.out.println(i+" "+args[i]); if (args[i].equals("-dir")) { dirName = args[i+1]; i+=2; } else if (args[i].equals("-name")) { String tmp = args[i+1]; if (tmp.endsWith("/") || tmp.endsWith("\\") || tmp.endsWith(":") || tmp.endsWith(".") ) { tmp = tmp.substring(0, tmp.length()-1); } // end of if (dsName.endsWith('/')) tmp = tmp.replace(' ','_'); if (tmp.length() > 0) { dsName = tmp; } // end of if (tmp.length() > 0) i+=2; } else if (args[i].equals("-base")) { baseStr = args[i+1]; System.out.println("The baseStr is "+baseStr); i+=2; } else if (args[i].equals("-exclude")) { excludes.add(args[i+1]); i+=2; } else if (args[i].equals("-paramRef")) { params.put(args[i+1], args[i+2]); i+=3; } else { System.out.println("Don't understand "+args[i++]); } } // end of for (int i=0; i<args.length; i++) try { base = new URL(baseStr); System.out.println("base is "+base.toString()); File f = new File(dirName); if (dirName != null && f.isDirectory()) { SacDirToDataSet sdir = new SacDirToDataSet(base, f, dsName, excludes, params); sdir.process(); } else { System.err.println("Not a directory: "+args[1]); } // end of else } catch (Exception e) { e.printStackTrace(); } // end of try-catch } // end of main ()
|
public static void main (String[] args) { if (args.length < 4) { System.err.println("Usage: java edu.sc.seis.fissuresUtil.sac.SacDirToDataSet -base url -dir directoryPath -name datasetname [-exclude file] [-paramRef name file]"); return; } // end of if (args.length != 2) String dirName = null; URL base = null; String baseStr = ""; String dsName = "default dataset name"; LinkedList excludes = new LinkedList(); HashMap params = new HashMap(); int i=0; while (i<args.length) { System.out.println(i+" "+args[i]); if (args[i].equals("-dir")) { dirName = args[i+1]; i+=2; } else if (args[i].equals("-name")) { String tmp = args[i+1]; if (tmp.endsWith("/") || tmp.endsWith("\\") || tmp.endsWith(":") || tmp.endsWith(".") ) { tmp = tmp.substring(0, tmp.length()-1); } // end of if (dsName.endsWith('/')) tmp = tmp.replace(' ','_'); if (tmp.length() > 0) { dsName = tmp; } // end of if (tmp.length() > 0) i+=2; } else if (args[i].equals("-base")) { baseStr = args[i+1]; System.out.println("The baseStr is "+baseStr); i+=2; } else if (args[i].equals("-exclude")) { excludes.add(args[i+1]); i+=2; } else if (args[i].equals("-paramRef")) { params.put(args[i+1], args[i+2]); i+=3; } else { System.out.println("Don't understand "+args[i++]); } } // end of for (int i=0; i<args.length; i++) try { base = new URL(baseStr); System.out.println("base is "+base.toString()); File f = new File(dirName); if (dirName != null && f.isDirectory()) { SacDirToDataSet sdir = new SacDirToDataSet(base, f, dsName, excludes, params); sdir.process(); } else { System.err.println("Not a directory: "+args[1]); } // end of else } catch (Exception e) { e.printStackTrace(); } // end of try-catch } // end of main ()
| 1,118,344
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ i++; } seismos.add(i, name); return i; }
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } seismos.add(i, name); return i; }
| 1,118,346
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ i++; } seismos.add(i, name); return i; }
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && ((String)seismos.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, name); return i; }
| 1,118,347
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.jAlloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,348
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.jAlloc("method"), new NATMethod(AGSymbol.jAlloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,349
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void setUp() { try { customClosure_ = new NATObject(); customClosure_.meta_defineField(AGSymbol.alloc("apply"), new NativeClosure(customClosure_) { public ATObject base_apply(ATTable args) throws InterpreterException { ATTable apply_args = get(args, 1).base_asTable(); assertEquals(42, getNbr(apply_args, 1)); return NATNil._INSTANCE_; } }); customClosure_.meta_defineField(AGSymbol.alloc("method"), new NATMethod(AGSymbol.alloc("foo"), NATTable.EMPTY, new AGBegin(NATTable.EMPTY))); customContext_ = new NATObject(); customContext_.meta_defineField(AGSymbol.alloc("self"), NATNumber.atValue(24)); customClosure_.meta_defineField(AGSymbol.alloc("context"), customContext_); } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,350
|
public void testCoercedMetalevelInvocation() { try { ATClosure coercedObject = customClosure_.base_asClosure(); assertTrue(coercedObject.meta_respondsTo(AGSymbol.alloc("apply")).asNativeBoolean().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } }
|
public void testCoercedMetalevelInvocation() { try { ATClosure coercedObject = customClosure_.base_asClosure(); assertTrue(coercedObject.meta_respondsTo(AGSymbol.jAlloc("apply")).asNativeBoolean().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } }
| 1,118,351
|
private String constructString(String initialBit, List sections){ Iterator it = sections.iterator(); while(it.hasNext()){ initialBit += "<br/>\n" + constructString((Section)it.next()); } return initialBit; }
|
private String constructString(String initialBit, List sections){ Iterator it = sections.iterator(); while(it.hasNext()){ initialBit += "<hr/><br/>\n" + constructString((Section)it.next()); } return initialBit; }
| 1,118,353
|
private String makeDivider(int len){ return "<hline/>"; }
|
private String makeDivider(int len){ return "<hr/>"; }
| 1,118,354
|
public void report(String message, Throwable e, List sections) throws IOException{ File outFile = new File(directory, "Exception_"+lastFileNum+".html"); appendToIndexFile(outFile, e); BufferedWriter bw = new BufferedWriter(new FileWriter(outFile)); String str = getHeader(e, lastFileNum); str += message; str += "\n<br/>\n<br/>\n"; String stackTrace = "<h2>Stack Trace</h2><br/>"; str += stackTrace + "<pre>"+makeDivider(stackTrace.length()) + ExceptionReporterUtils.getTrace(e)+"</pre>"; bw.write(constructString(str, sections)); bw.close(); lastFileNum++; }
|
public void report(String message, Throwable e, List sections) throws IOException{ File outFile = new File(directory, "Exception_"+lastFileNum+".html"); appendToIndexFile(outFile, e); BufferedWriter bw = new BufferedWriter(new FileWriter(outFile)); String str = getHeader(e, lastFileNum); str += message; str += "\n<br/>\n<br/>\n"; String stackTrace = "<h2>Stack Trace</h2><br/>"; str += stackTrace +makeDivider(stackTrace.length()) + "<pre>"+ ExceptionReporterUtils.getTrace(e)+"</pre>"; bw.write(constructString(str, sections)); bw.close(); lastFileNum++; }
| 1,118,355
|
public abstract BwCalSuiteWrapper getCalSuite(String name) throws CalFacadeException;
|
public abstract BwCalSuiteWrapper getCalSuite() throws CalFacadeException;
| 1,118,356
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } BwEvent event = form.getEditEvent(); reqpar = request.getParameter("copy"); if (reqpar != null) { /* Refetch the event and switch it for a cloned copy. * guid must be set to null to avoid dup guid. */ EventInfo ei = form.fetchSvci().getEvent(event.getId()); BwEvent evcopy = new BwEventObj(); ei.getEvent().shallowCopyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); evcopy.setGuid(null); if (debug) { BwLocation l = evcopy.getLocation(); if (l == null) { debugMsg("Copied event has null location"); } else { debugMsg("Copied event has location with id " + l.getId()); } } ei.setEvent(evcopy); form.setEventInfo(ei); resetEvent(form); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form, svci, event, form.getErr())) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ event.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(event.getCalendar(), event, null); } else { svci.updateEvent(event); } if (!alerts) { updateAuthPrefs(form, event.getCategories(), event.getSponsor(), event.getLocation(), event.getCalendar()); } resetEvent(form); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } form.assignAddingEvent(false); return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } String reqpar = request.getParameter("delete"); if (reqpar != null) { return "delete"; } BwEvent event = form.getEditEvent(); reqpar = request.getParameter("copy"); if (reqpar != null) { /* Refetch the event and switch it for a cloned copy. * guid must be set to null to avoid dup guid. */ EventInfo ei = fetchEvent(event, form); BwEvent evcopy = new BwEventObj(); ei.getEvent().shallowCopyTo(evcopy); evcopy.setId(CalFacadeDefs.unsavedItemKey); evcopy.setGuid(null); if (debug) { BwLocation l = evcopy.getLocation(); if (l == null) { debugMsg("Copied event has null location"); } else { debugMsg("Copied event has location with id " + l.getId()); } } ei.setEvent(evcopy); form.setEventInfo(ei); resetEvent(form); form.assignAddingEvent(true); return "copy"; } CalSvcI svci = form.fetchSvci(); if (!validateEvent(form, svci, event, form.getErr())) { return "retry"; } /* Validation set up the form so that any selected contact, location * and or categories are available. */ event.setPublick(true); if (form.getAddingEvent()) { svci.addEvent(event.getCalendar(), event, null); } else { svci.updateEvent(event); } if (!alerts) { updateAuthPrefs(form, event.getCategories(), event.getSponsor(), event.getLocation(), event.getCalendar()); } resetEvent(form); if (form.getAddingEvent()) { form.getMsg().emit("org.bedework.client.message.event.added"); } else { form.getMsg().emit("org.bedework.client.message.event.updated"); } form.assignAddingEvent(false); return "continue"; }
| 1,118,357
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } List stationsUnderMouse = new ArrayList(); synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() > 1){ final JPopupMenu popup = new JPopupMenu(); Iterator it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { toggleStationSelection(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } else{ toggleStationSelection((Station)stationsUnderMouse.get(0)); } return true; } return false; }
|
public boolean mouseClicked(MouseEvent e){ if (currentPopup != null){ currentPopup.setVisible(false); currentPopup = null; } List stationsUnderMouse = new ArrayList(); synchronized(omgraphics){ Iterator it = omgraphics.iterator(); while(it.hasNext()){ OMStation current = (OMStation)it.next(); if(current.contains(e.getX(), e.getY())){ stationsUnderMouse.add(current.getStation()); } } } if (stationsUnderMouse.size() > 0){ if (stationsUnderMouse.size() > 1){ final JPopupMenu popup = new JPopupMenu(); Iterator it = stationsUnderMouse.iterator(); while (it.hasNext()){ final Station current = (Station)it.next(); final JMenuItem menuItem = new JMenuItem(getStationInfo(current, currentEvent)); menuItem.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { toggleStationSelection(current); popup.setVisible(false); } }); menuItem.addMouseListener(new MouseAdapter(){ public void mouseEntered(MouseEvent e) { menuItem.setArmed(true); } public void mouseExited(MouseEvent e) { menuItem.setArmed(false); } }); popup.add(menuItem); } Point compLocation = e.getComponent().getLocationOnScreen(); double[] popupLoc = {compLocation.getX(), compLocation.getY()}; popup.setLocation((int)popupLoc[0] + e.getX(), (int)popupLoc[1] + e.getY()); popup.setVisible(true); currentPopup = popup; } else{ toggleStationSelection((Station)stationsUnderMouse.get(0)); } return true; } return false; }
| 1,118,358
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingCategory(false); return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ initFields(form); form.assignAddingCategory(false); return "continue"; }
| 1,118,361
|
public BwUser getUser() throws CalFacadeException { return user; }
|
public BwUser getUser() throws CalFacadeException { return user; }
| 1,118,362
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
|
public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
| 1,118,363
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
| 1,118,364
|
private void logon(BwUser val) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
|
public void logon(BwUser val) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
| 1,118,365
|
public void updateUser() throws CalFacadeException { updateUser(getUser()); }
|
public void updateUser() throws CalFacadeException { updateUser(getUser()); }
| 1,118,366
|
public TPosAuthorisationEntriesBean findByAuthorisationIdRsp(java.lang.String p0)throws javax.ejb.FinderException;
|
public TPosAuthorisationEntriesBean findByAuthorisationIdRsp(java.lang.String p0, IWTimestamp stamp)throws javax.ejb.FinderException;
| 1,118,369
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0)throws javax.ejb.FinderException;
|
public KortathjonustanAuthorisationEntries findByAuthorizationCode(java.lang.String p0, IWTimestamp stamp)throws javax.ejb.FinderException;
| 1,118,370
|
public ATObject meta_invoke(ATObject receiver, ATSymbol selector, ATTable arguments) throws InterpreterException { return lookupFrame_.meta_invoke(receiver_, selector, arguments); }
|
public ATObject meta_invoke(ATObject receiver, ATSymbol selector, ATTable arguments) throws InterpreterException { if(selector == AGSymbol.jAlloc("==")) return super.meta_invoke(this, selector, arguments); return lookupFrame_.meta_invoke(receiver_, selector, arguments); }
| 1,118,371
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationLiteralsEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); setupCompartmentTitle(view); setupCompartmentCollapsed(view); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(EnumerationLiteralsEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); setupCompartmentTitle(view); setupCompartmentCollapsed(view); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
| 1,118,372
|
public ATFraction base_abs();
|
public ATNumeric base_abs();
| 1,118,373
|
public ATFraction base_dec();
|
public ATNumeric base_dec();
| 1,118,374
|
public ATFraction base_inc();
|
public ATNumeric base_inc();
| 1,118,375
|
public IdeaMapController(IdeaMap newIdeaMap) { this.ideaMap = newIdeaMap; this.ideaMap.setFocusTraversalKeysEnabled(false); this.ideaMap.setFocusable(true); this.ideaMap.addFocusListener(this); this.ideaMap.addKeyListener(this); this.ideaMap.addMouseListener(this); this.ideaMap.addMouseMotionListener(this); this.ideaMap.getTextField().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } } }); this.ideaMap.requestFocusInWindow(); }
|
public IdeaMapController(IdeaMap newIdeaMap) { this.ideaMap = newIdeaMap; this.ideaMap.setFocusTraversalKeysEnabled(false); this.ideaMap.setFocusable(true); this.ideaMap.addFocusListener(this); this.ideaMap.addKeyListener(this); this.ideaMap.addMouseListener(this); this.ideaMap.addMouseMotionListener(this); this.ideaMap.getTextField().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } } }); this.ideaMap.requestFocusInWindow(); }
| 1,118,376
|
public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } }
|
public void actionPerformed(ActionEvent e) { ideaMap.requestFocusInWindow(); IdeaView current = ideaMap.getSelectedView(); if (current != null) { unEditIdeaView(current); } }
| 1,118,377
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
| 1,118,378
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
| 1,118,379
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
| 1,118,380
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
| 1,118,381
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
|
public boolean init(String authenticatedUser, String user, boolean publicAdmin, boolean superUser, Groups groups, String synchId, boolean debug) throws CalFacadeException { this.debug = debug; boolean userCreated = false; if (authenticatedUser == null) { this.superUser = false; // be safe } BwUser authUser; try { access = new AccessUtil(superUser, debug); objTimestamp = new Timestamp(System.currentTimeMillis()); this.superUser = superUser; this.synchId = synchId; log = Logger.getLogger(getClass()); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } ignoreCreator = false; if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); ignoreCreator = superUser; if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); events = new Events(this, access, this.user, currentMode, ignoreCreator, debug); calendars = new Calendars(this, access, this.user, currentMode, ignoreCreator, debug); categories = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, this.user, currentMode, ignoreCreator, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, currentMode, ignoreCreator, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; }
| 1,118,382
|
protected TimezoneInfo lookup(String id) throws CalFacadeException { TimezoneInfo tzinfo; tzinfo = (TimezoneInfo)timezones.get(id); return tzinfo; }
|
protected TimezoneInfo lookup(String id) throws CalFacadeException { TimezoneInfo tzinfo; if (systemHasPrecedence) { tzinfo = (TimezoneInfo)systemTimezones.get(id); } else { tzinfo = (TimezoneInfo)timezones.get(id); } if (tzinfo == null) { if (systemHasPrecedence) { tzinfo = (TimezoneInfo)timezones.get(id); } else { tzinfo = (TimezoneInfo)systemTimezones.get(id); } } return tzinfo; }
| 1,118,383
|
public void testNullContext() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); impl.setContextSource(this.contextSource); try { impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); fail("IllegalStateException should have been thrown with no query configured"); } catch (IllegalStateException ise) { //expected } }
|
public void testNullContext() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); impl.setContextSource(this.contextSource); try { impl.getUserAttributes(Collections.singletonMap("username", "seed")); fail("IllegalStateException should have been thrown with no query configured"); } catch (IllegalStateException ise) { //expected } }
| 1,118,384
|
public void testNullQuery() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); try { impl.getUserAttributes(Collections.singletonMap("dummy", "seed")); fail("IllegalStateException should have been thrown with no context configured"); } catch (IllegalStateException ise) { //expected } }
|
public void testNullQuery() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); try { impl.getUserAttributes(Collections.singletonMap("username", "seed")); fail("IllegalStateException should have been thrown with no context configured"); } catch (IllegalStateException ise) { //expected } }
| 1,118,385
|
public void testProperties() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); assertEquals("", impl.getBaseDN()); impl.setBaseDN("BaseDN"); assertEquals("BaseDN", impl.getBaseDN()); impl.setBaseDN(null); assertEquals("", impl.getBaseDN()); assertEquals(Collections.EMPTY_MAP, impl.getLdapAttributesToPortalAttributes()); Map attrMap = new HashMap(); attrMap.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(attrMap); Map expectedAttrMap = new HashMap(attrMap); expectedAttrMap.put("mail", Collections.singleton("email")); assertEquals(expectedAttrMap, impl.getLdapAttributesToPortalAttributes()); assertNull(impl.getContextSource()); impl.setContextSource(this.contextSource); assertEquals(contextSource, impl.getContextSource()); impl.setLdapAttributesToPortalAttributes(null); assertEquals(Collections.EMPTY_SET, impl.getPossibleUserAttributeNames()); impl.setLdapAttributesToPortalAttributes(attrMap); assertEquals(Collections.singleton("email"), impl.getPossibleUserAttributeNames()); assertNull(impl.getQuery()); impl.setQuery("QueryString"); assertEquals("QueryString", impl.getQuery()); assertEquals(Collections.EMPTY_LIST, impl.getQueryAttributes()); impl.setQueryAttributes(Collections.singletonList("QAttr")); assertEquals(Collections.singletonList("QAttr"), impl.getQueryAttributes()); assertEquals(0, impl.getTimeLimit()); impl.setTimeLimit(1337); assertEquals(1337, impl.getTimeLimit()); }
|
public void testProperties() { LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); assertEquals("", impl.getBaseDN()); impl.setBaseDN("BaseDN"); assertEquals("BaseDN", impl.getBaseDN()); impl.setBaseDN(null); assertEquals("", impl.getBaseDN()); assertEquals(Collections.EMPTY_MAP, impl.getLdapAttributesToPortalAttributes()); Map attrMap = new HashMap(); attrMap.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(attrMap); Map expectedAttrMap = new HashMap(attrMap); expectedAttrMap.put("mail", Collections.singleton("email")); assertEquals(expectedAttrMap, impl.getLdapAttributesToPortalAttributes()); assertNull(impl.getContextSource()); impl.setContextSource(this.contextSource); assertEquals(contextSource, impl.getContextSource()); impl.setLdapAttributesToPortalAttributes(null); assertEquals(Collections.EMPTY_SET, impl.getPossibleUserAttributeNames()); impl.setLdapAttributesToPortalAttributes(attrMap); assertEquals(Collections.singleton("email"), impl.getPossibleUserAttributeNames()); assertNull(impl.getQuery()); impl.setQuery("QueryString"); assertEquals("QueryString", impl.getQuery()); assertNull(impl.getQueryAttributes()); impl.setQueryAttributes(Collections.singletonList("QAttr")); assertEquals(Collections.singletonList("QAttr"), impl.getQueryAttributes()); assertEquals(0, impl.getTimeLimit()); impl.setTimeLimit(1337); assertEquals(1337, impl.getTimeLimit()); }
| 1,118,386
|
public void setComponentsBounds() { int width = panel.getWidth(); int height = panel.getHeight(); int gameBoardWidth = width / 2 - (borderWidth + borderWidth / 2); int gameBoardHeight = gameBoardWidth * 3 / 4; setComponentBounds(gameBoard, borderWidth, borderWidth, gameBoardWidth, gameBoardHeight); int tileRackBackgroundY = borderWidth + gameBoardHeight + borderWidth; int tileRackBackgroundHeight = gameBoardHeight * 2 / 13; setComponentBounds(tileRackBackground, borderWidth, tileRackBackgroundY, gameBoardWidth, tileRackBackgroundHeight); int tileRackHeight = tileRackBackgroundHeight * 8 / 10; int tileRackWidth = tileRackHeight * 6 + TileRack.spacing * 5; int tileRackX = (width / 2 + borderWidth / 2 - tileRackWidth) / 2; int tileRackY = tileRackBackgroundY + (tileRackBackgroundHeight - tileRackHeight) / 2; setComponentBounds(tileRack, tileRackX, tileRackY, tileRackWidth, tileRackHeight); int lobbyY = tileRackBackgroundY + tileRackBackgroundHeight + borderWidth; int lobbyPostHeight = (int)lobbyPost.getPreferredSize().getHeight(); int lobbyHeight = height - borderWidth - lobbyY; if (lobbyPost.isVisible()) { lobbyHeight -= lobbyPostHeight; } setComponentBounds(lobby, borderWidth, lobbyY, gameBoardWidth, lobbyHeight); int lobbyPostY = lobbyY + lobbyHeight; setComponentBounds(lobbyPost, borderWidth, lobbyPostY, gameBoardWidth, lobbyPostHeight); int scoreSheetY = width / 2 + borderWidth / 2; int scoreSheetRowHeight = gameBoardWidth * 10 / 18 / 10; int numRowsInScoreSheet = Main.getMain().getNumberOfPlayers() + 4; int scoreSheetHeight = scoreSheetRowHeight * numRowsInScoreSheet; scoreSheet.setRowHeight(scoreSheetRowHeight); setComponentBounds(scoreSheet, scoreSheetY, borderWidth, gameBoardWidth, scoreSheetHeight); int gameRoomY = borderWidth + scoreSheetHeight + borderWidth; int gameRoomPostHeight = (int)gameRoomPost.getPreferredSize().getHeight(); int gameRoomHeight = height - borderWidth - gameRoomY; if (gameRoomPost.isVisible()) { gameRoomHeight -= gameRoomPostHeight; } setComponentBounds(gameRoom, scoreSheetY, gameRoomY, gameBoardWidth, gameRoomHeight); int gameRoomPostY = gameRoomY + gameRoomHeight; setComponentBounds(gameRoomPost, scoreSheetY, gameRoomPostY, gameBoardWidth, gameRoomPostHeight); }
|
public void setComponentsBounds() { int width = panel.getWidth(); int height = panel.getHeight(); int gameBoardWidth = width / 2 - (borderWidth + borderWidth / 2); int gameBoardHeight = gameBoardWidth * 3 / 4; setComponentBounds(gameBoard, borderWidth, borderWidth, gameBoardWidth, gameBoardHeight); int tileRackBackgroundY = borderWidth + gameBoardHeight + borderWidth; int tileRackBackgroundHeight = gameBoardHeight * 2 / 13; setComponentBounds(tileRackBackground, borderWidth, tileRackBackgroundY, gameBoardWidth, tileRackBackgroundHeight); int tileRackHeight = tileRackBackgroundHeight * 8 / 10; int tileRackWidth = tileRackHeight * 6 + TileRack.spacing * 5; int tileRackX = (width / 2 + borderWidth / 2 - tileRackWidth) / 2; int tileRackY = tileRackBackgroundY + (tileRackBackgroundHeight - tileRackHeight) / 2; setComponentBounds(tileRack, tileRackX, tileRackY, tileRackWidth, tileRackHeight); int lobbyY = tileRackBackgroundY + tileRackBackgroundHeight + borderWidth; int lobbyPostHeight = (int)lobbyPost.getPreferredSize().getHeight(); int lobbyHeight = height - borderWidth - lobbyY; if (lobbyPost.isVisible()) { lobbyHeight -= lobbyPostHeight; } setComponentBounds(lobby, borderWidth, lobbyY, gameBoardWidth, lobbyHeight); int lobbyPostY = lobbyY + lobbyHeight; setComponentBounds(lobbyPost, borderWidth, lobbyPostY, gameBoardWidth, lobbyPostHeight); int scoreSheetY = width / 2 + borderWidth / 2; int scoreSheetRowHeight = gameBoardWidth * 10 / 18 / 10; int scoreSheetHeight = scoreSheetRowHeight * numRowsInScoreSheet; scoreSheet.setRowHeight(scoreSheetRowHeight); setComponentBounds(scoreSheet, scoreSheetY, borderWidth, gameBoardWidth, scoreSheetHeight); int gameRoomY = borderWidth + scoreSheetHeight + borderWidth; int gameRoomPostHeight = (int)gameRoomPost.getPreferredSize().getHeight(); int gameRoomHeight = height - borderWidth - gameRoomY; if (gameRoomPost.isVisible()) { gameRoomHeight -= gameRoomPostHeight; } setComponentBounds(gameRoom, scoreSheetY, gameRoomY, gameBoardWidth, gameRoomHeight); int gameRoomPostY = gameRoomY + gameRoomHeight; setComponentBounds(gameRoomPost, scoreSheetY, gameRoomPostY, gameBoardWidth, gameRoomPostHeight); }
| 1,118,387
|
private ModuleLoader.ModuleInfoContainer getModuleInfo() throws ModuleLoaderException { try { URL jarURL = new URL("jar", "", url +"!/"); JarURLConnection conn = (JarURLConnection)jarURL.openConnection(); Attributes attr = conn.getMainAttributes(); if (attr == null) { throw new ModuleLoaderException("No Module-Class defined"); } String moduleClassName = attr.getValue(ATTR_MODULE_CLASS); if (moduleClassName == null) { throw new ModuleLoaderException("No Module-Class defined"); } else { ModuleInfoContainer info = new ModuleInfoContainer(); info.moduleClassName = moduleClassName; info.version = parseFloat(attr.getValue(ATTR_MODULE_VERSION)); info.name = attr.getValue(ATTR_MODULE_NAME); info.configClassName = attr.getValue(ATTR_MODULE_CONFIG_CLASS); info.protocols = getProtocols(attr); info.requirements = getRequirements(attr); info.informationResource = attr.getValue(ATTR_MODULE_INFORMATION); return info; } } catch (Exception exc) { throw new ModuleLoaderException(exc); } }
|
private ModuleLoader.ModuleInfoContainer getModuleInfo() throws ModuleLoaderException { try { URL jarURL = new URL("jar", "", url +"!/"); JarURLConnection conn = (JarURLConnection)jarURL.openConnection(); Attributes attr = conn.getMainAttributes(); if (attr == null) { throw new ModuleLoaderException("No Module-Class defined"); } String moduleClassName = attr.getValue(ATTR_MODULE_CLASS); if (moduleClassName == null) { throw new ModuleLoaderException("No Module-Class defined"); } else { ModuleInfoContainer info = new ModuleInfoContainer(); info.moduleClassName = moduleClassName; info.version = parseFloat(attr.getValue(ATTR_MODULE_VERSION)); info.name = attr.getValue(ATTR_MODULE_NAME); info.configClassName = attr.getValue(ATTR_MODULE_CONFIG_CLASS); info.protocols = getProtocols(attr); info.requirements = getRequirements(attr); info.infoURL = getInfoURL(jarURL, attr); return info; } } catch (Exception exc) { throw new ModuleLoaderException(exc); } }
| 1,118,388
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); Rectangle currentClip = copy.getClip().getBounds(); copy.setClip(currentClip.x,currentClip.y, width, height); try { copy.setFont(DisplayUtils.BORDER_FONT); copy.setStroke(DisplayUtils.TWO_PIXEL_STROKE); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); // top int numTicks; int pixelLoc; ScaleMapper map = topScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if(map.isMajorTick(i)){ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); String label = map.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength - 3); } }else{ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); } } copy.drawString(map.getAxisLabel(), width/2, fontHeight); } // left map = leftScaleMap; if (map != null) { numTicks = map.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); }else{ // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(left, pixelLoc, left - majorTickLength, pixelLoc)); String label = map.getLabel(i); if (label != null && label.length() != 0) { Rectangle2D stringBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(left - majorTickLength - stringBounds.getWidth()) - 2, pixelLoc + fm.getAscent()/2 - 2); } } else { copy.draw(new Line2D.Float(left - minorTickLength, pixelLoc, left, pixelLoc)); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(map.getAxisLabel(), copy); } double yTranslate = insets.top + (height - insets.top - insets.bottom + leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(map.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } } // bottom map = bottomScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); String label = map.getLabel(i); Rectangle2D labelBounds = fm.getStringBounds(label, copy); int labelWidth = (int)labelBounds.getWidth(); int labelHeight = (int)labelBounds.getHeight(); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc - labelWidth/2, height- bottom + majorTickLength + labelHeight); } } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } } String label = map.getAxisLabel(); Rectangle2D labelBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(insets.left + (width - insets.left - insets.right - labelBounds.getWidth())/2), height); } // right map = rightScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); String label = map.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g.create(); if (copy != null) { copy.translate(x,y); Rectangle currentClip = copy.getClip().getBounds(); copy.setClip(currentClip.x,currentClip.y, width, height - 5); try { copy.setFont(DisplayUtils.BORDER_FONT); copy.setStroke(DisplayUtils.TWO_PIXEL_STROKE); // in case there are borders inside of this one Insets insets = ((JComponent)c).getInsets(); FontMetrics fm = copy.getFontMetrics(); // top int numTicks; int pixelLoc; ScaleMapper map = topScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if(map.isMajorTick(i)){ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - majorTickLength)); String label = map.getLabel(i); if (label != null && label.length() != 0 ) { int labelWidth = (int)fm.getStringBounds(label, copy).getWidth(); copy.drawString(label, pixelLoc - labelWidth/2, top - majorTickLength - 3); } }else{ copy.draw(new Line2D.Float(pixelLoc, top, pixelLoc, top - minorTickLength)); } } copy.drawString(map.getAxisLabel(), width/2, fontHeight); } // left map = leftScaleMap; if (map != null) { numTicks = map.getNumTicks(); if ( numTicks == 0 || numTicks ==1) { copy.drawString("No Data", fontHeight + 2, top + (height - top - bottom)/2- fm.getLeading()); }else{ // end of if () for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(left, pixelLoc, left - majorTickLength, pixelLoc)); String label = map.getLabel(i); if (label != null && label.length() != 0) { Rectangle2D stringBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(left - majorTickLength - stringBounds.getWidth()) - 2, pixelLoc + fm.getAscent()/2 - 2); } } else { copy.draw(new Line2D.Float(left - minorTickLength, pixelLoc, left, pixelLoc)); } } if(leftAxisLabelBounds == null){ leftAxisLabelBounds = copy.getFontMetrics().getStringBounds(map.getAxisLabel(), copy); } double yTranslate = insets.top + (height - insets.top - insets.bottom + leftAxisLabelBounds.getWidth())/2; double xTranslate = leftAxisLabelBounds.getHeight(); copy.translate(xTranslate, yTranslate); copy.rotate(-Math.PI/2); copy.drawString(map.getAxisLabel(), 0, 0); copy.rotate(Math.PI/2); copy.translate(-xTranslate, -yTranslate); } } // bottom map = bottomScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = insets.left + map.getPixelLocation(i); if (map.isMajorTick(i)) { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+majorTickLength)); String label = map.getLabel(i); Rectangle2D labelBounds = fm.getStringBounds(label, copy); int labelWidth = (int)labelBounds.getWidth(); int labelHeight = (int)labelBounds.getHeight(); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc - labelWidth/2, height- bottom + majorTickLength + labelHeight); } } else { copy.draw(new Line2D.Float(pixelLoc, height-bottom, pixelLoc, height-bottom+minorTickLength)); } } String label = map.getAxisLabel(); Rectangle2D labelBounds = fm.getStringBounds(label, copy); copy.drawString(label, (int)(insets.left + (width - insets.left - insets.right - labelBounds.getWidth())/2), height - 5); } // right map = rightScaleMap; if (map != null) { numTicks = map.getNumTicks(); for (int i=0; i<numTicks; i++) { pixelLoc = height - map.getPixelLocation(i) - bottom; copy.draw(new Line2D.Float(pixelLoc, c.getSize().height-bottom, pixelLoc, c.getSize().height-bottom/2)); String label = map.getLabel(i); if (label != null && label.length() != 0) { copy.drawString(label, pixelLoc, c.getSize().height-fm.getLeading()); } } } } finally { copy.dispose(); } } }
| 1,118,389
|
public void setBottomScaleMapper(ScaleMapper scaleMap) { this.bottomScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ bottom = 20 + getFontHeight(scaleMap.getAxisLabel()); }else{ bottom = 20; } }
|
public void setBottomScaleMapper(ScaleMapper scaleMap) { this.bottomScaleMap = scaleMap; if(scaleMap.getAxisLabel() != null && !scaleMap.getAxisLabel().equals("")){ bottom = majorTickLength + 2 * getFontHeight(scaleMap.getAxisLabel()) + 5; }else{ bottom = 20; } }
| 1,118,390
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } }
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } }
| 1,118,391
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } }
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(prop); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } }
| 1,118,392
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + nm + " ns: " + ns + " value: " + value); } } }
|
private void processPlist(Collection plist, Element node, boolean remove) throws WebdavException { Element[] props = getChildren(node); for (int i = 0; i < props.length; i++) { Element prop = props[i]; String ns = prop.getNamespaceURI(); String nm = prop.getLocalName(); String value = getElementContent(prop); if (remove && (value != null)) { throw new WebdavBadRequest(); } plist.add(new Property(ns, nm, value)); if (debug) { trace("reqtype: " + prop.getLocalName() + " ns: " + prop.getNamespaceURI() + " value: " + value); } } }
| 1,118,393
|
public ClassFigure() { this.setLayoutManager(new org.eclipse.gmf.internal.codegen.draw2d.GridLayout()); this.setFill(false); this.setFillXOR(false); this.setOutline(false); this.setOutlineXOR(false); this.setLineWidth(1); this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); createContents(); }
|
public ClassFigure() { org.eclipse.gmf.internal.codegen.draw2d.GridLayout layoutThis = new org.eclipse.gmf.internal.codegen.draw2d.GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; layoutThis.horizontalSpacing = 0; layoutThis.verticalSpacing = 0; layoutThis.marginWidth = 0; layoutThis.marginHeight = 0; this.setLayoutManager(layoutThis); this.setFill(false); this.setFillXOR(false); this.setOutline(false); this.setOutlineXOR(false); this.setLineWidth(1); this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); createContents(); }
| 1,118,394
|
public void setStartTime(MicroSecondDate date) { String t = seedDate.format(date); int millis =(int) (date.getMicroSeconds() % 1000000) / 100; setStartTime( t + millis); }
|
public void setStartTime(MicroSecondDate date) { String t = seedDate.format(date); int millis =(int) (date.getMicroSeconds() % 1000000) / 100; setStartTime( t + millis); }
| 1,118,395
|
public void initializeDisplay(DataSetSeismogram seis, String name, VerticalSeismogramDisplay parent){ this.name = name; this.parent = parent; plotPainter = new PlotPainter(); add(plotPainter); ampRegistrar.visibleAmpCalc(timeRegistrar); addSeismogram(seis); setLayout(new OverlayLayout(this)); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); timeScaleMap = new TimeScaleCalc(200, timeRegistrar); ampScaleMap = new AmpScaleMapper(50, 4, (AmpRangeConfig)ampRegistrar); setMinimumSize(new Dimension(100, 50)); scaleBorder = new ScaleBorder(); scaleBorder.setLeftScaleMapper(ampScaleMap); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), new LeftTitleBorder("")), BorderFactory.createCompoundBorder(scaleBorder, BorderFactory.createLoweredBevelBorder()))); Dimension d = getSize(); Insets insets = this.getInsets(); Insets current = this.getInsets(); setPreferredSize(new Dimension(200 + current.left, 100 + current.top + current.bottom)); }
|
public void initializeDisplay(DataSetSeismogram seis, String name, VerticalSeismogramDisplay parent){ this.name = name; this.parent = parent; plotPainter = new PlotPainter(); add(plotPainter); ampRegistrar.visibleAmpCalc(timeRegistrar); addSeismogram(seis); setLayout(new OverlayLayout(this)); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { resize(); } public void componentShown(ComponentEvent e) { resize(); } }); timeScaleMap = new TimeScaleCalc(200, timeRegistrar); ampScaleMap = new AmpScaleMapper(50, 4, ampRegistrar); setMinimumSize(new Dimension(100, 50)); scaleBorder = new ScaleBorder(); scaleBorder.setLeftScaleMapper(ampScaleMap); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), new LeftTitleBorder("")), BorderFactory.createCompoundBorder(scaleBorder, BorderFactory.createLoweredBevelBorder()))); Dimension d = getSize(); Insets insets = this.getInsets(); Insets current = this.getInsets(); setPreferredSize(new Dimension(200 + current.left, 100 + current.top + current.bottom)); }
| 1,118,397
|
public Object clone() { BwAuthUserPrefs aup = new BwAuthUserPrefs(); aup.setId(getId()); // Don't clone the authuser - sets up a loop aup.setAutoAddCategories(getAutoAddCategories()); TreeSet nts = new TreeSet(); Set ts = getPreferredCategories(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCategory)((BwCategory)it.next()).clone()); } } aup.setPreferredCategories(nts); aup.setAutoAddLocations(getAutoAddLocations()); nts = new TreeSet(); ts = getPreferredLocations(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwLocation)((BwLocation)it.next()).clone()); } } aup.setPreferredLocations(nts); aup.setAutoAddSponsors(getAutoAddSponsors()); nts = new TreeSet(); ts = getPreferredSponsors(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwSponsor)((BwSponsor)it.next()).clone()); } } aup.setPreferredSponsors(nts); aup.setAutoAddCalendars(getAutoAddCalendars()); nts = new TreeSet(); ts = getPreferredCalendars(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCalendar)((BwCalendar)it.next()).clone()); } } aup.setPreferredCalendars(nts); return aup; }
|
public Object clone() { BwAuthUserPrefs aup = new BwAuthUserPrefs(); aup.setId(getId()); // Don't clone the authuser - sets up a loop aup.setAutoAddCategories(getAutoAddCategories()); TreeSet nts = new TreeSet(); Set ts = getPreferredCategories(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCategory)((BwCategory)it.next()).clone()); } } aup.setPreferredCategories(nts); aup.setAutoAddLocations(getAutoAddLocations()); nts = new TreeSet(); ts = getPreferredLocations(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwLocation)((BwLocation)it.next()).clone()); } } aup.setPreferredLocations(nts); aup.setAutoAddSponsors(getAutoAddSponsors()); nts = new TreeSet(); ts = getPreferredSponsors(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwSponsor)((BwSponsor)it.next()).clone()); } } aup.setPreferredSponsors(nts); aup.setAutoAddCalendars(getAutoAddCalendars()); nts = new TreeSet(); ts = getPreferredCalendars(); if (ts != null) { Iterator it = ts.iterator(); while (it.hasNext()) { nts.add((BwCalendar)((BwCalendar)it.next()).shallowClone()); } } aup.setPreferredCalendars(nts); return aup; }
| 1,118,398
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(i))){ i++; } seismos.add(i, seismo); return i; }
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(names.get(i)))){ i++; } seismos.add(i, seismo); return i; }
| 1,118,399
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(i))){ i++; } seismos.add(i, seismo); return i; }
|
public int sort(DataSetSeismogram seismo, String name){ int i = 0; while(i < seismos.size() && seismo.isFurtherThan((DataSetSeismogram)seismos.get(i))){ i++; } seismos.put(name, seismo); names.add(i, seismo); return i; }
| 1,118,400
|
public void draw(UnitRangeImpl r, Graphics2D g2d){ double numDivisions = (r.max_value - r.min_value)/divSize; double pixelsPerLabelTick = getLimitingSize()/numDivisions; double pixelsPerMinorTick = pixelsPerLabelTick/ticksPerDiv; int numLabelTicks = (int)Math.ceil(numDivisions) + 1; //Create tick shapes GeneralPath labelTickShape = new GeneralPath(); GeneralPath minorTickShape = new GeneralPath(); float[] nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { labelTickShape.moveTo(nextLabelPoint[0], nextLabelPoint[1]); labelTickShape.lineTo(nextLabelPoint[0] + labelTickWidth, nextLabelPoint[1] + labelTickHeight); float[] nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextLabelPoint); for (int j = 0; j < ticksPerDiv - 1; j++) { minorTickShape.moveTo(nextMinorPoint[0], nextMinorPoint[1]); minorTickShape.lineTo(nextMinorPoint[0] + tickWidth, nextMinorPoint[1] + tickHeight); nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextMinorPoint); } nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } TitleProvider tp = (TitleProvider)titles.get(0); FontMetrics fm = g2d.getFontMetrics(); Rectangle2D titleBounds = fm.getStringBounds(tp.getTitle(), g2d); if(direction == VERTICAL){ double y = (int)(getSize().height/2 + titleBounds.getWidth()/2); double x; if(side == LEFT)x = titleBounds.getHeight(); else x = getWidth() - titleBounds.getHeight(); g2d.translate(x, y); g2d.rotate(-Math.PI/2); g2d.drawString(tp.getTitle(), 0, 0); g2d.rotate(Math.PI/2); g2d.translate(-x, -y); }else{ int x = (int)(getWidth()/2 - titleBounds.getWidth()/2); int y; if(side == TOP) y = (int)titleBounds.getHeight(); else y = (int)(getHeight() - titleBounds.getHeight()); g2d.drawString(tp.getTitle(), x, y); } //Figure out how much to translate this generic tick shape to match //the actual time double[] translation = getTranslation(r); //Casing the translation to an int removes tick jitter in borders //where the values have changed, but the range hasn't. Since they //move by an integral amount, they move in lockstep. This introduces //inaccuracy in translations that wouldn't naturally be an int. //Be forewarned! g2d.translate((int)translation[0], (int)translation[1]); g2d.setStroke(DisplayUtils.TWO_PIXEL_STROKE); g2d.draw(labelTickShape); g2d.setStroke(DisplayUtils.ONE_PIXEL_STROKE); g2d.draw(minorTickShape); double value = getFirstLabelValue(r); nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { if(displayNegatives || value >= 0){ label(getLabel(value), nextLabelPoint, g2d); } value += divSize; nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } g2d.translate(-(int)translation[0], -(int)translation[1]); }
|
public void draw(UnitRangeImpl r, Graphics2D g2d){ double numDivisions = (r.max_value - r.min_value)/divSize; double pixelsPerLabelTick = getLimitingSize()/numDivisions; double pixelsPerMinorTick = pixelsPerLabelTick/ticksPerDiv; int numLabelTicks = (int)Math.ceil(numDivisions) + 1; //Create tick shapes GeneralPath labelTickShape = new GeneralPath(); GeneralPath minorTickShape = new GeneralPath(); float[] nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { labelTickShape.moveTo(nextLabelPoint[0], nextLabelPoint[1]); labelTickShape.lineTo(nextLabelPoint[0] + labelTickWidth, nextLabelPoint[1] + labelTickHeight); float[] nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextLabelPoint); for (int j = 0; j < ticksPerDiv - 1; j++) { minorTickShape.moveTo(nextMinorPoint[0], nextMinorPoint[1]); minorTickShape.lineTo(nextMinorPoint[0] + tickWidth, nextMinorPoint[1] + tickHeight); nextMinorPoint = getNextPoint((float)pixelsPerMinorTick, nextMinorPoint); } nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } TitleProvider tp = (TitleProvider)titles.get(0); FontMetrics fm = g2d.getFontMetrics(); Rectangle2D titleBounds = fm.getStringBounds(tp.getTitle(), g2d); if(direction == VERTICAL){ double y = (int)(getSize().height/2 + titleBounds.getWidth()/2); double x; if(side == LEFT)x = titleBounds.getHeight(); else x = getWidth() - titleBounds.getHeight(); g2d.translate(x, y); g2d.rotate(-Math.PI/2); g2d.drawString(tp.getTitle(), 0, 0); g2d.rotate(Math.PI/2); g2d.translate(-x, -y); }else{ int x = (int)(getWidth()/2 - titleBounds.getWidth()/2); int y; if(side == TOP) y = (int)titleBounds.getHeight(); else y = (int)(getHeight() - titleBounds.getHeight()); g2d.drawString(tp.getTitle(), x, y); } //Figure out how much to translate this generic tick shape to match //the actual time double[] translation = getTranslation(r); //Casing the translation to an int removes tick jitter in borders //where the values have changed, but the range hasn't. Since they //move by an integral amount, they move in lockstep. This introduces //inaccuracy in translations that wouldn't naturally be an int. //Be forewarned! g2d.translate((int)translation[0], (int)translation[1]); g2d.setStroke(DisplayUtils.TWO_PIXEL_STROKE); g2d.draw(labelTickShape); g2d.setStroke(DisplayUtils.ONE_PIXEL_STROKE); g2d.draw(minorTickShape); double value = getFirstLabelValue(r); nextLabelPoint = getFirstPoint(); for (int i = 0; i < numLabelTicks; i++) { if(displayNegatives || value >= 0){ label(getLabel(value), nextLabelPoint, g2d, translation[1]); } value += divSize; nextLabelPoint = getNextPoint((float)pixelsPerLabelTick, nextLabelPoint); } g2d.translate(-(int)translation[0], -(int)translation[1]); }
| 1,118,401
|
private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } g2d.drawString(label, x, y); }
|
private void label(String label, float[] nextLabelPoint, Graphics2D g2d, double trans) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } g2d.drawString(label, x, y); }
| 1,118,402
|
private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } g2d.drawString(label, x, y); }
|
private void label(String label, float[] nextLabelPoint, Graphics2D g2d) { Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(label, g2d); float x, y; if(direction == VERTICAL){ y = nextLabelPoint[1] + (float)(bounds.getHeight()/(double)4); int xMod = LABEL_TICK_LENGTH + 2; if(side == LEFT) x = nextLabelPoint[0] - xMod - (int)bounds.getWidth(); else x = nextLabelPoint[0] + xMod; }else{//Must be horizontal x = nextLabelPoint[0] - (int)(bounds.getWidth()/2); if(side == TOP) y = nextLabelPoint[1] - LABEL_TICK_LENGTH - 3; else y = LABEL_TICK_LENGTH + (float)bounds.getHeight() - 3; } if(y + trans <= getSize().height && y - bounds.getHeight() + trans >= 0)g2d.drawString(label, x, y); }
| 1,118,403
|
public int currentSegment(float[] coordinates){ int i = 0; if(min){ i = 1; currentIndex--; } min = !min; coordinates[0] = currentIndex; coordinates[1] = points[i][currentIndex]; if(coordinates[0] % 100 == 0){ logger.debug("x: " + coordinates[0] + " y: " + coordinates[1]); } if(at != null){ at.transform(coordinates, 0, coordinates, 0, 1); } if(currentIndex == startIndex){ return SEG_MOVETO; }else{ return SEG_LINETO; } }
|
public int currentSegment(float[] coordinates){ int i = 0; if(min){ i = 1; currentIndex--; } min = !min; coordinates[0] = currentIndex; coordinates[1] = points[i][currentIndex]; if(coordinates[0] % 100 == 0){ logger.debug("x: " + coordinates[0] + " y: " + coordinates[1]); } if(at != null){ at.transform(coordinates, 0, coordinates, 0, 1); } if(currentIndex == startIndex){ return SEG_MOVETO; }else{ return SEG_LINETO; } }
| 1,118,405
|
public int getWindingRule(){ logger.debug("calling getWindingRule"); return WIND_NON_ZERO; }
|
public int getWindingRule(){ return WIND_NON_ZERO; }
| 1,118,406
|
public boolean isDone(){ if(currentIndex % 200 == 0){ logger.debug("calling isDone"); } if(currentIndex == endIndex){ return true; } return false; }
|
public boolean isDone(){ if(currentIndex % 200 == 0){ logger.debug("calling isDone"); } if(currentIndex == endIndex){ return true; } return false; }
| 1,118,407
|
public void next(){ if(currentIndex % 200 == 0){ logger.debug("calling next()"); } currentIndex++; }
|
public void next(){ if(currentIndex % 200 == 0){ logger.debug("calling next()"); } currentIndex++; }
| 1,118,409
|
public void setDrawnPixels(int[] drawnPixels){ this.drawnPixels = drawnPixels; startIndex = drawnPixels[0]; endIndex = drawnPixels[1]; currentIndex = startIndex; logger.debug("Iterator drawing on " + startIndex + ", " + endIndex); }
|
public void setDrawnPixels(int[] drawnPixels){ this.drawnPixels = drawnPixels; startIndex = drawnPixels[0]; endIndex = drawnPixels[1]; currentIndex = startIndex; logger.debug("Iterator drawing on " + startIndex + ", " + endIndex); }
| 1,118,410
|
public EventFormatter(CalSvcI svci, EventInfo eventInfo, TimeView view, CalendarInfo calInfo, CalTimezones ctz) { this.eventInfo = eventInfo; this.calInfo = calInfo; this.ctz= ctz; this.svci = svci; }
|
public EventFormatter(CalSvcI svci, EventInfo eventInfo, TimeView view, CalendarInfo calInfo, CalTimezones ctz) { this.eventInfo = eventInfo; this.calInfo = calInfo; this.ctz= ctz; }
| 1,118,411
|
public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; setDate(date, ctz); }
|
public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; setDate(date, ctz); }
| 1,118,412
|
public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; setDate(date, ctz); }
|
public DateTimeFormatter(CalendarInfo calInfo, BwDateTime date, CalTimezones ctz) throws CalFacadeException { this.calInfo = calInfo; }
| 1,118,413
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationLiteralEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
|
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } }
| 1,118,414
|
public void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW AZIMUTH"); if(!particleMotion.isHorizontalPlane()) return; Shape sector = getSectorShape(); graphics2D.setColor(Color.blue); graphics2D.fill(sector); graphics2D.draw(sector); graphics2D.setStroke(new BasicStroke(2.0f)); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); graphics2D.setStroke(new BasicStroke(1.0f)); }
|
public synchronized void drawAzimuth(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW AZIMUTH"); if(!particleMotion.isHorizontalPlane()) return; Shape sector = getSectorShape(); graphics2D.setColor(Color.blue); graphics2D.fill(sector); graphics2D.draw(sector); graphics2D.setStroke(new BasicStroke(2.0f)); graphics2D.setColor(Color.green); Shape azimuth = getAzimuthPath(); graphics2D.draw(azimuth); graphics2D.setStroke(new BasicStroke(1.0f)); }
| 1,118,416
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW LABELS"); Color color = new Color(0, 0, 0, 128); graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public synchronized void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW LABELS"); Color color = new Color(0, 0, 0, 128); graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,417
|
public void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); ((Graphics2D)g).draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Graphics2D graphics2D = (Graphics2D) g; Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.timeRegistrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
|
public synchronized void drawParticleMotion(ParticleMotion particleMotion, Graphics g) { if(!recalculateValues) { recalculateValues = false; System.out.println(" DRAWING THE PARTICLE MOTION WITHOUT RECALCULATING THE VALUES"); ((Graphics2D)g).draw(particleMotion.getShape()); return; } logger.debug("IN DRAW PARTICLE MOTION"); Graphics2D graphics2D = (Graphics2D) g; Dimension dimension = super.getSize(); LocalSeismogramImpl hseis = particleMotion.hseis.getSeismogram(); LocalSeismogramImpl vseis = particleMotion.vseis.getSeismogram(); AmpConfigRegistrar vAmpConfigRegistrar = particleMotion.vAmpConfigRegistrar; AmpConfigRegistrar hAmpConfigRegistrar = particleMotion.hAmpConfigRegistrar; Color color = particleMotion.getColor(); if(color == null) { color = COLORS[RGBCOLOR]; particleMotion.setColor(color); RGBCOLOR++; if(RGBCOLOR == COLORS.length) RGBCOLOR = 0; } drawLabels(particleMotion, graphics2D); graphics2D.setColor(color); Insets insets = getInsets(); Dimension flipDimension = new Dimension(dimension.height, dimension.width); try { System.out.println("In PaintSeismogram hmax = "+hunitRangeImpl.getMaxValue()+ " hmin = "+hunitRangeImpl.getMinValue()); System.out.println("In PaintSeismogram vmax = "+vunitRangeImpl.getMaxValue()+ " vmin = "+vunitRangeImpl.getMinValue()); MicroSecondTimeRange microSecondTimeRange = null; if(particleMotion.timeRegistrar == null) { microSecondTimeRange = new MicroSecondTimeRange(new MicroSecondDate(hseis.getBeginTime()), new MicroSecondDate(hseis.getEndTime())); //System.out.println("beginTime = "+hseis.getBeginTime()); //System.out.println("endTime = "+hseis.getEndTime()); } else { microSecondTimeRange = particleMotion.getTimeRange(); } System.out.println("*************** Beofore getting PlottableSimple"); Date utilStartTime = Calendar.getInstance().getTime(); int[][] hPixels = SimplePlotUtil.getPlottableSimple(hseis, hunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension);*/ /*SimplePlotUtil.compressYvalues(hseis, microSecondTimeRange, hunitRangeImpl, dimension); SimplePlotUtil.scaleYvalues(hPixels, hseis, microSecondTimeRange, hunitRangeImpl, dimension); */ int[][] vPixels = SimplePlotUtil.getPlottableSimple(vseis, vunitRangeImpl, microSecondTimeRange, dimension); /*SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension);*/ SimplePlotUtil.flipArray(vPixels[1], dimension.height); Date utilEndTime = Calendar.getInstance().getTime(); System.out.println("The UTIL TIME is ******* "+ (utilEndTime.getTime() - utilStartTime.getTime())); /* SimplePlotUtil.compressYvalues(vseis, microSecondTimeRange, vunitRangeImpl, dimension); System.out.println("---------------------->Scaling THE Y VALUES "); SimplePlotUtil.scaleYvalues(vPixels, vseis, microSecondTimeRange, vunitRangeImpl, dimension); SimplePlotUtil.flipArray(vPixels[1], dimension.height); */ int len = vPixels[1].length; int[] x, y; x = new int[hPixels[1].length]; y = new int[vPixels[1].length]; x = hPixels[1]; y = vPixels[1]; if (hPixels[1].length < len) { len = hPixels.length; } Date drawStartTime = Calendar.getInstance().getTime(); Shape shape = getParticleMotionPath(hPixels[1], vPixels[1]); Date drawEndTime = Calendar.getInstance().getTime(); System.out.println("The PATH TIME is *********** "+(drawEndTime.getTime() - drawStartTime.getTime())); particleMotion.setShape(shape); System.out.println("After setting the shape"); if(shape == null) System.out.println("The shape is null"); graphics2D.draw(shape); System.out.println("The shape is drawn"); } catch(Exception e) { e.printStackTrace(); } }
| 1,118,418
|
public boolean findPoint(int count, int newx, int newy) { boolean rtn = false; int size = displays.size(); for(int counter = 0; counter < size; counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); Shape shape = particleMotion.getShape(); //for(int i = -4; i < 4; i++) { // for(int j = -4; j < 4; j++) { if(shape.contains(newx, newy)){ particleMotion.setSelected(true);rtn = true; // particleMotionDisplay.updateAmpScale(particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis)); } // } //} } //logger.debug("The return value is "+rtn); if(rtn == true) {repaint();} return rtn; }
|
public synchronized boolean findPoint(int count, int newx, int newy) { boolean rtn = false; int size = displays.size(); for(int counter = 0; counter < size; counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); Shape shape = particleMotion.getShape(); //for(int i = -4; i < 4; i++) { // for(int j = -4; j < 4; j++) { if(shape.contains(newx, newy)){ particleMotion.setSelected(true);rtn = true; // particleMotionDisplay.updateAmpScale(particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis)); } // } //} } //logger.debug("The return value is "+rtn); if(rtn == true) {repaint();} return rtn; }
| 1,118,419
|
public Shape getParticleMotionPath(int[] x, int[] y) { int len = x.length; if(y.length < len) { len = y.length;} GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD); if(len != 0) { generalPath.moveTo(x[0], y[0]); } for(int counter = 1; counter < len; counter++) { generalPath.lineTo(x[counter], y[counter]); } /*for(int counter = 0; counter < len; counter++) { generalPath.append(new Rectangle2D.Float(x[counter]-2, y[counter]-2, 4, 4), false); }*/ System.out.println("Before returning from the getParticleMotionPath"); return (Shape)generalPath; }
|
public synchronized Shape getParticleMotionPath(int[] x, int[] y) { int len = x.length; if(y.length < len) { len = y.length;} GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD); if(len != 0) { generalPath.moveTo(x[0], y[0]); } for(int counter = 1; counter < len; counter++) { generalPath.lineTo(x[counter], y[counter]); } /*for(int counter = 0; counter < len; counter++) { generalPath.append(new Rectangle2D.Float(x[counter]-2, y[counter]-2, 4, 4), false); }*/ System.out.println("Before returning from the getParticleMotionPath"); return (Shape)generalPath; }
| 1,118,421
|
public Shape getSectorShape() { ParticleMotion particleMotion = (ParticleMotion)displays.get(0); AmpConfigRegistrar ampRangeConfig = particleMotion.vAmpConfigRegistrar; UnitRangeImpl unitRangeImpl = vunitRangeImpl;//ampRangeConfig.getAmpRange(particleMotion.vseis); double vmin = unitRangeImpl.getMinValue(); double vmax = unitRangeImpl.getMaxValue(); unitRangeImpl = hunitRangeImpl;//particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis); double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); Insets insets = getInsets(); double fmin = super.getSize().getWidth() - insets.left - insets.right; double fmax = super.getSize().getHeight() - insets.top - insets.bottom; int originx = (int)(fmin/2);//(int)((hmax - hmin) /4); int originy = (int)(fmax/2);//((vmax - vmin) /4); int newx = originx; //(int)(((originx-hmin) * fmin)/ (hmax - hmin));//(int)((max * fmin)/ (max - min)); int newy = originy; //(int)(fmax - (int)(((originy-vmin)*fmax)/(vmax - vmin))); GeneralPath generalPath = new GeneralPath(); int size = sectors.size(); for(int counter = 0; counter < size; counter++) { Point2D.Double point = (Point2D.Double)sectors.get(counter); double degreeone = point.getX(); double degreetwo = point.getY(); int xone = (int)(fmin * Math.cos(Math.toRadians(degreeone))); int yone = (int)(fmax * Math.sin(Math.toRadians(degreeone))); generalPath.moveTo(newx+xone, newy-yone); generalPath.lineTo(newx-xone, newy+yone); int xtwo = (int)(fmin * Math.cos(Math.toRadians(degreetwo))); int ytwo = (int)(fmax * Math.sin(Math.toRadians(degreetwo))); generalPath.lineTo(newx-xtwo, newy+ytwo); generalPath.lineTo(newx+xtwo, newy-ytwo); generalPath.lineTo(newx+xone, newy-yone); } return (Shape)generalPath; }//
|
public synchronized Shape getSectorShape() { ParticleMotion particleMotion = (ParticleMotion)displays.get(0); AmpConfigRegistrar ampRangeConfig = particleMotion.vAmpConfigRegistrar; UnitRangeImpl unitRangeImpl = vunitRangeImpl;//ampRangeConfig.getAmpRange(particleMotion.vseis); double vmin = unitRangeImpl.getMinValue(); double vmax = unitRangeImpl.getMaxValue(); unitRangeImpl = hunitRangeImpl;//particleMotion.hAmpConfigRegistrar.getAmpRange(particleMotion.hseis); double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); Insets insets = getInsets(); double fmin = super.getSize().getWidth() - insets.left - insets.right; double fmax = super.getSize().getHeight() - insets.top - insets.bottom; int originx = (int)(fmin/2);//(int)((hmax - hmin) /4); int originy = (int)(fmax/2);//((vmax - vmin) /4); int newx = originx; //(int)(((originx-hmin) * fmin)/ (hmax - hmin));//(int)((max * fmin)/ (max - min)); int newy = originy; //(int)(fmax - (int)(((originy-vmin)*fmax)/(vmax - vmin))); GeneralPath generalPath = new GeneralPath(); int size = sectors.size(); for(int counter = 0; counter < size; counter++) { Point2D.Double point = (Point2D.Double)sectors.get(counter); double degreeone = point.getX(); double degreetwo = point.getY(); int xone = (int)(fmin * Math.cos(Math.toRadians(degreeone))); int yone = (int)(fmax * Math.sin(Math.toRadians(degreeone))); generalPath.moveTo(newx+xone, newy-yone); generalPath.lineTo(newx-xone, newy+yone); int xtwo = (int)(fmin * Math.cos(Math.toRadians(degreetwo))); int ytwo = (int)(fmax * Math.sin(Math.toRadians(degreetwo))); generalPath.lineTo(newx-xtwo, newy+ytwo); generalPath.lineTo(newx+xtwo, newy-ytwo); generalPath.lineTo(newx+xone, newy-yone); } return (Shape)generalPath; }//
| 1,118,422
|
public void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); }
|
public synchronized void paintComponent(Graphics g) { // if(setSelected == 1) g.setColor(Color.red); //else if(setSelected == 2) g.setColor(getBackground()); Graphics2D graphics2D = (Graphics2D)g; logger.debug("IN PAINT COMPONENT"); if(startPoint != null && endPoint != null) { graphics2D.setColor(Color.yellow); //logger.debug("Start Point "+startPoint.getX()+" "+startPoint.getY()); //logger.debug("End Point "+endPoint.getX()+" "+endPoint.getY()); java.awt.geom.Rectangle2D.Double rect = new java.awt.geom.Rectangle2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX() - startPoint.getX(), endPoint.getY() - startPoint.getY()); graphics2D.fill(rect); graphics2D.draw(rect); } int size = displays.size(); //first draw the azimuth if one of the display is horizontal plane for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); if(!displayKeys.contains(particleMotion.key)) continue; drawAzimuth(particleMotion, graphics2D); } Date startTime = Calendar.getInstance().getTime(); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; if(particleMotion.isSelected()) continue; drawParticleMotion(particleMotion, graphics2D); }//end of for System.out.println("ENd of the for"); for(int counter = 0; counter < displays.size(); counter++) { ParticleMotion particleMotion = (ParticleMotion)displays.get(counter); //if(!getDisplayKey().equals(particleMotion.key)) continue; if(!displayKeys.contains(particleMotion.key)) continue; //drawAzimuth(particleMotion, graphics2D); if(particleMotion.isSelected()) { particleMotion.setSelected(false); drawParticleMotion(particleMotion, g); } } Date endTime = Calendar.getInstance().getTime(); System.out.println("THE TIME TAKEN IS ********** "+ (endTime.getTime() - startTime.getTime())); }
| 1,118,423
|
public void resize() { setSize(super.getSize()); //particleMotionDisplay.resize(); recalculateValues = true; repaint(); }
|
public synchronized void resize() { setSize(super.getSize()); //particleMotionDisplay.resize(); recalculateValues = true; repaint(); }
| 1,118,424
|
public void updateTimeRange() { hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); }
|
public synchronized void updateTimeRange() { hunitRangeImpl = new UnitRangeImpl(getMinHorizontalAmplitude(), getMaxHorizontalAmplitude(), UnitImpl.COUNT); vunitRangeImpl = new UnitRangeImpl(getMinVerticalAmplitude(), getMaxVerticalAmplitude(), UnitImpl.COUNT); particleMotionDisplay.updateHorizontalAmpScale(hunitRangeImpl); particleMotionDisplay.updateVerticalAmpScale(vunitRangeImpl); }
| 1,118,425
|
public void zoomInParticleMotionDisplay(int clickCount, int mx, int my) { double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); double vmin = vunitRangeImpl.getMinValue(); double vmax = vunitRangeImpl.getMaxValue(); if(hmin > hmax) { double temp = hmax; hmax = hmin; hmin = temp;} if(vmin > vmax) { double temp = vmax; vmax = vmin; vmin = temp;} Insets insets = getInsets(); double width = super.getSize().getWidth() - insets.left - insets.right; double height = super.getSize().getHeight() - insets.top - insets.bottom; int centerx, centery; if(clickCount == 1) { centerx = (int)((hmax - hmin) / 4); centery = (int)((vmax - vmin) / 4); } else { centerx = (int)((hmax - hmin) / 4); centery = (int)((hmax - hmin) / 4); } int xone = (int)(((hmax - hmin)/width * mx) + hmin); int yone = (int)(((vmin - vmax)/height * my) + vmax); logger.debug("----------------------------------------------------------"); logger.debug("clickCount = "+clickCount); logger.debug(" hmin = "+hmin+" hmax = "+hmax); logger.debug(" vmin = "+vmin+" vmax = "+vmax); logger.debug(" xone = "+xone+" yone = "+yone); logger.debug(" bcenterx = "+centerx+" bcentery = "+centery); if(clickCount == 1) { if(xone < 0) centerx = -centerx; if(yone < 0) centery = -centery; } else { //if(hmin < 0 ) centerx = -centerx; // if(vmin < 0) centery = -centery; } int xa, xs, ya, ys; if(clickCount == 1) { xa = xone - centerx; xs = xone + centerx; ya = yone - centery; ys = yone + centery; } else { if(centerx < 0) centerx = -centerx; if(centery < 0) centery = -centery; xa = (int)hmin - centerx; xs = (int)hmax + centerx; ya = (int)vmin - centery; ys = (int)vmax + centery; if((xs - xa) < 50){ xs = xs + 50; xa = xa - 50;} if((ys - ya) < 50) { ys = ys + 50; ya = ya - 50;} } if(xa > xs) { int temp = xs; xs = xa; xa = temp;} if(ya > ys) {int temp = ys; ys = ya; ya = temp;} logger.debug(" acenterx = "+centerx+" acentery = "+centery); logger.debug(" xa = "+xa+" xs = "+xs); logger.debug(" ya = "+ya+" ys = "+ys); //int xtwo = (int)(((hmax - hmin)/width * endPoint.getX()) - hmax); //int ytwo = (int)(((vmin - vmax)/height * endPoint.getY()) + vmax); startPoint = null; endPoint = null; if(xa < xs && ya < ys || clickCount != 1) { System.out.println("The Zooming takes place"); particleMotionDisplay.updateHorizontalAmpScale(new UnitRangeImpl(xa, xs, UnitImpl.COUNT)); particleMotionDisplay.updateVerticalAmpScale(new UnitRangeImpl(ya, ys, UnitImpl.COUNT)); vunitRangeImpl = new UnitRangeImpl(ya, ys, UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(xa, xs, UnitImpl.COUNT); particleMotionDisplay.fireAmpRangeEvent(new AmpSyncEvent(ya, ys, true)); } else System.out.println("NO ZOOMING"); }
|
public synchronized void zoomInParticleMotionDisplay(int clickCount, int mx, int my) { double hmin = hunitRangeImpl.getMinValue(); double hmax = hunitRangeImpl.getMaxValue(); double vmin = vunitRangeImpl.getMinValue(); double vmax = vunitRangeImpl.getMaxValue(); if(hmin > hmax) { double temp = hmax; hmax = hmin; hmin = temp;} if(vmin > vmax) { double temp = vmax; vmax = vmin; vmin = temp;} Insets insets = getInsets(); double width = super.getSize().getWidth() - insets.left - insets.right; double height = super.getSize().getHeight() - insets.top - insets.bottom; int centerx, centery; if(clickCount == 1) { centerx = (int)((hmax - hmin) / 4); centery = (int)((vmax - vmin) / 4); } else { centerx = (int)((hmax - hmin) / 4); centery = (int)((hmax - hmin) / 4); } int xone = (int)(((hmax - hmin)/width * mx) + hmin); int yone = (int)(((vmin - vmax)/height * my) + vmax); logger.debug("----------------------------------------------------------"); logger.debug("clickCount = "+clickCount); logger.debug(" hmin = "+hmin+" hmax = "+hmax); logger.debug(" vmin = "+vmin+" vmax = "+vmax); logger.debug(" xone = "+xone+" yone = "+yone); logger.debug(" bcenterx = "+centerx+" bcentery = "+centery); if(clickCount == 1) { if(xone < 0) centerx = -centerx; if(yone < 0) centery = -centery; } else { //if(hmin < 0 ) centerx = -centerx; // if(vmin < 0) centery = -centery; } int xa, xs, ya, ys; if(clickCount == 1) { xa = xone - centerx; xs = xone + centerx; ya = yone - centery; ys = yone + centery; } else { if(centerx < 0) centerx = -centerx; if(centery < 0) centery = -centery; xa = (int)hmin - centerx; xs = (int)hmax + centerx; ya = (int)vmin - centery; ys = (int)vmax + centery; if((xs - xa) < 50){ xs = xs + 50; xa = xa - 50;} if((ys - ya) < 50) { ys = ys + 50; ya = ya - 50;} } if(xa > xs) { int temp = xs; xs = xa; xa = temp;} if(ya > ys) {int temp = ys; ys = ya; ya = temp;} logger.debug(" acenterx = "+centerx+" acentery = "+centery); logger.debug(" xa = "+xa+" xs = "+xs); logger.debug(" ya = "+ya+" ys = "+ys); //int xtwo = (int)(((hmax - hmin)/width * endPoint.getX()) - hmax); //int ytwo = (int)(((vmin - vmax)/height * endPoint.getY()) + vmax); startPoint = null; endPoint = null; if(xa < xs && ya < ys || clickCount != 1) { System.out.println("The Zooming takes place"); particleMotionDisplay.updateHorizontalAmpScale(new UnitRangeImpl(xa, xs, UnitImpl.COUNT)); particleMotionDisplay.updateVerticalAmpScale(new UnitRangeImpl(ya, ys, UnitImpl.COUNT)); vunitRangeImpl = new UnitRangeImpl(ya, ys, UnitImpl.COUNT); hunitRangeImpl = new UnitRangeImpl(xa, xs, UnitImpl.COUNT); particleMotionDisplay.fireAmpRangeEvent(new AmpSyncEvent(ya, ys, true)); } else System.out.println("NO ZOOMING"); }
| 1,118,426
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = getReqPar(request, "name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
| 1,118,428
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "notAdded"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
| 1,118,429
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = request.getParameter("makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } boolean makeDefaultView = false; String str = getReqPar(request, "makedefaultview"); if (str != null) { makeDefaultView = str.equals("y"); } BwView view = new BwView(); view.setName(name); if (!svc.addView(view, makeDefaultView)) { form.getErr().emit("org.bedework.client.error.viewnotadded"); return "notAdded"; } form.setView(view); form.setSubscriptions(svc.getSubscriptions()); return "success"; }
| 1,118,430
|
public void addSeismogram(DataSetSeismogram newSeismogram){ seismos.add(newSeismogram); SeismogramPlotter newPlotter; if (autoColor) { newPlotter = new SeismogramPlotter(newSeismogram, seisColors[seisCount%seisColors.length]); }else { newPlotter = new SeismogramPlotter(newSeismogram, Color.blue); } // end of else if(parent != null) newPlotter.setVisibility(parent.getOriginalVisibility()); plotters.add(seisCount, newPlotter); seisCount++; Iterator e = globalFilters.iterator(); while(e.hasNext()){ applyFilter((ColoredFilter)e.next()); } timeRegistrar.addSeismogram(newSeismogram); ampRegistrar.addSeismogram(newSeismogram); redo = true; }
|
public void addSeismogram(DataSetSeismogram newSeismogram){ seismos.add(newSeismogram); SeismogramPlotter newPlotter; if (autoColor) { newPlotter = new SeismogramPlotter(newSeismogram, seisColors[seisCount%seisColors.length]); }else { newPlotter = new SeismogramPlotter(newSeismogram, Color.blue); } // end of else if(parent != null) newPlotter.setVisibility(parent.getOriginalVisibility()); plotters.add(seisCount, newPlotter); seisCount++; Iterator e = globalFilters.iterator(); while(e.hasNext()){ applyFilter((ColoredFilter)e.next()); } timeRegistrar.addSeismogram(newSeismogram); ampRegistrar.addSeismogram(newSeismogram); redo = true; }
| 1,118,431
|
public SeismogramBackgroundLoader(SeismogramBackgroundLoaderPool pool) { this.pool = pool; Runnable r = new Runnable() { public void run() { try { runWork(); } catch (Exception e) { e.printStackTrace(); } } }; privateThread = new Thread(r); privateThread.start(); }
|
public SeismogramBackgroundLoader(SeismogramBackgroundLoaderPool pool) { this.pool = pool; Runnable r = new Runnable() { public void run() { try { runWork(); } catch (Exception e) { e.printStackTrace(); } } }; privateThread = new Thread(seisLoaderThreadGroup, r, "Seismogram Loader"+getThreadNum()); privateThread.start(); }
| 1,118,432
|
protected static void scaleYvalues(int[][] comp, LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size) { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); System.out.println("yMin = "+yMin+ " yMax = "+yMax+" height = "+size.height); for( int i =0 ; i < comp[1].length; i++) { //System.out.println(" before "+comp[1][i]); comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); // System.out.println(" after "+comp[1][i]); } // flipArray(comp[1], size.height); }
|
protected static void scaleYvalues(int[][] comp, LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size) { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); for( int i =0 ; i < comp[1].length; i++) { //System.out.println(" before "+comp[1][i]); comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); // System.out.println(" after "+comp[1][i]); } // flipArray(comp[1], size.height); }
| 1,118,433
|
public static LocalSeismogramImpl createSpike() { return createSpike(new MicroSecondDate()); }
|
public static LocalSeismogramImpl createSpike() { return createSpike(ClockUtil.now()); }
| 1,118,434
|
public ATObject setValue(ATObject newValue) throws NATException { ATObject result = getValue(); frame_.meta_assignField(name_, newValue); return result; }
|
public ATObject setValue(ATObject newValue) throws NATException { ATObject result = getFieldValue(); frame_.meta_assignField(name_, newValue); return result; }
| 1,118,435
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,437
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,438
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,439
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,440
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,441
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
|
public void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { Color color = particleMotion.getColor(); if(color == null) color = COLORS[0]; graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 10; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); int x = (dimension.width - font.getSize() * 3) / 2; int y = dimension.height - 4; graphics2D.drawString(particleMotion.key.substring(0, 3), x, y); x = font.getSize(); y = (dimension.height) / 2; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance((Math.PI/2)*3)); graphics2D.drawString(particleMotion.key.substring(4, particleMotion.key.length()), 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); }
| 1,118,442
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeView(view); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.error.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeView(view); return "success"; }
| 1,118,443
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.notfound", name); return "notFound"; } svc.removeView(view); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String name = request.getParameter("name"); if (name == null) { form.getErr().emit("org.bedework.client.missingfield", "name"); return "error"; } BwView view = svc.findView(name); if (view == null) { form.getErr().emit("org.bedework.client.error.viewnotfound", name); return "notFound"; } svc.removeView(view); return "success"; }
| 1,118,444
|
public void itemStateChanged(ItemEvent ae) { if(ae.getStateChange() == ItemEvent.SELECTED) { view.addDisplayKey(((AbstractButton)ae.getItem()).getText()); setHorizontalTitle(view.getSelectedParticleMotion()[0].hseis.getSeismogram().getName()); setVerticalTitle(view.getSelectedParticleMotion()[0].vseis.getSeismogram().getName()); view.updateTime(); } else if(ae.getStateChange() == ItemEvent.DESELECTED){ System.out.println("The radiobutton UN SELECTED is "+ ((AbstractButton)ae.getItem()).getText()); view.removeDisplaykey(((AbstractButton)ae.getItem()).getText()); } //view.setDisplayKey(ae.getActionCommand()); repaint(); }
|
public void itemStateChanged(ItemEvent ae) { if(ae.getStateChange() == ItemEvent.SELECTED) { view.addDisplayKey(((AbstractButton)ae.getItem()).getText()); setHorizontalTitle(view.getSelectedParticleMotion()[0].hseis.getSeismogram().getName()); setVerticalTitle(view.getSelectedParticleMotion()[0].vseis.getSeismogram().getName()); view.updateTime(); } else if(ae.getStateChange() == ItemEvent.DESELECTED){ System.out.println("The radiobutton UN SELECTED is "+ ((AbstractButton)ae.getItem()).getText()); view.removeDisplaykey(((AbstractButton)ae.getItem()).getText()); } //view.setDisplayKey(ae.getActionCommand()); repaint(); }
| 1,118,445
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,446
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,447
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,448
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,449
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,450
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = request.getParameter("skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); BwPreferences prefs; String str = request.getParameter("user"); if (str != null) { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs = svc.getUserPrefs(user); } else { prefs = svc.getUserPrefs(); } str = request.getParameter("view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = request.getParameter("viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = request.getParameter("skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); return "success"; }
| 1,118,451
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
| 1,118,452
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
| 1,118,453
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
|
public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } }
| 1,118,454
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.