bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
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); }
7,764
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; }
7,765
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); }
7,766
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; }
7,767
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()); setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; }
7,768
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()); setForeground(getTextNonSelectionColor()); } return this; }
7,769
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); }
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); }
7,770
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); }
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { if (obj instanceof VMID) { VMID other = (VMID) obj; return uid.equals(other.uid) && Arrays.equals(addr, other.addr); } VMID other = (VMID) obj; if (addr.length != other.addr.length) { if (obj instanceof VMID) { VMID other = (VMID) obj; return uid.equals(other.uid) && Arrays.equals(addr, other.addr); } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { if (obj instanceof VMID) { VMID other = (VMID) obj; return uid.equals(other.uid) && Arrays.equals(addr, other.addr); } } return uid.equals(other.uid); }
7,771
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); }
public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); }
7,772
public int hashCode () { return super.hashCode(); }
public int hashCode () { return super.hashCode(); }
7,773
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,774
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,775
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,776
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,777
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,778
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // activated = true;// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { activated = true; repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); }
7,779
public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); }
public void internalFrameActivated(InternalFrameEvent e) { activated = true; repaint(); }
7,781
public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); }
public void internalFrameClosed(InternalFrameEvent e) { }
7,782
public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); }
public void internalFrameClosing(InternalFrameEvent e) { disconnectMe(); }
7,783
public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); }
public void internalFrameDeiconified(InternalFrameEvent e) { }
7,785
public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); }
public void internalFrameIconified(InternalFrameEvent e) { }
7,786
public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); }
public void internalFrameOpened(InternalFrameEvent e) { }
7,787
public Session getSessionAt( int index) { JInternalFrame[] frames = desktop.getAllFrames(); return (Session)frames[index].getContentPane(); }
public Session getSessionAt( int index) { JInternalFrame[] frames = desktop.getAllFrames(); return (Session)frames[index].getContentPane(); }
7,789
private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
7,790
private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
7,791
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; } }
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; } }
7,792
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; } }
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } }
7,793
public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); }
public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); }
7,794
private void prevSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
private void prevSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } }
7,795
public void removeSessionView(Session targetSession) { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); int index = desktop.getIndexOf(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index);// sessionPane.remove(index);// if (index < (sessionPane.getTabCount() - 2)) {// sessionPane.setSelectedIndex(index);// sessionPane.setForegroundAt(index,Color.blue);// sessionPane.setIconAt(index,focused);// }// else {//// if (sessionPane.getTabCount() > 0) {// sessionPane.setSelectedIndex(0);// sessionPane.setForegroundAt(0,Color.blue);// sessionPane.setIconAt(0,focused);// }//// } }
public void removeSessionView(Session targetSession) { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); int index = desktop.getIndexOf(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index);// sessionPane.remove(index);// if (index < (sessionPane.getTabCount() - 2)) {// sessionPane.setSelectedIndex(index);// sessionPane.setForegroundAt(index,Color.blue);// sessionPane.setIconAt(index,focused);// }// else {//// if (sessionPane.getTabCount() > 0) {// sessionPane.setSelectedIndex(0);// sessionPane.setForegroundAt(0,Color.blue);// sessionPane.setIconAt(0,focused);// }//// } }
7,797
private void initXTFRInfo() { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); Border emptyBorder = BorderFactory.createEmptyBorder(10, 10, 0, 10); // main panel JPanel mp = new JPanel(); mp.setLayout(borderLayout); // system panel JPanel sp = new JPanel(); sp.setLayout(new BorderLayout()); sp.setBorder(emptyBorder); // host panel for as400 as400p = new JPanel(); as400p.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelAS400"))); as400p.setLayout(new GridBagLayout()); JLabel snpLabel = new JLabel(LangTool.getString("xtfr.labelSystemName")); systemName = new JTextField(vt.getHostName()); systemName.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy =0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(snpLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(systemName,gbc); JLabel hfnpLabel = new JLabel(LangTool.getString("xtfr.labelHostFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(hfnpLabel, gbc); hostFile = new JTextField(); hostFile.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(hostFile, gbc); JLabel idpLabel = new JLabel(LangTool.getString("xtfr.labelUserId")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(idpLabel, gbc); user = new JTextField(); user.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(user, gbc); // password panel JLabel pwpLabel = new JLabel(LangTool.getString("xtfr.labelPassword")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(pwpLabel, gbc); password = new JPasswordField(); password.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(password, gbc); // Query Wizard useQuery = new JCheckBox(LangTool.getString("xtfr.labelUseQuery")); useQuery.addItemListener(this); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(useQuery, gbc); //query button queryWizard = new JButton(LangTool.getString("xtfr.labelQueryWizard")); queryWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startWizard(); } }); queryWizard.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(queryWizard, gbc); // Field Selection panel fieldsLabel = new JLabel(LangTool.getString("xtfr.labelFields")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(fieldsLabel, gbc); allFields = new JRadioButton(LangTool.getString("xtfr.labelAllFields")); allFields.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(allFields, gbc); selectedFields = new JRadioButton(LangTool.getString("xtfr.labelSelectedFields")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 10); as400p.add(selectedFields, gbc); ButtonGroup fieldGroup = new ButtonGroup(); fieldGroup.add(allFields); fieldGroup.add(selectedFields); // Field Text Description panel textDescLabel = new JLabel(LangTool.getString("xtfr.labelTxtDesc")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 6; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(textDescLabel, gbc); txtDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescFull")); txtDesc.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 5); as400p.add(txtDesc, gbc); intDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescInt")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 10); as400p.add(intDesc, gbc); ButtonGroup txtDescGroup = new ButtonGroup(); txtDescGroup.add(txtDesc); txtDescGroup.add(intDesc); // pc panel for pc information JPanel pcp = new JPanel(new GridBagLayout()); pcp.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelpc"))); JLabel pffLabel = new JLabel(LangTool.getString("xtfr.labelFileFormat")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pffLabel, gbc); fileFormat = new JComboBox(); fileFormat.setPreferredSize(new Dimension(220, 25)); fileFormat.addItem(htmlFilter.getDescription()); fileFormat.addItem(OOFilter.getDescription()); fileFormat.addItem(ExcelFilter.getDescription()); fileFormat.addItem(KSpreadFilter.getDescription()); fileFormat.addItem(DelimitedFilter.getDescription()); fileFormat.addItem(FixedWidthFilter.getDescription()); fileFormat.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); filter = getFilterByDescription(); if (filter.getOutputFilterInstance().isCustomizable()) customize.setEnabled(true); else customize.setEnabled(false); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(fileFormat, gbc); customize = new JButton(LangTool.getString("xtfr.labelCustomize")); customize.setPreferredSize(new Dimension(110, 25)); customize.setActionCommand("CUSTOMIZE"); customize.addActionListener(this); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(customize, gbc); // now make sure we set the customizable button enabled or not // depending on the filter. fileFormat.setSelectedIndex(0); JLabel pcpLabel = new JLabel(LangTool.getString("xtfr.labelPCFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pcpLabel, gbc); localFile = new JTextField(); localFile.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(localFile, gbc); JButton browsePC = new JButton(LangTool.getString("xtfr.labelPCBrowse")); browsePC.setActionCommand("BROWSEPC"); browsePC.addActionListener(this); browsePC.setPreferredSize(new Dimension(110, 25)); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(browsePC, gbc); decimalSeparator = new JComboBox(); decimalSeparator.setPreferredSize(new Dimension(220, 25)); decimalSeparator.addItem(LangTool.getString("xtfr.period")); decimalSeparator.addItem(LangTool.getString("xtfr.comma")); // obtain the decimal separator for the machine locale DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.getDefault()); if (formatter.getDecimalFormatSymbols().getDecimalSeparator() == '.') decimalSeparator.setSelectedIndex(0); else decimalSeparator.setSelectedIndex(1); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 5); pcp.add(new JLabel(LangTool.getString("xtfr.labelDecimal")), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 5, 5); pcp.add(decimalSeparator, gbc); sp.add(as400p, BorderLayout.NORTH); sp.add(pcp, BorderLayout.SOUTH); // options panel JPanel op = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); JButton xtfrButton = new JButton(LangTool.getString("xtfr.labelXTFR")); xtfrButton.addActionListener(this); xtfrButton.setActionCommand("XTFR"); op.add(xtfrButton); JButton emailButton = new JButton(LangTool.getString("xtfr.labelXTFREmail")); emailButton.addActionListener(this); emailButton.setActionCommand("EMAIL"); op.add(emailButton); mp.add(sp, BorderLayout.CENTER); mp.add(op, BorderLayout.SOUTH); this.getContentPane().add(mp, BorderLayout.CENTER); // this.setModal(false); // this.setModal(true); this.setTitle(LangTool.getString("xtfr.title")); initXTFRFields(); // 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); //QueryPanel when Use Query selected as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); // now show the world what we can do show(); }
private void initXTFRInfo() { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); Border emptyBorder = BorderFactory.createEmptyBorder(10, 10, 0, 10); // main panel JPanel mp = new JPanel(); mp.setLayout(borderLayout); // system panel JPanel sp = new JPanel(); sp.setLayout(new BorderLayout()); sp.setBorder(emptyBorder); // host panel for as400 as400p = new JPanel(); as400p.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelAS400"))); as400p.setLayout(new GridBagLayout()); JLabel snpLabel = new JLabel(LangTool.getString("xtfr.labelSystemName")); systemName = new JTextField(vt.getHostName()); systemName.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy =0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(snpLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(systemName,gbc); JLabel hfnpLabel = new JLabel(LangTool.getString("xtfr.labelHostFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(hfnpLabel, gbc); hostFile = new JTextField(); hostFile.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(hostFile, gbc); JLabel idpLabel = new JLabel(LangTool.getString("xtfr.labelUserId")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(idpLabel, gbc); user = new JTextField(); user.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(user, gbc); // password panel JLabel pwpLabel = new JLabel(LangTool.getString("xtfr.labelPassword")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(pwpLabel, gbc); password = new JPasswordField(); password.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(password, gbc); // Query Wizard useQuery = new JCheckBox(LangTool.getString("xtfr.labelUseQuery")); useQuery.addItemListener(this); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(useQuery, gbc); //query button queryWizard = new JButton(LangTool.getString("xtfr.labelQueryWizard")); queryWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startWizard(); } }); queryWizard.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(queryWizard, gbc); // Field Selection panel fieldsLabel = new JLabel(LangTool.getString("xtfr.labelFields")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(fieldsLabel, gbc); allFields = new JRadioButton(LangTool.getString("xtfr.labelAllFields")); allFields.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(allFields, gbc); selectedFields = new JRadioButton(LangTool.getString("xtfr.labelSelectedFields")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 10); as400p.add(selectedFields, gbc); ButtonGroup fieldGroup = new ButtonGroup(); fieldGroup.add(allFields); fieldGroup.add(selectedFields); // Field Text Description panel textDescLabel = new JLabel(LangTool.getString("xtfr.labelTxtDesc")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 6; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(textDescLabel, gbc); txtDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescFull")); txtDesc.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 5); as400p.add(txtDesc, gbc); intDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescInt")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 10); as400p.add(intDesc, gbc); ButtonGroup txtDescGroup = new ButtonGroup(); txtDescGroup.add(txtDesc); txtDescGroup.add(intDesc); // pc panel for pc information JPanel pcp = new JPanel(new GridBagLayout()); pcp.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelpc"))); JLabel pffLabel = new JLabel(LangTool.getString("xtfr.labelFileFormat")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pffLabel, gbc); fileFormat = new JComboBox(); fileFormat.setPreferredSize(new Dimension(220, 25)); fileFormat.addItem(htmlFilter.getDescription()); fileFormat.addItem(OOFilter.getDescription()); fileFormat.addItem(ExcelFilter.getDescription()); fileFormat.addItem(KSpreadFilter.getDescription()); fileFormat.addItem(DelimitedFilter.getDescription()); fileFormat.addItem(FixedWidthFilter.getDescription()); fileFormat.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); filter = getFilterByDescription(); if (filter.getOutputFilterInstance().isCustomizable()) customize.setEnabled(true); else customize.setEnabled(false); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(fileFormat, gbc); customize = new JButton(LangTool.getString("xtfr.labelCustomize")); customize.setPreferredSize(new Dimension(110, 25)); customize.setActionCommand("CUSTOMIZE"); customize.addActionListener(this); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(customize, gbc); // now make sure we set the customizable button enabled or not // depending on the filter. fileFormat.setSelectedIndex(0); JLabel pcpLabel = new JLabel(LangTool.getString("xtfr.labelPCFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pcpLabel, gbc); localFile = new JTextField(); localFile.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(localFile, gbc); JButton browsePC = new JButton(LangTool.getString("xtfr.labelPCBrowse")); browsePC.setActionCommand("BROWSEPC"); browsePC.addActionListener(this); browsePC.setPreferredSize(new Dimension(110, 25)); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(browsePC, gbc); decimalSeparator = new JComboBox(); decimalSeparator.setPreferredSize(new Dimension(220, 25)); decimalSeparator.addItem(LangTool.getString("xtfr.period")); decimalSeparator.addItem(LangTool.getString("xtfr.comma")); // obtain the decimal separator for the machine locale DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.getDefault()); if (formatter.getDecimalFormatSymbols().getDecimalSeparator() == '.') decimalSeparator.setSelectedIndex(0); else decimalSeparator.setSelectedIndex(1); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 5); pcp.add(new JLabel(LangTool.getString("xtfr.labelDecimal")), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 5, 5); pcp.add(decimalSeparator, gbc); sp.add(as400p, BorderLayout.NORTH); sp.add(pcp, BorderLayout.SOUTH); // options panel JPanel op = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); JButton xtfrButton = new JButton(LangTool.getString("xtfr.labelXTFR")); xtfrButton.addActionListener(this); xtfrButton.setActionCommand("XTFR"); op.add(xtfrButton); JButton emailButton = new JButton(LangTool.getString("xtfr.labelXTFREmail")); emailButton.addActionListener(this); emailButton.setActionCommand("EMAIL"); op.add(emailButton); mp.add(sp, BorderLayout.CENTER); mp.add(op, BorderLayout.SOUTH); this.getContentPane().add(mp, BorderLayout.CENTER); // this.setModal(false); // this.setModal(true); this.setTitle(LangTool.getString("xtfr.title")); initXTFRFields(); // 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); //QueryPanel when Use Query selected as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); // now show the world what we can do show(); }
7,798
public void setDragMode(int mode) { if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) { // throw new IllegalArgumentException("Outline drag modes are unsupported."); mode = LIVE_DRAG_MODE; } dragMode = mode; }
public void setDragMode(int mode) if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) // throw new IllegalArgumentException("Outline drag modes are unsupported."); mode = LIVE_DRAG_MODE; } dragMode = mode; }
7,799
public void setDragMode(int mode) { if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) { // throw new IllegalArgumentException("Outline drag modes are unsupported."); mode = LIVE_DRAG_MODE; } dragMode = mode; }
public void setDragMode(int mode) { if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) { // throw new IllegalArgumentException("Outline drag modes are unsupported."); mode = LIVE_DRAG_MODE; dragMode = mode;
7,800
public void addParameterObject(Object o) throws AssemblyException { if (!klass.isInstance(o)) throw new AssemblyException( new IllegalArgumentException( "Cannot add object " + o + " to array where the elements are of class " + klass)); list.add(o); }
public void addParameterObject(Object o) throws AssemblyException { if (!klass.isInstance(o)) throw new AssemblyException( new IllegalArgumentException( "Cannot add object " + o + " to array where the elements are of class " + klass)); list.add(o); }
7,802
public void addParameterObject(Object o) throws AssemblyException { if (!klass.isInstance(o)) throw new AssemblyException( new IllegalArgumentException( "Cannot add object " + o + " to array where the elements are of class " + klass)); list.add(o); }
public void addParameterObject(Object o) throws AssemblyException { if (!klass.isInstance(o)) throw new AssemblyException( new IllegalArgumentException( "Cannot add object " + o + " to array where the elements are of class " + klass)); try { Array.set(array, length++, o); } catch(IllegalArgumentException iae) { throw new AssemblyException(iae); } }
7,803
public Object endContext(Context outerContext) throws AssemblyException { if (array == null) { array = Array.newInstance(klass, list.size()); for (int i = 0; i < list.size(); i++) Array.set(array, i, list.get(i)); } return array; }
public Object endContext(Context outerContext) throws AssemblyException { if (length != Array.getLength(array)) { array = Array.newInstance(klass, list.size()); for (int i = 0; i < list.size(); i++) Array.set(array, i, list.get(i)); } return array; }
7,804
public Object endContext(Context outerContext) throws AssemblyException { if (array == null) { array = Array.newInstance(klass, list.size()); for (int i = 0; i < list.size(); i++) Array.set(array, i, list.get(i)); } return array; }
public Object endContext(Context outerContext) throws AssemblyException { if (array == null) { array = Array.newInstance(klass, list.size()); for (int i = 0; i < list.size(); i++) Array.set(array, i, list.get(i)); } return array; }
7,805
public Object get(int index) throws AssemblyException { if (array == null) return list.get(index); else return Array.get(array, index); }
public Object get(int index) throws AssemblyException { if (array == null) return list.get(index); else return Array.get(array, index); }
7,806
public void set(int index, Object o) throws AssemblyException { if (array == null) { if (klass.isInstance(o)) list.add(index, o); else throw new AssemblyException( new IllegalArgumentException("Argument is not compatible to array component type.")); } else Array.set(array, index, o); }
public void set(int index, Object o) throws AssemblyException { if (array == null) { if (klass.isInstance(o)) list.add(index, o); else throw new AssemblyException( new IllegalArgumentException("Argument is not compatible to array component type.")); } else Array.set(array, index, o); }
7,807
public JWindow() { super(SwingUtilities.getOwnerFrame()); windowInit(); }
public JWindow() { super(SwingUtilities.getOwnerFrame(null)); windowInit(); }
7,809
public Graphics getGraphics() { log.debug("getGraphics"); final Component parent = component.getParent(); if (parent != null) { //System.out.println("creating graphics"); return parent.getGraphics().create(location.x, location.y, size.width, size.height); } else { throw new Error(); } }
public Graphics getGraphics() { log.debug("getGraphics"); final Component parent = component.getParent(); if (parent != null) { //System.out.println("creating graphics"); return parent.getGraphics().create(location.x, location.y, size.width, size.height); } else { throw new Error(); } }
7,810
public void hide() { setVisible(false); }
public final void hide() { setVisible(false); }
7,811
public Dimension minimumSize() { return jComponent.getMinimumSize(); }
public final Dimension minimumSize() { return jComponent.getMinimumSize(); }
7,812
public Dimension preferredSize() { return jComponent.getPreferredSize(); }
public final Dimension preferredSize() { return jComponent.getPreferredSize(); }
7,813
public void print(Graphics g) { jComponent.print(g); }
public final void print(Graphics g) { jComponent.print(g); }
7,814
public void repaint(long tm, int x, int y, int width, int height) { jComponent.repaint(tm, x, y, width, height); paintAWTComponent(); }
public final void repaint(long tm, int x, int y, int width, int height) { jComponent.repaint(tm, x, y, width, height); paintAWTComponent(); }
7,815
public void requestFocus() { jComponent.requestFocus(); }
public final void requestFocus() { jComponent.requestFocus(); }
7,816
public void reshape(int x, int y, int width, int height) { setBounds(x, y, width, height); }
public final void reshape(int x, int y, int width, int height) { setBounds(x, y, width, height); }
7,817
public void setBackground(Color c) { jComponent.setBackground(c); paintAWTComponent(); }
public final void setBackground(Color c) { jComponent.setBackground(c); paintAWTComponent(); }
7,818
public void setBounds(int x, int y, int width, int height) { Rectangle b = jComponent.getBounds(); jComponent.setBounds(x, y, width, height); if (b.width != width || b.height != height) { sendComponentEvent(ComponentEvent.COMPONENT_RESIZED); } else { sendComponentEvent(ComponentEvent.COMPONENT_MOVED); } }
public void setBounds(int x, int y, int width, int height) { Rectangle b = jComponent.getBounds(); jComponent.setBounds(x, y, width, height); if (b.width != width || b.height != height) { sendComponentEvent(ComponentEvent.COMPONENT_RESIZED); } else { sendComponentEvent(ComponentEvent.COMPONENT_MOVED); } }
7,819
public void setBounds(int x, int y, int width, int height) { Rectangle b = jComponent.getBounds(); jComponent.setBounds(x, y, width, height); if (b.width != width || b.height != height) { sendComponentEvent(ComponentEvent.COMPONENT_RESIZED); } else { sendComponentEvent(ComponentEvent.COMPONENT_MOVED); } }
public void setBounds(int x, int y, int width, int height) { Rectangle b = jComponent.getBounds(); jComponent.setBounds(x, y, width, height); if ((oldWidth != width) || (oldHeight != height)) { sendComponentEvent(ComponentEvent.COMPONENT_RESIZED); } else { sendComponentEvent(ComponentEvent.COMPONENT_MOVED); } }
7,820
public void setCursor(Cursor cursor) { jComponent.setCursor(cursor); }
public final void setCursor(Cursor cursor) { jComponent.setCursor(cursor); }
7,821
public void setEnabled(boolean b) { jComponent.setEnabled(b); }
public final void setEnabled(boolean b) { jComponent.setEnabled(b); }
7,822
public void setEventMask(long mask) { // TODO Auto-generated method stub }
public final void setEventMask(long mask) { // TODO Auto-generated method stub }
7,823
public void setFont(Font f) { jComponent.setFont(f); paintAWTComponent(); }
public final void setFont(Font f) { jComponent.setFont(f); paintAWTComponent(); }
7,824
public void setVisible(boolean b) { jComponent.setVisible(b); paintAWTComponent(); }
public final void setVisible(boolean b) { jComponent.setVisible(b); paintAWTComponent(); }
7,825
public void show() { setVisible(true); }
public final void show() { setVisible(true); }
7,826
public static Component[] getVisibleChildren(Container c) { Component[] children = c.getComponents(); Vector visible = new Vector(); for (int i = 0; i < children.length; i++) if (children[i].isVisible()) visible.add(children[i]); return (Component[]) visible.toArray(new Container[visible.size()]); }
public static List getVisibleChildren(Container c) { Component[] children = c.getComponents(); Vector visible = new Vector(); for (int i = 0; i < children.length; i++) if (children[i].isVisible()) visible.add(children[i]); return (Component[]) visible.toArray(new Container[visible.size()]); }
7,827
public static Component[] getVisibleChildren(Container c) { Component[] children = c.getComponents(); Vector visible = new Vector(); for (int i = 0; i < children.length; i++) if (children[i].isVisible()) visible.add(children[i]); return (Component[]) visible.toArray(new Container[visible.size()]); }
public static Component[] getVisibleChildren(Container c) { Component[] children = c.getComponents(); Vector visible = new Vector(); for (int i = 0; i < children.length; i++) if (children[i].isVisible()) visible.add(children[i]); return (Component[]) visible.toArray(new Container[visible.size()]); }
7,828
public Checkbox() { this("", false, null); }
Checkbox() { this("", false, null); }
7,829
public void addNotify() { if (peer == null) peer = getToolkit().createCheckbox(this); super.addNotify(); }
addNotify() { if (peer == null) peer = getToolkit().createCheckbox(this); super.addNotify(); }
7,830
public CheckboxGroup getCheckboxGroup() { return (group); }
public CheckboxGroup getCheckboxGroup() { return (group); }
7,831
public Object[] getSelectedObjects() { if (state == false) return (null); Object[] objs = new Object[1]; objs[0] = label; return (objs); }
getSelectedObjects() { if (state == false) return (null); Object[] objs = new Object[1]; objs[0] = label; return (objs); }
7,832
protected String paramString() { return ("label=" + label + ",state=" + state + ",group=" + group + "," + super.paramString()); }
protected String paramString() { return ("label=" + label + ",state=" + state + ",group=" + group + "," + super.paramString()); }
7,833
public synchronized void setCheckboxGroup(CheckboxGroup group) { this.group = group; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setCheckboxGroup(group); } }
setCheckboxGroup(CheckboxGroup group) { this.group = group; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setCheckboxGroup(group); } }
7,834
public synchronized void setCheckboxGroup(CheckboxGroup group) { this.group = group; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setCheckboxGroup(group); } }
public synchronized void setCheckboxGroup(CheckboxGroup group) { this.group = group; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setCheckboxGroup(group); } }
7,835
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setLabel(label); } }
setLabel(String label) { this.label = label; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setLabel(label); } }
7,837
public synchronized void setState(boolean state) { this.state = state; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setState(state); } }
setState(boolean state) { this.state = state; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setState(state); } }
7,838
public synchronized void setState(boolean state) { this.state = state; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setState(state); } }
public synchronized void setState(boolean state) { this.state = state; if (peer != null) { CheckboxPeer cp = (CheckboxPeer) peer; cp.setState(state); } }
7,839
public Object getClientProperty(Object key) { return getClientProperties().get(key); }
public final Object getClientProperty(Object key) { return getClientProperties().get(key); }
7,842
protected String paramString() { return "JComponent"; }
protected String paramString() { StringBuffer sb = new StringBuffer(); sb.append(super.paramString()); sb.append(",alignmentX=").append(getAlignmentX()); sb.append(",alignmentY=").append(getAlignmentY()); sb.append(",border="); if (getBorder() != null) sb.append(getBorder()); sb.append(",maximumSize="); if (getMaximumSize() != null) sb.append(getMaximumSize()); sb.append(",minimumSize="); if (getMinimumSize() != null) sb.append(getMinimumSize()); sb.append(",preferredSize="); if (getPreferredSize() != null) sb.append(getPreferredSize()); return sb.toString(); }
7,843
public void putClientProperty(Object key, Object value) { getClientProperties().put(key, value); }
public final void putClientProperty(Object key, Object value) { getClientProperties().put(key, value); }
7,844
public Graphics create() { return new DebugGraphics(graphics.create()); }
public Graphics create() { DebugGraphics copy = new DebugGraphics(graphics.create()); copy.debugOptions = debugOptions; return copy; }
7,849
public void drawChars(char[] data, int offset, int length, int x, int y) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.setColor(color); graphics.drawChars(data, offset, length, x, y); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.drawChars(data, offset, length, x, y); sleep(debugFlashTime); } graphics.setColor(color); graphics.drawChars(data, offset, length, x, y); }
public void drawChars(char[] data, int offset, int length, int x, int y) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.drawChars(data, offset, length, x, y); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.drawChars(data, offset, length, x, y); sleep(debugFlashTime); } graphics.drawChars(data, offset, length, x, y); }
7,853
public void drawRect(int x, int y, int width, int height) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.setColor(color); graphics.drawRect(x, y, width, height); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.drawRect(x, y, width, height); sleep(debugFlashTime); } graphics.setColor(color); graphics.drawRect(x, y, width, height); }
public void drawRect(int x, int y, int width, int height) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.drawRect(x, y, width, height); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.drawRect(x, y, width, height); sleep(debugFlashTime); } graphics.drawRect(x, y, width, height); }
7,859
public void fillRect(int x, int y, int width, int height) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.setColor(color); graphics.fillRect(x, y, width, height); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.fillRect(x, y, width, height); sleep(debugFlashTime); } graphics.setColor(color); graphics.fillRect(x, y, width, height); }
public void fillRect(int x, int y, int width, int height) { for (int index = 0; index < (debugFlashCount - 1); ++index) { graphics.fillRect(x, y, width, height); sleep(debugFlashTime); graphics.setColor(debugFlashColor); graphics.fillRect(x, y, width, height); sleep(debugFlashTime); } graphics.fillRect(x, y, width, height); }
7,866
public Color getColor() { return color; }
public Color getColor() { return graphics.getColor(); }
7,868
public void setColor(Color color) { this.color = color; }
public void setColor(Color color) { if ((debugOptions & LOG_OPTION) != 0) logStream().println(prefix() + " Setting color: " + color); graphics.setColor(color); }
7,870
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { sem.send(); JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { if (sem.send()) { JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
7,876
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { sem.send(); JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { sem.send(); JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
7,877
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { sem.send(); JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
private void sendIt (Frame parent, SendEMail sem) { if (parent == null) parent = new JFrame(); try { sem.send(); JOptionPane.showMessageDialog(parent, LangTool.getString("em.confirmationMessage") + " " + (String)toAddress.getSelectedItem(), LangTool.getString("em.titleConfirmation"), JOptionPane.INFORMATION_MESSAGE); if (session != null) { config.setProperty("emailTo", getToTokens(config.getStringProperty("emailTo"), toAddress)); config.saveSessionProps(); setToCombo(config.getStringProperty("emailTo"),toAddress); } } catch (IOException ioe) { System.out.println(ioe.getMessage()); } catch (SendFailedException sfe) { showFailedException(parent, sfe); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
7,878
final static void add(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 + fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, true); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFADDP(reg); // Push result vstack.push(result); } }
final static void add(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(ifac, type, fpv1 + fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, true); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFADDP(reg); // Push result vstack.push(result); } }
7,879
final static void compare(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, boolean gt, int type, Label curInstrLabel) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); // Prepare operands final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1. fxchST1(os, fpuStack, reg); final X86RegisterPool pool = ec.getPool(); pool.request(EAX); final Register resr = pool.request(JvmType.INT); if (!gt) { // Reverse order fxch(os, fpuStack, Register.ST1); } os.writeFUCOMPP(); // Compare, Pop twice os.writeFNSTSW_AX(); // Store fp status word in AX os.writeSAHF(); // Store AH to Flags // Pop fpu stack twice (FUCOMPP) fpuStack.pop(); fpuStack.pop(); final Label eqLabel = new Label(curInstrLabel + "eq"); final Label ltLabel = new Label(curInstrLabel + "lt"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(eqLabel, X86Constants.JE); os.writeJCC(ltLabel, X86Constants.JB); // Greater if (gt) { os.writeMOV_Const(resr, -1); } else { os.writeMOV_Const(resr, 1); } os.writeJMP(endLabel); // Equal os.setObjectRef(eqLabel); os.writeXOR(resr, resr); os.writeJMP(endLabel); // Less os.setObjectRef(ltLabel); if (gt) { os.writeMOV_Const(resr, 1); } else { os.writeMOV_Const(resr, -1); } // End os.setObjectRef(endLabel); // Push result final IntItem res = IntItem.createReg(resr); pool.transferOwnerTo(resr, res); vstack.push(res); // Release pool.release(EAX); }
final static void compare(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, boolean gt, int type, Label curInstrLabel) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); // Prepare operands final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1. fxchST1(os, fpuStack, reg); final X86RegisterPool pool = ec.getPool(); pool.request(EAX); final Register resr = pool.request(JvmType.INT); if (!gt) { // Reverse order fxch(os, fpuStack, Register.ST1); } os.writeFUCOMPP(); // Compare, Pop twice os.writeFNSTSW_AX(); // Store fp status word in AX os.writeSAHF(); // Store AH to Flags // Pop fpu stack twice (FUCOMPP) fpuStack.pop(); fpuStack.pop(); final Label eqLabel = new Label(curInstrLabel + "eq"); final Label ltLabel = new Label(curInstrLabel + "lt"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(eqLabel, X86Constants.JE); os.writeJCC(ltLabel, X86Constants.JB); // Greater if (gt) { os.writeMOV_Const(resr, -1); } else { os.writeMOV_Const(resr, 1); } os.writeJMP(endLabel); // Equal os.setObjectRef(eqLabel); os.writeXOR(resr, resr); os.writeJMP(endLabel); // Less os.setObjectRef(ltLabel); if (gt) { os.writeMOV_Const(resr, 1); } else { os.writeMOV_Const(resr, -1); } // End os.setObjectRef(endLabel); // Push result final ItemFactory ifac = ec.getItemFactory(); final IntItem res = (IntItem)ifac.createReg(JvmType.INT, resr); pool.transferOwnerTo(resr, res); vstack.push(res); // Release pool.release(EAX); }
7,880
final static void convert(EmitterContext ec, VirtualStack vstack, int fromType, int toType) { final Item v = vstack.pop(fromType); if (v.isConstant()) { vstack.push(createConst(toType, getFPValue(v))); } else { v.pushToFPU(ec); vstack.fpuStack.pop(v); final Item result = createFPUStack(toType); vstack.push(result); vstack.fpuStack.push(result); } }
final static void convert(EmitterContext ec, VirtualStack vstack, int fromType, int toType) { final Item v = vstack.pop(fromType); if (v.isConstant()) { vstack.push(createConst(ifac, toType, getFPValue(v))); } else { v.pushToFPU(ec); vstack.fpuStack.pop(v); final Item result = createFPUStack(toType); vstack.push(result); vstack.fpuStack.push(result); } }
7,881
final static void convert(EmitterContext ec, VirtualStack vstack, int fromType, int toType) { final Item v = vstack.pop(fromType); if (v.isConstant()) { vstack.push(createConst(toType, getFPValue(v))); } else { v.pushToFPU(ec); vstack.fpuStack.pop(v); final Item result = createFPUStack(toType); vstack.push(result); vstack.fpuStack.push(result); } }
final static void convert(EmitterContext ec, VirtualStack vstack, int fromType, int toType) { final Item v = vstack.pop(fromType); if (v.isConstant()) { vstack.push(createConst(toType, getFPValue(v))); } else { v.pushToFPU(ec); vstack.fpuStack.pop(v); final Item result = ifac.createFPUStack(toType); vstack.push(result); vstack.fpuStack.push(result); } }
7,882
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
private final static Item createConst(ItemFactory ifac, int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
7,883
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return ifac.createDConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
7,884
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return ifac.createFConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
7,885
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return ifac.createIConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
7,886
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return LongItem.createConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
private final static Item createConst(int type, double value) { switch (type) { case JvmType.DOUBLE: return DoubleItem.createConst(value); case JvmType.FLOAT: return FloatItem.createConst((float) value); case JvmType.INT: return IntItem.createConst((int) value); case JvmType.LONG: return ifac.createLConst((long) value); default: throw new IllegalArgumentException("Invalid type " + type); } }
7,887
final static void div(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 / fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFDIVP(reg); // Push result vstack.push(result); } }
final static void div(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(ifac, type, fpv1 / fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFDIVP(reg); // Push result vstack.push(result); } }
7,888
final static void mul(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 * fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, true); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFMULP(reg); // Push result vstack.push(result); } }
final static void mul(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(ifac, type, fpv1 * fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, true); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFMULP(reg); // Push result vstack.push(result); } }
7,889
final static void neg(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v = vstack.pop(type); if (v.isConstant()) { final double fpv = getFPValue(v); vstack.push(createConst(type, -fpv)); } else { // Prepare final FPUStack fpuStack = vstack.fpuStack; prepareForOperation(os, ec, vstack, fpuStack, v); // Calculate os.writeFCHS(); // Push result vstack.push(v); } }
final static void neg(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v = vstack.pop(type); if (v.isConstant()) { final double fpv = getFPValue(v); vstack.push(createConst(ifac, type, -fpv)); } else { // Prepare final FPUStack fpuStack = vstack.fpuStack; prepareForOperation(os, ec, vstack, fpuStack, v); // Calculate os.writeFCHS(); // Push result vstack.push(v); } }
7,890
final static void rem(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 % fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1, if not swap fxchST1(os, fpuStack, reg); // Pop the fpuStack.tos fpuStack.pop(); // Calculate os.writeFXCH(Register.ST1); os.writeFPREM(); os.writeFSTP(Register.ST1); // Push result vstack.push(fpuStack.tos()); } }
final static void rem(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(ifac, type, fpv1 % fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1, if not swap fxchST1(os, fpuStack, reg); // Pop the fpuStack.tos fpuStack.pop(); // Calculate os.writeFXCH(Register.ST1); os.writeFPREM(); os.writeFSTP(Register.ST1); // Push result vstack.push(fpuStack.tos()); } }
7,891
final static void sub(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 - fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFSUBP(reg); // Push result vstack.push(result); } }
final static void sub(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(ifac, type, fpv1 - fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); final Item result = fpuStack.getItem(reg); fpuStack.pop(); // Calculate os.writeFSUBP(reg); // Push result vstack.push(result); } }
7,892
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
7,893
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
7,894
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch.head != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
7,895
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } else { return false; } }
private boolean matchP(CharIndexed input, REMatch mymatch) { REMatch newMatch = null; REMatch last = null; REToken tk; for (int i=0; i < options.size(); i++) { // In ordaer that the backtracking can work, // each option must be chained to the next token. // But the chain method has some side effect, so // we use clones. tk = (REToken)((REToken) options.elementAt(i)).clone(); tk.chain(this.next); tk.setUncle(this.uncle); tk.subIndex = this.subIndex; REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // is a match } // try next option if (newMatch != null) { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch.head); return true; } else { return false; } }
7,896
private void buildMethodHash(Class cls, boolean build) { Method[] meths = cls.getMethods(); for (int i = 0; i < meths.length; i++) { /* Don't need to include any java.xxx related stuff */ if (meths[i].getDeclaringClass().getName().startsWith("java.")) { continue; } long hash = RMIHashes.getMethodHash(meths[i]); if(build) methods.put(new Long (hash), meths[i]); else methods.remove(new Long (hash));//System.out.println("meth = " + meths[i] + ", hash = " + hash); }}
private void buildMethodHash(Class cls, boolean build) { Method[] meths = cls.getMethods(); for (int i = 0; i < meths.length; i++) { /* Don't need to include any java.xxx related stuff */ if (meths[i].getDeclaringClass().getName().startsWith("java.")) { continue; } long hash = RMIHashes.getMethodHash(meths[i]); if(build) methods.put(new Long (hash), meths[i]); else methods.remove(new Long(hash)); }//System.out.println("meth = " + meths[i] + ", hash = " + hash); }}
7,897