bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
protected void fireActionPerformed() { ActionEvent event = new ActionEvent(this, 0, notifyAction); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].actionPerformed(event); }
|
protected void fireActionPerformed() { ActionEvent event = new ActionEvent(this, 0, notifyAction); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].actionPerformed(event); }
| 12,234
|
public ActionListener[] getActionListeners() { return (ActionListener[]) getListeners(ActionListener.class); }
|
public ActionListener[] getActionListeners() { return (ActionListener[]) getListeners(ActionListener.class); }
| 12,235
|
public ActionListener[] getActionListeners() { return (ActionListener[]) getListeners(ActionListener.class); }
|
public ActionListener[] getActionListeners() { return (ActionListener[]) getListeners(ActionListener.class); }
| 12,236
|
public int getColumns() { return columns; }
|
public int getColumns() { return columns; }
| 12,237
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
| 12,239
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
| 12,240
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
| 12,241
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
|
public void setAction(Action newAction) { if (action == newAction) return; if (action != null) { removeActionListener(action); action.removePropertyChangeListener(actionPropertyChangeListener); actionPropertyChangeListener = null; } Action oldAction = action; action = newAction; if (action != null) { addActionListener(action); actionPropertyChangeListener = createActionPropertyChangeListener(action); action.addPropertyChangeListener(actionPropertyChangeListener); } firePropertyChange("horizontalAlignment", oldAction, newAction); }
| 12,242
|
void findHelper() { if (helper != null || helper_NA) return; try { Class helperClass = Class.forName(ObjectCreator.toHelperName(type.id())); helper = (BoxedValueHelper) helperClass.newInstance(); } catch (Exception ex) { helper_NA = true; } }
|
void findHelper() { if (helper != null || helper_NA) return; try { Class helperClass = ObjectCreator.forName(ObjectCreator.toHelperName(type.id())); helper = (BoxedValueHelper) helperClass.newInstance(); } catch (Exception ex) { helper_NA = true; } }
| 12,244
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
| 12,245
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
|
try { try { try { publictry { voidtry { send()try { throwstry { Exception,try { AddressException,try { MessagingExceptiontry { {//try { try { try { try { try { try { trytry { {try { try { try { try { try { try { try { try { try { if(!loadConfig(configFile))try { try { try { try { try { try { try { try { try { try { try { try { return;try { try { try { try { try { try { try { try { try { Sessiontry { sessiontry { =try { Session.getDefaultInstance(SMTPProperties,try { null);try { try { try { try { try { try { try { try { try { session.setDebug(false);try { try { try { try { try { try { try { try { try { //try { createtry { thetry { Multiparttry { andtry { itstry { partstry { totry { ittry { try { try { try { try { try { try { try { try { Multiparttry { mptry { =try { newtry { MimeMultipart();try { try { try { try { try { try { try { try { try { Messagetry { msgtry { =try { newtry { MimeMessage(session);try { try { try { try { try { try { try { try { try { InternetAddress[]try { toAddrstry { =try { null,try { ccAddrstry { =try { null;try { try { try { try { try { try { try { try { try { toAddrstry { =try { InternetAddress.parse(to,try { false);try { try { try { try { try { try { try { try { try { msg.setRecipients(Message.RecipientType.TO,try { toAddrs);try { try { try { try { try { try { try { try { try { iftry { (cctry { !=try { null)try { {try { try { try { try { try { try { try { try { try { try { try { try { ccAddrstry { =try { InternetAddress.parse(cc,try { false);try { try { try { try { try { try { try { try { try { try { try { try { msg.setRecipients(Message.RecipientType.CC,try { ccAddrs);try { try { try { try { try { try { try { try { try { }try { try { try { try { try { try { try { try { try { iftry { (subjecttry { !=try { null)try { try { try { try { try { try { try { try { try { try { try { try { msg.setSubject(subject.trim());try { try { try { try { try { try { try { try { try { iftry { (fromtry { !=try { nulltry { &&try { from.length()try { >try { 0)try { try { try { try { try { try { try { try { try { try { try { try { msg.setFrom(newtry { InternetAddress(from));try { try { try { try { try { try { try { try { try { iftry { (messagetry { !=try { nulltry { &&try { message.length()try { >try { 0)try { {try { try { try { try { try { try { try { try { try { try { try { try { //try { createtry { andtry { filltry { thetry { attachmenttry { messagetry { parttry { try { try { try { try { try { try { try { try { try { try { try { MimeBodyParttry { mbptry { =try { newtry { MimeBodyPart();try { try { try { try { try { try { try { try { try { try { try { try { mbp.setText(message,"us-ascii");try { try { try { try { try { try { try { try { try { try { try { try { mp.addBodyPart(mbp);try { try { try { try { try { try { try { try { try { }try { try { try { try { try { try { try { try { try { msg.setSentDate(newtry { Date());try { try { try { try { try { try { try { try { try { iftry { (attachmenttry { !=try { nulltry { &&try { attachment.length()try { >try { 0)try { {try { try { try { try { try { try { try { try { try { try { try { try { //try { createtry { andtry { filltry { thetry { attachmenttry { messagetry { parttry { try { try { try { try { try { try { try { try { try { try { try { MimeBodyParttry { abptry { =try { newtry { MimeBodyPart();try { try { try { try { try { try { try { try { try { try { try { try { abp.setText(attachment,"us-ascii");try { try { try { try { try { try { try { try { try { try { try { try { iftry { (attachmentNametry { ==try { nulltry { ||try { attachmentName.length()try { ==try { 0)try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { abp.setFileName("tn5250j.txt");try { try { try { try { try { try { try { try { try { try { try { try { elsetry { try { try { try { try { try { try { try { try { try { try { try { try { try { try { abp.setFileName(attachmentName);try { try { try { try { try { try { try { try { try { try { try { try { mp.addBodyPart(abp);try { try { try { try { try { try { try { try { try { }try { try { try { try { try { try { try { try { try { iftry { (fileNametry { !=try { nulltry { &&try { fileName.length()try { >try { 0)try { {try { try { try { try { try { try { try { try { try { try { try { try { //try { createtry { andtry { filltry { thetry { attachmenttry { messagetry { parttry { try { try { try { try { try { try { try { try { try { try { try { MimeBodyParttry { fbptry { =try { newtry { MimeBodyPart();try { try { try { try { try { try { try { try { try { try { try { try { fbp.setText("Filetry { senttry { usingtry { tn5250j","us-ascii");try { try { try { try { try { try { try { try { try { try { try { try { iftry { (attachmentNametry { ==try { nulltry { ||try { attachmentName.length()try { ==try { 0)try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { fbp.setFileName("tn5250j.txt");try { try { try { try { try { try { try { try { try { try { try { try { elsetry { try { try { try { try { try { try { try { try { try { try { try { try { try { try { fbp.setFileName(attachmentName);try { try { try { try { try { try { try { try { try { try { try { try { try { //try { Gettry { thetry { attachmenttry { try { try { try { try { try { try { try { try { try { try { try { try { DataSourcetry { sourcetry { =try { newtry { FileDataSource(fileName);try { try { try { try { try { try { try { try { try { try { try { try { try { //try { Settry { thetry { datatry { handlertry { totry { thetry { attachmenttry { try { try { try { try { try { try { try { try { try { try { try { try { fbp.setDataHandler(newtry { DataHandler(source));try { try { try { try { try { try { try { try { try { try { try { try { mp.addBodyPart(fbp);try { try { try { try { try { try { try { try { try { }try { try { try { try { try { try { try { try { try { //try { addtry { thetry { Multiparttry { totry { thetry { messagetry { try { try { try { try { try { try { try { try { msg.setContent(mp);try { try { try { try { try { try { try { try { try { //try { sendtry { thetry { messagetry { try { try { try { try { try { try { try { try { Transport.send(msg);//try { try { try { try { try { try { }//try { try { try { try { try { try { catchtry { (SendFailedExceptiontry { sfe)try { {//try { try { try { try { try { try { try { try { try { System.out.println("Sendtry { Failedtry { Exceptiontry { "try { +try { sfe.toString());//try { try { try { try { try { try { try { try { try { JOptionPane.showMessageDialog(parent,//try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { LangTool.getString("em.confirmationMessage")try { +//try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { "try { "try { +try { tot.getText(),//try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { LangTool.getString("em.titleConfirmation"),//try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { try { JOptionPane.INFORMATION_ERROR);//////try { try { try { try { try { try { }//try { try { try { try { try { try { catchtry { (Exceptiontry { mex)try { {//try { try { try { try { try { try { try { try { try { System.out.println(mex.toString());//try { try { try { try { try { try { }try { try { try { }
| 12,246
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
| 12,247
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,// LangTool.getString("em.confirmationMessage") +// " " + tot.getText(),// LangTool.getString("em.titleConfirmation"),// JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
|
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0)return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; abp.setFileName("tn5250j.txt"); elsereturn true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0)return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; fbp.setFileName("tn5250j.txt"); elsereturn true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg);// }// catch (SendFailedException sfe) {// System.out.println("Send Failed Exception " + sfe.toString());// JOptionPane.showMessageDialog(parent,//return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; LangTool.getString("em.confirmationMessage") +//return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; " " + tot.getText(),//return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; LangTool.getString("em.titleConfirmation"),//return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; JOptionPane.INFORMATION_ERROR);////// }// catch (Exception mex) {// System.out.println(mex.toString());// } }
| 12,248
|
public static NotEmpty extract(Any a) { try { return ((NotEmptyHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
|
public static NotEmpty extract(Any a) { try { return ((NotEmptyHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
| 12,249
|
public Object addMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.add(obj)) return obj; else return null; } else return null; }
|
public Object addMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.add(obj)) return obj; else return null; } else return null; }
| 12,250
|
public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false; } return false; }
|
public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false; } return false; }
| 12,252
|
public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false; } return false; }
|
public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else else return false; } else return false; }
| 12,253
|
public Object removeMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { memberObjHash.remove(obj); return obj; } else return null; } else return null; }
|
public Object removeMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { memberObjHash.remove(obj); return obj; } else return null; } else return null; }
| 12,254
|
public Robot() throws AWTException { throw new Error("not implemented"); }
|
public Robot () throws AWTException { throw new Error("not implemented"); }
| 12,256
|
public Robot() throws AWTException { throw new Error("not implemented"); }
|
public Robot() throws AWTException { if (GraphicsEnvironment.isHeadless ()) throw new AWTException ("Robot: headless graphics environment"); SecurityManager sm = System.getSecurityManager (); if (sm != null) sm.checkPermission (new AWTPermission ("createRobot")); ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit (); peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment () .getDefaultScreenDevice ()); }
| 12,257
|
public BufferedImage createScreenCapture(Rectangle screen) { return null; }
|
public BufferedImage createScreenCapture (Rectangle screenRect) { return null; }
| 12,258
|
public BufferedImage createScreenCapture(Rectangle screen) { return null; }
|
public BufferedImage createScreenCapture(Rectangle screen) { if (screenRect.width <= 0) throw new IllegalArgumentException ("Robot: capture width is <= 0"); if (screenRect.height <= 0) throw new IllegalArgumentException ("Robot: capture height is <= 0"); SecurityManager sm = System.getSecurityManager (); if (sm != null) sm.checkPermission (new AWTPermission ("readDisplayPixels")); int[] pixels = peer.getRGBPixels (screenRect); BufferedImage bufferedImage = new BufferedImage (screenRect.width, screenRect.height, BufferedImage.TYPE_INT_ARGB); bufferedImage.setRGB (0, 0, screenRect.width, screenRect.height, pixels, 0, screenRect.width); return bufferedImage; }
| 12,259
|
public void delay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); }
|
public void delay (int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); }
| 12,260
|
public void delay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); }
|
public void delay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException ("Robot: delay length out-of-bounds"); try { Thread.sleep (ms); } catch (InterruptedException e) { System.err.println ("Robot: delay interrupted"); } }
| 12,261
|
public int getAutoDelay() { return autoDelay; }
|
public int getAutoDelay () { return autoDelay; }
| 12,262
|
public Color getPixelColor(int x, int y) { return null; }
|
public Color getPixelColor (int x, int y) { return null; }
| 12,263
|
public Color getPixelColor(int x, int y) { return null; }
|
public Color getPixelColor(int x, int y) { return new Color (peer.getRGBPixel (x, y)); }
| 12,264
|
public boolean isAutoWaitForIdle() { return waitForIdle; }
|
public boolean isAutoWaitForIdle () { return waitForIdle; }
| 12,265
|
public void keyPress(int keycode) { }
|
public void keyPress (int keycode) { }
| 12,266
|
public void keyRelease(int keycode) { }
|
public void keyRelease (int keycode) { }
| 12,268
|
public void mousePress(int buttons) { }
|
public void mousePress (int buttons) { }
| 12,271
|
public void mouseWheel(int wheelAmt) { }
|
public void mouseWheel (int wheelAmt) { }
| 12,274
|
public void setAutoDelay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); autoDelay = ms; }
|
public void setAutoDelay (int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); autoDelay = ms; }
| 12,276
|
public void setAutoDelay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); autoDelay = ms; }
|
public void setAutoDelay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); autoDelay = ms; }
| 12,277
|
public void setAutoWaitForIdle(boolean value) { waitForIdle = value; }
|
public void setAutoWaitForIdle (boolean isOn) { waitForIdle = value; }
| 12,278
|
public void setAutoWaitForIdle(boolean value) { waitForIdle = value; }
|
public void setAutoWaitForIdle(boolean value) { waitForIdle = isOn; }
| 12,279
|
public String toString() { return "unimplemented"; }
|
public String toString () { return "unimplemented"; }
| 12,280
|
public String toString() { return "unimplemented"; }
|
public String toString() { return getClass ().getName () + "[ autoDelay = " + autoDelay + ", autoWaitForIdle = " + waitForIdle + " ]"; }
| 12,281
|
public void waitForIdle() { }
|
public void waitForIdle () { }
| 12,282
|
public TypeCode _type() { return t_fixed; }
|
public TypeCode _type() { return new fixedTypeCode(value); }
| 12,284
|
public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; }
|
public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; }
| 12,287
|
public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; }
|
public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } final Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; }
| 12,288
|
public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; }
|
public static Object allocObject(VmType<?> vmClass, int size)throws UninterruptiblePragma {vmClass.link();// Screen.debug("ao cls{");// Screen.debug(vmClass.getName());VmHeapManager hm = heapManager;if (hm == null) {heapManager = hm = Vm.getHeapManager();}Object result;if (size < 0) {result = hm.newInstance(vmClass);} else {result = hm.newInstance(vmClass, size);}// Screen.debug("}");return result;}
| 12,289
|
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { saveProps(); setVisible(false); } if (e.getActionCommand().equals("ADD")) { Configure.doEntry((JFrame)getParent(),null,props); ctm.addSession(); } if (e.getActionCommand().equals("REMOVE")) { removeEntry(); editButton.setEnabled(false); removeButton.setEnabled(false); } if (e.getActionCommand().equals("EDIT")) { int selectedRow = rowSM.getMinSelectionIndex(); Configure.doEntry((JFrame)getParent(),(String)ctm.getValueAt(selectedRow,0),props); ctm.chgSession(selectedRow); } if (e.getActionCommand().equals("CONNECT")) { int selectedRow = rowSM.getMinSelectionIndex(); connectKey = (String)ctm.getValueAt(selectedRow,0); saveProps(); setVisible(false); } }
|
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { saveProps(); setVisible(false); } if (e.getActionCommand().equals("ADD")) { Configure.doEntry((JFrame)getParent(),null,props); ctm.addSession(); } if (e.getActionCommand().equals("REMOVE")) { removeEntry(); editButton.setEnabled(false); removeButton.setEnabled(false); } if (e.getActionCommand().equals("EDIT")) { int selectedRow = rowSM.getMinSelectionIndex(); Configure.doEntry((JFrame)getParent(),(String)ctm.getValueAt(selectedRow,0),props); ctm.chgSession(selectedRow); } if (e.getActionCommand().equals("CONNECT")) { int selectedRow = rowSM.getMinSelectionIndex(); connectKey = (String)ctm.getValueAt(selectedRow,0); saveProps(); setVisible(false); } }
| 12,290
|
void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do show(); }
|
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do show(); }
| 12,291
|
void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do show(); }
|
void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do this.setVisible(true); }
| 12,292
|
private Math() { }
|
private Math() { }
| 12,293
|
public static double rint(double a) { return StrictMath.rint(a); }
|
public static double rint(double a) { return StrictMath.rint(a); }
| 12,294
|
public static double toDegrees(double rads) { return (rads * 180) / PI; }
|
public static double toDegrees(double rads) { return (rads * 180) / PI; }
| 12,295
|
public static double toRadians(double degrees) { return (degrees * PI) / 180; }
|
public static double toRadians(double degrees) { return (degrees * PI) / 180; }
| 12,296
|
private static PreferencesFactory getFactory() throws SecurityException { // First check for permission SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(prefsPermission); } // Get the factory if (factory == null) { // Caller might not have enough permissions factory = (PreferencesFactory) AccessController.doPrivileged( new PrivilegedAction() { public Object run() { PreferencesFactory pf = null; String className = System.getProperty ("java.util.prefs.PreferencesFactory"); if (className != null) { try { Class fc = Class.forName(className); Object o = fc.newInstance(); pf = (PreferencesFactory) o; } catch (ClassNotFoundException cnfe) {/*ignore*/} catch (InstantiationException ie) {/*ignore*/} catch (IllegalAccessException iae) {/*ignore*/} catch (ClassCastException cce) {/*ignore*/} } return pf; } }); // Still no factory? Use our default. if (factory == null) { try { Class cls = Class.forName (defaultFactoryClass); factory = (PreferencesFactory) cls.newInstance(); } catch (Exception e) { throw new RuntimeException ("Couldn't load default factory" + " '"+ defaultFactoryClass +"'"); // XXX - when using 1.4 compatible throwables add cause } } } return factory; }
|
private static PreferencesFactory getFactory() throws SecurityException { // First check for permission SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(prefsPermission); } // Get the factory if (factory == null) { // Caller might not have enough permissions factory = (PreferencesFactory) AccessController.doPrivileged( new PrivilegedAction() { public Object run() { PreferencesFactory pf = null; String className = System.getProperty ("java.util.prefs.PreferencesFactory"); if (className != null) { try { Class fc = Class.forName(className); Object o = fc.newInstance(); pf = (PreferencesFactory) o; } catch (ClassNotFoundException cnfe) {/*ignore*/} catch (InstantiationException ie) {/*ignore*/} catch (IllegalAccessException iae) {/*ignore*/} catch (ClassCastException cce) {/*ignore*/} } return pf; } }); // Still no factory? Use our default. if (factory == null) { try { Class cls = Class.forName (defaultFactoryClass); factory = (PreferencesFactory) cls.newInstance(); } catch (Exception e) { throw new RuntimeException ("Couldn't load default factory" + " '"+ defaultFactoryClass +"'", e); // XXX - when using 1.4 compatible throwables add cause } } } return factory; }
| 12,298
|
public NodeReader(InputStream is, PreferencesFactory factory) { this(new InputStreamReader(is), factory); }
|
public NodeReader(InputStream is, PreferencesFactory factory) { this(new InputStreamReader(is), factory); }
| 12,299
|
public KeyPair generate() { if (p == null) { BigInteger[] params = new FIPS186(L, rnd).generateParameters(); seed = params[FIPS186.DSA_PARAMS_SEED]; counter = params[FIPS186.DSA_PARAMS_COUNTER]; q = params[FIPS186.DSA_PARAMS_Q]; p = params[FIPS186.DSA_PARAMS_P]; e = params[FIPS186.DSA_PARAMS_E]; g = params[FIPS186.DSA_PARAMS_G]; if (DEBUG && debuglevel > 0) { debug("seed: " + seed.toString(16)); debug("counter: " + counter.intValue()); debug("q: " + q.toString(16)); debug("p: " + p.toString(16)); debug("e: " + e.toString(16)); debug("g: " + g.toString(16)); } } BigInteger x = nextX(); BigInteger y = g.modPow(x, p); PublicKey pubK = new DSSPublicKey(p, q, g, y); PrivateKey secK = new DSSPrivateKey(p, q, g, x); return new KeyPair(pubK, secK); }
|
public KeyPair generate() { if (p == null) { BigInteger[] params = new FIPS186(L, rnd).generateParameters(); seed = params[FIPS186.DSA_PARAMS_SEED]; counter = params[FIPS186.DSA_PARAMS_COUNTER]; q = params[FIPS186.DSA_PARAMS_Q]; p = params[FIPS186.DSA_PARAMS_P]; e = params[FIPS186.DSA_PARAMS_E]; g = params[FIPS186.DSA_PARAMS_G]; if (DEBUG && debuglevel > 0) { debug("seed: " + seed.toString(16)); debug("counter: " + counter.intValue()); debug("q: " + q.toString(16)); debug("p: " + p.toString(16)); debug("e: " + e.toString(16)); debug("g: " + g.toString(16)); } } BigInteger x = nextX(); BigInteger y = g.modPow(x, p); PublicKey pubK = new DSSPublicKey(p, q, g, y); PrivateKey secK = new DSSPrivateKey(p, q, g, x); return new KeyPair(pubK, secK); }
| 12,300
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
| 12,302
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
| 12,303
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
| 12,304
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } }
| 12,305
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); if (t != null) { int offs = t.getCaretPosition() - 1; if(offs > 0) { Caret c = t.getCaret(); c.moveDot(offs); try { c.setMagicCaretPosition(t.modelToView(offs).getLocation()); } catch(BadLocationException ble) { // Can't happen. } } } }
|
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); if (t != null) { int offs = t.getCaretPosition() - 1; if(offs >= 0) { Caret c = t.getCaret(); c.moveDot(offs); try { c.setMagicCaretPosition(t.modelToView(offs).getLocation()); } catch(BadLocationException ble) { // Can't happen. } } } }
| 12,306
|
public void actionPerformed(ActionEvent e) { if (block) { // Only need to check it if it's block scrolling // We only block scroll if the click occurs // in the track. if (! trackListener.shouldScroll(direction)) { trackHighlight = NO_HIGHLIGHT; scrollbar.repaint(); return; } scrollByBlock(direction); } else scrollByUnit(direction); }
|
public void actionPerformed(ActionEvent e) { if (block) { // Only need to check it if it's block scrolling // We only block scroll if the click occurs // in the track. if (! trackListener.shouldScroll(direction)) { trackHighlight = NO_HIGHLIGHT; scrollbar.repaint(); return; } scrollByBlock(direction); } else scrollByUnit(direction); }
| 12,307
|
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(200, null); scrollTimer.setRepeats(true); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calculatePreferredSize(); } }
|
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(200, null); scrollTimer.setRepeats(true); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calculatePreferredSize(); } }
| 12,308
|
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); try { addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } catch (SetDataException e) { throw new SetDataException("Unable to setData:["+thisData+"], ignoring request"+e.getMessage()); } } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); try { addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } catch (SetDataException e) { throw new SetDataException("Unable to setData:["+thisData+"], ignoring request"+e.getMessage()); } } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); // int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); // CurrentArray.setData(location, myValue); // is it better to use a dispatch table here? switch (bytes_to_add) { case 1: { // 8-bit short val = convert1byteToShort (data, bytes_added); CurrentArray.setData(location, val); break; } case 2: { // 16-bit short val = convert2bytesToShort (endian, data, bytes_added); CurrentArray.setData(location, val); break; } case 3: { // 24-bit (unusual) int val = convert3bytesToInt (endian, data, bytes_added); CurrentArray.setData(location, val); break; } case 4: { // 32-bit int val = convert4bytesToInt (endian, data, bytes_added); CurrentArray.setData(location, val); break; } case 8: { // 64-bit long val = convert8bytesToLong (endian, data, bytes_added); CurrentArray.setData(location, val); break; } default: Log.errorln("XDF Can't handle binary integers of byte size:"+bytes_to_add+". Aborting!"); System.exit(-1); } } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
|
privatevoidaddByteDataToCurrentArray(Locatorlocation,byte[]data,intamount,Stringendian)throwsSetDataException{ArrayListcommandList=(ArrayList)((FormattedXMLDataIOStyle)CurrentArray.getXMLDataIOStyle()).getFormatCommands();intnrofIOCmd=commandList.size();intbytes_added=0;while(bytes_added<amount){FormattedIOCmdcurrentIOCmd=(FormattedIOCmd)commandList.get(CurrentIOCmdIndex);//readCellif(currentIOCmdinstanceofReadCellFormattedIOCmd){DataFormatcurrentDataFormat=DataFormatList[CurrentDataFormatIndex];intbytes_to_add=currentDataFormat.numOfBytes();if(currentDataFormatinstanceofIntegerDataFormat||currentDataFormatinstanceofFloatDataFormat){StringthisData=newString(data,bytes_added,bytes_to_add);//Log.errorln("GotHrefFormattedNumberData:["+thisData.trim()+"]["+bytes_added+"]["+bytes_to_add+"]");try{addDataToCurrentArray(location,thisData.trim(),currentDataFormat,IntRadix[CurrentDataFormatIndex]);}catch(SetDataExceptione){thrownewSetDataException("UnabletosetData:["+thisData+"],ignoringrequest"+e.getMessage());}}elseif(currentDataFormatinstanceofStringDataFormat){StringthisData=newString(data,bytes_added,bytes_to_add);//Log.errorln("GotHrefFormattedCharacterData:["+thisData+"]["+bytes_added+"]["+bytes_to_add+"]");try{addDataToCurrentArray(location,thisData,currentDataFormat,IntRadix[CurrentDataFormatIndex]);}catch(SetDataExceptione){thrownewSetDataException("UnabletosetData:["+thisData+"],ignoringrequest"+e.getMessage());}}elseif(currentDataFormatinstanceofBinaryFloatDataFormat){if(bytes_to_add==4){floatmyValue=convert4bytesToFloat(endian,data,bytes_added);//Log.errorln("GotHrefDataBFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]");CurrentArray.setData(location,myValue);}elseif(bytes_to_add==8){//Log.errorln("GotHrefDataBFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]");doublemyValue=convert8bytesToDouble(endian,data,bytes_added);CurrentArray.setData(location,myValue);}else{Log.errorln("Error:gotfloatingpointwithbitsize!=(32|64).Ignoringdata.");}}elseif(currentDataFormatinstanceofBinaryIntegerDataFormat){//IntegermyValue=convert2bytesToInteger(endian,data,bytes_added);//Log.errorln("GotHrefDataInteger:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]");//intnumOfBytes=((BinaryIntegerDataFormat)currentDataFormat).numOfBytes();//intmyValue=convertBytesToInteger(bytes_to_add,endian,data,bytes_added);//CurrentArray.setData(location,myValue);//isitbettertouseadispatchtablehere?switch(bytes_to_add){case1:{//8-bitshortval=convert1byteToShort(data,bytes_added);CurrentArray.setData(location,val);break;}case2:{//16-bitshortval=convert2bytesToShort(endian,data,bytes_added);CurrentArray.setData(location,val);break;}case3:{//24-bit(unusual)intval=convert3bytesToInt(endian,data,bytes_added);CurrentArray.setData(location,val);break;}case4:{//32-bitintval=convert4bytesToInt(endian,data,bytes_added);CurrentArray.setData(location,val);break;}case8:{//64-bitlongval=convert8bytesToLong(endian,data,bytes_added);CurrentArray.setData(location,val);break;}default:Log.errorln("XDFCan'thandlebinaryintegersofbytesize:"+bytes_to_add+".Aborting!");System.exit(-1);}}//advancethedatapointertonextlocationlocation.next();//advanceourglobalpointertothecurrentDataFormatif(NrofDataFormats>1)if(CurrentDataFormatIndex==(NrofDataFormats-1))CurrentDataFormatIndex=0;elseCurrentDataFormatIndex++;bytes_added+=bytes_to_add;}elseif(currentIOCmdinstanceofSkipCharFormattedIOCmd){Integerbytes_to_skip=((SkipCharFormattedIOCmd)currentIOCmd).getCount();bytes_added+=bytes_to_skip.intValue();}elseif(currentIOCmdinstanceofRepeatFormattedIOCmd){//shouldnthappenLog.errorln("ArghgetFormatCommandsnotworkingright,gotrepeatcommandinaddByteData!!!");System.exit(-1);}//advanceourglobalpointertothecurrentIOCmdif(nrofIOCmd>1)if(CurrentIOCmdIndex==(nrofIOCmd-1))CurrentIOCmdIndex=0;elseCurrentIOCmdIndex++;}}
| 12,311
|
protected void changeState(int stateflag, boolean b) { int oldstate = stateMask; int newstate; if (b) newstate = oldstate | stateflag; else newstate = oldstate & ~ stateflag; if (oldstate == newstate) return; if ((stateflag != SELECTED) && (stateflag != ENABLED) && (stateMask & ENABLED) == 0) return; stateMask = newstate; fireStateChanged(); if ((oldstate & SELECTED) == 0 && (newstate & SELECTED) == SELECTED) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else if ((oldstate & SELECTED) == SELECTED && (newstate & SELECTED) == 0) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } else if (((oldstate & ARMED) == ARMED && (oldstate & PRESSED) == PRESSED) && ((newstate & ARMED) == ARMED && (newstate & PRESSED) == 0)) fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand)); }
|
private void changeState(int stateflag, boolean b) { int oldstate = stateMask; int newstate; if (b) newstate = oldstate | stateflag; else newstate = oldstate & ~ stateflag; if (oldstate == newstate) return; if ((stateflag != SELECTED) && (stateflag != ENABLED) && (stateMask & ENABLED) == 0) return; stateMask = newstate; fireStateChanged(); if ((oldstate & SELECTED) == 0 && (newstate & SELECTED) == SELECTED) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else if ((oldstate & SELECTED) == SELECTED && (newstate & SELECTED) == 0) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } else if (((oldstate & ARMED) == ARMED && (oldstate & PRESSED) == PRESSED) && ((newstate & ARMED) == ARMED && (newstate & PRESSED) == 0)) fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand)); }
| 12,312
|
public void fireActionPerformed(ActionEvent e) { ActionListener[] ll = getActionListeners(); for (int i = 0; i < ll.length; i++) ll[i].actionPerformed(e); }
|
protected void fireActionPerformed(ActionEvent e) { ActionListener[] ll = getActionListeners(); for (int i = 0; i < ll.length; i++) ll[i].actionPerformed(e); }
| 12,313
|
public void fireItemStateChanged(ItemEvent e) { ItemListener[] ll = getItemListeners(); for (int i = 0; i < ll.length; i++) ll[i].itemStateChanged(e); }
|
protected void fireItemStateChanged(ItemEvent e) { ItemListener[] ll = getItemListeners(); for (int i = 0; i < ll.length; i++) ll[i].itemStateChanged(e); }
| 12,314
|
public void fireStateChanged() { ChangeListener[] ll = getChangeListeners(); for (int i = 0; i < ll.length; i++) ll[i].stateChanged(changeEvent); }
|
protected void fireStateChanged() { ChangeListener[] ll = getChangeListeners(); for (int i = 0; i < ll.length; i++) ll[i].stateChanged(changeEvent); }
| 12,315
|
public CellRendererPane() { } // CellRendererPane()
|
public CellRendererPane() { } // CellRendererPane()
| 12,317
|
protected void addImpl(Component c, Object constraints, int index) { if (!isAncestorOf(c)) { super.addImpl(c, constraints, index); } } // addImpl()
|
protected void addImpl(Component c, Object constraints, int index) { if (!isAncestorOf(c)) { super.addImpl(c, constraints, index); } } // addImpl()
| 12,318
|
public void invalidate() { } // invalidate()
|
public void invalidate() { } // invalidate()
| 12,319
|
public void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { // reparent c addImpl(c, null, 0); Rectangle oldClip = graphics.getClipBounds(); // translate to (x,y) graphics.translate(x, y); graphics.clipRect(0, 0, w, h); // set bounds of c c.setBounds(0, 0, w, h); // validate if necessary if (shouldValidate) { c.validate(); } // paint component c.paint(graphics); // untranslate g graphics.translate(-x, -y); graphics.setClip(oldClip); } // paintComponent()
|
public void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { // reparent c addImpl(c, null, 0); Rectangle oldClip = graphics.getClipBounds(); // translate to (x,y) graphics.translate(x, y); graphics.clipRect(0, 0, w, h); // set bounds of c c.setBounds(0, 0, w, h); // validate if necessary if (shouldValidate) { c.validate(); } // paint component c.paint(graphics); // untranslate g graphics.translate(-x, -y); graphics.setClip(oldClip); } // paintComponent()
| 12,321
|
public void update(Graphics graphics) { } // update()
|
public void update(Graphics graphics) { } // update()
| 12,322
|
public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; }
|
public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; }
| 12,323
|
public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; }
|
public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; }
| 12,324
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
| 12,325
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
| 12,326
|
public Quad foldConstants() { if (operand1 instanceof Constant && operand2 instanceof Constant) { Constant c1 = (Constant) operand1; Constant c2 = (Constant) operand2; switch (operation) { case IADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAdd(c2)); case ISUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iSub(c2)); case IMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iMul(c2)); case IDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iDiv(c2)); case IREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iRem(c2)); case IAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAnd(c2)); case IOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iOr(c2)); case IXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iXor(c2)); case ISHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShl(c2)); case ISHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShr(c2)); case IUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iUshr(c2)); case LADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAdd(c2)); case LSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lSub(c2)); case LMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lMul(c2)); case LDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lDiv(c2)); case LREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lRem(c2)); case LAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAnd(c2)); case LOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lOr(c2)); case LXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lXor(c2)); case LSHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShl(c2)); case LSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShr(c2)); case LUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lUshr(c2)); case FADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fAdd(c2)); case FSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fSub(c2)); case FMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fMul(c2)); case FDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fDiv(c2)); case FREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fRem(c2)); case DADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dAdd(c2)); case DSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dSub(c2)); case DMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dMul(c2)); case DDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dDiv(c2)); case DREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dRem(c2)); default: throw new IllegalArgumentException("Don't know how to fold those yet..."); } } return this; }
|
public Quad foldConstants() { if (operand1 instanceof Constant && operand2 instanceof Constant) { Constant c1 = (Constant) operand1; Constant c2 = (Constant) operand2; switch (operation) { case IADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAdd(c2)); case ISUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iSub(c2)); case IMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iMul(c2)); case IDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iDiv(c2)); case IREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iRem(c2)); case IAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAnd(c2)); case IOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iOr(c2)); case IXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iXor(c2)); case ISHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShl(c2)); case ISHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShr(c2)); case IUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iUshr(c2)); case LADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAdd(c2)); case LSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lSub(c2)); case LMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lMul(c2)); case LDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lDiv(c2)); case LREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lRem(c2)); case LAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAnd(c2)); case LOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lOr(c2)); case LXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lXor(c2)); case LSHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShl(c2)); case LSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShr(c2)); case LUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lUshr(c2)); case FADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fAdd(c2)); case FSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fSub(c2)); case FMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fMul(c2)); case FDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fDiv(c2)); case FREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fRem(c2)); case DADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dAdd(c2)); case DSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dSub(c2)); case DMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dMul(c2)); case DDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dDiv(c2)); case DREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dRem(c2)); default: throw new IllegalArgumentException("Don't know how to fold those yet..."); } } return this; }
| 12,327
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,328
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,329
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,330
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,331
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,332
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,333
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 12,334
|
public Operand getOperand1() { return operand1; }
|
public Operand getOperand1() { return operand1; }
| 12,335
|
public Operand getOperand2() { return operand2; }
|
public Operand getOperand2() { return operand2; }
| 12,336
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + operand1.toString() + " " + OP_MAP[operation - IADD] + " " + operand2.toString(); }
|
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + operand1.toString() + " " + OP_MAP[operation - IADD] + " " + operand2.toString(); }
| 12,337
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*// this stuff slows down the parser too much to leave commented in.// uncomment as neededLog.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*// this stuff slows down the parser too much to leave commented in.// uncomment as neededLog.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = 0; try { thisInt = Integer.parseInt(thisString, intRadix); } catch (NumberFormatException e) { if (thisString.startsWith("+")) { thisInt = Integer.parseInt(thisString.substring(1), intRadix); } else { throw e; } } CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
| 12,339
|
private static RMIClassLoaderSpi getProviderInstance() { // TODO: Do something more useful here. return null; }
|
String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) private String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) static String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) RMIClassLoaderSpi String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) getProviderInstance() String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) { String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) // String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) TODO: String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) Do String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) something String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) more String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) useful String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) here. String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) return String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) null; String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) }
| 12,341
|
public String getProperty(String key, String def) { return def; }
|
public String getProperty(String key, String def) { if (settings.containsKey(key)) return settings.getProperty(key); else return def; }
| 12,343
|
public MediaPrintableArea(float x, float y, float w, float h, int units) { if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f) throw new IllegalArgumentException(); this.x = x; this.y = y; this.width = w; this.height = h; }
|
public MediaPrintableArea(float x, float y, float w, float h, int units) { if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f) throw new IllegalArgumentException(); this.x = x; this.y = y; this.width = w; this.height = h; }
| 12,345
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException(); return height * units; }
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return height * units; }
| 12,346
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException(); return height * units; }
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException(); return height / ((float)units); }
| 12,347
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException(); return width * units; }
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return width * units; }
| 12,348
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException(); return width * units; }
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException(); return width / ((float)units); }
| 12,349
|
public float getX(int units) { if (units < 1) throw new IllegalArgumentException(); return x * units; }
|
public float getX(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return x * units; }
| 12,350
|
public float getX(int units) { if (units < 1) throw new IllegalArgumentException(); return x * units; }
|
public float getX(int units) { if (units < 1) throw new IllegalArgumentException(); return x / ((float)units); }
| 12,351
|
public float getY(int units) { if (units < 1) throw new IllegalArgumentException(); return y * units; }
|
public float getY(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return y * units; }
| 12,352
|
public float getY(int units) { if (units < 1) throw new IllegalArgumentException(); return y * units; }
|
public float getY(int units) { if (units < 1) throw new IllegalArgumentException(); return y / ((float)units); }
| 12,353
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
| 12,354
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
| 12,355
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
|
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
| 12,356
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.