rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
int breakLocation = Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()), (int) pos, (int) (pos + len), getTabExpander(), p0); View brokenView = createFragment(p0, breakLocation);
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT...
preferenceChanged(this, true, true);
preferenceChanged(null, true, true);
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, true); }
else { Segment s = getText(getStartOffset(), getEndOffset()); glyphPainter = new J2DGlyphPainter(s.toString(), getFont(), new FontRenderContext(null, false, false)); } } }
protected void checkPainter() { if (glyphPainter == null) glyphPainter = new DefaultGlyphPainter(); }
if (p0 != getStartOffset()) fragment.startOffset = p0; if (p1 != getEndOffset()) fragment.endOffset = p1;
fragment.offset = p0 - el.getStartOffset(); fragment.length = p1 - p0; fragment.glyphPainter = glyphPainter.getPainter(fragment, p0, p1);
public View createFragment(int p0, int p1) { GlyphView fragment = (GlyphView) clone(); if (p0 != getStartOffset()) fragment.startOffset = p0; if (p1 != getEndOffset()) fragment.endOffset = p1; return fragment; }
checkPainter(); int start = getStartOffset(); int end = glyphPainter.getBoundedPosition(this, start, pos, len); if (end == 0) weight = BadBreakWeight; else { if (getBreakLocation(start, end) != -1) weight = ExcellentBreakWeight; else
public int getBreakWeight(int axis, float pos, float len) { int weight; if (axis == Y_AXIS) weight = super.getBreakWeight(axis, pos, len); else { // FIXME: Commented out because the Utilities.getBreakLocation method // is still buggy. The GoodBreakWeight is a reasonable workaround fo...
}
public int getBreakWeight(int axis, float pos, float len) { int weight; if (axis == Y_AXIS) weight = super.getBreakWeight(axis, pos, len); else { // FIXME: Commented out because the Utilities.getBreakLocation method // is still buggy. The GoodBreakWeight is a reasonable workaround fo...
int end = endOffset; if (end < 0) end = super.getEndOffset(); return end;
Element el = getElement(); int offs; if (length > 0) offs = el.getStartOffset() + offset + length; else offs = el.getEndOffset(); return offs;
public int getEndOffset() { int end = endOffset; if (end < 0) end = super.getEndOffset(); return end; }
Element el = getElement(); Document doc = el.getDocument(); Segment seg = new Segment(); try { doc.getText(p0, p1 - p0, seg); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException must not be thrown " + "here"); ae.initCause(ex); throw ae; } FontMetrics fm = null; return U...
checkPainter(); return glyphPainter.getSpan(this, p0, p1, tabExpander, tabX);
public float getPartialSpan(int p0, int p1) { Element el = getElement(); Document doc = el.getDocument(); Segment seg = new Segment(); try { doc.getText(p0, p1 - p0, seg); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException ...
int start = startOffset; if (start < 0) start = super.getStartOffset(); return start;
Element el = getElement(); int offs = el.getStartOffset(); if (length > 0) offs += offset; return offs;
public int getStartOffset() { int start = startOffset; if (start < 0) start = super.getStartOffset(); return start; }
TabExpander te = null; View parent = getParent(); if (parent instanceof TabExpander) te = (TabExpander) parent; return te;
return tabExpander;
public TabExpander getTabExpander() { TabExpander te = null; View parent = getParent(); if (parent instanceof TabExpander) te = (TabExpander) parent; return te; }
Element el = getElement(); return getGlyphPainter().getSpan(this, el.getStartOffset(), el.getEndOffset(), te, x);
checkPainter(); TabExpander old = tabExpander; tabExpander = te; if (tabExpander != old) { preferenceChanged(null, true, false); } tabX = x; return getGlyphPainter().getSpan(this, getStartOffset(), getEndOffset(), tabExpander, x);
public float getTabbedSpan(float x, TabExpander te) { Element el = getElement(); return getGlyphPainter().getSpan(this, el.getStartOffset(), el.getEndOffset(), te, x); }
Segment txt = new Segment();
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her...
getDocument().getText(p0, p1 - p0, txt);
getDocument().getText(p0, p1 - p0, cached);
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her...
return txt;
return cached;
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("BadLocationException should not be " + "thrown her...
preferenceChanged(this, true, false);
preferenceChanged(null, true, false);
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, false); }
Color fg = getForeground(); JTextComponent tc = null;
public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g...
JTextComponent tc = (JTextComponent) c;
tc = (JTextComponent) c; if (! tc.isEnabled()) fg = tc.getDisabledTextColor(); } Color bg = getBackground(); if (bg != null) { g.setColor(bg); System.err.println("fill background: " + bg); g.fillRect(r.x, r.y, r.width, r.height); } if (tc != null) {
public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g...
getGlyphPainter().paint(this, g, a, p0, p1);
g.setColor(fg); glyphPainter.paint(this, g, a, p0, p1); boolean underline = isUnderline(); boolean striked = isStrikeThrough(); if (underline || striked) { View parent = getParent(); if (parent != null && parent.getEndOffset() == p1) { Segment s = getText(p0, p1); while (s.count > 0 && Character.isWhitespace(s.array[...
public void paint(Graphics g, Shape a) { checkPainter(); int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); // Paint layered highlights if there are any. if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.g...
preferenceChanged(this, true, false);
preferenceChanged(null, true, false);
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf) { preferenceChanged(this, true, false); }
Class found = Class.forName(classname);
Class found = Class.forName(classname, true, ClassLoader.getSystemClassLoader());
public MainThread(String classname, String[] args) throws ClassNotFoundException, NoSuchMethodException { Class found = Class.forName(classname); Class[] argTypes = new Class[1]; argTypes[0] = args.getClass(); mainMethod = found.getMethod("main", argTypes); this.args = args; }
JTree() { updateUI(); }
public JTree() { treeModel = createTreeModel(null); }
JTree() { updateUI(); }
Clipboard(String name) {
public Clipboard(String name) {
Clipboard(String name){ this.name = name;}
getContents(Object requestor) { return(contents); }
public synchronized Transferable getContents(Object requestor) { return contents; }
getContents(Object requestor){ return(contents);}
setContents(Transferable contents, ClipboardOwner owner) {
public synchronized void setContents(Transferable contents, ClipboardOwner owner) {
setContents(Transferable contents, ClipboardOwner owner){ if (this.owner != owner) if (this.owner != null) this.owner.lostOwnership(this, contents); this.owner = owner; this.contents = contents;}
return new Rectangle(0, 0, 0, 0);
return null;
protected Rectangle getVisibleEditorRect() { int width = textComponent.getWidth(); int height = textComponent.getHeight(); if (width <= 0 || height <= 0) return new Rectangle(0, 0, 0, 0); Insets insets = textComponent.getInsets(); return new Rectangle(insets.left, insets.top, width - insets.l...
Integer layer = getLayer (c); int[] range = layerToRange (layer);
int layer = getLayer (c); int[] range = layerToRange(new Integer(layer));
public int getIndexOf(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); Component[] comps = getComponents(); for (int i = range[0]; i < range[1]; ++i) { if (comps[i] == c) return i; } // should have found the component during iteration throw n...
protected Integer getLayer (Component c)
public int getLayer(Component c)
protected Integer getLayer (Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return (Integer) componentToLayer.get (c); }
return (Integer) componentToLayer.get (c);
return ((Integer) componentToLayer.get(c)).intValue();
protected Integer getLayer (Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return (Integer) componentToLayer.get (c); }
Integer layer = getLayer (c); int[] range = layerToRange (layer);
int layer = getLayer (c); int[] range = layerToRange(new Integer(layer));
public int getPosition(Component c) { Integer layer = getLayer (c); int[] range = layerToRange (layer); int top = range[0]; int bot = range[1]; Component[] comps = getComponents (); for (int i = top; i < bot; ++i) { if (comps[i] == c) return i - top; } // should have foun...
Integer layer = getLayer (c); decrLayer (layer);
int layer = getLayer (c); decrLayer (new Integer(layer));
public void remove (int index) { Component c = getComponent (index); Integer layer = getLayer (c); decrLayer (layer); componentToLayer.remove (c); super.remove (index); revalidate(); repaint(); }
Integer layer = getLayer (c); int[] range = layerToRange (layer);
int layer = getLayer (c); int[] range = layerToRange(new Integer(layer));
public void setPosition(Component c, int position) { Integer layer = getLayer (c); int[] range = layerToRange (layer); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math....
EventListener[] ll = listenerList.getListeners(MenuKeyListener.class); for (int i = 0; i < ll.length; i++) ((MenuKeyListener) ll[i]).menuKeyPressed(event);
protected void fireMenuKeyPressed(MenuKeyEvent event) { // TODO }
EventListener[] ll = listenerList.getListeners(MenuKeyListener.class); for (int i = 0; i < ll.length; i++) ((MenuKeyListener) ll[i]).menuKeyTyped(event);
protected void fireMenuKeyReleased(MenuKeyEvent event) { // TODO }
EventListener[] ll = listenerList.getListeners(MenuKeyListener.class); for (int i = 0; i < ll.length; i++) ((MenuKeyListener) ll[i]).menuKeyTyped(event);
protected void fireMenuKeyTyped(MenuKeyEvent event) { // TODO }
super.init(text, icon); paint_border = false; paint_focus = false; hori_align = JButton.LEFT; hori_text_pos = JButton.LEFT;
protected void init(String text, Icon icon) { // TODO }
return ((high - MIN_HIGH_SURROGATE) << 10) + (low - MIN_LOW_SURROGATE);
return ((high - MIN_HIGH_SURROGATE) * 0x400) + (low - MIN_LOW_SURROGATE) + 0x10000;
public static int toCodePoint(char high, char low) { return ((high - MIN_HIGH_SURROGATE) << 10) + (low - MIN_LOW_SURROGATE); }
changes = new Hashtable();
public DefaultDocumentEvent(int offset, int length, DocumentEvent.EventType type) { this.offset = offset; this.length = length; this.type = type; changes = new Hashtable(); modified = false; }
if (edit instanceof DocumentEvent.ElementChange)
if (changes == null && edits.size() > THRESHOLD)
public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (edit instanceof DocumentEvent.ElementChange) { modified = true; DocumentEvent.ElementChange elEdit = (DocumentEvent.ElementChange) edit; change...
modified = true;
changes = new HashMap(); int count = edits.size(); for (int i = 0; i < count; i++) { Object o = edits.elementAt(i); if (o instanceof DocumentEvent.ElementChange) { DocumentEvent.ElementChange ec = (DocumentEvent.ElementChange) o; changes.put(ec.getElement(), ec); } } } if (changes != null && edit instanceof DocumentEv...
public boolean addEdit(UndoableEdit edit) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. if (edit instanceof DocumentEvent.ElementChange) { modified = true; DocumentEvent.ElementChange elEdit = (DocumentEvent.ElementChange) edit; change...
return (DocumentEvent.ElementChange) changes.get(elem);
DocumentEvent.ElementChange change = null; if (changes != null) { change = (DocumentEvent.ElementChange) changes.get(elem); } else { int count = edits.size(); for (int i = 0; i < count && change == null; i++) { Object o = edits.get(i); if (o instanceof DocumentEvent.ElementChange) { DocumentEvent.ElementChange ec = (Do...
public DocumentEvent.ElementChange getChange(Element elem) { // XXX - Fully qualify ElementChange to work around gcj bug #2499. return (DocumentEvent.ElementChange) changes.get(elem); }
public Position createPosition(final int offset) throws BadLocationException
public synchronized Position createPosition(final int offset) throws BadLocationException
public Position createPosition(final int offset) throws BadLocationException { return content.createPosition(offset); }
finally { notifyListeners = false; } }
protected void fireChangedUpdate(DocumentEvent event) { DocumentListener[] listeners = getDocumentListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].changedUpdate(event); }
finally { notifyListeners = false; } }
protected void fireInsertUpdate(DocumentEvent event) { DocumentListener[] listeners = getDocumentListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].insertUpdate(event); }
finally { notifyListeners = false; } }
protected void fireRemoveUpdate(DocumentEvent event) { DocumentListener[] listeners = getDocumentListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].removeUpdate(event); }
protected final Thread getCurrentWriter()
protected final synchronized Thread getCurrentWriter()
protected final Thread getCurrentWriter() { return currentWriter; }
public final void readLock()
public final synchronized void readLock()
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ...
if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) {
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ...
documentCV.wait(); } catch (InterruptedException ie)
while (currentWriter != null)
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ...
throw new Error("interrupted trying to get a readLock"); }
if (currentWriter == Thread.currentThread()) return; wait();
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ...
catch (InterruptedException ex) { throw new Error("Interrupted during grab read lock"); }
public final void readLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); ...
public final void readUnlock()
public final synchronized void readUnlock()
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ...
if (numReaders == 0)
if (numReaders <= 0)
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ...
synchronized (documentCV) {
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ...
if (currentWriter == null) { numReaders --; if (numReaders == 0 && numWritersWaiting != 0) documentCV.notify(); } }
numReaders--; notify();
public final void readUnlock() { // Note we could have a problem here if readUnlock was called without a // prior call to readLock but the specs simply warn users to ensure that // balance by using a finally block: // readLock() // try // { // doSomethingHere // } // finally // { ...
if (documentFilter == null)
writeLock(); try { DocumentFilter f = getDocumentFilter(); if (f == null)
public void remove(int offset, int length) throws BadLocationException { if (documentFilter == null) removeImpl(offset, length); else documentFilter.remove(getBypass(), offset, length); }
documentFilter.remove(getBypass(), offset, length);
f.remove(getBypass(), offset, length); } finally { writeUnlock(); }
public void remove(int offset, int length) throws BadLocationException { if (documentFilter == null) removeImpl(offset, length); else documentFilter.remove(getBypass(), offset, length); }
try { writeLock();
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ...
finally { writeUnlock(); }
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ...
}
void removeImpl(int offset, int length) throws BadLocationException { // The RI silently ignores all requests that have a negative length. // Don't ask my why, but that's how it is. if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove ...
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0)
protected synchronized final void writeLock()
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ...
documentCV.wait();
while (numReaders > 0 || currentWriter != null) { if (Thread.currentThread() == currentWriter) { if (notifyListeners) throw new IllegalStateException("Mutation during notify"); numWriters++; return;
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ...
catch (InterruptedException ie) { throw new Error("interruped while trying to obtain write lock"); }
wait();
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ...
numWritersWaiting --;
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ...
numWriters = 1; } catch (InterruptedException ex) { throw new Error("Interupted during grab write lock");
protected final void writeLock() { if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } ...
protected final void writeUnlock()
protected final synchronized void writeUnlock()
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } }
synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter))
if (--numWriters <= 0)
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } }
documentCV.notifyAll(); }
notifyAll();
protected final void writeUnlock() { synchronized (documentCV) { if (Thread.currentThread().equals(currentWriter)) { currentWriter = null; documentCV.notifyAll(); } } }
put (out, BYTE_ORDER_MARK);
} out.putChar (BYTE_ORDER_MARK);
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }...
put (out, c); put (out, d);
out.putChar (c); out.putChar (d);
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }...
put (out, c);
} out.putChar (c);
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }...
out.order(originalBO);
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() if (needsByteOrderMark) { if (out.remaining () < 2) return CoderResult.OVERFLOW; put (out, BYTE_ORDER_MARK); needsByteOrderMark = false; }...
this.handlersEp = descriptor.getExtensionPoint("protocols");
this.handlersEp = descriptor.getExtensionPoint("handlers");
public ProtocolHandlerFactoryPlugin(PluginDescriptor descriptor) { super(descriptor); this.handlersEp = descriptor.getExtensionPoint("protocols"); reloadHandlers(); }
protected void dispatchEvent(AWTEvent evt) { if (evt instanceof ActiveEvent) {
protected void dispatchEvent(AWTEvent evt) { currentEvent = evt; if (evt instanceof InputEvent) lastWhen = ((InputEvent) evt).getWhen(); else if (evt instanceof ActionEvent) lastWhen = ((ActionEvent) evt).getWhen(); else if (evt instanceof InvocationEvent) lastWhen = ((InvocationEvent) evt).getWhen(); if (evt instanc...
protected void dispatchEvent(AWTEvent evt) { if (evt instanceof ActiveEvent) { ActiveEvent active_evt = (ActiveEvent) evt; active_evt.dispatch(); } else { Object source = evt.getSource(); if (source instanceof Component) { Component srccmp = (Component) source; srccmp.dispatchEvent(evt); } else if (s...
public static long getMostRecentEventTime() {
public static long getMostRecentEventTime() { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); if (Thread.currentThread() != eq.dispatchThread)
public static long getMostRecentEventTime() { // XXX For now, this ONLY does the current time. return System.currentTimeMillis(); }
return eq.lastWhen;
public static long getMostRecentEventTime() { // XXX For now, this ONLY does the current time. return System.currentTimeMillis(); }
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException {
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { if (isDispatchThread ()) throw new Error("Can't call invokeAndWait from event dispatch thread");
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch t...
if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch thread");
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw new Error("Can't call invokeAndWait from event dispatch t...
while (eq.next != null) eq = eq.next;
public static boolean isDispatchThread() { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); return (Thread.currentThread() == eq.dispatchThread); }
synchronized (prev) { prev.next = null; }
synchronized (prev) { prev.next = next; if (next != null) next.prev = prev;
protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); // Don't synchronize both this and prev at the same time, or deadlock could // occur. synchronized (prev) { prev.next = null; } synchronized (this) { int i = next_out; while (i != next_in) { prev.postE...
next_in = 0; next_out = 0; dispatchThread.interrupt (); dispatchThread = null; }
protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); // Don't synchronize both this and prev at the same time, or deadlock could // occur. synchronized (prev) { prev.next = null; } synchronized (this) { int i = next_out; while (i != next_in) { prev.postE...
public synchronized void postEvent(AWTEvent evt) { if (next != null) {
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) {
public synchronized void postEvent(AWTEvent evt) { if (next != null) { next.postEvent(evt); return; } // FIXME: Security checks? /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id =...
public synchronized void push(EventQueue newEventQueue) {
public synchronized void push(EventQueue newEventQueue) { if (newEventQueue == null) throw new NullPointerException (); if (next != null) { next.push (newEventQueue); return; } if (dispatchThread == null) dispatchThread = new EventDispatchThread(this);
public synchronized void push(EventQueue newEventQueue) { int i = next_out; while (i != next_in) { newEventQueue.postEvent(queue[i]); next_out = i; if (++i == queue.length) i = 0; } next = newEventQueue; newEventQueue.prev = this; }
return view;
HTMLRootView rootView = new HTMLRootView(c, view, kit, doc); return rootView;
public static View createHTMLView(JComponent c, String html) { // TODO: This might be wrong. Lets see if it turns out good when // the javax.swing.text.html package is in a good shape. HTMLDocument doc = new HTMLDocument(); HTMLEditorKit kit = new HTMLEditorKit(); StringReader reader = new StringReade...
return s.contains("<") && s.contains(">");
return (s != null) && s.contains("<") && s.contains(">");
public static boolean isHTMLString(String s) { // We consider a string to be HTML if it contains both the '<' and '>' // character at least once. return s.contains("<") && s.contains(">"); }
{
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); }
} if (!(obj instanceof RSAKey)) {
if (! (obj instanceof RSAKey))
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); }
}
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof RSAKey)) { return false; } final RSAKey that = (RSAKey) obj; return n.equals(that.getModulus()); }
String ls = SystemProperties.getProperty("line.separator"); str = new StringBuilder().append(ls)
String ls = (String) AccessController.doPrivileged (new GetPropertyAction("line.separator")); str = new StringBuilder(ls)
public String toString() { if (str == null) { String ls = SystemProperties.getProperty("line.separator"); str = new StringBuilder().append(ls) .append("defaultFormat=").append(defaultFormat).append(",").append(ls) .append("n=0x").append(n.toString(16)).append(",").append(l...
cluster = getUInt8(1 + lenlen);
cluster = getInt8(1 + lenlen);
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust...
cluster = getUInt16(1 + lenlen);
cluster = getInt16(1 + lenlen);
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust...
cluster = getUInt24(1 + lenlen);
cluster = getInt24(1 + lenlen);
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust...
cluster = getUInt32AsInt(1 + lenlen);
cluster = getInt32(1 + lenlen);
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust...
this.cluster = cluster + previousLCN;
this.cluster = cluster == 0 ? 0 : cluster + previousLCN;
public DataRun(NTFSNonResidentAttribute attr, int offset, long vcn, long previousLCN) { super(attr, offset); // read first byte in type attribute this.type = getUInt8(0); final int lenlen = type & 0xF; final int clusterlen = type >>> 4; this.size = lenlen + clust...
volume.readClusters(actCluster, dst, actDstOffset, count);
if (actCluster == 0) { Arrays.fill(dst, actDstOffset, actDstOffset + count, (byte) 0); } else { volume.readClusters(actCluster, dst, actDstOffset, count); }
public int readClusters(long vcn, byte[] dst, int dstOffset, int nrClusters, int clusterSize, NTFSVolume volume) throws IOException { final long myFirstVcn = getFirstVcn(); final int myLength = getLength(); final long myLastVcn = myFirstVcn + myLength - 1; final long r...
"TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
protected void initClassDefaults(UIDefaults defaults) { // Variables Object[] uiDefaults; // Initialize Class Defaults uiDefaults = new Object[] { "ButtonUI", "javax.swing.plaf.basic.BasicButtonUI", "CheckBoxMenuItemUI", "javax.swing.plaf.basic.BasicCheckBoxMenuItemUI", "CheckBoxUI", "java...
"Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.gif")),
"Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")), "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")),
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6...
"Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.gif")),
"Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")),
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6...
"Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.gif")),
"Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")),
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; // The default Look and Feel happens to use these three purple shades // extensively. Color lightPurple = new Color(0xCC, 0xCC, 0xFF); Color midPurple = new Color(0x99, 0x99, 0xCC); Color darkPurple = new Color(0x6...
int ret = (int) buf[0]; if (ret < 0) { ret += 0x100; } return ret;
return 0xff & buf[0];
public int read() throws IOException { byte[] buf = new byte[1]; int len = read(buf, 0, 1); if (len == -1) { return -1; } int ret = (int) buf[0]; if (ret < 0) { ret += 0x100; } return ret; }
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); }
public void doPass2() { refs[0] = refs[0].simplify();
public void doPass2(BootableHashMap liveVariables) { setDeadCode(true); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }