public void setColor(Color _color) { myColor = _color; tabbedPanel.setForeground(_color); firstButton.setForeground(_color); for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) e.nextElement().setColor(_color); }
/** * notify listeners of a popup selection * * @param popStr popup selection string */ void popNotify(String popStr) { Enumeration en = popListeners.elements(); for (; en.hasMoreElements(); ) { PopListener listener = (PopListener) en.nextElement(); listener.popHappened(popStr); } } // popNotify()
public StringBuffer saveStringBuffer() { StringBuffer save = new StringBuffer(); for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) { Editor page = e.nextElement(); save.append( "<" + name + ".Page>\n" + "<Type>" + typeOfPage(page) + "</Type>\n" + "<Name>" + page.getName() + "</Name>\n" + "<Active>" + page.isActive() + "</Active>\n" + "<" + contentDelim + ">\n"); save.append(page.saveStringBuffer()); save.append("</" + contentDelim + ">\n" + "</" + name + ".Page>\n"); } return save; }
void drawboard(Graphics g) { g.setColor(Color.black); g.fillRect(0, 0, getWidth(), getHeight()); sqw = getWidth() / xdim; sqh = getHeight() / ydim; // draw background panels if (def != null) { for (int y = 0; y < ydim; y++) { for (int x = 0; x < xdim; x++) def.drawObject(g, x, y, sqw, sqh, this); } } if (USEVEC) { // draw each element in the vector for (Enumeration e = boardVec.elements(); e.hasMoreElements(); ) { boardContainer c = (boardContainer) e.nextElement(); c.o.drawObject(g, c.d.width, c.d.height, sqw, sqh, this); } } else { // draw from grid for (int y = 0; y < ydim; y++) { for (int x = 0; x < xdim; x++) if (board[x][y] != null) board[x][y].drawObject(g, x, y, sqw, sqh, this); } } }
public java.util.List<SearchResult> search(String _info, String _searchString, int _mode) { String passName = getName(); if (passName.startsWith("Osejs.")) passName = passName.substring(6); java.util.List<SearchResult> list = new ArrayList<SearchResult>(); for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) list.addAll(e.nextElement().search(passName, _searchString, _mode)); return list; }
public void clear() { for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) e.nextElement().clear(); pageList.clear(); tabbedPanel.removeAll(); showFirstPage(); updatePageCounterField(pageList.size()); changed = false; }
/* * Applet is no longer displayed */ public void stop() { // Tell all pages to stop talking to the server Enumeration e = pages.elements(); while (e.hasMoreElements()) { SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement(); if (pg != null) { pg.stop(); } } }
/** Check if soap data matches filter */ public boolean filterMatch(SOAPMonitorData soap) { boolean match = true; if (filter_include != null) { // Check for service match Enumeration e = filter_include.elements(); match = false; while (e.hasMoreElements() && !match) { String service = (String) e.nextElement(); if (service.equals(soap.getTargetService())) { match = true; } } } if (filter_exclude != null) { // Check for service match Enumeration e = filter_exclude.elements(); while (e.hasMoreElements() && match) { String service = (String) e.nextElement(); if (service.equals(soap.getTargetService())) { match = false; } } } if (filter_active) { // Check for active status match if (soap.getSOAPResponse() != null) { match = false; } } if (filter_complete) { // Check for complete status match if (soap.getSOAPResponse() == null) { match = false; } } // The "most recent" is always a match if (soap.getId() == null) { match = true; } return match; }
/** * List results by date * * @param reslist result list * @param ldisp */ private void listByDateRun(ResultList reslist, boolean ldisp) { StringTokenizer tokenizer = new StringTokenizer((String) reslist.get("list"), "\n"); Vector vdata = new Vector(); while (tokenizer.hasMoreTokens()) { String data = convertToPretty(tokenizer.nextToken()); if (datasets.contains(data) || ldisp) vdata.add(data); } datasets.removeAllElements(); Enumeration en = vdata.elements(); while (en.hasMoreElements()) datasets.addElement(en.nextElement()); }
/** Refilter the list of messages */ public void applyFilter() { // Re-filter using new criteria filter_data = null; if ((filter_include != null) || (filter_exclude != null) || filter_active || filter_complete) { filter_data = new Vector(); Enumeration e = data.elements(); SOAPMonitorData soap; while (e.hasMoreElements()) { soap = (SOAPMonitorData) e.nextElement(); if (filterMatch(soap)) { filter_data.addElement(soap); } } } fireTableDataChanged(); }
public WebcamCaptureAndFadePanel(String saveDir, String layout) { System.out.println("Using " + saveDir + " as directory for the images."); saveDirectory = saveDir; getImages(); images_used = new ArrayList<Integer>(); images_lastadded = new ArrayList<Integer>(); images_nevershown = new ArrayList<Integer>(); Vector devices = (Vector) CaptureDeviceManager.getDeviceList(null).clone(); Enumeration enumeration = devices.elements(); System.out.println("- Available cameras -"); ArrayList<String> names = new ArrayList<String>(); while (enumeration.hasMoreElements()) { CaptureDeviceInfo cdi = (CaptureDeviceInfo) enumeration.nextElement(); String name = cdi.getName(); if (name.startsWith("vfw:")) { names.add(name); System.out.println(name); } } // String str1 = "vfw:Logitech USB Video Camera:0"; // String str2 = "vfw:Microsoft WDM Image Capture (Win32):0"; if (names.size() == 0) { JOptionPane.showMessageDialog( null, "Ingen kamera funnet. " + "Du må koble til et kamera for å kjøre programmet.", "Feil", JOptionPane.ERROR_MESSAGE); System.exit(0); } else if (names.size() > 1) { JOptionPane.showMessageDialog( null, "Fant mer enn 1 kamera. " + "Velger da:\n" + names.get(0), "Advarsel", JOptionPane.WARNING_MESSAGE); } String str2 = names.get(0); di = CaptureDeviceManager.getDevice(str2); ml = di.getLocator(); try { player = Manager.createRealizedPlayer(ml); formatControl = (FormatControl) player.getControl("javax.media.control.FormatControl"); /* Format[] formats = formatControl.getSupportedFormats(); for (int i=0; i<formats.length; i++) System.out.println(formats[i].toString()); */ player.start(); } catch (javax.media.NoPlayerException e) { JOptionPane.showMessageDialog( null, "Klarer ikke å starte" + " programmet pga. feil med kamera. Sjekk at det er koblet til.", "IOException", JOptionPane.ERROR_MESSAGE); System.exit(0); } catch (Exception e) { e.printStackTrace(); System.exit(0); } /* * Layout * * Add * - comp * - imagepanels */ if (layout.equals("1024v2")) { layout1024v2(); } else if (layout.equals("1280")) { layout1280(); } else { layout1024(); } // Capture Window if (captureWindow) { cw = new JFrame("Capture from webcam"); cw.setAlwaysOnTop(true); cw.setSize(sizeCaptureWindow_x, sizeCaptureWindow_y); cw.addKeyListener(new captureWindowKeyListner()); cw.setUndecorated(true); // Add webcam if ((comp = player.getVisualComponent()) != null) { cw.add(comp); } // Add panel to window and set location of window cw.setLocation(cwLocation_x, cwLocation_y); } // Text window cwText = new rotatedText(""); /* * Timer for update */ Timer thread = new Timer(); thread.schedule(new frameUpdateTask(), 0, (1000 / fps)); }
@Override public Enumeration children() { return children.elements(); }
private boolean nameExists(String _name) { for (Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) if (_name.equals(e.nextElement().getName())) return true; return false; }
public void setChanged(boolean _ch) { changed = _ch; for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) e.nextElement().setChanged(_ch); }
public boolean isChanged() { if (changed) return true; for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) if (e.nextElement().isChanged()) return true; return false; }
public void setFont(Font _font) { myFont = _font; for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) e.nextElement().setFont(_font); }
/** Returns the number of active pages of this TabbedEditor */ public int getActivePageCount() { int counter = 0; for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) if (e.nextElement().isActive()) counter++; return counter; }
/** Returns the pages of this TabbedEditor */ public java.util.Enumeration<Editor> getPageEnumeration() { return pageList.elements(); }