/* * Copyright 2003-2004, Franz-Josef Elmer, All rights reserved * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details * (http://www.gnu.org/copyleft/lesser.html). * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package jcckit.graphic; import java.awt.Color; import jcckit.util.ConfigParameters; /** * Basic attributes for shapes. * * @author Franz-Josef Elmer */ public class ShapeAttributes implements LineAttributes, FillAttributes { /** Configuration parameter key. */ public static final String FILL_COLOR_KEY = "fillColor", LINE_COLOR_KEY = "lineColor", LINE_THICKNESS_KEY = "lineThickness", LINE_PATTERN_KEY = "linePattern"; private final Color _fillColor; private final Color _lineColor; private final double _lineThickness; private final double[] _linePattern; /** * Creates a new instance based on the specified configuration * parameters. *
Key & Default Value | Type | Mandatory | *Description |
---|---|---|---|
fillColor = no filling | Color | *no | The fill color of the shape. |
lineColor = no line | Color | *no | The color of a line, a polygon, or the border of a shape. |
lineThickness = 0 | double | *no | *The thickness of a line. A thickness of zero means that * the renderer will draw the thinest line possible. |
linePattern = solid line | *double[] | no | *A sequence of lengths where the pen is alternatively * down or up. For example, 0.1 0.1 will lead to a dashed * line whereas 0.02 0.02 is the pattern of a dotted * line and 0.02 0.02 0.1 0.02 of a dashed-dotted * line. |