rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
buf.setLength(0);
boolean quoteStarted = false; buf.clear();
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') {
if (quoteStarted) { if (c == '\'') quoteStarted = false; else
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) {
index++; continue; } if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); index++; } else if (c == '\'') { quoteStarted = true; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol(), NumberFormat.Field.CURRENCY); index++; } else buf.append(syms.getCurrencySymbol(), NumberFormat.Field.CURRENCY); } else if (c == syms.getPercent()) {
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
buf.append(c); } else if (is_suffix && c == syms.getPerMill()) {
buf.append(c, NumberFormat.Field.PERCENT); } else if (c == syms.getPerMill()) {
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
buf.append(c); } else if (patChars.indexOf(c) != -1) {
buf.append(c, NumberFormat.Field.PERMILLE); } else if (patChars.indexOf(c) != -1) {
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
++index;
index++;
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
if (quoteStarted) throw new IllegalArgumentException ("pattern is lacking a closing quote");
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern.charAt(index + 1) == '\'') { buf.append(c); ++index; } else if (c == '\'' && index + 2 < len && pattern.charAt(index + 2) == '\'') { buf.append(pattern.charAt(index + 1)); index += 2; } else if (c == '\u00a4') { if (index + 1 < len && pattern.charAt(index + 1) == '\u00a4') { buf.append(syms.getInternationalCurrencySymbol()); ++index; } else buf.append(syms.getCurrencySymbol()); } else if (is_suffix && c == syms.getPercent()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 100; buf.append(c); } else if (is_suffix && c == syms.getPerMill()) { if (multiplierSet) throw new IllegalArgumentException("multiplier already set " + "- index: " + index); multiplierSet = true; multiplier = 1000; buf.append(c); } else if (patChars.indexOf(c) != -1) { // This is a pattern character. break; } else buf.append(c); ++index; } return index; }
} else if (c != syms.getExponential() && c != syms.getPatternSeparator() && patChars.indexOf(c) != -1) throw new IllegalArgumentException("unexpected special " + "character - index: " + index);
} else if (c != syms.getExponential() && c != syms.getPatternSeparator() && c != syms.getPercent() && c != syms.getPerMill() && patChars.indexOf(c) != -1) throw new IllegalArgumentException ("unexpected special " + "character - index: " + index);
private final int scanFormat(String pattern, int index, String patChars, DecimalFormatSymbols syms, boolean is_positive) { int max = pattern.length(); int countSinceGroup = 0; int zeroCount = 0; boolean saw_group = false; // // Scan integer part. // while (index < max) { char c = pattern.charAt(index); if (c == syms.getDigit()) { if (zeroCount > 0) throw new IllegalArgumentException("digit mark following " + "zero - index: " + index); ++countSinceGroup; } else if (c == syms.getZeroDigit()) { ++zeroCount; ++countSinceGroup; } else if (c == syms.getGroupingSeparator()) { countSinceGroup = 0; saw_group = true; } else break; ++index; } // We can only side-effect when parsing the positive format. if (is_positive) { groupingUsed = saw_group; groupingSize = (byte) countSinceGroup; minimumIntegerDigits = zeroCount; } // Early termination. if (index == max || pattern.charAt(index) == syms.getGroupingSeparator()) { if (is_positive) decimalSeparatorAlwaysShown = false; return index; } if (pattern.charAt(index) == syms.getDecimalSeparator()) { ++index; // // Scan fractional part. // int hashCount = 0; zeroCount = 0; while (index < max) { char c = pattern.charAt(index); if (c == syms.getZeroDigit()) { if (hashCount > 0) throw new IllegalArgumentException("zero mark " + "following digit - index: " + index); ++zeroCount; } else if (c == syms.getDigit()) { ++hashCount; } else if (c != syms.getExponential() && c != syms.getPatternSeparator() && patChars.indexOf(c) != -1) throw new IllegalArgumentException("unexpected special " + "character - index: " + index); else break; ++index; } if (is_positive) { maximumFractionDigits = hashCount + zeroCount; minimumFractionDigits = zeroCount; } if (index == max) return index; } if (pattern.charAt(index) == syms.getExponential()) { // // Scan exponential format. // zeroCount = 0; ++index; while (index < max) { char c = pattern.charAt(index); if (c == syms.getZeroDigit()) ++zeroCount; else if (c == syms.getDigit()) { if (zeroCount > 0) throw new IllegalArgumentException("digit mark following zero " + "in exponent - index: " + index); } else if (patChars.indexOf(c) != -1) throw new IllegalArgumentException("unexpected special " + "character - index: " + index); else break; ++index; } if (is_positive) { useExponentialNotation = true; minExponentDigits = (byte) zeroCount; } } return index; }
maximumIntegerDigits = groupingSize; groupingSize = 0; if (maximumIntegerDigits > minimumIntegerDigits && maximumIntegerDigits > 0) { minimumIntegerDigits = 1; exponentRound = maximumIntegerDigits; } else exponentRound = 1;
private final int scanFormat(String pattern, int index, String patChars, DecimalFormatSymbols syms, boolean is_positive) { int max = pattern.length(); int countSinceGroup = 0; int zeroCount = 0; boolean saw_group = false; // // Scan integer part. // while (index < max) { char c = pattern.charAt(index); if (c == syms.getDigit()) { if (zeroCount > 0) throw new IllegalArgumentException("digit mark following " + "zero - index: " + index); ++countSinceGroup; } else if (c == syms.getZeroDigit()) { ++zeroCount; ++countSinceGroup; } else if (c == syms.getGroupingSeparator()) { countSinceGroup = 0; saw_group = true; } else break; ++index; } // We can only side-effect when parsing the positive format. if (is_positive) { groupingUsed = saw_group; groupingSize = (byte) countSinceGroup; minimumIntegerDigits = zeroCount; } // Early termination. if (index == max || pattern.charAt(index) == syms.getGroupingSeparator()) { if (is_positive) decimalSeparatorAlwaysShown = false; return index; } if (pattern.charAt(index) == syms.getDecimalSeparator()) { ++index; // // Scan fractional part. // int hashCount = 0; zeroCount = 0; while (index < max) { char c = pattern.charAt(index); if (c == syms.getZeroDigit()) { if (hashCount > 0) throw new IllegalArgumentException("zero mark " + "following digit - index: " + index); ++zeroCount; } else if (c == syms.getDigit()) { ++hashCount; } else if (c != syms.getExponential() && c != syms.getPatternSeparator() && patChars.indexOf(c) != -1) throw new IllegalArgumentException("unexpected special " + "character - index: " + index); else break; ++index; } if (is_positive) { maximumFractionDigits = hashCount + zeroCount; minimumFractionDigits = zeroCount; } if (index == max) return index; } if (pattern.charAt(index) == syms.getExponential()) { // // Scan exponential format. // zeroCount = 0; ++index; while (index < max) { char c = pattern.charAt(index); if (c == syms.getZeroDigit()) ++zeroCount; else if (c == syms.getDigit()) { if (zeroCount > 0) throw new IllegalArgumentException("digit mark following zero " + "in exponent - index: " + index); } else if (patChars.indexOf(c) != -1) throw new IllegalArgumentException("unexpected special " + "character - index: " + index); else break; ++index; } if (is_positive) { useExponentialNotation = true; minExponentDigits = (byte) zeroCount; } } return index; }
public void setMaximumFractionDigits(int newValue) { maximumFractionDigits = Math.min(newValue, 340);
public void setMaximumFractionDigits (int newValue) { super.setMaximumFractionDigits(Math.min(newValue, 340));
public void setMaximumFractionDigits(int newValue) { maximumFractionDigits = Math.min(newValue, 340); }
public void setMaximumIntegerDigits(int newValue) { maximumIntegerDigits = Math.min(newValue, 309);
public void setMaximumIntegerDigits (int newValue) { super.setMaximumIntegerDigits(Math.min(newValue, 309));
public void setMaximumIntegerDigits(int newValue) { maximumIntegerDigits = Math.min(newValue, 309); }
public void setMinimumFractionDigits(int newValue) { minimumFractionDigits = Math.min(newValue, 340);
public void setMinimumFractionDigits (int newValue) { super.setMinimumFractionDigits(Math.min(newValue, 340));
public void setMinimumFractionDigits(int newValue) { minimumFractionDigits = Math.min(newValue, 340); }
public void setMinimumIntegerDigits(int newValue) { minimumIntegerDigits = Math.min(newValue, 309);
public void setMinimumIntegerDigits (int newValue) { super.setMinimumIntegerDigits(Math.min(newValue, 309));
public void setMinimumIntegerDigits(int newValue) { minimumIntegerDigits = Math.min(newValue, 309); }
public DecimalFormatSymbols (Locale loc)
public DecimalFormatSymbols ()
public DecimalFormatSymbols (Locale loc) { ResourceBundle res; try { res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", loc); } catch (MissingResourceException x) { res = null; } currencySymbol = safeGetString (res, "currencySymbol", "$"); decimalSeparator = safeGetChar (res, "decimalSeparator", '.'); digit = safeGetChar (res, "digit", '#'); exponential = safeGetChar (res, "exponential", 'E'); groupingSeparator = safeGetChar (res, "groupingSeparator", ','); infinity = safeGetString (res, "infinity", "\u221e"); // FIXME: default? intlCurrencySymbol = safeGetString (res, "intlCurrencySymbol", "$"); try { monetarySeparator = safeGetChar (res, "monetarySeparator", '.'); } catch (MissingResourceException x) { monetarySeparator = decimalSeparator; } minusSign = safeGetChar (res, "minusSign", '-'); NaN = safeGetString (res, "NaN", "\ufffd"); patternSeparator = safeGetChar (res, "patternSeparator", ';'); percent = safeGetChar (res, "percent", '%'); perMill = safeGetChar (res, "perMill", '\u2030'); zeroDigit = safeGetChar (res, "zeroDigit", '0'); }
ResourceBundle res; try { res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", loc); } catch (MissingResourceException x) { res = null; } currencySymbol = safeGetString (res, "currencySymbol", "$"); decimalSeparator = safeGetChar (res, "decimalSeparator", '.'); digit = safeGetChar (res, "digit", '#'); exponential = safeGetChar (res, "exponential", 'E'); groupingSeparator = safeGetChar (res, "groupingSeparator", ','); infinity = safeGetString (res, "infinity", "\u221e"); intlCurrencySymbol = safeGetString (res, "intlCurrencySymbol", "$"); try { monetarySeparator = safeGetChar (res, "monetarySeparator", '.'); } catch (MissingResourceException x) { monetarySeparator = decimalSeparator; } minusSign = safeGetChar (res, "minusSign", '-'); NaN = safeGetString (res, "NaN", "\ufffd"); patternSeparator = safeGetChar (res, "patternSeparator", ';'); percent = safeGetChar (res, "percent", '%'); perMill = safeGetChar (res, "perMill", '\u2030'); zeroDigit = safeGetChar (res, "zeroDigit", '0');
this (Locale.getDefault());
public DecimalFormatSymbols (Locale loc) { ResourceBundle res; try { res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", loc); } catch (MissingResourceException x) { res = null; } currencySymbol = safeGetString (res, "currencySymbol", "$"); decimalSeparator = safeGetChar (res, "decimalSeparator", '.'); digit = safeGetChar (res, "digit", '#'); exponential = safeGetChar (res, "exponential", 'E'); groupingSeparator = safeGetChar (res, "groupingSeparator", ','); infinity = safeGetString (res, "infinity", "\u221e"); // FIXME: default? intlCurrencySymbol = safeGetString (res, "intlCurrencySymbol", "$"); try { monetarySeparator = safeGetChar (res, "monetarySeparator", '.'); } catch (MissingResourceException x) { monetarySeparator = decimalSeparator; } minusSign = safeGetChar (res, "minusSign", '-'); NaN = safeGetString (res, "NaN", "\ufffd"); patternSeparator = safeGetChar (res, "patternSeparator", ';'); percent = safeGetChar (res, "percent", '%'); perMill = safeGetChar (res, "perMill", '\u2030'); zeroDigit = safeGetChar (res, "zeroDigit", '0'); }
public abstract StringBuffer format (double number, StringBuffer sbuf, FieldPosition pos);
public final String format (long number) { StringBuffer sbuf = new StringBuffer(50); format (number, sbuf, null); return sbuf.toString(); }
public abstract StringBuffer format (double number, StringBuffer sbuf, FieldPosition pos);
public boolean isBorderOpaque();
boolean isBorderOpaque();
public boolean isBorderOpaque();
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height);
void paintBorder(Component c, Graphics g, int x, int y, int width, int height);
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height);
public boolean isLoggable(LogRecord record);
boolean isLoggable(LogRecord record);
public boolean isLoggable(LogRecord record);
synchronized (ErrorManager.class)
synchronized (this)
public void error(String message, Exception ex, int errorCode) { if (everUsed) return; synchronized (ErrorManager.class) { /* The double check is intentional. If the first check was * omitted, the monitor would have to be entered every time * error() method was called. If the second check was * omitted, the code below could be executed by multiple * threads simultaneously. */ if (everUsed) return; everUsed = true; } String codeMsg; switch (errorCode) { case GENERIC_FAILURE: codeMsg = "GENERIC_FAILURE"; break; case WRITE_FAILURE: codeMsg = "WRITE_FAILURE"; break; case FLUSH_FAILURE: codeMsg = "FLUSH_FAILURE"; break; case CLOSE_FAILURE: codeMsg = "CLOSE_FAILURE"; break; case OPEN_FAILURE: codeMsg = "OPEN_FAILURE"; break; case FORMAT_FAILURE: codeMsg = "FORMAT_FAILURE"; break; default: codeMsg = String.valueOf(errorCode); break; } System.err.println("Error upon logging: " + codeMsg); if ((message != null) && (message.length() > 0)) System.err.println(message); if (ex != null) ex.printStackTrace(); }
* * This is the 'double-checked locking' idiom, which is broken * with the current version of the Java memory model. However, * we assume that JVMs will have adopted a revised version of * the Java Memory Model by the time GNU Classpath gains * widespread acceptance. See Classpath bug #2944.
public void error(String message, Exception ex, int errorCode) { if (everUsed) return; synchronized (ErrorManager.class) { /* The double check is intentional. If the first check was * omitted, the monitor would have to be entered every time * error() method was called. If the second check was * omitted, the code below could be executed by multiple * threads simultaneously. */ if (everUsed) return; everUsed = true; } String codeMsg; switch (errorCode) { case GENERIC_FAILURE: codeMsg = "GENERIC_FAILURE"; break; case WRITE_FAILURE: codeMsg = "WRITE_FAILURE"; break; case FLUSH_FAILURE: codeMsg = "FLUSH_FAILURE"; break; case CLOSE_FAILURE: codeMsg = "CLOSE_FAILURE"; break; case OPEN_FAILURE: codeMsg = "OPEN_FAILURE"; break; case FORMAT_FAILURE: codeMsg = "FORMAT_FAILURE"; break; default: codeMsg = String.valueOf(errorCode); break; } System.err.println("Error upon logging: " + codeMsg); if ((message != null) && (message.length() > 0)) System.err.println(message); if (ex != null) ex.printStackTrace(); }
if (alignment < BOTTOM_ALIGNMENT || alignment > HANGING_BASELINE) throw new IllegalArgumentException("Invalid alignment");
protected GraphicAttribute (int alignment) { this.alignment = alignment; }
public Rectangle2D getBounds () throws NotImplementedException
public Rectangle2D getBounds()
public Rectangle2D getBounds () throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
float asc = getAscent(); return new Rectangle2D.Float(0, - asc, getAdvance(), asc + getDescent());
public Rectangle2D getBounds () throws NotImplementedException { throw new Error ("not implemented"); }
return getPreferredSize(c);
return maxSize;
public Dimension getMaximumSize(JComponent c) { return getPreferredSize(c); }
return getPreferredSize(c);
return minSize;
public Dimension getMinimumSize(JComponent c) { return getPreferredSize(c); }
Dimension dims = new Dimension(0, 0); Insets insets = c.getInsets();
Dimension pref = verticalPrefSize;
public Dimension getPreferredSize(JComponent c) { Dimension dims = new Dimension(0, 0); Insets insets = c.getInsets(); if (c instanceof JSeparator) { JSeparator s = (JSeparator) c; if (s.getOrientation() == JSeparator.HORIZONTAL) { dims.height = 2; dims.width = 40; } else { dims.width = 2; dims.height = 40; } } dims.width += insets.left + insets.right; dims.height += insets.top + insets.bottom; return dims; }
{ dims.height = 2; dims.width = 40; } else { dims.width = 2; dims.height = 40; }
pref = horizontalPrefSize;
public Dimension getPreferredSize(JComponent c) { Dimension dims = new Dimension(0, 0); Insets insets = c.getInsets(); if (c instanceof JSeparator) { JSeparator s = (JSeparator) c; if (s.getOrientation() == JSeparator.HORIZONTAL) { dims.height = 2; dims.width = 40; } else { dims.width = 2; dims.height = 40; } } dims.width += insets.left + insets.right; dims.height += insets.top + insets.bottom; return dims; }
dims.width += insets.left + insets.right; dims.height += insets.top + insets.bottom; return dims;
return pref;
public Dimension getPreferredSize(JComponent c) { Dimension dims = new Dimension(0, 0); Insets insets = c.getInsets(); if (c instanceof JSeparator) { JSeparator s = (JSeparator) c; if (s.getOrientation() == JSeparator.HORIZONTAL) { dims.height = 2; dims.width = 40; } else { dims.width = 2; dims.height = 40; } } dims.width += insets.left + insets.right; dims.height += insets.top + insets.bottom; return dims; }
int midAB = r.width / 2 + r.x; int midAD = r.height / 2 + r.y;
public void paint(Graphics g, JComponent c) { Rectangle r = new Rectangle(); SwingUtilities.calculateInnerArea(c, r); Color saved = g.getColor(); int midAB = r.width / 2 + r.x; int midAD = r.height / 2 + r.y; JSeparator s; if (c instanceof JSeparator) s = (JSeparator) c; else return; if (s.getOrientation() == JSeparator.HORIZONTAL) { g.setColor(highlight); g.drawLine(r.x, midAD, r.x + r.width, midAD); g.setColor(shadow); g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1); } else { g.setColor(highlight); g.drawLine(midAB, r.y, midAB, r.y + r.height); g.setColor(shadow); g.drawLine(midAB + 1, r.y, midAB + 1, r.y + r.height); } }
{ g.setColor(highlight); g.drawLine(r.x, midAD, r.x + r.width, midAD); g.setColor(shadow); g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1); } else { g.setColor(highlight); g.drawLine(midAB, r.y, midAB, r.y + r.height); g.setColor(shadow); g.drawLine(midAB + 1, r.y, midAB + 1, r.y + r.height); }
{ int midAB = r.height / 2; g.setColor(shadow); g.drawLine(r.x, r.y + midAB - 1, r.x + r.width, r.y + midAB - 1); g.setColor(highlight); g.fillRect(r.x, r.y + midAB, r.x + r.width, r.y + midAB); } else { int midAD = r.height / 2 + r.y; g.setColor(shadow); g.drawLine(r.x, r.y, r.x, r.y + r.height); g.setColor(highlight); g.fillRect(r.x + midAD, r.y + r.height, r.x + midAD, r.y + r.height); } g.setColor(saved);
public void paint(Graphics g, JComponent c) { Rectangle r = new Rectangle(); SwingUtilities.calculateInnerArea(c, r); Color saved = g.getColor(); int midAB = r.width / 2 + r.x; int midAD = r.height / 2 + r.y; JSeparator s; if (c instanceof JSeparator) s = (JSeparator) c; else return; if (s.getOrientation() == JSeparator.HORIZONTAL) { g.setColor(highlight); g.drawLine(r.x, midAD, r.x + r.width, midAD); g.setColor(shadow); g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1); } else { g.setColor(highlight); g.drawLine(midAB, r.y, midAB, r.y + r.height); g.setColor(shadow); g.drawLine(midAB + 1, r.y, midAB + 1, r.y + r.height); } }
public TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath,
public TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath,
public TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) { super(source); this.paths = new TreePath[]{path}; this.areNew = new boolean[]{isNew}; this.oldLeadSelectionPath = oldLeadSelectionPath; this.newLeadSelectionPath = newLeadSelectionPath; } // TreeSelectionEvent()
this.paths = new TreePath[]{path}; this.areNew = new boolean[]{isNew};
this.paths = paths; this.areNew = areNew;
public TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) { super(source); this.paths = new TreePath[]{path}; this.areNew = new boolean[]{isNew}; this.oldLeadSelectionPath = oldLeadSelectionPath; this.newLeadSelectionPath = newLeadSelectionPath; } // TreeSelectionEvent()
if (treepath.length != path.length) {
if (treepath.length != path.length)
public boolean equals(Object object) { // Variables Object[] treepath; int index; // Check for TreePath if (object instanceof TreePath) { // Get Path Elements treepath = ((TreePath) object).getPath(); // Check length if (treepath.length != path.length) { return false; } // if // Check Elements for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) { return false; } // if } // for // Tree Path's are equals return true; } // if // Unequal return false; } // equals()
}
public boolean equals(Object object) { // Variables Object[] treepath; int index; // Check for TreePath if (object instanceof TreePath) { // Get Path Elements treepath = ((TreePath) object).getPath(); // Check length if (treepath.length != path.length) { return false; } // if // Check Elements for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) { return false; } // if } // for // Tree Path's are equals return true; } // if // Unequal return false; } // equals()
for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) {
for (index = 0; index < path.length; index++) { if (treepath[index] != path[index])
public boolean equals(Object object) { // Variables Object[] treepath; int index; // Check for TreePath if (object instanceof TreePath) { // Get Path Elements treepath = ((TreePath) object).getPath(); // Check length if (treepath.length != path.length) { return false; } // if // Check Elements for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) { return false; } // if } // for // Tree Path's are equals return true; } // if // Unequal return false; } // equals()
} }
}
public boolean equals(Object object) { // Variables Object[] treepath; int index; // Check for TreePath if (object instanceof TreePath) { // Get Path Elements treepath = ((TreePath) object).getPath(); // Check length if (treepath.length != path.length) { return false; } // if // Check Elements for (index = 0; index < path.length; index++) { if (treepath[index] != path[index]) { return false; } // if } // for // Tree Path's are equals return true; } // if // Unequal return false; } // equals()
boolean empty = sbuf.length() == 0;
public String getHostAddress() { StringBuffer sbuf = new StringBuffer(40); for (int i = 0; i < 16; i += 2) { int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); boolean empty = sbuf.length() == 0; if (empty) { if (i > 0) sbuf.append("::"); } else sbuf.append(':'); if (x != 0 || i >= 14) sbuf.append(Integer.toHexString(x)); } return sbuf.toString(); }
if (empty) {
public String getHostAddress() { StringBuffer sbuf = new StringBuffer(40); for (int i = 0; i < 16; i += 2) { int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); boolean empty = sbuf.length() == 0; if (empty) { if (i > 0) sbuf.append("::"); } else sbuf.append(':'); if (x != 0 || i >= 14) sbuf.append(Integer.toHexString(x)); } return sbuf.toString(); }
sbuf.append("::"); } else
public String getHostAddress() { StringBuffer sbuf = new StringBuffer(40); for (int i = 0; i < 16; i += 2) { int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); boolean empty = sbuf.length() == 0; if (empty) { if (i > 0) sbuf.append("::"); } else sbuf.append(':'); if (x != 0 || i >= 14) sbuf.append(Integer.toHexString(x)); } return sbuf.toString(); }
if (x != 0 || i >= 14)
public String getHostAddress() { StringBuffer sbuf = new StringBuffer(40); for (int i = 0; i < 16; i += 2) { int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); boolean empty = sbuf.length() == 0; if (empty) { if (i > 0) sbuf.append("::"); } else sbuf.append(':'); if (x != 0 || i >= 14) sbuf.append(Integer.toHexString(x)); } return sbuf.toString(); }
public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata)
public IIOImage (Raster raster, List thumbnails, IIOMetadata metadata)
public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata) { if (image == null) throw new IllegalArgumentException ("image may not be null"); this.image = image; this.thumbnails = thumbnails; this.metadata = metadata; }
if (image == null) throw new IllegalArgumentException ("image may not be null");
if (raster == null) throw new IllegalArgumentException ("raster may not be null");
public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata) { if (image == null) throw new IllegalArgumentException ("image may not be null"); this.image = image; this.thumbnails = thumbnails; this.metadata = metadata; }
this.image = image;
this.raster = raster;
public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata) { if (image == null) throw new IllegalArgumentException ("image may not be null"); this.image = image; this.thumbnails = thumbnails; this.metadata = metadata; }
return thumbnails.size();
return thumbnails == null ? 0 : thumbnails.size();
public int getNumThumbnails() { return thumbnails.size(); }
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public void appendData(String arg) { if (isReadonly()) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } String value = text + arg; mutating(value); text = value; }
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public void deleteData(int offset, int count) { if (isReadonly()) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); if (offset < 0 || count < 0 || offset > raw.length) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { count = raw.length - offset; } if (count == 0) { return; } try { char[] buf = new char[raw.length - count]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(raw, offset + count, buf, offset, raw.length - (offset + count)); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx(DomEx.INDEX_SIZE_ERR);
throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
public void deleteData(int offset, int count) { if (isReadonly()) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); if (offset < 0 || count < 0 || offset > raw.length) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { count = raw.length - offset; } if (count == 0) { return; } try { char[] buf = new char[raw.length - count]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(raw, offset + count, buf, offset, raw.length - (offset + count)); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public void insertData(int offset, String arg) { if (isReadonly()) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); char[] tmp = arg.toCharArray (); char[] buf = new char[raw.length + tmp.length]; try { System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(tmp, 0, buf, offset, tmp.length); System.arraycopy(raw, offset, buf, offset + tmp.length, raw.length - offset); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx(DomEx.INDEX_SIZE_ERR);
throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
public void insertData(int offset, String arg) { if (isReadonly()) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); char[] tmp = arg.toCharArray (); char[] buf = new char[raw.length + tmp.length]; try { System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(tmp, 0, buf, offset, tmp.length); System.arraycopy(raw, offset, buf, offset + tmp.length, raw.length - offset); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public void replaceData(int offset, int count, String arg) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); // deleteData if (offset < 0 || count < 0 || offset > raw.length) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { count = raw.length - offset; } try { char[] buf = new char[raw.length - count]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(raw, offset + count, buf, offset, raw.length - (offset + count)); // insertData char[] tmp = arg.toCharArray (); char[] buf2 = new char[buf.length + tmp.length]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(tmp, 0, buf, offset, tmp.length); System.arraycopy(raw, offset, buf, offset + tmp.length, raw.length - offset); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx(DomEx.INDEX_SIZE_ERR);
throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
public void replaceData(int offset, int count, String arg) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); // deleteData if (offset < 0 || count < 0 || offset > raw.length) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { count = raw.length - offset; } try { char[] buf = new char[raw.length - count]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(raw, offset + count, buf, offset, raw.length - (offset + count)); // insertData char[] tmp = arg.toCharArray (); char[] buf2 = new char[buf.length + tmp.length]; System.arraycopy(raw, 0, buf, 0, offset); System.arraycopy(tmp, 0, buf, offset, tmp.length); System.arraycopy(raw, offset, buf, offset + tmp.length, raw.length - offset); String value = new String(buf); mutating(value); text = value; } catch (IndexOutOfBoundsException x) { throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public void setNodeValue(String value) { if (isReadonly()) { throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (value == null) { value = ""; } mutating(value); text = value; }
throw new DomEx(DomEx.INDEX_SIZE_ERR);
throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
public String substringData(int offset, int count) { try { return text.substring(offset, count); } catch (StringIndexOutOfBoundsException e) { if (offset >= 0 && count >= 0 && offset < text.length()) { return text.substring(offset); } throw new DomEx(DomEx.INDEX_SIZE_ERR); } }
public RemoteException(String s)
public RemoteException()
public RemoteException(String s) { this(s, null); }
this(s, null);
this(null, null);
public RemoteException(String s) { this(s, null); }
public InetSocketAddress(String hostname, int port)
public InetSocketAddress(InetAddress addr, int port)
public InetSocketAddress(String hostname, int port) throws IllegalArgumentException { if (port < 0 || port > 65535) throw new IllegalArgumentException(); this.port = port; this.hostname = hostname; try { this.addr = InetAddress.getByName(hostname); } catch (Exception e) // UnknownHostException, SecurityException { this.addr = null; } }
throw new IllegalArgumentException();
throw new IllegalArgumentException("Bad port number: " + port);
public InetSocketAddress(String hostname, int port) throws IllegalArgumentException { if (port < 0 || port > 65535) throw new IllegalArgumentException(); this.port = port; this.hostname = hostname; try { this.addr = InetAddress.getByName(hostname); } catch (Exception e) // UnknownHostException, SecurityException { this.addr = null; } }
this.hostname = hostname; try { this.addr = InetAddress.getByName(hostname); } catch (Exception e) { this.addr = null; }
this.hostname = addr.getHostName();
public InetSocketAddress(String hostname, int port) throws IllegalArgumentException { if (port < 0 || port > 65535) throw new IllegalArgumentException(); this.port = port; this.hostname = hostname; try { this.addr = InetAddress.getByName(hostname); } catch (Exception e) // UnknownHostException, SecurityException { this.addr = null; } }
public ProtocolException(String message)
public ProtocolException()
public ProtocolException(String message) { super(message); }
super(message);
public ProtocolException(String message) { super(message); }
ForEachNode(TemplateNode children, TemplateNode next, Expr select, List sortKeys)
ForEachNode(Expr select, List sortKeys)
ForEachNode(TemplateNode children, TemplateNode next, Expr select, List sortKeys) { super(children, next); this.select = select; this.sortKeys = sortKeys; }
super(children, next);
ForEachNode(TemplateNode children, TemplateNode next, Expr select, List sortKeys) { super(children, next); this.select = select; this.sortKeys = sortKeys; }
return new ForEachNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet),
TemplateNode ret = new ForEachNode(select.clone(stylesheet),
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) { sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); } return new ForEachNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), sortKeys2); }
if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) { sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); } return new ForEachNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), sortKeys2); }
public Component getListCellRendererComponent(JList list,
Component getListCellRendererComponent(JList list,
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus);
public Component getEditorComponent();
Component getEditorComponent();
public Component getEditorComponent();
public void addItemListener(ItemListener value0) { }
public void addItemListener(ItemListener listener) { listenerList.add (ItemListener.class, listener); }
public void addItemListener(ItemListener value0) { // TODO } // addItemListener()
public void setItem(Object item);
void setItem(Object item);
public void setItem(Object item);
public void removeItemListener(ItemListener value0) { }
public void removeItemListener(ItemListener listener) { listenerList.remove (ItemListener.class, listener); }
public void removeItemListener(ItemListener value0) { // TODO } // removeItemListener()
public Set getAllFonts() { if(fontsByName.size() == 0) { TTFFontData fontData; try { fontData = new TTFFontDataFile(this.getClass().getClassLoader().getResource("/" + "luxisr.ttf")); TTFFont font = new TTFFont(fontData,10 ); fontsByName.put(font.getName(),font); } catch (IOException e) { throw new RuntimeException(e); }
public Set getAllFonts() { if (!fontsLoaded) { loadFonts();
public Set getAllFonts() { if(fontsByName.size() == 0) { // load the luxisr.ttf TTFFontData fontData; try { fontData = new TTFFontDataFile(this.getClass().getClassLoader().getResource("/" + "luxisr.ttf")); TTFFont font = new TTFFont(fontData,10 ); fontsByName.put(font.getName(),font); } catch (IOException e) { throw new RuntimeException(e); } } return new HashSet(fontsByName.values()); }
private TTFFontData getFontData(Font font) { if(font instanceof TTFFont) return ((TTFFont)font).getFontData();
private TTFFontData getFontData(Font font) { if (font instanceof TTFFont) { return ((TTFFont) font).getFontData(); }
private TTFFontData getFontData(Font font) { if(font instanceof TTFFont) return ((TTFFont)font).getFontData(); return null; }
final Font f = (Font)fontsByName.get(font.getFamily());
if (!fontsLoaded) { loadFonts(); } final Font f = (Font) fontsByName.get(font.getFamily());
public boolean provides(Font font) { final Font f = (Font)fontsByName.get(font.getFamily()); return (f != null); }
public boolean isLoggable(LogRecord record) { if (record.getLevel().intValue() < level.intValue())
public boolean isLoggable(LogRecord record) { if (record.getLevel().intValue() <= level.intValue())
public boolean isLoggable(LogRecord record) { if (record.getLevel().intValue() < level.intValue()) return false; if (filter != null) return filter.isLoggable(record); else return true; }
final int ascent = hheadTable.getAscent();
final double ascent = hheadTable.getAscent();
public void render(Graphics2D g, String text, int x, int y) { try { final GeneralPath gp = new GeneralPath(); gp.moveTo(x, y); final TTFGlyphTable glyphTable = fontData.getGlyphTable(); final TTFCMapTable cmapTable = fontData.getCMapTable(); final TTFHorizontalHeaderTable hheadTable = fontData.getHorizontalHeaderTable(); final TTFHorizontalMetricsTable hmTable = fontData.getHorizontalMetricsTable(); if (!(cmapTable.getNrEncodingTables() > 0)) { throw new RuntimeException("No Encoding is found!"); } final TTFCMapTable.EncodingTable encTable = cmapTable.getEncodingTable(0); if (encTable.getTableFormat() == null) { throw new RuntimeException("The table is NUll!!"); } final int ascent = hheadTable.getAscent(); final AffineTransform tx = new AffineTransform(); final double scale = fontSize / ascent; tx.translate(x, y + fontSize); //System.out.println("Scale=" + scale); tx.scale(scale, -scale); tx.translate(0, ascent); for (int i = 0; i < text.length(); i++) { // get the index for the needed glyph int index = encTable.getTableFormat().getGlyphIndex(text.charAt(i)); Shape shape = glyphTable.getGlyph(index).getShape(); gp.append(shape.getPathIterator(tx), false); tx.translate(hmTable.getAdvanceWidth(index), 0); } //System.out.println("Drawing string..." + gp + ", bounds " + gp.getBounds()); g.draw(gp); } catch (IOException ex) { log.error("Error drawing text", ex); } }
int index = encTable.getTableFormat().getGlyphIndex(text.charAt(i));
final int index = encTable.getTableFormat().getGlyphIndex(text.charAt(i));
public void render(Graphics2D g, String text, int x, int y) { try { final GeneralPath gp = new GeneralPath(); gp.moveTo(x, y); final TTFGlyphTable glyphTable = fontData.getGlyphTable(); final TTFCMapTable cmapTable = fontData.getCMapTable(); final TTFHorizontalHeaderTable hheadTable = fontData.getHorizontalHeaderTable(); final TTFHorizontalMetricsTable hmTable = fontData.getHorizontalMetricsTable(); if (!(cmapTable.getNrEncodingTables() > 0)) { throw new RuntimeException("No Encoding is found!"); } final TTFCMapTable.EncodingTable encTable = cmapTable.getEncodingTable(0); if (encTable.getTableFormat() == null) { throw new RuntimeException("The table is NUll!!"); } final int ascent = hheadTable.getAscent(); final AffineTransform tx = new AffineTransform(); final double scale = fontSize / ascent; tx.translate(x, y + fontSize); //System.out.println("Scale=" + scale); tx.scale(scale, -scale); tx.translate(0, ascent); for (int i = 0; i < text.length(); i++) { // get the index for the needed glyph int index = encTable.getTableFormat().getGlyphIndex(text.charAt(i)); Shape shape = glyphTable.getGlyph(index).getShape(); gp.append(shape.getPathIterator(tx), false); tx.translate(hmTable.getAdvanceWidth(index), 0); } //System.out.println("Drawing string..." + gp + ", bounds " + gp.getBounds()); g.draw(gp); } catch (IOException ex) { log.error("Error drawing text", ex); } }
public SQLWarning(String message, String SQLState)
public SQLWarning(String reason, String SQLState, int vendorCode)
public SQLWarning(String message, String SQLState) { super(message, SQLState); }
super(message, SQLState);
super(reason, SQLState, vendorCode);
public SQLWarning(String message, String SQLState) { super(message, SQLState); }
public BigInteger(byte[] val)
private BigInteger()
public BigInteger(byte[] val) { if (val == null || val.length < 1) throw new NumberFormatException(); words = byteArrayToIntArray(val, val[0] < 0 ? -1 : 0); BigInteger result = make(words, words.length); this.ival = result.ival; this.words = result.words; }
if (val == null || val.length < 1) throw new NumberFormatException(); words = byteArrayToIntArray(val, val[0] < 0 ? -1 : 0); BigInteger result = make(words, words.length); this.ival = result.ival; this.words = result.words;
public BigInteger(byte[] val) { if (val == null || val.length < 1) throw new NumberFormatException(); words = byteArrayToIntArray(val, val[0] < 0 ? -1 : 0); BigInteger result = make(words, words.length); this.ival = result.ival; this.words = result.words; }
public String toString(int radix)
public String toString()
public String toString(int radix) { if (words == null) return Integer.toString(ival, radix); if (ival <= 2) return Long.toString(longValue(), radix); int buf_size = ival * (MPN.chars_per_word(radix) + 1); StringBuffer buffer = new StringBuffer(buf_size); format(radix, buffer); return buffer.toString(); }
if (words == null) return Integer.toString(ival, radix); if (ival <= 2) return Long.toString(longValue(), radix); int buf_size = ival * (MPN.chars_per_word(radix) + 1); StringBuffer buffer = new StringBuffer(buf_size); format(radix, buffer); return buffer.toString();
return toString(10);
public String toString(int radix) { if (words == null) return Integer.toString(ival, radix); if (ival <= 2) return Long.toString(longValue(), radix); int buf_size = ival * (MPN.chars_per_word(radix) + 1); StringBuffer buffer = new StringBuffer(buf_size); format(radix, buffer); return buffer.toString(); }
tokens = new Vector();
tokens = new ArrayList();
public SimpleDateFormat() { /* * There does not appear to be a standard API for determining * what the default pattern for a locale is, so use package-scope * variables in DateFormatSymbols to encapsulate this. */ super(); Locale locale = Locale.getDefault(); calendar = new GregorianCalendar(locale); computeCenturyStart(); tokens = new Vector(); formatData = new DateFormatSymbols(locale); pattern = (formatData.dateFormats[DEFAULT] + ' ' + formatData.timeFormats[DEFAULT]); compileFormat(pattern); numberFormat = NumberFormat.getInstance(locale); numberFormat.setGroupingUsed (false); }
numberFormat.setParseIntegerOnly (true); numberFormat.setMaximumFractionDigits (0);
public SimpleDateFormat() { /* * There does not appear to be a standard API for determining * what the default pattern for a locale is, so use package-scope * variables in DateFormatSymbols to encapsulate this. */ super(); Locale locale = Locale.getDefault(); calendar = new GregorianCalendar(locale); computeCenturyStart(); tokens = new Vector(); formatData = new DateFormatSymbols(locale); pattern = (formatData.dateFormats[DEFAULT] + ' ' + formatData.timeFormats[DEFAULT]); compileFormat(pattern); numberFormat = NumberFormat.getInstance(locale); numberFormat.setGroupingUsed (false); }
public final String format (Date date)
public final StringBuffer format (Object obj, StringBuffer buf, FieldPosition pos)
public final String format (Date date) { StringBuffer sb = new StringBuffer (); format (date, sb, new FieldPosition (MONTH_FIELD)); return sb.toString(); }
StringBuffer sb = new StringBuffer (); format (date, sb, new FieldPosition (MONTH_FIELD)); return sb.toString();
if (obj instanceof Number) obj = new Date(((Number) obj).longValue()); else if (! (obj instanceof Date)) throw new IllegalArgumentException ("Cannot format given Object as a Date"); return format ((Date) obj, buf, pos);
public final String format (Date date) { StringBuffer sb = new StringBuffer (); format (date, sb, new FieldPosition (MONTH_FIELD)); return sb.toString(); }
namespaceDeclUris = false;
public void reset () { contexts = new Context[32]; contextPos = 0; contexts[contextPos] = currentContext = new Context(); currentContext.declarePrefix("xml", XMLNS); }
public void beginDraggingFrame(JComponent frame);
void beginDraggingFrame(JComponent frame);
public void beginDraggingFrame(JComponent frame);
public void endDraggingFrame(JComponent frame);
void endDraggingFrame(JComponent frame);
public void endDraggingFrame(JComponent frame);
public void dragFrame(JComponent frame, int x, int y);
void dragFrame(JComponent frame, int x, int y);
public void dragFrame(JComponent frame, int x, int y);
public void setHorizontalAlignment(int alignment) { hori_align = alignment; }
public void setHorizontalAlignment(int a) { int old = hori_align; hori_align = a; if (old != a) { firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, old, a); revalidate(); repaint(); } }
public void setHorizontalAlignment(int alignment) { hori_align = alignment; }
public void setHorizontalTextPosition(int textPosition) { hori_text_pos = textPosition; }
public void setHorizontalTextPosition(int t) { int old = hori_text_pos; hori_text_pos = t; if (old != t) { firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, old, t); revalidate(); repaint(); } }
public void setHorizontalTextPosition(int textPosition) { hori_text_pos = textPosition; }
public void setText(String text) { this.text = text; revalidate(); repaint(); }
public void setText(String t) { String old = text; text = t; if (t != old) { firePropertyChange(TEXT_CHANGED_PROPERTY, old, t); revalidate(); repaint(); } }
public void setText(String text) { this.text = text; revalidate(); repaint(); }
return null;
float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < children.length; i++) { float myMinLeft = children[i].minimum * children[i].alignment; float myMinRight = children[i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = children[i].preferred * children[i].alignment; float myPrefRight = children[i].preferred - myMinLeft; prefLeft = Math.max(myPrefLeft, prefLeft); prefRight = Math.max(myPrefRight, prefRight); float myMaxLeft = children[i].maximum * children[i].alignment; float myMaxRight = children[i].maximum - myMinLeft; 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); return new SizeRequirements(minSize, prefSize, maxSize, 0.5F);
getAlignedSizeRequirements(SizeRequirements[] children) { return null; // TODO }
return new ApplyImportsNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet));
TemplateNode ret = new ApplyImportsNode(); if (children != null) { ret.children = children.clone(stylesheet);
TemplateNode clone(Stylesheet stylesheet) { return new ApplyImportsNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet)); }
if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
TemplateNode clone(Stylesheet stylesheet) { return new ApplyImportsNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet)); }
throw new IOException("BlockDeviceAPI not found on parent device", ex);
final IOException ioe = new IOException("BlockDeviceAPI not found on device"); ioe.initCause(ex); throw ioe;
public MappedBlockDeviceSupport(Device parent, long offset, long length) throws IOException { super(parent.getBus(), "mapped-" + parent.getId()); this.parent = parent; try { this.parentApi = (BlockDeviceAPI)parent.getAPI(BlockDeviceAPI.class); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on parent device", ex); } this.offset = offset; this.length = length; if (offset < 0) { throw new IndexOutOfBoundsException("offset < 0"); } if (length < 0) { throw new IndexOutOfBoundsException("length < 0"); } if (offset + length > parentApi.getLength()) { throw new IndexOutOfBoundsException("offset + length > parent.length"); } registerAPI(BlockDeviceAPI.class, this); }
public CharBuffer put (char[] src, int offset, int length)
public CharBuffer put (CharBuffer src)
public CharBuffer put (char[] src, int offset, int length) { checkArraySize(src.length, offset, length); checkForOverflow(length); for (int i = offset; i < offset + length; i++) put (src [i]); return this; }
checkArraySize(src.length, offset, length); checkForOverflow(length); for (int i = offset; i < offset + length; i++) put (src [i]);
if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining()); if (src.remaining () > 0) { char[] toPut = new char [src.remaining ()]; src.get (toPut); put (toPut); }
public CharBuffer put (char[] src, int offset, int length) { checkArraySize(src.length, offset, length); checkForOverflow(length); for (int i = offset; i < offset + length; i++) put (src [i]); return this; }
final public static CharBuffer wrap(char[] array, int offset, int length)
public static final CharBuffer wrap(char[] array, int offset, int length)
final public static CharBuffer wrap(char[] array, int offset, int length) { return new CharBufferImpl(array, 0, array.length, offset + length, offset, -1, false); }