KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcckit > plot > SymbolFactory


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.GraphicalElement;
22 import jcckit.graphic.GraphPoint;
23
24 /**
25  * Interface of a symbol factory. A symbol is a {@link GraphicalElement}
26  * or {@link jcckit.graphic.GraphicalComposite}. A symbol factory creates
27  * the same type of symbols. In general, they have all the same size.
28  * But they are distinguished from each other by their positions.
29  * In addition they may also differ in other properties which will
30  * be determined by {@link Hint Hints}.
31  *
32  * @author Franz-Josef Elmer
33  */

34 public interface SymbolFactory {
35   /** Common configuration parameter key need by implementing classes. */
36   public static final String JavaDoc SIZE_KEY = "size",
37                              ATTRIBUTES_KEY = "attributes";
38
39   /** Default size of a symbol = 0.01. */
40   public static final double DEFAULT_SIZE = 0.01;
41
42   /**
43    * Creates a symbol for the specified point taking into account
44    * the specified hints.
45    * @param point The position of the symbol. In general it is a transformation
46    * of a corresponding {@link jcckit.data.DataPoint} into a
47    * {@link GraphPoint}.
48    * @param hintFromPreviousPoint Hint from the previous point of the same
49    * {@link Curve} or <tt>null</tt>.
50    * @param hintFromPreviousCurve Hint from the previous
51    * {@link Curve} or <tt>null</tt>.
52    */

53   public Symbol createSymbol(GraphPoint point, Hint hintFromPreviousPoint,
54                              Hint hintFromPreviousCurve);
55
56   /**
57    * Creates a symbol for the legend at the specified position.
58    * @param centerPosition Center position of the symbol.
59    * @param size The size of the symbol. Will not be used if the symbol
60    * of the curve points have all the same size. In this case
61    * the symbol for the legend has the size of the curve symbols.
62    */

63   public GraphicalElement createLegendSymbol(GraphPoint centerPosition,
64                                              double size);
65 }
66
Popular Tags