bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public synchronized void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, l); }
|
public synchronized void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, l); }
| 3,288
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
|
public synchronized void removeFocusListener(FocusListener listener) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
| 3,289
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
| 3,290
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
|
removeHierarchyBoundsListener(HierarchyBoundsListener listener) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
| 3,291
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
| 3,292
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
|
public synchronized void removeHierarchyListener(HierarchyListener listener) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
| 3,293
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
| 3,294
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
|
public synchronized void removeInputMethodListener(InputMethodListener listener) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
| 3,295
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
| 3,296
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
|
public synchronized void removeKeyListener(KeyListener listener) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
| 3,297
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
| 3,298
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
|
public synchronized void removeMouseListener(MouseListener listener) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
| 3,299
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
| 3,300
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
|
public synchronized void removeMouseMotionListener(MouseMotionListener listener) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
| 3,301
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
| 3,302
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
|
public synchronized void removeMouseWheelListener(MouseWheelListener listener) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
| 3,303
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
| 3,304
|
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 (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); } }
|
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() && isShowing ()) { 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 (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); } }
| 3,305
|
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 (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); } }
|
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 != 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); } }
| 3,306
|
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 (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); } }
|
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 (shouldRepaintSelf) repaint(); } if (isShowing () && (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); } }
| 3,307
|
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 (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); } }
|
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 (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (isShowing () && (oldwidth != width || oldheight != height)) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
| 3,308
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
|
public void setFont(Font newFont) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
| 3,309
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
| 3,310
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(font); firePropertyChange("font", oldFont, newFont); invalidate(); font = f; }
| 3,311
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
| 3,312
|
public void setLocale(Locale l) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
|
public void setLocale(Locale newLocale) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
| 3,313
|
public void setLocale(Locale l) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
|
public void setLocale(Locale l) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
| 3,314
|
protected void setParentArray(Array parentArray) { Log.debug("in XMLDataIOStyle, setParentArray()"); this.parentArray = parentArray; }
|
protected void setParentArray(Array parentArray) { this.parentArray = parentArray; }
| 3,315
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
| 3,316
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
| 3,317
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
| 3,318
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
|
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
| 3,319
|
public abstract void add(String item, int index);
|
public abstract void add(String item, int index);
| 3,320
|
public abstract void remove(int index);
|
public abstract void remove(int index);
| 3,321
|
public abstract void select(int index);
|
public abstract void select(int index);
| 3,322
|
public Option(String name, String description) { super(name, description, MANDATORY); }
|
public Option(String name, String description) { super(name, description, MANDATORY); }
| 3,323
|
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; }
|
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; }
| 3,324
|
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
|
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
| 3,325
|
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
|
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
| 3,326
|
public void describe(Help help) { for (int i = 0; i < options.length; i++) options[i].describe(help); }
|
public void describe(Help help) { for (int i = 0; i < options.length; i++) options[i].describe(help); }
| 3,327
|
public String format() { if (options.length == 0) return ""; String result = options[0].getName(); for (int i = 1; i < options.length; i++) result += "|" + options[i].getName(); return result; }
|
public String format() { if (options.length == 0) return ""; String result = options[0].getName(); for (int i = 1; i < options.length; i++) result += "|" + options[i].getName(); return result; }
| 3,328
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
| 3,329
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
| 3,330
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
| 3,331
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
| 3,332
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
|
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
| 3,333
|
public void setWindowDecorationStyle(int style) { if (style != NONE && style != FRAME && style != INFORMATION_DIALOG && style != ERROR_DIALOG && style != COLOR_CHOOSER_DIALOG && style != FILE_CHOOSER_DIALOG && style != QUESTION_DIALOG && style != WARNING_DIALOG) throw new IllegalArgumentException("invalid style"); int oldStyle = windowDecorationStyle; windowDecorationStyle = style; firePropertyChange("windowDecorationStyle", oldStyle, style); }
|
public void setWindowDecorationStyle(int style) { if (style != NONE && style != FRAME && style != INFORMATION_DIALOG && style != ERROR_DIALOG && style != COLOR_CHOOSER_DIALOG && style != FILE_CHOOSER_DIALOG && style != QUESTION_DIALOG && style != WARNING_DIALOG && style != PLAIN_DIALOG) throw new IllegalArgumentException("invalid style"); int oldStyle = windowDecorationStyle; windowDecorationStyle = style; firePropertyChange("windowDecorationStyle", oldStyle, style); }
| 3,334
|
public Note addNote(Note n) { if (n == null) { Log.warn("in Parameter.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
|
public Note addNote(Note n) { if (n == null) { Log.warn("in Parameter.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
| 3,335
|
public Value addValue(Value v) { if (v == null) { Log.warn("in Parameter.addValue(), the Value passed in is null"); return null; } getValueList().add(v); return v; }
|
public Value addValue(Value v) { if (v == null) { Log.warn("in Parameter.addValue(), the Value passed in is null"); return null; } getValueList().add(v); return v; }
| 3,336
|
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
|
public ValueGroup addValueGroup (ValueGroup group) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
| 3,337
|
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
|
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
| 3,338
|
public Object clone() throws CloneNotSupportedException { Parameter cloneObj = (Parameter) super.clone(); //deep copy of the valueGroupOwnedHash synchronized (this.valueGroupOwnedHash) { synchronized(cloneObj.valueGroupOwnedHash) { cloneObj.valueGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.valueGroupOwnedHash.size())); Iterator iter = this.valueGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.valueGroupOwnedHash.add(iter.next()); } } } return cloneObj; }
|
public Object clone() throws CloneNotSupportedException { Parameter cloneObj = (Parameter) super.clone(); //deep copy of the valueGroupOwnedHash synchronized (this.valueGroupOwnedHash) { synchronized(cloneObj.valueGroupOwnedHash) { cloneObj.valueGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.valueGroupOwnedHash.size())); Iterator iter = this.valueGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.valueGroupOwnedHash.add(((Group)iter.next()).clone()); } } } return cloneObj; }
| 3,339
|
public boolean removeValueGroup(ValueGroup group) { if (group == null) { Log.warn("in Axis,removeValueGroup(). ValueGroup passed in is null"); return false; } return valueGroupOwnedHash.remove(group); }
|
public boolean removeValueGroup(ValueGroup group) { if (group == null) { Log.warn("in Axis,removeValueGroup(). ValueGroup passed in is null"); return false; } return valueGroupOwnedHash.remove(group); }
| 3,340
|
public String toString() { return (this.getClass() + "[" + getName() + "]"); }
|
public String toString() { return (this.getClass() + "[type=" + getType() + ",name=" + getName() + "]"); }
| 3,342
|
public SwingScrollbarPeer(Scrollbar sb) { SwingToolkit.add(sb, this); SwingToolkit.copyAwtProperties(sb, this); setOrientation(sb.getOrientation()); setBlockIncrement(sb.getBlockIncrement()); setUnitIncrement(sb.getUnitIncrement()); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb.getMaximum()); }
|
public SwingScrollbarPeer(Scrollbar sb) { SwingToolkit.add(sb, this); SwingToolkit.copyAwtProperties(sb, this); setOrientation(sb.getOrientation()); setBlockIncrement(sb.getBlockIncrement()); setUnitIncrement(sb.getUnitIncrement()); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb.getMaximum()); }
| 3,343
|
public boolean canDetermineObscurity() { return false; }
|
public boolean canDetermineObscurity() { return false; }
| 3,344
|
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
|
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
| 3,345
|
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
|
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
| 3,346
|
public void destroyBuffers() { }
|
public void destroyBuffers() { }
| 3,347
|
public void dispose() { }
|
public void dispose() { }
| 3,348
|
public void flip(BufferCapabilities.FlipContents flipContents) { }
|
public void flip(BufferCapabilities.FlipContents flipContents) { }
| 3,349
|
public Image getBackBuffer() { return null; }
|
public Image getBackBuffer() { return null; }
| 3,350
|
public void handleEvent(AWTEvent e) { //System.err.println(e); }
|
public void handleEvent(AWTEvent e) { //System.err.println(e); }
| 3,351
|
public boolean handlesWheelScrolling() { return false; }
|
public boolean handlesWheelScrolling() { return false; }
| 3,352
|
public boolean isObscured() { return false; }
|
public boolean isObscured() { return false; }
| 3,353
|
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
|
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
| 3,354
|
public void setEventMask(long mask) { // TODO Auto-generated method stub }
|
public void setEventMask(long mask) { // TODO Auto-generated method stub }
| 3,355
|
public void setEventMask(long mask) { // TODO Auto-generated method stub }
|
public void setEventMask(long mask) { // TODO Auto-generated method stub }
| 3,356
|
public void setLineIncrement(int l) { }
|
public void setLineIncrement(int l) { }
| 3,357
|
public void setPageIncrement(int l) { }
|
public void setPageIncrement(int l) { }
| 3,358
|
public void updateCursorImmediately() { }
|
public void updateCursorImmediately() { }
| 3,359
|
public int getMode() { int iMode=Ext2Utils.get16(data, 0); Ext2Debugger.debug("INode.getIMode(): "+Ext2Debugger.hexFormat(iMode), 3); return iMode; }
|
public int getMode() { int iMode=Ext2Utils.get16(data, 0); Ext2Debugger.debug("INode.getIMode(): "+Ext2Debugger.hexFormat(iMode), 3); return iMode; }
| 3,360
|
private void init() { specificDataFormatName = "exponent"; //add attributes attribOrder.add(0,"exponent"); attribOrder.add(0,"precision"); attribOrder.add(0, "width"); attribHash.put("exponent", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("precision", new XMLAttribute(new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("width", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); generateFormatPattern(); }
|
private void init() { specificDataFormatName = "exponential"; //add attributes attribOrder.add(0,"exponent"); attribOrder.add(0,"precision"); attribOrder.add(0, "width"); attribHash.put("exponent", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("precision", new XMLAttribute(new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("width", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); generateFormatPattern(); }
| 3,361
|
public boolean selfTest() { final int[] mLen = new int[] { 16, 20, 32, 48, 64 }; final byte[] M = new byte[mLen[mLen.length - 1]]; new Random ().nextBytes(M); final byte[] EM = new byte[1024]; byte[] p; int bs, i, j; for (bs = 256; bs < 1025; bs += 256) { init(bs); for (i = 0; i < mLen.length; i++) { j = mLen[i]; p = pad(M, 0, j); if (j + p.length != blockSize) { new RuntimeException(name()).printStackTrace(System.err); return false; } System.arraycopy(p, 0, EM, 0, p.length); System.arraycopy(M, 0, EM, p.length, j); try { if (p.length != unpad(EM, 0, blockSize)) { new RuntimeException(name()).printStackTrace(System.err); return false; } } catch (WrongPaddingException x) { x.printStackTrace(System.err); return false; } } reset(); } return true; }
|
public boolean selfTest() { final int[] mLen = new int[] { 16, 20, 32, 48, 64 }; final byte[] M = new byte[mLen[mLen.length - 1]]; PRNG.getInstance().nextBytes(M); final byte[] EM = new byte[1024]; byte[] p; int bs, i, j; for (bs = 256; bs < 1025; bs += 256) { init(bs); for (i = 0; i < mLen.length; i++) { j = mLen[i]; p = pad(M, 0, j); if (j + p.length != blockSize) { new RuntimeException(name()).printStackTrace(System.err); return false; } System.arraycopy(p, 0, EM, 0, p.length); System.arraycopy(M, 0, EM, p.length, j); try { if (p.length != unpad(EM, 0, blockSize)) { new RuntimeException(name()).printStackTrace(System.err); return false; } } catch (WrongPaddingException x) { x.printStackTrace(System.err); return false; } } reset(); } return true; }
| 3,362
|
public Dimension getPreferredSize() { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = getToolkit().getFontMetrics(getFont()); SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(), getIcon(), getVerticalAlignment(), getHorizontalAlignment(), getVerticalTextPosition(), getHorizontalTextPosition(), vr, ir, tr, getIconTextGap()); Rectangle cr = ir.union(tr); return new Dimension(cr.width, cr.height); }
|
public Dimension getPreferredSize() { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = getToolkit().getFontMetrics(getFont()); SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(), getIcon(), getVerticalAlignment(), getHorizontalAlignment(), getVerticalTextPosition(), getHorizontalTextPosition(), vr, ir, tr, getIconTextGap()); Rectangle cr = ir.union(tr); return new Dimension(cr.width, cr.height); }
| 3,363
|
public GrayFilter(boolean b, int p) { this.b = b; //FIXME - HANDLE THIS this.p = p; }
|
public GrayFilter(boolean b, int p) { this.b = b; //FIXME - HANDLE THIS this.p = (1. - (p / 100.)) / 3.; }
| 3,364
|
public int filterRGB(int x, int y, int rgb) { return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16) + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb))); }
|
public int filterRGB(int x, int y, int rgb) { return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16) + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb))); }
| 3,365
|
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel)c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
|
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel) c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
| 3,366
|
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel)c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
|
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel)c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
| 3,367
|
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
|
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
| 3,368
|
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
|
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
| 3,369
|
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; Font saved_font = g.getFont(); Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); if (text != null && ! text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } g.setFont(saved_font); }
|
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; Font saved_font = g.getFont(); Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); if (text != null && !text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } g.setFont(saved_font); }
| 3,370
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,372
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,373
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)) - botOffset, fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,374
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,375
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight - botOffset * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight - botOffset * (row + 1) - fmHeight - botOffset / 2), fmWidth, fmHeight - botOffset / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight - botOffset * row), fmWidth, fmHeight - botOffset ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight - botOffset * (row + 1) - fmHeight - botOffset / 2), fmWidth, fmHeight - botOffset / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight - botOffset * (row + 1),bi.getWidth(null),fmHeight - botOffset * (row + 1)); s.updateImage(0,fmHeight - botOffset * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - botOffset - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - botOffset - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight - botOffset * (row + 1),bi.getWidth(null),fmHeight - botOffset * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - botOffset - fmHeight); s.updateImage(0,fmHeight - botOffset * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - botOffset - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,376
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, (fmHeight / 2) - botOffset ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,377
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
publicvoiddrawCursor(Screen5250s,introw,intcol,intfmWidth,intfmHeight,booleaninsertMode,intcrossHair,intcursorSize,ColorcolorCursor,ColorcolorBg,ColorcolorWhite,Fontfont){//synchronized(lock){Graphics2Dg2=getDrawingArea();//if(g2==null)//return;switch(cursorSize){case0:cursor.setRect(fmWidth*(col),(fmHeight*(row+1)),fmWidth,1);break;case1:cursor.setRect(fmWidth*(col),(fmHeight*(row+1)-fmHeight/2),fmWidth,fmHeight/2);break;case2:cursor.setRect(fmWidth*(col),(fmHeight*row),fmWidth,fmHeight);break;}if(insertMode&&cursorSize!=1){cursor.setRect(fmWidth*(col),(fmHeight*(row+1)-fmHeight/2),fmWidth,fmHeight/2);}Rectangler=cursor.getBounds();r.setSize(r.width,r.height);g2.setColor(colorCursor);g2.setXORMode(colorBg);g2.fill(cursor);//cursorActive=true;s.updateImage(r);switch(crossHair){case1://horizontalg2.drawLine(0,fmHeight*(row+1),bi.getWidth(null),fmHeight*(row+1));s.updateImage(0,fmHeight*(row+1),bi.getWidth(null),1);break;case2://verticalg2.drawLine(r.x,0,r.x,bi.getHeight(null)-fmHeight-fmHeight);s.updateImage(r.x,0,1,bi.getHeight(null)-fmHeight-fmHeight);break;case3://horizontal&verticalg2.drawLine(0,fmHeight*(row+1),bi.getWidth(null),fmHeight*(row+1));g2.drawLine(r.x,0,r.x,bi.getHeight(null)-fmHeight-fmHeight);s.updateImage(0,fmHeight*(row+1),bi.getWidth(null),1);s.updateImage(r.x,0,1,bi.getHeight(null)-fmHeight-fmHeight);break;}g2.dispose();g2=getWritingArea(font);g2.setPaint(colorBg);g2.fill(pArea);g2.setColor(colorWhite);//g2.drawString((getRow(lastPos)+1)+"/"+(getCol(lastPos)+1)//,(float)pArea.getX(),//(float)pArea.getY()+fmHeight);g2.drawString((row+1)+"/"+(col+1),(float)pArea.getX(),(float)pArea.getY()+fmHeight);s.updateImage(pArea.getBounds());g2.dispose();//tellwaitingthreadstowakeup//lock.notify();//}}
| 3,378
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,379
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,380
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,(fmHeight * (row + 1)) - botOffset,bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,(fmHeight * (row + 1)) - botOffset,bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 3,381
|
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
|
public void drawCursor(Screen5250 s,int row, int col,int fmWidth, int fmHeight,boolean insertMode, int crossHair,int cursorSize, Color colorCursor,Color colorBg,Color colorWhite,Font font) {//synchronized (lock) {Graphics2D g2 = getDrawingArea();//if (g2 == null)//return;switch (cursorSize) {case 0:cursor.setRect(fmWidth * (col),(fmHeight * (row + 1)),fmWidth,1);break;case 1:cursor.setRect(fmWidth * (col),(fmHeight * (row + 1) - fmHeight / 2),fmWidth,fmHeight / 2);break;case 2:cursor.setRect(fmWidth * (col),(fmHeight * row),fmWidth,fmHeight);break;}if (insertMode && cursorSize != 1) {cursor.setRect(fmWidth * (col),(fmHeight * (row + 1) - fmHeight / 2),fmWidth,fmHeight / 2);}Rectangle r = cursor.getBounds();r.setSize(r.width,r.height);g2.setColor(colorCursor);g2.setXORMode(colorBg);g2.fill(cursor);//cursorActive = true;s.updateImage(r);switch (crossHair) {case 1: // horizontalg2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1));s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1);break;case 2: // verticalg2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight);s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight);break;case 3: // horizontal & verticalg2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1));g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight);s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1);s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight);break;}g2.dispose();g2 = getWritingArea(font);g2.setPaint(colorBg);g2.fill(pArea);g2.setColor(colorWhite);//g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)//,(float)pArea.getX(),//(float)pArea.getY() + fmHeight);g2.drawString((row + 1) + "/" + (col + 1),(float)pArea.getX(),(float)pArea.getY() + fmHeight);s.updateImage(pArea.getBounds());g2.dispose();// tell waiting threads to wake up//lock.notify();//}}
| 3,382
|
private void distributeSizeAndWeight (int size, double weight, int start, int span, int[] sizes, double[] weights) { if (span == 1) { sizes[start] = Math.max(sizes[start], size); weights[start] = Math.max(weights[start], weight); } else { int numOccupied = span; int lastOccupied = -1; for(int i = start; i < start + span; i++) { if (sizes[i] == 0.0) numOccupied--; else { size -= sizes[i]; lastOccupied = i; } } // A component needs to occupy at least one row. if(numOccupied == 0) sizes[start + span - 1] = size; else if (size > 0) sizes[lastOccupied] += size; calcCellWeights(weight, weights, start, span); } }
|
private void distributeSizeAndWeight (int size, double weight, int start, int span, int[] sizes, double[] weights) { if (span == 1) { sizes[start] = Math.max(sizes[start], size); weights[start] = Math.max(weights[start], weight); } else if (span > 1) { int numOccupied = span; int lastOccupied = -1; for(int i = start; i < start + span; i++) { if (sizes[i] == 0.0) numOccupied--; else if (span > 1) { size -= sizes[i]; lastOccupied = i; } } // A component needs to occupy at least one row. if(numOccupied == 0) sizes[start + span - 1] = size; else if (span > 1) if (size > 0) sizes[lastOccupied] += size; calcCellWeights(weight, weights, start, span); } }
| 3,383
|
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
|
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
| 3,384
|
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
|
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
| 3,385
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i += 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
| 3,386
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke) key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
| 3,387
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
|
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
| 3,388
|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i += 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
| 3,389
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.