bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
---|---|---|
public void remove(Component comp) { synchronized (getTreeLock ()) { for (int i = 0; i < ncomponents; ++i) { if (component[i] == comp) { remove(i); break; } } } } | public void remove(Component comp) { synchronized (getTreeLock ()) { for (int i = 0; i < ncomponents; ++i) { if (component[i] == comp) { remove(i); break; } } } } | 101 |
public boolean requestFocusInWindow(boolean temporary) { return super.requestFocusInWindow(temporary); } | public boolean requestFocusInWindow() { return super.requestFocusInWindow(temporary); } | 103 |
public boolean requestFocusInWindow(boolean temporary) { return super.requestFocusInWindow(temporary); } | public boolean requestFocusInWindow(boolean temporary) { if (isRequestFocusEnabled()) return super.requestFocusInWindow(); else return false; } | 104 |
public static int round(float a) { if (Float.isNaN(a)) return 0; return (int) floor(a + 0.5f); } | public static int round(float a) { if (Float.isNaN(a)) return 0; return (int) floor(a + 0.5f); } | 105 |
public DefaultTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer, TreeCellEditor editor) { setTree(tree); this.renderer = renderer; if (editor == null) editor = createTreeCellEditor(); realEditor = editor; lastPath = tree.getLeadSelectionPath(); tree.addTreeSelectionListener(this); editingContainer = createContainer(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("Tree.font")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); editingIcon = renderer.getIcon(); timer = new javax.swing.Timer(1200, this); } | public DefaultTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer, TreeCellEditor editor) { setTree(tree); this.renderer = renderer; if (editor == null) editor = createTreeCellEditor(); realEditor = editor; lastPath = tree.getLeadSelectionPath(); tree.addTreeSelectionListener(this); editingContainer = createContainer(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("Tree.font")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); editingIcon = renderer.getIcon(); timer = new javax.swing.Timer(1200, this); } | 106 |
public DefaultTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer, TreeCellEditor editor) { setTree(tree); this.renderer = renderer; if (editor == null) editor = createTreeCellEditor(); realEditor = editor; lastPath = tree.getLeadSelectionPath(); tree.addTreeSelectionListener(this); editingContainer = createContainer(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("Tree.font")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); editingIcon = renderer.getIcon(); timer = new javax.swing.Timer(1200, this); } | public DefaultTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer, TreeCellEditor editor) { setTree(tree); this.renderer = renderer; if (editor == null) editor = createTreeCellEditor(); realEditor = editor; lastPath = tree.getLeadSelectionPath(); tree.addTreeSelectionListener(this); editingContainer = createContainer(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("Tree.font")); setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); editingIcon = renderer.getIcon(); timer = new javax.swing.Timer(1200, this); } | 107 |
public Rectangle(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } | public Rectangle() { this.x = x; this.y = y; this.width = width; this.height = height; } | 108 |
public Rectangle(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } | public Rectangle(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } | 109 |
public void setOpaque(boolean isOpaque) { boolean oldOpaque = opaque; opaque = isOpaque; firePropertyChange("opaque", oldOpaque, opaque); revalidate(); repaint(); } | public void setOpaque(boolean isOpaque) { boolean oldOpaque = opaque; opaque = isOpaque; firePropertyChange("opaque", oldOpaque, opaque); revalidate(); repaint(); } | 110 |
public void paintComponent(Graphics graphics, Component c, Container p, Rectangle r) { paintComponent(graphics, c, p, r.x, r.y, r.width, r.height); } // paintComponent() | public void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { paintComponent(graphics, c, p, r.x, r.y, r.width, r.height); } // paintComponent() | 111 |
public void paintComponent(Graphics graphics, Component c, Container p, Rectangle r) { paintComponent(graphics, c, p, r.x, r.y, r.width, r.height); } // paintComponent() | public void paintComponent(Graphics graphics, Component c, Container p, Rectangle r) { graphics.translate(x, y); c.setBounds(0, 0, w, h); if (shouldValidate) { c.validate(); } c.paint(graphics); graphics.translate(-x, -y); } // paintComponent() | 112 |
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(oldx, oldy, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } } | public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { boolean shouldRepaintParent = false; boolean shouldRepaintSelf = false; if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(parent.getX() + oldx, parent.getY() + oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(parent.getX() + x, parent.getY() + y, width, height); shouldRepaintParent = parentBounds.intersects(oldBounds); shouldRepaintSelf = parentBounds.intersects(newBounds); } if (shouldRepaintParent) parent.repaint(oldx, oldy, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } } | 113 |
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(oldx, oldy, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } } | public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(oldx, oldy, oldwidth, oldheight); if (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } } | 114 |
public SwingWindowPeer(SwingToolkit toolkit, Window window, JInternalFrame jComponent) { super(toolkit, window, jComponent); } | public SwingWindowPeer(SwingToolkit toolkit, Window window, JInternalFrame jComponent) { super(toolkit, window, jComponent); } | 115 |
public void setLocation(Point p) { setLocation(p.x, p.y); } | public void setLocation(int x, int y) { setLocation(p.x, p.y); } | 116 |
public void setLocation(Point p) { setLocation(p.x, p.y); } | public void setLocation(Point p) { move (x, y); } | 117 |
public void setSize(Dimension d) { resize (d); } | public void setSize(int width, int height) { resize (d); } | 118 |
public void setSize(Dimension d) { resize (d); } | public void setSize(Dimension d) { resize (width, height); } | 119 |
isResizable(){ return(resizable);} | isResizable(){ return(resizable);} | 120 |
getTitle(){ return(title);} | getTitle(){ return(title);} | 121 |
getMenuBar(){ return(menuBar);} | getMenuBar(){ return(menuBar);} | 122 |
public void dispose() { hide(); JDesktopPane pane = getDesktopPane(); if (pane != null) pane.setSelectedFrame(null); else { try { setSelected(false); } catch (PropertyVetoException e) { // Do nothing if they don't want to be unselected. } } isClosed = true; fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED); removeNotify(); } | public void dispose() { setVisible(false); JDesktopPane pane = getDesktopPane(); if (pane != null) pane.setSelectedFrame(null); else { try { setSelected(false); } catch (PropertyVetoException e) { // Do nothing if they don't want to be unselected. } } isClosed = true; fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED); removeNotify(); } | 123 |
public UserException(String reason) { super(reason); } | public UserException() { super(reason); } | 124 |
public UserException(String reason) { super(reason); } | public UserException(String reason) { } | 125 |
public IllegalArgumentException(String s) { super(s); } | public IllegalArgumentException(String s) { super(s); } | 126 |
protected CharsetProvider() { SecurityManager s = System.getSecurityManager(); if (s != null) s.checkPermission(new RuntimePermission("charsetProvider")); } | protected CharsetProvider() { SecurityManager s = System.getSecurityManager(); if (s != null && ! (this instanceof gnu.java.nio.charset.Provider || this instanceof gnu.java.nio.charset.iconv.IconvProvider)) s.checkPermission(new RuntimePermission("charsetProvider")); } | 127 |
public Key(int virtuelKey) { this.lowerVirtuelKey = virtuelKey; this.upperVirtuelKey = virtuelKey; this.altGrVirtuelKey = virtuelKey; lowerChar = 0; upperChar = 0; altGrChar = 0; } | public Key() { this.lowerVirtuelKey = virtuelKey; this.upperVirtuelKey = virtuelKey; this.altGrVirtuelKey = virtuelKey; lowerChar = 0; upperChar = 0; altGrChar = 0; } | 128 |
public Key(int virtuelKey) { this.lowerVirtuelKey = virtuelKey; this.upperVirtuelKey = virtuelKey; this.altGrVirtuelKey = virtuelKey; lowerChar = 0; upperChar = 0; altGrChar = 0; } | public Key(int virtuelKey) { this.lowerVirtuelKey = virtuelKey; this.upperVirtuelKey = virtuelKey; this.altGrVirtuelKey = virtuelKey; lowerChar = 0; upperChar = 0; altGrChar = 0; } | 129 |
public void setSelected(ButtonModel m, boolean b) { if ((sel != m || b) && (! b || sel == m)) return; if (b && sel != m) { ButtonModel old = sel; sel = m; if (old != null) old.setSelected(false); AbstractButton button = FindButton(old); if (button != null) button.repaint(); } else if (!b && sel == m) m.setSelected(true); } | public void setSelected(ButtonModel m, boolean b) { if ((sel != m || b) && (! b || sel == m)) return; if (b && sel != m) { ButtonModel old = sel; sel = m; if (old != null) old.setSelected(false); AbstractButton button = findButton(old); if (button != null) button.repaint(); } else if (!b && sel == m) m.setSelected(true); } | 131 |
public JIFSDirectory(String name, boolean root) throws IOException { this(name); this.root = root; JIFSDirectory dir; JIFSFile file; //file entries.add(new JIFSFuptime(this)); entries.add(new JIFSFmemory(this)); entries.add(new JIFSFversion(this)); //directory entries.add(new JIFSDthreads( this)); entries.add(new JIFSDplugins(this)); } | public JIFSDirectory(String name, boolean root) throws IOException { this(name); this.root = root; JIFSDirectory dir; JIFSFile file; //file entries.add(new JIFSFuptime(this)); entries.add(new JIFSFmemory(this)); entries.add(new JIFSFversion(this)); //directory entries.add(new JIFSDthreads( this)); entries.add(new JIFSDplugins(this)); } | 132 |
public ReadOnlyFileSystemException(String message) { super(message); } | public ReadOnlyFileSystemException(String message, Throwable cause) { super(message); } | 133 |
protected String paramString() { return "JTextComponent"; } | protected String paramString() { return "JTextComponent"; } | 135 |
public synchronized void setContents(Transferable contents, ClipboardOwner owner) { if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents; } | public synchronized void setContents(Transferable contents, ClipboardOwner owner) { if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents; } | 136 |
public synchronized void setContents(Transferable contents, ClipboardOwner owner) { if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents; } | public synchronized void setContents(Transferable contents, ClipboardOwner owner) { if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; if (oldOwner != null) oldOwner.lostOwnership(this, oldContents); } FlavorListener[] fs = getFlavorListeners(); if (fs.length > 0) { boolean newFlavors = ((contents != null && oldContents == null) || (contents == null && oldContents != null)); if (!newFlavors && contents != null && oldContents != null) { DataFlavor[] df1 = contents.getTransferDataFlavors(); DataFlavor[] df2 = oldContents.getTransferDataFlavors(); newFlavors = df1.length != df2.length; for (int i = 0; !newFlavors && i < df1.length; i++) newFlavors = !df1[i].equals(df2[i]); } if (newFlavors) { FlavorEvent e = new FlavorEvent(this); for (int i = 0; i < fs.length; i++) fs[i].flavorsChanged(e); } } } | 137 |
public static KeyStroke getKeyStroke(int keyCode, int modifiers) { return (KeyStroke) getAWTKeyStroke(keyCode, modifiers); } | public static KeyStroke getKeyStroke(char keyChar) { return (KeyStroke) getAWTKeyStroke(keyCode, modifiers); } | 139 |
public static KeyStroke getKeyStroke(int keyCode, int modifiers) { return (KeyStroke) getAWTKeyStroke(keyCode, modifiers); } | public static KeyStroke getKeyStroke(int keyCode, int modifiers) { return (KeyStroke) getAWTKeyStroke(keyChar); } | 140 |
public Dimension getPreferredSize() { if (preferredSize != null) return preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) return s; } Dimension p = super.getPreferredSize(); return p; } | public Dimension getPreferredSize() { if (preferredSize != null) prefSize = preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) return s; } Dimension p = super.getPreferredSize(); return p; } | 141 |
public Dimension getPreferredSize() { if (preferredSize != null) return preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) return s; } Dimension p = super.getPreferredSize(); return p; } | public Dimension getPreferredSize() { if (preferredSize != null) return preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) prefSize = s; } Dimension p = super.getPreferredSize(); return p; } | 142 |
public Dimension getPreferredSize() { if (preferredSize != null) return preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) return s; } Dimension p = super.getPreferredSize(); return p; } | public Dimension getPreferredSize() { if (preferredSize != null) return preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) return s; } Dimension p = super.getPreferredSize(); return p; } | 143 |
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, oldValue, newValue); } | protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, oldValue, newValue); } | 144 |
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, oldValue, newValue); } | protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); } | 145 |
public void mousePressed(MouseEvent e) { if (! toolBar.isFloatable()) return; Point ssd = e.getPoint(); Insets insets = toolBar.getInsets(); // Verify that this click occurs in the top inset. if (toolBar.getOrientation() == SwingConstants.HORIZONTAL) { if (e.getX() > insets.left) return; } else { if (e.getY() > insets.top) return; } origin = new Point(0, 0); SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) // Need to know who keeps the toolBar if it gets dragged back into it. origParent = toolBar.getParent(); SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true; if (dragWindow != null) dragWindow.setOffset(new Point(e.getX(), e.getY())); dragTo(e.getPoint(), origin); } | public void mousePressed(MouseEvent e) { if (! toolBar.isFloatable()) return; Point ssd = e.getPoint(); Insets insets = toolBar.getInsets(); // Verify that this click occurs in the top inset. if (toolBar.getOrientation() == SwingConstants.HORIZONTAL) { if (e.getX() > insets.left) return; } else { if (e.getY() > insets.top) return; } origin = new Point(0, 0); if (toolBar.isShowing()) SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) // Need to know who keeps the toolBar if it gets dragged back into it. origParent = toolBar.getParent(); SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true; if (dragWindow != null) dragWindow.setOffset(new Point(e.getX(), e.getY())); dragTo(e.getPoint(), origin); } | 146 |
public void mousePressed(MouseEvent e) { if (! toolBar.isFloatable()) return; Point ssd = e.getPoint(); Insets insets = toolBar.getInsets(); // Verify that this click occurs in the top inset. if (toolBar.getOrientation() == SwingConstants.HORIZONTAL) { if (e.getX() > insets.left) return; } else { if (e.getY() > insets.top) return; } origin = new Point(0, 0); SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) // Need to know who keeps the toolBar if it gets dragged back into it. origParent = toolBar.getParent(); SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true; if (dragWindow != null) dragWindow.setOffset(new Point(e.getX(), e.getY())); dragTo(e.getPoint(), origin); } | public void mousePressed(MouseEvent e) { if (! toolBar.isFloatable()) return; Point ssd = e.getPoint(); Insets insets = toolBar.getInsets(); // Verify that this click occurs in the top inset. if (toolBar.getOrientation() == SwingConstants.HORIZONTAL) { if (e.getX() > insets.left) return; } else { if (e.getY() > insets.top) return; } origin = new Point(0, 0); SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) // Need to know who keeps the toolBar if it gets dragged back into it. origParent = toolBar.getParent(); if (toolBar.isShowing()) SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true; if (dragWindow != null) dragWindow.setOffset(new Point(e.getX(), e.getY())); dragTo(e.getPoint(), origin); } | 147 |
public Window(Frame owner) { this (owner, owner.getGraphicsConfiguration ()); } | Window() { this (owner, owner.getGraphicsConfiguration ()); } | 148 |
public Window(Frame owner) { this (owner, owner.getGraphicsConfiguration ()); } | public Window(Frame owner) { visible = false; focusCycleRoot = true; setLayout(new BorderLayout()); addWindowFocusListener (new WindowAdapter () { public void windowGainedFocus (WindowEvent event) { if (windowFocusOwner != null) { EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); synchronized (eq) { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); Component currentFocusOwner = manager.getGlobalPermanentFocusOwner (); if (currentFocusOwner != null) { eq.postEvent (new FocusEvent (currentFocusOwner, FocusEvent.FOCUS_LOST, false, windowFocusOwner)); eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false, currentFocusOwner)); } else eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false)); } } } }); GraphicsEnvironment g = GraphicsEnvironment.getLocalGraphicsEnvironment(); graphicsConfiguration = g.getDefaultScreenDevice().getDefaultConfiguration(); } | 149 |
public static Point convertPoint(Component source, Point aPoint, Component destination) { return convertPoint(source, aPoint.x, aPoint.y, destination); } | public static Point convertPoint(Component source, int x, int y, Component destination) { return convertPoint(source, aPoint.x, aPoint.y, destination); } | 150 |
public static Point convertPoint(Component source, Point aPoint, Component destination) { return convertPoint(source, aPoint.x, aPoint.y, destination); } | public static Point convertPoint(Component source, Point aPoint, Component destination) { Point pt = new Point(x, y); if (source == null && destination == null) return pt; if (source == null) source = getRoot(destination); if (destination == null) destination = getRoot(source); if (source.isShowing() && destination.isShowing()) { convertPointToScreen(pt, source); convertPointFromScreen(pt, destination); } return pt; } | 151 |
public SecurityException(String s) { super(s); } | public SecurityException(String s) { super(s); } | 152 |
public RuntimeException(String s) { super(s); } | public RuntimeException() { super(s); } | 153 |
public RuntimeException(String s) { super(s); } | public RuntimeException(String s) { } | 154 |
public void setOrientation(int orientation) { if (orientation != VERTICAL && orientation != HORIZONTAL) throw new IllegalArgumentException("orientation must be one of VERTICAL or HORIZONTAL"); if (this.orientation != orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange("orientation", oldOrientation, this.orientation); } } | public void setOrientation(int orientation) { if (orientation != VERTICAL && orientation != HORIZONTAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); if (this.orientation != orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange("orientation", oldOrientation, this.orientation); } } | 155 |
public DefaultBoundedRangeModel(int value, int extent, int minimum, int maximum) { if (!(minimum <= value && extent >= 0 && (value + extent) <= maximum)) throw new IllegalArgumentException(); this.value = value; this.extent = extent; this.minimum = minimum; this.maximum = maximum; // The isAdjusting field already has a false value by default. } | public DefaultBoundedRangeModel(int value, int extent, int minimum, int maximum) { if (!(minimum <= value && extent >= 0 && (value + extent) <= maximum)) throw new IllegalArgumentException(); this.value = value; this.extent = extent; this.minimum = minimum; this.maximum = maximum; // The isAdjusting field already has a false value by default. } | 156 |
public DefaultBoundedRangeModel(int value, int extent, int minimum, int maximum) { if (!(minimum <= value && extent >= 0 && (value + extent) <= maximum)) throw new IllegalArgumentException(); this.value = value; this.extent = extent; this.minimum = minimum; this.maximum = maximum; // The isAdjusting field already has a false value by default. } | public DefaultBoundedRangeModel(int value, int extent, int minimum, int maximum) { if (!(minimum <= value && extent >= 0 && (value + extent) <= maximum)) throw new IllegalArgumentException(); this.value = value; this.extent = extent; this.minimum = minimum; this.maximum = maximum; // The isAdjusting field already has a false value by default. } | 157 |
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getPosFromView(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { // get the bounded area of the selection screen.getBoundingArea(workR); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + workR.width); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + workR.height); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); } | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getPosFromView(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { // get the bounded area of the selection screen.getBoundingArea(workR); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + workR.width); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + workR.height); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); } | 158 |
public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } | public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } | 159 |
BorderLayout(){ this(0,0);} | BorderLayout(){ this(0,0);} | 160 |
public void setBounds(int x, int y, int width, int height) { reshape (x, y, width, height); } | public void setBounds(Rectangle r) { reshape (x, y, width, height); } | 161 |
public void setBounds(int x, int y, int width, int height) { reshape (x, y, width, height); } | public void setBounds(int x, int y, int width, int height) { setBounds (r.x, r.y, r.width, r.height); } | 162 |
protected final Point getEndPoint() { if(this.endPoint == null) { setEndPoint(new Point(0,0)); } return this.endPoint; } | protected Point getEndPoint() { if(this.endPoint == null) { setEndPoint(new Point(0,0)); } return this.endPoint; } | 163 |
protected final Point getStartPoint() { if(this.startPoint == null) { setStartPoint(new Point(0,0)); } return this.startPoint; } | protected Point getStartPoint() { if(this.startPoint == null) { setStartPoint(new Point(0,0)); } return this.startPoint; } | 164 |
public Thread(Runnable target) { this(null, target, autoName()); } | public Thread(Runnable target) { this(null, target, autoName()); } | 165 |
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return ((Integer) pane.getValue()).intValue(); } | public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return ((Integer) pane.getValue()).intValue(); } | 166 |
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return ((Integer) pane.getValue()).intValue(); } | public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return ((Integer) pane.getValue()).intValue(); } | 167 |
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return ((Integer) pane.getValue()).intValue(); } | public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) { JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); if (pane.getValue() instanceof Integer) return ((Integer) pane.getValue()).intValue(); return -1; } | 168 |
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger) { this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON); } | public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button) { this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON); } | 169 |
public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger) { this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON); } | public MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger) { this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON); } | 170 |
public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) { JOptionPane pane = new JOptionPane(message, messageType); pane.setIcon(icon); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); } | public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) { JOptionPane pane = new JOptionPane(message, messageType); pane.setIcon(icon); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); } | 171 |
public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) { JOptionPane pane = new JOptionPane(message, messageType); pane.setIcon(icon); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); } | public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) { JOptionPane pane = new JOptionPane(message, messageType); pane.setIcon(icon); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); } | 172 |
public boolean isInField(int pos, boolean chgToField) { return screenFields.isInField(pos,chgToField); } | public boolean isInField() { return screenFields.isInField(pos,chgToField); } | 173 |
public boolean isInField(int pos, boolean chgToField) { return screenFields.isInField(pos,chgToField); } | public boolean isInField(int pos, boolean chgToField) { return isInField(lastPos,true); } | 174 |
public final void systemRequest(char sr) { if (sr == ' ') { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); JLabel jl = new JLabel("Enter alternate job"); final JTextField sro = new JTextField(); srp.add(jl,BorderLayout.NORTH); srp.add(sro,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {"SysReq","Cancel"}; final JOptionPane pane = new JOptionPane( message, // the dialog message array JOptionPane.QUESTION_MESSAGE, // message type JOptionPane.DEFAULT_OPTION, // option type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0]); // option that should be made into a default button // create a dialog wrapping the pane final JDialog dialog = pane.createDialog(null, // parent frame "System Request" // dialog title ); // add the listener that will set the focus to // the desired option dialog.addWindowListener( new WindowAdapter() { public void windowOpened( WindowEvent e) { super.windowOpened( e ); // now we're setting the focus to the desired component // it's not the best solution as it depends on internals // of the OptionPane class, but you can use it temporarily // until the bug gets fixed // also you might want to iterate here thru the set of // the buttons and pick one to call requestFocus() for it sro.requestFocus(); } }); dialog.show(); // now we can process the value selected String value = (String)pane.getValue(); if (value.equals(options[0])) { // from rfc1205 section 4.3 // Client sends header with the 000A12A0000004040000FFEF // System Request bit set. // // if we wanted to send an option with it we would need to send // it at the end such as the following // // byte abyte0[] = new byte[1]; or number of bytes in option // abyte0[0] = getEBCDIC(option);// System.out.println("SYSRQS sent"); // send option along with system request if (sro.getText().length() > 0) { for (int x = 0; x < sro.getText().length(); x++) { // System.out.println(sro.getText().charAt(x)); if (sro.getText().charAt(0) == '2') { // System.out.println("dataq cleared"); dsq.clear(); } baosp.write(getEBCDIC(sro.getText().charAt(x))); } try { writeGDS(4, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); } else { // no option sent with system request try { writeGDS(4, 0, null); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } } } controller.requestFocus(); } else { baosp.write(getEBCDIC(sr)); try { writeGDS(4, 0, baosp.toByteArray()); } catch (IOException ioe) { baosp.reset(); System.out.println(ioe.getMessage()); } baosp.reset(); } } | public final void systemRequest(char sr) { if (sr == ' ') { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); JLabel jl = new JLabel("Enter alternate job"); final JTextField sro = new JTextField(); srp.add(jl,BorderLayout.NORTH); srp.add(sro,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {"SysReq","Cancel"}; final JOptionPane pane = new JOptionPane( message, // the dialog message array JOptionPane.QUESTION_MESSAGE, // message type JOptionPane.DEFAULT_OPTION, // option type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0]); // option that should be made into a default button // create a dialog wrapping the pane final JDialog dialog = pane.createDialog(null, // parent frame "System Request" // dialog title ); // add the listener that will set the focus to // the desired option dialog.addWindowListener( new WindowAdapter() { public void windowOpened( WindowEvent e) { super.windowOpened( e ); // now we're setting the focus to the desired component // it's not the best solution as it depends on internals // of the OptionPane class, but you can use it temporarily // until the bug gets fixed // also you might want to iterate here thru the set of // the buttons and pick one to call requestFocus() for it sro.requestFocus(); } }); dialog.show(); // now we can process the value selected String value = (String)pane.getValue(); if (value.equals(options[0])) { // from rfc1205 section 4.3 // Client sends header with the 000A12A0000004040000FFEF // System Request bit set. // // if we wanted to send an option with it we would need to send // it at the end such as the following // // byte abyte0[] = new byte[1]; or number of bytes in option // abyte0[0] = getEBCDIC(option);// System.out.println("SYSRQS sent"); // send option along with system request if (sro.getText().length() > 0) { for (int x = 0; x < sro.getText().length(); x++) { // System.out.println(sro.getText().charAt(x)); if (sro.getText().charAt(0) == '2') { // System.out.println("dataq cleared"); dsq.clear(); } baosp.write(getEBCDIC(sro.getText().charAt(x))); } try { writeGDS(4, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); } else { // no option sent with system request try { writeGDS(4, 0, null); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } } } controller.requestFocus(); } else { baosp.write(getEBCDIC(sr)); try { writeGDS(4, 0, baosp.toByteArray()); } catch (IOException ioe) { baosp.reset(); System.out.println(ioe.getMessage()); } baosp.reset(); } } | 175 |
public void setSize(int width, int height) { resize (width, height); } | public void setSize(Dimension d) { resize (width, height); } | 176 |
public void setSize(int width, int height) { resize (width, height); } | public void setSize(int width, int height) { setSize (d.width, d.height); } | 177 |
public boolean isFocusTraversable() { return enabled && visible && (peer == null || peer.isFocusTraversable()); } | public boolean isFocusTraversable() { return enabled && visible && (peer == null || isLightweight() || peer.isFocusTraversable()); } | 178 |
public final void setBounds(Rectangle r) { setBounds(r.width, r.height); } | public final void setBounds(int width, int height) { setBounds(r.width, r.height); } | 179 |
public final void setBounds(Rectangle r) { setBounds(r.width, r.height); } | public final void setBounds(Rectangle r) { setCursorActive(false); resizeScreenArea(width,height); dirty.setBounds(tArea.getBounds()); if (gui.getGraphics() != null) { gg2d = null; drawing = true; updateDirty(); } if (isStatusErrorCode()) setStatus(STATUS_ERROR_CODE,STATUS_VALUE_ON,statusString); if (isXSystem()) setStatus(STATUS_SYSTEM,STATUS_VALUE_ON,statusString); if (isMessageWait()) setMessageLightOn(); setCursorActive(true); } | 180 |
public JList(ListModel listData) { init(); setModel(listData); } | public JList() { init(); setModel(listData); } | 181 |
public JList(ListModel listData) { init(); setModel(listData); } | public JList(ListModel listData) { init(); } | 182 |
public JScrollPane(Component view) { this(view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); } | public JScrollPane() { this(view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); } | 183 |
public JScrollPane(Component view) { this(view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); } | public JScrollPane(Component view) { this(view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); } | 184 |
public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, messageType); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, messageType); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | 185 |
public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, messageType); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | 186 |
public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, messageType); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, title); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | public static String showInputDialog(Component parentComponent, Object message, String title, int messageType) { JOptionPane pane = new JOptionPane(message, messageType); pane.setWantsInput(true); JDialog dialog = pane.createDialog(parentComponent, null); dialog.pack(); dialog.show(); return (String) pane.getInputValue(); } | 187 |
private RefItem(int kind, Register reg, VmConstString val, int offsetToFP) { super(kind, reg, offsetToFP); this.value = val; } | private RefItem(int kind, Register reg, VmConstString val, int offsetToFP) { super(kind, reg, offsetToFP); this.value = val; } | 188 |
protected WordItem cloneConstant() { return createConst(getValue()); } | protected WordItem cloneConstant() { return factory.createAConst(getValue()); } | 189 |
public void setBlockIncrement(int blockIncrement) { if (blockIncrement != this.blockIncrement) { int oldInc = this.blockIncrement; this.blockIncrement = blockIncrement; firePropertyChange(BLOCK_INCREMENT_CHANGED_PROPERTY, oldInc, this.blockIncrement); } } | public void setBlockIncrement(int blockIncrement) { if (blockIncrement != this.blockIncrement) { int oldInc = this.blockIncrement; this.blockIncrement = blockIncrement; firePropertyChange("blockIncrement", oldInc, this.blockIncrement); } } | 190 |
public void setModel(BoundedRangeModel newModel) { if (model != newModel) { BoundedRangeModel oldModel = model; model = newModel; oldModel.removeChangeListener(changeListener); model.addChangeListener(changeListener); firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, model); } } | public void setModel(BoundedRangeModel newModel) { if (model != newModel) { BoundedRangeModel oldModel = model; model = newModel; oldModel.removeChangeListener(changeListener); model.addChangeListener(changeListener); firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, model); } } | 191 |
public void setOrientation(int orientation) { if (orientation != SwingConstants.HORIZONTAL && orientation != SwingConstants.VERTICAL) throw new IllegalArgumentException("orientation must be one of HORIZONTAL or VERTICAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, this.orientation); } } | public void setOrientation(int orientation) { if (orientation != SwingConstants.HORIZONTAL && orientation != SwingConstants.VERTICAL) throw new IllegalArgumentException("orientation must be one of HORIZONTAL or VERTICAL"); if (orientation != this.orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange("orientation", oldOrientation, this.orientation); } } | 192 |
public void setUnitIncrement(int unitIncrement) { if (unitIncrement != this.unitIncrement) { int oldInc = this.unitIncrement; this.unitIncrement = unitIncrement; firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc, this.unitIncrement); } } | public void setUnitIncrement(int unitIncrement) { if (unitIncrement != this.unitIncrement) { int oldInc = this.unitIncrement; this.unitIncrement = unitIncrement; firePropertyChange("unitIncrement", oldInc, this.unitIncrement); } } | 193 |
public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); } | public static Class loadClass (String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); } | 194 |
public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); } | public static Class loadClass (String codebases, String name) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); //try context class loader first try { return loader.loadClass (name); } catch (ClassNotFoundException e) { // class not found in the local classpath } if (codebases.length() == 0) //=="" { loader = defaultLoader; } else { loader = getClassLoader(codebases); } if (loader == null) { //do not throw NullPointerException throw new ClassNotFoundException ("Could not find class (" + name + ") at codebase (" + codebases + ")"); } return loader.loadClass (name); } | 195 |
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); } | public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); } | 196 |
public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(parent); this.factory = null; this.securityContext = null; addURLs(urls); } | public URLClassLoader(URL[] urls, ClassLoader parent) throws SecurityException { super(); this.factory = null; this.securityContext = null; addURLs(urls); } | 197 |
public StringTokenizer(String str, String delim) { this(str, delim, false); } | public StringTokenizer(String str) { this(str, delim, false); } | 198 |
public StringTokenizer(String str, String delim) { this(str, delim, false); } | public StringTokenizer(String str, String delim) { this(str, " \t\n\r\f", false); } | 199 |
public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); } | public String nextToken(String delim) throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); } | 200 |
public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); } | public String nextToken() throws NoSuchElementException { if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { if (retDelims) return str.substring(pos, ++pos); while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } if (pos < len) { int start = pos; while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); return str.substring(start, pos); } throw new NoSuchElementException(); } | 201 |
public ClassNotFoundException(String s) { this(s, null); } | public ClassNotFoundException() { this(s, null); } | 202 |
public ClassNotFoundException(String s) { this(s, null); } | public ClassNotFoundException(String s) { this(null); } | 203 |
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setBackground(defaults.getColor(prefix + ".background")); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); } | protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); textComponent.setBackground(defaults.getColor(prefix + ".background")); textComponent.setForeground(defaults.getColor(prefix + ".foreground")); textComponent.setMargin(defaults.getInsets(prefix + ".margin")); textComponent.setBorder(defaults.getBorder(prefix + ".border")); textComponent.setFont(defaults.getFont(prefix + ".font")); caret.setBlinkRate(defaults.getInt(prefix + ".caretBlinkRate")); } | 204 |