rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
styleSheet.setBase(u);
getStyleSheet().setBase(u);
public void setBase(URL u) { baseURL = u; styleSheet.setBase(u); }
throws BadLocationException, IOException, NotImplementedException
throws BadLocationException, IOException
public void setInnerHTML(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (elem.isLeaf()) throw new IllegalArgumentException("Element is a leaf"); if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("setInnerHTML not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("setInnerHTML not implemented");
int start = elem.getStartOffset(); int end = elem.getEndOffset(); HTMLEditorKit.ParserCallback reader = getInsertingReader( end, 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true); remove(start, end - start);
public void setInnerHTML(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (elem.isLeaf()) throw new IllegalArgumentException("Element is a leaf"); if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("setInnerHTML not implemented"); }
public void setOuterHTML(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException
public void setOuterHTML(Element elem, String htmlText) throws BadLocationException, IOException
public void setOuterHTML(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("setOuterHTML not implemented"); }
if (parser == null) throw new IllegalStateException("Parser has not been set"); System.out.println("setOuterHTML not implemented");
int start = elem.getStartOffset(); int end = elem.getEndOffset(); remove(start, end-start); HTMLEditorKit.ParserCallback reader = getInsertingReader( start, 0, 0, HTML.Tag.BODY, elem); getParser().parse(new StringReader(htmlText), reader, true);
public void setOuterHTML(Element elem, String htmlText) throws BadLocationException, IOException, NotImplementedException { if (parser == null) throw new IllegalStateException("Parser has not been set"); // FIXME: Not implemented fully, use InsertHTML* in HTMLEditorKit? System.out.println("setOuterHTML not implemented"); }
bad.minor = Minor.Any;
public static NamingContextExt extract(Any a) { try { return ((NamingContextExtHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("NamingContextExt expected"); bad.initCause(ex); throw bad; } }
if (member < 1) throw new IllegalArgumentException("member may not be less than 1");
public PageRanges(int member) { super(member); }
noteFrame(this);
Frame(){ this("");}
if (parent != null && parent.isDisplayable()) fireDummyEvent();
addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); super.addNotify();}
getFrames()
public static Frame[] getFrames()
getFrames(){ //Frame[] array = new Frames[frames.size()]; //return frames.toArray(array); String msg = "FIXME: can't be implemented without weak references"; throw new UnsupportedOperationException(msg);}
String msg = "FIXME: can't be implemented without weak references"; throw new UnsupportedOperationException(msg);
int n = 0; synchronized (weakFrames) { Iterator i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) ++n; } if (n == 0) return new Frame[0]; else { Frame[] frames = new Frame[n]; n = 0; i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) frames[n++] = (Frame) wr.get(); } return frames; } }
getFrames(){ //Frame[] array = new Frames[frames.size()]; //return frames.toArray(array); String msg = "FIXME: can't be implemented without weak references"; throw new UnsupportedOperationException(msg);}
fireDummyEvent();
public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify();}
startFrameType();
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } loadSessions(); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); tnicon = createImageIcon("tnicon.jpg"); frames = new Vector(); newView(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
if (isSpecified("-MDI",args))
if (isSpecified("-MDI",args)) {
static public void main(String[] args) { if (isSpecified("-MDI",args)) useMDIFrames = true; if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame1.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) m.frame1.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
}
static public void main(String[] args) { if (isSpecified("-MDI",args)) useMDIFrames = true; if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame1.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) m.frame1.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
return cause; }
return containedException; }
public Throwable getCause() { return cause; }
return cause; }
return containedException; }
public Throwable getException() { return cause; }
if (this.cause != null)
if (this.containedException != null)
public Throwable initCause(Throwable cause) { if (this.cause != null) { throw new IllegalStateException(); } if (cause == this) { throw new IllegalArgumentException(); } this.cause = cause; return this; }
} this.cause = cause;
} this.containedException = cause;
public Throwable initCause(Throwable cause) { if (this.cause != null) { throw new IllegalStateException(); } if (cause == this) { throw new IllegalArgumentException(); } this.cause = cause; return this; }
System.out.println(" sent heartbeat to " + ses.getSessionName());
log.info(" sent heartbeat to " + ses.getSessionName());
public void actionPerformed(ActionEvent e) { Session ses; for (int x = 0; x < sessions.size(); x++) { try { ses = (Session)sessions.get(x); if (ses.isConnected() && ses.isSendKeepAlive()) { ses.getVT().sendHeartBeat(); System.out.println(" sent heartbeat to " + ses.getSessionName()); } } catch (Exception ex) { System.out.println(ex.getMessage()); } } }
System.out.println(ex.getMessage());
log.warn(ex.getMessage());
public void actionPerformed(ActionEvent e) { Session ses; for (int x = 0; x < sessions.size(); x++) { try { ses = (Session)sessions.get(x); if (ses.isConnected() && ses.isSendKeepAlive()) { ses.getVT().sendHeartBeat(); System.out.println(" sent heartbeat to " + ses.getSessionName()); } } catch (Exception ex) { System.out.println(ex.getMessage()); } } }
synchronized (pool) {
void release() { if (pool != null) { synchronized (pool) { useCount++; Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections) { // maxConnections must always be >= 1 Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru); try { c.closeConnection(); } catch (IOException ioe) { // Ignore it. We are just cleaning up. } } } } }
Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections)
pool.put(this); } else
void release() { if (pool != null) { synchronized (pool) { useCount++; Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections) { // maxConnections must always be >= 1 Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru); try { c.closeConnection(); } catch (IOException ioe) { // Ignore it. We are just cleaning up. } } } } }
Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru);
void release() { if (pool != null) { synchronized (pool) { useCount++; Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections) { // maxConnections must always be >= 1 Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru); try { c.closeConnection(); } catch (IOException ioe) { // Ignore it. We are just cleaning up. } } } } }
c.closeConnection();
closeConnection();
void release() { if (pool != null) { synchronized (pool) { useCount++; Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections) { // maxConnections must always be >= 1 Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru); try { c.closeConnection(); } catch (IOException ioe) { // Ignore it. We are just cleaning up. } } } } }
} }
void release() { if (pool != null) { synchronized (pool) { useCount++; Object key = HTTPConnection.getPoolKey(hostname, port, secure); pool.put(key, this); while (pool.size() >= HTTPURLConnection.maxConnections) { // maxConnections must always be >= 1 Object lru = pool.keySet().iterator().next(); HTTPConnection c = (HTTPConnection)pool.remove(lru); try { c.closeConnection(); } catch (IOException ioe) { // Ignore it. We are just cleaning up. } } } } }
void setPool(LinkedHashMap p)
void setPool(Pool p)
void setPool(LinkedHashMap p) { pool = p; }
if (!Utility.isValidEncoding(strEncoding)) {
if (!Utility.isValidIOEncoding(strEncoding)) {
public String setEncoding (String strEncoding) { if (!Utility.isValidEncoding(strEncoding)) { Log.error("not valid encoding. 'set' request ingored. returning null"); return null; } return (String) ((XMLAttribute) attribHash.get("encoding")).setAttribValue(strEncoding); }
{ return null; }
{ if (accessibleContext == null) accessibleContext = new AccessibleJCheckBox(); return accessibleContext; }
public AccessibleContext getAccessibleContext() { return null; }
value [ i ] = input.read_wstring();
value [ i ] = input.read_string();
public void _read(InputStream input) { value = new String[ input.read_long() ]; for (int i = 0; i < value.length; i++) { value [ i ] = input.read_wstring(); } typecode.setLength(value.length); }
output.write_wstring(value [ i ]);
output.write_string(value [ i ]);
public void _write(OutputStream output) { output.write_long(value.length); for (int i = 0; i < value.length; i++) { output.write_wstring(value [ i ]); } }
System.err.println("WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NO SECURITY MANAGER.\n\n" + "THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION\n" + "THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.\n" + "DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANT DATA.\n" + "THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.\n"); System.err.println("[press 'c' or 'C' to continue or anything else to quit]"); BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String response = null; try { response = stdin.readLine(); } catch (IOException e) { System.err.println("failed to read response to warning message: " + e); System.exit(1); } if (!(response.equals("c") || response.equals("C"))) { System.exit(0); }
public static void main(String[] args) throws IOException { parser = new ClasspathToolParser("appletviewer", true); parser.setHeader("usage: appletviewer [OPTION] -code CODE | URL..."); OptionGroup attributeGroup = new OptionGroup("Applet tag options"); attributeGroup.add(new Option("code", Main.messages.getString ("gcjwebplugin.code_description"), "CODE") { public void parsed(String argument) throws OptionException { code = argument; } }); attributeGroup.add(new Option("codebase", Main.messages.getString ("gcjwebplugin.codebase_description"), "CODEBASE") { public void parsed(String argument) throws OptionException { codebase = argument; } }); attributeGroup.add(new Option("archive", Main.messages.getString ("gcjwebplugin.archive_description"), "ARCHIVE") { public void parsed(String argument) throws OptionException { archive = argument; } }); attributeGroup.add(new Option("width", Main.messages.getString ("gcjwebplugin.width_description"), "WIDTH") { public void parsed(String argument) throws OptionException { dimensions.width = Integer.parseInt(argument); } }); attributeGroup.add(new Option("height", Main.messages.getString ("gcjwebplugin.height_description"), "HEIGHT") { public void parsed(String argument) throws OptionException { dimensions.height = Integer.parseInt(argument); } }); attributeGroup.add(new Option("param", Main.messages.getString ("gcjwebplugin.param_description"), "NAME,VALUE") { public void parsed(String argument) throws OptionException { parameters.add(argument); } }); OptionGroup pluginGroup = new OptionGroup("Plugin option"); pluginGroup.add(new Option("plugin", Main.messages.getString ("gcjwebplugin.plugin_description"), "INPUT,OUTPUT") { public void parsed(String argument) throws OptionException { pluginMode = true; int comma = argument.indexOf(','); pipeInName = argument.substring(0, comma); pipeOutName = argument.substring(comma + 1); } }); OptionGroup debuggingGroup = new OptionGroup("Debugging option"); debuggingGroup.add(new Option("verbose", Main.messages.getString ("gcjwebplugin.verbose_description"), (String) null) { public void parsed(String argument) throws OptionException { verbose = true; } }); OptionGroup compatibilityGroup = new OptionGroup("Compatibility options"); compatibilityGroup.add(new Option("debug", Main.messages.getString ("gcjwebplugin.debug_description"), (String) null) { public void parsed(String argument) throws OptionException { // Currently ignored. } }); compatibilityGroup.add(new Option("encoding", Main.messages.getString ("gcjwebplugin.encoding_description"), "CHARSET") { public void parsed(String argument) throws OptionException { // FIXME: We should probably be using // java.nio.charset.CharsetDecoder to handle the encoding. What // is the status of Classpath's implementation? } }); parser.add(attributeGroup); parser.add(pluginGroup); parser.add(debuggingGroup); parser.add(compatibilityGroup); String[] urls = parser.parse(args); // Print arguments. printArguments(args); args = urls; if (dimensions.height < 0) dimensions.height = 200; if (dimensions.width < 0) dimensions.width = (int) (1.6 * dimensions.height); //System.setSecurityManager(new AppletSecurityManager(pluginMode)); if (pluginMode) { InputStream in; OutputStream out; in = new FileInputStream(pipeInName); out = new FileOutputStream(pipeOutName); PluginAppletViewer.start(in, out); } else { if (code == null) { // The --code option wasn't given and there are no URL // arguments so we have nothing to work with. if (args.length == 0) { System.err.println(Main.messages.getString("gcjwebplugin.no_input_files")); System.exit(1); } // Create a standalone appletviewer from a list of URLs. new StandaloneAppletViewer(args); } else { // Create a standalone appletviewer from the --code // option. new StandaloneAppletViewer(code, codebase, archive, parameters, dimensions); } } }
public FTPFileSystem(FTPFSDevice device) {
public FTPFileSystem(final FTPFSDevice device) {
public FTPFileSystem(FTPFSDevice device) { this.device = device; device.addListener(new DeviceListener() { public void deviceStarted(Device device) { //empty } public void deviceStop(Device device) { try { close(); } catch(IOException x){ x.printStackTrace(); } } }); try{// setRemoteHost(device.getHost());// setTimeout(300000);// connect(); connect(device.getHost()); login(device.getUser(),device.getPassword()); thread = new Thread(new Runnable(){ public void run() { try{ while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ //ignore } } } catch(Exception x){ x.printStackTrace(); } } },"ftpfs_keepalive"); thread.start(); //FTPFile f = new FTPFile("/", "/", 0, true, new Date(0)); FTPFile f = new FTPFile(); f.setName(printWorkingDirectory()); root = new FTPFSDirectory(this, f); closed = false; }catch(Exception e){ throw new RuntimeException(e); } }
connect(device.getHost());
setRemoteHost(device.getHost()); setTimeout(300000); AccessController.doPrivileged( new PrivilegedAction(){ public Object run() { try{ connect(); return null; }catch(Exception e){ throw new RuntimeException(e); } } });
public FTPFileSystem(FTPFSDevice device) { this.device = device; device.addListener(new DeviceListener() { public void deviceStarted(Device device) { //empty } public void deviceStop(Device device) { try { close(); } catch(IOException x){ x.printStackTrace(); } } }); try{// setRemoteHost(device.getHost());// setTimeout(300000);// connect(); connect(device.getHost()); login(device.getUser(),device.getPassword()); thread = new Thread(new Runnable(){ public void run() { try{ while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ //ignore } } } catch(Exception x){ x.printStackTrace(); } } },"ftpfs_keepalive"); thread.start(); //FTPFile f = new FTPFile("/", "/", 0, true, new Date(0)); FTPFile f = new FTPFile(); f.setName(printWorkingDirectory()); root = new FTPFSDirectory(this, f); closed = false; }catch(Exception e){ throw new RuntimeException(e); } }
FTPFile f = new FTPFile(); f.setName(printWorkingDirectory());
FTPFile f = new FTPFile("/", "/", 0, true, new Date(0));
public FTPFileSystem(FTPFSDevice device) { this.device = device; device.addListener(new DeviceListener() { public void deviceStarted(Device device) { //empty } public void deviceStop(Device device) { try { close(); } catch(IOException x){ x.printStackTrace(); } } }); try{// setRemoteHost(device.getHost());// setTimeout(300000);// connect(); connect(device.getHost()); login(device.getUser(),device.getPassword()); thread = new Thread(new Runnable(){ public void run() { try{ while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ //ignore } } } catch(Exception x){ x.printStackTrace(); } } },"ftpfs_keepalive"); thread.start(); //FTPFile f = new FTPFile("/", "/", 0, true, new Date(0)); FTPFile f = new FTPFile(); f.setName(printWorkingDirectory()); root = new FTPFSDirectory(this, f); closed = false; }catch(Exception e){ throw new RuntimeException(e); } }
public void run() {
public Object run() {
public void run() { try{ while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ //ignore } } } catch(Exception x){ x.printStackTrace(); } }
while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ } } } catch(Exception x){ x.printStackTrace();
connect(); return null; }catch(Exception e){ throw new RuntimeException(e);
public void run() { try{ while(!isClosed()){ try { Thread.sleep(100000); nop(); }catch(InterruptedException x){ //ignore } } } catch(Exception x){ x.printStackTrace(); } }
listFiles(root.path());
dir(root.path());
private synchronized void nop() throws Exception{ listFiles(root.path()); }
void addSelectionInterval(int index0, int index1);
void addSelectionInterval(int anchor, int lead);
void addSelectionInterval(int index0, int index1);
boolean isSelectedIndex(int a);
boolean isSelectedIndex(int index);
boolean isSelectedIndex(int a);
void removeSelectionInterval(int index0, int index1);
void removeSelectionInterval(int anchor, int lead);
void removeSelectionInterval(int index0, int index1);
void setSelectionInterval(int index0, int index1);
void setSelectionInterval(int anchor, int lead);
void setSelectionInterval(int index0, int index1);
void setSelectionMode(int a);
void setSelectionMode(int mode);
void setSelectionMode(int a);
protected void resolve() throws PluginException {
protected void resolve(PluginRegistryModel registry) throws PluginException {
protected void resolve() throws PluginException { for (int i = 0; i < libraries.length; i++) { libraries[i].resolve(); } }
libraries[i].resolve();
libraries[i].resolve(registry);
protected void resolve() throws PluginException { for (int i = 0; i < libraries.length; i++) { libraries[i].resolve(); } }
protected void unresolve() throws PluginException {
protected void unresolve(PluginRegistryModel registry) throws PluginException {
protected void unresolve() throws PluginException { for (int i = 0; i < libraries.length; i++) { libraries[i].unresolve(); } }
libraries[i].unresolve();
libraries[i].unresolve(registry);
protected void unresolve() throws PluginException { for (int i = 0; i < libraries.length; i++) { libraries[i].unresolve(); } }
return false;
return all;
private boolean evaluateImpl(Node context, int pos, int len) { Object left = lhs.evaluate(context, pos, len); Object right = rhs.evaluate(context, pos, len); /* * If both objects to be compared are node-sets, then the comparison * will be true if and only if there is a node in the first node-set and * a node in the second node-set such that the result of performing the * comparison on the string-values of the two nodes is true. */ boolean flns = left instanceof Collection; boolean frns = right instanceof Collection; if (flns && frns) { Collection lns = (Collection) left; Collection rns = (Collection) right; boolean all = true; for (Iterator i = lns.iterator(); i.hasNext(); ) { Node ltest = (Node) i.next(); for (Iterator j = rns.iterator(); j.hasNext(); ) { Node rtest = (Node) j.next(); if (ltest == rtest || ltest.equals(rtest)) { // much shorter if (!invert) { return true; } } else if (stringValue(ltest).equals(stringValue(rtest))) { if (!invert) { return true; } } else { all = false; } } } return false; } /* * If one object to be compared is a node-set and the other is a number, * then the comparison will be true if and only if there is a node in * the node-set such that the result of performing the comparison on the * number to be compared and on the result of converting the * string-value of that node to a number using the number function is * true. */ boolean fln = left instanceof Double; boolean frn = right instanceof Double; if ((flns && frn) || (frns && fln)) { Collection ns = flns ? (Collection) left : (Collection) right; double n = fln ? ((Double) left).doubleValue() : ((Double) right).doubleValue(); boolean all = true; for (Iterator i = ns.iterator(); i.hasNext(); ) { Node test = (Node) i.next(); double nn = _number(context, stringValue(test)); if (nn == n) { if (!invert) { return true; } } else { all = false; } } return invert ? all : false; } /* * If one object to be compared is a node-set and the other is a * string, then the comparison will be true if and only if there is a * node in the node-set such that the result of performing the * comparison on the string-value of the node and the other string is * true. */ boolean fls = left instanceof String; boolean frs = right instanceof String; if ((flns && frs) || (frns && fls)) { Collection ns = flns ? (Collection) left : (Collection) right; String s = fls ? (String) left : (String) right; boolean all = true; for (Iterator i = ns.iterator(); i.hasNext(); ) { Node test = (Node) i.next(); if (stringValue(test).equals(s)) { if (!invert) { return true; } } else { all = false; } } return invert ? all : false; } /* * If one object to be compared is a node-set and the other is a * boolean, then the comparison will be true if and only if the result * of performing the comparison on the boolean and on the result of * converting the node-set to a boolean using the boolean function is * true. */ boolean flb = left instanceof Boolean; boolean frb = right instanceof Boolean; if ((flns && frb) || (frns && flb)) { Collection ns = flns ? (Collection) left : (Collection) right; boolean b = flb ? ((Boolean) left).booleanValue() : ((Boolean) right).booleanValue(); return _boolean(context, ns) == b; } /* * If at least one object to be compared is a boolean, then each object * to be compared is converted to a boolean as if by applying the * boolean function. */ if (flb || frb) { boolean lb = flb ? ((Boolean) left).booleanValue() : _boolean(context, left); boolean rb = frb ? ((Boolean) right).booleanValue() : _boolean(context, right); return lb == rb; } /* * Otherwise, if at least one object to be compared is * a number, then each object to be compared is converted to a number as * if by applying the number function. */ if (fln || frn) { double ln = fln ? ((Double) left).doubleValue() : _number(context, left); double rn = frn ? ((Double) right).doubleValue() : _number(context, right); return ln == rn; } /* * Otherwise, both objects to be * compared are converted to strings as if by applying the string * function. */ String ls = fls ? (String) left : _string(context, left); String rs = frs ? (String) right : _string(context, right); return ls.equals(rs); }
AxisInterface axis0 = (AxisInterface) CurrentArray.getAxisList().get(0); AxisInterface axis1 = (AxisInterface) CurrentArray.getAxisList().get(1);
public void action () { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();AxisInterface axis0 = (AxisInterface) CurrentArray.getAxisList().get(0); AxisInterface axis1 = (AxisInterface) CurrentArray.getAxisList().get(1); CurrentDataFormatIndex = 0; // boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ Log.errorln("FORMATTED DATA READ NOT SUPPORTED"); } else { // snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } }Log.errorln("Location:["+myLocator.getAxisLocation(axis0)+","+myLocator.getAxisLocation(axis1)+"]"); myLocator.next(); } } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
Log.errorln("Location:["+myLocator.getAxisLocation(axis0)+","+myLocator.getAxisLocation(axis1)+"]");
public void action () { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();AxisInterface axis0 = (AxisInterface) CurrentArray.getAxisList().get(0); AxisInterface axis1 = (AxisInterface) CurrentArray.getAxisList().get(1); CurrentDataFormatIndex = 0; // boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ Log.errorln("FORMATTED DATA READ NOT SUPPORTED"); } else { // snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } }Log.errorln("Location:["+myLocator.getAxisLocation(axis0)+","+myLocator.getAxisLocation(axis1)+"]"); myLocator.next(); } } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
Log.errorln("FOR Start handler not implemented yet.");
for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if (name.equals("axisIdRef") ) { AxisReadOrder.add(AxisObj.get(attrs.getValue(i))); } else Log.warnln("Warning: got weird attribute:"+name+" on for node"); }
public void action (AttributeList attrs) { Log.errorln("FOR Start handler not implemented yet."); }
AxisReadOrder = new ArrayList();
public void action (AttributeList attrs) { // save these for later, when we know what kind of dataIOstyle we got DataIOStyleAttribs = attrs; // clear out the format command object array // (its used by Formatted reads only, but this is reasonable // spot to do this). CurrentFormatObjectList = new ArrayList (); }
ArrayList axisList = (ArrayList) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1);
Axis lastAxisObject = (Axis) CurrentArray.getAxisList().get(CurrentArray.getAxisList().size()-1);
public void action (AttributeList attrs) { // grab parent node name String gParentNodeName = getGrandParentNodeName(); // create new object appropriately Unit newunit = new Unit(); newunit.setXMLAttributes(attrs); // determine where this goes and then insert it if( gParentNodeName.equals(XDFNodeName.PARAMETER) ) { newunit = LastParameterObject.addUnit(newunit); } else if ( gParentNodeName.equals(XDFNodeName.FIELD) ) { newunit = LastFieldObject.addUnit(newunit); } else if ( gParentNodeName.equals(XDFNodeName.AXIS) ) { ArrayList axisList = (ArrayList) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newunit = lastAxisObject.addUnit(newunit); } else if ( gParentNodeName.equals(XDFNodeName.ARRAY) ) { newunit = CurrentArray.addUnit(newunit); } else { Log.warnln("Unknown grandparent object, cant add unit, ignoring."); } LastUnitObject = newunit; }
String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable");
public void action (char buf [], int offset, int len) { String valueListString = new String (buf, offset, len); // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } }
CurrentValueListParameter.put("isDelimitedCase", "true");
public void action (char buf [], int offset, int len) { String valueListString = new String (buf, offset, len); // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } }
CurrentValueListParameter = new Hashtable();
public void action (AttributeList attrs) { // 1. grab parent node name String parentNodeName = getParentNodeName(); // 2. try to determine values from attributes (e.g. algorithm method) ArrayList values = getValueListNodeValues(attrs); // 3. IT could be that no values exist because they are stored // in PCDATA rather than as algorithm (treat in char data handler // in this case). if(values.size() > 0 ) { // algoritm case ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { /* ValueGroup lastValueGroup = (ValueGroup) CurrentValueGroupList.get(CurrentValueGroupList.size()-1); newvalueGroup = lastValueGroup.addValueGroup(newvalueGroup); */ if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { // get the last axis Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.errorln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } // add these new value objects to all open groups Iterator iter1 = CurrentValueGroupList.iterator(); Iterator iter2 = valueObjList.iterator(); while (iter1.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter1.next(); while (iter2.hasNext()) { Value nextValueObj = (Value) iter2.next(); nextValueObj.addToGroup(nextValueGroupObj); } // reset iter2 iter2 = valueObjList.iterator(); } } else { // PCDATA case String delimiter = DefaultValueListDelimiter; String repeatable = DefaultValueListRepeatable; // pickup overriding values from attribute list for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("delimiter") ) { delimiter = attrs.getValue(i); } else if ( name.equals("repeatable")) { repeatable = attrs.getValue(i); } } CurrentValueListParameter = new Hashtable(); // re-init CurrentValueListParameter.put("parentNode", parentNodeName); CurrentValueListParameter.put("delimiter", delimiter); CurrentValueListParameter.put("repeatable", repeatable); } }
ArrayList values = getValueListNodeValues(attrs);
for (int i = 0; i < attrs.getLength(); i++) { if (attrs.getValue(i) != null) CurrentValueListParameter.put(attrs.getName(i), attrs.getValue(i)); } CurrentValueListParameter.put("isDelimitedCase", "false");
public void action (AttributeList attrs) { // 1. grab parent node name String parentNodeName = getParentNodeName(); // 2. try to determine values from attributes (e.g. algorithm method) ArrayList values = getValueListNodeValues(attrs); // 3. IT could be that no values exist because they are stored // in PCDATA rather than as algorithm (treat in char data handler // in this case). if(values.size() > 0 ) { // algoritm case ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { /* ValueGroup lastValueGroup = (ValueGroup) CurrentValueGroupList.get(CurrentValueGroupList.size()-1); newvalueGroup = lastValueGroup.addValueGroup(newvalueGroup); */ if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { // get the last axis Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.errorln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } // add these new value objects to all open groups Iterator iter1 = CurrentValueGroupList.iterator(); Iterator iter2 = valueObjList.iterator(); while (iter1.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter1.next(); while (iter2.hasNext()) { Value nextValueObj = (Value) iter2.next(); nextValueObj.addToGroup(nextValueGroupObj); } // reset iter2 iter2 = valueObjList.iterator(); } } else { // PCDATA case String delimiter = DefaultValueListDelimiter; String repeatable = DefaultValueListRepeatable; // pickup overriding values from attribute list for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("delimiter") ) { delimiter = attrs.getValue(i); } else if ( name.equals("repeatable")) { repeatable = attrs.getValue(i); } } CurrentValueListParameter = new Hashtable(); // re-init CurrentValueListParameter.put("parentNode", parentNodeName); CurrentValueListParameter.put("delimiter", delimiter); CurrentValueListParameter.put("repeatable", repeatable); } }
if(values.size() > 0 ) { ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.errorln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); System.exit(-1); } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); } Iterator iter1 = CurrentValueGroupList.iterator(); Iterator iter2 = valueObjList.iterator(); while (iter1.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter1.next(); while (iter2.hasNext()) { Value nextValueObj = (Value) iter2.next(); nextValueObj.addToGroup(nextValueGroupObj); } iter2 = valueObjList.iterator(); } } else { String delimiter = DefaultValueListDelimiter; String repeatable = DefaultValueListRepeatable; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("delimiter") ) { delimiter = attrs.getValue(i); } else if ( name.equals("repeatable")) { repeatable = attrs.getValue(i); } } CurrentValueListParameter = new Hashtable(); CurrentValueListParameter.put("parentNode", parentNodeName); CurrentValueListParameter.put("delimiter", delimiter); CurrentValueListParameter.put("repeatable", repeatable); }
public void action (AttributeList attrs) { // 1. grab parent node name String parentNodeName = getParentNodeName(); // 2. try to determine values from attributes (e.g. algorithm method) ArrayList values = getValueListNodeValues(attrs); // 3. IT could be that no values exist because they are stored // in PCDATA rather than as algorithm (treat in char data handler // in this case). if(values.size() > 0 ) { // algoritm case ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { /* ValueGroup lastValueGroup = (ValueGroup) CurrentValueGroupList.get(CurrentValueGroupList.size()-1); newvalueGroup = lastValueGroup.addValueGroup(newvalueGroup); */ if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { // get the last axis Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.errorln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } // add these new value objects to all open groups Iterator iter1 = CurrentValueGroupList.iterator(); Iterator iter2 = valueObjList.iterator(); while (iter1.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter1.next(); while (iter2.hasNext()) { Value nextValueObj = (Value) iter2.next(); nextValueObj.addToGroup(nextValueGroupObj); } // reset iter2 iter2 = valueObjList.iterator(); } } else { // PCDATA case String delimiter = DefaultValueListDelimiter; String repeatable = DefaultValueListRepeatable; // pickup overriding values from attribute list for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("delimiter") ) { delimiter = attrs.getValue(i); } else if ( name.equals("repeatable")) { repeatable = attrs.getValue(i); } } CurrentValueListParameter = new Hashtable(); // re-init CurrentValueListParameter.put("parentNode", parentNodeName); CurrentValueListParameter.put("delimiter", delimiter); CurrentValueListParameter.put("repeatable", repeatable); } }
Log.errorln("setData:["+thisString+"]["+dataLocator.getAxisLocation(FastestAxis)+"]");
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) { // Note that we dont treat binary data at all try { Log.errorln("setData:["+thisString+"]["+dataLocator.getAxisLocation(FastestAxis)+"]"); if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
private ArrayList getValueListNodeValues (AttributeList attrs) {
private ArrayList getValueListNodeValues () {
private ArrayList getValueListNodeValues (AttributeList attrs) { ArrayList values = new ArrayList(); // parameters for the algorithm int size = DefaultValueListSize; int start = DefaultValueListStart; int step = DefaultValueListStep; // Capture any overridding Valuelist attributes // into algorithm parameters for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("size") ) { Integer tmp = new Integer (attrs.getValue(i)); size = tmp.intValue(); } else if ( name.equals("step")) { Integer tmp = new Integer (attrs.getValue(i)); step = tmp.intValue(); } else if ( name.equals("start")) { Integer tmp = new Integer (attrs.getValue(i)); start = tmp.intValue(); } else if ( name.equals("delimiter")) { // IF delimiter is defined, then we ARENT using // an algorthm, and should exit here without further ado. return values; } } // do the algorithm to populate the values in the ArrayList int numberOfValues = 0; int currentValue = start; while (numberOfValues < size) { values.add(String.valueOf(currentValue)); currentValue += step; numberOfValues++; } return values; }
int size = DefaultValueListSize; int start = DefaultValueListStart; int step = DefaultValueListStep; for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("size") ) { Integer tmp = new Integer (attrs.getValue(i)); size = tmp.intValue(); } else if ( name.equals("step")) { Integer tmp = new Integer (attrs.getValue(i)); step = tmp.intValue(); } else if ( name.equals("start")) { Integer tmp = new Integer (attrs.getValue(i)); start = tmp.intValue(); } else if ( name.equals("delimiter")) { return values; } }
int size = Integer.valueOf((String) CurrentValueListParameter.get("size")).intValue(); int start = Integer.valueOf((String) CurrentValueListParameter.get("start")).intValue(); int step = Integer.valueOf((String) CurrentValueListParameter.get("step")).intValue();
private ArrayList getValueListNodeValues (AttributeList attrs) { ArrayList values = new ArrayList(); // parameters for the algorithm int size = DefaultValueListSize; int start = DefaultValueListStart; int step = DefaultValueListStep; // Capture any overridding Valuelist attributes // into algorithm parameters for (int i = 0; i < attrs.getLength(); i++) { String name = attrs.getName(i); if ( name.equals("size") ) { Integer tmp = new Integer (attrs.getValue(i)); size = tmp.intValue(); } else if ( name.equals("step")) { Integer tmp = new Integer (attrs.getValue(i)); step = tmp.intValue(); } else if ( name.equals("start")) { Integer tmp = new Integer (attrs.getValue(i)); start = tmp.intValue(); } else if ( name.equals("delimiter")) { // IF delimiter is defined, then we ARENT using // an algorthm, and should exit here without further ado. return values; } } // do the algorithm to populate the values in the ArrayList int numberOfValues = 0; int currentValue = start; while (numberOfValues < size) { values.add(String.valueOf(currentValue)); currentValue += step; numberOfValues++; } return values; }
endElementHandlerHashtable.put(XDFNodeName.VALUELIST, new valueListEndElementHandlerFunc());
private void initEndHandlerHashtable () { endElementHandlerHashtable.put(XDFNodeName.DATA, new dataEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.FIELDGROUP, new fieldGroupEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.NOTES, new notesEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.PARAMETERGROUP, new parameterGroupEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.READ, new readEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.REPEAT, new repeatEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD0, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD1, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD2, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD3, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD4, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD5, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD6, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD7, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD8, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.VALUEGROUP, new valueGroupEndElementHandlerFunc()); }
boolean changed = (x != getX()) || (y != getY()) || (w != getWidth()) || (h != getHeight());
public void reshape(int x, int y, int w, int h) { boolean changed = (x != getX()) || (y != getY()) || (w != getWidth()) || (h != getHeight()); if (w != getWidth() || h != getHeight()) sizeChanged = true; super.reshape(x, y, w, h); if (changed) { damaged = true; fireStateChanged(); } }
if (changed)
if (sizeChanged)
public void reshape(int x, int y, int w, int h) { boolean changed = (x != getX()) || (y != getY()) || (w != getWidth()) || (h != getHeight()); if (w != getWidth() || h != getHeight()) sizeChanged = true; super.reshape(x, y, w, h); if (changed) { damaged = true; fireStateChanged(); } }
if (isShowing()) getView().validate();
public void scrollRectToVisible(Rectangle contentRect) { Point pos = getViewPosition(); Rectangle viewBounds = getView().getBounds(); Rectangle portBounds = getBounds(); // FIXME: should validate the view if it is not valid, however // this may cause excessive validation when the containment // hierarchy is being created. // if contentRect is larger than the portBounds, center the view if (contentRect.height > portBounds.height || contentRect.width > portBounds.width) { setViewPosition(new Point(contentRect.x, contentRect.y)); return; } // Y-DIRECTION if (contentRect.y < -viewBounds.y) setViewPosition(new Point(pos.x, contentRect.y)); else if (contentRect.y + contentRect.height > -viewBounds.y + portBounds.height) setViewPosition (new Point(pos.x, contentRect.y - (portBounds.height - contentRect.height))); // X-DIRECTION pos = getViewPosition(); if (contentRect.x < -viewBounds.x) setViewPosition(new Point(contentRect.x, pos.y)); else if (contentRect.x + contentRect.width > -viewBounds.x + portBounds.width) setViewPosition (new Point(contentRect.x - (portBounds.width - contentRect.width), pos.y)); }
if (contentRect.height > portBounds.height || contentRect.width > portBounds.width) { setViewPosition(new Point(contentRect.x, contentRect.y)); return; } if (contentRect.y < -viewBounds.y) setViewPosition(new Point(pos.x, contentRect.y)); else if (contentRect.y + contentRect.height > -viewBounds.y + portBounds.height) setViewPosition (new Point(pos.x, contentRect.y - (portBounds.height - contentRect.height))); pos = getViewPosition(); if (contentRect.x < -viewBounds.x) setViewPosition(new Point(contentRect.x, pos.y)); else if (contentRect.x + contentRect.width > -viewBounds.x + portBounds.width) setViewPosition (new Point(contentRect.x - (portBounds.width - contentRect.width), pos.y));
if (contentRect.y + contentRect.height + viewBounds.y > portBounds.height) pos.y = contentRect.y + contentRect.height - viewBounds.height; if (contentRect.y + viewBounds.y < 0) pos.y = contentRect.y; if (contentRect.x + contentRect.width + viewBounds.x > portBounds.width) pos.x = contentRect.x + contentRect.width - viewBounds.width; if (contentRect.x + viewBounds.x < 0) pos.x = contentRect.x; setViewPosition(pos);
public void scrollRectToVisible(Rectangle contentRect) { Point pos = getViewPosition(); Rectangle viewBounds = getView().getBounds(); Rectangle portBounds = getBounds(); // FIXME: should validate the view if it is not valid, however // this may cause excessive validation when the containment // hierarchy is being created. // if contentRect is larger than the portBounds, center the view if (contentRect.height > portBounds.height || contentRect.width > portBounds.width) { setViewPosition(new Point(contentRect.x, contentRect.y)); return; } // Y-DIRECTION if (contentRect.y < -viewBounds.y) setViewPosition(new Point(pos.x, contentRect.y)); else if (contentRect.y + contentRect.height > -viewBounds.y + portBounds.height) setViewPosition (new Point(pos.x, contentRect.y - (portBounds.height - contentRect.height))); // X-DIRECTION pos = getViewPosition(); if (contentRect.x < -viewBounds.x) setViewPosition(new Point(contentRect.x, pos.y)); else if (contentRect.x + contentRect.width > -viewBounds.x + portBounds.width) setViewPosition (new Point(contentRect.x - (portBounds.width - contentRect.width), pos.y)); }
while (getComponentCount() > 0) {
public void setView(Component v) { while (getComponentCount() > 0) { if (viewListener != null) getView().removeComponentListener(viewListener); //remove(0); } if (v != null) { if (viewListener == null) viewListener = createViewListener(); v.addComponentListener(viewListener); add(v); fireStateChanged(); } revalidate(); }
}
public void setView(Component v) { while (getComponentCount() > 0) { if (viewListener != null) getView().removeComponentListener(viewListener); //remove(0); } if (v != null) { if (viewListener == null) viewListener = createViewListener(); v.addComponentListener(viewListener); add(v); fireStateChanged(); } revalidate(); }
repaint();
public void setView(Component v) { while (getComponentCount() > 0) { if (viewListener != null) getView().removeComponentListener(viewListener); //remove(0); } if (v != null) { if (viewListener == null) viewListener = createViewListener(); v.addComponentListener(viewListener); add(v); fireStateChanged(); } revalidate(); }
super(p, q, g); this.y = y;
this(Registry.RAW_ENCODING_ID, p, q, g, y);
public DSSPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y) { super(p, q, g); this.y = y; }
throw new IllegalArgumentException("format");
throw new IllegalArgumentException("Unsupported encoding format: " + format);
public byte[] getEncoded(int format) { byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new DSSKeyPairRawCodec().encodePublicKey(this); break; default: throw new IllegalArgumentException("format"); } return result; }
IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPublicKey) codec.decodePublicKey(k);
return (DSSPublicKey) new DSSKeyPairRawCodec().decodePublicKey(k);
public static DSSPublicKey valueOf(byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_DSS_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } }
else
catch (IllegalArgumentException ignored)
public static DSSPublicKey valueOf(byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_DSS_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } }
throw new IllegalArgumentException("magic");
public static DSSPublicKey valueOf(byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_DSS_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } }
return (DSSPublicKey) new DSSKeyPairX509Codec().decodePublicKey(k);
public static DSSPublicKey valueOf(byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_DSS_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } }
keys.setKey( 29,new Key(KeyEvent.VK_CONTROL ));
keys.setKey(29, new Key((char) 0, KeyEvent.VK_CONTROL));
protected void initKeys(Keys keys) { Key key; keys.setKey( 1,new Key(KeyEvent.VK_ESCAPE)); keys.setKey( 2,new Key('1' ,KeyEvent.VK_1,'+' ,KeyEvent.VK_ADD ,'' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 3,new Key('2' ,KeyEvent.VK_2,'"' ,KeyEvent.VK_QUOTEDBL ,'@' ,KeyEvent.VK_AT)); keys.setKey( 4,new Key('3' ,KeyEvent.VK_3,'*' ,KeyEvent.VK_MULTIPLY ,'#' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 5,new Key('4' ,KeyEvent.VK_4,'' ,'')); keys.setKey( 6,new Key('5' ,KeyEvent.VK_5,'%' ,'')); keys.setKey( 7,new Key('6' ,KeyEvent.VK_6,'&' ,KeyEvent.VK_UNDEFINED ,'' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 8,new Key('7' ,KeyEvent.VK_7,'/' ,KeyEvent.VK_SLASH ,'|' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 9,new Key('8' ,KeyEvent.VK_8,'(' ,KeyEvent.VK_LEFT_PARENTHESIS ,'' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 10,new Key('9' ,KeyEvent.VK_9,')' ,KeyEvent.VK_RIGHT_PARENTHESIS)); keys.setKey( 11,new Key('0' ,KeyEvent.VK_0,'=' ,KeyEvent.VK_EQUALS)); keys.setKey( 12,new Key('\'',KeyEvent.VK_QUOTE ,'?' ,KeyEvent.VK_UNDEFINED , '', KeyEvent.VK_DEAD_ACUTE)); keys.setKey( 13,new Key('^',KeyEvent.VK_DEAD_CIRCUMFLEX ,'`',KeyEvent.VK_DEAD_GRAVE ,'~',KeyEvent.VK_UNDEFINED)); keys.setKey( 14,new Key('\b' ,KeyEvent.VK_BACK_SPACE)); keys.setKey( 15,new Key('\t' ,KeyEvent.VK_TAB)); keys.setKey( 16,new Key('q' ,'Q' ,KeyEvent.VK_Q)); keys.setKey( 17,new Key('w' ,'W' ,KeyEvent.VK_W)); keys.setKey( 18,new Key('e' ,'E' ,'' ,KeyEvent.VK_E)); keys.setKey( 19,new Key('r' ,'R' ,KeyEvent.VK_R)); keys.setKey( 20,new Key('t' ,'T' ,KeyEvent.VK_T)); keys.setKey( 21,new Key('z' ,'Z' ,KeyEvent.VK_Z)); keys.setKey( 22,new Key('u' ,'U' ,KeyEvent.VK_U)); key = keys.getKey(22); key.addDeadKeyChar(KeyEvent.VK_DEAD_DIAERESIS ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_CIRCUMFLEX,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_ACUTE ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_GRAVE ,new char[]{'' ,''}); keys.setKey( 23,new Key('i' ,'I' ,KeyEvent.VK_I)); key = keys.getKey(23); key.addDeadKeyChar(KeyEvent.VK_DEAD_DIAERESIS ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_CIRCUMFLEX,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_ACUTE ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_GRAVE ,new char[]{'' ,''}); keys.setKey( 24,new Key('o' ,'O' ,KeyEvent.VK_O)); key = keys.getKey(24); key.addDeadKeyChar(KeyEvent.VK_DEAD_DIAERESIS ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_CIRCUMFLEX,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_ACUTE ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_GRAVE ,new char[]{'' ,''}); keys.setKey( 25,new Key('p' ,'P' ,KeyEvent.VK_P)); keys.setKey( 26,new Key('' ,'' ,'[' ,KeyEvent.VK_OPEN_BRACKET)); keys.setKey( 27,new Key('' ,KeyEvent.VK_DEAD_DIAERESIS, '!', KeyEvent.VK_EXCLAMATION_MARK,']' ,KeyEvent.VK_CLOSE_BRACKET)); keys.setKey( 28,new Key('\n' ,KeyEvent.VK_ENTER)); keys.setKey( 29,new Key(KeyEvent.VK_CONTROL )); keys.setKey( 30,new Key('a' ,'A' ,'a' ,KeyEvent.VK_A)); key = keys.getKey(30); key.addDeadKeyChar(KeyEvent.VK_DEAD_DIAERESIS ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_CIRCUMFLEX,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_ACUTE ,new char[]{'' ,''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_GRAVE ,new char[]{'' ,''}); keys.setKey( 31,new Key('s' ,'S' ,KeyEvent.VK_S)); keys.setKey( 32,new Key('d' ,'D' ,KeyEvent.VK_D)); keys.setKey( 33,new Key('f' ,'F' ,KeyEvent.VK_F)); keys.setKey( 34,new Key('g' ,'G' ,KeyEvent.VK_G)); keys.setKey( 35,new Key('h' ,'H' ,KeyEvent.VK_H)); keys.setKey( 36,new Key('j' ,'J' ,KeyEvent.VK_J)); keys.setKey( 37,new Key('k' ,'K' ,KeyEvent.VK_K)); keys.setKey( 38,new Key('l' ,'L' ,KeyEvent.VK_L)); keys.setKey( 39,new Key('' ,'' ,KeyEvent.VK_UNDEFINED)); keys.setKey( 40,new Key('' ,'' ,'{',KeyEvent.VK_BRACELEFT)); keys.setKey( 41,new Key('' ,'')); keys.setKey( 42,new Key(KeyEvent.VK_SHIFT)); keys.setKey( 43,new Key('$' ,KeyEvent.VK_DOLLAR, '' ,KeyEvent.VK_UNDEFINED, '}',KeyEvent.VK_BRACERIGHT)); keys.setKey( 44,new Key('y' ,'Y' ,KeyEvent.VK_Y)); keys.setKey( 45,new Key('x' ,'X' ,KeyEvent.VK_X)); keys.setKey( 46,new Key('c' ,'C' ,KeyEvent.VK_C)); keys.setKey( 47,new Key('v' ,'V' ,KeyEvent.VK_V)); keys.setKey( 48,new Key('b' ,'B' ,KeyEvent.VK_B)); keys.setKey( 49,new Key('n' ,'N' ,KeyEvent.VK_N)); keys.setKey( 50,new Key('m' ,'M' ,KeyEvent.VK_M)); keys.setKey( 51,new Key(',',KeyEvent.VK_COMMA,';',KeyEvent.VK_SEMICOLON)); keys.setKey( 52,new Key('.',KeyEvent.VK_PERIOD,':',KeyEvent.VK_COLON)); keys.setKey( 53,new Key('-',KeyEvent.VK_MINUS,'_',KeyEvent.VK_UNDERSCORE)); keys.setKey( 54,new Key(KeyEvent.VK_SHIFT)); keys.setKey( 55,new Key(KeyEvent.VK_CONTROL)); keys.setKey( 56,new Key(KeyEvent.VK_ALT)); keys.setKey( 57,new Key(' ',KeyEvent.VK_SPACE)); key = keys.getKey(57); key.addDeadKeyChar(KeyEvent.VK_DEAD_DIAERESIS ,new char[]{''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_CIRCUMFLEX,new char[]{'^'}); key.addDeadKeyChar(KeyEvent.VK_DEAD_ACUTE ,new char[]{''}); key.addDeadKeyChar(KeyEvent.VK_DEAD_GRAVE ,new char[]{'`'}); keys.setKey( 58,new Key(KeyEvent.VK_CAPS_LOCK)); keys.setKey( 59,new Key(KeyEvent.VK_F1)); keys.setKey( 60,new Key(KeyEvent.VK_F2)); keys.setKey( 61,new Key(KeyEvent.VK_F3)); keys.setKey( 62,new Key(KeyEvent.VK_F4)); keys.setKey( 63,new Key(KeyEvent.VK_F5)); keys.setKey( 64,new Key(KeyEvent.VK_F6)); keys.setKey( 65,new Key(KeyEvent.VK_F7)); keys.setKey( 66,new Key(KeyEvent.VK_F8)); keys.setKey( 67,new Key(KeyEvent.VK_F9)); keys.setKey( 68,new Key(KeyEvent.VK_F10)); keys.setKey( 69,new Key(KeyEvent.VK_NUM_LOCK)); keys.setKey( 70,new Key(KeyEvent.VK_SCROLL_LOCK)); keys.setKey( 71,new Key('7',KeyEvent.VK_NUMPAD7)); keys.setKey( 72,new Key('8',KeyEvent.VK_NUMPAD8)); keys.setKey( 73,new Key('9',KeyEvent.VK_NUMPAD9)); keys.setKey( 74,new Key('-',KeyEvent.VK_SUBTRACT)); keys.setKey( 75,new Key('4',KeyEvent.VK_NUMPAD4)); keys.setKey( 76,new Key('5',KeyEvent.VK_NUMPAD5)); keys.setKey( 77,new Key('6',KeyEvent.VK_NUMPAD6)); keys.setKey( 78,new Key('+',KeyEvent.VK_ADD)); keys.setKey( 79,new Key('1',KeyEvent.VK_NUMPAD1)); keys.setKey( 80,new Key('2',KeyEvent.VK_NUMPAD2)); keys.setKey( 81,new Key('3',KeyEvent.VK_NUMPAD3)); keys.setKey( 82,new Key('0',KeyEvent.VK_NUMPAD0)); keys.setKey( 83,new Key('.',KeyEvent.VK_DECIMAL)); keys.setKey( 86,new Key('<',KeyEvent.VK_LESS,'>',KeyEvent.VK_GREATER,'\\',KeyEvent.VK_BACK_SLASH)); keys.setKey( 87,new Key(KeyEvent.VK_F11)); keys.setKey( 88,new Key(KeyEvent.VK_F12)); keys.setKey( 96,new Key(KeyEvent.VK_INSERT)); keys.setKey( 97,new Key(KeyEvent.VK_HOME)); keys.setKey( 98,new Key(KeyEvent.VK_PAGE_UP)); keys.setKey( 99,new Key('/',KeyEvent.VK_DIVIDE)); keys.setKey(100,new Key(KeyEvent.VK_PRINTSCREEN)); keys.setKey(101,new Key(KeyEvent.VK_DELETE)); keys.setKey(102,new Key(KeyEvent.VK_END)); keys.setKey(103,new Key(KeyEvent.VK_PAGE_DOWN)); keys.setKey(104,new Key(KeyEvent.VK_UP)); keys.setKey(105,new Key(KeyEvent.VK_SEPARATOR)); keys.setKey(111,new Key('/',KeyEvent.VK_SLASH)); keys.setKey(112,new Key(KeyEvent.VK_CONTROL)); keys.setKey(113,new Key(KeyEvent.VK_LEFT)); keys.setKey(114,new Key(KeyEvent.VK_DOWN)); keys.setKey(115,new Key(KeyEvent.VK_RIGHT)); keys.setKey(116,new Key(KeyEvent.VK_PAUSE)); }
Variable var = (Variable) sources.get(0); return var.simplify();
return first.simplify();
public Operand simplify() { int n = sources.size(); if (n == 1) { Variable var = (Variable) sources.get(0); return var.simplify(); } else { Variable first = (Variable) sources.get(0); // We can't use var.simplify() here because the result might // be a constant, which complicates code generation. // sources should contain only Variable instances. first = first.simplifyCopy(); for (int i=1; i<n; i+=1) { Variable var = (Variable) sources.get(i); var = var.simplifyCopy(); AssignQuad assignQuad = var.getAssignQuad(); // This is more efficient than generating phi moves at the end // of the block. Basically all phi sources are merged into the // first. assignQuad.setLHS(first); // This might be in a loop, in which case this variable is live // at least until the end of the loop. This looks tricky, but I // think it's correct. IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1); } // This is bold assumption that the first phi source was assigned // before any others. I'm not sure if this is always true... return first; } }
Variable first = (Variable) sources.get(0);
public Operand simplify() { int n = sources.size(); if (n == 1) { Variable var = (Variable) sources.get(0); return var.simplify(); } else { Variable first = (Variable) sources.get(0); // We can't use var.simplify() here because the result might // be a constant, which complicates code generation. // sources should contain only Variable instances. first = first.simplifyCopy(); for (int i=1; i<n; i+=1) { Variable var = (Variable) sources.get(i); var = var.simplifyCopy(); AssignQuad assignQuad = var.getAssignQuad(); // This is more efficient than generating phi moves at the end // of the block. Basically all phi sources are merged into the // first. assignQuad.setLHS(first); // This might be in a loop, in which case this variable is live // at least until the end of the loop. This looks tricky, but I // think it's correct. IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1); } // This is bold assumption that the first phi source was assigned // before any others. I'm not sure if this is always true... return first; } }
assignQuad.setLHS(first);
public Operand simplify() { int n = sources.size(); if (n == 1) { Variable var = (Variable) sources.get(0); return var.simplify(); } else { Variable first = (Variable) sources.get(0); // We can't use var.simplify() here because the result might // be a constant, which complicates code generation. // sources should contain only Variable instances. first = first.simplifyCopy(); for (int i=1; i<n; i+=1) { Variable var = (Variable) sources.get(i); var = var.simplifyCopy(); AssignQuad assignQuad = var.getAssignQuad(); // This is more efficient than generating phi moves at the end // of the block. Basically all phi sources are merged into the // first. assignQuad.setLHS(first); // This might be in a loop, in which case this variable is live // at least until the end of the loop. This looks tricky, but I // think it's correct. IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1); } // This is bold assumption that the first phi source was assigned // before any others. I'm not sure if this is always true... return first; } }
IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1);
if (assignQuad != null) { assignQuad.setLHS(first); IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1); } else { }
public Operand simplify() { int n = sources.size(); if (n == 1) { Variable var = (Variable) sources.get(0); return var.simplify(); } else { Variable first = (Variable) sources.get(0); // We can't use var.simplify() here because the result might // be a constant, which complicates code generation. // sources should contain only Variable instances. first = first.simplifyCopy(); for (int i=1; i<n; i+=1) { Variable var = (Variable) sources.get(i); var = var.simplifyCopy(); AssignQuad assignQuad = var.getAssignQuad(); // This is more efficient than generating phi moves at the end // of the block. Basically all phi sources are merged into the // first. assignQuad.setLHS(first); // This might be in a loop, in which case this variable is live // at least until the end of the loop. This looks tricky, but I // think it's correct. IRBasicBlock block = assignQuad.getBasicBlock().getLastPredecessor(); first.setLastUseAddress(block.getEndPC()-1); } // This is bold assumption that the first phi source was assigned // before any others. I'm not sure if this is always true... return first; } }
textComp.addCaretListener(this);
JTextComponent.this.addCaretListener(this); caretDot = getCaretPosition();
public AccessibleJTextComponent() { super(); textComp.addCaretListener(this); }
throws NotImplementedException
public void caretUpdate(CaretEvent e) throws NotImplementedException { // TODO: fire appropriate event. dot = e.getDot(); }
dot = e.getDot();
int dot = e.getDot(); int mark = e.getMark(); if (caretDot != dot) { firePropertyChange(ACCESSIBLE_CARET_PROPERTY, new Integer(caretDot), new Integer(dot)); caretDot = dot; } if (mark != dot) { firePropertyChange(ACCESSIBLE_SELECTION_PROPERTY, null, getSelectedText()); }
public void caretUpdate(CaretEvent e) throws NotImplementedException { // TODO: fire appropriate event. dot = e.getDot(); }
throws NotImplementedException
public void changedUpdate(DocumentEvent e) throws NotImplementedException { // TODO }
firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null, new Integer(e.getOffset()));
public void changedUpdate(DocumentEvent e) throws NotImplementedException { // TODO }
textComp.select(start, end); textComp.cut();
JTextComponent.this.select(start, end); JTextComponent.this.cut();
public void cut(int start, int end) { textComp.select(start, end); textComp.cut(); }
throws NotImplementedException
public boolean doAccessibleAction(int i) throws NotImplementedException { return false; // TODO }
return false;
boolean ret = false; Action[] actions = getActions(); if (i >= 0 && i < actions.length) { ActionEvent ev = new ActionEvent(JTextComponent.this, ActionEvent.ACTION_PERFORMED, null); actions[i].actionPerformed(ev); ret = true; } return ret;
public boolean doAccessibleAction(int i) throws NotImplementedException { return false; // TODO }
throws NotImplementedException
public int getAccessibleActionCount() throws NotImplementedException { return 0; // TODO }
return 0;
return getActions().length;
public int getAccessibleActionCount() throws NotImplementedException { return 0; // TODO }
throws NotImplementedException
public String getAccessibleActionDescription(int i) throws NotImplementedException { // TODO: Not implemented fully return super.getAccessibleDescription(); }
return super.getAccessibleDescription();
String desc = null; Action[] actions = getActions(); if (i >= 0 && i < actions.length) desc = (String) actions[i].getValue(Action.NAME); return desc;
public String getAccessibleActionDescription(int i) throws NotImplementedException { // TODO: Not implemented fully return super.getAccessibleDescription(); }
throws NotImplementedException
public AccessibleStateSet getAccessibleStateSet() throws NotImplementedException { AccessibleStateSet state = super.getAccessibleStateSet(); // TODO: Figure out what state must be added here to the super's state. return state; }
if (isEditable()) state.add(AccessibleState.EDITABLE);
public AccessibleStateSet getAccessibleStateSet() throws NotImplementedException { AccessibleStateSet state = super.getAccessibleStateSet(); // TODO: Figure out what state must be added here to the super's state. return state; }
throws NotImplementedException
public String getAfterIndex(int part, int index) throws NotImplementedException { return null; // TODO }
return null;
return getAtIndexImpl(part, index, 1);
public String getAfterIndex(int part, int index) throws NotImplementedException { return null; // TODO }
throws NotImplementedException
public String getAtIndex(int part, int index) throws NotImplementedException { return null; // TODO }
return null;
return getAtIndexImpl(part, index, 0);
public String getAtIndex(int part, int index) throws NotImplementedException { return null; // TODO }
throws NotImplementedException
public String getBeforeIndex(int part, int index) throws NotImplementedException { return null; // TODO }
return null;
return getAtIndexImpl(part, index, -1);
public String getBeforeIndex(int part, int index) throws NotImplementedException { return null; // TODO }