KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcckit > plot > SquareSymbolFactory


1 /*
2  * Copyright 2003-2004, Franz-Josef Elmer, All rights reserved
3  *
4  * This library is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details
13  * (http://www.gnu.org/copyleft/lesser.html).
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 package jcckit.plot;
20
21 import jcckit.graphic.GraphicAttributes;
22 import jcckit.graphic.GraphicalElement;
23 import jcckit.graphic.GraphPoint;
24 import jcckit.graphic.Rectangle;
25 import jcckit.util.ConfigParameters;
26
27 /**
28  * A factory of square symbols.
29  *
30  * @author Franz-Josef Elmer
31  */

32 public class SquareSymbolFactory extends AbstractSymbolFactory {
33   /**
34    * Creates an instance from the specified configuration parameters.
35    * For the configuration parameters see the
36    * <a HREF="AbstractSymbolFactory.html#AbstractSymbolFactory(jcckit.util.ConfigParameters)">
37    * constructor</a> of the superclass {@link AbstractSymbolFactory}.
38    */

39   public SquareSymbolFactory(ConfigParameters config) {
40     super(config);
41   }
42
43   /**
44    * Creates a {@link Rectangle}.
45    * @param centerPosition Position of the center of the rectangle.
46    * @param size Diameter of the rectangle.
47    * @param attributes Rectangle attributes.
48    */

49   protected GraphicalElement createPlainSymbol(GraphPoint centerPosition,
50                                                double size,
51                                                GraphicAttributes attributes) {
52     return new Rectangle(centerPosition, size, size, attributes);
53   }
54 }
55
Popular Tags