rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
System.out.println("\nrenameVariables block: " + block);
private void renameVariables(IRBasicBlock block) { System.out.println("\nrenameVariables block: " + block); doRenameVariables(block); Iterator it = block.getSuccessors().iterator(); while (it.hasNext()) { IRBasicBlock b = (IRBasicBlock) it.next(); rewritePhiParams(b); } it = block.getDominatedBlocks().iterator(); while (it.hasNext()) { IRBasicBlock b = (IRBasicBlock) it.next(); if (b != block) { renameVariables(b); } } popVariables(block); }
System.out.println("\nrewritePhiParams block: " + block);
private void rewritePhiParams(IRBasicBlock block) { if (block == null) { return; } System.out.println("\nrewritePhiParams block: " + block); Iterator it = block.getQuads().iterator(); while (it.hasNext()) { Quad q = (Quad) it.next(); if (q instanceof PhiAssignQuad) { PhiAssignQuad aq = (PhiAssignQuad) q; SSAStack st = getStack(aq.getLHS()); Variable var = st.peek(); if (var != null) { PhiOperand phi = (PhiOperand) aq.getPhiOperand(); phi.addSource(var); } } } }
SSAStack st = getStack(aq.getLHS()); Variable var = st.peek(); if (var != null) { PhiOperand phi = (PhiOperand) aq.getPhiOperand(); phi.addSource(var);
if (!aq.isDeadCode()) { SSAStack st = getStack(aq.getLHS()); Variable var = st.peek(); if (var != null) { PhiOperand phi = (PhiOperand) aq.getPhiOperand(); phi.addSource(var); } else { aq.setDeadCode(true); }
private void rewritePhiParams(IRBasicBlock block) { if (block == null) { return; } System.out.println("\nrewritePhiParams block: " + block); Iterator it = block.getQuads().iterator(); while (it.hasNext()) { Quad q = (Quad) it.next(); if (q instanceof PhiAssignQuad) { PhiAssignQuad aq = (PhiAssignQuad) q; SSAStack st = getStack(aq.getLHS()); Variable var = st.peek(); if (var != null) { PhiOperand phi = (PhiOperand) aq.getPhiOperand(); phi.addSource(var); } } } }
uninstallDefaultChoosers();
public void uninstallUI(JComponent c) { uninstallListeners(); uninstallDefaults(); pane = null; chooser = null; }
if (title == null || mnemonicKey == 0 || title.charAt(index) != mnemonicKey)
if (title == null || mnemonicKey == 0 || (index > -1 && title.charAt(index) != mnemonicKey))
public void setDisplayedMnemonicIndex(int index) throws IllegalArgumentException { if (index < -1 || title != null && index >= title.length()) throw new IllegalArgumentException(); if (title == null || mnemonicKey == 0 || title.charAt(index) != mnemonicKey) index = -1; underlinedChar = index; }
if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) {
if (isLinux && e.getKeyCode() == KeyEvent.VK_ALT_GRAPH) {
void processVTKeyReleased(KeyEvent e){ displayInfo(e); if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) { isAltGr = false; } int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e;// displayInfo(e,"Released added"); dialog.setVisible(false); dialog.dispose(); } }
String currentValue = getValue(); if(currentValue == null) currentValue = new String (); currentValue.concat(text); setValue(currentValue);
StringBuffer newValue = new StringBuffer (); String currentValue; if ( (currentValue = getValue()) != null ) newValue.append(currentValue); newValue.append(text); setValue(newValue.toString());
public void addText (String text) { String currentValue = getValue(); if(currentValue == null) currentValue = new String (); // yes, this can happen currentValue.concat(text); setValue(currentValue); }
dialog.show();
dialog.setVisible(true);
public static void doEntry(Frame parent, String propKey, Properties props2) { props = props2; confTabs = new JTabbedPane(); ec = new JCheckBox(LangTool.getString("conf.labelEnhanced")); tc = new JCheckBox(LangTool.getString("conf.labelUseSystemName")); sdn = new JCheckBox(LangTool.getString("conf.labelUseHostName")); useProxy = new JCheckBox(LangTool.getString("conf.labelUseProxy")); sdNormal = new JRadioButton(LangTool.getString("conf.label24")); JRadioButton sdBig = new JRadioButton(LangTool.getString("conf.label27")); noEmbed = new JCheckBox(LangTool.getString("conf.labelEmbed")); deamon = new JCheckBox(LangTool.getString("conf.labelDeamon")); newJVM = new JCheckBox(LangTool.getString("conf.labelNewJVM")); heartBeat = new JCheckBox(LangTool.getString("conf.labelHeartBeat")); jtb = new JCheckBox("AS/400 Toolbox"); jtb.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { doCPStateChanged(e); } }); cpb = new JComboBox(); String[] availCP = getAvailableCodePages(); cpb.addItem(LangTool.getString("conf.labelDefault")); for (int x = 0; x < availCP.length; x++) { cpb.addItem(availCP[x]); } sslType = new JComboBox(); for (int x = 0; x < SSL_TYPES.length; x++) { sslType.addItem(SSL_TYPES[x]); } if (propKey == null) { systemName = new JTextField(20); systemId = new JTextField(20); port = new JTextField("23",5); deviceName = new JTextField(20); fpn = new JTextField(20); proxyHost = new JTextField(20); proxyPort = new JTextField("1080",5); ec.setSelected(true); tc.setSelected(true); jtb.setSelected(false); sdNormal.setSelected(true); deamon.setSelected(true); newJVM.setEnabled(false); noEmbed.setEnabled(false); deamon.setEnabled(false); systemName.setDocument(new SomethingEnteredDocument()); } else { String[] args = new String[20]; parseArgs((String)props.get(propKey),args); systemName = new JTextField(propKey,20); systemName.setEditable(false); systemName.setEnabled(false); systemId = new JTextField(args[0],20); if (isSpecified("-p",args)) { port = new JTextField(getParm("-p",args),5); } else { port = new JTextField("23",5); } if (isSpecified("-sslType",args)) sslType.setSelectedItem(getParm("-sslType",args)); if (isSpecified("-sph",args)) proxyHost = new JTextField(getParm("-sph",args),20); else proxyHost = new JTextField(20); if (isSpecified("-f",args)) fpn = new JTextField(getParm("-f",args),20); else fpn = new JTextField(20); if (isSpecified("-cp",args)) { String codepage = getParm("-cp",args); String[] acps = CharMappings.getAvailableCodePages(); jtb.setSelected(true); for (int x = 0; x < acps.length; x++) { if (acps[x].equals(codepage)) jtb.setSelected(false); } cpb.setSelectedItem(codepage); } if (isSpecified("-e",args)) ec.setSelected(true); else ec.setSelected(false); if (isSpecified("-t",args)) tc.setSelected(true); else tc.setSelected(false); if (isSpecified("-132",args)) sdBig.setSelected(true); else sdNormal.setSelected(true); if (isSpecified("-dn",args)) deviceName = new JTextField(getParm("-dn",args),20); else deviceName = new JTextField(20); if (isSpecified("-dn=hostname",args)) { sdn.setSelected(true); deviceName.setEnabled(false); } else { sdn.setSelected(false); deviceName.setEnabled(true); } if (isSpecified("-spp",args)) { proxyPort = new JTextField(getParm("-spp",args),5); } else { proxyPort = new JTextField("1080",5); } if (isSpecified("-usp",args)) useProxy.setSelected(true); else useProxy.setSelected(false); if (isSpecified("-noembed",args)) noEmbed.setSelected(true); else noEmbed.setSelected(false); if (isSpecified("-d",args)) deamon.setSelected(true); else deamon.setSelected(false); if (isSpecified("-nc",args)) newJVM.setSelected(true); else newJVM.setSelected(false); if (isSpecified("-hb",args)) heartBeat.setSelected(true); else heartBeat.setSelected(false); if (isSpecified("-hb",args)) heartBeat.setSelected(true); else heartBeat.setSelected(false); } //Create main attributes panel JPanel mp = new JPanel(); BoxLayout mpLayout = new BoxLayout(mp,BoxLayout.Y_AXIS); mp.setLayout(mpLayout); //System Name panel JPanel snp = new JPanel(); AlignLayout snpLayout = new AlignLayout(2,5,5); snp.setLayout(snpLayout); snp.setBorder(BorderFactory.createEtchedBorder()); addLabelComponent(LangTool.getString("conf.labelSystemName"), systemName, snp); addLabelComponent(" ", noEmbed, snp); addLabelComponent(" ", deamon, snp); addLabelComponent(" ", newJVM, snp); //System Id panel JPanel sip = new JPanel(); AlignLayout al = new AlignLayout(2,5,5); sip.setLayout(al); sip.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelSystemIdTitle"))); addLabelComponent(LangTool.getString("conf.labelSystemId"), systemId, sip); addLabelComponent(LangTool.getString("conf.labelPort"), port, sip); addLabelComponent(LangTool.getString("conf.labelDeviceName"), deviceName, sip); addLabelComponent("", sdn, sip); sdn.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { doItemStateChanged(e); } }); addLabelComponent(LangTool.getString("conf.labelSSLType"), sslType, sip); addLabelComponent("", heartBeat, sip); // options panel JPanel op = new JPanel(); BoxLayout opLayout = new BoxLayout(op,BoxLayout.Y_AXIS); op.setLayout(opLayout); op.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelOptionsTitle"))); // file name panel JPanel fp = new JPanel(); BoxLayout fpLayout = new BoxLayout(fp,BoxLayout.Y_AXIS); fp.setLayout(fpLayout); fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelConfFile"))); fp.add(fpn); // screen dimensions panel JPanel sdp = new JPanel(); BoxLayout sdpLayout = new BoxLayout(sdp,BoxLayout.X_AXIS); sdp.setLayout(sdpLayout); sdp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelDimensions"))); // Group the radio buttons. ButtonGroup sdGroup = new ButtonGroup(); sdGroup.add(sdNormal); sdGroup.add(sdBig); sdp.add(sdNormal); sdp.add(sdBig); // code page panel JPanel cp = new JPanel(); BoxLayout cpLayout = new BoxLayout(cp,BoxLayout.X_AXIS); cp.setLayout(cpLayout); cp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelCodePage"))); cp.add(cpb); cp.add(jtb); // emulation mode panel JPanel ep = new JPanel(); BoxLayout epLayout = new BoxLayout(ep,BoxLayout.X_AXIS); ep.setLayout(epLayout); ep.setBorder(BorderFactory.createTitledBorder( LangTool.getString("conf.labelEmulateMode"))); ep.add(ec); // title to be use panel JPanel tp = new JPanel(); BoxLayout tpLayout = new BoxLayout(tp,BoxLayout.X_AXIS); tp.setLayout(tpLayout); tp.setBorder(BorderFactory.createTitledBorder( "")); addLabelComponent("", tc, tp); // add all options to Options panel op.add(fp); op.add(sdp); op.add(cp); op.add(ep); op.add(tp); //System Id panel JPanel sprox = new JPanel(); AlignLayout spal = new AlignLayout(2,5,5); sprox.setLayout(spal); sprox.setBorder(BorderFactory.createEtchedBorder()); addLabelComponent("", useProxy, sprox); addLabelComponent(LangTool.getString("conf.labelProxyHost"), proxyHost, sprox); addLabelComponent(LangTool.getString("conf.labelProxyPort"), proxyPort, sprox); confTabs.addTab(LangTool.getString("conf.tabGeneral"),snp); confTabs.addTab(LangTool.getString("conf.tabTCP"),sip); confTabs.addTab(LangTool.getString("conf.tabOptions"),op); confTabs.addTab(LangTool.getString("conf.tabProxy"),sprox); if (systemName.getText().trim().length() <= 0) { confTabs.setEnabledAt(1,false); confTabs.setEnabledAt(2,false); confTabs.setEnabledAt(3,false); } systemName.setAlignmentX(Component.CENTER_ALIGNMENT); systemId.setAlignmentX(Component.CENTER_ALIGNMENT); fpn.setAlignmentX(Component.CENTER_ALIGNMENT); cpb.setAlignmentX(Component.CENTER_ALIGNMENT); Object[] message = new Object[1]; message[0] = confTabs; options = new JButton[2]; String title; final String propKey2 = propKey; if (propKey2 == null) { Action add = new AbstractAction(LangTool.getString("conf.optAdd")) { public void actionPerformed(ActionEvent e) { doConfigureAction(propKey2); } }; options[0] = new JButton(add); ((JButton)options[0]).setEnabled(false); title = LangTool.getString("conf.addEntryATitle"); } else { Action edit = new AbstractAction(LangTool.getString("conf.optEdit")) { public void actionPerformed(ActionEvent e) { doConfigureAction(propKey2); } }; options[0] = new JButton(edit); title = LangTool.getString("conf.addEntryETitle"); } Action cancel = new AbstractAction(LangTool.getString("conf.optCancel")) { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }; options[1] = new JButton(cancel); JOptionPane pane = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options, options[0]); Component parentComponent = parent; pane.setInitialValue(options[0]); pane.setComponentOrientation(parentComponent.getComponentOrientation()); dialog = pane.createDialog(parentComponent, title); //, JRootPane.PLAIN_DIALOG); dialog.show(); }
public InvalidOpcodeException(String s) { super(s);
public InvalidOpcodeException() { super();
public InvalidOpcodeException(String s) { super(s); }
public KeyStoreException(String msg)
public KeyStoreException()
public KeyStoreException(String msg) { super(msg); }
super(msg);
public KeyStoreException(String msg) { super(msg); }
super.addRequestProperty(key, value);
public void addRequestProperty(String key, String value) { String old = requestHeaders.getValue(key); if (old == null) { requestHeaders.put(key, value); } else { requestHeaders.put(key, old + "," + value); } }
if (isRedirect(response) && getInstanceFollowRedirects())
if (response.isRedirect() && getInstanceFollowRedirects())
public void connect() throws IOException { if (connected) { return; } String protocol = url.getProtocol(); boolean secure = "https".equals(protocol); String host = url.getHost(); int port = url.getPort(); if (port < 0) { port = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } String file = url.getFile(); String username = url.getUserInfo(); String password = null; if (username != null) { int ci = username.indexOf(':'); if (ci != -1) { password = username.substring(ci + 1); username = username.substring(0, ci); } } final Credentials creds = (username == null) ? null : new Credentials (username, password); boolean retry; do { retry = false; if (connection == null) { connection = getConnection(host, port, secure); if (secure) { SSLSocketFactory factory = getSSLSocketFactory(); HostnameVerifier verifier = getHostnameVerifier(); if (factory != null) { connection.setSSLSocketFactory(factory); } connection.addHandshakeCompletedListener(this); // TODO verifier } } if (proxyHostname != null) { if (proxyPort < 0) { proxyPort = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } connection.setProxy(proxyHostname, proxyPort); } try { request = connection.newRequest(method, file); if (!keepAlive) { request.setHeader("Connection", "close"); } if (agent != null) { request.setHeader("User-Agent", agent); } request.getHeaders().putAll(requestHeaders); if (requestSink != null) { byte[] content = requestSink.toByteArray(); RequestBodyWriter writer = new ByteArrayRequestBodyWriter(content); request.setRequestBodyWriter(writer); } if (creds != null) { request.setAuthenticator(new Authenticator() { public Credentials getCredentials(String realm, int attempts) { return (attempts < 2) ? creds : null; } }); } response = request.dispatch(); } catch (IOException ioe) { if (connection.useCount > 0) { // Connection re-use failed: Try a new connection. try { connection.close(); } catch (IOException _) { // Ignore. } connection = null; retry = true; continue; } else { // First time the connection was used: Hard failure. throw ioe; } } if (isRedirect(response) && getInstanceFollowRedirects()) { // Read the response body, if there is one. If the // redirect points us back at the same server, we will use // the cached connection, so we must make sure there is no // pending data in it. InputStream body = response.getBody(); if (body != null) { byte[] ignore = new byte[1024]; while (true) { int n = body.read(ignore, 0, ignore.length); if (n == -1) break; } } // Follow redirect String location = response.getHeader("Location"); if (location != null) { String connectionUri = connection.getURI(); int start = connectionUri.length(); if (location.startsWith(connectionUri) && location.charAt(start) == '/') { file = location.substring(start); retry = true; } else if (location.startsWith("http:")) { connection.close(); connection = null; secure = false; start = 7; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTP_PORT; } file = location.substring(end); retry = true; } else if (location.startsWith("https:")) { connection.close(); connection = null; secure = true; start = 8; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTPS_PORT; } file = location.substring(end); retry = true; } else if (location.length() > 0) { // Malformed absolute URI, treat as file part of URI if (location.charAt(0) == '/') { // Absolute path file = location; } else { // Relative path int lsi = file.lastIndexOf('/'); file = (lsi == -1) ? "/" : file.substring(0, lsi + 1); file += location; } retry = true; } } } else { responseSink = response.getBody(); if (response.getCode() == 404) { errorSink = responseSink; throw new FileNotFoundException(url.toString()); } } } while (retry); connected = true; }
if (response.getCode() == 404) {
if (response.isError())
public void connect() throws IOException { if (connected) { return; } String protocol = url.getProtocol(); boolean secure = "https".equals(protocol); String host = url.getHost(); int port = url.getPort(); if (port < 0) { port = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } String file = url.getFile(); String username = url.getUserInfo(); String password = null; if (username != null) { int ci = username.indexOf(':'); if (ci != -1) { password = username.substring(ci + 1); username = username.substring(0, ci); } } final Credentials creds = (username == null) ? null : new Credentials (username, password); boolean retry; do { retry = false; if (connection == null) { connection = getConnection(host, port, secure); if (secure) { SSLSocketFactory factory = getSSLSocketFactory(); HostnameVerifier verifier = getHostnameVerifier(); if (factory != null) { connection.setSSLSocketFactory(factory); } connection.addHandshakeCompletedListener(this); // TODO verifier } } if (proxyHostname != null) { if (proxyPort < 0) { proxyPort = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } connection.setProxy(proxyHostname, proxyPort); } try { request = connection.newRequest(method, file); if (!keepAlive) { request.setHeader("Connection", "close"); } if (agent != null) { request.setHeader("User-Agent", agent); } request.getHeaders().putAll(requestHeaders); if (requestSink != null) { byte[] content = requestSink.toByteArray(); RequestBodyWriter writer = new ByteArrayRequestBodyWriter(content); request.setRequestBodyWriter(writer); } if (creds != null) { request.setAuthenticator(new Authenticator() { public Credentials getCredentials(String realm, int attempts) { return (attempts < 2) ? creds : null; } }); } response = request.dispatch(); } catch (IOException ioe) { if (connection.useCount > 0) { // Connection re-use failed: Try a new connection. try { connection.close(); } catch (IOException _) { // Ignore. } connection = null; retry = true; continue; } else { // First time the connection was used: Hard failure. throw ioe; } } if (isRedirect(response) && getInstanceFollowRedirects()) { // Read the response body, if there is one. If the // redirect points us back at the same server, we will use // the cached connection, so we must make sure there is no // pending data in it. InputStream body = response.getBody(); if (body != null) { byte[] ignore = new byte[1024]; while (true) { int n = body.read(ignore, 0, ignore.length); if (n == -1) break; } } // Follow redirect String location = response.getHeader("Location"); if (location != null) { String connectionUri = connection.getURI(); int start = connectionUri.length(); if (location.startsWith(connectionUri) && location.charAt(start) == '/') { file = location.substring(start); retry = true; } else if (location.startsWith("http:")) { connection.close(); connection = null; secure = false; start = 7; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTP_PORT; } file = location.substring(end); retry = true; } else if (location.startsWith("https:")) { connection.close(); connection = null; secure = true; start = 8; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTPS_PORT; } file = location.substring(end); retry = true; } else if (location.length() > 0) { // Malformed absolute URI, treat as file part of URI if (location.charAt(0) == '/') { // Absolute path file = location; } else { // Relative path int lsi = file.lastIndexOf('/'); file = (lsi == -1) ? "/" : file.substring(0, lsi + 1); file += location; } retry = true; } } } else { responseSink = response.getBody(); if (response.getCode() == 404) { errorSink = responseSink; throw new FileNotFoundException(url.toString()); } } } while (retry); connected = true; }
throw new FileNotFoundException(url.toString()); }
public void connect() throws IOException { if (connected) { return; } String protocol = url.getProtocol(); boolean secure = "https".equals(protocol); String host = url.getHost(); int port = url.getPort(); if (port < 0) { port = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } String file = url.getFile(); String username = url.getUserInfo(); String password = null; if (username != null) { int ci = username.indexOf(':'); if (ci != -1) { password = username.substring(ci + 1); username = username.substring(0, ci); } } final Credentials creds = (username == null) ? null : new Credentials (username, password); boolean retry; do { retry = false; if (connection == null) { connection = getConnection(host, port, secure); if (secure) { SSLSocketFactory factory = getSSLSocketFactory(); HostnameVerifier verifier = getHostnameVerifier(); if (factory != null) { connection.setSSLSocketFactory(factory); } connection.addHandshakeCompletedListener(this); // TODO verifier } } if (proxyHostname != null) { if (proxyPort < 0) { proxyPort = secure ? HTTPConnection.HTTPS_PORT : HTTPConnection.HTTP_PORT; } connection.setProxy(proxyHostname, proxyPort); } try { request = connection.newRequest(method, file); if (!keepAlive) { request.setHeader("Connection", "close"); } if (agent != null) { request.setHeader("User-Agent", agent); } request.getHeaders().putAll(requestHeaders); if (requestSink != null) { byte[] content = requestSink.toByteArray(); RequestBodyWriter writer = new ByteArrayRequestBodyWriter(content); request.setRequestBodyWriter(writer); } if (creds != null) { request.setAuthenticator(new Authenticator() { public Credentials getCredentials(String realm, int attempts) { return (attempts < 2) ? creds : null; } }); } response = request.dispatch(); } catch (IOException ioe) { if (connection.useCount > 0) { // Connection re-use failed: Try a new connection. try { connection.close(); } catch (IOException _) { // Ignore. } connection = null; retry = true; continue; } else { // First time the connection was used: Hard failure. throw ioe; } } if (isRedirect(response) && getInstanceFollowRedirects()) { // Read the response body, if there is one. If the // redirect points us back at the same server, we will use // the cached connection, so we must make sure there is no // pending data in it. InputStream body = response.getBody(); if (body != null) { byte[] ignore = new byte[1024]; while (true) { int n = body.read(ignore, 0, ignore.length); if (n == -1) break; } } // Follow redirect String location = response.getHeader("Location"); if (location != null) { String connectionUri = connection.getURI(); int start = connectionUri.length(); if (location.startsWith(connectionUri) && location.charAt(start) == '/') { file = location.substring(start); retry = true; } else if (location.startsWith("http:")) { connection.close(); connection = null; secure = false; start = 7; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTP_PORT; } file = location.substring(end); retry = true; } else if (location.startsWith("https:")) { connection.close(); connection = null; secure = true; start = 8; int end = location.indexOf('/', start); host = location.substring(start, end); int ci = host.lastIndexOf(':'); if (ci != -1) { port = Integer.parseInt(host.substring (ci + 1)); host = host.substring(0, ci); } else { port = HTTPConnection.HTTPS_PORT; } file = location.substring(end); retry = true; } else if (location.length() > 0) { // Malformed absolute URI, treat as file part of URI if (location.charAt(0) == '/') { // Absolute path file = location; } else { // Relative path int lsi = file.lastIndexOf('/'); file = (lsi == -1) ? "/" : file.substring(0, lsi + 1); file += location; } retry = true; } } } else { responseSink = response.getBody(); if (response.getCode() == 404) { errorSink = responseSink; throw new FileNotFoundException(url.toString()); } } } while (retry); connected = true; }
if (response.isError()) { int code = response.getCode(); if (code == 404 || code == 410) throw new FileNotFoundException(url.toString()); throw new IOException("Server returned HTTP response code " + code + " for URL " + url.toString()); }
public InputStream getInputStream() throws IOException { if (!connected) { connect(); } if (!doInput) { throw new ProtocolException("doInput is false"); } return responseSink; }
if (connected) throw new IllegalStateException("Already connected");
public Map getRequestProperties() { return requestHeaders; }
if (key == null) return null;
public String getRequestProperty(String key) { return requestHeaders.getValue(key); }
super.setRequestProperty(key, value);
public void setRequestProperty(String key, String value) { requestHeaders.put(key, value); }
iNode.decLocked();
public void setLength(long length) throws IOException { if (!canWrite()) throw new ReadOnlyFileSystemException( "FileSystem or File is readonly"); long blockSize = iNode.getExt2FileSystem().getBlockSize(); //synchronize to the inode cache to make sure that the inode does not // get //flushed between reading it and locking it synchronized (((Ext2FileSystem) getFileSystem()).getInodeCache()) { //reread the inode before synchronizing to it to make sure //all threads use the same instance rereadInode(); //lock the inode into the cache so it is not flushed before // synchronizing to it //(otherwise a new instance of INode referring to the same inode // could be put //in the cache resulting in the possibility of two threads // manipulating the same //inode at the same time because they would synchronize to // different INode instances) iNode.incLocked(); } //a single inode may be represented by more than one Ext2Directory // instances, //but each will use the same instance of the underlying inode (see // Ext2FileSystem.getINode()), //so synchronize to the inode synchronized (iNode) { try { //if length<getLength(), then the file is truncated if (length < getLength()) { long blockNr = length / blockSize; long blockOffset = length % blockSize; long nextBlock; if (blockOffset == 0) nextBlock = blockNr; else nextBlock = blockNr + 1; for (long i = iNode.getAllocatedBlockCount() - 1; i >= nextBlock; i--) { log.debug("setLength(): freeing up block " + i + " of inode"); iNode.freeDataBlock(i); } iNode.setSize(length); iNode.setMtime(System.currentTimeMillis() / 1000); //setLength done, unlock the inode from the cache iNode.decLocked(); return; } //if length>getLength(), then new blocks are allocated for the // file //The content of the new blocks is undefined (see the // setLength(long i) //method of java.io.RandomAccessFile if (length > getLength()) { long len = length - getLength(); long blocksAllocated = getLengthInBlocks(); long bytesAllocated = getLength(); long bytesCovered = 0; while (bytesCovered < len) { long blockIndex = (bytesAllocated + bytesCovered) / blockSize; long blockOffset = (bytesAllocated + bytesCovered) % blockSize; long newSection = Math.min(len - bytesCovered, blockSize - blockOffset); //allocate a new block if needed if (blockIndex >= blocksAllocated) { iNode.allocateDataBlock(blockIndex); blocksAllocated++; } bytesCovered += newSection; } iNode.setSize(length); iNode.setMtime(System.currentTimeMillis() / 1000); return; } } catch (Throwable ex) { final IOException ioe = new IOException(); ioe.initCause(ex); throw ioe; } finally { //setLength done, unlock the inode from the cache iNode.decLocked(); } } // synchronized(inode) }
jComponent.doLayout();
public void beginValidate() { jComponent.doLayout(); }
super(toolkit, canvas, new JCanvas()); this.canvas = canvas;
super(toolkit, canvas, new SwingCanvas(canvas));
public SwingCanvasPeer(SwingToolkit toolkit, Canvas canvas) { super(toolkit, canvas, new JCanvas()); this.canvas = canvas; SwingToolkit.add(canvas, jComponent); SwingToolkit.copyAwtProperties(canvas, jComponent); }
res.put("gnu.classpath.home.url", "system: res.put("gnu.classpath.vm.shortname", "jnode");
public static void insertSystemProperties(Properties res) { final Vm vm = Vm.getVm(); final VmArchitecture arch = vm.getArch(); // Java properties res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", vm.getVersion()); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch.getName()); res.put("os.version", vm.getVersion()); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); // Log4j properties res.put("log4j.defaultInitOverride", "true"); // GNU properties res.put("gnu.cpu.endian", (arch.getByteOrder() == ByteOrder.BIG_ENDIAN) ? "big" : "little");// res.put("gnu.java.io.encoding_scheme_alias.US-ASCII", "ISO8859-1");// res.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE");// res.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE"); }
}
public char last() { if (count == 0) return DONE; current = getEndIndex() - 1; return array[current]; }
point.x = size.width + xOffset;
point.x = xOffset;
protected Point getPopupMenuOrigin() { // The menu's screen location and size. Point screenLoc = getLocationOnScreen(); Dimension size = getSize(); // Determine the popup's size. JPopupMenu popup = getPopupMenu(); Dimension popupSize = popup.getSize(); if (popupSize.width == 0 || popupSize.height == 0) popupSize = popup.getPreferredSize(); // Determine screen bounds. Toolkit tk = Toolkit.getDefaultToolkit(); Rectangle screenBounds = new Rectangle(tk.getScreenSize()); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gd.getDefaultConfiguration(); Insets screenInsets = tk.getScreenInsets(gc); screenBounds.x -= screenInsets.left; screenBounds.width -= screenInsets.left + screenInsets.right; screenBounds.y -= screenInsets.top; screenBounds.height -= screenInsets.top + screenInsets.bottom; screenLoc.x -= screenInsets.left; screenLoc.y -= screenInsets.top; Point point = new Point(); if (isTopLevelMenu()) { // If menu in the menu bar. int xOffset = UIManager.getInt("Menu.menuPopupOffsetX"); int yOffset = UIManager.getInt("Menu.menuPopupOffsetY"); // Determine X location. if (getComponentOrientation().isLeftToRight()) { // Prefer popup to the right. point.x = xOffset; // Check if it fits, otherwise place popup wherever it fits. if (screenLoc.x + point.x + popupSize.width > screenBounds.width + screenBounds.width && screenBounds.width - size.width < 2 * (screenLoc.x - screenBounds.x)) // Popup to the right if there's not enough room. point.x = size.width - xOffset - popupSize.width; } else { // Prefer popup to the left. point.x = size.width - xOffset - popupSize.width; if (screenLoc.x + point.x < screenBounds.x && screenBounds.width - size.width > 2 * (screenLoc.x - screenBounds.x)) // Popup to the left if there's not enough room. point.x = xOffset; } // Determine Y location. Prefer popping down. point.y = size.height + yOffset; if (screenLoc.y + point.y + popupSize.height >= screenBounds.height && screenBounds.height - size.height < 2 * (screenLoc.y - screenBounds.y)) // Position above if there's not enough room below. point.y = - yOffset - popupSize.height; } else { // If submenu. int xOffset = UIManager.getInt("Menu.submenuPopupOffsetX"); int yOffset = UIManager.getInt("Menu.submenuPopupOffsetY"); // Determine X location. if (getComponentOrientation().isLeftToRight()) { // Prefer popup to the right. point.x = size.width + xOffset; if (screenLoc.x + point.x + popupSize.width >= screenBounds.x + screenBounds.width && screenBounds.width - size.width < 2 * (screenLoc.x - screenBounds.x)) // Position to the left if there's not enough room on the right. point.x = - xOffset - popupSize.width; } else { // Prefer popup on the left side. point.x = - xOffset - popupSize.width; if (screenLoc.x + point.x < screenBounds.x && screenBounds.width - size.width > 2 * (screenLoc.x - screenBounds.x)) // Popup to the right if there's not enough room. point.x = size.width + xOffset; } // Determine Y location. Prefer popping down. point.y = yOffset; if (screenLoc.y + point.y + popupSize.height >= screenBounds.y + screenBounds.height && screenBounds.height - size.height < 2 * (screenLoc.y - screenBounds.y)) { // Pop up if there's not enough room below.// @classpath-bugfix 6/9/2006 Martin Husted Hartvig ([email protected]) : point.y = screenLoc.y - screenBounds.y + size.height - yOffset - popupSize.height;// @classpath-bugfix-end } } return point; }
point.y = screenLoc.y - screenBounds.y + size.height - yOffset - popupSize.height;
point.y = size.height - yOffset - popupSize.height;
protected Point getPopupMenuOrigin() { // The menu's screen location and size. Point screenLoc = getLocationOnScreen(); Dimension size = getSize(); // Determine the popup's size. JPopupMenu popup = getPopupMenu(); Dimension popupSize = popup.getSize(); if (popupSize.width == 0 || popupSize.height == 0) popupSize = popup.getPreferredSize(); // Determine screen bounds. Toolkit tk = Toolkit.getDefaultToolkit(); Rectangle screenBounds = new Rectangle(tk.getScreenSize()); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gd.getDefaultConfiguration(); Insets screenInsets = tk.getScreenInsets(gc); screenBounds.x -= screenInsets.left; screenBounds.width -= screenInsets.left + screenInsets.right; screenBounds.y -= screenInsets.top; screenBounds.height -= screenInsets.top + screenInsets.bottom; screenLoc.x -= screenInsets.left; screenLoc.y -= screenInsets.top; Point point = new Point(); if (isTopLevelMenu()) { // If menu in the menu bar. int xOffset = UIManager.getInt("Menu.menuPopupOffsetX"); int yOffset = UIManager.getInt("Menu.menuPopupOffsetY"); // Determine X location. if (getComponentOrientation().isLeftToRight()) { // Prefer popup to the right. point.x = xOffset; // Check if it fits, otherwise place popup wherever it fits. if (screenLoc.x + point.x + popupSize.width > screenBounds.width + screenBounds.width && screenBounds.width - size.width < 2 * (screenLoc.x - screenBounds.x)) // Popup to the right if there's not enough room. point.x = size.width - xOffset - popupSize.width; } else { // Prefer popup to the left. point.x = size.width - xOffset - popupSize.width; if (screenLoc.x + point.x < screenBounds.x && screenBounds.width - size.width > 2 * (screenLoc.x - screenBounds.x)) // Popup to the left if there's not enough room. point.x = xOffset; } // Determine Y location. Prefer popping down. point.y = size.height + yOffset; if (screenLoc.y + point.y + popupSize.height >= screenBounds.height && screenBounds.height - size.height < 2 * (screenLoc.y - screenBounds.y)) // Position above if there's not enough room below. point.y = - yOffset - popupSize.height; } else { // If submenu. int xOffset = UIManager.getInt("Menu.submenuPopupOffsetX"); int yOffset = UIManager.getInt("Menu.submenuPopupOffsetY"); // Determine X location. if (getComponentOrientation().isLeftToRight()) { // Prefer popup to the right. point.x = size.width + xOffset; if (screenLoc.x + point.x + popupSize.width >= screenBounds.x + screenBounds.width && screenBounds.width - size.width < 2 * (screenLoc.x - screenBounds.x)) // Position to the left if there's not enough room on the right. point.x = - xOffset - popupSize.width; } else { // Prefer popup on the left side. point.x = - xOffset - popupSize.width; if (screenLoc.x + point.x < screenBounds.x && screenBounds.width - size.width > 2 * (screenLoc.x - screenBounds.x)) // Popup to the right if there's not enough room. point.x = size.width + xOffset; } // Determine Y location. Prefer popping down. point.y = yOffset; if (screenLoc.y + point.y + popupSize.height >= screenBounds.y + screenBounds.height && screenBounds.height - size.height < 2 * (screenLoc.y - screenBounds.y)) { // Pop up if there's not enough room below.// @classpath-bugfix 6/9/2006 Martin Husted Hartvig ([email protected]) : point.y = screenLoc.y - screenBounds.y + size.height - yOffset - popupSize.height;// @classpath-bugfix-end } } return point; }
return elt.getAttributes();
return getElement().getAttributes();
public AttributeSet getAttributes() { return elt.getAttributes(); }
View parent = getParent();
public Container getContainer() { return parent != null ? parent.getContainer() : null; }
return elt.getEndOffset();
return getElement().getEndOffset();
public int getEndOffset() { return elt.getEndOffset(); }
return elt.getStartOffset();
return getElement().getStartOffset();
public int getStartOffset() { return elt.getStartOffset(); }
View parent = getParent();
public ViewFactory getViewFactory() { return parent != null ? parent.getViewFactory() : null; }
public void setParent(View a)
public void setParent(View parent)
public void setParent(View a) { parent = a; }
parent = a;
this.parent = parent;
public void setParent(View a) { parent = a; }
public void setSize(int w, int h) { width = w; height = h; }
public void setSize(float width, float height) { }
public void setSize(int w, int h) { width = w; height = h; }
if (rect == null) return;
public void scrollPathToVisible(TreePath path) { if (path == null) return; Rectangle rect = getPathBounds(path); if (rect == null) return; scrollRectToVisible(rect); }
setSelectionPath(temp);
public void scrollPathToVisible(TreePath path) { if (path == null) return; Rectangle rect = getPathBounds(path); if (rect == null) return; scrollRectToVisible(rect); }
revalidate(); repaint();
public void updateUI() { setUI((TreeUI) UIManager.getUI(this)); revalidate(); repaint(); }
if (text == null) { return;
if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn();
public void sendKeys(String text) { if (text == null) { return; } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (text != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) { return false; }
protected boolean simulateKeyStroke(char c){ if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) { return false; } boolean updateField = false; boolean numericError = false; boolean updatePos = false; boolean autoEnter = false; if (!Character.isISOControl(c)) { if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { switch (screenFields.getCurrentFieldShift()) { case 0: // Alpha shift case 2: // Numeric Shift case 4: // Kakana Shift updateField = true; break; case 1: // Alpha Only if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; break; case 3: // Numeric only if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; else numericError = true; break; case 5: // Digits only if(Character.isDigit(c)) updateField = true; else displayError(ERR_NUMERIC_09); break; case 7: // Signed numeric if(Character.isDigit(c) || c == '+' || c == '-') if (lastPos == screenFields.getCurrentField().endPos() && (c != '+' && c != '-')) displayError(ERR_INVALID_SIGN); else updateField = true; else displayError(ERR_NUMERIC_09); break; } if (updateField) { if (screenFields.isCurrentFieldToUpper()) c = Character.toUpperCase(c); setCursorOff(); updatePos = true; resetDirty(lastPos); if (insertMode) { if (endOfField(false) != screenFields.getCurrentField().endPos()) shiftRight(lastPos); else { displayError(ERR_NO_ROOM_INSERT); updatePos = false; } } if (updatePos) { screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos)); screenFields.getCurrentField().changePos(1); screen[lastPos].setChar(c); screenFields.setCurrentFieldMDT(); // if we have gone passed the end of the field then goto the next field if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) { if (screenFields.isCurrentFieldAutoEnter()) { autoEnter = true; } else if (!screenFields.isCurrentFieldFER()) gotoFieldNext(); } else goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1); } updateImage(dirty); setCursorOn(); if (autoEnter) sendAid(AID_ENTER); } else { if (numericError) { displayError(ERR_NUMERIC_ONLY); } } } else { displayError(ERR_CURSOR_PROTECTED); } } return updatePos; }
restoreErrorLine(); setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,"");
resetError();
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : if (isStatusErrorCode()) { restoreErrorLine(); setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,""); isInField(lastPos); updateDirty(); setCursorOn(); } else { setPrehelpState(false,isKeyboardLocked(),false); } simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; setCursorOff(); if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } setCursorOn(); } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
NIODatagramSocket socket = (NIODatagramSocket) ((DatagramChannelImpl) ch).socket(); return socket.getPlainDatagramSocketImpl().getNativeFD();
try { return ((DatagramChannelImpl) ch).getVMChannel().getState().getNativeFD(); } catch (IOException ioe) { throw new IllegalStateException(ioe); }
public int getNativeFD() { NIODatagramSocket socket = (NIODatagramSocket) ((DatagramChannelImpl) ch).socket(); return socket.getPlainDatagramSocketImpl().getNativeFD(); }
if (name != null && value != null) ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value);
if (this.attribHash.containsKey(name)) { ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } else Log.errorln("Error: cant set XMLAttribute:["+name+"], doesnt exist in object:"+this);
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String value = attrs.getValue(i); if (name != null && value != null) ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } } }
rp.setBackground(UIManager.getColor("control"));
protected void installDefaults(JRootPane rp) { // Is this ok? rp.setBackground(UIManager.getColor("control")); }
x = x + 5; y = y + 5; if (collapsed) {
public void paintIcon(Component c, Graphics g, int x, int y) { x = x + 5; y = y + 5; if (collapsed) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.fillRect(x + 7, y + 3, 5, 2); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } else { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.drawLine(x + 7, y + 2, x + 7, y + 5); g.fillRect(x + 3, y + 7, 2, 5); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } }
g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.fillRect(x + 7, y + 3, 5, 2); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2);
Color dark = new Color(99, 130, 191); Color light = new Color(163, 184, 204); Color white = Color.white;
public void paintIcon(Component c, Graphics g, int x, int y) { x = x + 5; y = y + 5; if (collapsed) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.fillRect(x + 7, y + 3, 5, 2); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } else { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.drawLine(x + 7, y + 2, x + 7, y + 5); g.fillRect(x + 3, y + 7, 2, 5); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } }
g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3);
x += 8; y += 6; final int w = 6; final int wHalf = (w >> 2); g.setColor(light); g.drawOval(x, y, w, w); g.setColor(dark); g.fillOval(x + 1, y + 1, w - 1, w - 1); if (collapsed) g.fillRect(x + w, y + wHalf + 1, w, 2); else g.fillRect(x + wHalf + 1, y + w, 2, w); g.setColor(white); g.fillRect(x + wHalf + 1, y + wHalf + 1, 2, 2);
public void paintIcon(Component c, Graphics g, int x, int y) { x = x + 5; y = y + 5; if (collapsed) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.fillRect(x + 7, y + 3, 5, 2); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } else { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.drawLine(x + 7, y + 2, x + 7, y + 5); g.fillRect(x + 3, y + 7, 2, 5); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } }
g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } else { g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.drawLine(x + 7, y + 2, x + 7, y + 5); g.fillRect(x + 3, y + 7, 2, 5); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); }
public void paintIcon(Component c, Graphics g, int x, int y) { x = x + 5; y = y + 5; if (collapsed) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.fillRect(x + 7, y + 3, 5, 2); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } else { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x + 2, y, x + 5, y); g.drawLine(x + 6, y + 1, x + 7, y + 2); g.drawLine(x + 7, y + 2, x + 7, y + 5); g.fillRect(x + 3, y + 7, 2, 5); g.drawLine(x + 7, y + 5, x + 6, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); g.drawLine(x, y + 2, x, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 6); g.drawLine(x + 2, y + 7, x + 5, y + 7); g.fillRect(x + 3, y + 3, 2, 2); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 3, y + 2, x + 4, y + 2); g.drawLine(x + 2, y + 3, x + 2, y + 4); g.drawLine(x + 3, y + 5, x + 3, y + 5); g.drawLine(x + 5, y + 3, x + 5, y + 3); g.setColor(new Color(153, 153, 204)); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 2, y + 5, x + 2, y + 5); g.drawLine(x + 2, y + 6, x + 5, y + 6); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 5); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 2, y + 1, x + 5, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 5); } }
return new HorizontalSliderThumbIcon();
if (horizontalSliderThumbIcon == null) horizontalSliderThumbIcon = new HorizontalSliderThumbIcon(); return horizontalSliderThumbIcon;
public static Icon getHorizontalSliderThumbIcon() { return new HorizontalSliderThumbIcon(); }
return new VerticalSliderThumbIcon();
if (verticalSliderThumbIcon == null) verticalSliderThumbIcon = new VerticalSliderThumbIcon(); return verticalSliderThumbIcon;
public static Icon getVerticalSliderThumbIcon() { return new VerticalSliderThumbIcon(); }
IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(k); if (kpc == null) { throw new KeyAgreementException(""); } byte[] b = kpc.encodePrivateKey(k); int length = b.length; if (length > Registry.SASL_FOUR_BYTE_MAX_LIMIT) { throw new KeyAgreementException("encoded private key is too long"); } byte[] lengthBytes = { (byte) (length >>> 24), (byte) (length >>> 16), (byte) (length >>> 8), (byte) length }; out.write(lengthBytes, 0, 4); out.write(b, 0, b.length);
writeKey(k);
public void writePrivateKey(PrivateKey k) throws KeyAgreementException { IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(k); if (kpc == null) { throw new KeyAgreementException(""); } byte[] b = kpc.encodePrivateKey(k); int length = b.length; if (length > Registry.SASL_FOUR_BYTE_MAX_LIMIT) { throw new KeyAgreementException("encoded private key is too long"); } byte[] lengthBytes = { (byte) (length >>> 24), (byte) (length >>> 16), (byte) (length >>> 8), (byte) length }; out.write(lengthBytes, 0, 4); out.write(b, 0, b.length); }
IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(k); if (kpc == null) { throw new KeyAgreementException(""); } byte[] b = kpc.encodePublicKey(k); int length = b.length; if (length > Registry.SASL_FOUR_BYTE_MAX_LIMIT) { throw new KeyAgreementException("encoded public key is too long"); } byte[] lengthBytes = { (byte) (length >>> 24), (byte) (length >>> 16), (byte) (length >>> 8), (byte) length }; out.write(lengthBytes, 0, 4); out.write(b, 0, b.length);
writeKey(k);
public void writePublicKey(PublicKey k) throws KeyAgreementException { IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(k); if (kpc == null) { throw new KeyAgreementException(""); } byte[] b = kpc.encodePublicKey(k); int length = b.length; if (length > Registry.SASL_FOUR_BYTE_MAX_LIMIT) { throw new KeyAgreementException("encoded public key is too long"); } byte[] lengthBytes = { (byte) (length >>> 24), (byte) (length >>> 16), (byte) (length >>> 8), (byte) length }; out.write(lengthBytes, 0, 4); out.write(b, 0, b.length); }
drawLine(currStart, currEnd, g, rect.x, rect.y);
drawLine(currStart, currEnd, g, rect.x, rect.y + metrics.getAscent());
public void paint(Graphics g, Shape s) { // Ensure metrics are up-to-date. updateMetrics(); JTextComponent textComponent = (JTextComponent) getContainer(); g.setFont(textComponent.getFont()); selectedColor = textComponent.getSelectedTextColor(); unselectedColor = textComponent.getForeground(); disabledColor = textComponent.getDisabledTextColor(); // FIXME: this is a hack, for some reason textComponent.getSelectedColor // was returning black, which is not visible against a black background selectedColor = Color.WHITE; Rectangle rect = s.getBounds(); int lineHeight = metrics.getHeight(); int end = getEndOffset(); int currStart = getStartOffset(); int currEnd; while (currStart < end) { currEnd = calculateBreakPosition(currStart, end); drawLine(currStart, currEnd, g, rect.x, rect.y); rect.y += lineHeight; if (currEnd == currStart) currStart ++; else currStart = currEnd; } }
this.hide();
this.setVisible(false);
private void fillQueryTextArea() { queryTextArea.append(queryBuilder.getQuery()); this.hide(); this.dispose(); }
return new StyleSheet();
StyleSheet styleSheet = new StyleSheet(); styleSheet.importStyleSheet(getClass().getResource(HTMLEditorKit.DEFAULT_CSS)); return styleSheet;
protected StyleSheet getStyleSheet() { // FIXME: Not implemented properly. return new StyleSheet(); }
boolean graphicsDebugMode = false;
public void installUI(JComponent c) { if (c instanceof JTerminal) { this.terminal = (JTerminal)c; boolean graphicsDebugMode = false; if (graphicsDebugMode) { javax.swing.RepaintManager repaintManager = javax.swing.RepaintManager.currentManager(terminal); repaintManager.setDoubleBufferingEnabled(false); terminal.setDebugGraphicsOptions(javax.swing.DebugGraphics.FLASH_OPTION); } this.session = terminal.getSession(); session.setRunningHeadless(true); installComponents(); installListeners(); installDefaults(); installKeyboardActions(); } else throw new Error("TerminalUI needs JTerminal"); }
if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>");
if (delimiter !=null) { writeOut(outputstream, " delimiter =\""); writeOutAttribute(outputstream, delimiter); writeOut(outputstream, "\""); } writeOut(outputstream, " repeatable=\""); writeOutAttribute(outputstream, repeatable); writeOut(outputstream, "\""); if (recordTerminator !=null) { writeOut(outputstream, " recordTerminator=\""); writeOutAttribute(outputstream, recordTerminator); writeOut(outputstream, "\""); }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
fireScreenChanged(1);
updateDirty();
protected void repaintScreen() { //drawing = true;// dirty.setBounds(tArea.getBounds()); dirtyScreen.setBounds(0,lenScreen - 1,0,0);// if (gui.getGraphics() != null) { // do not forget to null out gg2d before update or else there will // be a very hard to trace screen resize problem // controllersG2D = null;// updateDirty();// } fireScreenChanged(1); // restore statuses that were on the screen before resize if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_ERROR) { oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, ScreenOIA.OIA_LEVEL_INPUT_ERROR); } if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_INHIBITED) { oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, ScreenOIA.OIA_LEVEL_INPUT_INHIBITED); } if (oia.isMessageWait()) oia.setMessageLightOn(); }
if (oldRows != numRows || oldCols != numCols) fireScreenSizeChanged();
public final void setRowsCols(int rows, int cols) { // default number of rows and columns numRows = rows; numCols = cols; lenScreen = numRows * numCols; planes.setSize(rows); }
boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) {
if (indent!=null)
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
}
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
String moreIndent = super.sPrettyXDFOutputIndentation;
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput)
writeOut(outputstream, "<read"); Hashtable xmlInfo = getXMLInfo(); ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); specificIOStyleToXDF(outputstream, moreIndent); if (niceOutput) {
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } super.toXDFOutputStream(outputstream, null, nextIndent); for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE);
writeOut(outputstream, indent);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "< if (niceOutput) writeOut(outputstream, Constants.NEW_LINE);
writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); }
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { String myIndent; boolean niceOutput = super.sPrettyXDFOutput; if (indent !=null) { myIndent = indent; } else myIndent = ""; String moreIndent = super.sPrettyXDFOutputIndentation; //open the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); String nextIndent = myIndent + moreIndent; List indents = new ArrayList(); List axisList = getParentArray().getAxisList(); String axisId; for (int i = 0; i< axisList.size(); i++) { axisId = ((AxisInterface)axisList.get(i)).getAxisId(); indents.add(nextIndent); if (niceOutput) writeOut(outputstream, nextIndent); writeOut(outputstream,"<"+UntaggedInstructionNodeName + "axisIdRef = \"" + axisId + "\">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); nextIndent += moreIndent; } //now dump ourselves here using the trusty generic method super.toXDFOutputStream(outputstream, null, nextIndent); //close the instruction for (int i = indents.size()-1; i>=0; i++) { if (niceOutput) writeOut(outputstream, (String) indents.get(i)); writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } //close the read block if (niceOutput) writeOut(outputstream, myIndent); writeOut(outputstream, "<//"+classXDFNodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
final String lineNr = getLineNr(); final String linePrefix; final String line; if (isInterpreted()) { linePrefix = ""; } else { linePrefix = "*"; } line = lineNr;
final String location = getLocationInfo();
public String toString() { final VmMethod method = sfMethod; final VmType vmClass = (method == null) ? null : method.getDeclaringClass(); final String cname = (vmClass == null) ? "<unknown class>" : vmClass.getName(); final String mname = (method == null) ? "<unknown method>" : method.getName(); final String lineNr = getLineNr(); final String linePrefix; final String line; if (isInterpreted()) { linePrefix = ""; } else { linePrefix = "*"; } /*if (lineNr < 0) { line = "?"; } else { line = String.valueOf(lineNr); }*/ line = lineNr; return cname + "!" + mname + " (" + linePrefix + line + ")"; }
return cname + "!" + mname + " (" + linePrefix + line + ")";
return cname + "!" + mname + " (" + location + ")";
public String toString() { final VmMethod method = sfMethod; final VmType vmClass = (method == null) ? null : method.getDeclaringClass(); final String cname = (vmClass == null) ? "<unknown class>" : vmClass.getName(); final String mname = (method == null) ? "<unknown method>" : method.getName(); final String lineNr = getLineNr(); final String linePrefix; final String line; if (isInterpreted()) { linePrefix = ""; } else { linePrefix = "*"; } /*if (lineNr < 0) { line = "?"; } else { line = String.valueOf(lineNr); }*/ line = lineNr; return cname + "!" + mname + " (" + linePrefix + line + ")"; }
registerAPI(BlockDeviceAPI.class, this);
registerAPI(FSBlockDeviceAPI.class, this);
public FileDevice(File file, String mode) throws FileNotFoundException, IOException { super(null, "file" + System.currentTimeMillis()); raf = new RandomAccessFile(file, mode); registerAPI(BlockDeviceAPI.class, this); }
if (codePage.toLowerCase().startsWith("870")) {
if (codePage.toLowerCase().startsWith("870-pl")) {
public void setCodePage (String newCodePage) { if (!codePage.toLowerCase().equals(newCodePage.toLowerCase())) { codePage = newCodePage; int i = 0; int[] cp = CharMappings.getCodePage(codePage); do { ebcdic[i] = cp[i]; ascii[cp[i]] = i; } while(++i < 256); if (codePage.toLowerCase().startsWith("870")) { unicode = uni1250; convert = true;// System.out.println("using conversion"); } else if(codePage.toLowerCase().startsWith("1025")) { unicode = uni1025; convert = true;// System.out.println("using conversion"); } else { convert = false;// System.out.println("not using conversion"); } } }
setSelected(false);
public void windowClosing(WindowEvent event) { }
public Offset add (Extent byteSize) {
public Offset add (int byteSize) {
public Offset add (Extent byteSize) { return null; }
public Gui5250Frame(My5250 m) {
public Gui5250Frame(My5250 m, int seq) {
public Gui5250Frame(My5250 m) { me = m; enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
sequence = seq;
public Gui5250Frame(My5250 m) { me = m; enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
this.setTitle("tn5250j - 0.5.2");
String release = "0"; String version = ".5"; String subVer= ".2b"; if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + release + version + subVer); else setTitle("tn5250j - " + release + version + subVer);
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); this.setTitle("tn5250j - 0.5.2"); sessionPane.setBorder(BorderFactory.createEtchedBorder()); sessionPane.setBounds(new Rectangle(78, 57, 5, 5)); sessionPane.setOpaque(false); sessionPane.setRequestFocusEnabled(false); sessionPane.setDoubleBuffered(true); this.getContentPane().add(sessionPane, BorderLayout.CENTER); }
sessionPane.addChangeListener(this); centerFrame();
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); this.setTitle("tn5250j - 0.5.2"); sessionPane.setBorder(BorderFactory.createEtchedBorder()); sessionPane.setBounds(new Rectangle(78, 57, 5, 5)); sessionPane.setOpaque(false); sessionPane.setRequestFocusEnabled(false); sessionPane.setDoubleBuffered(true); this.getContentPane().add(sessionPane, BorderLayout.CENTER); }
if (isSpecified("-noembed",args)) {
if (isSpecified("-noembed",args) && sessionCount > 0) {
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } if (isSpecified("-hb",args)) sesProps.put(SESSION_HEART_BEAT,"1"); Session5250 s2 = manager.openSession(sesProps,propFileName,sel); SessionGUI s = new SessionGUI(s2); if (!frame1.isVisible()) { splash.updateProgress(++step); if (isSpecified("-noembed",args)) { newView(); } frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); s.addEmulatorActionListener(this); }
public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); }
public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); }
public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); }
public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); }
public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); }
public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); }
public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
JInternalFrame[] frames = desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame();
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame();
private void nextSession() { JInternalFrame[] frames = desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; }
public void onSessionChanged(SessionChangeEvent changeEvent) { }
JInternalFrame[] frames = desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame();
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame();
private void prevSession() { JInternalFrame[] frames = desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
JInternalFrame[] frames = desktop.getAllFrames();
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); int index = desktop.getIndexOf(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index);
public void removeSessionView(Session targetSession) { JInternalFrame[] frames = desktop.getAllFrames(); }
for (int i=0;i<mb.getMenuCount();i++) if (((JMenu)mb.getComponent(i)).isPopupMenuVisible())
for (int i = 0; i < mb.getMenuCount(); i++) { JMenu m = mb.getMenu(i); if (m != null && m.isPopupMenuVisible())
private boolean popupVisible() { JMenuBar mb = (JMenuBar) ((JMenu)menuItem).getParent(); // check if mb.isSelected because if no menus are selected // we don't have to look through the list for popup menus if (!mb.isSelected()) return false; for (int i=0;i<mb.getMenuCount();i++) if (((JMenu)mb.getComponent(i)).isPopupMenuVisible()) return true; return false; }
}
private boolean popupVisible() { JMenuBar mb = (JMenuBar) ((JMenu)menuItem).getParent(); // check if mb.isSelected because if no menus are selected // we don't have to look through the list for popup menus if (!mb.isSelected()) return false; for (int i=0;i<mb.getMenuCount();i++) if (((JMenu)mb.getComponent(i)).isPopupMenuVisible()) return true; return false; }
return new LineSegment(P1, P2);
LineSegment segment = null; try { segment = (LineSegment) super.clone(); segment.P1 = (Point2D) P1.clone(); segment.P2 = (Point2D) P2.clone(); } catch (CloneNotSupportedException cnse) { InternalError ie = new InternalError(); ie.initCause(cnse); throw ie; } return segment;
public Object clone() { return new LineSegment(P1, P2); }
if (this.equals (READING))
if (getName().equals(READING.getName()))
protected Object readResolve() throws InvalidObjectException { if (this.equals (READING)) return READING; if (this.equals (LANGUAGE)) return LANGUAGE; if (this.equals (INPUT_METHOD_SEGMENT)) return INPUT_METHOD_SEGMENT; throw new InvalidObjectException ("Can't resolve Attribute: " + getName()); }
if (this.equals (LANGUAGE))
if (getName().equals(LANGUAGE.getName()))
protected Object readResolve() throws InvalidObjectException { if (this.equals (READING)) return READING; if (this.equals (LANGUAGE)) return LANGUAGE; if (this.equals (INPUT_METHOD_SEGMENT)) return INPUT_METHOD_SEGMENT; throw new InvalidObjectException ("Can't resolve Attribute: " + getName()); }
if (this.equals (INPUT_METHOD_SEGMENT))
if (getName().equals(INPUT_METHOD_SEGMENT.getName()))
protected Object readResolve() throws InvalidObjectException { if (this.equals (READING)) return READING; if (this.equals (LANGUAGE)) return LANGUAGE; if (this.equals (INPUT_METHOD_SEGMENT)) return INPUT_METHOD_SEGMENT; throw new InvalidObjectException ("Can't resolve Attribute: " + getName()); }
bad.minor = Minor.Any;
public static AdapterNonExistent extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (AdapterNonExistent) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("AdapterNonExistent expected"); bad.initCause(cex); throw bad; } }
drawing = true;
public void clearScreen() { for (int x = 0; x < lenScreen; x++) { screen[x].setCharAndAttr(' ',initAttr,false); screen[x].setUseGUI(ScreenChar.NO_GUI); } dirty.setBounds(tArea.getBounds());// dirty.setBounds(fmWidth * numCols,fmHeight * numRows,0,0); }
row = 0; sb = new StringBuffer();
public void createFileInstance(String fileName) throws FileNotFoundException { fout = new PrintStream(new FileOutputStream(fileName)); }
firePropertyChange(ENABLED_PROPERTY, !this.enabled, this.enabled);
firePropertyChange("enabled", !this.enabled, this.enabled);
public void setEnabled(boolean enabled) { if (enabled != this.enabled) { this.enabled = enabled; firePropertyChange(ENABLED_PROPERTY, !this.enabled, this.enabled); } }
return null;
KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager(); Component focused = kfm.getPermanentFocusOwner(); JTextComponent textComp = null; if (focused instanceof JTextComponent) textComp = (JTextComponent) focused; return textComp;
protected final JTextComponent getFocusedComponent() { return null; // TODO }
String paramId = newparameter.getParamId(); if (paramId != null) { if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." ); ParamObj.put(paramId, newparameter); } String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) { if (ParamObj.containsKey(paramIdRef)) { Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); } newparameter.setXMLAttributes(attrs); newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null); ParamObj.put(newparameter.getParamId(), newparameter); } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Parameter newparameter = new Parameter(); newparameter.setXMLAttributes(attrs); // set XML attributes from passed list // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.ARRAY) ) { newparameter = CurrentArray.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.ROOT) || parentNodeName.equals(XDFNodeName.STRUCTURE) ) { newparameter = CurrentStructure.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) ) { // for now, just add as regular parameter if(LastParameterGroupParentObject instanceof Array) { newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); } else if(LastParameterGroupParentObject instanceof Structure) { newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); } } else { Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring"); return (Object) null; } // add this object to all open groups Iterator iter = CurrentParameterGroupList.iterator(); while (iter.hasNext()) { ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next(); newparameter.addToGroup(nextParamGroupObj); } LastParameterObject = newparameter; return newparameter; }
String readIdRef = readObj.getReadIdRef();
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
if (readIdRef != null) {
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable();
DataIOStyleAttribs.clear();
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { // create new object appropriately FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); // add this object to the lookup table, if it has an ID if (readId != null) { // a warning check, just in case if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); // add this into the list of note objects ReadObj.put(readId, readObj); } // If there is a reference object, clone it to get // the new readObj if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } // override attrs with those in passed list readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); // give the clone a unique Id and remove IdRef readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); readObj.setReadIdRef(null); // add this into the list of note objects ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }