/** * Returns an HTML image map tag tag for this entity. * * @param toolTipTagFragmentGenerator the generator for tooltip fragment. * @param urlTagFragmentGenerator the generator for the URL fragment. * * @return The HTML tag. */ public String getImageMapAreaTag(ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuffer tag = new StringBuffer(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<AREA SHAPE=\"" + getShapeType() + "\"" + " COORDS=\"" + getShapeCoords() + "\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment(this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment(this.urlText)); } tag.append(">"); } return tag.toString(); }
/** * Writes an image map to an output stream. * * @param writer the writer (<code>null</code> not permitted). * @param name the map name (<code>null</code> not permitted). * @param info the chart rendering info (<code>null</code> not permitted). * @param toolTipTagFragmentGenerator the tool tip generator. * @param urlTagFragmentGenerator the url generator. * * @throws IOException if there are any I/O errors. */ public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws IOException { writer.println( ImageMapUtil.getImageMap( name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator ) ); }
/** * Returns an HTML image map tag for this entity. The returned fragment * should be <code>XHTML 1.0</code> compliant. * * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if this entity contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * this entity has a URL). * * @return The HTML tag. */ public String getImageMapAreaTag( ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuffer tag = new StringBuffer(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<area shape=\"" + getShapeType() + "\"" + " coords=\"" + getShapeCoords() + "\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment( this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment( this.urlText)); } // if there is a tool tip, we expect it to generate the title and // alt values, so we only add an empty alt if there is no tooltip if (!hasToolTip) { tag.append(" alt=\"\""); } tag.append("/>"); } return tag.toString(); }
/** * Returns an HTML image map tag for this entity. The returned fragment * should be <code>XHTML 1.0</code> compliant. * * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if this entity contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * this entity has a URL). * * @return The HTML tag. */ public String getImageMapAreaTag( ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuilder tag = new StringBuilder(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<area shape=\"").append(getShapeType()).append("\"") .append(" coords=\"").append(getShapeCoords()).append("\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment( this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment( this.urlText)); } else { tag.append(" nohref=\"nohref\""); } // if there is a tool tip, we expect it to generate the title and // alt values, so we only add an empty alt if there is no tooltip if (!hasToolTip) { tag.append(" alt=\"\""); } tag.append("/>"); } return tag.toString(); }
/** * Returns an HTML image map tag for this entity. The returned fragment * should be {@code XHTML 1.0} compliant. * * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text ({@code null} not permitted * if this entity contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference ({@code null} not permitted if * this entity has a URL). * * @return The HTML tag. */ public String getImageMapAreaTag( ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuilder tag = new StringBuilder(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<area shape=\"").append(getShapeType()).append("\"") .append(" coords=\"").append(getShapeCoords()).append("\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment( this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment( this.urlText)); } else { tag.append(" nohref=\"nohref\""); } // if there is a tool tip, we expect it to generate the title and // alt values, so we only add an empty alt if there is no tooltip if (!hasToolTip) { tag.append(" alt=\"\""); } tag.append("/>"); } return tag.toString(); }
/** * Returns an HTML image map tag for this entity. The returned fragment * should be <code>XHTML 1.0</code> compliant. * * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if this entity contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * this entity has a URL). * * @return The HTML tag. */ public String getImageMapAreaTag( ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuffer tag = new StringBuffer(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<area shape=\"" + getShapeType() + "\"" + " coords=\"" + getShapeCoords() + "\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment( this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment( this.urlText)); } else { tag.append(" nohref=\"nohref\""); } // if there is a tool tip, we expect it to generate the title and // alt values, so we only add an empty alt if there is no tooltip if (!hasToolTip) { tag.append(" alt=\"\""); } tag.append("/>"); } return tag.toString(); }
/** * Returns an HTML image map tag for this entity. The returned fragment * should be <code>XHTML 1.0</code> compliant. * * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if this entity contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * this entity has a URL). * * @return The HTML tag. */ public String getImageMapAreaTag( ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { StringBuffer tag = new StringBuffer(); boolean hasURL = (this.urlText == null ? false : !this.urlText.equals("")); boolean hasToolTip = (this.toolTipText == null ? false : !this.toolTipText.equals("")); if (hasURL || hasToolTip) { tag.append("<area shape=\"").append(getShapeType()).append("\"") .append(" coords=\"").append(getShapeCoords()).append("\""); if (hasToolTip) { tag.append(toolTipTagFragmentGenerator.generateToolTipFragment( this.toolTipText)); } if (hasURL) { tag.append(urlTagFragmentGenerator.generateURLFragment( this.urlText)); } else { tag.append(" nohref=\"nohref\""); } // if there is a tool tip, we expect it to generate the title and // alt values, so we only add an empty alt if there is no tooltip if (!hasToolTip) { tag.append(" alt=\"\""); } tag.append("/>"); } return tag.toString(); }
/** * Creates an HTML image map. * * @param name the map name (<code>null</code> not permitted). * @param info the chart rendering info (<code>null</code> not permitted). * @param toolTipTagFragmentGenerator the tool tip generator. * @param urlTagFragmentGenerator the url generator. * * @return the map tag. */ public static String getImageMap(String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { return ImageMapUtil.getImageMap(name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator); }
/** * Writes an image map to the specified writer. * * @param writer the writer (<code>null</code> not permitted). * @param name the map name (<code>null</code> not permitted). * @param info the chart rendering info (<code>null</code> not permitted). * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if <code>info</code> contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * <code>info</code> contains URLs). * * @throws IOException if there are any I/O errors. */ public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws IOException { writer.println(ImageMapUtilities.getImageMap(name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator)); }
/** * Creates an HTML image map. This method maps directly to * {@link ImageMapUtilities#getImageMap(String, ChartRenderingInfo, * ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}. * * @param name the map name (<code>null</code> not permitted). * @param info the chart rendering info (<code>null</code> not permitted). * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text (<code>null</code> not permitted * if <code>info</code> contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference (<code>null</code> not permitted if * <code>info</code> contains URLs). * * @return The map tag. */ public static String getImageMap(String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { return ImageMapUtilities.getImageMap(name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator); }
/** * Writes an image map to the specified writer. * * @param writer the writer ({@code null} not permitted). * @param name the map name ({@code null} not permitted). * @param info the chart rendering info ({@code null} not permitted). * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text ({@code null} not permitted * if {@code info} contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference ({@code null} not permitted if * {@code info} contains URLs). * * @throws IOException if there are any I/O errors. */ public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws IOException { writer.println(ImageMapUtils.getImageMap(name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator)); }
/** * Creates an HTML image map. This method maps directly to * {@link ImageMapUtils#getImageMap(String, ChartRenderingInfo, * ToolTipTagFragmentGenerator, URLTagFragmentGenerator)}. * * @param name the map name ({@code null} not permitted). * @param info the chart rendering info ({@code null} not permitted). * @param toolTipTagFragmentGenerator a generator for the HTML fragment * that will contain the tooltip text ({@code null} not permitted * if {@code info} contains tooltip information). * @param urlTagFragmentGenerator a generator for the HTML fragment that * will contain the URL reference ({@code null} not permitted if * {@code info} contains URLs). * * @return The map tag. */ public static String getImageMap(String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) { return ImageMapUtils.getImageMap(name, info, toolTipTagFragmentGenerator, urlTagFragmentGenerator); }