/* * [Art.java] * * Summary: Generate an affiliate reference to an art.com poster. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. */ package com.mindprod.htmlmacros.macro; import com.mindprod.entities.DeEntifyStrings; import com.mindprod.fastcat.FastCat; import static com.mindprod.htmlmacros.macro.Global.configuration; import static java.lang.System.*; /** * Generate an affiliate reference to an art.com poster. * * @author Roedy Green, Canadian Mind Products * @version 1.8 2009-02-06 include go package in ZIP bundle. * @since 2009 */ public final class Art extends Macro { /** * art.com's vendor id */ private static final int ARTCOMID = 918185;// constant vendor id, art.com's id. /** * suffix for a tag */ private static final String TAG_TAIL = configuration.getTagTail(); /** * how to use the macro */ private static final String USAGE = "\nArt macro needs title productid width height"; /** * guts to Generate Art reference, displays image with title below with VIEW button. * * @param title description of print. * @param p productId of the print., no trailing A * @param width width of the print image. * @param height height of the print image. * * @return expand html for the link to art.com */ private static String expand( String title, int p, int width, int height ) { int pRounded = ( p / 1000 ) * 1000; final FastCat sb = new FastCat( 45 ); sb.append( "
" + "" ); sb.append( "" ); sb.append( " |
" );
sb.append( title );// leave decorative HTML especially sb.append( " |