1 34 35 package org.krysalis.jcharts.properties; 36 37 38 import org.krysalis.jcharts.test.HTMLGenerator; 39 import org.krysalis.jcharts.test.HTMLTestable; 40 import org.krysalis.jcharts.properties.util.ChartStroke; 41 import org.krysalis.jcharts.properties.util.ChartFont; 42 43 import java.awt.*; 44 45 46 51 public class LegendProperties extends LegendAreaProperties implements HTMLTestable 52 { 53 public static final Font DEFAULT_FONT = new Font( "Serif", Font.PLAIN, 12 ); 54 public static final Paint DEFAULT_FONT_PAINT = Color.black; 55 public static final Stroke DEFAULT_ICON_BORDER_STROKE = new BasicStroke( 1.0f ); 56 public static final Paint DEFAULT_ICON_BORDER_PAINT = Color.black; 57 58 private ChartFont font = ChartFont.DEFAULT_LEGEND; 59 60 private Paint iconBorderPaint = DEFAULT_ICON_BORDER_PAINT; 61 private Stroke iconBorderStroke = DEFAULT_ICON_BORDER_STROKE; 62 private Dimension size = null; 63 64 65 68 public LegendProperties() 69 { 70 super(); 71 72 super.setBackgroundPaint( null ); 74 75 super.setBorderStroke( ChartStroke.DEFAULT_LEGEND_OUTLINE ); 76 } 77 78 79 84 public void setChartFont( ChartFont legendFont ) 85 { 86 this.font = legendFont; 87 } 88 89 90 95 public ChartFont getChartFont() 96 { 97 return this.font; 98 } 99 100 101 106 public void setIconBorderPaint( Paint iconBorderPaint ) 107 { 108 this.iconBorderPaint = iconBorderPaint; 109 } 110 111 112 117 public Paint getIconBorderPaint() 118 { 119 return this.iconBorderPaint; 120 } 121 122 123 128 public void setIconBorderStroke( Stroke stroke ) 129 { 130 this.iconBorderStroke = stroke; 131 } 132 133 134 139 public Stroke getIconBorderStroke() 140 { 141 return this.iconBorderStroke; 142 } 143 144 145 150 public void toHTML( HTMLGenerator htmlGenerator ) 151 { 152 htmlGenerator.propertiesTableStart( "LegendProperties" ); 153 super.toHTML( htmlGenerator ); 154 htmlGenerator.addTableRow( "Icon Border Paint", this.getIconBorderPaint() ); 155 htmlGenerator.addTableRow( "Icon Border Stroke", this.getIconBorderStroke() ); 156 htmlGenerator.addTableRow( "Chart Font", this.getChartFont() ); 157 htmlGenerator.propertiesTableEnd(); 158 } 159 160 161 165 public java.awt.Dimension getSize() 166 { 167 return this.size; 168 } 169 170 171 175 public void setSize( java.awt.Dimension size ) 176 { 177 this.size = size; 178 } 179 180 } 181 | Popular Tags |