From b29fed6b3a58ec88ce6932813f719331bc95ec91 Mon Sep 17 00:00:00 2001 From: Sylvain Jermini Date: Mon, 22 Jun 2020 15:57:26 +0200 Subject: [PATCH] remove more unused utils/misc cleanup --- .../css/constants/ValueConstants.java | 141 ---- .../openhtmltopdf/css/newmatch/Matcher.java | 9 +- .../openhtmltopdf/css/parser/CSSParser.java | 10 - .../com/openhtmltopdf/layout/BlockBoxing.java | 9 - .../layout/VerticalAlignContext.java | 20 +- .../render/AbstractOutputDevice.java | 13 +- .../resource/AbstractResource.java | 2 +- .../simple/extend/URLUTF8Encoder.java | 16 - .../xhtml/controls/AbstractControl.java | 2 +- .../simple/xhtml/controls/ButtonControl.java | 6 +- .../com/openhtmltopdf/util/ArrayUtil.java | 3 - .../com/openhtmltopdf/util/GeneralUtil.java | 272 -------- .../util/PermutationGenerator.java | 160 ----- .../java/com/openhtmltopdf/util/Util.java | 635 ------------------ .../main/java/com/openhtmltopdf/util/Uu.java | 192 ------ 15 files changed, 15 insertions(+), 1475 deletions(-) delete mode 100644 openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/PermutationGenerator.java delete mode 100755 openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Util.java delete mode 100644 openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Uu.java diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/constants/ValueConstants.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/constants/ValueConstants.java index e363455f0..026173b10 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/constants/ValueConstants.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/constants/ValueConstants.java @@ -48,63 +48,6 @@ public final class ValueConstants { */ private final static Map sacTypesStrings; - /** - * A text representation of the CSS type for this value. - * - * @param cssType PARAM - * @param primitiveValueType PARAM - * @return Returns - */ - public static String cssType(int cssType, int primitiveValueType) { - String desc = null; - if (cssType == CSSValue.CSS_PRIMITIVE_VALUE) { - if (primitiveValueType >= TYPE_DESCRIPTIONS.size()) { - desc = "{unknown: " + primitiveValueType + "}"; - } else { - desc = TYPE_DESCRIPTIONS.get(primitiveValueType); - if (desc == null) { - desc = "{UNKNOWN VALUE TYPE}"; - } - } - } else { - desc = "{value list}"; - } - return desc; - } - - /** - * Description of the Method - * - * @param type PARAM - * @return Returns - */ - public static short sacPrimitiveTypeForString(String type) { - if ("em".equals(type)) { - return CSSPrimitiveValue.CSS_EMS; - } else if ("ex".equals(type)) { - return CSSPrimitiveValue.CSS_EXS; - } else if ("px".equals(type)) { - return CSSPrimitiveValue.CSS_PX; - } else if ("%".equals(type)) { - return CSSPrimitiveValue.CSS_PERCENTAGE; - } else if ("in".equals(type)) { - return CSSPrimitiveValue.CSS_IN; - } else if ("cm".equals(type)) { - return CSSPrimitiveValue.CSS_CM; - } else if ("mm".equals(type)) { - return CSSPrimitiveValue.CSS_MM; - } else if ("pt".equals(type)) { - return CSSPrimitiveValue.CSS_PT; - } else if ("pc".equals(type)) { - return CSSPrimitiveValue.CSS_PC; - } else if (type == null) { - //this is only valid if length is 0 - return CSSPrimitiveValue.CSS_PX; - } else { - throw new XRRuntimeException("Unknown type on CSS value: " + type); - } - } - /** * Description of the Method * @@ -115,22 +58,6 @@ public static String stringForSACPrimitiveType(short type) { return sacTypesStrings.get(new Short(type)); } - /** - * Returns true if the specified value was absolute (even if we have a - * computed value for it), meaning that either the value can be used - * directly (e.g. pixels) or there is a fixed context-independent conversion - * for it (e.g. inches). Proportional types (e.g. %) return false. - * - * @param primitive The CSSValue instance to check. - * @return See desc. - */ - //TODO: method may be unnecessary (tobe) - public static boolean isAbsoluteUnit(CSSPrimitiveValue primitive) { - short type = 0; - type = primitive.getPrimitiveType(); - return isAbsoluteUnit(type); - } - /** * Returns true if the specified type absolute (even if we have a computed * value for it), meaning that either the value can be used directly (e.g. @@ -202,27 +129,6 @@ public static boolean isAbsoluteUnit(short type) { } } - /** - * Gets the cssValueTypeDesc attribute of the {@link CSSValue} object - * - * @param cssValue PARAM - * @return The cssValueTypeDesc value - */ - public static String getCssValueTypeDesc(CSSValue cssValue) { - switch (cssValue.getCssValueType()) { - case CSSValue.CSS_CUSTOM: - return "CSS_CUSTOM"; - case CSSValue.CSS_INHERIT: - return "CSS_INHERIT"; - case CSSValue.CSS_PRIMITIVE_VALUE: - return "CSS_PRIMITIVE_VALUE"; - case CSSValue.CSS_VALUE_LIST: - return "CSS_VALUE_LIST"; - default: - return "UNKNOWN"; - } - } - /** * Returns true if the SAC primitive value type is a number unit--a unit * that can only contain a numeric value. This is a shorthand way of saying, @@ -306,53 +212,6 @@ public static boolean isNumber(short cssPrimitiveType) { sacTypesStrings.put(new Short(CSSPrimitiveValue.CSS_PC), "pc"); } - /** - * Incomplete routine to try and determine the - * CSSPrimitiveValue short code for a given value, - * e.g. 14pt is CSS_PT. - * - * @param value PARAM - * @return Returns - */ - public static short guessType(String value) { - short type = CSSPrimitiveValue.CSS_STRING; - if (value != null && value.length() > 1) { - if (value.endsWith("%")) { - type = CSSPrimitiveValue.CSS_PERCENTAGE; - } else if (value.startsWith("rgb") || value.startsWith("#")) { - type = CSSPrimitiveValue.CSS_RGBCOLOR; - } else { - String hmm = value.substring(value.length() - 2); - if ("pt".equals(hmm)) { - type = CSSPrimitiveValue.CSS_PT; - } else if ("px".equals(hmm)) { - type = CSSPrimitiveValue.CSS_PX; - } else if ("em".equals(hmm)) { - type = CSSPrimitiveValue.CSS_EMS; - } else if ("ex".equals(hmm)) { - type = CSSPrimitiveValue.CSS_EXS; - } else if ("in".equals(hmm)) { - type = CSSPrimitiveValue.CSS_IN; - } else if ("cm".equals(hmm)) { - type = CSSPrimitiveValue.CSS_CM; - } else if ("mm".equals(hmm)) { - type = CSSPrimitiveValue.CSS_MM; - } else { - if (Character.isDigit(value.charAt(value.length() - 1))) { - try { - new Float(value); - type = CSSPrimitiveValue.CSS_NUMBER; - } catch (NumberFormatException ex) { - type = CSSPrimitiveValue.CSS_STRING; - } - } else { - type = CSSPrimitiveValue.CSS_STRING; - } - } - } - } - return type; - } }// end class /* diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/newmatch/Matcher.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/newmatch/Matcher.java index f772b3166..b0aaf0b62 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/newmatch/Matcher.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/newmatch/Matcher.java @@ -34,7 +34,6 @@ import com.openhtmltopdf.css.extend.StylesheetFactory; import com.openhtmltopdf.css.extend.TreeResolver; import com.openhtmltopdf.css.sheet.*; -import com.openhtmltopdf.util.Util; import com.openhtmltopdf.util.XRLog; @@ -220,6 +219,10 @@ private Mapper getMapper(Object e) { return m; } + private static boolean isNullOrEmpty(String str) { + return str == null || str.length() == 0; + } + private com.openhtmltopdf.css.sheet.Ruleset getElementStyle(Object e) { //synchronized (e) { if (_attRes == null || _styleFactory == null) { @@ -227,7 +230,7 @@ private com.openhtmltopdf.css.sheet.Ruleset getElementStyle(Object e) { } String style = _attRes.getElementStyling(e); - if (Util.isNullOrEmpty(style)) { + if (isNullOrEmpty(style)) { return null; } @@ -241,7 +244,7 @@ private com.openhtmltopdf.css.sheet.Ruleset getNonCssStyle(Object e) { return null; } String style = _attRes.getNonCssStyling(e); - if (Util.isNullOrEmpty(style)) { + if (isNullOrEmpty(style)) { return null; } return _styleFactory.parseStyleDeclaration(com.openhtmltopdf.css.sheet.StylesheetInfo.AUTHOR, style); diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/parser/CSSParser.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/parser/CSSParser.java index d90d147f7..135bac2f4 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/parser/CSSParser.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/parser/CSSParser.java @@ -31,8 +31,6 @@ import java.io.IOException; import java.io.Reader; import java.io.StringReader; -import java.net.URI; -import java.net.URISyntaxException; import java.util.*; import java.util.logging.Level; @@ -1974,14 +1972,6 @@ private String getTokenValue(Token t, boolean literal) { } } - private boolean isRelativeURI(String uri) { - try { - return uri.length() > 0 && (uri.charAt(0) != '/' && ! new URI(uri).isAbsolute()); - } catch (URISyntaxException e) { - return false; - } - } - private int getCurrentLine() { return _lexer.yyline(); } diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/BlockBoxing.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/BlockBoxing.java index 9cf15ee4f..12c7f4850 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/BlockBoxing.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/BlockBoxing.java @@ -432,7 +432,6 @@ public void setChildOffset(int childOffset) { private static class RelayoutData { private LayoutState _layoutState; - private int _listIndex; private boolean _startsRun; private boolean _endsRun; @@ -482,14 +481,6 @@ public int getChildOffset() { public void setChildOffset(int childOffset) { _childOffset = childOffset; } - - public int getListIndex() { - return _listIndex; - } - - public void setListIndex(int listIndex) { - _listIndex = listIndex; - } } } diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/VerticalAlignContext.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/VerticalAlignContext.java index 187a7c38a..76ff65cc5 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/VerticalAlignContext.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/VerticalAlignContext.java @@ -196,34 +196,18 @@ public void setInitialMeasurements(InlineBoxMeasurements measurements) { } private static final class ChildContextData { - private Box _root; - private VerticalAlignContext _verticalAlignContext; - - - public ChildContextData() { - } + private final Box _root; + private final VerticalAlignContext _verticalAlignContext; public ChildContextData(Box root, VerticalAlignContext vaContext) { _root = root; _verticalAlignContext = vaContext; } - public Box getRoot() { - return _root; - } - - public void setRoot(Box root) { - _root = root; - } - public VerticalAlignContext getVerticalAlignContext() { return _verticalAlignContext; } - public void setVerticalAlignContext(VerticalAlignContext verticalAlignContext) { - _verticalAlignContext = verticalAlignContext; - } - private void moveContextContents(int ty) { moveInlineContents(_root, ty); } diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/render/AbstractOutputDevice.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/render/AbstractOutputDevice.java index f245207c8..b2ccf46a0 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/render/AbstractOutputDevice.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/render/AbstractOutputDevice.java @@ -38,7 +38,7 @@ import com.openhtmltopdf.extend.FSImage; import com.openhtmltopdf.extend.OutputDevice; import com.openhtmltopdf.util.Configuration; -import com.openhtmltopdf.util.Uu; +import com.openhtmltopdf.util.XRLog; import java.awt.*; import java.awt.geom.Area; @@ -50,14 +50,6 @@ * implementations for many OutputDevice methods. */ public abstract class AbstractOutputDevice implements OutputDevice { - - public static class ClipInfo { - public final List _ops; - - public ClipInfo(List ops) { - this._ops = ops; - } - } private FontSpecification _fontSpec; @@ -210,8 +202,7 @@ private FSImage getBackgroundImage(RenderingContext c, CalculatedStyle style) { try { return c.getUac().getImageResource(uri).getImage(); } catch (Exception ex) { - ex.printStackTrace(); - Uu.p(ex); + XRLog.exception("Failed to load background image at uri " + uri, ex); } } return null; diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/AbstractResource.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/AbstractResource.java index a05526363..0104491bf 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/AbstractResource.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/AbstractResource.java @@ -31,7 +31,7 @@ * @author Patrick Wright */ public abstract class AbstractResource implements Resource { - private static enum StreamType { READER, STREAM, INPUT_SOURCE; } + private enum StreamType { READER, STREAM, INPUT_SOURCE; } private final StreamType streamType; private InputSource inputSource; diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/extend/URLUTF8Encoder.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/extend/URLUTF8Encoder.java index bc0bffd89..6126b11d7 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/extend/URLUTF8Encoder.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/extend/URLUTF8Encoder.java @@ -98,22 +98,6 @@ public static String encode( String s ) { return sbuf.toString(); } - /** - * Description of the Method - * - * @param chars PARAM - * @return Returns - */ - public static String encode( char[] chars ) { - StringBuilder sbuf = new StringBuilder(); - int len = chars.length; - for ( int i = 0; i < len; i++ ) { - int ch = chars[i]; - append( sbuf, ch ); - } - return sbuf.toString(); - } - /** * Description of the Method * diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/AbstractControl.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/AbstractControl.java index d498f9ccd..432278592 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/AbstractControl.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/AbstractControl.java @@ -43,7 +43,7 @@ public abstract class AbstractControl implements FormControl { private boolean _successful; private boolean _enabled; - private List _listeners = new ArrayList(); + private List _listeners = new ArrayList<>(); public AbstractControl(XhtmlForm form, Element e) { _form = form; diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/ButtonControl.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/ButtonControl.java index f4ace4d6d..c3406ed32 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/ButtonControl.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/simple/xhtml/controls/ButtonControl.java @@ -31,7 +31,7 @@ public class ButtonControl extends AbstractControl { private String _type, _label; private boolean _extended; - private List _listeners = new ArrayList(); + private List _listeners = new ArrayList<>(); public ButtonControl(XhtmlForm form, Element e) { super(form, e); @@ -75,8 +75,8 @@ public void removeButtonControlListener(ButtonControlListener listener) { } public boolean press() { - for (Iterator iter = _listeners.iterator(); iter.hasNext();) { - if(!((ButtonControlListener) iter.next()).pressed(this)) + for (Iterator iter = _listeners.iterator(); iter.hasNext();) { + if(!(iter.next()).pressed(this)) return false; } return true; diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/ArrayUtil.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/ArrayUtil.java index 5f25bd36d..4a6598399 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/ArrayUtil.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/ArrayUtil.java @@ -26,9 +26,6 @@ public class ArrayUtil { public static String[] cloneOrEmpty(String[] source){ return source == null ? Constants.EMPTY_STR_ARR : (String[]) source.clone(); } - public static byte[] cloneOrEmpty(byte[] source){ - return source == null ? Constants.EMPTY_BYTE_ARR : (byte[]) source.clone(); - } public static int[] cloneOrEmpty(int[] source) { return source == null ? Constants.EMPTY_INT_ARR : (int[]) source.clone(); diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/GeneralUtil.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/GeneralUtil.java index 909041705..ed085e5dc 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/GeneralUtil.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/GeneralUtil.java @@ -32,12 +32,6 @@ */ public class GeneralUtil { - /** - * Used to format an Object's hashcode into a 0-padded 10 char String, e.g. - * for 24993066 returns "0024993066" - */ - public final static java.text.DecimalFormat PADDED_HASH_FORMAT = new java.text.DecimalFormat("0000000000"); - /** * Dumps an exception to the console, only the last 5 lines of the stack * trace. @@ -57,187 +51,6 @@ public static void dumpShortException(Exception ex) { } } - /** - * Returns a String tracking the last n method calls, from oldest to most - * recent. You can use this as a simple tracing mechanism to find out the - * calls that got to where you execute the trackBack() call - * from. Example:
- *
-     * // called from Box.calcBorders(), line 639
-     * String tback = GeneralUtil.trackBack(6);
-     * System.out.println(tback);
-     * 
produces - *
-     * Boxing.layoutChildren(ln 204)
-     * BlockBoxing.layoutContent(ln 81)
-     * Boxing.layout(ln 72)
-     * Boxing.layout(ln 133)
-     * Box.totalLeftPadding(ln 306)
-     * Box.calcBorders(ln 639)
-     * 
- * The trackBack() method itself is always excluded from the dump. - * Note the output may not be useful if HotSpot has been optimizing the - * code. - * - * @param cnt How far back in the call tree to go; if call tree is smaller, will - * be limited to call tree. - * @return see desc - */ - public static String trackBack(int cnt) { - Exception ex = new Exception(); - StringBuilder sb = new StringBuilder(); - List list = new ArrayList(cnt); - StackTraceElement[] stes = ex.getStackTrace(); - if (cnt >= stes.length) { - cnt = stes.length - 1; - } - - // >= 1 to not include this method - for (int i = cnt; i >= 1; i--) { - StackTraceElement ste = stes[i]; - sb.append(GeneralUtil.classNameOnly(ste.getClassName())); - sb.append("."); - sb.append(ste.getMethodName()); - sb.append("(ln ").append(ste.getLineNumber()).append(")"); - list.add(sb.toString()); - sb = new StringBuilder(); - } - - Iterator iter = list.iterator(); - StringBuilder padding = new StringBuilder(); - StringBuilder trackback = new StringBuilder(); - while (iter.hasNext()) { - String s = (String) iter.next(); - trackback.append(padding).append(s).append("\n"); - padding.append(" "); - } - return trackback.toString(); - } - - - /** - * Given an Object instance, returns just the classname with no package - * - * @param o PARAM - * @return Returns - */ - public static String classNameOnly(Object o) { - String s = "[null object ref]"; - if (o != null) { - s = classNameOnly(o.getClass().getName()); - } - return s; - } - - /** - * Given a String classname, returns just the classname with no package - * - * @param cname PARAM - * @return Returns - */ - public static String classNameOnly(String cname) { - String s = "[null object ref]"; - if (cname != null) { - s = cname.substring(cname.lastIndexOf('.') + 1); - } - return s; - } - - /** - * Description of the Method - * - * @param o PARAM - * @return Returns - */ - public static String paddedHashCode(Object o) { - String s = "0000000000"; - if (o != null) { - s = PADDED_HASH_FORMAT.format(o.hashCode()); - } - return s; - } - - public static boolean isMacOSX() { - try { - if (System.getProperty("os.name").toLowerCase().startsWith("mac os x")) { - return true; - } - } catch (SecurityException e) { - System.err.println(e.getLocalizedMessage()); - } - return false; - } - - public static StringBuilder htmlEscapeSpace(String uri) { - StringBuilder sbURI = new StringBuilder((int) (uri.length() * 1.5)); - char ch; - for (int i = 0; i < uri.length(); ++i) { - ch = uri.charAt(i); - if (ch == ' ') { - sbURI.append("%20"); - } else if (ch == '\\') { - sbURI.append('/'); - } else { - sbURI.append(ch); - } - } - return sbURI; - } - - /** - * Reads all content from a given InputStream into a String using the default platform encoding. - * - * @param is the InputStream to read from. Must already be open, and will NOT be closed by this function. Failing to - * close this stream after the call will result in a resource leak. - * - * @return String containing contents read from the stream - * @throws IOException if the stream could not be read - */ - public static String inputStreamToString(InputStream is) throws IOException { - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - StringWriter sw = new StringWriter(); - char c[] = new char[1024]; - while (true) { - int n = br.read(c, 0, c.length); - if (n < 0) break; - sw.write(c, 0, n); - } - isr.close(); - return sw.toString(); - } - - public static void writeStringToFile(String content, String encoding, String fileName) - throws IOException { - File f = new File(fileName); - FileOutputStream fos = new FileOutputStream(f); - try { - OutputStreamWriter osw = new OutputStreamWriter(fos, encoding); - BufferedWriter bw = new BufferedWriter(osw); - PrintWriter pw = new PrintWriter(bw); - try { - pw.print(content); - pw.flush(); - bw.flush(); - } finally { - try { - pw.close(); - } catch (Exception e) { - // ignore - } - } - } catch (IOException e) { - throw e; - } finally { - try { - fos.close(); - } catch (Exception e) { - // ignore - } - } - System.out.println("Wrote file: " + f.getAbsolutePath()); - } - /** * Parses an integer from a string using less restrictive rules about which * characters we won't accept. This scavenges the supplied string for any @@ -281,91 +94,6 @@ public static int parseIntRelaxed(String s) { return Integer.MAX_VALUE; } } - - /** - * Converts any special characters into their corresponding HTML entities, for example < to &lt;. This is done using a character - * by character test, so you may consider other approaches for large documents. Make sure you declare the - * entities that might appear in this replacement, e.g. the latin-1 entities - * This method was taken from a code-samples website, written and hosted by Real Gagnon, at - * http://www.rgagnon.com/javadetails/java-0306.html. - * - * @param s The String which may contain characters to escape. - * @return The string with the characters as HTML entities. - */ - public static String escapeHTML(String s){ - if (s == null) { - return ""; - } - StringBuilder sb = new StringBuilder(); - int n = s.length(); - for (int i = 0; i < n; i++) { - char c = s.charAt(i); - switch (c) { - case '<': - sb.append("<"); - break; - case '>': - sb.append(">"); - break; - case '&': - sb.append("&"); - break; - case '"': - sb.append("""); - break; - /* - case 'ÔøΩ': sb.append("à");break; - case 'ÔøΩ': sb.append("À");break; - case 'ÔøΩ': sb.append("â");break; - case 'ÔøΩ': sb.append("Â");break; - case 'ÔøΩ': sb.append("ä");break; - case 'ÔøΩ': sb.append("Ä");break; - case 'ÔøΩ': sb.append("å");break; - case 'ÔøΩ': sb.append("Å");break; - case 'ÔøΩ': sb.append("æ");break; - case 'ÔøΩ': sb.append("Æ");break; - case 'ÔøΩ': sb.append("ç");break; - case 'ÔøΩ': sb.append("Ç");break; - case 'ÔøΩ': sb.append("é");break; - case 'ÔøΩ': sb.append("É");break; - case 'ÔøΩ': sb.append("è");break; - case 'ÔøΩ': sb.append("È");break; - case 'ÔøΩ': sb.append("ê");break; - case 'ÔøΩ': sb.append("Ê");break; - case 'ÔøΩ': sb.append("ë");break; - case 'ÔøΩ': sb.append("Ë");break; - case 'ÔøΩ': sb.append("ï");break; - case 'ÔøΩ': sb.append("Ï");break; - case 'ÔøΩ': sb.append("ô");break; - case 'ÔøΩ': sb.append("Ô");break; - case 'ÔøΩ': sb.append("ö");break; - case 'ÔøΩ': sb.append("Ö");break; - case 'ÔøΩ': sb.append("ø");break; - case 'ÔøΩ': sb.append("Ø");break; - case 'ÔøΩ': sb.append("ß");break; - case 'ÔøΩ': sb.append("ù");break; - case 'ÔøΩ': sb.append("Ù");break; - case 'ÔøΩ': sb.append("û");break; - case 'ÔøΩ': sb.append("Û");break; - case 'ÔøΩ': sb.append("ü");break; - case 'ÔøΩ': sb.append("Ü");break; - case 'ÔøΩ': sb.append("®");break; - case 'ÔøΩ': sb.append("©");break; - case 'ÔøΩ': sb.append("€"); break; - */ - // be carefull with this one (non-breaking whitee space) - case ' ': - sb.append(" "); - break; - - default: - sb.append(c); - break; - } - } - return sb.toString(); - } - } /* diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/PermutationGenerator.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/PermutationGenerator.java deleted file mode 100644 index 33ec501a8..000000000 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/PermutationGenerator.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.openhtmltopdf.util; - - -import java.math.BigInteger; - -/** - * The PermutationGenerator Java class systematically generates permutations. It relies on the fact that any set with n - * elements can be placed in one-to-one correspondence with the set {1, 2, 3, ..., n}. The algorithm is described by - * Kenneth H. Rosen, Discrete Mathematics and Its Applications, 2nd edition (NY: McGraw-Hill, 1991), pp. 282-284. - *
- * The class is very easy to use. Suppose that you wish to generate all permutations of the strings "a", "b", "c", and - * "d". Put them into an array. Keep calling the permutation generator's {@link #getNext ()} method until there are no - * more permutations left. The {@link #getNext ()} method returns an array of integers, which tell you the order in - * which to arrange your original array of strings. Here is a snippet of code which illustrates how to use the - * PermutationGenerator class. - *
- * int[] indices;
- * String[] elements = {"a", "b", "c", "d"};
- * PermutationGenerator x = new PermutationGenerator (elements.length);
- * StringBuffer permutation;
- * while (x.hasMore ()) {
- * permutation = new StringBuffer ();
- * indices = x.getNext ();
- * for (int i = 0; i < indices.length; i++) {
- * permutation.append (elements[indices[i]]);
- * }
- * System.out.println (permutation.toString ());
- * }
- * 
- * One caveat. Don't use this class on large sets. Recall that the number of permutations of a set containing n elements - * is n factorial, which is a very large number even when n is as small as 20. 20! is 2,432,902,008,176,640,000. - *
- * NOTE: This class was taken from the internet, as posted by Michael Gilleland on this website. The code was posted with the following comment: "The - * source code is free for you to use in whatever way you wish." - * - * @author Michael Gilleland, Merriam Park Software (http://www.merriampark.com/index.htm) - */ -public class PermutationGenerator { - - private int[] a; - private BigInteger numLeft; - private BigInteger total; - - //----------------------------------------------------------- - // Constructor. WARNING: Don't make n too large. - // Recall that the number of permutations is n! - // which can be very large, even when n is as small as 20 -- - // 20! = 2,432,902,008,176,640,000 and - // 21! is too big to fit into a Java long, which is - // why we use BigInteger instead. - //---------------------------------------------------------- - - public PermutationGenerator(int n) { - if (n < 1) { - throw new IllegalArgumentException("Min 1"); - } - a = new int[n]; - total = getFactorial(n); - reset(); - } - - //------ - // Reset - //------ - - public void reset() { - for (int i = 0; i < a.length; i++) { - a[i] = i; - } - numLeft = new BigInteger(total.toString()); - } - - //------------------------------------------------ - // Return number of permutations not yet generated - //------------------------------------------------ - - public BigInteger getNumLeft() { - return numLeft; - } - - //------------------------------------ - // Return total number of permutations - //------------------------------------ - - public BigInteger getTotal() { - return total; - } - - //----------------------------- - // Are there more permutations? - //----------------------------- - - public boolean hasMore() { - return numLeft.compareTo(BigInteger.ZERO) == 1; - } - - //------------------ - // Compute factorial - //------------------ - - private static BigInteger getFactorial(int n) { - BigInteger fact = BigInteger.ONE; - for (int i = n; i > 1; i--) { - fact = fact.multiply(new BigInteger(Integer.toString(i))); - } - return fact; - } - - //-------------------------------------------------------- - // Generate next permutation (algorithm from Rosen p. 284) - //-------------------------------------------------------- - - public int[] getNext() { - - if (numLeft.equals(total)) { - numLeft = numLeft.subtract(BigInteger.ONE); - return ArrayUtil.cloneOrEmpty(a); - } - - int temp; - - // Find largest index j with a[j] < a[j+1] - - int j = a.length - 2; - while (a[j] > a[j + 1]) { - j--; - } - - // Find index k such that a[k] is smallest integer - // greater than a[j] to the right of a[j] - - int k = a.length - 1; - while (a[j] > a[k]) { - k--; - } - - // Interchange a[j] and a[k] - - temp = a[k]; - a[k] = a[j]; - a[j] = temp; - - // Put tail end of permutation after jth position in increasing order - - int r = a.length - 1; - int s = j + 1; - - while (r > s) { - temp = a[s]; - a[s] = a[r]; - a[r] = temp; - r--; - s++; - } - - numLeft = numLeft.subtract(BigInteger.ONE); - return ArrayUtil.cloneOrEmpty(a); - } -} // end class diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Util.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Util.java deleted file mode 100755 index 9fd61ec0c..000000000 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Util.java +++ /dev/null @@ -1,635 +0,0 @@ -/* - * {{{ header & license - * Copyright (c) 2004, 2005 Joshua Marinacci - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * }}} - */ -package com.openhtmltopdf.util; - -import javax.swing.*; -import java.awt.Dimension; -import java.awt.Toolkit; -import java.io.*; -import java.text.DateFormat; -import java.util.*; - - -/** - * Description of the Class - * - * @author empty - */ -public class Util { - /** - * Description of the Field - */ - private PrintWriter pw = null; - /** - * Description of the Field - */ - private boolean on = true; - - /** - * Constructor for the Util object - * - * @param writer PARAM - */ - public Util(PrintWriter writer) { - this.pw = writer; - } - - /** - * Constructor for the Util object - * - * @param out PARAM - */ - public Util(OutputStream out) { - this.pw = new PrintWriter(out); - } - - /* - * ------------ static stuff ------------- - */ - /* - * ---- general print functions ----- - */ - /** - * Description of the Method - * - * @param o PARAM - */ - public void print(Object o) { - println(o, false); - } - - /** - * Description of the Method - * - * @param o PARAM - */ - public void println(Object o) { - println(o, true); - } - - /** - * Description of the Method - * - * @param o PARAM - * @param line PARAM - */ - public void println(Object o, boolean line) { - if (o == null) { - ps("null"); - return; - } - //ps("in p: " + o.getClass()); - if (o instanceof Object[]) { - print_array((Object[]) o); - return; - } - if (o instanceof int[]) { - print_array((int[]) o); - } - if (o instanceof String) { - ps((String) o, line); - return; - } - if (o instanceof Exception) { - ps(stack_to_string((Exception) o)); - return; - } - if (o instanceof Vector) { - print_vector((Vector) o); - return; - } - if (o instanceof Hashtable) { - print_hashtable((Hashtable) o); - return; - } - if (o instanceof Date) { - print_date((Date) o); - return; - } - if (o instanceof Calendar) { - print_calendar((Calendar) o); - return; - } - - ps(o.toString(), line); - } - - - /* - * --- data type specific print functions ---- - */ - /** - * Description of the Method - * - * @param v PARAM - */ - public void print_vector(Vector v) { - ps("vector: size=" + v.size()); - for (int i = 0; i < v.size(); i++) { - ps(v.elementAt(i).toString()); - } - } - - /** - * Description of the Method - * - * @param array PARAM - */ - public void print_array(int[][] array) { - print("array: size=" + array.length + " by " + array[0].length); - for (int i = 0; i < array.length; i++) { - for (int j = 0; j < array[i].length; j++) { - //pr("i = " + i + " j = " + j); - ps(array[i][j] + " ", false); - } - print(""); - } - } - - /** - * Description of the Method - * - * @param array PARAM - */ - public void print_array(Object[] array) { - print("array: size=" + array.length); - for (int i = 0; i < array.length; i++) { - ps(" " + array[i].toString(), false); - } - } - - /** - * Description of the Method - * - * @param array PARAM - */ - public void print_array(int[] array) { - print("array: size=" + array.length); - for (int i = 0; i < array.length; i++) { - ps(" " + array[i], false); - } - } - - /** - * Description of the Method - * - * @param h PARAM - */ - public void print_hashtable(Hashtable h) { - print("hashtable size=" + h.size()); - Enumeration keys = h.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - print(key + " = "); - print(h.get(key).toString()); - } - } - - /** - * Description of the Method - * - * @param array PARAM - */ - public void print_array(byte[] array) { - print("byte array: size = " + array.length); - for (int i = 0; i < array.length; i++) { - print("" + array[i]); - } - } - - /** - * Description of the Method - * - * @param date PARAM - */ - public void print_date(Date date) { - DateFormat date_format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); - print(date_format.format(date)); - } - - /** - * Description of the Method - * - * @param cal PARAM - */ - public void print_calendar(Calendar cal) { - print(cal.getTime()); - } - - /** - * Description of the Method - * - * @param sec PARAM - */ - public void printUnixtime(long sec) { - print(new Date(sec * 1000)); - } - - /** - * Sets the on attribute of the Util object - * - * @param on The new on value - */ - public void setOn(boolean on) { - this.on = on; - } - - - /** - * Sets the printWriter attribute of the Util object - * - * @param writer The new printWriter value - */ - public void setPrintWriter(PrintWriter writer) { - this.pw = writer; - } - - /** - * Description of the Method - * - * @param s PARAM - */ - private void ps(String s) { - ps(s, true); - } - - /** - * Description of the Method - * - * @param s PARAM - * @param line PARAM - */ - private void ps(String s, boolean line) { - if (!on) { - return; - } - if (line) { - if (pw == null) { - System.out.println(s); - } else { - //System.out.println(s); - pw.println(s); - //pw.println("
"); - } - } else { - if (pw == null) { - System.out.print(s); - } else { - //System.out.print(s); - pw.print(s); - //pw.print("
"); - } - } - } - - - /* - * ----- other stuff ---- - */ - /** - * Description of the Method - * - * @param filename PARAM - * @return Returns - * @throws FileNotFoundException Throws - * @throws IOException Throws - */ - public static String file_to_string(String filename) - throws FileNotFoundException, IOException { - File file = new File(filename); - return file_to_string(file); - } - - /** - * Description of the Method - * - * @param text PARAM - * @param file PARAM - * @throws IOException Throws - */ - public static void string_to_file(String text, File file) - throws IOException { - FileWriter writer = null; - writer = new FileWriter(file); - try { - StringReader reader = new StringReader(text); - char[] buf = new char[1000]; - while (true) { - int n = reader.read(buf, 0, 1000); - if (n == -1) { - break; - } - writer.write(buf, 0, n); - } - writer.flush(); - } finally { - if (writer != null) { - writer.close(); - } - } - } - - /** - * Description of the Method - * - * @param str PARAM - * @return Returns - */ - public static int string_to_int(String str) { - return Integer.parseInt(str); - } - - /** - * Description of the Method - * - * @param e PARAM - * @return Returns - */ - public static String stack_to_string(Exception e) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - pw.close(); - return sw.toString(); - } - - /** - * Description of the Method - * - * @param e PARAM - * @return Returns - */ - public static String stack_to_string(Throwable e) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - pw.close(); - return sw.toString(); - } - - /** - * Description of the Method - * - * @param in PARAM - * @return Returns - * @throws IOException Throws - */ - public static String inputstream_to_string(InputStream in) - throws IOException { - Reader reader = new InputStreamReader(in); - StringWriter writer = new StringWriter(); - char[] buf = new char[1000]; - while (true) { - int n = reader.read(buf, 0, 1000); - if (n == -1) { - break; - } - writer.write(buf, 0, n); - } - return writer.toString(); - } - - /** - * Description of the Method - * - * @param file PARAM - * @return Returns - * @throws FileNotFoundException Throws - * @throws IOException Throws - */ - public static String file_to_string(File file) - throws IOException { - FileReader reader = null; - StringWriter writer = null; - String str; - try { - reader = new FileReader(file); - writer = new StringWriter(); - char[] buf = new char[1000]; - while (true) { - int n = reader.read(buf, 0, 1000); - if (n == -1) { - break; - } - writer.write(buf, 0, n); - } - str = writer.toString(); - } finally { - if (reader != null) { - reader.close(); - } - if (writer != null) { - writer.close(); - } - } - return str; - } - - /** - * Description of the Method - * - * @param source PARAM - * @param target PARAM - * @param replacement PARAM - * @return Returns - */ - public static String replace(String source, String target, String replacement) { - StringBuilder output = new StringBuilder(); - int n = 0; - while (true) { - //print("n = " + n); - int off = source.indexOf(target, n); - if (off == -1) { - output.append(source.substring(n)); - break; - } - output.append(source, n, off); - output.append(replacement); - n = off + target.length(); - } -// output.append(source.substring(off+target.length())); - return output.toString(); - } - - /** - * Description of the Method - * - * @param v PARAM - * @return Returns - */ - public static String[] vector_to_strings(Vector v) { - int len = v.size(); - String[] ret = new String[len]; - for (int i = 0; i < len; i++) { - ret[i] = v.elementAt(i).toString(); - } - return ret; - } - - /** - * Description of the Method - * - * @param l PARAM - * @return Returns - */ - public static String[] list_to_strings(List l) { - int len = l.size(); - String[] ret = new String[len]; - for (int i = 0; i < len; i++) { - ret[i] = l.get(i).toString(); - } - return ret; - } - - /** - * Description of the Method - * - * @param array PARAM - * @return Returns - */ - public static List toList(Object[] array) { - return to_list(array); - } - - /** - * Description of the Method - * - * @param array PARAM - * @return Returns - */ - public static List to_list(Object[] array) { - List list = new ArrayList(); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /* - * public void pr(Date date) { - * DateFormat date_format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); - * pr(date_format.format(date)); - * } - */ - /* - * public void pr(Calendar cal) { - * pr(cal.getTime()); - * } - */ - - /** - * Description of the Method - * - * @param msec PARAM - */ - public static void sleep(long msec) { - try { - Thread.sleep(msec); - } catch (InterruptedException ex) { - com.openhtmltopdf.util.Uu.p(stack_to_string(ex)); - } - } - - /** - * Description of the Method - * - * @param frame PARAM - */ - public static void center(JFrame frame) { - //p("centering"); - Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize(); - frame.setLocation((int) ((screen_size.getWidth() - frame.getWidth()) / 2), - (int) ((screen_size.getHeight() - frame.getHeight()) / 2)); - } - - /** - * Description of the Method - * - * @param frame PARAM - */ - public static void center(JDialog frame) { - //p("centering"); - Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize(); - frame.setLocation((int) ((screen_size.getWidth() - frame.getWidth()) / 2), - (int) ((screen_size.getHeight() - frame.getHeight()) / 2)); - } - - - /** - * Gets the number attribute of the Util class - * - * @param str PARAM - * @return The number value - */ - public static boolean isNumber(String str) { - try { - Integer.parseInt(str); - return true; - } catch (NumberFormatException e) { - return false; - } - } - - public static boolean isNullOrEmpty(String str) { - return str == null || str.length() == 0; - } - - public static boolean isNullOrEmpty(String str, boolean trim) { - return str == null || str.length() == 0 || (trim && str.trim().length() == 0); - } - - public static boolean isEqual(String str1, String str2) { - return str1 == str2 || (str1 != null && str1.equals(str2)); - } - - public static boolean isEqual(String str1, String str2, boolean ignoreCase) { - return str1 == str2 || (str1 != null && (ignoreCase ? str1.equalsIgnoreCase(str2) : str1.equals(str2))); - } -} - -/* - * $Id$ - * - * $Log$ - * Revision 1.8 2009/05/09 15:16:43 pdoubleya - * FindBugs: proper disposal of IO resources - * - * Revision 1.7 2009/04/25 11:19:07 pdoubleya - * Add utility methods to compare strings, patch from Peter Fassev in issue #263. - * - * Revision 1.6 2007/05/20 23:25:31 peterbrant - * Various code cleanups (e.g. remove unused imports) - * - * Patch from Sean Bright - * - * Revision 1.5 2005/01/29 20:18:38 pdoubleya - * Clean/reformat code. Removed commented blocks, checked copyright. - * - * Revision 1.4 2004/12/12 03:33:05 tobega - * Renamed x and u to avoid confusing IDE. But that got cvs in a twist. See if this does it - * - * Revision 1.3 2004/10/23 14:06:57 pdoubleya - * Re-formatted using JavaStyle tool. - * Cleaned imports to resolve wildcards except for common packages (java.io, java.util, etc). - * Added CVS log comments at bottom. - * - * - */ - diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Uu.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Uu.java deleted file mode 100644 index 6497b52fa..000000000 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/util/Uu.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * {{{ header & license - * Copyright (c) 2004, 2005 Joshua Marinacci - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * }}} - */ -package com.openhtmltopdf.util; - -import java.io.PrintWriter; -import java.io.StringWriter; - - -/** - * Description of the Class - * - * @author empty - */ -public class Uu extends Util { - /** - * Description of the Field - */ - private static Util util; - /** - * Description of the Field - */ - private static Util utilAsString; - - /** - * Constructor for the Uu object - */ - private Uu() { - super(System.out); - } - - /** - * Description of the Method - */ - public static void on() { - init(); - util.setOn(true); - } - - /** - * Description of the Method - */ - public static void off() { - init(); - util.setOn(false); - } - - /** - * Description of the Method - * - * @param object PARAM - */ - public static void p(Object object) { - init(); - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - utilAsString.setPrintWriter(pw); - utilAsString.print(object);// our log adds a newline - pw.flush(); - if (XRLog.isLoggingEnabled()) { - XRLog.general(sw.getBuffer().toString()); - } - } - - /** - * Description of the Method - * - * @param object PARAM - */ - public static void pr(Object object) { - init(); - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - utilAsString.setPrintWriter(pw); - utilAsString.print(object);// our log adds a newline - pw.flush(); - if (XRLog.isLoggingEnabled()) { - XRLog.general(sw.getBuffer().toString()); - } - //util.print( object ); - } - - /** - * Description of the Method - * - * @param msec PARAM - */ - public static void sleep(int msec) throws InterruptedException { - Thread.sleep(msec); - } - - /** - * Description of the Method - */ - public static void dump_stack() { - p(stack_to_string(new Exception())); - } - - /** - * Description of the Method - * - * @param args PARAM - */ - public static void main(String args[]) { - try { - Uu.p(new Object()); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - /** - * Description of the Method - */ - private static void init() { - if (util == null) { - util = new Util(System.out); - } - if (utilAsString == null) { - utilAsString = new Util(System.out); - } - }// end main() -} - -/* - * $Id$ - * - * $Log$ - * Revision 1.4 2009/04/25 11:57:05 pdoubleya - * Small opt, avoid log calls where logging is disabled, patch from Peter Fassev issue #263 - * - * Revision 1.3 2005/09/29 06:15:07 tobega - * Patch from Peter Brant: - * List of changes: - * - Fix extents height calculation - * - Small refactoring to Boxing to combine a method - * - Make render and layout threads interruptible and add - * RootPanel.shutdown() method to shut them down in an orderly manner - * - Fix NPE in Graphics2DRenderer. It looks like - * BasicPanel.intrinsic_size will always be null anyway? - * - Fix NPE in RootPanel when enclosingScrollPane is null. - * - Both RenderLoop.collapseRepaintEvents and - * LayoutLoop.collapseLayoutEvents will go into an infinite loop if the - * next event isn't collapsible. I added a common implementation to - * RenderQueue which doesn't have this problem. - * - * Revision 1.2 2005/01/29 20:18:38 pdoubleya - * Clean/reformat code. Removed commented blocks, checked copyright. - * - * Revision 1.1 2004/12/12 03:33:05 tobega - * Renamed x and u to avoid confusing IDE. But that got cvs in a twist. See if this does it - * - * Revision 1.4 2004/11/22 21:34:05 joshy - * created new whitespace handler. - * new whitespace routines only work if you set a special property. it's - * off by default. - * - * turned off fractional font metrics - * - * fixed some bugs in Uu and Xx - * - * - j - * - * Issue number: - * Obtained from: - * Submitted by: - * Reviewed by: - * - * Revision 1.3 2004/10/23 14:06:57 pdoubleya - * Re-formatted using JavaStyle tool. - * Cleaned imports to resolve wildcards except for common packages (java.io, java.util, etc). - * Added CVS log comments at bottom. - * - * - */ -