rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS);
prng.nextBytes(PS);
public byte[] encode(final byte[] M) { // a. Generate an octet string PS of length k - mLen - 3 consisting // of pseudo-randomly generated nonzero octets. The length of PS // will be at least eight octets. final byte[] PS = new byte[k - M.length - 3]; // FIXME. This should be configurable, somehow. SecureRandom rnd = new SecureRandom (); rnd.nextBytes(PS); int i = 0; for (; i < PS.length; i++) { if (PS[i] == 0) PS[i] = 1; } // b. Concatenate PS, the message M, and other padding to form an // encoded message EM of length k octets as // // EM = 0x00 || 0x02 || PS || 0x00 || M. return assembleEM(PS, M); }
{ new SecureRandom ().nextBytes(buffer);
getDefaultPRNG().nextBytes(buffer);
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
}
private void nextRandomBytes(byte[] buffer) { if (rnd != null) { rnd.nextBytes(buffer); } else { new SecureRandom ().nextBytes(buffer); } }
public BigInteger add(BigInteger val)
private static BigInteger add(int x, int y)
public BigInteger add(BigInteger val) { return add(this, val, 1); }
return add(this, val, 1);
return valueOf((long) x + (long) y);
public BigInteger add(BigInteger val) { return add(this, val, 1); }
public BigInteger divide(BigInteger val)
private static void divide(long x, long y, BigInteger quotient, BigInteger remainder, int rounding_mode)
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
if (val.isZero()) throw new ArithmeticException("divisor is zero");
boolean xNegative, yNegative; if (x < 0) { xNegative = true; if (x == Long.MIN_VALUE) { divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } x = -x; } else xNegative = false;
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize();
if (y < 0) { yNegative = true; if (y == Long.MIN_VALUE) { if (rounding_mode == TRUNCATE) { if (quotient != null) quotient.set(0); if (remainder != null) remainder.set(x); } else divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } y = -y; } else yNegative = false; long q = x / y; long r = x % y; boolean qNegative = xNegative ^ yNegative; boolean add_one = false; if (r != 0) { switch (rounding_mode) { case TRUNCATE: break; case CEILING: case FLOOR: if (qNegative == (rounding_mode == FLOOR)) add_one = true; break; case ROUND: add_one = r > ((y - (q & 1)) >> 1); break; } } if (quotient != null) { if (add_one) q++; if (qNegative) q = -q; quotient.set(q); } if (remainder != null) { if (add_one) { r = y - r; xNegative = ! xNegative; } else { } if (xNegative) r = -r; remainder.set(r); }
public BigInteger divide(BigInteger val) { if (val.isZero()) throw new ArithmeticException("divisor is zero"); BigInteger quot = new BigInteger(); divide(this, val, quot, null, TRUNCATE); return quot.canonicalize(); }
public TransformerException(String msg, Throwable cause)
public TransformerException(String msg)
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
this(msg, null, cause); }
this(msg, null, null); }
public TransformerException(String msg, Throwable cause) { this(msg, null, cause); }
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
childReqs, offsets, spans); layoutValid[axis] = true;
childReqs[axis], offsets, spans);
protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { SizeRequirements[] childReqs = getChildRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) { float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = childReqs[axis][i].preferred - myPrefLeft; prefLeft = Math.max(myPrefLeft, prefLeft); prefRight = Math.max(myPrefRight, prefRight); float myMaxLeft = childReqs[axis][i].maximum * childReqs[axis][i].alignment; float myMaxRight = childReqs[axis][i].maximum - myMaxLeft; maxLeft = Math.max(myMaxLeft, maxLeft); maxRight = Math.max(myMaxRight, maxRight); } int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; return res;
protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred = 0; long maximum = 0; for (int i = 0; i < children.length; i++) { minimum += childReqs[axis][i].minimum; preferred += childReqs[axis][i].preferred; maximum += childReqs[axis][i].maximum; } if (minimum > Integer.MAX_VALUE) minimum = Integer.MAX_VALUE; if (preferred > Integer.MAX_VALUE) preferred = Integer.MAX_VALUE; if (maximum > Integer.MAX_VALUE) maximum = Integer.MAX_VALUE; result.minimum = (int) minimum; result.preferred = (int) preferred; result.maximum = (int) maximum; result.alignment = 0.5F; return result;
protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getTiledSizeRequirements(childReqs); }
SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs);
updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) { float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = childReqs[axis][i].preferred - myPrefLeft; prefLeft = Math.max(myPrefLeft, prefLeft); prefRight = Math.max(myPrefRight, prefRight); float myMaxLeft = childReqs[axis][i].maximum * childReqs[axis][i].alignment; float myMaxRight = childReqs[axis][i].maximum - myMaxLeft; maxLeft = Math.max(myMaxLeft, maxLeft); maxRight = Math.max(myMaxRight, maxRight); } int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; return res;
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { SizeRequirements[] childReqs = getChildRequirements(axis); return SizeRequirements.getAlignedSizeRequirements(childReqs); }
if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]);
updateRequirements(axis);
public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { if (! isLayoutValid(axis)) requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); align = requirements[axis].alignment; } return align; }
if (!isLayoutValid(axis)) {
float max;
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]);
max = getPreferredSpan(axis);
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum;
max = Integer.MAX_VALUE; return max;
public float getMaximumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].maximum; }
if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); }
updateRequirements(axis);
public float getMinimumSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].minimum; }
if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); }
updateRequirements(axis);
public float getPreferredSpan(int axis) { if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); } return requirements[axis].preferred; }
requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis],
layoutValid[minorAxis] = false; span[minorAxis] = newSpan[minorAxis]; layoutMinorAxis(span[minorAxis], minorAxis, offsets[minorAxis],
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
span[myAxis] = newSpan[myAxis];
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis],
layoutValid[myAxis] = false; span[myAxis] = newSpan[myAxis]; layoutMajorAxis(span[myAxis], myAxis, offsets[myAxis],
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout";
if (layoutValid[myAxis] == false) System.err.println("WARNING: Major axis layout must be valid after layout"); if (layoutValid[minorAxis] == false) System.err.println("Minor axis layout must be valid after layout");
protected void layout(int width, int height) { int[] newSpan = new int[]{ width, height }; int count = getViewCount(); // Update minor axis as appropriate. We need to first update the minor // axis layout because that might affect the children's preferences along // the major axis. int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; } // Update major axis as appropriate. if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis]; // Update the child view's sizes. for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; } assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout"; }
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
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(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
SizeRequirements.calculateTiledPositions(targetSpan, null, childReqs,
SizeRequirements.calculateTiledPositions(targetSpan, requirements[axis], childReqs[axis],
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(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
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(targetSpan, null, childReqs, offsets, spans); layoutValid[axis] = true; }
SizeRequirements[] childReqs = getChildRequirements(axis);
updateChildRequirements(axis); updateRequirements(axis);
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. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
childReqs, offsets, spans); layoutValid[axis] = true;
childReqs[axis], offsets, spans);
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. SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs, offsets, spans); layoutValid[axis] = true; }
TableColumnModel cols = table.getColumnModel();
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0;
Point p1 = new Point(clip.x, clip.y); int c0 = table.columnAtPoint(p1); if (c0 == -1) c0 = 0; int r0 = table.rowAtPoint(p1); if (r0 == -1) r0 = 0; Point p2 = new Point(clip.x + clip.width, clip.y + clip.height); int cn = table.columnAtPoint(p2); if (cn == -1) cn = table.getColumnCount() - 1; int rn = table.rowAtPoint(p2); if (rn == -1) rn = table.getRowCount() - 1;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle();
TableColumnModel cmodel = table.getColumnModel(); int [] widths = new int[cn+1]; for (int i = c0; i <=cn ; i++) { widths[i] = cmodel.getColumn(i).getWidth(); } Rectangle bounds = table.getCellRect(r0, c0, false); bounds.height = table.getRowHeight()+table.getRowMargin(); int left = bounds.x; int top = bounds.y; int bottom; int height = bounds.height;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
for (int c = 0; c < ncols && x < xmax; ++c)
Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip))
for (int c = c0; c <= cn; ++c)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
y += height; } x += width;
bounds.y += height; bounds.x = left;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
ymax = y; xmax = x; Color grid = table.getGridColor();
bottom = bounds.y;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
x = x0;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
for (int c = 0; c < ncols && x < xmax; ++c)
int x = left; for (int c = c0; c <= cn; ++c)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax);
gfx.drawLine(x, top, x, bottom); x += widths[c];
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
y = y0;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
for (int r = 0; r < nrows && y < ymax; ++r)
int y = top; for (int r = r0; r <= rn; ++r)
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
gfx.drawLine(x0, y, xmax, y);
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight() + table.getRowMargin(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; Rectangle bounds = new Rectangle(); // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int halfGapWidth = gap.width / 2; int halfGapHeight = gap.height / 2; for (int r = 0; r < nrows && y < ymax; ++r) { bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height; if (bounds.intersects(clip)) { paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); } y += height; } x += width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth(); gfx.drawLine(x, y0, x, ymax); } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); for (int r = 0; r < nrows && y < ymax; ++r) { y += height; gfx.drawLine(x0, y, xmax, y); } gfx.setColor(save); } }
{ x += columnModel.getColumn(i).getWidth(); x += x_gap; }
x += columnModel.getColumn(i).getWidth();
public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) { x += columnModel.getColumn(i).getWidth(); x += x_gap; } if (includeSpacing) return new Rectangle(x, y, width, height); else return new Rectangle(x, y, width - x_gap, height - y_gap); }
bad.minor = Minor.Any;
public static ServantAlreadyActive extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (ServantAlreadyActive) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServantAlreadyActive expected"); bad.initCause(cex); throw bad; } }
builder.emitObject(os, object);
throw new RuntimeException("Unresolved object " + object);
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
} catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex);
public int addressOf32(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final int offset = (int) os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
builder.emitObject(os, object);
throw new RuntimeException("Unresolved object " + object);
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
} catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex);
public long addressOf64(Object object) { final NativeStream.ObjectRef ref = os.getObjectRef(object); try { if (!ref.isResolved()) { builder.emitObject(os, object); } final long offset = os.getBaseAddr() + ref.getOffset(); return offset; } catch (ClassNotFoundException ex) { throw new RuntimeException("Unresolved object ref", ex); } catch (UnresolvedObjectRefException ex) { throw new RuntimeException("Unresolved object ref", ex); } }
if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY))
if (e.getPropertyName().equals("renderer"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
if (e.getPropertyName().equals("dataModel"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); } }
public void setPopupSize(int width, int height)
public void setPopupSize(Dimension size)
public void setPopupSize(int width, int height) { super.setSize(width, height); }
super.setSize(width, height);
super.setSize(size);
public void setPopupSize(int width, int height) { super.setSize(width, height); }
throws NotImplementedException
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
Object[] bindings = (Object[]) SharedUIDefaults.get("MenuBar.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(menuBar, bindings); SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(menuBar, getActionMap());
protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement }
throws NotImplementedException
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null);
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. }
public AbstractAction(String name)
public AbstractAction()
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
this(name, null);
this("");
public AbstractAction(String name) { this(name, null); // TODO: default icon?? }
if (selected)
if (selected && isEnabled())
public void setSelected(boolean selected) { // if this menu selection is true, then activate this menu and // display popup associated with this menu if (selected) { super.setArmed(true); super.setSelected(true); // FIXME: The popup menu should be shown on the screen after certain // number of seconds pass. The 'delay' property of this menu indicates // this amount of seconds. 'delay' property is 0 by default. if (this.isShowing()) { fireMenuSelected(); int x = 0; int y = 0; if (menuLocation == null) { // Calculate correct position of the popup. Note that location of the popup // passed to show() should be relative to the popup's invoker if (isTopLevelMenu()) y = this.getHeight(); else x = this.getWidth(); getPopupMenu().show(this, x, y); } else getPopupMenu().show(this, menuLocation.x, menuLocation.y); } } else { super.setSelected(false); super.setArmed(false); fireMenuDeselected(); popupMenu.setVisible(false); } }
if (this.isShowing())
if (isShowing())
public void setSelected(boolean selected) { // if this menu selection is true, then activate this menu and // display popup associated with this menu if (selected) { super.setArmed(true); super.setSelected(true); // FIXME: The popup menu should be shown on the screen after certain // number of seconds pass. The 'delay' property of this menu indicates // this amount of seconds. 'delay' property is 0 by default. if (this.isShowing()) { fireMenuSelected(); int x = 0; int y = 0; if (menuLocation == null) { // Calculate correct position of the popup. Note that location of the popup // passed to show() should be relative to the popup's invoker if (isTopLevelMenu()) y = this.getHeight(); else x = this.getWidth(); getPopupMenu().show(this, x, y); } else getPopupMenu().show(this, menuLocation.x, menuLocation.y); } } else { super.setSelected(false); super.setArmed(false); fireMenuDeselected(); popupMenu.setVisible(false); } }
add(list, BorderLayout.CENTER);
setLayout(new GridLayout(1, 1)); list.setBorder(new BevelBorder(BevelBorder.LOWERED)); add(list);
public WindowBar() { this.list = new JList(); this.model = new DefaultListModel(); this.wrappers = new HashMap<JInternalFrame, FrameWrapper>(); list.setModel(model); add(list, BorderLayout.CENTER); }
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue)
public void setPrototypeDisplayValue(Object value)
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue) { prototypeDisplayValue = newPrototypeDisplayValue; }
prototypeDisplayValue = newPrototypeDisplayValue;
Object oldValue = prototypeDisplayValue; prototypeDisplayValue = value; firePropertyChange("prototypeDisplayValue", oldValue, value);
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue) { prototypeDisplayValue = newPrototypeDisplayValue; }
public DefaultComboBoxModel(Object[] items)
public DefaultComboBoxModel()
public DefaultComboBoxModel(Object[] items) { list = new Vector(Arrays.asList(items)); }
list = new Vector(Arrays.asList(items));
list = new Vector();
public DefaultComboBoxModel(Object[] items) { list = new Vector(Arrays.asList(items)); }
changeSupport.firePropertyChange(propertyName, new Boolean(oldValue), new Boolean(newValue));
changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, new Boolean(oldValue), new Boolean(newValue)); }
this.propertyListeners = new Hashtable();
this.propertyListeners = new HashMap();
public SwingPropertyChangeSupport(Object source) { super(source); this.source = source; this.listeners = new EventListenerList(); this.propertyListeners = new Hashtable(); }
this.x = (int) x; this.y = (int) y; this.width = (int) width; this.height = (int) height;
this.x = (int) Math.floor(x); this.y = (int) Math.floor(y); this.width = (int) Math.ceil(x + width) - this.x; this.height = (int) Math.ceil(y + height) - this.y;
public void setRect(double x, double y, double width, double height) { this.x = (int) x; this.y = (int) y; this.width = (int) width; this.height = (int) height; }
public PropertyChangeListener[] getPropertyChangeListeners(String property)
public PropertyChangeListener[] getPropertyChangeListeners()
public PropertyChangeListener[] getPropertyChangeListeners(String property) { return changeSupport == null ? new PropertyChangeListener[0] : changeSupport.getPropertyChangeListeners(property); }
: changeSupport.getPropertyChangeListeners(property);
: changeSupport.getPropertyChangeListeners();
public PropertyChangeListener[] getPropertyChangeListeners(String property) { return changeSupport == null ? new PropertyChangeListener[0] : changeSupport.getPropertyChangeListeners(property); }
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName)
public synchronized PropertyChangeListener[] getPropertyChangeListeners()
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount();
List namedListeners = new ArrayList(); Set namedListenerEntries = propertyListeners.entrySet(); Iterator iterator = namedListenerEntries.iterator(); while (iterator.hasNext()) { Map.Entry e = (Map.Entry) iterator.next(); String propertyName = (String) e.getKey(); EventListenerList ell = (EventListenerList) e.getValue(); if (ell != null) { Object[] list = ell.getListenerList(); for (int i = 0; i < list.length; i += 2) { namedListeners.add(new PropertyChangeListenerProxy(propertyName, (PropertyChangeListener) list[i + 1])); } } } int size = listeners.getListenerCount() + namedListeners.size();
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; }
for (int i = 0; i < list.length; i += 2) result[index++] = (PropertyChangeListener) list[i + 1];
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; }
Iterator iterator2 = namedListeners.iterator(); while (iterator2.hasNext()) result[index++] = (PropertyChangeListenerProxy) iterator2.next();
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
g.fillRect(clip.x, clip.y, clip.width, clip.height);
g.fillRect(0, 0, c.getWidth(), c.getHeight());
public void update(Graphics g, JComponent c) { if (c.isOpaque()) { g.setColor(c.getBackground()); Rectangle clip = g.getClipBounds(); g.fillRect(clip.x, clip.y, clip.width, clip.height); } paint(g, c); }
public FileArgument(String name, String description) { super(name, description, SINGLE);
public FileArgument(String name, String description, boolean multi) { super(name, description, multi);
public FileArgument(String name, String description) { super(name, description, SINGLE); }
public void setIndeterminate(boolean newValue)
public void setIndeterminate(boolean flag)
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
if (indeterminate != newValue)
if (indeterminate != flag)
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate);
indeterminate = flag; firePropertyChange("indeterminate", !flag, indeterminate);
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir);
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); height = tr.union(ir).height;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
calcRect.height = fontHeight;
height = fontHeight;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
calcRect.height += insets.top + insets.bottom; return calcRect.height;
height += insets.top + insets.bottom; return height;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir);
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width;
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
calcRect.width += insets.left + insets.right; return calcRect.width;
width += insets.left + insets.right; return width;
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
public Rectangle getTabBounds(JTabbedPane pane, int i)
protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest; }
dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest;
return rects[i];
protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest; }
Insets insets = getInsets(); int w = defaultSize + insets.left + insets.right; int h = defaultSize + insets.top + insets.bottom; return new Dimension(w, h);
return PREFERRED_SIZE;
public Dimension getPreferredSize() { Insets insets = getInsets(); int w = defaultSize + insets.left + insets.right; int h = defaultSize + insets.top + insets.bottom; return new Dimension(w, h); }
if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent())))
if (path == null)
public void expandPath(TreePath path) { // Don't expand if last path component is a leaf node. if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent()))) return; try { fireTreeWillExpand(path); } catch (ExpandVetoException ev) { // We do nothing if attempt has been vetoed. } setExpandedState(path, true); fireTreeExpanded(path); }
setSelectionPath(temp);
revalidate(); repaint();
public void scrollPathToVisible(TreePath path) { if (path == null) return; Object[] oPath = path.getPath(); TreePath temp = new TreePath(oPath[0]); boolean stop = false; int i = 1; while (!stop) { while (isVisible(temp)) if (i < oPath.length) temp = temp.pathByAddingChild(oPath[i++]); else { stop = true; break; } makeVisible(temp); } Rectangle rect = getPathBounds(path); scrollRectToVisible(rect); setSelectionPath(temp); }
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren)
public DefaultTreeModel(TreeNode root)
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) { setRoot(root); this.asksAllowsChildren = asksAllowsChildren; }
this.asksAllowsChildren = asksAllowsChildren;
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) { setRoot(root); this.asksAllowsChildren = asksAllowsChildren; }
protected URLConnection(URL url) { this.url = url; allowUserInteraction = def_allow_user_inter; useCaches = def_use_caches; req_props = new Hashtable(def_req_props); }
protected URLConnection(URL url) { this.url = url; allowUserInteraction = defaultAllowUserInteraction; useCaches = defaultUseCaches; }
protected URLConnection(URL url) { // Set up all our instance variables this.url = url; allowUserInteraction = def_allow_user_inter; useCaches = def_use_caches; req_props = new Hashtable(def_req_props); }
public boolean getAllowUserInteraction() { return (allowUserInteraction);
public boolean getAllowUserInteraction() { return allowUserInteraction;
public boolean getAllowUserInteraction() { return (allowUserInteraction); }
public Object getContent() throws IOException { String type = getContentType();
public Object getContent() throws IOException { if (!connected) connect();
public Object getContent() throws IOException { // connect(); String type = getContentType(); // First try the factory ContentHandler ch = null; if (factory != null) ch = factory.createContentHandler(type); if (ch != null) return (ch.getContent(this)); // Then try our default class try { Class cls = Class.forName("gnu.java.net.content." + type.replace('/', '.')); Object obj = cls.newInstance(); if (!(obj instanceof ContentHandler)) throw new UnknownServiceException(type); ch = (ContentHandler) obj; return (ch.getContent(this)); } catch (ClassNotFoundException e) { // Do nothing } catch (InstantiationException e) { // Do nothing } catch (IllegalAccessException e) { // Do nothing } throw new UnknownServiceException(type); }
ContentHandler ch = null; if (factory != null) ch = factory.createContentHandler(type);
String type = getContentType(); ContentHandler ch = getContentHandler(type);
public Object getContent() throws IOException { // connect(); String type = getContentType(); // First try the factory ContentHandler ch = null; if (factory != null) ch = factory.createContentHandler(type); if (ch != null) return (ch.getContent(this)); // Then try our default class try { Class cls = Class.forName("gnu.java.net.content." + type.replace('/', '.')); Object obj = cls.newInstance(); if (!(obj instanceof ContentHandler)) throw new UnknownServiceException(type); ch = (ContentHandler) obj; return (ch.getContent(this)); } catch (ClassNotFoundException e) { // Do nothing } catch (InstantiationException e) { // Do nothing } catch (IllegalAccessException e) { // Do nothing } throw new UnknownServiceException(type); }
if (ch != null) return (ch.getContent(this));
if (ch != null) return ch.getContent(this);
public Object getContent() throws IOException { // connect(); String type = getContentType(); // First try the factory ContentHandler ch = null; if (factory != null) ch = factory.createContentHandler(type); if (ch != null) return (ch.getContent(this)); // Then try our default class try { Class cls = Class.forName("gnu.java.net.content." + type.replace('/', '.')); Object obj = cls.newInstance(); if (!(obj instanceof ContentHandler)) throw new UnknownServiceException(type); ch = (ContentHandler) obj; return (ch.getContent(this)); } catch (ClassNotFoundException e) { // Do nothing } catch (InstantiationException e) { // Do nothing } catch (IllegalAccessException e) { // Do nothing } throw new UnknownServiceException(type); }
try { Class cls = Class.forName("gnu.java.net.content." + type.replace('/', '.')); Object obj = cls.newInstance(); if (!(obj instanceof ContentHandler)) throw new UnknownServiceException(type); ch = (ContentHandler) obj; return (ch.getContent(this)); } catch (ClassNotFoundException e) { } catch (InstantiationException e) { } catch (IllegalAccessException e) { } throw new UnknownServiceException(type); }
return getInputStream(); }
public Object getContent() throws IOException { // connect(); String type = getContentType(); // First try the factory ContentHandler ch = null; if (factory != null) ch = factory.createContentHandler(type); if (ch != null) return (ch.getContent(this)); // Then try our default class try { Class cls = Class.forName("gnu.java.net.content." + type.replace('/', '.')); Object obj = cls.newInstance(); if (!(obj instanceof ContentHandler)) throw new UnknownServiceException(type); ch = (ContentHandler) obj; return (ch.getContent(this)); } catch (ClassNotFoundException e) { // Do nothing } catch (InstantiationException e) { // Do nothing } catch (IllegalAccessException e) { // Do nothing } throw new UnknownServiceException(type); }
public String getContentEncoding() { return (getHeaderField("content-encoding"));
public String getContentEncoding() { return getHeaderField("content-encoding");
public String getContentEncoding() { return (getHeaderField("content-encoding")); }