static { _jspx_dependants = new java.util.ArrayList(4); _jspx_dependants.add("/inc/sharedFunctions.jsp"); _jspx_dependants.add("/inc/header.jsp"); _jspx_dependants.add("/inc/login_form.jsp"); _jspx_dependants.add("/inc/footer.jsp"); }
/** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[11]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 3; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1 << j)) != 0) { la1tokens[j] = true; } } } } for (int i = 0; i < 11; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; jj_expentries.add(jj_expentry); } } jj_endpos = 0; jj_rescan_token(); jj_add_error_token(0, 0); int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { exptokseq[i] = jj_expentries.get(i); } return new ParseException(token, exptokseq, tokenImage); }
private void jj_add_error_token(int kind, int pos) { if (pos >= 100) return; if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; } else if (jj_endpos != 0) { jj_expentry = new int[jj_endpos]; for (int i = 0; i < jj_endpos; i++) { jj_expentry[i] = jj_lasttokens[i]; } jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext(); ) { int[] oldentry = (int[]) (it.next()); if (oldentry.length == jj_expentry.length) { for (int i = 0; i < jj_expentry.length; i++) { if (oldentry[i] != jj_expentry[i]) { continue jj_entries_loop; } } jj_expentries.add(jj_expentry); break jj_entries_loop; } } if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; } }
private int setDataDescriptors(java.util.List<DdsBean> beanList, DataDescriptor dds, int seqno) { for (DataDescriptor key : dds.getSubKeys()) { beanList.add(new DdsBean(key, seqno++)); if (key.getSubKeys() != null) seqno = setDataDescriptors(beanList, key, seqno); } return seqno; }
/* return status codes for account/device */ public static int[] getStatusCodes(String accountID, String deviceID) throws DBException { /* account-id specified? */ if (StringTools.isBlank(accountID)) { return new int[0]; } /* device-id specified? */ if (StringTools.isBlank(deviceID)) { deviceID = ALL_DEVICES; } /* select */ // DBSelect: SELECT statucCode FROM StatusCode WHERE (accountID='acct') AND (deviceID='*') ORDER // BY statucCode DBSelect<StatusCode> dsel = new DBSelect<StatusCode>(StatusCode.getFactory()); dsel.setSelectedFields(StatusCode.FLD_statusCode); DBWhere dwh = dsel.createDBWhere(); dsel.setWhere( dwh.WHERE_( dwh.AND( dwh.EQ(StatusCode.FLD_accountID, accountID), dwh.EQ(StatusCode.FLD_deviceID, deviceID)))); dsel.setOrderByFields(StatusCode.FLD_statusCode); /* get list */ java.util.List<Integer> codeList = new Vector<Integer>(); Statement stmt = null; ResultSet rs = null; try { stmt = DBConnection.getDefaultConnection().execute(dsel.toString()); rs = stmt.getResultSet(); while (rs.next()) { int code = rs.getInt(StatusCode.FLD_statusCode); codeList.add(new Integer(code)); } } catch (SQLException sqe) { throw new DBException("Getting StatusCode List", sqe); } finally { if (rs != null) { try { rs.close(); } catch (Throwable t) { } } if (stmt != null) { try { stmt.close(); } catch (Throwable t) { } } } /* return array of status codes */ int codeListInt[] = new int[codeList.size()]; for (int i = 0; i < codeListInt.length; i++) { codeListInt[i] = codeList.get(i).intValue(); } return codeListInt; }
public static void drawImage(int[][][] pixels, int startX, int startY) { // Key idea: draw a bunch (lots of rectangles) with the appropriate color DrawObject R = new DrawObject(); R.pixels = pixels; R.startX = startX; R.startY = startY; R.sequenceNum = currentSequenceNum; images.add(R); // Rescale if needed. int leftX = startX; int rightX = startX + pixels.length; int lowY = startY; int highY = startY + pixels[0].length; if (minX > leftX) { minX = leftX; } if (maxX < rightX) { maxX = rightX; } if (minY > lowY) { minY = lowY; } if (maxY < highY) { maxY = highY; } drawArea.repaint(); }
/** * ** Gets a list of all the argument key names ** @return a list of all the argument key names */ public java.util.List<String> getArgNames() { java.util.List<String> knList = new Vector<String>(); for (KeyVal kv : this.getKeyValList()) { knList.add(kv.getKey()); } return knList; }
static void handleMouseDragged(MouseEvent e) { DrawObject L = new DrawObject(); L.scribbleX = e.getX(); L.scribbleY = e.getY(); L.scribbleNum = currentScribbleNum; scribbles.add(L); drawArea.repaint(); }
public static void drawPoint(double x, double y) { DrawObject p = new DrawObject(); p.color = pointColor; p.x = x; p.y = y; p.diameter = pointDiameter; p.sequenceNum = currentSequenceNum; if (animationMode) { synchronized (animPoints) { animPoints.add(p); } } else { synchronized (points) { points.add(p); } } drawArea.repaint(); }
public static void drawLabel(double x, double y, String str) { DrawObject L = new DrawObject(); L.color = labelColor; L.x = x; L.y = y; L.str = str; L.sequenceNum = currentSequenceNum; if (animationMode) { synchronized (animLabels) { animLabels.add(L); } } else { synchronized (labels) { labels.add(L); } } drawArea.repaint(); }
public static void drawRectangle(double x1, double y1, double width, double height) { DrawObject R = new DrawObject(); R.color = rectangleColor; R.x = x1; R.y = y1; R.width = width; R.height = height; R.sequenceNum = currentSequenceNum; R.drawStroke = drawStroke; if (animationMode) { synchronized (animRectangles) { animRectangles.add(R); } } else { synchronized (rectangles) { rectangles.add(R); } } drawArea.repaint(); }
public static String GetPropertyString_OBDII(long dtcFault[]) { if (ListTools.isEmpty(dtcFault)) { return GetPropertyString_OBDII(""); } else { java.util.List<String> dtc = new Vector<String>(); for (int i = 0; i < dtcFault.length; i++) { if (dtcFault[i] != 0L) { dtc.add(GetFaultString(dtcFault[i])); } } return GetPropertyString_OBDII(dtc); } }
public static void drawLineFromEquation(double a, double b, double c) { // Draw the equation ax+by+c=0 in the available range. DrawObject L = new DrawObject(); L.color = lineEqnColor; L.a = a; L.b = b; L.c = c; L.sequenceNum = currentSequenceNum; L.drawStroke = drawStroke; synchronized (eqnLines) { eqnLines.add(L); } drawArea.repaint(); }
/** Concatenate params for URL string */ String concatParams(Properties props) { if (props == null) { return null; } java.util.List list = new ArrayList(); for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) { String key = (String) iter.next(); String val = props.getProperty(key); if (!StringUtil.isNullString(val)) { list.add(key + "=" + urlEncode(val)); } } return StringUtil.separatedString(list, "&"); }
/* return list of all Devices within the specified DeviceGroup (NOT SCALABLE BEYOND A FEW HUNDRED GROUPS) */ public static java.util.List<String> getUsersForGroup(String acctId, String groupId) throws DBException { /* valid account/groupId? */ if (StringTools.isBlank(acctId)) { return null; } else if (StringTools.isBlank(groupId)) { return null; } /* get db selector */ DBSelect dsel = GroupList._getUserListSelect(acctId, groupId); if (dsel == null) { return null; } /* read users for group */ java.util.List<String> usrList = new Vector<String>(); DBConnection dbc = null; Statement stmt = null; ResultSet rs = null; try { dbc = DBConnection.getDefaultConnection(); stmt = dbc.execute(dsel.toString()); rs = stmt.getResultSet(); while (rs.next()) { String usrId = rs.getString(GroupList.FLD_userID); usrList.add(usrId); } } catch (SQLException sqe) { throw new DBException("Get Group GroupeList", sqe); } finally { if (rs != null) { try { rs.close(); } catch (Throwable t) { } } if (stmt != null) { try { stmt.close(); } catch (Throwable t) { } } DBConnection.release(dbc); } /* return list */ return usrList; }
public static void drawLine(double x1, double y1, double x2, double y2, boolean isArrow) { DrawObject L = new DrawObject(); L.color = lineColor; L.x = x1; L.y = y1; L.x2 = x2; L.y2 = y2; if (isArrow) { L.color = arrowColor; L.isArrow = true; } L.sequenceNum = currentSequenceNum; L.drawStroke = drawStroke; if (animationMode) { synchronized (animLines) { animLines.add(L); } } else { synchronized (lines) { lines.add(L); } } drawArea.repaint(); }
public void setBufrFile(RandomAccessFile raf) throws IOException { this.raf = raf; java.util.List<MessageBean> beanList = new ArrayList<MessageBean>(); scan = new MessageScanner(raf); while (scan.hasNext()) { Message m = scan.next(); if (m == null) continue; beanList.add(new MessageBean(m)); } messageTable.setBeans(beanList); obsTable.setBeans(new ArrayList()); ddsTable.setBeans(new ArrayList()); }
String[] getContactList() { java.util.List cl = new java.util.LinkedList(); StringTokenizer st = new StringTokenizer(contactList.getText()); StringBuffer sb = new StringBuffer(); StringBuffer dbg = new StringBuffer("test applet contactlist: "); while (st.hasMoreTokens()) { String loginId = st.nextToken().trim(); if (loginId.length() == 0) continue; dbg.append("'" + loginId + "' "); cl.add(loginId); sb.append(loginId).append('\n'); } CAT.info(dbg.toString()); contactList.setText(sb.toString()); return (String[]) cl.toArray(new String[cl.size()]); }
private void readInventoryFromFile() { try { Scanner scan = new Scanner(new File("inventory.txt")); while (scan.hasNext()) { scan.useDelimiter(", "); String id = scan.next().trim(); String title = scan.next().trim(); scan.useDelimiter("\n"); double price = Double.parseDouble(scan.next().replace(",", "").trim()); Book book = new Book(id, title, price); inventory.add(book); } } catch (FileNotFoundException e) { System.out.println("DEBUG: -----Start-----\n" + e + "DEBUG: ------End------\n"); } }
private void setObs(Message m) { java.util.List<ObsBean> beanList = new ArrayList<ObsBean>(); try { NetcdfDataset ncd = getBufrMessageAsDataset(m); Variable v = ncd.findVariable(BufrIosp.obsRecord); if ((v != null) && (v instanceof Structure)) { Structure obs = (Structure) v; StructureDataIterator iter = obs.getStructureIterator(); while (iter.hasNext()) { beanList.add(new ObsBean(obs, iter.next())); } } } catch (Exception ex) { JOptionPane.showMessageDialog(BufrMessageViewer.this, ex.getMessage()); ex.printStackTrace(); } obsTable.setBeans(beanList); }
// ErtanO 12.03.2004 public static java.util.List getAvailablePLAF() { java.util.List l = new java.util.ArrayList(); l.add("System"); l.add("TinyLAF"); l.add("JGoodiesLAF-PlasticXP"); l.add("JGoodiesLAF-Plastic"); l.add("JGoodiesLAF-Plastic3D"); l.add("JGoodiesLAF-ExtWindows"); javax.swing.UIManager.LookAndFeelInfo[] lfinfo = javax.swing.UIManager.getInstalledLookAndFeels(); for (int i = 0; i < lfinfo.length; ++i) { l.add(lfinfo[i].getName()); } return l; }
static { _jspx_dependants = new java.util.ArrayList(1); _jspx_dependants.add("/admin/login_check.jsp"); }
private void playerSetup() { players = new ArrayList(twoPlayerRB.isSelected() ? 2 : 1); if (mouseRB.isSelected()) { MouseControlledPlayer p1 = new MouseControlledPlayer(width / 2, height / 2, 3, true, this, 3, 1, width); addMouseMotionListener(p1); addMouseListener(p1); players.add(p1); } else { KeyboardControlledPlayer p1 = new KeyboardControlledPlayer( width / 2, height / 2, 3, true, this, 3, KeyEvent.VK_W, KeyEvent.VK_A, KeyEvent.VK_S, KeyEvent.VK_D, keyboardSpeedS1.getValue(), KeyEvent.VK_SPACE, KeyEvent.VK_F, 1, width); KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(p1); players.add(p1); } if (twoPlayerRB.isSelected()) { if (mouseRB.isSelected()) { KeyboardControlledPlayer p2 = new KeyboardControlledPlayer( width / 2, height / 2, 3, true, this, 3, KeyEvent.VK_W, KeyEvent.VK_A, KeyEvent.VK_S, KeyEvent.VK_D, keyboardSpeedS2.getValue(), KeyEvent.VK_SPACE, KeyEvent.VK_F, 2, width); KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(p2); players.add(p2); } else { KeyboardControlledPlayer p2 = new KeyboardControlledPlayer( width / 2, height / 2, 3, true, this, 3, KeyEvent.VK_NUMPAD8, KeyEvent.VK_NUMPAD4, KeyEvent.VK_NUMPAD5, KeyEvent.VK_NUMPAD6, keyboardSpeedS2.getValue(), KeyEvent.VK_NUMPAD0, KeyEvent.VK_NUMPAD1, 2, width); KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(p2); players.add(p2); } } }
protected boolean readFromFile(File file) throws IOException { Reader reader = new FileReader(file); BufferedReader bufferedReader = new BufferedReader(reader); String line = bufferedReader.readLine(); while (line != null && line.length() == 0) { line = bufferedReader.readLine(); } boolean isNexus = (line != null && line.toUpperCase().contains("#NEXUS")); reader = new FileReader(file); Tree tree = null; try { if (isNexus) { NexusImporter importer = new NexusImporter(reader); tree = importer.importTree(taxa); } else { NewickImporter importer = new NewickImporter(reader); tree = importer.importTree(taxa); } } catch (Importer.ImportException ime) { JOptionPane.showMessageDialog( this, "Error parsing imported file: " + ime, "Error reading file", JOptionPane.ERROR_MESSAGE); ime.printStackTrace(); return false; } catch (IOException ioex) { JOptionPane.showMessageDialog( this, "File I/O Error: " + ioex, "File I/O Error", JOptionPane.ERROR_MESSAGE); ioex.printStackTrace(); return false; } catch (Exception ex) { JOptionPane.showMessageDialog( this, "Fatal exception: " + ex, "Error reading file", JOptionPane.ERROR_MESSAGE); ex.printStackTrace(); return false; } if (tree == null) { JOptionPane.showMessageDialog( this, "The file is not in a suitable format or contains no trees.", "Error reading file", JOptionPane.ERROR_MESSAGE); return false; } FlexibleTree binaryTree = new FlexibleTree(tree, true); binaryTree.resolveTree(); trees.add(binaryTree); if (taxa == null) { taxa = binaryTree; } getExportTreeAction().setEnabled(true); getExportDataAction().setEnabled(true); return true; }
static { _jspx_dependants = new java.util.ArrayList(1); _jspx_dependants.add("/ext/catalog/../../head.inc"); }