rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public CompoundEdit() { }
public CompoundEdit() { edits = new Vector(); inProgress = true; }
public CompoundEdit() { } // CompoundEdit()
public void die() {
public void die() { for (int i = edits.size() - 1; i >= 0; i--) ((UndoableEdit) edits.elementAt(i)).die();
public void die() { // Variables int index; UndoableEdit current; // Loop through all contained UndoableEdits for (index = edits.size() - 1; index >= 0; index--) { current = (UndoableEdit) edits.elementAt(index); current.die(); } // for: index } // die()
int index; UndoableEdit current; for (index = edits.size() - 1; index >= 0; index--) { current = (UndoableEdit) edits.elementAt(index); current.die(); } }
super.die(); }
public void die() { // Variables int index; UndoableEdit current; // Loop through all contained UndoableEdits for (index = edits.size() - 1; index >= 0; index--) { current = (UndoableEdit) edits.elementAt(index); current.die(); } // for: index } // die()
public String getPresentationName() { if (edits.size() == 0) { return super.getPresentationName(); } else { return lastEdit().getPresentationName(); } }
public String getPresentationName() { UndoableEdit last; last = lastEdit(); if (last == null) return super.getPresentationName(); else return last.getPresentationName(); }
public String getPresentationName() { if (edits.size() == 0) { return super.getPresentationName(); } else { return lastEdit().getPresentationName(); } } // getPresentationName()
public boolean isSignificant() {
public boolean isSignificant() { for (int i = edits.size() - 1; i >= 0; i--) if (((UndoableEdit) edits.elementAt(i)).isSignificant()) return true;
public boolean isSignificant() { // Variables int index; UndoableEdit current; // Check each edit for (index = 0; index < edits.size(); index++) { current = (UndoableEdit) edits.elementAt(index); if (current.isSignificant() == true) { return true; } } // for: index return false; } // isSignificant()
int index; UndoableEdit current; for (index = 0; index < edits.size(); index++) { current = (UndoableEdit) edits.elementAt(index); if (current.isSignificant() == true) { return true; } } return false; }
return false; }
public boolean isSignificant() { // Variables int index; UndoableEdit current; // Check each edit for (index = 0; index < edits.size(); index++) { current = (UndoableEdit) edits.elementAt(index); if (current.isSignificant() == true) { return true; } } // for: index return false; } // isSignificant()
protected UndoableEdit lastEdit() { if (edits.size() == 0) { return null; } return (UndoableEdit) edits.elementAt(edits.size() - 1); }
protected UndoableEdit lastEdit() { if (edits.size() == 0) return null; else return (UndoableEdit) edits.elementAt(edits.size() - 1); }
protected UndoableEdit lastEdit() { if (edits.size() == 0) { return null; } return (UndoableEdit) edits.elementAt(edits.size() - 1); } // lastEdit()
public boolean addEdit(UndoableEdit anEdit) { return false; }
public boolean addEdit(UndoableEdit edit) { return false; }
public boolean addEdit(UndoableEdit anEdit) { return false; } // addEdit()
public boolean addEdit(UndoableEdit anEdit);
boolean addEdit(UndoableEdit anEdit);
public boolean addEdit(UndoableEdit anEdit);
public boolean replaceEdit(UndoableEdit anEdit);
boolean replaceEdit(UndoableEdit anEdit);
public boolean replaceEdit(UndoableEdit anEdit);
public boolean canRedo() { if (alive == true && hasBeenDone == false) { return true; } return false; }
public boolean canRedo() { return alive && !hasBeenDone; }
public boolean canRedo() { if (alive == true && hasBeenDone == false) { return true; } // if return false; } // canRedo()
public boolean canUndo() { if (alive == true && hasBeenDone == true) { return true; } return false; }
public boolean canUndo() { return alive && hasBeenDone; }
public boolean canUndo() { if (alive == true && hasBeenDone == true) { return true; } // if return false; } // canUndo()
public void die();
void die();
public void die();
public String getPresentationName();
String getPresentationName();
public String getPresentationName();
public String getRedoPresentationName() { if (getPresentationName().equals("") == true) { return RedoName; } else { return RedoName + " " + getPresentationName(); } }
public String getRedoPresentationName() { String msg, pres; msg = UIManager.getString("AbstractUndoableEdit.redoText"); if (msg == null) msg = RedoName; pres = getPresentationName(); if ((pres == null) || (pres.length() == 0)) return msg; else return msg + ' ' + pres; }
public String getRedoPresentationName() { if (getPresentationName().equals("") == true) { return RedoName; } else { return RedoName + " " + getPresentationName(); } } // getRedoPresentationName()
public String getRedoPresentationName();
String getRedoPresentationName();
public String getRedoPresentationName();
public String getUndoPresentationName() { if (getPresentationName().equals("") == true) { return UndoName; } else { return UndoName + " " + getPresentationName(); } }
public String getUndoPresentationName() { String msg, pres; msg = UIManager.getString("AbstractUndoableEdit.undoText"); if (msg == null) msg = UndoName; pres = getPresentationName(); if ((pres == null) || (pres.length() == 0)) return msg; else return msg + ' ' + pres; }
public String getUndoPresentationName() { if (getPresentationName().equals("") == true) { return UndoName; } else { return UndoName + " " + getPresentationName(); } } // getUndoPresentationName()
public String getUndoPresentationName();
String getUndoPresentationName();
public String getUndoPresentationName();
public boolean isSignificant();
boolean isSignificant();
public boolean isSignificant();
public void redo() throws CannotRedoException;
void redo() throws CannotRedoException;
public void redo() throws CannotRedoException;
public String toString() { return null; }
public String toString() { return super.toString() + " hasBeenDone: " + hasBeenDone + " alive: " + alive; }
public String toString() { return null; // TODO } // toString()
public void undo() throws CannotUndoException;
void undo() throws CannotUndoException;
public void undo() throws CannotUndoException;
(ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected. (If nothing was selected, menu should be pressed before
(ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected. (If nothing was selected, menu...
if (! menu.isTopLevelMenu() || (menu.isTopLevelMenu() && (((JMenuBar) menu.getParent()).isSelected() && ! menu.isArmed())))
if (! menu.isTopLevelMenu() || popupVisible())
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected. (If nothing was selected, menu...
else
public void removeImage(Image image) { synchronized (this) { MediaEntry e = head; MediaEntry prev = null; while (e != null) { if (e.image == image) { if (prev == null) head = e.next; else prev.next = e.next; } prev = e; e = e.next; } } }
SizeRequirements sr = super.calculateMajorAxisRequirements(axis, r); return sr;
if (r == null) r = new SizeRequirements(); if (setCSSSpan(r, axis)) { SizeRequirements parent = super.calculateMajorAxisRequirements(axis, null); int margin = axis == X_AXIS ? getLeftInset() + getRightInset() : getTopInset() + getBottomInset(); r.minimum -= margin; r.preferred -= margin; r.maximum -= margin; constra...
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r) { SizeRequirements sr = super.calculateMajorAxisRequirements(axis, r); // FIXME: adjust it if the CSS width or height attribute is specified // and applicable ...
SizeRequirements sr = super.calculateMinorAxisRequirements(axis, r); return sr;
if (r == null) r = new SizeRequirements(); if (setCSSSpan(r, axis)) { SizeRequirements parent = super.calculateMinorAxisRequirements(axis, null); int margin = axis == X_AXIS ? getLeftInset() + getRightInset() : getTopInset() + getBottomInset(); r.minimum -= margin; r.preferred -= margin; r.maximum -= margin; constra...
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) { SizeRequirements sr = super.calculateMinorAxisRequirements(axis, r); // FIXME: adjust it if the CSS width or height attribute is specified // and applicable. ...
super.layoutMinorAxis(targetSpan, axis, offsets, spans);
int viewCount = getViewCount(); for (int i = 0; i < viewCount; i++) { View view = getView(i); int min = (int) view.getMinimumSpan(axis); int max; Length length = cssSpans[axis]; if (length != null) { min = Math.max((int) length.getValue(targetSpan), min); max = min; } else max = (int) view.getMaximumSpan(axis); if (m...
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { // FIXME: Not implemented. super.layoutMinorAxis(targetSpan, axis, offsets, spans); }
if (axis == getAxis()) return getPreferredSpan(axis);
if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]);
public float getMaximumSpan(int axis) { if (axis == getAxis()) return getPreferredSpan(axis); else return Integer.MAX_VALUE; }
return Integer.MAX_VALUE;
requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum;
public float getMaximumSpan(int axis) { if (axis == getAxis()) return getPreferredSpan(axis); else return Integer.MAX_VALUE; }
validateLayout(axis);
layoutValid[axis] = true;
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targe...
SizeRequirements total = baselineRequirements(axis, null); SizeRequirements.calculateAlignedPositions(targetSpan, total, childReqs, offsets, spans); validateLayout(axis);
SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true;
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. // TODO: This might be an opportunity for perf...
Rectangle bounds = a.getBounds(); if (bounds.width != getWidth() || bounds.height != getHeight()) setSize(bounds.width, bounds.height);
public void paint(Graphics g, Shape a) { // Adjust size if the size is changed. Rectangle bounds = a.getBounds(); if (bounds.width != getWidth() || bounds.height != getHeight()) setSize(bounds.width, bounds.height); Rectangle inside = getInsideAllocation(a); Rectangle copy = new Rectangle(inside)...
int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + length, newSpansX, offset + views.length,
int[] newSpansX = new int[oldSize - length + numViews]; System.arraycopy(spans[X_AXIS], 0, newSpansX, 0, offset); System.arraycopy(spans[X_AXIS], offset + length, newSpansX, offset + numViews,
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
spansX = newSpansX;
spans[X_AXIS] = newSpansX;
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
int[] newSpansY = new int[oldSize - length + views.length]; System.arraycopy(spansY, 0, newSpansY, 0, offset); System.arraycopy(spansY, offset + length, newSpansY, offset + views.length,
int[] newSpansY = new int[oldSize - length + numViews]; System.arraycopy(spans[Y_AXIS], 0, newSpansY, 0, offset); System.arraycopy(spans[Y_AXIS], offset + length, newSpansY, offset + numViews,
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
spansY = newSpansY;
spans[Y_AXIS] = newSpansY;
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
int[] newOffsetsX = new int[oldSize - length + views.length]; System.arraycopy(offsetsX, 0, newOffsetsX, 0, offset); System.arraycopy(offsetsX, offset + length, newOffsetsX, offset + views.length,
int[] newOffsetsX = new int[oldSize - length + numViews]; System.arraycopy(offsets[X_AXIS], 0, newOffsetsX, 0, offset); System.arraycopy(offsets[X_AXIS], offset + length, newOffsetsX, offset + numViews,
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
offsetsX = newOffsetsX;
offsets[X_AXIS] = newOffsetsX;
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
int[] newOffsetsY = new int[oldSize - length + views.length]; System.arraycopy(offsetsY, 0, newOffsetsY, 0, offset); System.arraycopy(offsetsY, offset + length, newOffsetsY, offset + views.length,
int[] newOffsetsY = new int[oldSize - length + numViews]; System.arraycopy(offsets[Y_AXIS], 0, newOffsetsY, 0, offset); System.arraycopy(offsets[Y_AXIS], offset + length, newOffsetsY, offset + numViews,
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
offsetsY = newOffsetsY;
offsets[Y_AXIS] = newOffsetsY;
public void replace(int offset, int length, View[] views) { // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + views.length]; System.arraycopy(spansX, 0, newSpansX, 0, offset); System.arraycopy(spansX, offset + l...
return 0;
float inset; switch (size) { case View.TOP: inset = topInset; break; case View.BOTTOM: inset = bottomInset; break; case View.LEFT: inset = leftInset; break; case View.RIGHT: inset = rightInset; break; default: inset = 0.0F; } return inset;
public float getInset(int size, View v) { // FIXME: Not implemented. return 0; }
throw new AssertionError("BadLocationException must not be thrown "
AssertionError ae; ae = new AssertionError("BadLocationException must not be thrown "
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) { throw new AssertionError("BadLocationException must not be thrown...
ae.initCause(ex); throw ae;
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) { throw new AssertionError("BadLocationException must not be thrown...
throw new AssertionError("BadLocationException should not be "
AssertionError ae; ae = new AssertionError("BadLocationException should not be "
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { throw new AssertionError("BadLocationException should not be " + "thrown here. p0 = " + p0 + "...
ae.initCause(ex); throw ae;
public Segment getText(int p0, int p1) { Segment txt = new Segment(); try { getDocument().getText(p0, p1 - p0, txt); } catch (BadLocationException ex) { throw new AssertionError("BadLocationException should not be " + "thrown here. p0 = " + p0 + "...
public abstract void setText (CharacterIterator newText);
public void setText (String newText) { setText (new StringCharacterIterator (newText)); }
public abstract void setText (CharacterIterator newText);
edits.clear(); elementStack.clear();
private void finishEdit(DefaultDocumentEvent ev) { // This for loop applies all the changes that were made and updates the // DocumentEvent. for (Iterator i = edits.iterator(); i.hasNext();) { Edit edits = (Edit) i.next(); Element[] removed = new Element[edits.removed.siz...
for (int p = 0;
int p; for (p = 0;
protected void insertUpdate(ElementSpec[] data) { // Push the current path to the stack. Element current = root; int index = current.getElementIndex(offset); while (! current.isLeaf()) { Element child = current.getElement(index); int editIndex = child.isLeaf() ? index...
p++) {
p++);
protected void insertUpdate(ElementSpec[] data) { // Push the current path to the stack. Element current = root; int index = current.getElementIndex(offset); while (! current.isLeaf()) { Element child = current.getElement(index); int editIndex = child.isLeaf() ? index...
}
protected void insertUpdate(ElementSpec[] data) { // Push the current path to the stack. Element current = root; int index = current.getElementIndex(offset); while (! current.isLeaf()) { Element child = current.getElement(index); int editIndex = child.isLeaf() ? index...
writeLock();
protected void create(ElementSpec[] data) { writeLock(); try { // Clear content if there is some. int len = getLength(); if (len > 0) remove(0, len); // Now we insert the content. StringBuilder b = new StringBuilder(); for (int i = 0; i < data.length; ++i...
BranchElement createRoot = (BranchElement) createBranchElement(null, null); Element dummyLeaf = createLeafElement(createRoot, null, 0, 1); createRoot.replace(0, 0, new Element[]{ dummyLeaf }); ElementBuffer createBuffer = new ElementBuffer(createRoot); createBuffer.insert(0, b.length(), data, new DefaultDocumentEvent(0...
buffer.create(len, data, ev);
protected void create(ElementSpec[] data) { writeLock(); try { // Clear content if there is some. int len = getLength(); if (len > 0) remove(0, len); // Now we insert the content. StringBuilder b = new StringBuilder(); for (int i = 0; i < data.length; ++i...
root.replace(0, removed.length, added); ev.addEdit(new ElementEdit(root, 0, removed, added));
super.insertUpdate(ev, null);
protected void create(ElementSpec[] data) { writeLock(); try { // Clear content if there is some. int len = getLength(); if (len > 0) remove(0, len); // Now we insert the content. StringBuilder b = new StringBuilder(); for (int i = 0; i < data.length; ++i...
ev.end();
protected void create(ElementSpec[] data) { writeLock(); try { // Clear content if there is some. int len = getLength(); if (len > 0) remove(0, len); // Now we insert the content. StringBuilder b = new StringBuilder(); for (int i = 0; i < data.length; ++i...
UndoableEdit edit = content.insertString(offset,
Content c = getContent(); UndoableEdit edit = c.insertString(offset,
protected void insert(int offset, ElementSpec[] data) throws BadLocationException { if (data == null || data.length == 0) return; try { // writeLock() and writeUnlock() should always be in a try/finally // block so that locking balance is guaranteed even if some // exception ...
super.insertUpdate(ev, null); ev.end();
protected void insert(int offset, ElementSpec[] data) throws BadLocationException { if (data == null || data.length == 0) return; try { // writeLock() and writeUnlock() should always be in a try/finally // block so that locking balance is guaranteed even if some // exception ...
int vLength = value.length(); if (maskLength != vLength) throw new ParseException ("stringToValue passed invalid value", vLength); try { convertValue(value, false); } catch (ParseException pe) { throw new ParseException("stringToValue passed invalid value", pe.getErrorOffset()); } if (!getValueContainsLiteralCh...
return super.stringToValue(convertStringToValue(value));
public Object stringToValue (String value) throws ParseException { int vLength = value.length(); // For value to be a valid it must be the same length as the mask // note this doesn't take into account symbols that occupy more than // one character, this is something we may possibly need to fix. ...
String result = super.valueToString(value); int rLength = result.length(); if (rLength > maskLength) result = result.substring(0, maskLength); result = convertValue(result, true); if (rLength < maskLength) return pad(result, rLength); return result;
String string = value != null ? value.toString() : ""; return convertValueToString(string);
public String valueToString (Object value) throws ParseException { String result = super.valueToString(value); int rLength = result.length(); // If value is longer than the mask, truncate it. Note we may need to // account for symbols that are more than one character long. if (rLength > maskLeng...
return ((1 << getType(ch)) & ((1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER) | (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER) | (1 << OTHER_LETTER))) != 0;
return isLetter((int)ch);
public static boolean isLetter(char ch) { return ((1 << getType(ch)) & ((1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER) | (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER) | (1 << OTHER_LETTER))) != 0; }
throw new CRLException(ioe.toString());
CRLException crle = new CRLException(ioe.getMessage()); crle.initCause (ioe); throw crle;
public CRL engineGenerateCRL(InputStream inStream) throws CRLException { try { return generateCRL(inStream); } catch (IOException ioe) { throw new CRLException(ioe.toString()); } }
throw new CRLException(ioe.toString());
CRLException crle = new CRLException(ioe.getMessage()); crle.initCause (ioe); throw crle;
public Collection engineGenerateCRLs(InputStream inStream) throws CRLException { LinkedList crls = new LinkedList(); while (true) { try { crls.add(generateCRL(inStream)); } catch (EOFException eof) { break; } catch (IOExcept...
throw new CertificateException(ioe.toString());
CertificateException ce = new CertificateException(ioe.getMessage()); ce.initCause (ioe); throw ce;
public Certificate engineGenerateCertificate(InputStream inStream) throws CertificateException { try { return generateCert(inStream); } catch (IOException ioe) { throw new CertificateException(ioe.toString()); } }
throw new CertificateException(ioe.toString());
CertificateException ce = new CertificateException(ioe.getMessage()); ce.initCause (ioe); throw ce;
public Collection engineGenerateCertificates(InputStream inStream) throws CertificateException { LinkedList certs = new LinkedList(); while (true) { try { certs.add(generateCert(inStream)); } catch (EOFException eof) { break; } ...
if (inStream == null) throw new CRLException("missing input stream");
private X509CRL generateCRL(InputStream inStream) throws IOException, CRLException { if (!inStream.markSupported()) inStream = new BufferedInputStream(inStream, 8192); inStream.mark(20); int i = inStream.read(); if (i == -1) throw new EOFException(); // If the input is in binary DER forma...
if (inStream == null) throw new CertificateException("missing input stream");
private X509Certificate generateCert(InputStream inStream) throws IOException, CertificateException { if (!inStream.markSupported()) inStream = new BufferedInputStream(inStream, 8192); inStream.mark(20); int i = inStream.read(); if (i == -1) throw new EOFException(); // If the input is in...
throw new Error("not implemented");
return Math.max(Line2D.ptSegDistSq(x1, y1, x2, y2, cx1, cy1), Line2D.ptSegDistSq(x1, y1, x2, y2, cx2, cy2));
public static double getFlatnessSq(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2) { // XXX Implement. throw new Error("not implemented"); }
private int current;
private int current = 0;
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current < 2; } public voi...
return current < 2;
return current >= 2;
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current < 2; } public voi...
if (current == 0)
int result; switch (current)
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current < 2; } public voi...
if (at != null) at.transform(coords, 0, coords, 0, 1); return SEG_MOVETO; } if (current == 1) {
result = SEG_MOVETO; break; case 1:
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current < 2; } public voi...
return SEG_CUBICTO; } throw new NoSuchElementException("cubic iterator out of bounds");
return result;
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current < 2; } public voi...
if (current == 0)
int result; switch (current)
public int currentSegment(float[] coords) { if (current == 0) { coords[0] = (float) getX1(); coords[1] = (float) getY1(); if (at != null) at.transform(coords, 0, coords, 0, 1); return SEG_MOVETO; } if (current == 1) ...
if (at != null) at.transform(coords, 0, coords, 0, 1); return SEG_MOVETO; } if (current == 1) {
result = SEG_MOVETO; break; case 1:
public int currentSegment(float[] coords) { if (current == 0) { coords[0] = (float) getX1(); coords[1] = (float) getY1(); if (at != null) at.transform(coords, 0, coords, 0, 1); return SEG_MOVETO; } if (current == 1) ...
return SEG_CUBICTO; } throw new NoSuchElementException("cubic iterator out of bounds");
return result;
public int currentSegment(float[] coords) { if (current == 0) { coords[0] = (float) getX1(); coords[1] = (float) getY1(); if (at != null) at.transform(coords, 0, coords, 0, 1); return SEG_MOVETO; } if (current == 1) ...
return current < 2;
return current >= 2;
public boolean isDone() { return current < 2; }
public void subdivide(CubicCurve2D l, CubicCurve2D r)
public void subdivide(CubicCurve2D left, CubicCurve2D right)
public void subdivide(CubicCurve2D l, CubicCurve2D r) { if (l == null) l = new CubicCurve2D.Double(); if (r == null) r = new CubicCurve2D.Double(); // Use empty slots at end to share single array. double[] d = new double[] { getX1(), getY1(), getCtrlX1(), getCtrlY1(), ...
if (l == null) l = new CubicCurve2D.Double(); if (r == null) r = new CubicCurve2D.Double();
public void subdivide(CubicCurve2D l, CubicCurve2D r) { if (l == null) l = new CubicCurve2D.Double(); if (r == null) r = new CubicCurve2D.Double(); // Use empty slots at end to share single array. double[] d = new double[] { getX1(), getY1(), getCtrlX1(), getCtrlY1(), ...
l.setCurve(d, 0); r.setCurve(d, 6);
if (left != null) left.setCurve(d, 0); if (right != null) right.setCurve(d, 6);
public void subdivide(CubicCurve2D l, CubicCurve2D r) { if (l == null) l = new CubicCurve2D.Double(); if (r == null) r = new CubicCurve2D.Double(); // Use empty slots at end to share single array. double[] d = new double[] { getX1(), getY1(), getCtrlX1(), getCtrlY1(), ...
public static int solveQuadratic(double[] eqn, double[] res)
public static int solveQuadratic(double[] eqn)
public static int solveQuadratic(double[] eqn, double[] res) { // Taken from poly/solve_quadratic.c in the GNU Scientific Library // (GSL), cvs revision 1.7 of 2003-07-26. For the original source, // see http://www.gnu.org/software/gsl/ // // Brian Gough, the author of that code, has granted the //...
double a; double b; double c; double disc; c = eqn[0]; b = eqn[1]; a = eqn[2]; if (a == 0) { if (b == 0) return -1; res[0] = -c / b; return 1; } disc = b * b - 4 * a * c; if (disc < 0) return 0; if (disc == 0) { res[0] = -0.5 * b / a; return 1; } if (b == 0) { double r; r = Math.abs(0.5 * Math.sqrt(disc)...
return solveQuadratic(eqn, eqn);
public static int solveQuadratic(double[] eqn, double[] res) { // Taken from poly/solve_quadratic.c in the GNU Scientific Library // (GSL), cvs revision 1.7 of 2003-07-26. For the original source, // see http://www.gnu.org/software/gsl/ // // Brian Gough, the author of that code, has granted the //...
put("Alg.Alias.Signature.RSA", "MD5withRSA");
public Gnu() { super("GNU", 1.0, "GNU provider v1.0 implementing SHA-1, MD5, DSA, RSA, X.509 Certificates and CRLs, PKIX certificate path validators, Collection cert stores, Diffie-Hellman key agreement and key pair generator"); AccessController.doPrivileged (new PrivilegedAction() { public Object run(...
put("Alg.Alias.Signature.RSA", "MD5withRSA");
public Object run() { // Note that all implementation class names are referenced by using // Class.getName(). That way when we staticly link the Gnu provider // we automatically get all the implementation classes. // Signature put("Signature.SHA160withDSS", gnu.java.security.jce...
ORB orb = Restricted_ORB.Singleton;
ORB orb = OrbRestricted.Singleton;
public static TypeCode type() { ORB orb = Restricted_ORB.Singleton; return orb.create_alias_tc(id(), "FieldName", orb.create_string_tc(0)); }
if (b.isSelected() && b.isEnabled())
if (m.isSelected() && m.isEnabled())
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIc...
else if (!b.isSelected() && b.isEnabled())
else if (! m.isSelected() && m.isEnabled())
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIc...
else if (b.isSelected() && !b.isEnabled())
else if (m.isSelected() && ! m.isEnabled())
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIc...
if (b.hasFocus() && b.isFocusPainted() && b.isEnabled())
if (b.hasFocus() && b.isFocusPainted() && m.isEnabled())
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); Icon currentIcon = null; if (b.isSelected() && b.isEnabled()) currentIc...
huffman.tallyDist(strstart - matchStart, matchLen);
boolean full = huffman.tallyDist(strstart - matchStart, matchLen);
private boolean deflateFast(boolean flush, boolean finish) { if (lookahead < MIN_LOOKAHEAD && !flush) return false; while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { /* We are flushing everything */ huffman.flushBlock(window, blockStart, strstart - blockStart, fin...
if (!full)
private boolean deflateFast(boolean flush, boolean finish) { if (lookahead < MIN_LOOKAHEAD && !flush) return false; while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { /* We are flushing everything */ huffman.flushBlock(window, blockStart, strstart - blockStart, fin...
public Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
public final Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
public Point2D getPoint2D (Point2D srcPt, Point2D dstPt) { return transform.transform (srcPt, dstPt); }
Color savedColor = g.getColor(); if (c.isEnabled())
g.translate(x, y); if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme) {
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color savedColor = g.getColor(); if (c.isEnabled()) g.setColor(MetalLookAndFeel.getControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, y, x + w - 1, ...
g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, y, x + w - 1, y); g.drawLine(x, y, x, y + h - 2); g.drawLine(x + 2, y + h - 2, x + w - 1, y + h - 2);
{ g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, 0, w - 1, 0); g.drawLine(0, 0, 0, h - 2); g.drawLine(0, h - 2, w - 1, h - 2); g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 1, w - 1, 1); g.drawLine(1, 1, 1, h - 1); g.drawLine(1, h - 1, w - 1, h - 1);
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color savedColor = g.getColor(); if (c.isEnabled()) g.setColor(MetalLookAndFeel.getControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, y, x + w - 1, ...
g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2); g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.setColor(savedColor);
g.drawLine(1, h - 2, 1, h - 2); } g.translate(-x, -y);
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color savedColor = g.getColor(); if (c.isEnabled()) g.setColor(MetalLookAndFeel.getControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, y, x + w - 1, ...
super();
editor = new JTextField("", 9);
public MetalComboBoxEditor() { super(); editor.setBorder(new MetalComboBoxEditorBorder()); }
os.writeSAR(Register.EBP, 16, 16); os.writeSAR(Register.EBP, 16, 24);
public static void main(String[] args) throws Exception { final X86Stream os = new X86Stream(X86CpuID.createID("pentium4"), 0); final Label label = new Label("label"); os.writeADD(Register.EDX, Register.EAX); os.setObjectRef(label); os.writeNOP(); os.writeLOOP(label); os.writeTEST_AL(0xff); os.writeTEST(R...
SecurityManager sm = Runtime.securityManager;
SecurityManager sm = SecurityManager.current;
public static String setProperty(String key, String value) { SecurityManager sm = Runtime.securityManager; // Be thread-safe. if (sm != null) sm.checkPermission(new PropertyPermission(key, "write")); return (String) properties.setProperty(key, value); }
return (String) properties.setProperty(key, value);
return SystemProperties.setProperty(key, value);
public static String setProperty(String key, String value) { SecurityManager sm = Runtime.securityManager; // Be thread-safe. if (sm != null) sm.checkPermission(new PropertyPermission(key, "write")); return (String) properties.setProperty(key, value); }
public final Class getCategory()
public Class getCategory()
public final Class getCategory() { return JobKOctetsProcessed.class; }
public final String getName()
public String getName()
public final String getName() { return "job-k-octets-processed"; }