bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public static void close(String psFilename, String projection, String region) throws InterruptedException, IOException { String command = "psxy /dev/null -V -J" + projection + " -R" + region + " -O"; GenericCommandExecute.execute(command); }
public static void close(String psFilename, String projection, String region) throws InterruptedException, IOException { String command = "psxy /dev/null -V -J" + projection + " -R" + region + " -O"; FileOutputStream fos = new FileOutputStream(psFilename, true); try { GenericCommandExecute.execute(command, new StringReader(""), fos, System.err); } finally { fos.close(); } }
1,117,082
public static void main(String[] args) { try { double[][] points = { {-180, 90}, {-135, 67.5}, {-90, 45}, {-45, 22.5}, {0, 0}}; addPoints("/Volumes/heff/oliverpa/gmtTest/world.ps", "Kf166/10i", "-14/346/-90/90", "t0.4", "0/0/255", "5/255", points); double[][] morePoints = { {45, -22.5, 0.7}, {90, -45, 0.5}, {135, -67.5, 0.4}, {180, -90, 1.0}}; addPoints("/Volumes/heff/oliverpa/gmtTest/world.ps", "Kf166/10i", "-14/346/-90/90", "ci", null, "12/255/0/0", morePoints); } catch(Exception e) { e.printStackTrace(); } } //private static Logger logger = Logger.getLogger(PSXYExecute.class);
public static void main(String[] args) { try { double[][] points = { {-180, 90}, {-135, 67.5}, {-90, 45}, {-45, 22.5}, {0, 0}}; addPoints("world.ps", "Kf166/10i", "-14/346/-90/90", "t0.4", "0/0/255", "5/255", points); double[][] morePoints = { {45, -22.5, 0.7}, {90, -45, 0.5}, {135, -67.5, 0.4}, {180, -90, 1.0}}; addPoints("world.ps", "Kf166/10i", "-14/346/-90/90", "ci", null, "12/255/0/0", morePoints); } catch(Exception e) { e.printStackTrace(); } } //private static Logger logger = Logger.getLogger(PSXYExecute.class);
1,117,083
public static int execute(String command, Reader stdin, OutputStream stdout, OutputStream stderr) throws InterruptedException, IOException { Runtime rt = Runtime.getRuntime(); System.out.println("executing command: " + command); Process proc = rt.exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdout)); BufferedWriter inWriter = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); BufferedReader errReader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); BufferedWriter errWriter = new BufferedWriter(new OutputStreamWriter(stderr)); StreamPump pump = new StreamPump(reader, writer, false); pump.setName("stdout"); StreamPump errPump = new StreamPump(errReader, errWriter, false); errPump.setName("stderr"); StreamPump stdInPump = new StreamPump(new BufferedReader(stdin), inWriter, true); stdInPump.setName("stdin"); pump.start(); stdInPump.start(); errPump.start(); int exitVal = proc.waitFor(); //waiting for finish of StreamPump runs synchronized(pump) {} synchronized(stdInPump) {} synchronized(errPump) {} System.out.println("command returned exit value " + exitVal); if(!pump.hasCompleted() || !errPump.hasCompleted()) { throw new IllegalStateException("Pumps must complete"); } return exitVal; }
public static int execute(String command, Reader stdin, OutputStream stdout, OutputStream stderr) throws InterruptedException, IOException { Runtime rt = Runtime.getRuntime(); System.out.println("executing command: " + command); Process proc = rt.exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdout)); BufferedWriter inWriter = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); BufferedReader errReader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); BufferedWriter errWriter = new BufferedWriter(new OutputStreamWriter(stderr)); StreamPump pump = new StreamPump(reader, writer, false); pump.setName("stdout"); StreamPump errPump = new StreamPump(errReader, errWriter, false); errPump.setName("stderr"); StreamPump stdInPump = new StreamPump(new BufferedReader(stdin), inWriter, true); stdInPump.setName("stdin"); pump.start(); stdInPump.start(); errPump.start(); int exitVal = proc.waitFor(); //waiting for finish of StreamPump runs synchronized(pump) {} synchronized(stdInPump) {} synchronized(errPump) {} System.out.println("command returned exit value " + exitVal); if(!pump.hasCompleted() || !errPump.hasCompleted()) { throw new IllegalStateException("Pumps must complete"); } return exitVal; }
1,117,085
public static int execute(String command, Reader stdin, OutputStream stdout, OutputStream stderr) throws InterruptedException, IOException { Runtime rt = Runtime.getRuntime(); System.out.println("executing command: " + command); Process proc = rt.exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdout)); BufferedWriter inWriter = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); BufferedReader errReader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); BufferedWriter errWriter = new BufferedWriter(new OutputStreamWriter(stderr)); StreamPump pump = new StreamPump(reader, writer, false); pump.setName("stdout"); StreamPump errPump = new StreamPump(errReader, errWriter, false); errPump.setName("stderr"); StreamPump stdInPump = new StreamPump(new BufferedReader(stdin), inWriter, true); stdInPump.setName("stdin"); pump.start(); stdInPump.start(); errPump.start(); int exitVal = proc.waitFor(); //waiting for finish of StreamPump runs synchronized(pump) {} synchronized(stdInPump) {} synchronized(errPump) {} System.out.println("command returned exit value " + exitVal); if(!pump.hasCompleted() || !errPump.hasCompleted()) { throw new IllegalStateException("Pumps must complete"); } return exitVal; }
public static int execute(String command, Reader stdin, OutputStream stdout, OutputStream stderr) throws InterruptedException, IOException { Runtime rt = Runtime.getRuntime(); System.out.println("executing command: " + command); Process proc = rt.exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdout)); BufferedWriter inWriter = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); BufferedReader errReader = new BufferedReader(new InputStreamReader(proc.getErrorStream())); BufferedWriter errWriter = new BufferedWriter(new OutputStreamWriter(stderr)); StreamPump pump = new StreamPump(reader, writer, false); pump.setName("stdout"); StreamPump errPump = new StreamPump(errReader, errWriter, false); errPump.setName("stderr"); StreamPump stdInPump = new StreamPump(new BufferedReader(stdin), inWriter, true); stdInPump.setName("stdin"); pump.start(); stdInPump.start(); errPump.start(); int exitVal = proc.waitFor(); //waiting for finish of StreamPump runs synchronized(pump) {} synchronized(stdInPump) {} synchronized(errPump) {} System.out.println("command returned exit value " + exitVal); if(!pump.hasCompleted() || !errPump.hasCompleted()) { throw new IllegalStateException("Pumps must complete"); } return exitVal; }
1,117,086
public JDBCQuantity(Connection conn) throws SQLException{ this(new JDBCUnit(conn), conn); }
public JDBCQuantity(Connection conn) throws SQLException{ this(new JDBCUnit(conn), conn); }
1,117,087
public void setMode(int mode) { if (mode <= Main.MODE_IN_LOBBY) { gameBoardData.init(); scoreSheetCaptionData.init(); scoreSheetHoteltypeData.init(); Main.getMainFrame().scoreSheet.resetUsedRowsHack(); } if (mode < Main.MODE_IN_LOBBY) { userListPresenter.init(); } }
public void setMode(int mode) { if (mode <= Main.MODE_IN_LOBBY) { gameBoardData.init(); scoreSheetCaptionData.init(); scoreSheetHoteltypeData.init(); } if (mode < Main.MODE_IN_LOBBY) { userListPresenter.init(); } }
1,117,089
void drawString(Graphics2D graphics2d, String string, Point p, int alignment, double orientation, boolean editing, IdeaMap map) { double orient = orientation % Math.PI; if (orient > (Math.PI / 2.0)) { orient -= Math.PI; } if (orient < (-Math.PI / 2.0)) { orient += Math.PI; } int xc = p.x; int yc = p.y; AffineTransform transform = graphics2d.getTransform(); transform(graphics2d, orient, xc, yc); FontMetrics fm = graphics2d.getFontMetrics(); double realTextWidth = fm.stringWidth(string); double realTextHeight = fm.getHeight() - fm.getDescent(); int offsetX = (int) (realTextWidth * (double) (alignment % 3) / 2.0); int offsetY = (int) (-realTextHeight * (double) (alignment / 3) / 2.0); if (!editing) { if ((graphics2d != null) && (string != null)) { graphics2d.drawString(string, xc - offsetX, yc - offsetY); } } else { Graphics2D g2d = (Graphics2D)graphics2d.create(xc - offsetX - 5, yc + offsetY - 5, (int) realTextWidth + 10, (int) realTextHeight + 10); map.getTextField().paint(g2d); g2d.dispose(); } graphics2d.setTransform(transform); }
void drawString(Graphics2D graphics2d, String string, Point p, int alignment, double orientation, boolean editing, IdeaMap map) { double orient = orientation % Math.PI; if (orient > (Math.PI / 2.0)) { orient -= Math.PI; } if (orient < (-Math.PI / 2.0)) { orient += Math.PI; } int xc = p.x; int yc = p.y; AffineTransform transform = graphics2d.getTransform(); transform(graphics2d, orient, xc, yc); FontMetrics fm = graphics2d.getFontMetrics(); double realTextWidth = fm.stringWidth(string); double realTextHeight = fm.getHeight() - fm.getDescent(); int offsetX = (int) (realTextWidth * (double) (alignment % 3) / 2.0); int offsetY = (int) (-realTextHeight * (double) (alignment / 3) / 2.0); if (!editing) { if ((graphics2d != null) && (string != null)) { AttributedString as = new AttributedString(string); as.addAttribute(TextAttribute.FONT, graphics2d.getFont()); boolean isHyperlink = (this.getIdea().getUrl().length() > 0); if (isHyperlink) { as.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); } graphics2d.drawString(as.getIterator(), xc - offsetX, yc - offsetY); } } else { Graphics2D g2d = (Graphics2D)graphics2d.create(xc - offsetX - 5, yc + offsetY - 5, (int) realTextWidth + 10, (int) realTextHeight + 10); map.getTextField().paint(g2d); g2d.dispose(); } graphics2d.setTransform(transform); }
1,117,091
public BranchView(Idea anIdea) { super(anIdea); }
public BranchView(Idea anIdea) { super(anIdea); }
1,117,092
public MutablePeriod(Object period, PeriodType type) { super(period, type, null); }
public MutablePeriod(Object period, PeriodType type) { super(period, type, null); }
1,117,093
public int sort(LocalSeismogramImpl seismo){ String name = seismo.getName(); int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, seismo.getName()); return i; }
public int sort(LocalSeismogramImpl seismo){ String name = seismo.getName(); int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, seismo.getName()); return i; }
1,117,094
public DataSetSeismogram(RequestFilter rf, DataCenterOperations dco) { this(rf, dco, null); }
public DataSetSeismogram(RequestFilter rf, DataCenterOperations dco) { this(rf, dco, null); }
1,117,095
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new Vector(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new Vector(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new Vector(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new Vector(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
1,117,096
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new Vector(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new Vector(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new ArrayList(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new Vector(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
1,117,097
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new Vector(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new Vector(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
Req(String user, String pw, String testFileName) throws Throwable { this.user = user; this.pw = pw; FileReader frdr = null; try { File testFile = new File(testFileName); frdr = new FileReader(testFile); LineNumberReader lnr = new LineNumberReader(frdr); Vector headers = null; Vector cont = null; do { String ln = lnr.readLine(); if (ln == null) { break; } if (ln.trim().length() == 0) { continue; } if (cont != null) { /* swallow remaining as content */ cont.add(ln); } else if ((description == null) && (ln.startsWith(descHdr))) { /* DESCRIPTION */ description = ln.substring(descHdr.length()); } else if (ln.startsWith(exprespHdr)) { /* EXPECT-RESPONSE */ expectedResp = Integer.parseInt(ln.substring(exprespHdr.length())); } else if ((method == null) && (ln.startsWith(methHdr))) { /* METHOD */ method = ln.substring(methHdr.length()); } else if (ln.startsWith(authHdr)) { /* AUTH */ auth = "true".equals(ln.substring(authHdr.length())); } else if ((url == null) && (ln.startsWith(urlHdr))) { /* URL */ url = ln.substring(urlHdr.length()); } else if (ln.startsWith(hdrHdr)) { /* HEADER */ if (headers == null) { headers = new Vector(); } String hdr = ln.substring(hdrHdr.length()); int colonPos = hdr.indexOf(": "); if (colonPos < 0) { throw new Exception("Bad header in test data file " + testFileName); } headers.add(new Header(hdr.substring(0, colonPos), hdr.substring(colonPos + 2))); } else if ((contentType == null) && (ln.startsWith(ctypeHdr))) { /* CONTENTTYPE */ contentType = ln.substring(ctypeHdr.length()); } else if (ln.startsWith(contFileHdr)) { /* CONTENTFILE */ fromFile = true; contentFileName = ln.substring(contFileHdr.length()); File contentFile = new File(contentFileName); if (!contentFile.isAbsolute()) { contentFileName = testFile.getParentFile().getAbsolutePath() + "/" + contentFileName; } System.out.println("Load content from file " + contentFileName); } else if (!fromFile && ln.startsWith(contHdr)) { /* CONTENT */ if (cont == null) { cont = new ArrayList(); } } else { throw new Exception("Bad test data file " + testFileName); } } while (true); if (headers != null) { hdrs = (Header[])headers.toArray(new Header[headers.size()]); } if (cont != null) { content = (String[])cont.toArray(new String[cont.size()]); } } finally { if (frdr != null) { try { frdr.close(); } catch (Throwable t) {} } } }
1,117,098
public int sendRequest(String method, String url, String user, String pw, Header[] hdrs, String contentType, int contentLen, byte[] content) throws Throwable { client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
public int sendRequest(String method, String url, String user, String pw, Header[] hdrs, String contentType, int contentLen, byte[] content) throws Throwable { client.setMethodName(method, url); HttpMethod meth = client.getMethod(); if (user != null) { String upw = user + ":" + pw; meth.setRequestHeader("Authorization", "Basic " + new String(new BASE64Encoder().encode (upw.getBytes()))); } if (hdrs != null) { for (int i = 0; i < hdrs.length; i++) { meth.setRequestHeader(hdrs[i]); } } if (contentType == null) { contentType = "text/xml"; } if (content != null) { client.setContent(content, contentType); } status = client.execute(); return status; }
1,117,099
public static void askToExit() { if (MainConfiguration.PROPS.getBoolean("gui.asktoexit")) { //$NON-NLS-1$ int i = JOptionPane.showConfirmDialog(null, Messages.getString("Util.19"), //$NON-NLS-1$ Messages.getString("Util.20"), JOptionPane.YES_NO_OPTION); //$NON-NLS-2$ if (i != JOptionPane.YES_OPTION) { return; } } MainFrame.getInstance().dispose(); System.exit(0); }
public static void askToExit() { if (MainConfiguration.PROPS.getBoolean("gui.asktoexit")) { //$NON-NLS-1$ int i = JOptionPane.showConfirmDialog(null, Messages.getString("Util.19"), //$NON-NLS-1$ Messages.getString("Util.20"), JOptionPane.YES_NO_OPTION); //$NON-NLS-2$ if (i != JOptionPane.YES_OPTION) { return; } } if (MainFrame.getInstance() != null) { MainFrame.getInstance().dispose(); } System.exit(0); }
1,117,100
public void setSelected(Idea newSelected) { Idea oldSelected = newSelected; if (this.selected != null) { this.selected.setSelected(false); } this.selected = newSelected; if (this.selected != null) { this.selected.setSelected(true); } firePropertyChange("selected", oldSelected, this.selected); }
public void setSelected(Idea newSelected) { Idea oldSelected = this.selected; if (this.selected != null) { this.selected.setSelected(false); } this.selected = newSelected; if (this.selected != null) { this.selected.setSelected(true); } firePropertyChange("selected", oldSelected, this.selected); }
1,117,101
public Idea(String text) { setText(text); }
public Idea(String text) { setText(text); }
1,117,102
private void createHourFormat(double minutesPerDivision, int divPerLabel, List recip){ TimeInterval inter = new TimeInterval(minutesPerDivision, UnitImpl.MINUTE); recip.add(new TimeBorderFormat("HH:mm:ss", inter, divPerLabel)); }
private void createHourFormat(double minutesPerDivision, int divPerLabel, List recip){ TimeInterval inter = new TimeInterval(minutesPerDivision, UnitImpl.MINUTE); recip.add(new TimeBorderFormat("HH:mm:ss", inter, divPerLabel)); }
1,117,104
private void createMinuteFormats(double[][] minDivs, List recip){ for (int i = 0; i < minDivs.length; i++) { createHourFormat(minDivs[i][0], (int)minDivs[i][1], recip); } }
private void createMinuteFormats(double[][] minDivs, List recip){ for (int i = 0; i < minDivs.length; i++) { createHourFormat(minDivs[i][0], (int)minDivs[i][1], recip, UnitImpl.MINUTE); } }
1,117,105
public MicroSecondTimeRange(MicroSecondDate beginTime, TimeInterval interval){ this.beginTime = beginTime; this.endTime = beginTime.add(interval); this.interval = interval; }
public MicroSecondTimeRange(MicroSecondDate beginTime, TimeInterval interval){ this.beginTime = beginTime; this.endTime = beginTime.add(interval); this.interval = interval; }
1,117,106
public ATNumber base_inc() { return NATNumber.atValue(javaValue+1); }
public ATNumeric base_inc() { return NATNumber.atValue(javaValue+1); }
1,117,107
public ATNumber base_abs() { return NATNumber.atValue(Math.abs(javaValue)); }
public ATNumeric base_abs() { return NATNumber.atValue(Math.abs(javaValue)); }
1,117,108
public Events(Calintf cal, AccessUtil access, HibSession sess, BwUser user, boolean debug) { this.cal = cal; this.access = access; this.sess = sess; this.user = user; this.debug = debug; Properties uidprops = new Properties(); uidprops.setProperty("separator", "-"); uuidGen = new UUIDHexGenerator(); ((Configurable)uuidGen).configure(Hibernate.STRING, uidprops, null); }
public Events(Calintf cal, AccessUtil access, HibSession sess, BwUser user, boolean debug) { this.cal = cal; this.access = access; this.sess = sess; this.user = user; this.debug = debug; Properties uidprops = new Properties(); uidprops.setProperty("separator", "-"); uuidGen = new UUIDHexGenerator(); ((Configurable)uuidGen).configure(Hibernate.STRING, uidprops, null); }
1,117,109
private void addOverride(BwEventProxy proxy, BwRecurrenceInstance inst) throws CalFacadeException { BwEventAnnotation override = proxy.getRef(); override.setOwner(user); sess.saveOrUpdate(override); inst.setOverride(override); }
private void addOverride(BwEventProxy proxy, BwRecurrenceInstance inst) throws CalFacadeException { BwEventAnnotation override = proxy.getRef(); override.setOwner(user); getSess().saveOrUpdate(override); inst.setOverride(override); }
1,117,111
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
1,117,116
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); if (rid == null) { eventQuery(BwEventObj.class, guid, rid, seqnum, true); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
1,117,117
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
1,117,118
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
1,117,119
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } return ev; }
public BwEvent getEvent(int id) throws CalFacadeException { Criteria cr = sess.createCriteria(BwEventObj.class); cr.add(Expression.eq("id", new Integer(id))); BwEvent ev = (BwEvent)sess.getUnique(); if (!access.accessible(ev, privRead, noAccessReturnsNull)) { return null; } eventQuery(BwEventAnnotation.class, guid, rid, seqnum, false); BwEventAnnotation override = (BwEventAnnotation)sess.getUnique(); BwEventProxy proxy; if (override != null) { proxy = makeProxy(null, override, null, CalFacadeDefs.retrieveRecurExpanded); } else { StringBuffer sb = new StringBuffer(); sb.append("from "); sb.append(BwRecurrenceInstance.class.getName()); sb.append(" rec "); sb.append(" where rec.master.guid=:guid "); if (seqnum != null) { sb.append(" and rec.master.sequence=:seq "); } sb.append(" and rec.recurrenceId=:rid "); sess.createQuery(sb.toString()); sess.setString("guid", guid); if (seqnum != null) { sess.setInt("seq", seqnum.intValue()); } sess.setString("rid", rid); BwRecurrenceInstance inst = (BwRecurrenceInstance)sess.getUnique(); if (inst == null) { return ts; } proxy = makeProxy(inst, null, null, CalFacadeDefs.retrieveRecurExpanded); } if ((proxy != null) && (access.accessible(proxy, privRead, noAccessReturnsNull))) { ts.add(proxy); } return ts; }
1,117,120
private BwEvent postGetEvent(BwEvent ev, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { if (ev == null) { return null; } if (!access.accessible(ev, desiredAccess, noAccessReturnsNull)) { return null; } /* XXX-ALARM if (currentMode == userMode) { ev.setAlarms(getAlarms(ev, user)); } */ return ev; }
private BwEvent postGetEvent(BwEvent ev, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { if (ev == null) { return null; } if (!access.accessible(ev, desiredAccess, nullForNoAccess)) { return null; } /* XXX-ALARM if (currentMode == userMode) { ev.setAlarms(getAlarms(ev, user)); } */ return ev; }
1,117,124
private Collection postGetEvents(Collection evs, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { TreeSet outevs = new TreeSet(); Iterator it = evs.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (access.accessible(ev, desiredAccess, noAccessReturnsNull)) { outevs.add(ev); } } return outevs; }
private Collection postGetEvents(Collection evs, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { TreeSet outevs = new TreeSet(); Iterator it = evs.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (access.accessible(ev, desiredAccess, nullForNoAccess)) { outevs.add(ev); } } return outevs; }
1,117,125
private void setCalendarEntities(BwCalendar calendar, CalTerm calTerm) throws CalFacadeException { if (calendar.getCalendarCollection()) { // leaf calendar sess.setEntity("calendar" + calTerm.i, calendar); calTerm.i++; } else { Iterator it = calendar.getChildren().iterator(); while (it.hasNext()) { setCalendarEntities((BwCalendar)it.next(), calTerm); } } }
private void setCalendarEntities(BwCalendar calendar, CalTerm calTerm) throws CalFacadeException { if (calendar.getCalendarCollection()) { // leaf calendar getSess().setEntity("calendar" + calTerm.i, calendar); calTerm.i++; } else { Iterator it = calendar.getChildren().iterator(); while (it.hasNext()) { setCalendarEntities((BwCalendar)it.next(), calTerm); } } }
1,117,126
public CalFacadeException(String s) { super(s); }
public CalFacadeException(String s) { super(s); }
1,117,129
public TimeZone getTimeZone(final String id) throws CalFacadeException;
public abstract TimeZone getTimeZone(final String id) throws CalFacadeException;
1,117,130
public String getUtc(String time, String tzid, TimeZone tz) throws CalFacadeException;
public synchronized String getUtc(String time, String tzid, TimeZone tz) throws CalFacadeException { if (CalFacadeUtil.isISODateTimeUTC(time)) { return time; } if (CalFacadeUtil.isISODate(time)) { time += "T000000"; } else if (!CalFacadeUtil.isISODateTime(time)) { throw new CalFacadeBadDateException(); } try { boolean tzchanged = false; if (tz == null) { if (tzid == null) { if ((lasttzid != null) || (lasttz == null)) { lasttz = TimeZone.getDefault(); tzchanged = true; } } else { if ((lasttzid == null) || (!lasttzid.equals(tzid))) { lasttz = getTimeZone(tzid); if (lasttz == null) { lasttzid = null; throw new CalFacadeBadDateException(); } tzchanged = true; } } } else { if (tz != lasttz) { tzchanged = true; tzid = tz.getID(); lasttz = tz; } } if (tzchanged) { if (debug) { trace("**********tzchanged for tzid " + tzid); } formatTd.setTimeZone(lasttz); lasttzid = tzid; } cal.setTime(formatTd.parse(time)); StringBuffer sb = new StringBuffer(); digit4(sb, cal.get(Calendar.YEAR)); digit2(sb, cal.get(Calendar.MONTH) + 1); digit2(sb, cal.get(Calendar.DAY_OF_MONTH)); sb.append('T'); digit2(sb, cal.get(Calendar.HOUR_OF_DAY)); digit2(sb, cal.get(Calendar.MINUTE)); digit2(sb, cal.get(Calendar.SECOND)); sb.append('Z'); return sb.toString(); } catch (Throwable t) { t.printStackTrace(); throw new CalFacadeBadDateException(); } }
1,117,131
static boolean appendPublicOrCreatorTerm(StringBuffer sb, String entName, int currentMode, boolean ignoreCreator) throws CalFacadeException { boolean publicEvents = (currentMode == guestMode) || (currentMode == publicAdminMode); boolean all = (currentMode == guestMode) || ignoreCreator; boolean setUser = false; sb.append("("); if (!all) { sb.append("("); } sb.append(entName); sb.append(".publick="); sb.append(String.valueOf(publicEvents)); if (!all) { sb.append(") and ("); sb.append(entName); sb.append(".creator=:user"); sb.append(")"); setUser = true; } sb.append(")"); return setUser; }
static boolean appendPublicOrCreatorTerm(StringBuffer sb, String entName, int currentMode, boolean ignoreCreator) throws CalFacadeException { boolean publicEvents = (currentMode == guestMode) || (currentMode == publicAdminMode); boolean all = publicEvents || ignoreCreator; boolean setUser = false; sb.append("("); if (!all) { sb.append("("); } sb.append(entName); sb.append(".publick="); sb.append(String.valueOf(publicEvents)); if (!all) { sb.append(") and ("); sb.append(entName); sb.append(".creator=:user"); sb.append(")"); setUser = true; } sb.append(")"); return setUser; }
1,117,132
public MemoryDataSetSeismogram(LocalSeismogramImpl seis) { this(makeSeisArray(seis), null); }
public MemoryDataSetSeismogram(LocalSeismogramImpl seis) { this(makeSeisArray(seis), null); }
1,117,133
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seis.getNumPoints()) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff; double maxToMeanDiff = Math.abs(minMaxMean[2] - minMaxMean[1]); double minToMeanDiff = Math.abs(minMaxMean[2] - minMaxMean[0]); if(maxToMeanDiff > minToMeanDiff){ meanDiff = maxToMeanDiff; }else{ meanDiff = minToMeanDiff; } data.setCalcIndex(seisIndex); double min = minMaxMean[2] - meanDiff; double max = minMaxMean[2] + meanDiff; System.out.println(seismo + " amp range: " + min + ", " + max + " Points: " + seisIndex[0] + ", " + seisIndex[1]); return data.setCleanRange(new UnitRangeImpl(min, max, UnitImpl.COUNT)); }
private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); LocalSeismogramImpl seis = (LocalSeismogramImpl)seismo.getSeismogram(); int[] seisIndex = DisplayUtils.getSeisPoints(seis, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seis.getNumPoints()) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seis.getNumPoints()){ seisIndex[1] = seis.getNumPoints() -1; } double[] minMaxMean = ((Statistics)DisplayUtils.statCache.get(seismo)).minMaxMean(seisIndex[0], seisIndex[1]); double meanDiff; double maxToMeanDiff = Math.abs(minMaxMean[2] - minMaxMean[1]); double minToMeanDiff = Math.abs(minMaxMean[2] - minMaxMean[0]); if(maxToMeanDiff > minToMeanDiff){ meanDiff = maxToMeanDiff; }else{ meanDiff = minToMeanDiff; } data.setCalcIndex(seisIndex); double min = minMaxMean[2] - meanDiff; double max = minMaxMean[2] + meanDiff; return data.setCleanRange(new UnitRangeImpl(min, max, UnitImpl.COUNT)); }
1,117,134
public double[] minMaxMean(int beginIndex, int endIndex){ if (beginIndex < 0 ) { throw new IllegalArgumentException("begin Index < 0 "+beginIndex); } // end of if (beginIndex < 0 ) if (endIndex > getLength() ) { throw new IllegalArgumentException("end Index > data length "+endIndex); } // end of if (beginIndex < 0 ) if(minMaxMeanCalculated){ if(beginIndex == this.beginIndex && endIndex == this.endIndex){ return minMaxMean; } // begin or end has changed, destory any cached values flushCache(); if(this.beginIndex > beginIndex && this.endIndex < endIndex || this.beginIndex < beginIndex && this.endIndex > endIndex){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } int removalStart, removalEnd, newDataStart, newDataEnd; if(this.beginIndex < beginIndex || this.endIndex < endIndex){ removalStart = this.beginIndex; removalEnd = beginIndex - 1; newDataStart = this.endIndex; newDataEnd = endIndex - 1; }else{ removalStart = endIndex; removalEnd = this.endIndex - 1; newDataStart = beginIndex; newDataEnd = this.beginIndex; } minMaxMean[2] *= this.endIndex - this.beginIndex; if(iSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(iSeries[j] <= minMaxMean[0]){ // if min is found in remave section reaclulate minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(iSeries[j] >= minMaxMean[1]){ // if max is found in remove section reaclulate minMaxMean= calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= iSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(iSeries[j] < minMaxMean[0]){ minMaxMean[0] = iSeries[j]; } if(iSeries[j] > minMaxMean[1]){ minMaxMean[1] = iSeries[j]; } minMaxMean[2] += iSeries[j]; } }else if(sSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(sSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(sSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= sSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(sSeries[j] < minMaxMean[0]){ minMaxMean[0] = sSeries[j]; } if(sSeries[j] > minMaxMean[1]){ minMaxMean[1] = sSeries[j]; } minMaxMean[2] += sSeries[j]; } }else if(fSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(fSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(fSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= fSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(fSeries[j] < minMaxMean[0]){ minMaxMean[0] = fSeries[j]; } if(fSeries[j] > minMaxMean[1]){ minMaxMean[1] = fSeries[j]; } minMaxMean[2] += fSeries[j]; } }else if(dSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(dSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(dSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= dSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(dSeries[j] < minMaxMean[0]){ minMaxMean[0] = dSeries[j]; } if(dSeries[j] > minMaxMean[1]){ minMaxMean[1] = dSeries[j]; } minMaxMean[2] += dSeries[j]; } } this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; }
public double[] minMaxMean(int beginIndex, int endIndex){ if (beginIndex < 0 ) { throw new IllegalArgumentException("begin Index < 0 "+beginIndex); } // end of if (beginIndex < 0 ) if (endIndex > getLength() ) { throw new IllegalArgumentException("end Index > data length "+endIndex); } // end of if (beginIndex < 0 ) if(minMaxMeanCalculated){ if(beginIndex == this.beginIndex && endIndex == this.endIndex){ return minMaxMean; } // begin or end has changed, destory any cached values flushCache(); if(this.beginIndex > beginIndex && this.endIndex < endIndex || this.beginIndex < beginIndex && this.endIndex > endIndex){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } int removalStart, removalEnd, newDataStart, newDataEnd; if(this.beginIndex < beginIndex || this.endIndex < endIndex){ removalStart = this.beginIndex; removalEnd = beginIndex - 1; newDataStart = this.endIndex; newDataEnd = endIndex - 1; }else{ removalStart = endIndex; removalEnd = this.endIndex - 1; newDataStart = beginIndex; newDataEnd = this.beginIndex; } minMaxMean[2] *= this.endIndex - this.beginIndex; if(iSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(iSeries[j] <= minMaxMean[0]){ // if min is found in remave section reaclulate minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(iSeries[j] >= minMaxMean[1]){ // if max is found in remove section reaclulate minMaxMean= calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= iSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(iSeries[j] < minMaxMean[0]){ minMaxMean[0] = iSeries[j]; } if(iSeries[j] > minMaxMean[1]){ minMaxMean[1] = iSeries[j]; } minMaxMean[2] += iSeries[j]; } }else if(sSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(sSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(sSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= sSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(sSeries[j] < minMaxMean[0]){ minMaxMean[0] = sSeries[j]; } if(sSeries[j] > minMaxMean[1]){ minMaxMean[1] = sSeries[j]; } minMaxMean[2] += sSeries[j]; } }else if(fSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(fSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(fSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= fSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(fSeries[j] < minMaxMean[0]){ minMaxMean[0] = fSeries[j]; } if(fSeries[j] > minMaxMean[1]){ minMaxMean[1] = fSeries[j]; } minMaxMean[2] += fSeries[j]; } }else if(dSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(dSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(dSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= dSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(dSeries[j] < minMaxMean[0]){ minMaxMean[0] = dSeries[j]; } if(dSeries[j] > minMaxMean[1]){ minMaxMean[1] = dSeries[j]; } minMaxMean[2] += dSeries[j]; } } this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; }
1,117,135
public double[] minMaxMean(int beginIndex, int endIndex){ if (beginIndex < 0 ) { throw new IllegalArgumentException("begin Index < 0 "+beginIndex); } // end of if (beginIndex < 0 ) if (endIndex > getLength() ) { throw new IllegalArgumentException("end Index > data length "+endIndex); } // end of if (beginIndex < 0 ) if(minMaxMeanCalculated){ if(beginIndex == this.beginIndex && endIndex == this.endIndex){ return minMaxMean; } // begin or end has changed, destory any cached values flushCache(); if(this.beginIndex > beginIndex && this.endIndex < endIndex || this.beginIndex < beginIndex && this.endIndex > endIndex){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } int removalStart, removalEnd, newDataStart, newDataEnd; if(this.beginIndex < beginIndex || this.endIndex < endIndex){ removalStart = this.beginIndex; removalEnd = beginIndex - 1; newDataStart = this.endIndex; newDataEnd = endIndex - 1; }else{ removalStart = endIndex; removalEnd = this.endIndex - 1; newDataStart = beginIndex; newDataEnd = this.beginIndex; } minMaxMean[2] *= this.endIndex - this.beginIndex; if(iSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(iSeries[j] <= minMaxMean[0]){ // if min is found in remave section reaclulate minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(iSeries[j] >= minMaxMean[1]){ // if max is found in remove section reaclulate minMaxMean= calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= iSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(iSeries[j] < minMaxMean[0]){ minMaxMean[0] = iSeries[j]; } if(iSeries[j] > minMaxMean[1]){ minMaxMean[1] = iSeries[j]; } minMaxMean[2] += iSeries[j]; } }else if(sSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(sSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(sSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= sSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(sSeries[j] < minMaxMean[0]){ minMaxMean[0] = sSeries[j]; } if(sSeries[j] > minMaxMean[1]){ minMaxMean[1] = sSeries[j]; } minMaxMean[2] += sSeries[j]; } }else if(fSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(fSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(fSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= fSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(fSeries[j] < minMaxMean[0]){ minMaxMean[0] = fSeries[j]; } if(fSeries[j] > minMaxMean[1]){ minMaxMean[1] = fSeries[j]; } minMaxMean[2] += fSeries[j]; } }else if(dSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(dSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(dSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= dSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(dSeries[j] < minMaxMean[0]){ minMaxMean[0] = dSeries[j]; } if(dSeries[j] > minMaxMean[1]){ minMaxMean[1] = dSeries[j]; } minMaxMean[2] += dSeries[j]; } } this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; }
public double[] minMaxMean(int beginIndex, int endIndex){ if (beginIndex < 0 ) { throw new IllegalArgumentException("begin Index < 0 "+beginIndex); } // end of if (beginIndex < 0 ) if (endIndex > getLength() ) { throw new IllegalArgumentException("end Index > data length "+endIndex); } // end of if (beginIndex < 0 ) if(minMaxMeanCalculated){ if(beginIndex == this.beginIndex && endIndex == this.endIndex){ return minMaxMean; } // begin or end has changed, destory any cached values flushCache(); if(this.beginIndex > beginIndex && this.endIndex < endIndex || this.beginIndex < beginIndex && this.endIndex > endIndex){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } int removalStart, removalEnd, newDataStart, newDataEnd; if(this.beginIndex < beginIndex || this.endIndex < endIndex){ removalStart = this.beginIndex; removalEnd = beginIndex - 1; newDataStart = this.endIndex; newDataEnd = endIndex - 1; }else{ removalStart = endIndex; removalEnd = this.endIndex - 1; newDataStart = beginIndex; newDataEnd = this.beginIndex; } minMaxMean[2] *= this.endIndex - this.beginIndex; if(iSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(iSeries[j] <= minMaxMean[0]){ // if min is found in remave section reaclulate minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(iSeries[j] >= minMaxMean[1]){ // if max is found in remove section reaclulate minMaxMean= calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= iSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(iSeries[j] < minMaxMean[0]){ minMaxMean[0] = iSeries[j]; } if(iSeries[j] > minMaxMean[1]){ minMaxMean[1] = iSeries[j]; } minMaxMean[2] += iSeries[j]; } }else if(sSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(sSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(sSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= sSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(sSeries[j] < minMaxMean[0]){ minMaxMean[0] = sSeries[j]; } if(sSeries[j] > minMaxMean[1]){ minMaxMean[1] = sSeries[j]; } minMaxMean[2] += sSeries[j]; } }else if(fSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(fSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(fSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= fSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(fSeries[j] < minMaxMean[0]){ minMaxMean[0] = fSeries[j]; } if(fSeries[j] > minMaxMean[1]){ minMaxMean[1] = fSeries[j]; } minMaxMean[2] += fSeries[j]; } }else if(dSeries != null){ for(int j = removalStart; j <= removalEnd; j++) { if(dSeries[j] <= minMaxMean[0]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } if(dSeries[j] >= minMaxMean[1]){ minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; } minMaxMean[2] -= dSeries[j]; } for(int j = newDataStart; j <= newDataEnd; j++) { if(dSeries[j] < minMaxMean[0]){ minMaxMean[0] = dSeries[j]; } if(dSeries[j] > minMaxMean[1]){ minMaxMean[1] = dSeries[j]; } minMaxMean[2] += dSeries[j]; } } this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } minMaxMean = calculateMinMaxMean(beginIndex, endIndex); return minMaxMean; }
1,117,136
public void update(File file, boolean playing) { String s = "*** "+ file.toString() + ((playing) ? Messages.getString("MainPanel.PLAYING") : ""); //$NON-NLS-1$ //$NON-NLS-2$ setText(s); DefaultListModel listModel = playlist.getListModel(); int index = listModel.indexOf(file); ListDataListener[] listeners = listModel.getListDataListeners(); ListDataEvent e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, index, index); for (int i = 0; i < listeners.length; i++) { listeners[i].contentsChanged(e); } }
public void update(File file, boolean playing) { String s = file.toString(); if (playing) { s = "***"+ s + Messages.getString("MainPanel.PLAYING"); } //$NON-NLS-1$ //$NON-NLS-2$ setText(s); DefaultListModel listModel = playlist.getListModel(); int index = listModel.indexOf(file); ListDataListener[] listeners = listModel.getListDataListeners(); ListDataEvent e = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, index, index); for (int i = 0; i < listeners.length; i++) { listeners[i].contentsChanged(e); } }
1,117,137
public void play(int index) { System.out.println("play("+index+")"); if (index > list.size()) { throw new RuntimeException("index = "+ index +" > list.size() = "+ list.size()); } playingIndex = index; if (isPlaying()) { player.stop(); } try { final File file = (File)list.get(index); player = new MP3Player(file); player.addListener(passthroughPlayerListener); player.addListener(configPlayerListener); Thread thread = new Thread() { public void run() { try { player.play(); } catch (Exception exc) { exc.printStackTrace(); } } }; thread.setDaemon(true); thread.start(); } catch (Exception exc) { exc.printStackTrace(); } }
public void play(int index) { System.out.println("play("+index+")"); if (index > list.size()) { throw new RuntimeException("index = "+ index +" > list.size() = "+ list.size()); } playingIndex = index; if (isPlaying()) { player.stop(); } try { final File file = (File)list.get(index); player = new MP3Player(file); player.addListener(passthroughPlayerListener); player.addListener(configPlayerListener); Thread thread = new Thread() { public void run() { try { player.play(); } catch (Exception exc) { exc.printStackTrace(); } } }; thread.setDaemon(true); thread.start(); } catch (Exception exc) { exc.printStackTrace(); } }
1,117,138
public void play(int index) { System.out.println("play("+index+")"); if (index > list.size()) { throw new RuntimeException("index = "+ index +" > list.size() = "+ list.size()); } playingIndex = index; if (isPlaying()) { player.stop(); } try { final File file = (File)list.get(index); player = new MP3Player(file); player.addListener(passthroughPlayerListener); player.addListener(configPlayerListener); Thread thread = new Thread() { public void run() { try { player.play(); } catch (Exception exc) { exc.printStackTrace(); } } }; thread.setDaemon(true); thread.start(); } catch (Exception exc) { exc.printStackTrace(); } }
public void play(int index) { System.out.println("play("+index+")"); if (index > list.size()) { throw new RuntimeException("index = "+ index +" > list.size() = "+ list.size()); } playingIndex = index; if (isPlaying()) { player.stop(); } try { final File file = (File)list.get(index); player = new MP3Player(file); player.addListener(passthroughPlayerListener); player.addListener(configPlayerListener); Thread thread = new Thread() { public void run() { try { player.play(); } catch (Exception exc) { exc.printStackTrace(); } } }; thread.setDaemon(true); thread.start(); } catch (Exception exc) { exc.printStackTrace(); } }
1,117,139
public File getFile();
public abstract File getFile();
1,117,140
public void add(File f) { list.addElement(f); }
public void add(File f) { list.addElement(f); }
1,117,141
protected Command getMSLWrapper(ICommand cmd) { TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) .getEditingDomain(); CompositeTransactionalCommand modelCmd = new CompositeTransactionalCommand( editingDomain, cmd.getLabel()); modelCmd.compose(cmd); return new EtoolsProxyCommand(modelCmd); }
protected Command getMSLWrapper(ICommand cmd) { TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) .getEditingDomain(); CompositeTransactionalCommand modelCmd = new CompositeTransactionalCommand( editingDomain, cmd.getLabel()); modelCmd.compose(cmd); return new ICommandProxy(modelCmd); }
1,117,142
protected Command getSemanticCommand(IEditCommandRequest request) { IEditCommandRequest completedRequest = completeRequest(request); Command semanticCommand = getSemanticCommandSwitch(completedRequest); if (semanticCommand == null) { return UnexecutableCommand.INSTANCE; } boolean shouldProceed = true; if (completedRequest instanceof DestroyRequest) { shouldProceed = shouldProceed((DestroyRequest) completedRequest); } if (shouldProceed) { if (completedRequest instanceof DestroyRequest) { ICommand deleteCommand = new DeleteCommand((View) getHost() .getModel()); semanticCommand = semanticCommand.chain(new EtoolsProxyCommand( deleteCommand)); } return semanticCommand; } return UnexecutableCommand.INSTANCE; }
protected Command getSemanticCommand(IEditCommandRequest request) { IEditCommandRequest completedRequest = completeRequest(request); Command semanticCommand = getSemanticCommandSwitch(completedRequest); if (semanticCommand == null) { return UnexecutableCommand.INSTANCE; } boolean shouldProceed = true; if (completedRequest instanceof DestroyRequest) { shouldProceed = shouldProceed((DestroyRequest) completedRequest); } if (shouldProceed) { if (completedRequest instanceof DestroyRequest) { ICommand deleteCommand = new DeleteCommand((View) getHost() .getModel()); semanticCommand = semanticCommand.chain(new ICommandProxy( deleteCommand)); } return semanticCommand; } return UnexecutableCommand.INSTANCE; }
1,117,143
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResult queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); return buffer.toString(); } resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); return buffer.toString(); } resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
1,117,144
private PresentationObject getInputFields(String queryName, String queryDescription, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { // create a nice headline for the confused user String currentQuery = StringHandler.concat(resourceBundle.getLocalizedString("ro_current_query", "Current Query"),":"); Text currentQueryHeader = new Text(currentQuery); currentQueryHeader.setBold(); add(currentQueryHeader); add(Text.getBreak()); Text text = new Text(queryName); text.setBold(); add(text); if (queryDescription != null) { add(Text.getBreak()); String descriptionHeader = StringHandler.concat(resourceBundle.getLocalizedString("ro_query_description", "Query description"),":"); Text descriptionHeaderText = new Text(descriptionHeader); descriptionHeaderText.setBold(); add(descriptionHeaderText); add(Text.getBreak()); Text queryDescriptionText = new Text(queryDescription); queryDescriptionText.setBold(); add(queryDescriptionText); } Table table = null; int i = 1; // special case: ask for the desired number of rows if (resultNumberOfRows != -1) { table = new Table (2, identifierValueMap.size() + 2); Text desiredNumberOfRowsText = new Text(resourceBundle.getLocalizedString("ro_set_number_of_max_rows", "Set number of max rows")); table.add(desiredNumberOfRowsText, 1, i ); TextInput numberOfRowsInput = new TextInput(NUMBER_OF_ROWS_KEY, Integer.toString(resultNumberOfRows)); table.add(numberOfRowsInput, 2, i ); i++; } else { table = new Table (2, identifierValueMap.size() + 1); } Iterator iterator = identifierValueMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String key = (String) entry.getKey(); if (! DirectSQLStatement.USER_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.endsWith(key)) { InputDescription inputDescription = (InputDescription) identifierInputDescriptionMap.get(key); Object object = identifierValueMap.get(key); String inputHandlerClass = inputDescription.getInputHandler(); String description = inputDescription.getDescription(); InputHandler inputHandler = getInputHandler(inputHandlerClass); PresentationObject input = null; if (inputHandler == null) { String value = (object instanceof List) ? ((String) ((List) object).get(0)) : object.toString(); input = new TextInput(key, value); } else if (object instanceof Collection) { Collection value = (Collection) object; input = inputHandler.getHandlerObject(key, value, iwc); } else { String value = object.toString(); input = inputHandler.getHandlerObject(key, value, iwc); } table.add(description, 1, i); table.add(input, 2, i++); } } String okayText = resourceBundle.getLocalizedString("ro_okay", "ok"); SubmitButton okayButton = new SubmitButton(okayText, EXECUTE_QUERY_KEY, "default_value"); okayButton.setAsImageButton(true); PresentationObject goBack = getGoBackButton(resourceBundle); table.add(goBack, 1, i); table.add(okayButton, 1, i); return table; }
private PresentationObject getInputFields(String queryName, String queryDescription, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { // create a nice headline for the confused user String currentQuery = StringHandler.concat(resourceBundle.getLocalizedString("ro_current_query", "Current Query"),":"); Text currentQueryHeader = new Text(currentQuery); currentQueryHeader.setBold(); add(currentQueryHeader); add(Text.getBreak()); Text text = new Text(queryName); text.setBold(); add(text); if (queryDescription != null) { add(Text.getBreak()); String descriptionHeader = StringHandler.concat(resourceBundle.getLocalizedString("ro_query_description", "Query description"),":"); Text descriptionHeaderText = new Text(descriptionHeader); descriptionHeaderText.setBold(); add(descriptionHeaderText); add(Text.getBreak()); Text queryDescriptionText = new Text(queryDescription); queryDescriptionText.setBold(); add(queryDescriptionText); } Table table = null; int i = 1; // special case: ask for the desired number of rows if (resultNumberOfRows != -1) { table = new Table (2, identifierValueMap.size() + 2); Text desiredNumberOfRowsText = new Text(resourceBundle.getLocalizedString("ro_set_number_of_max_rows", "Set number of max rows")); table.add(desiredNumberOfRowsText, 1, i ); TextInput numberOfRowsInput = new TextInput(NUMBER_OF_ROWS_KEY, Integer.toString(resultNumberOfRows)); table.add(numberOfRowsInput, 2, i ); i++; } else { table = new Table (2, identifierValueMap.size() + 1); } Set keySet = identifierValueMap.keySet(); String[] keys = (String[]) keySet.toArray(new String[keySet.size()]); Arrays.sort(keys,new StringNumberComparator()); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String key = (String) entry.getKey(); if (! DirectSQLStatement.USER_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.endsWith(key)) { InputDescription inputDescription = (InputDescription) identifierInputDescriptionMap.get(key); Object object = identifierValueMap.get(key); String inputHandlerClass = inputDescription.getInputHandler(); String description = inputDescription.getDescription(); InputHandler inputHandler = getInputHandler(inputHandlerClass); PresentationObject input = null; if (inputHandler == null) { String value = (object instanceof List) ? ((String) ((List) object).get(0)) : object.toString(); input = new TextInput(key, value); } else if (object instanceof Collection) { Collection value = (Collection) object; input = inputHandler.getHandlerObject(key, value, iwc); } else { String value = object.toString(); input = inputHandler.getHandlerObject(key, value, iwc); } table.add(description, 1, i); table.add(input, 2, i++); } } String okayText = resourceBundle.getLocalizedString("ro_okay", "ok"); SubmitButton okayButton = new SubmitButton(okayText, EXECUTE_QUERY_KEY, "default_value"); okayButton.setAsImageButton(true); PresentationObject goBack = getGoBackButton(resourceBundle); table.add(goBack, 1, i); table.add(okayButton, 1, i); return table; }
1,117,146
private PresentationObject getInputFields(String queryName, String queryDescription, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { // create a nice headline for the confused user String currentQuery = StringHandler.concat(resourceBundle.getLocalizedString("ro_current_query", "Current Query"),":"); Text currentQueryHeader = new Text(currentQuery); currentQueryHeader.setBold(); add(currentQueryHeader); add(Text.getBreak()); Text text = new Text(queryName); text.setBold(); add(text); if (queryDescription != null) { add(Text.getBreak()); String descriptionHeader = StringHandler.concat(resourceBundle.getLocalizedString("ro_query_description", "Query description"),":"); Text descriptionHeaderText = new Text(descriptionHeader); descriptionHeaderText.setBold(); add(descriptionHeaderText); add(Text.getBreak()); Text queryDescriptionText = new Text(queryDescription); queryDescriptionText.setBold(); add(queryDescriptionText); } Table table = null; int i = 1; // special case: ask for the desired number of rows if (resultNumberOfRows != -1) { table = new Table (2, identifierValueMap.size() + 2); Text desiredNumberOfRowsText = new Text(resourceBundle.getLocalizedString("ro_set_number_of_max_rows", "Set number of max rows")); table.add(desiredNumberOfRowsText, 1, i ); TextInput numberOfRowsInput = new TextInput(NUMBER_OF_ROWS_KEY, Integer.toString(resultNumberOfRows)); table.add(numberOfRowsInput, 2, i ); i++; } else { table = new Table (2, identifierValueMap.size() + 1); } Iterator iterator = identifierValueMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String key = (String) entry.getKey(); if (! DirectSQLStatement.USER_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.endsWith(key)) { InputDescription inputDescription = (InputDescription) identifierInputDescriptionMap.get(key); Object object = identifierValueMap.get(key); String inputHandlerClass = inputDescription.getInputHandler(); String description = inputDescription.getDescription(); InputHandler inputHandler = getInputHandler(inputHandlerClass); PresentationObject input = null; if (inputHandler == null) { String value = (object instanceof List) ? ((String) ((List) object).get(0)) : object.toString(); input = new TextInput(key, value); } else if (object instanceof Collection) { Collection value = (Collection) object; input = inputHandler.getHandlerObject(key, value, iwc); } else { String value = object.toString(); input = inputHandler.getHandlerObject(key, value, iwc); } table.add(description, 1, i); table.add(input, 2, i++); } } String okayText = resourceBundle.getLocalizedString("ro_okay", "ok"); SubmitButton okayButton = new SubmitButton(okayText, EXECUTE_QUERY_KEY, "default_value"); okayButton.setAsImageButton(true); PresentationObject goBack = getGoBackButton(resourceBundle); table.add(goBack, 1, i); table.add(okayButton, 1, i); return table; }
private PresentationObject getInputFields(String queryName, String queryDescription, Map identifierValueMap, Map identifierInputDescriptionMap, IWResourceBundle resourceBundle, IWContext iwc) { // create a nice headline for the confused user String currentQuery = StringHandler.concat(resourceBundle.getLocalizedString("ro_current_query", "Current Query"),":"); Text currentQueryHeader = new Text(currentQuery); currentQueryHeader.setBold(); add(currentQueryHeader); add(Text.getBreak()); Text text = new Text(queryName); text.setBold(); add(text); if (queryDescription != null) { add(Text.getBreak()); String descriptionHeader = StringHandler.concat(resourceBundle.getLocalizedString("ro_query_description", "Query description"),":"); Text descriptionHeaderText = new Text(descriptionHeader); descriptionHeaderText.setBold(); add(descriptionHeaderText); add(Text.getBreak()); Text queryDescriptionText = new Text(queryDescription); queryDescriptionText.setBold(); add(queryDescriptionText); } Table table = null; int i = 1; // special case: ask for the desired number of rows if (resultNumberOfRows != -1) { table = new Table (2, identifierValueMap.size() + 2); Text desiredNumberOfRowsText = new Text(resourceBundle.getLocalizedString("ro_set_number_of_max_rows", "Set number of max rows")); table.add(desiredNumberOfRowsText, 1, i ); TextInput numberOfRowsInput = new TextInput(NUMBER_OF_ROWS_KEY, Integer.toString(resultNumberOfRows)); table.add(numberOfRowsInput, 2, i ); i++; } else { table = new Table (2, identifierValueMap.size() + 1); } Iterator iterator = identifierValueMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String key = (String) entry.getKey(); if (! DirectSQLStatement.USER_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(key) && ! DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.endsWith(key)) { InputDescription inputDescription = (InputDescription) identifierInputDescriptionMap.get(key); Object object = identifierValueMap.get(key); String inputHandlerClass = inputDescription.getInputHandler(); String description = inputDescription.getDescription(); InputHandler inputHandler = getInputHandler(inputHandlerClass); PresentationObject input = null; if (inputHandler == null) { String value = (object instanceof List) ? ((String) ((List) object).get(0)) : object.toString(); input = new TextInput(key, value); } else if (object instanceof Collection) { Collection value = (Collection) object; input = inputHandler.getHandlerObject(key, value, iwc); } else { String value = object.toString(); input = inputHandler.getHandlerObject(key, value, iwc); } table.add(description, 1, i); table.add(input, 2, i++); } } String okayText = resourceBundle.getLocalizedString("ro_okay", "ok"); SubmitButton okayButton = new SubmitButton(okayText, EXECUTE_QUERY_KEY, "default_value"); okayButton.setAsImageButton(true); PresentationObject goBack = getGoBackButton(resourceBundle); table.add(goBack, 1, i); table.add(okayButton, 1, i); return table; }
1,117,147
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, buffer.toString()); }
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, buffer.toString()); }
1,117,148
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, buffer.toString()); }
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, buffer.toString()); }
1,117,149
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, buffer.toString()); }
private void setAccessCondition(Map identifierValueMap, IWContext iwc) throws RemoteException { List groupIds = new ArrayList(); User user = iwc.getCurrentUser(); UserBusiness userBusiness = getUserBusiness(); GroupBusiness groupBusiness = getGroupBusiness(); Collection topGroupNodes = userBusiness.getUsersTopGroupNodesByViewAndOwnerPermissions(user,iwc); Iterator iterator = topGroupNodes.iterator(); while ( iterator.hasNext()) { Group topGroup = (Group) iterator.next(); Collection childGroups = groupBusiness.getChildGroupsRecursive(topGroup); if (childGroups != null) { Iterator childGroupsIterator = childGroups.iterator(); while (childGroupsIterator.hasNext()) { Group group = (Group) childGroupsIterator.next(); groupIds.add(group.getPrimaryKey()); } } } // create the where condition for user view StringBuffer userBuffer = new StringBuffer("(select related_ic_group_id from ic_group_relation where ic_group_id in "); Iterator groupIdsIterator = groupIds.iterator(); StringBuffer buffer = new StringBuffer("( "); String separator = ""; while (groupIdsIterator.hasNext()) { buffer.append(separator); Object groupId = groupIdsIterator.next(); buffer.append(groupId.toString()); separator = " , "; } buffer.append(" )"); userBuffer.append(buffer).append(" and group_relation_status = 'ST_ACTIVE')"); identifierValueMap.put(DirectSQLStatement.USER_ACCESS_VARIABLE, userBuffer.toString()); identifierValueMap.put(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE, buffer.toString()); // create the where condition for group view identifierValueMap.put(DirectSQLStatement.GROUP_ACCESS_VARIABLE, groupAccess); }
1,117,150
public JasperPrint printSynchronizedReport(com.idega.block.dataquery.data.QueryResult p0,java.util.Map p1,com.idega.block.datareport.data.DesignBox p2) throws java.rmi.RemoteException;
public JasperPrint printSynchronizedReport(com.idega.block.dataquery.data.QueryResult p0,com.idega.block.datareport.data.DesignBox p2) throws java.rmi.RemoteException;
1,117,151
public void addParameter(Element param);
public void addParameter(String name, Object param);
1,117,152
public static LocalSeismogramImpl createRaggedSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, int missingSamples, ChannelId id) { double secondShift = missingSamples / (double)SPIKE_SAMPLES_PER_SECOND; TimeInterval shiftInt = new TimeInterval(secondShift, UnitImpl.SECOND); time = time.add(shiftInt); traceLength = traceLength.subtract(shiftInt); String name = "spike at " + time.toString(); int seconds = (int)Math.ceil(traceLength.convertTo(UnitImpl.SECOND) .getValue()); int[] dataBits = new int[SPIKE_SAMPLES_PER_SECOND * seconds]; for(int i = 0; i < dataBits.length; i++) { if(i % samplesPerSpike == 0 && i >= missingSamples) { dataBits[i] = 100; } } return createTestData(name, dataBits, time.getFissuresTime(), id); }
public static LocalSeismogramImpl createRaggedSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, int missingSamples, ChannelId id) { double secondShift = missingSamples / (double)SPIKE_SAMPLES_PER_SECOND; TimeInterval shiftInt = new TimeInterval(secondShift, UnitImpl.SECOND); time = time.add(shiftInt); traceLength = traceLength.subtract(shiftInt); String name = "spike at " + time.toString(); int seconds = (int)Math.ceil(traceLength.convertTo(UnitImpl.SECOND) .getValue()); int[] dataBits = new int[SPIKE_SAMPLES_PER_SECOND * seconds]; for(int i = 0; i < dataBits.length; i++) { if(i % samplesPerSpike == 0 && i >= missingSamples) { dataBits[i] = 100; } } return createTestData(name, dataBits, time.getFissuresTime(), id); }
1,117,153
public static LocalSeismogramImpl createRaggedSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, int missingSamples, ChannelId id) { double secondShift = missingSamples / (double)SPIKE_SAMPLES_PER_SECOND; TimeInterval shiftInt = new TimeInterval(secondShift, UnitImpl.SECOND); time = time.add(shiftInt); traceLength = traceLength.subtract(shiftInt); String name = "spike at " + time.toString(); int seconds = (int)Math.ceil(traceLength.convertTo(UnitImpl.SECOND) .getValue()); int[] dataBits = new int[SPIKE_SAMPLES_PER_SECOND * seconds]; for(int i = 0; i < dataBits.length; i++) { if(i % samplesPerSpike == 0 && i >= missingSamples) { dataBits[i] = 100; } } return createTestData(name, dataBits, time.getFissuresTime(), id); }
public static LocalSeismogramImpl createRaggedSpike(MicroSecondDate time, TimeInterval traceLength, int samplesPerSpike, int missingSamples, ChannelId id) { double secondShift = missingSamples / (double)SPIKE_SAMPLES_PER_SECOND; TimeInterval shiftInt = new TimeInterval(secondShift, UnitImpl.SECOND); time = time.add(shiftInt); traceLength = traceLength.subtract(shiftInt); String name = "spike at " + time.toString(); int seconds = (int)Math.ceil(traceLength.convertTo(UnitImpl.SECOND) .getValue()); int[] dataBits = new int[SPIKE_SAMPLES_PER_SECOND * seconds]; for(int i = 0; i < dataBits.length; i++) { if((i + missingSamples) % samplesPerSpike == 0) { dataBits[i] = 100; } } return createTestData(name, dataBits, time.getFissuresTime(), id); }
1,117,154
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
1,117,155
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
1,117,156
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
1,117,157
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
1,117,158
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
public static int[][] makePlottable(LocalSeismogramImpl seis, MicroSecondTimeRange tr, int samplesPerDay) throws CodecException { MicroSecondDate startTime = tr.getBeginTime(); if(seis.getBeginTime().after(startTime)) { startTime = seis.getBeginTime(); } MicroSecondDate stopTime = tr.getEndTime(); if(seis.getEndTime().before(stopTime)) { stopTime = seis.getEndTime(); } int startSample = PlottableChunk.getPixel(startTime, samplesPerDay); startTime = getTime(startTime, startSample, samplesPerDay); int stopSample = PlottableChunk.getPixel(stopTime, samplesPerDay); stopTime = getTime(stopTime, stopSample, samplesPerDay); double lengthInDays = stopTime.difference(startTime) .getValue(UnitImpl.DAY); int numSamples = (int)Math.ceil(lengthInDays * samplesPerDay); if(numSamples % 2 == 1) { numSamples++; } int[][] out = new int[2][numSamples]; TimeInterval startShift = startTime.subtract(tr.getBeginTime()); double daysShifted = startShift.getValue(UnitImpl.DAY); int xOffset = (int)Math.floor(daysShifted * samplesPerDay / 2); TimeInterval plottableSampleLength = (TimeInterval)new TimeInterval(1, UnitImpl.DAY).divideBy(samplesPerDay) .convertTo(UnitImpl.SECOND); double seisSamplesPerSample = plottableSampleLength.divideBy(seis.getSampling() .getPeriod() .convertTo(UnitImpl.SECOND)) .getValue(); for(int i = 0; i < numSamples; i += 2) { out[0][i] = xOffset + i / 2; out[0][i + 1] = xOffset + i / 2; int startSeisSample = (int)Math.floor(i * seisSamplesPerSample); if(startSeisSample < 0) { startSeisSample = 0; } int stopSeisSample = (int)Math.ceil((i + 1) * seisSamplesPerSample); if(stopSeisSample > seis.getNumPoints()) { stopSeisSample = seis.getNumPoints(); } int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for(int j = startSeisSample; j < stopSeisSample; j++) { int val = (int)seis.getValueAt(j).getValue(); if(val < min) { min = val; } if(val > max) { max = val; } } out[1][i] = min; out[1][i + 1] = max; } return out; }
1,117,159
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { return (LocalSeismogramImpl)seismogramCache.get(name); } // end of if (seismogramCache.containsKey(name)) String urlString = "NONE"; NodeList nList = evalNodeList(config, "SacSeismogram[name="+dquote+name+dquote+"]"); if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") URL sacURL = new URL(base, urlString); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); NodeList propList = evalNodeList(e, "property"); if (propList != null && propList.getLength() != 0) { Property[] props = seis.getProperties(); Property[] newProps = new Property[1+props.length+nList.getLength()]; System.arraycopy(props, 0, newProps, 0, props.length); for (int i=0; i<propList.getLength(); i++) { Element propElement = (Element)propList.item(i); newProps[props.length+i] = new Property(xpath.eval(propElement, "name/text()").str(), xpath.eval(propElement, "value/text()").str()); } // end of for newProps[newProps.length-1] = new Property(seisNameKey, name); seis.setProperties(newProps); } if (seis != null) { seismogramCache.put(name, seis); } // end of if (seis != null) return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { return (LocalSeismogramImpl)seismogramCache.get(name); } // end of if (seismogramCache.containsKey(name)) String urlString = "NONE"; NodeList nList = evalNodeList(config, "SacSeismogram[name="+dquote+name+dquote+"]"); if (nList != null && nList.getLength() != 0) { try { Node n = nList.item(0); if (n instanceof Element) { Element e = (Element)n; urlString = e.getAttribute("xlink:href"); if (urlString == null || urlString == "") { throw new MalformedURLException(name+" does not have an xlink:href attribute"); } // end of if (urlString == null || urlString == "") URL sacURL = new URL(base, urlString); DataInputStream dis = new DataInputStream(new BufferedInputStream(sacURL.openStream())); SacTimeSeries sac = new SacTimeSeries(); sac.read(dis); LocalSeismogramImpl seis = SacToFissures.getSeismogram(sac); NodeList propList = evalNodeList(e, "property"); if (propList != null && propList.getLength() != 0) { Property[] props = seis.getProperties(); Property[] newProps = new Property[1+props.length+nList.getLength()]; System.arraycopy(props, 0, newProps, 0, props.length); for (int i=0; i<propList.getLength(); i++) { Element propElement = (Element)propList.item(i); newProps[props.length+i] = new Property(xpath.eval(propElement, "name/text()").str(), xpath.eval(propElement, "value/text()").str()); } // end of for newProps[newProps.length-1] = new Property(seisNameKey, name); seis.setProperties(newProps); } if (seis != null) { seismogramCache.put(name, seis); } // end of if (seis != null) return seis; } } catch (MalformedURLException e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } catch (Exception e) { logger.error("Couldn't get seismogram "+name, e); logger.error(urlString); } // end of try-catch } return null; }
1,117,160
SimpleXLink(DocumentBuilder docBuilder, Element element, URL base) { this.docBuilder = docBuilder; this.element = element; this.base = base; }
SimpleXLink(DocumentBuilder docBuilder, Element element, URL base) { this.docBuilder = docBuilder; this.element = element; this.base = base; }
1,117,161
public void read(DataInputStream dis) throws IOException { readHeader(dis); readData(dis); }
public void read(DataInputStream dis) throws IOException { readHeader(dis); readData(dis); }
1,117,162
public XMLDataSet(DocumentBuilder docBuilder, URL base, Element config) { this(docBuilder, base); this.config = config; }
public XMLDataSet(DocumentBuilder docBuilder, URL base, Element config) { this(docBuilder, base); this.config = config; }
1,117,166
public void write(Node node) { // is there anything to do? if (node == null) { return; } short type = node.getNodeType(); switch (type) { case Node.DOCUMENT_NODE: { Document document = (Document)node; if (!fCanonical) { fOut.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); fOut.flush(); write(document.getDoctype()); } write(document.getDocumentElement()); break; } case Node.DOCUMENT_TYPE_NODE: { DocumentType doctype = (DocumentType)node; fOut.print("<!DOCTYPE "); fOut.print(doctype.getName()); String publicId = doctype.getPublicId(); String systemId = doctype.getSystemId(); if (publicId != null) { fOut.print(" PUBLIC '"); fOut.print(publicId); fOut.print("' '"); fOut.print(systemId); fOut.print('\''); } else { fOut.print(" SYSTEM '"); fOut.print(systemId); fOut.print('\''); } String internalSubset = doctype.getInternalSubset(); if (internalSubset != null) { fOut.println(" ["); fOut.print(internalSubset); fOut.print(']'); } fOut.println('>'); break; } case Node.ELEMENT_NODE: { fOut.print('<'); fOut.print(node.getNodeName()); Attr attrs[] = sortAttributes(node.getAttributes()); for (int i = 0; i < attrs.length; i++) { Attr attr = attrs[i]; fOut.print(' '); fOut.print(attr.getNodeName()); fOut.print("=\""); normalizeAndPrint(attr.getNodeValue()); fOut.print('"'); } fOut.println('>'); fOut.flush(); Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } break; } case Node.ENTITY_REFERENCE_NODE: { if (fCanonical) { Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } } else { fOut.print('&'); fOut.print(node.getNodeName()); fOut.print(';'); fOut.flush(); } break; } case Node.CDATA_SECTION_NODE: { if (fCanonical) { normalizeAndPrint(node.getNodeValue()); } else { fOut.print("<![CDATA["); fOut.print(node.getNodeValue()); fOut.print("]]>"); } fOut.flush(); break; } case Node.TEXT_NODE: { normalizeAndPrint(node.getNodeValue()); fOut.flush(); break; } case Node.PROCESSING_INSTRUCTION_NODE: { fOut.print("<?"); fOut.print(node.getNodeName()); String data = node.getNodeValue(); if (data != null && data.length() > 0) { fOut.print(' '); fOut.print(data); } fOut.println("?>"); fOut.flush(); break; } } if (type == Node.ELEMENT_NODE) { fOut.print("</"); fOut.print(node.getNodeName()); fOut.print('>'); fOut.flush(); } } // write(Node)
public void write(Node node) { // is there anything to do? if (node == null) { return; } short type = node.getNodeType(); switch (type) { case Node.DOCUMENT_NODE: { Document document = (Document)node; if (!fCanonical) { fOut.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); fOut.flush(); write(document.getDoctype()); } write(document.getDocumentElement()); break; } case Node.DOCUMENT_TYPE_NODE: { DocumentType doctype = (DocumentType)node; fOut.print("<!DOCTYPE "); fOut.print(doctype.getName()); String publicId = doctype.getPublicId(); String systemId = doctype.getSystemId(); if (publicId != null) { fOut.print(" PUBLIC '"); fOut.print(publicId); fOut.print("' '"); fOut.print(systemId); fOut.print('\''); } else { fOut.print(" SYSTEM '"); fOut.print(systemId); fOut.print('\''); } String internalSubset = doctype.getInternalSubset(); if (internalSubset != null) { fOut.println(" ["); fOut.print(internalSubset); fOut.print(']'); } fOut.print('>'); break; } case Node.ELEMENT_NODE: { fOut.print('<'); fOut.print(node.getNodeName()); Attr attrs[] = sortAttributes(node.getAttributes()); for (int i = 0; i < attrs.length; i++) { Attr attr = attrs[i]; fOut.print(' '); fOut.print(attr.getNodeName()); fOut.print("=\""); normalizeAndPrint(attr.getNodeValue()); fOut.print('"'); } fOut.print('>'); fOut.flush(); Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } break; } case Node.ENTITY_REFERENCE_NODE: { if (fCanonical) { Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } } else { fOut.print('&'); fOut.print(node.getNodeName()); fOut.print(';'); fOut.flush(); } break; } case Node.CDATA_SECTION_NODE: { if (fCanonical) { normalizeAndPrint(node.getNodeValue()); } else { fOut.print("<![CDATA["); fOut.print(node.getNodeValue()); fOut.print("]]>"); } fOut.flush(); break; } case Node.TEXT_NODE: { normalizeAndPrint(node.getNodeValue()); fOut.flush(); break; } case Node.PROCESSING_INSTRUCTION_NODE: { fOut.print("<?"); fOut.print(node.getNodeName()); String data = node.getNodeValue(); if (data != null && data.length() > 0) { fOut.print(' '); fOut.print(data); } fOut.println("?>"); fOut.flush(); break; } } if (type == Node.ELEMENT_NODE) { fOut.print("</"); fOut.print(node.getNodeName()); fOut.print('>'); fOut.flush(); } } // write(Node)
1,117,167
public void write(Node node) { // is there anything to do? if (node == null) { return; } short type = node.getNodeType(); switch (type) { case Node.DOCUMENT_NODE: { Document document = (Document)node; if (!fCanonical) { fOut.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); fOut.flush(); write(document.getDoctype()); } write(document.getDocumentElement()); break; } case Node.DOCUMENT_TYPE_NODE: { DocumentType doctype = (DocumentType)node; fOut.print("<!DOCTYPE "); fOut.print(doctype.getName()); String publicId = doctype.getPublicId(); String systemId = doctype.getSystemId(); if (publicId != null) { fOut.print(" PUBLIC '"); fOut.print(publicId); fOut.print("' '"); fOut.print(systemId); fOut.print('\''); } else { fOut.print(" SYSTEM '"); fOut.print(systemId); fOut.print('\''); } String internalSubset = doctype.getInternalSubset(); if (internalSubset != null) { fOut.println(" ["); fOut.print(internalSubset); fOut.print(']'); } fOut.println('>'); break; } case Node.ELEMENT_NODE: { fOut.print('<'); fOut.print(node.getNodeName()); Attr attrs[] = sortAttributes(node.getAttributes()); for (int i = 0; i < attrs.length; i++) { Attr attr = attrs[i]; fOut.print(' '); fOut.print(attr.getNodeName()); fOut.print("=\""); normalizeAndPrint(attr.getNodeValue()); fOut.print('"'); } fOut.println('>'); fOut.flush(); Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } break; } case Node.ENTITY_REFERENCE_NODE: { if (fCanonical) { Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } } else { fOut.print('&'); fOut.print(node.getNodeName()); fOut.print(';'); fOut.flush(); } break; } case Node.CDATA_SECTION_NODE: { if (fCanonical) { normalizeAndPrint(node.getNodeValue()); } else { fOut.print("<![CDATA["); fOut.print(node.getNodeValue()); fOut.print("]]>"); } fOut.flush(); break; } case Node.TEXT_NODE: { normalizeAndPrint(node.getNodeValue()); fOut.flush(); break; } case Node.PROCESSING_INSTRUCTION_NODE: { fOut.print("<?"); fOut.print(node.getNodeName()); String data = node.getNodeValue(); if (data != null && data.length() > 0) { fOut.print(' '); fOut.print(data); } fOut.println("?>"); fOut.flush(); break; } } if (type == Node.ELEMENT_NODE) { fOut.print("</"); fOut.print(node.getNodeName()); fOut.print('>'); fOut.flush(); } } // write(Node)
public void write(Node node) { // is there anything to do? if (node == null) { return; } short type = node.getNodeType(); switch (type) { case Node.DOCUMENT_NODE: { Document document = (Document)node; if (!fCanonical) { fOut.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); fOut.flush(); write(document.getDoctype()); } write(document.getDocumentElement()); break; } case Node.DOCUMENT_TYPE_NODE: { DocumentType doctype = (DocumentType)node; fOut.print("<!DOCTYPE "); fOut.print(doctype.getName()); String publicId = doctype.getPublicId(); String systemId = doctype.getSystemId(); if (publicId != null) { fOut.print(" PUBLIC '"); fOut.print(publicId); fOut.print("' '"); fOut.print(systemId); fOut.print('\''); } else { fOut.print(" SYSTEM '"); fOut.print(systemId); fOut.print('\''); } String internalSubset = doctype.getInternalSubset(); if (internalSubset != null) { fOut.println(" ["); fOut.print(internalSubset); fOut.print(']'); } fOut.println('>'); break; } case Node.ELEMENT_NODE: { fOut.print('<'); fOut.print(node.getNodeName()); Attr attrs[] = sortAttributes(node.getAttributes()); for (int i = 0; i < attrs.length; i++) { Attr attr = attrs[i]; fOut.print(' '); fOut.print(attr.getNodeName()); fOut.print("=\""); normalizeAndPrint(attr.getNodeValue()); fOut.print('"'); } fOut.println('>'); fOut.flush(); Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } break; } case Node.ENTITY_REFERENCE_NODE: { if (fCanonical) { Node child = node.getFirstChild(); while (child != null) { write(child); child = child.getNextSibling(); } } else { fOut.print('&'); fOut.print(node.getNodeName()); fOut.print(';'); fOut.flush(); } break; } case Node.CDATA_SECTION_NODE: { if (fCanonical) { normalizeAndPrint(node.getNodeValue()); } else { fOut.print("<![CDATA["); fOut.print(node.getNodeValue()); fOut.print("]]>"); } fOut.flush(); break; } case Node.TEXT_NODE: { normalizeAndPrint(node.getNodeValue()); fOut.flush(); break; } case Node.PROCESSING_INSTRUCTION_NODE: { fOut.print("<?"); fOut.print(node.getNodeName()); String data = node.getNodeValue(); if (data != null && data.length() > 0) { fOut.print(' '); fOut.print(data); } fOut.println("?>"); fOut.flush(); break; } } if (type == Node.ELEMENT_NODE) { fOut.print("</"); fOut.print(node.getNodeName()); fOut.println('>'); fOut.flush(); } } // write(Node)
1,117,168
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { Vector v = new Vector(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } v.add(ei); } } return v; }
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { ArrayList al = new ArrayList(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } v.add(ei); } } return v; }
1,117,169
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { Vector v = new Vector(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } v.add(ei); } } return v; }
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { Vector v = new Vector(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } al.add(ei); } } return v; }
1,117,170
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { Vector v = new Vector(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } v.add(ei); } } return v; }
public Collection getDaysEvents(MyCalendarVO date) throws Throwable { Vector v = new Vector(); CalTimezones tzcache = cal.getTimezones();// Dur oneDay = new Dur(1, 0, 0, 0); long millis = System.currentTimeMillis(); //tzcache.setSysTimezones(cal.getTimezones()); BwDateTime startDt = CalFacadeUtil.getDateTime(date.getDateDigits(), tzcache); BwDateTime endDt = startDt.getNextDay(tzcache); String start = startDt.getDate(); String end = endDt.getDate(); if (debug) { debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); } //if (debug) { // debugMsg("Get days events in range " + start + " to " + end); //} if (events == null) { events = cal.getEvents(null, null, CalFacadeUtil.getDateTime(firstDay.getDateDigits(), tzcache), CalFacadeUtil.getDateTime(lastDay.getTomorrow().getDateDigits(), tzcache), CalFacadeDefs.retrieveRecurExpanded); } Iterator it = events.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); String evStart = ev.getDtstart().getDate(); String evEnd = ev.getDtend().getDate(); /* Event is within range if: 1. (((evStart <= :start) and (evEnd > :start)) or 2. ((evStart >= :start) and (evStart < :end)) or 3. ((evEnd > :start) and (evEnd <= :end))) XXX followed caldav which might be wrong. Try 3. ((evEnd > :start) and (evEnd < :end))) */ int evstSt = evStart.compareTo(start); int evendSt = evEnd.compareTo(start); //debugMsg(" event " + evStart + " to " + evEnd); if (((evstSt <= 0) && (evendSt > 0)) || ((evstSt >= 0) && (evStart.compareTo(end) < 0)) || //((evendSt > 0) && (evEnd.compareTo(end) <= 0))) { ((evendSt > 0) && (evEnd.compareTo(end) < 0))) { // Passed the tests. if (debug) { debugMsg("Event passed range " + start + "-" + end + " with dates " + evStart + "-" + evEnd + ": " + ev.getSummary()); } v.add(ei); } } return al; }
1,117,171
private TimeViewDailyInfo[] getOneWeekTvdi(GtpiData gtpi) throws Throwable { Vector days = new Vector(); TimeViewDailyInfo tvdi; /** First see if we need to insert leading fillers */ int dayOfWeek = gtpi.currentDay.getDayOfWeek(); int dayNum = getFirstDayOfWeek(); if (debug) { debugMsg("dayOfWeek=" + dayOfWeek + " dayNum = " + dayNum); } while (dayNum != dayOfWeek) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); dayNum++; if (debug) { debugMsg("dayNum = " + dayNum); } if (dayNum > 7) { dayNum = 1; } // Check we got this right if (days.size() > 7) { throw new Exception("Programming error in getOneWeekTvdi"); } } for (;;) { dayOfWeek = gtpi.currentDay.getDayOfWeek(); if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; break; } gtpi.isLast = gtpi.last.isSameDate(gtpi.currentDay); /* Create a day entry */ tvdi = new TimeViewDailyInfo(calInfo); initTvdi(tvdi, gtpi); tvdi.setDayEntry(true); tvdi.setFirstDay(gtpi.isFirst); tvdi.setLastDay(gtpi.isLast); tvdi.setDayOfMonth(gtpi.currentDay.getDay()); tvdi.setDayOfWeek(dayOfWeek); /** Is this correct? The days of the week are rotated to adjust for * first day differences. */ tvdi.setDayName(calInfo.getDayName(dayOfWeek)); tvdi.setFirstDayOfMonth(gtpi.newMonth); gtpi.newMonth = false; tvdi.setFirstDayOfWeek(getFirstDayOfWeek() == dayOfWeek); tvdi.setLastDayOfWeek(calInfo.getLastDayOfWeek() == dayOfWeek); days.addElement(tvdi); gtpi.isFirst = false; gtpi.prevTvdi = tvdi; gtpi.currentDay = gtpi.currentDay.getTomorrow(); if (gtpi.isLast || tvdi.isLastDayOfWeek()) { // Watch for it also being the last day of the month if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; } break; } } /** Pad it out to seven days */ while (days.size() < 7) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); } return (TimeViewDailyInfo[])days.toArray(new TimeViewDailyInfo[ days.size()]); }
private TimeViewDailyInfo[] getOneWeekTvdi(GtpiData gtpi) throws Throwable { ArrayList days = new ArrayList(); TimeViewDailyInfo tvdi; /** First see if we need to insert leading fillers */ int dayOfWeek = gtpi.currentDay.getDayOfWeek(); int dayNum = getFirstDayOfWeek(); if (debug) { debugMsg("dayOfWeek=" + dayOfWeek + " dayNum = " + dayNum); } while (dayNum != dayOfWeek) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); dayNum++; if (debug) { debugMsg("dayNum = " + dayNum); } if (dayNum > 7) { dayNum = 1; } // Check we got this right if (days.size() > 7) { throw new Exception("Programming error in getOneWeekTvdi"); } } for (;;) { dayOfWeek = gtpi.currentDay.getDayOfWeek(); if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; break; } gtpi.isLast = gtpi.last.isSameDate(gtpi.currentDay); /* Create a day entry */ tvdi = new TimeViewDailyInfo(calInfo); initTvdi(tvdi, gtpi); tvdi.setDayEntry(true); tvdi.setFirstDay(gtpi.isFirst); tvdi.setLastDay(gtpi.isLast); tvdi.setDayOfMonth(gtpi.currentDay.getDay()); tvdi.setDayOfWeek(dayOfWeek); /** Is this correct? The days of the week are rotated to adjust for * first day differences. */ tvdi.setDayName(calInfo.getDayName(dayOfWeek)); tvdi.setFirstDayOfMonth(gtpi.newMonth); gtpi.newMonth = false; tvdi.setFirstDayOfWeek(getFirstDayOfWeek() == dayOfWeek); tvdi.setLastDayOfWeek(calInfo.getLastDayOfWeek() == dayOfWeek); days.addElement(tvdi); gtpi.isFirst = false; gtpi.prevTvdi = tvdi; gtpi.currentDay = gtpi.currentDay.getTomorrow(); if (gtpi.isLast || tvdi.isLastDayOfWeek()) { // Watch for it also being the last day of the month if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; } break; } } /** Pad it out to seven days */ while (days.size() < 7) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); } return (TimeViewDailyInfo[])days.toArray(new TimeViewDailyInfo[ days.size()]); }
1,117,172
private TimeViewDailyInfo[] getOneWeekTvdi(GtpiData gtpi) throws Throwable { Vector days = new Vector(); TimeViewDailyInfo tvdi; /** First see if we need to insert leading fillers */ int dayOfWeek = gtpi.currentDay.getDayOfWeek(); int dayNum = getFirstDayOfWeek(); if (debug) { debugMsg("dayOfWeek=" + dayOfWeek + " dayNum = " + dayNum); } while (dayNum != dayOfWeek) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); dayNum++; if (debug) { debugMsg("dayNum = " + dayNum); } if (dayNum > 7) { dayNum = 1; } // Check we got this right if (days.size() > 7) { throw new Exception("Programming error in getOneWeekTvdi"); } } for (;;) { dayOfWeek = gtpi.currentDay.getDayOfWeek(); if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; break; } gtpi.isLast = gtpi.last.isSameDate(gtpi.currentDay); /* Create a day entry */ tvdi = new TimeViewDailyInfo(calInfo); initTvdi(tvdi, gtpi); tvdi.setDayEntry(true); tvdi.setFirstDay(gtpi.isFirst); tvdi.setLastDay(gtpi.isLast); tvdi.setDayOfMonth(gtpi.currentDay.getDay()); tvdi.setDayOfWeek(dayOfWeek); /** Is this correct? The days of the week are rotated to adjust for * first day differences. */ tvdi.setDayName(calInfo.getDayName(dayOfWeek)); tvdi.setFirstDayOfMonth(gtpi.newMonth); gtpi.newMonth = false; tvdi.setFirstDayOfWeek(getFirstDayOfWeek() == dayOfWeek); tvdi.setLastDayOfWeek(calInfo.getLastDayOfWeek() == dayOfWeek); days.addElement(tvdi); gtpi.isFirst = false; gtpi.prevTvdi = tvdi; gtpi.currentDay = gtpi.currentDay.getTomorrow(); if (gtpi.isLast || tvdi.isLastDayOfWeek()) { // Watch for it also being the last day of the month if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; } break; } } /** Pad it out to seven days */ while (days.size() < 7) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.addElement(tvdi); } return (TimeViewDailyInfo[])days.toArray(new TimeViewDailyInfo[ days.size()]); }
private TimeViewDailyInfo[] getOneWeekTvdi(GtpiData gtpi) throws Throwable { Vector days = new Vector(); TimeViewDailyInfo tvdi; /** First see if we need to insert leading fillers */ int dayOfWeek = gtpi.currentDay.getDayOfWeek(); int dayNum = getFirstDayOfWeek(); if (debug) { debugMsg("dayOfWeek=" + dayOfWeek + " dayNum = " + dayNum); } while (dayNum != dayOfWeek) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.add(tvdi); dayNum++; if (debug) { debugMsg("dayNum = " + dayNum); } if (dayNum > 7) { dayNum = 1; } // Check we got this right if (days.size() > 7) { throw new Exception("Programming error in getOneWeekTvdi"); } } for (;;) { dayOfWeek = gtpi.currentDay.getDayOfWeek(); if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; break; } gtpi.isLast = gtpi.last.isSameDate(gtpi.currentDay); /* Create a day entry */ tvdi = new TimeViewDailyInfo(calInfo); initTvdi(tvdi, gtpi); tvdi.setDayEntry(true); tvdi.setFirstDay(gtpi.isFirst); tvdi.setLastDay(gtpi.isLast); tvdi.setDayOfMonth(gtpi.currentDay.getDay()); tvdi.setDayOfWeek(dayOfWeek); /** Is this correct? The days of the week are rotated to adjust for * first day differences. */ tvdi.setDayName(calInfo.getDayName(dayOfWeek)); tvdi.setFirstDayOfMonth(gtpi.newMonth); gtpi.newMonth = false; tvdi.setFirstDayOfWeek(getFirstDayOfWeek() == dayOfWeek); tvdi.setLastDayOfWeek(calInfo.getLastDayOfWeek() == dayOfWeek); days.add(tvdi); gtpi.isFirst = false; gtpi.prevTvdi = tvdi; gtpi.currentDay = gtpi.currentDay.getTomorrow(); if (gtpi.isLast || tvdi.isLastDayOfWeek()) { // Watch for it also being the last day of the month if (gtpi.currentDay.getMonth() != gtpi.curMonth) { gtpi.newMonth = true; } break; } } /** Pad it out to seven days */ while (days.size() < 7) { tvdi = new TimeViewDailyInfo(calInfo); tvdi.setFiller(true); days.add(tvdi); } return (TimeViewDailyInfo[])days.toArray(new TimeViewDailyInfo[ days.size()]); }
1,117,173
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
1,117,174
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.add(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
1,117,175
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.add(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
1,117,176
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new Vector(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new Vector(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
public TimeViewDailyInfo[] getTimePeriodInfo() { /* In the following code we assume that we never cross year boundaries so that the year is always constant. */ if (tvdis != null) { return tvdis; } try { GtpiData gtpi = new GtpiData(); Vector months = new Vector(); Vector weeks = new ArrayList(); gtpi.first = getFirstDay(); gtpi.last = getLastDay(); gtpi.multi = !gtpi.last.isSameDate(gtpi.first); gtpi.currentDay = new MyCalendarVO(gtpi.first.getTime(), calInfo.getLocale()); gtpi.year = String.valueOf(gtpi.currentDay.getYear()); Locale loc = Locale.getDefault(); // XXX Locale gtpi.todaysMonth = new MyCalendarVO( // XXX Expensive?? new Date(System.currentTimeMillis()), loc).getTwoDigitMonth(); if (debug) { debugMsg("getFirstDayOfWeek() = " + getFirstDayOfWeek()); debugMsg("gtpi.first.getFirstDayOfWeek() = " + calInfo.getFirstDayOfWeek()); } initGtpiForMonth(gtpi); /* Our month entry */ TimeViewDailyInfo monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); /* Create a year entry */ TimeViewDailyInfo yearTvdi = new TimeViewDailyInfo(calInfo); yearTvdi.setCal(gtpi.currentDay); yearTvdi.setYear(gtpi.year); yearTvdi.setDate(gtpi.currentDay.getDateDigits()); yearTvdi.setDateShort(gtpi.currentDay.getDateString()); yearTvdi.setDateLong(gtpi.currentDay.getLongDateString()); for (;;) { TimeViewDailyInfo weekTvdi = new TimeViewDailyInfo(calInfo); initTvdi(weekTvdi, gtpi); weekTvdi.setEntries(getOneWeekTvdi(gtpi)); weeks.addElement(weekTvdi); if (getFirstDayOfWeek() == gtpi.currentDay.getDayOfWeek()) { gtpi.weekOfYear++; } if (gtpi.isLast || gtpi.newMonth) { /** First add all the weeks to this month */ if (gtpi.prevTvdi != null) { gtpi.prevTvdi.setLastDayOfMonth(true); } monthTvdi.setEntries( (TimeViewDailyInfo[])weeks.toArray(new TimeViewDailyInfo[ weeks.size()])); months.addElement(monthTvdi); if (gtpi.isLast) { break; } /** Set up for a new month. */ initGtpiForMonth(gtpi); monthTvdi = new TimeViewDailyInfo(calInfo); initTvdi(monthTvdi, gtpi); weeks = new ArrayList(); } } yearTvdi.setEntries( (TimeViewDailyInfo[])months.toArray(new TimeViewDailyInfo[months.size()])); tvdis = new TimeViewDailyInfo[1]; tvdis[0] = yearTvdi; return tvdis; } catch (Throwable t) { Logger.getLogger(this.getClass()).error("getTimePeriodInfo", t); //XXX We need an error object return null; } }
1,117,177
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } return getDateTime(dt, dateOnly, UTC, timezones); }
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } return getDateTime(dt, dateOnly, UTC, timezones); }
1,117,178
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } return getDateTime(dt, dateOnly, UTC, timezones); }
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } return getDateTime(dt, dateOnly, UTC, timezones); }
1,117,179
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } return getDateTime(dt, dateOnly, UTC, timezones); }
public static BwDateTime getDateTime(String val, CalTimezones timezones) throws CalFacadeException { Date dt; boolean UTC = false; boolean dateOnly = false; try { dt = fromISODateTimeUTC(val); UTC = true; } catch (CalFacadeBadDateException bde1) { try { dt = fromISODateTime(val); } catch (CalFacadeBadDateException bde2) { try { dt = fromISODate(val); dateOnly = true; } catch (CalFacadeException ce) { throw ce; } catch (Throwable t) { throw new CalFacadeException(t); } } } catch (Throwable t) { throw new CalFacadeException(t); } dtm.init(dateOnly, date, timezones.getDefaultTimeZoneId(), timezones); return dtm; }
1,117,180
public abstract Collection getEvents(BwSubscription sub, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException;
public abstract Collection getEvents(BwSubscription sub, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException;
1,117,181
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
1,117,182
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
1,117,183
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { CalSvcI svci = form.fetchSvci(); String name = getReqPar(request, "subname"); if (name != null) { BwSubscription sub = svci.findSubscription(name); if (sub == null) { form.getErr().emit("org.bedework.client.error.unknownsubscription"); return "notFound"; } Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeSubscription); return "success"; } String url = getReqPar(request, "calUrl"); if (url != null) { BwCalendar cal = findCalendar(url, form); if (cal == null) { form.getErr().emit("org.bedework.client.error.unknowncalendar"); return "notFound"; } BwSubscription sub = BwSubscription.makeSubscription(cal); Collection c = new Vector(); c.add(sub); svci.setCurrentSubscriptions(c); form.setSelectionType(BedeworkDefs.selectionTypeCalendar); return "success"; } name = getReqPar(request, "viewName"); if (name == null) { name = svci.getUserPrefs().getPreferredView(); } if (name == null) { form.getErr().emit("org.bedework.client.error.nodefaultview"); return "noViewDef"; } if (!svci.setCurrentView(name)) { form.getErr().emit("org.bedework.client.error.unknownview"); return "noViewDef"; } form.refreshIsNeeded(); return "success"; }
1,117,184
private static NATObject createGlobalLexicalScope() { return new NATObject(OBJLexicalRoot._INSTANCE_); }
private static NATObject createGlobalLexicalScope() { return new NATIsolate(OBJLexicalRoot._INSTANCE_); }
1,117,185
public Events(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { super(cal, access, currentMode, ignoreCreator, debug); }
public Events(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, boolean debug) { super(cal, access, currentMode, ignoreCreator, debug); }
1,117,186
public Collection getEvents(BwCalendar calendar, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException { HibSession sess = getSess(); StringBuffer sb = new StringBuffer(); if (debug) { trace("getEvents for start=" + startDate + " end=" + endDate); } /* Name of the event in the query */ final String qevName = "ev"; Filters flt = new Filters(filter, sb, qevName, debug); /* SEG: from Events ev where */ sb.append("from "); sb.append(BwEvent.class.getName()); sb.append(" "); sb.append(qevName); sb.append(" where "); /* SEG: (<date-ranges>) and */ if (appendDateTerms(sb, qevName + ".dtstart.date", qevName + ".dtend.date", startDate, endDate)) { sb.append(" and "); } /* Don't retrieve any master records - I guess we might have a choice to retrieve any with the dates in the given range */ sb.append(qevName); sb.append(".recurring = false and "); /* SEG ( */ sb.append(" ("); boolean setUser = doCalendarClause(sb, qevName, calendar, currentMode, ignoreCreator); sb.append(") "); flt.addWhereFilters(); sb.append(" order by "); sb.append(qevName); sb.append(".dtstart.dtval"); //if (debug) { // trace(sb.toString()); //} sess.createQuery(sb.toString()); /* XXX Limit result set size - pagination allows something like: query.setFirstResult(0); query.setMaxResults(10); */ if (startDate != null) { sess.setString("fromDate", startDate.getDate()); } if (endDate != null) { sess.setString("toDate", endDate.getDate()); } doCalendarEntities(setUser, calendar); flt.parPass(sess); if (debug) { trace(sess.getQueryString()); } Collection es = sess.getList(); if (debug) { trace("Found " + es.size() + " events"); } es = postGetEvents(es, privRead, noAccessReturnsNull); /** Run the events we got through the filters */ es = flt.postExec(es); Collection rs = getLimitedRecurrences(calendar, filter, startDate, endDate, currentMode, ignoreCreator, recurRetrieval); if (rs != null) { es.addAll(rs); } return es; }
public Collection getEvents(BwCalendar calendar, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException { HibSession sess = getSess(); StringBuffer sb = new StringBuffer(); if (debug) { trace("getEvents for start=" + startDate + " end=" + endDate); } /* Name of the event in the query */ final String qevName = "ev"; Filters flt = new Filters(filter, sb, qevName, debug); /* SEG: from Events ev where */ sb.append("from "); sb.append(BwEvent.class.getName()); sb.append(" "); sb.append(qevName); sb.append(" where "); /* SEG: (<date-ranges>) and */ if (appendDateTerms(sb, qevName + ".dtstart.date", qevName + ".dtend.date", startDate, endDate)) { sb.append(" and "); } /* Don't retrieve any master records - I guess we might have a choice to retrieve any with the dates in the given range */ sb.append(qevName); sb.append(".recurring = false and "); /* SEG ( */ sb.append(" ("); boolean setUser = doCalendarClause(sb, qevName, calendar, currentMode, cal.getSuperUser()); sb.append(") "); flt.addWhereFilters(); sb.append(" order by "); sb.append(qevName); sb.append(".dtstart.dtval"); //if (debug) { // trace(sb.toString()); //} sess.createQuery(sb.toString()); /* XXX Limit result set size - pagination allows something like: query.setFirstResult(0); query.setMaxResults(10); */ if (startDate != null) { sess.setString("fromDate", startDate.getDate()); } if (endDate != null) { sess.setString("toDate", endDate.getDate()); } doCalendarEntities(setUser, calendar); flt.parPass(sess); if (debug) { trace(sess.getQueryString()); } Collection es = sess.getList(); if (debug) { trace("Found " + es.size() + " events"); } es = postGetEvents(es, privRead, noAccessReturnsNull); /** Run the events we got through the filters */ es = flt.postExec(es); Collection rs = getLimitedRecurrences(calendar, filter, startDate, endDate, currentMode, ignoreCreator, recurRetrieval); if (rs != null) { es.addAll(rs); } return es; }
1,117,187
public Collection getEvents(BwCalendar calendar, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException { HibSession sess = getSess(); StringBuffer sb = new StringBuffer(); if (debug) { trace("getEvents for start=" + startDate + " end=" + endDate); } /* Name of the event in the query */ final String qevName = "ev"; Filters flt = new Filters(filter, sb, qevName, debug); /* SEG: from Events ev where */ sb.append("from "); sb.append(BwEvent.class.getName()); sb.append(" "); sb.append(qevName); sb.append(" where "); /* SEG: (<date-ranges>) and */ if (appendDateTerms(sb, qevName + ".dtstart.date", qevName + ".dtend.date", startDate, endDate)) { sb.append(" and "); } /* Don't retrieve any master records - I guess we might have a choice to retrieve any with the dates in the given range */ sb.append(qevName); sb.append(".recurring = false and "); /* SEG ( */ sb.append(" ("); boolean setUser = doCalendarClause(sb, qevName, calendar, currentMode, ignoreCreator); sb.append(") "); flt.addWhereFilters(); sb.append(" order by "); sb.append(qevName); sb.append(".dtstart.dtval"); //if (debug) { // trace(sb.toString()); //} sess.createQuery(sb.toString()); /* XXX Limit result set size - pagination allows something like: query.setFirstResult(0); query.setMaxResults(10); */ if (startDate != null) { sess.setString("fromDate", startDate.getDate()); } if (endDate != null) { sess.setString("toDate", endDate.getDate()); } doCalendarEntities(setUser, calendar); flt.parPass(sess); if (debug) { trace(sess.getQueryString()); } Collection es = sess.getList(); if (debug) { trace("Found " + es.size() + " events"); } es = postGetEvents(es, privRead, noAccessReturnsNull); /** Run the events we got through the filters */ es = flt.postExec(es); Collection rs = getLimitedRecurrences(calendar, filter, startDate, endDate, currentMode, ignoreCreator, recurRetrieval); if (rs != null) { es.addAll(rs); } return es; }
public Collection getEvents(BwCalendar calendar, BwFilter filter, BwDateTime startDate, BwDateTime endDate, int recurRetrieval) throws CalFacadeException { HibSession sess = getSess(); StringBuffer sb = new StringBuffer(); if (debug) { trace("getEvents for start=" + startDate + " end=" + endDate); } /* Name of the event in the query */ final String qevName = "ev"; Filters flt = new Filters(filter, sb, qevName, debug); /* SEG: from Events ev where */ sb.append("from "); sb.append(BwEvent.class.getName()); sb.append(" "); sb.append(qevName); sb.append(" where "); /* SEG: (<date-ranges>) and */ if (appendDateTerms(sb, qevName + ".dtstart.date", qevName + ".dtend.date", startDate, endDate)) { sb.append(" and "); } /* Don't retrieve any master records - I guess we might have a choice to retrieve any with the dates in the given range */ sb.append(qevName); sb.append(".recurring = false and "); /* SEG ( */ sb.append(" ("); boolean setUser = doCalendarClause(sb, qevName, calendar, currentMode, ignoreCreator); sb.append(") "); flt.addWhereFilters(); sb.append(" order by "); sb.append(qevName); sb.append(".dtstart.dtval"); //if (debug) { // trace(sb.toString()); //} sess.createQuery(sb.toString()); /* XXX Limit result set size - pagination allows something like: query.setFirstResult(0); query.setMaxResults(10); */ if (startDate != null) { sess.setString("fromDate", startDate.getDate()); } if (endDate != null) { sess.setString("toDate", endDate.getDate()); } doCalendarEntities(setUser, calendar); flt.parPass(sess); if (debug) { trace(sess.getQueryString()); } Collection es = sess.getList(); if (debug) { trace("Found " + es.size() + " events"); } es = postGetEvents(es, privRead, noAccessReturnsNull); /** Run the events we got through the filters */ es = flt.postExec(es); Collection rs = getLimitedRecurrences(calendar, filter, startDate, endDate, currentMode, cal.getSuperUser(), recurRetrieval); if (rs != null) { es.addAll(rs); } return es; }
1,117,188
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = getMapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
1,117,189
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), DEFAULT_SCALE, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
1,117,190
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
1,117,191
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
public OpenMap(EventTableModel etm, ListSelectionModel lsm){ try{ mapHandler = new MapHandler(); mapHandler.add(this); // Create a MapBean mapBean = new MapBean(); //get the projection and set its background color and center point Proj proj = new CADRG(new LatLonPoint(mapBean.DEFAULT_CENTER_LAT, mapBean.DEFAULT_CENTER_LON), 200000000f, mapBean.DEFAULT_WIDTH, mapBean.DEFAULT_HEIGHT); proj.setBackgroundColor(WATER); mapBean.setProjection(proj); mapBean.setCenter(20, 200); mapHandler.add(mapBean); // Create and add a LayerHandler to the MapHandler. The // LayerHandler manages Layers, whether they are part of the // map or not. layer.setVisible(true) will add it to the map. // The LayerHandler has methods to do this, too. The // LayerHandler will find the MapBean in the MapHandler. lh = new LayerHandler(); mapHandler.add(lh); if(etm != null){ EventLayer el = new EventLayer(etm, lsm, mapBean); mapHandler.add(el); lh.addLayer(el, 1); } // Create a ShapeLayer to show world political boundaries. ShapeLayer shapeLayer = new ShapeLayer(); //Create shape layer properties Properties shapeLayerProps = new Properties(); shapeLayerProps.put("prettyName", "Political Solid"); shapeLayerProps.put("lineColor", "000000"); shapeLayerProps.put("fillColor", "39DA87"); shapeLayerProps.put("shapeFile", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.shp"); shapeLayerProps.put("spatialIndex", "edu/sc/seis/fissuresUtil/data/maps/dcwpo-browse.ssx"); shapeLayer.setProperties(shapeLayerProps); shapeLayer.setVisible(true); mapHandler.add(shapeLayer); // Create the directional and zoom control tool OMToolSet omts = new OMToolSet(); // Create an OpenMap toolbar ToolPanel toolBar = new ToolPanel(); // Add the ToolPanel and the OMToolSet to the MapHandler. The // OpenMapFrame will find the ToolPanel and attach it to the // top part of its content pane, and the ToolPanel will find // the OMToolSet and add it to itself. mapHandler.add(omts); mapHandler.add(toolBar); mapHandler.add(new MouseDelegator()); mapHandler.add(new SelectMouseMode()); mapHandler.add(new InformationDelegator()); } catch (MultipleSoloMapComponentException msmce) { // The MapHandler is only allowed to have one of certain // items. These items implement the SoloMapComponent // interface. The MapHandler can have a policy that // determines what to do when duplicate instances of the // same type of object are added - replace or ignore. // In this class, this will never happen, since we are // controlling that one MapBean, LayerHandler, // MouseDelegator, etc is being added to the MapHandler. } }
1,117,193
public ATBegin base_getBodyExpression() { return new AGBegin(new NATTable(new ATObject[] { AGSymbol.alloc("Native anonymous implementation in " + creatorClass_.getName())})); }
public ATBegin base_getBodyExpression() { return new AGBegin(new NATTable(new ATObject[] { AGSymbol.jAlloc("Native anonymous implementation in " + creatorClass_.getName())})); }
1,117,194
int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser);
int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser);
1,117,195
public DateMidnight(int year, int monthOfYear, int dayOfMonth, Chronology chronology) { super(year, monthOfYear, dayOfMonth, 0, 0, 0, 0, chronology); }
public DateMidnight(int year, int monthOfYear, int dayOfMonth, Chronology chronology) { super(year, monthOfYear, dayOfMonth, 0, 0, 0, 0, chronology); }
1,117,196
protected void debugMsg(String pname, String ptype, String pval) { debugOut("Error emitted: property=" + pname + " ptype=" + ptype + " val(s)=" + pval); }
protected void debugMsg(String pname, String ptype, String pval) { debugOut("Emitted: property=" + pname + " ptype=" + ptype + " val(s)=" + pval); }
1,117,197
FilterPanel( SortedSet tags, DataDictionary dataDictionary ) { setLayout( new FlowLayout() ); enablePanel( false ); checkBox.setPreferredSize( new Dimension(25, 25) ); add( checkBox ); comboBox.setPreferredSize( new Dimension(200, 25) ); add( comboBox ); operatorComboBox.setPreferredSize( new Dimension(50, 25) ); add( operatorComboBox ); textField.setPreferredSize( new Dimension(300, 25) ); add( textField ); add( new JLabel() ); TreeSet sortedTags = new TreeSet(tags); Iterator i = sortedTags.iterator(); while( i.hasNext() ) { comboBox.addItem( new ComboBoxItem((Integer)i.next(), dataDictionary )); } checkBox.addChangeListener( this ); }
FilterPanel( SortedSet tags, DataDictionary dataDictionary ) { setLayout( new FlowLayout() ); enablePanel( false ); checkBox.setPreferredSize( new Dimension(25, 25) ); add( checkBox ); comboBox.setPreferredSize( new Dimension(200, 25) ); add( comboBox ); operatorComboBox.setPreferredSize( new Dimension(50, 25) ); add( operatorComboBox ); textField.setPreferredSize( new Dimension(275, 25) ); add( textField ); add( new JLabel() ); TreeSet sortedTags = new TreeSet(tags); Iterator i = sortedTags.iterator(); while( i.hasNext() ) { comboBox.addItem( new ComboBoxItem((Integer)i.next(), dataDictionary )); } checkBox.addChangeListener( this ); }
1,117,198
public void testUnknownDasChannelCreation() { DASChannelCreator creator = new DASChannelCreator(NCReaderTest.net, new SamplingFinder() { public int find(String file, TimeRange fileTimeWindow) throws RT130FormatException, IOException { return 40; } }); MicroSecondDate now = new MicroSecondDate(); Channel[] chans = creator.create("1337", now, "1/00331133", new TimeRange()); assertEquals(3, chans.length); assertEquals("1337", chans[0].my_site.my_station.get_code()); // We assume that the channels are BH[ZNE] assertEquals("BHZ", chans[0].get_code()); Channel[] newChans = creator.create("1337", now.subtract(new TimeInterval(1, UnitImpl.MINUTE)), "1/00331133", new TimeRange()); // Dummy DAS channels just expand to fill whatever time is requsted of // that das for(int i = 0; i < newChans.length; i++) { assertEquals(chans[i], newChans[i]); } }
public void testUnknownDasChannelCreation() { DASChannelCreator creator = new DASChannelCreator(NCReaderTest.net, new SamplingFinder() { public int find(String file, MicroSecondTimeRange fileTimeWindow) throws RT130FormatException, IOException { return 40; } }); MicroSecondDate now = new MicroSecondDate(); Channel[] chans = creator.create("1337", now, "1/00331133", new TimeRange()); assertEquals(3, chans.length); assertEquals("1337", chans[0].my_site.my_station.get_code()); // We assume that the channels are BH[ZNE] assertEquals("BHZ", chans[0].get_code()); Channel[] newChans = creator.create("1337", now.subtract(new TimeInterval(1, UnitImpl.MINUTE)), "1/00331133", new TimeRange()); // Dummy DAS channels just expand to fill whatever time is requsted of // that das for(int i = 0; i < newChans.length; i++) { assertEquals(chans[i], newChans[i]); } }
1,117,199
public void testUnknownDasChannelCreation() { DASChannelCreator creator = new DASChannelCreator(NCReaderTest.net, new SamplingFinder() { public int find(String file, TimeRange fileTimeWindow) throws RT130FormatException, IOException { return 40; } }); MicroSecondDate now = new MicroSecondDate(); Channel[] chans = creator.create("1337", now, "1/00331133", new TimeRange()); assertEquals(3, chans.length); assertEquals("1337", chans[0].my_site.my_station.get_code()); // We assume that the channels are BH[ZNE] assertEquals("BHZ", chans[0].get_code()); Channel[] newChans = creator.create("1337", now.subtract(new TimeInterval(1, UnitImpl.MINUTE)), "1/00331133", new TimeRange()); // Dummy DAS channels just expand to fill whatever time is requsted of // that das for(int i = 0; i < newChans.length; i++) { assertEquals(chans[i], newChans[i]); } }
public void testUnknownDasChannelCreation() { DASChannelCreator creator = new DASChannelCreator(NCReaderTest.net, new SamplingFinder() { public int find(String file, TimeRange fileTimeWindow) throws RT130FormatException, IOException { return 40; } }); MicroSecondDate now = new MicroSecondDate(); Channel[] chans = creator.create("1337", "1/00331133", new TimeRange()); assertEquals(3, chans.length); assertEquals("1337", chans[0].my_site.my_station.get_code()); // We assume that the channels are BH[ZNE] assertEquals("BHZ", chans[0].get_code()); Channel[] newChans = creator.create("1337", now.subtract(new TimeInterval(1, UnitImpl.MINUTE)), "1/00331133", new TimeRange()); // Dummy DAS channels just expand to fill whatever time is requsted of // that das for(int i = 0; i < newChans.length; i++) { assertEquals(chans[i], newChans[i]); } }
1,117,200