public Piece addImage(String src, String hint, String alt, String fgColor, String bgColor) { // Piece img = new Piece("img"); Piece img = new Piece(null, alt, hint); img.addStyle("padding: 3px"); if (fgColor != null) { img.addStyle("color: " + fgColor); img.addStyle("background-color: " + bgColor); } // img.attributes = new HashMap<String, String>(); // img.attributes.put("src", src); // img.attributes.put("alt", alt); // img.hint = hint; pieces.add(img); return img; }
public void addStyle(String style) { for (Piece p : pieces) p.addStyle(style); }