rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
alignmentY = a;
public void setAlignmentY(float alignmentY) { // Set the the horizontal alignment. }
public void setAutoscrolls(boolean autoscrolls)
public void setAutoscrolls(boolean a)
public void setAutoscrolls(boolean autoscrolls) { // If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport }
autoscrolls = a;
public void setAutoscrolls(boolean autoscrolls) { // If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport }
debugGraphicsOptions = debugOptions;
public void setDebugGraphicsOptions(int debugOptions) { // Enables or disables diagnostic information about every graphics operation performed within the component or one of its children. }
public void setDoubleBuffered(boolean aFlag)
public void setDoubleBuffered(boolean db)
public void setDoubleBuffered(boolean aFlag) { use_double_buffer = aFlag; }
use_double_buffer = aFlag;
doubleBuffered = db;
public void setDoubleBuffered(boolean aFlag) { use_double_buffer = aFlag; }
public void setEnabled(boolean enabled)
public void setEnabled(boolean e)
public void setEnabled(boolean enabled) { // Sets whether or not this component is enabled. super.setEnabled(enabled); repaint(); }
super.setEnabled(enabled);
super.setEnabled(e); revalidate();
public void setEnabled(boolean enabled) { // Sets whether or not this component is enabled. super.setEnabled(enabled); repaint(); }
public void setFont(Font font)
public void setFont(Font f)
public void setFont(Font font) { super.setFont(font); revalidate(); repaint(); }
super.setFont(font);
super.setFont(f);
public void setFont(Font font) { super.setFont(font); revalidate(); repaint(); }
public void setMaximumSize(Dimension maximumSize) { max = maximumSize; }
public void setMaximumSize(Dimension max) { maximumSize = max; revalidate(); repaint(); }
public void setMaximumSize(Dimension maximumSize) { max = maximumSize; }
public void setMinimumSize(Dimension minimumSize) { min = minimumSize; }
public void setMinimumSize(Dimension min) { minimumSize = min; revalidate(); repaint(); }
public void setMinimumSize(Dimension minimumSize) { min = minimumSize; }
public void setPreferredSize(Dimension preferredSize) { pref = preferredSize; }
public void setPreferredSize(Dimension pref) { preferredSize = pref; }
public void setPreferredSize(Dimension preferredSize) { pref = preferredSize; }
public void setRequestFocusEnabled(boolean aFlag) {
public void setRequestFocusEnabled(boolean e) { requestFocusEnabled = e;
public void setRequestFocusEnabled(boolean aFlag) { }
{ tool_tip_text = text; }
{ toolTipText = text; }
public void setToolTipText(String text) { tool_tip_text = text; }
{
protected void setUI(ComponentUI newUI) { if (ui != null) { ui.uninstallUI(this); } // Set the look and feel delegate for this component. ui = newUI; if (ui != null) { ui.installUI(this); } revalidate(); repaint(); }
}
protected void setUI(ComponentUI newUI) { if (ui != null) { ui.uninstallUI(this); } // Set the look and feel delegate for this component. ui = newUI; if (ui != null) { ui.installUI(this); } revalidate(); repaint(); }
public void setVisible(boolean aFlag) { super.setVisible(aFlag); if (getParent() != null) { Rectangle dims = getBounds(); getParent().repaint((int)dims.getX(), (int)dims.getY(), (int)dims.getWidth(), (int)dims.getHeight()); } }
public void setVisible(boolean v) { super.setVisible(v); revalidate(); repaint(); }
public void setVisible(boolean aFlag) { // Makes the component visible or invisible. super.setVisible(aFlag); if (getParent() != null) { Rectangle dims = getBounds(); getParent().repaint((int)dims.getX(), (int)dims.getY(), (int)dims.getWidth(), ...
if (created)
if (created && parent instanceof DomDocument)
public void transform(Source xmlSource, Result outputTarget) throws TransformerException { // Get the source tree DOMSource source; synchronized (factory.resolver) { factory.resolver.setUserResolver(uriResolver); factory.resolver.setUserListener(errorListener); source = factory....
if (errorListener != null) { try { errorListener.error(new TransformerException(e)); } catch (TransformerException e2) { e2.printStackTrace(System.err); } } else e.printStackTrace(System.err);
void writeStreamResult(Node node, StreamResult sr, int outputMethod, String encoding) throws IOException { OutputStream out = null; boolean created = false; try { out = sr.getOutputStream(); if (out == null) { Writer writer = sr.getWriter(); ...
(isAlphaPremultiplied == isAlphaPremultiplied) && (bits.equals(o.bits)) &&
(isAlphaPremultiplied == o.isAlphaPremultiplied) && Arrays.equals(bits, o.bits) &&
public boolean equals(Object obj) { if (!(obj instanceof ColorModel)) return false; ColorModel o = (ColorModel) obj; return (pixel_bits == o.pixel_bits) && (transferType == o.transferType) && (transparency == o.transparency) && (hasAlpha == o.hasAlpha) && (isAlphaPremultiplied == isA...
doc.remove(start, end);
doc.remove(start, end - start);
public void replaceRange(String text, int start, int end) { Document doc = getDocument(); if (start > end || start < doc.getStartPosition().getOffset() || end >= doc.getEndPosition().getOffset()) throw new IllegalArgumentException(); try { doc.remove(start, end); doc.insertString(start, text, ...
throw new Error("Please report a bug", e);
public void replaceRange(String text, int start, int end) { Document doc = getDocument(); if (start > end || start < doc.getStartPosition().getOffset() || end >= doc.getEndPosition().getOffset()) throw new IllegalArgumentException(); try { doc.remove(start, end); doc.insertString(start, text, ...
private static void adjustFromLeft(SizeRequirements reqs, int baseline,
private static void adjustFromLeft(SizeRequirements reqs, float baseline,
private static void adjustFromLeft(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float left = baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxLeft = ((float) reqs.maximum) * reqs...
float minLeft = ((float) reqs.minimum) * reqs.alignment; if (left / reqs.alignment < reqs.minimum) left = Math.max(minLeft, maxLeft);
private static void adjustFromLeft(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float left = baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxLeft = ((float) reqs.maximum) * reqs...
spanAndOffset[1] = baseline - (int) (((float) spanAndOffset[0]) * reqs.alignment);
spanAndOffset[1] = (int) (baseline - spanAndOffset[0] * reqs.alignment);
private static void adjustFromLeft(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float left = baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxLeft = ((float) reqs.maximum) * reqs...
private static void adjustFromRight(SizeRequirements reqs, int baseline,
private static void adjustFromRight(SizeRequirements reqs, float baseline,
private static void adjustFromRight(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float right = allocated - baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxRight = ((float) reqs...
float minRight = ((float) reqs.minimum) * (1.F - reqs.alignment); if (right / (1.F - reqs.alignment) < reqs.minimum) right = Math.max(minRight, maxRight);
private static void adjustFromRight(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float right = allocated - baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxRight = ((float) reqs...
spanAndOffset[1] = baseline - (int) (((float) spanAndOffset[0]) * reqs.alignment);
spanAndOffset[1] = (int) (baseline - spanAndOffset[0] * reqs.alignment);
private static void adjustFromRight(SizeRequirements reqs, int baseline, int allocated, int[] spanAndOffset) { float right = allocated - baseline; // If the resulting span exceeds the maximum of the component, then adjust // accordingly. float maxRight = ((float) reqs...
if (sumDelta < 0) sumDelta = Integer.MAX_VALUE; }
private static void adjustGreater(int allocated, SizeRequirements[] children, int[] spans, int span) { // Sum up (maxSize - prefSize) over all children int sumDelta = 0; for (int i = 0; i < children.length; i++) sumDelta += children[i].maximum - children[i].preferred;...
{
{ offset = e.getX();
protected DragController(MouseEvent e) { }
finishDraggingTo(adjust(x, y));
protected void completeDrag(int x, int y) { }
if (isValid()) dragDividerTo(adjust(newX, newY));
protected void continueDrag(int newX, int newY) { }
return 0;
return x;
protected int getNeededLocation(int x, int y) { return 0; }
return 0;
return e.getX() + getX() - offset;
protected int positionForMouseEvent(MouseEvent e) { return 0; }
if (dragger != null) dragger.continueDrag(e);
public void mouseDragged(MouseEvent e) { // FIXME: Not yet implemented. }
if (splitPane.isOneTouchExpandable()) { if (e.getSource() == leftButton) { currentDividerLocation--; if (currentDividerLocation < 0) currentDividerLocation = 0; moveDividerTo(currentDividerLocation); return; } else if (e.getSource() == rightButton) { currentDividerLocation++; if (currentDividerLocation > 2) currentDivi...
public void mousePressed(MouseEvent e) { // FIXME: Not yet implemented. }
if (isDragging) dragger.completeDrag(e); isDragging = false;
public void mouseReleased(MouseEvent e) { // FIXME: Not yet implemented. }
setDividerSize(splitPane.getDividerSize());
public BasicSplitPaneDivider(BasicSplitPaneUI ui) { setBasicSplitPaneUI(ui); }
return new OneTouchButton( true);
int dir = SwingConstants.WEST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.NORTH; JButton button = new BasicArrowButton(dir); button.setBorderPainted(false); return button;
protected JButton createLeftOneTouchButton() { return new OneTouchButton(/* left */ true); }
return new OneTouchButton( false);
int dir = SwingConstants.EAST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.SOUTH; JButton button = new BasicArrowButton(dir); button.setBorderPainted(false); return button;
protected JButton createRightOneTouchButton() { return new OneTouchButton(/* left */ false); }
return new Dimension(dividerSize, dividerSize);
return getLayout().preferredLayoutSize(this);
public Dimension getPreferredSize() { return new Dimension(dividerSize, dividerSize); }
if (splitPane.isOneTouchExpandable()) { leftButton = createLeftOneTouchButton(); rightButton = createRightOneTouchButton(); add(leftButton); add(rightButton); leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); currentDividerLocation = 1;
protected void oneTouchExpandableChanged() { // FIXME: Not yet implemented. }
else { if (leftButton != null && rightButton != null) { leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; } } layout(); repaint(); }
protected void oneTouchExpandableChanged() { // FIXME: Not yet implemented. }
if (e.getPropertyName().equals(JSplitPane.ONE_TOUCH_EXPANDABLE_PROPERTY)) oneTouchExpandableChanged(); else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY)) { orientation = splitPane.getOrientation(); if (splitPane.isOneTouchExpandable()) { layout(); repaint(); } } else if (e.getPropertyName().equals(JS...
public void propertyChange(PropertyChangeEvent e) { // FIXME: Not yet implemented. }
oneTouchExpandableChanged();
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) { /* Remove the connection to the existing JSplitPane. */ if (splitPane != null) { splitPane.removePropertyChangeListener(this); splitPane.removeMouseListener(mouseHandler); splitPane.removeMouseMotionListener(mouseHandler); splitPa...
}
public void setBorder(Border border) { Border oldValue = this.border; this.border = border; firePropertyChange("border", oldValue, border); }
}
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); // adjust preferred and maximum size accordingly Dimension prefSize = getPreferredSize(); prefSize.width =...
iter = null;
public SentenceBreakIterator () { iter = null; }
Object bean; InputStream serStream; if (cl == null) { serStream = ClassLoader.getSystemResourceAsStream (beanName.replace ('.','/')+".ser"); } else { serStream = cl.getResourceAsStream (beanName.replace ('.', '/') + ".ser"); } if (serStream != null) { if(cl == null) { ObjectInputStream ois = new ObjectInputStream(ser...
return instantiate(cl, beanName, null, null); }
public static Object instantiate (ClassLoader cl, String beanName) throws IOException, ClassNotFoundException { Object bean; InputStream serStream; if (cl == null) { serStream = ClassLoader.getSystemResourceAsStream (beanName.replace ('.','/')+".ser"); } else { ...
throw new IllegalArgumentException("path must have non-zero length");
path = "/";
public Request newRequest(String method, String path) { if (method == null || method.length() == 0) { throw new IllegalArgumentException("method must have non-zero length"); } if (path == null || path.length() == 0) { throw new IllegalArgumentException("path must have non-zero leng...
}
public Request newRequest(String method, String path) { if (method == null || method.length() == 0) { throw new IllegalArgumentException("method must have non-zero length"); } if (path == null || path.length() == 0) { throw new IllegalArgumentException("path must have non-zero leng...
return (int) mnemonicKey;
return mnemonicKey;
public int getMnemonic() { return (int) mnemonicKey; }
AffineTransform xform, RenderingHints hints) throws NotImplementedException
AffineTransform xform, RenderingHints hints)
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) throws NotImplementedException { throw new Error("not implemente...
throw new Error("not implemented");
return new TexturePaintContext(this, deviceBounds, userBounds, xform);
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) throws NotImplementedException { throw new Error("not implemente...
throws NotImplementedException
public int getTransparency() throws NotImplementedException { throw new Error("not implemented"); }
throw new Error("not implemented");
return texture.getTransparency();
public int getTransparency() throws NotImplementedException { throw new Error("not implemented"); }
InetSocketAddress a = (InetSocketAddress) obj; return addr.equals(a.addr) && a.port == port;
InetSocketAddress sa = (InetSocketAddress) obj; if (addr == null && sa.addr != null) return false; else if (addr == null && sa.addr == null) return hostname.equals(sa.hostname) && sa.port == port; else return addr.equals(sa.addr) && sa.port == port;
public final boolean equals (Object obj) { // InetSocketAddress objects are equal when addr and port are equal. // The hostname may differ. if (obj instanceof InetSocketAddress) { InetSocketAddress a = (InetSocketAddress) obj; return addr.equals(a.addr) && a.port == port; } re...
return addr + ":" + port;
return (addr == null ? hostname : addr.getHostName()) + ":" + port;
public String toString() { return addr + ":" + port; }
graphics.clipRect(0, 0, w, h);
public void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { // reparent c addImpl(c, null, 0); // translate to (x,y) graphics.translate(x, y); // set bounds of c c.setBounds(0, 0, w, h); // validate i...
graphics.setClip(oldClip);
public void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { // reparent c addImpl(c, null, 0); // translate to (x,y) graphics.translate(x, y); // set bounds of c c.setBounds(0, 0, w, h); // validate i...
BoxLayout(JComponent p,
public BoxLayout(JComponent p,
BoxLayout(JComponent p, int way) { int width = 0; int height = 0; this.way = way; if (way == X_AXIS) { width = 1; } else { height = 1; } gridbag = new GridLayout(width, height); }
System.out.println("Copyright 2002 Free Software Foundation, Inc.");
System.out.println("Copyright 2005 Free Software Foundation, Inc.");
public static void version() { System.out.println("rmiregistry (" + System.getProperty("java.vm.name") + ") " + System.getProperty("java.vm.version")); System.out.println("Copyright 2002 Free Software Foundation, Inc."); System.out.println("This is free software; see the source for copying conditions. T...
paintChildren(g);
public void paint(Graphics g) { RepaintManager rm = RepaintManager.currentManager(this); // We do a little stunt act here to switch on double buffering if it's // not already on. If we are not already doublebuffered, then we jump // into the method paintDoubleBuffered, which turns on the double buffer ...
g.setClip(originalClip);
protected void paintChildren(Graphics g) { Component[] children = getComponents(); for (int i = children.length - 1; i >= 0; --i) { if (!children[i].isVisible()) continue; Rectangle bounds = children[i].getBounds(); Rectangle oldClip = g.getClipBounds(); if (oldClip ==...
c.setBackground(UIManager.getColor("control"));
public void installUI(JComponent c) { c.setBackground(UIManager.getColor("control")); super.installUI(c); }
}
if (c instanceof JRootPane) { JRootPane rp = (JRootPane) c; installDefaults(rp); installComponents(rp); installListeners(rp); installKeyboardActions(rp); } }
public void installUI(JComponent c) { c.setBackground(UIManager.getColor("control")); super.installUI(c); }
t.setToTranslation(tx, ty);
t.m02 = tx; t.m12 = ty; t.type = (tx == 0 && ty == 0) ? TYPE_UNIFORM_SCALE : TYPE_TRANSLATION;
public static AffineTransform getTranslateInstance(double tx, double ty) { AffineTransform t = new AffineTransform(); t.setToTranslation(tx, ty); return t; }
rootElement = createBranchElement(null, null); reindex(); return (AbstractElement) rootElement;
BranchElement root = (BranchElement) createBranchElement(null, SimpleAttributeSet.EMPTY); Element[] array = new Element[1]; array[0] = createLeafElement(root, SimpleAttributeSet.EMPTY, 0, 1); root.replace(0, 0, array); return root;
protected AbstractDocument.AbstractElement createDefaultRoot() { rootElement = createBranchElement(null, null); reindex(); return (AbstractElement) rootElement; }
return null;
Element root = getDefaultRootElement(); return root.getElement(root.getElementIndex(pos));
public Element getParagraphElement(int pos) { return null; }
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr)
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes)
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) { reindex(); }
super.insertUpdate(event, attributes);
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) { reindex(); }
elts.add(createLeafElement(rootElement, null, j, i)); j = i;
elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1;
protected void reindex() { Element[] lines; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); int j = 0; for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i+1)) { elts.add(createLeafElement(rootElem...
elts.add(createLeafElement(rootElement, null, j, content.length()));
elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, content.length()));
protected void reindex() { Element[] lines; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); int j = 0; for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i+1)) { elts.add(createLeafElement(rootElem...
lines[0] = createLeafElement(rootElement, null, 0, 1);
lines[0] = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, 0, 1);
protected void reindex() { Element[] lines; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); int j = 0; for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i+1)) { elts.add(createLeafElement(rootElem...
protected void removeUpdate(DefaultDocumentEvent chng)
protected void removeUpdate(DefaultDocumentEvent event)
protected void removeUpdate(DefaultDocumentEvent chng) { reindex(); }
super.removeUpdate(event);
protected void removeUpdate(DefaultDocumentEvent chng) { reindex(); }
if (theme == null)
public MetalLookAndFeel() { if (theme == null) createDefaultTheme(); }
if (theme == null)
protected void createDefaultTheme() { setCurrentTheme(new DefaultMetalTheme()); }
return null;
public static ColorUIResource getAcceleratorForeground() { return theme.getAcceleratorForeground(); }
return null;
public static ColorUIResource getAcceleratorSelectedForeground() { return theme.getAcceleratorSelectedForeground(); }
return null;
public static ColorUIResource getBlack() { return theme.getBlack(); }
return null;
public static ColorUIResource getControl() { return theme.getControl(); }
return null;
public static ColorUIResource getControlDarkShadow() { return theme.getControlDarkShadow(); }
return null;
public static ColorUIResource getControlDisabled() { return theme.getControlDisabled(); }
return null;
public static ColorUIResource getControlHighlight() { return theme.getControlHighlight(); }
return null;
public static ColorUIResource getControlInfo() { return theme.getControlInfo(); }
return null;
public static ColorUIResource getControlShadow() { return theme.getControlShadow(); }
return null;
public static ColorUIResource getControlTextColor() { return theme.getControlTextColor(); }
return null;
public static FontUIResource getControlTextFont() { return theme.getControlTextFont(); }
if (theme != null)
public UIDefaults getDefaults() { if (LAF_defaults == null) { LAF_defaults = super.getDefaults(); // add custom theme entries to the table theme.addCustomEntriesToTable(LAF_defaults); } // Returns the default values for this look and feel. return LAF_defaults; }
return "Metal look and feel";
return "The Java(tm) Look and Feel";
public String getDescription() { return "Metal look and feel"; }
return null;
public static ColorUIResource getDesktopColor() { return theme.getDesktopColor(); }
return null;
public static ColorUIResource getFocusColor() { return theme.getFocusColor(); }
return null;
public static ColorUIResource getHighlightedTextColor() { return theme.getHighlightedTextColor(); }
return "MetalLookAndFeel";
return "Metal";
public String getID() { return "MetalLookAndFeel"; }
return null;
public static ColorUIResource getInactiveControlTextColor() { return theme.getInactiveControlTextColor(); }
return null;
public static ColorUIResource getInactiveSystemTextColor() { return theme.getInactiveSystemTextColor(); }
return null;
public static ColorUIResource getMenuBackground() { return theme.getMenuBackground(); }
return null;
public static ColorUIResource getMenuDisabledForeground() { return theme.getMenuDisabledForeground(); }