/** * Create a menu with the given menuitem names. * * @param menuItems the names that will appear in the phone's menu * @param listener the commandlistener that will handle the commandevents * @param display the Displayable object were te commands will be added to. */ public static final void makeMenu( String[] menuItems, CommandListener listener, Displayable display) { // create command for every menuitem in the string array for (int i = 0; i < menuItems.length; i++) { Command cmd = new Command(menuItems[i], Command.ITEM, 2); display.addCommand(cmd); } // let the given listener handle the command events display.setCommandListener(listener); }
public static void writeJS(String filename, Displayable d) throws IOException { FileWriter fw = new FileWriter(filename); StringBuilder b = new StringBuilder(65536); d.writeJS(b); fw.write(b.toString()); fw.close(); }
/** Returns where any of the newly linked was locked. */ final boolean linkPatches() { final Rectangle r = new Rectangle(); // for reuse final double[][] po = transformPoints(p); boolean must_lock = false; for (int i = 0; i < n_points; i++) { final Layer la = layer_set.getLayer(p_layer[0]); for (final Displayable d : la.getDisplayables(Patch.class)) { d.getBoundingBox(r); if (r.contains((int) po[0][i], (int) po[1][i])) { link(d, true); must_lock = true; } } } return must_lock; }
public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; otapiJNI.delete_OfferDataMarket(swigCPtr); } swigCPtr = 0; } super.delete(); }
public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; otapiJNI.delete_ContactNym(swigCPtr); } swigCPtr = 0; } super.delete(); }
/** clean up if Activity is destroyed */ public void killUI() { if (current != null) { View view = current.getView(); Object parent = view.getParent(); if (parent instanceof ViewGroup) { ((ViewGroup) parent).removeView(view); } hiddenDisplay = current; current = null; } }
public static void exportDTD( final StringBuilder sb_header, final HashSet<String> hs, final String indent) { final String type = "t2_dissector"; if (hs.contains(type)) return; hs.add(type); sb_header .append(indent) .append("<!ELEMENT t2_dissector (") .append(Displayable.commonDTDChildren()) .append(",t2_dd_item)>\n"); Displayable.exportDTD(type, sb_header, hs, indent); // all ATTLIST of a Displayable sb_header .append(indent) .append("<!ELEMENT t2_dd_item EMPTY>\n") .append(indent) .append("<!ATTLIST t2_dd_item radius NMTOKEN #REQUIRED>\n") .append(indent) .append("<!ATTLIST t2_dd_item tag NMTOKEN #REQUIRED>\n") .append(indent) .append("<!ATTLIST t2_dd_item points NMTOKEN #REQUIRED>\n"); }