001package com.hfg.html; 002 003 004 005//------------------------------------------------------------------------------ 006/** 007 * Represents an image map (<map>) tag. Named ImageMap to avoid colliding with 008 * java.util.Map. 009 * <p> 010 * Note: HTML references imagemaps by the 'name' attribute while XHTML uses the 'id' 011 * attribute. 012 * </p> 013 * @author J. Alex Taylor, hairyfatguy.com 014 */ 015//------------------------------------------------------------------------------ 016// com.hfg XML/HTML Coding Library 017// 018// This library is free software; you can redistribute it and/or 019// modify it under the terms of the GNU Lesser General Public 020// License as published by the Free Software Foundation; either 021// version 2.1 of the License, or (at your option) any later version. 022// 023// This library is distributed in the hope that it will be useful, 024// but WITHOUT ANY WARRANTY; without even the implied warranty of 025// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 026// Lesser General Public License for more details. 027// 028// You should have received a copy of the GNU Lesser General Public 029// License along with this library; if not, write to the Free Software 030// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 031// 032// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 033// [email protected] 034//------------------------------------------------------------------------------ 035 036public class ImageMap extends HTMLTagWithCoreEvents 037{ 038 //########################################################################## 039 // CONSTRUCTORS 040 //########################################################################## 041 042 //-------------------------------------------------------------------------- 043 public ImageMap() 044 { 045 super(HTML.MAP); 046 } 047 048 //-------------------------------------------------------------------------- 049 public ImageMap(String inName) 050 { 051 this(); 052 setName(inName); 053 } 054 055 //########################################################################## 056 // PUBLIC METHODS 057 //########################################################################## 058 059 //-------------------------------------------------------------------------- 060 public Area addArea() 061 { 062 Area area = new Area(); 063 // Using addSubtag() instead of addSubtag() because content (text) 064 // may flow around embedded subtags. 065 addSubtag(area); 066 067 return area; 068 } 069 070 //-------------------------------------------------------------------------- 071 public ImageMap setName(String inValue) 072 { 073 setAttribute(HTML.NAME, inValue); 074 return this; 075 } 076 077 // Overrides for HTMLTag setters to allow method chaining. 078 079 //-------------------------------------------------------------------------- 080 @Override 081 public ImageMap setId(String inValue) 082 { 083 return (ImageMap) super.setId(inValue); 084 } 085 086 // Overrides for HTMLTagWithCoreEvents setters to allow method chaining. 087 088 //-------------------------------------------------------------------------- 089 @Override 090 public ImageMap setOnClick(String inValue) 091 { 092 return (ImageMap) super.setOnClick(inValue); 093 } 094 095 //-------------------------------------------------------------------------- 096 @Override 097 public ImageMap setOnDblClick(String inValue) 098 { 099 return (ImageMap) super.setOnDblClick(inValue); 100 } 101 102 //-------------------------------------------------------------------------- 103 @Override 104 public ImageMap setOnMouseDown(String inValue) 105 { 106 return (ImageMap) super.setOnMouseDown(inValue); 107 } 108 109 //-------------------------------------------------------------------------- 110 @Override 111 public ImageMap setOnMouseMove(String inValue) 112 { 113 return (ImageMap) super.setOnMouseMove(inValue); 114 } 115 116 //-------------------------------------------------------------------------- 117 @Override 118 public ImageMap setOnMouseOut(String inValue) 119 { 120 return (ImageMap) super.setOnMouseOut(inValue); 121 } 122 123 //-------------------------------------------------------------------------- 124 @Override 125 public ImageMap setOnMouseOver(String inValue) 126 { 127 return (ImageMap) super.setOnMouseOver(inValue); 128 } 129 130 //-------------------------------------------------------------------------- 131 @Override 132 public ImageMap setOnMouseUp(String inValue) 133 { 134 return (ImageMap) super.setOnMouseUp(inValue); 135 } 136 137 //-------------------------------------------------------------------------- 138 @Override 139 public ImageMap setOnKeyDown(String inValue) 140 { 141 return (ImageMap) super.setOnKeyDown(inValue); 142 } 143 144 //-------------------------------------------------------------------------- 145 @Override 146 public ImageMap setOnKeyPress(String inValue) 147 { 148 return (ImageMap) super.setOnKeyPress(inValue); 149 } 150 151 //-------------------------------------------------------------------------- 152 @Override 153 public ImageMap setOnKeyUp(String inValue) 154 { 155 return (ImageMap) super.setOnKeyUp(inValue); 156 } 157 158}