From: <mz...@us...> - 2007-07-19 17:07:44
|
Revision: 7091 http://svn.sourceforge.net/docbook/?rev=7091&view=rev Author: mzjn Date: 2007-07-19 10:07:39 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Added modifications so that the new callout.icon.size parameter is taken into account. This parameter is used for FO output (where SVG now is the default graphics format for callouts). Modified Paths: -------------- trunk/xsl-java/saxon65/src/com/nwalsh/saxon/FormatGraphicCallout.java trunk/xsl-java/saxon65/src/com/nwalsh/saxon/Verbatim.java trunk/xsl-java/xalan27/src/com/nwalsh/xalan/FormatGraphicCallout.java trunk/xsl-java/xalan27/src/com/nwalsh/xalan/Verbatim.java Modified: trunk/xsl-java/saxon65/src/com/nwalsh/saxon/FormatGraphicCallout.java =================================================================== --- trunk/xsl-java/saxon65/src/com/nwalsh/saxon/FormatGraphicCallout.java 2007-07-19 16:32:00 UTC (rev 7090) +++ trunk/xsl-java/saxon65/src/com/nwalsh/saxon/FormatGraphicCallout.java 2007-07-19 17:07:39 UTC (rev 7091) @@ -36,12 +36,14 @@ String graphicsPath = ""; String graphicsExt = ""; int graphicsMax = 0; + String iconSize = ""; - public FormatGraphicCallout(NamePool nPool, String path, String ext, int max, boolean fo) { + public FormatGraphicCallout(NamePool nPool, String path, String ext, int max, String size, boolean fo) { super(nPool, fo); graphicsPath = path; graphicsExt = ext; graphicsMax = max; + iconSize = size; } public void formatCallout(Emitter rtfEmitter, @@ -68,6 +70,8 @@ imgAttr.addAttribute("", "", "src", "CDATA", "url(" + graphicsPath + num + graphicsExt + ")"); imgAttr.addAttribute("", "", "id", "CDATA", id); + imgAttr.addAttribute("", "", "content-width", "CDATA", iconSize); + imgAttr.addAttribute("", "", "width", "CDATA", iconSize); // HTML } else { Modified: trunk/xsl-java/saxon65/src/com/nwalsh/saxon/Verbatim.java =================================================================== --- trunk/xsl-java/saxon65/src/com/nwalsh/saxon/Verbatim.java 2007-07-19 16:32:00 UTC (rev 7090) +++ trunk/xsl-java/saxon65/src/com/nwalsh/saxon/Verbatim.java 2007-07-19 17:07:39 UTC (rev 7091) @@ -78,6 +78,8 @@ private static String graphicsExt = null; /** The largest callout number that can be represented graphically. */ private static int graphicsMax = 10; + /** The size of the callout icon. */ + private static String iconSize = null; /** The FormatCallout object to use for formatting callouts. */ private static FormatCallout fCallout = null; @@ -317,7 +319,7 @@ int unicodeStart = 49; int unicodeMax = 0; - + String unicodeFont = ""; // Hardcoded defaults @@ -325,6 +327,7 @@ graphicsPath = null; graphicsExt = null; graphicsMax = 0; + iconSize = "7pt"; foStylesheet = false; calloutsSetup = true; @@ -371,10 +374,15 @@ graphicsMax = 0; } + // Get the callout icon size + varString = getVariable(context, "callout.icon.size"); + iconSize = varString; + fCallout = new FormatGraphicCallout(namePool, graphicsPath, graphicsExt, graphicsMax, + iconSize, foStylesheet); } else if (useUnicode) { // Get the starting character Modified: trunk/xsl-java/xalan27/src/com/nwalsh/xalan/FormatGraphicCallout.java =================================================================== --- trunk/xsl-java/xalan27/src/com/nwalsh/xalan/FormatGraphicCallout.java 2007-07-19 16:32:00 UTC (rev 7090) +++ trunk/xsl-java/xalan27/src/com/nwalsh/xalan/FormatGraphicCallout.java 2007-07-19 17:07:39 UTC (rev 7091) @@ -32,12 +32,17 @@ String graphicsPath = ""; String graphicsExt = ""; int graphicsMax = 0; + String iconSize = ""; - public FormatGraphicCallout(String path, String ext, int max, boolean fo) { + public FormatGraphicCallout(String path, String ext, int max, String size, boolean fo) { graphicsPath = path; graphicsExt = ext; graphicsMax = max; stylesheetFO = fo; + iconSize = size; + + //System.out.println("Size: " + size); + } public void formatCallout(DOMBuilder rtf, @@ -61,6 +66,8 @@ imgAttr.addAttribute("", "src", "src", "CDATA", "url(" + graphicsPath + num + graphicsExt + ")"); imgAttr.addAttribute("", "id", "id", "ID", id); + imgAttr.addAttribute("", "content-width", "content-width", "CDATA", iconSize); + imgAttr.addAttribute("", "width", "width", "CDATA", iconSize); } else { ns = ""; Modified: trunk/xsl-java/xalan27/src/com/nwalsh/xalan/Verbatim.java =================================================================== --- trunk/xsl-java/xalan27/src/com/nwalsh/xalan/Verbatim.java 2007-07-19 16:32:00 UTC (rev 7090) +++ trunk/xsl-java/xalan27/src/com/nwalsh/xalan/Verbatim.java 2007-07-19 17:07:39 UTC (rev 7091) @@ -94,6 +94,8 @@ private String graphicsExt = null; /** The largest callout number that can be represented graphically. */ private int graphicsMax = 10; + /** The size of the callout icon. */ + private static String iconSize = null; /** Should graphic callouts use fo:external-graphics or imgs. */ private boolean graphicsFO = false; @@ -440,9 +442,10 @@ String gPath = Params.getString(context, "callout.graphics.path"); String gExt = Params.getString(context, "callout.graphics.extension"); int gMax = Params.getInt(context, "callout.graphics.number.limit"); + String gSize = Params.getString(context, "callout.icon.size"); return insertGraphicCallouts(areaspecNodeSet, xalanNI, defaultColumn, - gPath, gExt, gMax, useFO); + gPath, gExt, gMax, gSize, useFO); } else if (Params.getBoolean(context, "callout.unicode")) { int uStart = Params.getInt(context, "callout.unicode.start.character"); @@ -469,8 +472,9 @@ String gPath, String gExt, int gMax, + String gSize, boolean useFO) { - FormatGraphicCallout fgc = new FormatGraphicCallout(gPath,gExt,gMax,useFO); + FormatGraphicCallout fgc = new FormatGraphicCallout(gPath,gExt,gMax, gSize, useFO); return insertCallouts(areaspecNodeSet, xalanNI, defaultColumn, fgc); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |