001package com.hfg.xml.msoffice2003.spreadsheetml; 002 003import com.hfg.xml.XMLTag; 004import com.hfg.graphics.ColorUtil; 005 006import java.awt.*; 007 008 009public class ExcelFont extends XMLTag 010{ 011 012 //--------------------------------------------------------------------------- 013 public ExcelFont() 014 { 015 super(SpreadsheetML.FONT); 016 } 017 018 //--------------------------------------------------------------------------- 019 public ExcelFont setColor(Color inValue) 020 { 021 setAttribute(SpreadsheetML.COLOR_ATT, "#" + ColorUtil.colorToHex(inValue)); 022 return this; 023 } 024 025 //--------------------------------------------------------------------------- 026 public ExcelFont setFontName(String inValue) 027 { 028 setAttribute(SpreadsheetML.FONT_NAME_ATT, inValue); 029 return this; 030 } 031 032 //--------------------------------------------------------------------------- 033 public ExcelFont setSize(int inValue) 034 { 035 setAttribute(SpreadsheetML.SIZE_ATT, inValue); 036 return this; 037 } 038 039 //--------------------------------------------------------------------------- 040 public ExcelFont setBold() 041 { 042 setAttribute(SpreadsheetML.BOLD_ATT, "1"); 043 return this; 044 } 045 046 //--------------------------------------------------------------------------- 047 public ExcelFont setItalic() 048 { 049 setAttribute(SpreadsheetML.ITALIC_ATT, "1"); 050 return this; 051 } 052}