bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public JNodePolicy(ExtensionPoint permissionsEp) { super(ClassLoader.getSystemResource("/org/jnode/security/jnode.policy")); this.codeSource2Permissions = new HashMap(); this.permissionsEp = permissionsEp; loadExtensions(); }
|
public JNodePolicy(ExtensionPoint permissionsEp) { this.policyFile = new PolicyFile(ClassLoader.getSystemResource("/org/jnode/security/jnode.policy")); this.codeSource2Permissions = new HashMap(); this.permissionsEp = permissionsEp; loadExtensions(); }
| 1,935
|
protected void addPermissions(CodeSource codeSource, Permissions perms) { for (Iterator it = codeSource2Permissions.entrySet().iterator(); it .hasNext();) { final Map.Entry e = (Map.Entry) it.next(); final CodeSource cs = (CodeSource) e.getKey(); if (cs.implies(codeSource)) { // BootLog.info(cs + " -> " + codeSource); final PermissionCollection pc = (PermissionCollection) e .getValue(); for (Enumeration ee = pc.elements(); ee.hasMoreElements();) { perms.add((Permission) ee.nextElement()); } } } }
|
protected void addPermissions(CodeSource codeSource, PermissionCollection perms) { for (Iterator it = codeSource2Permissions.entrySet().iterator(); it .hasNext();) { final Map.Entry e = (Map.Entry) it.next(); final CodeSource cs = (CodeSource) e.getKey(); if (cs.implies(codeSource)) { // BootLog.info(cs + " -> " + codeSource); final PermissionCollection pc = (PermissionCollection) e .getValue(); for (Enumeration ee = pc.elements(); ee.hasMoreElements();) { perms.add((Permission) ee.nextElement()); } } } }
| 1,936
|
public synchronized void refresh() { super.refresh(); loadExtensions(); }
|
public synchronized void refresh() { policyFile.refresh(); loadExtensions(); }
| 1,937
|
public MediaPrintableArea(float x, float y, float w, float h, int units) { if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f) throw new IllegalArgumentException(); this.x = (int) (x * units + 0.5f); this.y = (int) (y * units + 0.5f); this.width = (int) (w * units + 0.5f); this.height = (int) (h * units + 0.5f); }
|
public MediaPrintableArea(float x, float y, float w, float h, int units) { if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f) throw new IllegalArgumentException(); this.x = (int) (x * units + 0.5f); this.y = (int) (y * units + 0.5f); this.width = (int) (w * units + 0.5f); this.height = (int) (h * units + 0.5f); }
| 1,938
|
public boolean equals(Object obj) { if (! (obj instanceof MediaPrintableArea)) return false; MediaPrintableArea tmp = (MediaPrintableArea) obj; return (x == tmp.getX(1) && y == tmp.getY(1) && width == tmp.getWidth(1) && height == tmp.getHeight(1)); }
|
public boolean equals(Object obj) { if (! (obj instanceof MediaPrintableArea)) return false; MediaPrintableArea tmp = (MediaPrintableArea) obj; return (x == tmp.getX(1) && y == tmp.getY(1) && w == tmp.getWidth(1) && h == tmp.getHeight(1)); }
| 1,939
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return height / ((float)units); }
|
public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return h / ((float)units); }
| 1,940
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return width / ((float)units); }
|
public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException("units may not be less than 1"); return w / ((float)units); }
| 1,941
|
public int hashCode() { return x ^ y + width ^ height; }
|
public int hashCode() { return x ^ y + w ^ h; }
| 1,942
|
public InvalidKeyException(String msg) { super(msg); }
|
public InvalidKeyException() { super(msg); }
| 1,943
|
public InvalidKeyException(String msg) { super(msg); }
|
public InvalidKeyException(String msg) { }
| 1,944
|
public void paintComponent(Graphics g) { super.paintComponent(g); Insets insets = this.getInsets(); int w = getWidth() - (insets.left + insets.right); int h = getHeight() - (insets.top + insets.bottom); if (h > 0 && w > 0) { int x1 = insets.left; int y1 = insets.top; int x2 = x1 + (w - 1); int y2 = y1 + (h - 1); int iconWidth = 0; int iconX = x2; if (comboIcon != null) { iconWidth = comboIcon.getIconWidth(); int iconHeight = comboIcon.getIconHeight(); int iconY; if (iconOnly) { iconX = getWidth() / 2 - iconWidth / 2; iconY = getHeight() / 2 - iconHeight / 2; } else { iconX = x1 + (w - 1) - iconWidth; iconY = y1 + (y2 - y1) / 2 - iconHeight / 2; } comboIcon.paintIcon(this, g, iconX, iconY); if (this.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(x1 - 1, y1 - 1, w + 3, h + 1); } } if (! iconOnly && comboBox != null) { ListCellRenderer renderer = comboBox.getRenderer(); boolean pressed = this.getModel().isPressed(); Component comp = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); comp.setFont(rendererPane.getFont()); if (model.isArmed() && model.isPressed()) { if (isOpaque()) { comp.setBackground(UIManager.getColor("Button.select")); comp.setForeground(comboBox.getForeground()); } } else if (! comboBox.isEnabled()) { if (this.isOpaque()) { Color dbg = UIManager.getColor("ComboBox.disabledBackground"); comp.setBackground(dbg); Color dfg = UIManager.getColor("ComboBox.disabledForeground"); comp.setForeground(dfg); } } else { comp.setForeground(comboBox.getForeground()); comp.setBackground(comboBox.getBackground()); } int wr = w - (insets.right + iconWidth); rendererPane.paintComponent(g, comp, this, x1, y1, wr, h); } } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); Insets insets = this.getInsets(); int w = getWidth() - (insets.left + insets.right); int h = getHeight() - (insets.top + insets.bottom); if (h > 0 && w > 0) { int x1 = insets.left; int y1 = insets.top; int x2 = x1 + (w - 1); int y2 = y1 + (h - 1); int iconWidth = 0; int iconX = x2; if (comboIcon != null) { iconWidth = comboIcon.getIconWidth(); int iconHeight = comboIcon.getIconHeight(); int iconY; if (iconOnly) { iconX = getWidth() / 2 - iconWidth / 2; iconY = getHeight() / 2 - iconHeight / 2; } else { iconX = x1 + (w - 1) - iconWidth; iconY = y1 + (y2 - y1) / 2 - iconHeight / 2; } comboIcon.paintIcon(this, g, iconX, iconY); if (this.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(x1 - 1, y1 - 1, w + 3, h + 1); } } if (! iconOnly && comboBox != null) { ListCellRenderer renderer = comboBox.getRenderer(); boolean pressed = this.getModel().isPressed(); Component comp = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); comp.setFont(rendererPane.getFont()); if ((model.isArmed() && model.isPressed()) || (comboBox.isFocusOwner() && !comboBox.isPopupVisible())) { if (isOpaque()) { comp.setBackground(UIManager.getColor("Button.select")); comp.setForeground(comboBox.getForeground()); } } else if (! comboBox.isEnabled()) { if (this.isOpaque()) { Color dbg = UIManager.getColor("ComboBox.disabledBackground"); comp.setBackground(dbg); Color dfg = UIManager.getColor("ComboBox.disabledForeground"); comp.setForeground(dfg); } } else { comp.setForeground(comboBox.getForeground()); comp.setBackground(comboBox.getBackground()); } int wr = w - (insets.right + iconWidth); rendererPane.paintComponent(g, comp, this, x1, y1, wr, h); } } }
| 1,945
|
public synchronized void addComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.add(componentListener, l); if (componentListener != null) enableEvents(AWTEvent.COMPONENT_EVENT_MASK); }
|
public synchronized void addComponentListener(ComponentListener listener) { componentListener = AWTEventMulticaster.add(componentListener, l); if (componentListener != null) enableEvents(AWTEvent.COMPONENT_EVENT_MASK); }
| 1,946
|
public synchronized void addComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.add(componentListener, l); if (componentListener != null) enableEvents(AWTEvent.COMPONENT_EVENT_MASK); }
|
public synchronized void addComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.add(componentListener, listener); if (componentListener != null) enableEvents(AWTEvent.COMPONENT_EVENT_MASK); }
| 1,947
|
public synchronized void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, l); if (focusListener != null) enableEvents(AWTEvent.FOCUS_EVENT_MASK); }
|
public synchronized void addFocusListener(FocusListener listener) { focusListener = AWTEventMulticaster.add(focusListener, l); if (focusListener != null) enableEvents(AWTEvent.FOCUS_EVENT_MASK); }
| 1,948
|
public synchronized void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, l); if (focusListener != null) enableEvents(AWTEvent.FOCUS_EVENT_MASK); }
|
public synchronized void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, listener); if (focusListener != null) enableEvents(AWTEvent.FOCUS_EVENT_MASK); }
| 1,949
|
addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); }
|
addHierarchyBoundsListener(HierarchyBoundsListener listener) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); }
| 1,950
|
addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); }
|
addHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, listener); if (hierarchyBoundsListener != null) enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); }
| 1,951
|
public synchronized void addHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l); if (hierarchyListener != null) enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); }
|
public synchronized void addHierarchyListener(HierarchyListener listener) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l); if (hierarchyListener != null) enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); }
| 1,952
|
public synchronized void addHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l); if (hierarchyListener != null) enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); }
|
public synchronized void addHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, listener); if (hierarchyListener != null) enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); }
| 1,953
|
public synchronized void addInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l); if (inputMethodListener != null) enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); }
|
public synchronized void addInputMethodListener(InputMethodListener listener) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l); if (inputMethodListener != null) enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); }
| 1,954
|
public synchronized void addInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l); if (inputMethodListener != null) enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); }
|
public synchronized void addInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, listener); if (inputMethodListener != null) enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); }
| 1,955
|
public synchronized void addKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.add(keyListener, l); if (keyListener != null) enableEvents(AWTEvent.KEY_EVENT_MASK); }
|
public synchronized void addKeyListener(KeyListener listener) { keyListener = AWTEventMulticaster.add(keyListener, l); if (keyListener != null) enableEvents(AWTEvent.KEY_EVENT_MASK); }
| 1,956
|
public synchronized void addKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.add(keyListener, l); if (keyListener != null) enableEvents(AWTEvent.KEY_EVENT_MASK); }
|
public synchronized void addKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.add(keyListener, listener); if (keyListener != null) enableEvents(AWTEvent.KEY_EVENT_MASK); }
| 1,957
|
public synchronized void addMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.add(mouseListener, l); if (mouseListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
|
public synchronized void addMouseListener(MouseListener listener) { mouseListener = AWTEventMulticaster.add(mouseListener, l); if (mouseListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
| 1,958
|
public synchronized void addMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.add(mouseListener, l); if (mouseListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
|
public synchronized void addMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.add(mouseListener, listener); if (mouseListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
| 1,959
|
public synchronized void addMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
|
public synchronized void addMouseMotionListener(MouseMotionListener listener) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
| 1,960
|
public synchronized void addMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
|
public synchronized void addMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); }
| 1,961
|
public synchronized void addMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l); if (mouseWheelListener != null) enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK); }
|
public synchronized void addMouseWheelListener(MouseWheelListener listener) { mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l); if (mouseWheelListener != null) enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK); }
| 1,962
|
public synchronized void addMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l); if (mouseWheelListener != null) enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK); }
|
public synchronized void addMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, listener); if (mouseWheelListener != null) enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK); }
| 1,963
|
public synchronized void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, l); }
|
public synchronized void removeComponentListener(ComponentListener listener) { componentListener = AWTEventMulticaster.remove(componentListener, l); }
| 1,964
|
public synchronized void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, l); }
|
public synchronized void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, listener); }
| 1,965
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
|
public synchronized void removeFocusListener(FocusListener listener) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
| 1,966
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); }
|
public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, listener); }
| 1,967
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
|
removeHierarchyBoundsListener(HierarchyBoundsListener listener) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
| 1,968
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); }
|
removeHierarchyBoundsListener(HierarchyBoundsListener l) { hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, listener); }
| 1,969
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
|
public synchronized void removeHierarchyListener(HierarchyListener listener) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
| 1,970
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); }
|
public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, listener); }
| 1,971
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
|
public synchronized void removeInputMethodListener(InputMethodListener listener) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
| 1,972
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); }
|
public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, listener); }
| 1,973
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
|
public synchronized void removeKeyListener(KeyListener listener) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
| 1,974
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); }
|
public synchronized void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, listener); }
| 1,975
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
|
public synchronized void removeMouseListener(MouseListener listener) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
| 1,976
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
|
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, listener); }
| 1,977
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
|
public synchronized void removeMouseMotionListener(MouseMotionListener listener) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
| 1,978
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
|
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener); }
| 1,979
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
|
public synchronized void removeMouseWheelListener(MouseWheelListener listener) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
| 1,980
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
|
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, listener); }
| 1,981
|
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); } }
| 1,982
|
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); } }
| 1,983
|
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); } }
| 1,984
|
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); } }
| 1,985
|
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; }
| 1,986
|
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
|
public void setFont(Font f) { if (font == newFont) return; Font oldFont = font; font = newFont; if (peer != null) peer.setFont(f); invalidate(); font = f; }
| 1,987
|
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; }
| 1,988
|
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(); }
| 1,989
|
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(); }
| 1,990
|
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(); }
| 1,991
|
protected void setParentArray(Array parentArray) { Log.debug("in XMLDataIOStyle, setParentArray()"); this.parentArray = parentArray; }
|
protected void setParentArray(Array parentArray) { this.parentArray = parentArray; }
| 1,992
|
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 void send(IPv4Header ipHdr, TCPHeader hdr) 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); }
| 1,993
|
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); }
| 1,994
|
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); }
| 1,995
|
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, 0); }
| 1,996
|
public abstract void add(String item, int index);
|
void add (String item, int index);
| 1,997
|
public abstract void remove(int index);
|
void remove (int index);
| 1,998
|
public abstract void select(int index);
|
void select (int index);
| 1,999
|
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); }
| 2,000
|
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; }
| 2,001
|
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; }
| 2,002
|
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; } }
| 2,003
|
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; } }
| 2,004
|
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; }
| 2,005
|
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); }
| 2,006
|
public String toString() { return (this.getClass() + "[" + getName() + "]"); }
|
public String toString() { return (this.getClass() + "[type=" + getType() + ",name=" + getName() + "]"); }
| 2,008
|
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()); }
| 2,009
|
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); log.debug("INode.getIMode(): "+NumberUtils.hex(iMode)); return iMode; }
| 2,010
|
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(); }
| 2,011
|
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; }
| 2,012
|
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); }
| 2,013
|
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.; }
| 2,014
|
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))); }
| 2,015
|
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,int botOffset) {// 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();// } }
| 2,016
|
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();// } }
| 2,017
|
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) - botOffset), 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) - botOffset), 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();// } }
| 2,018
|
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 - botOffset, 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 - botOffset); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - botOffset - fmHeight - botOffset); 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 - botOffset); s.updateImage(0,fmHeight - botOffset * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - botOffset - fmHeight - botOffset); 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 - botOffset); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight - botOffset); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
| 2,019
|
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();// } }
| 2,020
|
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();// } }
| 2,021
|
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();// } }
| 2,022
|
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); } }
| 2,023
|
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); }
| 2,024
|
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); }
| 2,025
|
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); // listen to the keyboard this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; // default to separate // threads for commands. aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); // ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); } }
|
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); // listen to the keyboard this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; // default to separate // threads for commands. aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); // ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); } }
| 2,026
|
public void exit(){ exitted = true; console.close(); }
|
public void exit(){ exit0(); console.close(); }
| 2,027
|
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
|
protected String prompt() { String prompt = (String) AccessController.doPrivileged( new GetPropertyAction(PROMPT_PROPERTY_NAME)); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
| 2,028
|
public void start(boolean keepContent) { if (keepContent) { // we stay at the same position in X coordinate // only Y may have changed consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY);//move the cursor to the start of the line. } }
|
public void start(boolean keepContent) { if (keepContent) { // we stay at the same position in X coordinate // only Y may have changed consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY);//move the cursor to the start of the line. } }
| 2,030
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(reason, minor, completed); }
|
public UNKNOWN(String message) { super(reason, minor, completed); }
| 2,031
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(reason, minor, completed); }
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(message, 0, CompletionStatus.COMPLETED_NO); }
| 2,032
|
final void lock() { AddressPcEntry p = list; int count = 0; while (p != null) { count++; p = p.next; } final int[] table = new int[count*2]; p = list; int i = 0; while (p != null) { table[i+0] = p.pc; table[i+1] = p.offset; i += 2; p = p.next; } this.table = table; this.list = null; }
|
final void lock() { AddressPcEntry p = list; int count = 0; while (p != null) { count++; p = p.next; } final int[] table = new int[count*2]; p = list; int i = 0; while (p != null) { table[i+0] = p.pc; table[i+1] = p.offset; i += 2; p = p.next; } this.table = table; this.list = null; }
| 2,033
|
public static Border getButtonBorder() { if (buttonBorder == null) { Border outer = new MetalButtonBorder(); Border inner = getMarginBorder(); buttonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return buttonBorder; }
|
public static Border getButtonBorder() { if (buttonBorder == null) { Border outer = new ButtonBorder(); Border inner = getMarginBorder(); buttonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return buttonBorder; }
| 2,034
|
static Border getToolbarButtonBorder() { if (toolbarButtonBorder == null) { Border outer = new MetalButtonBorder(); Border inner = new RolloverMarginBorder(); toolbarButtonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return toolbarButtonBorder; }
|
static Border getToolbarButtonBorder() { if (toolbarButtonBorder == null) { Border outer = new ButtonBorder(); Border inner = new RolloverMarginBorder(); toolbarButtonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return toolbarButtonBorder; }
| 2,035
|
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Set character attributes like font-family, font-size, colors. Color foreground = view.getForeground(); g.setColor(foreground); Utilities.drawTabbedText(txt, bounds.x, bounds.y, g, tabEx, txt.offset); }
|
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Set character attributes like font-family, font-size, colors. Color foreground = view.getForeground(); g.setColor(foreground); Utilities.drawTabbedText(txt, bounds.x, bounds.y, g, tabEx, txt.offset); }
| 2,036
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.