KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jrobin > graph > ValueMarker


1 /* ============================================================
2  * JRobin : Pure java implementation of RRDTool's functionality
3  * ============================================================
4  *
5  * Project Info: http://www.jrobin.org
6  * Project Lead: Sasa Markovic (saxon@jrobin.org)
7  *
8  * Developers: Sasa Markovic (saxon@jrobin.org)
9  * Arne Vandamme (cobralord@jrobin.org)
10  *
11  * (C) Copyright 2003, by Sasa Markovic.
12  *
13  * This library is free software; you can redistribute it and/or modify it under the terms
14  * of the GNU Lesser General Public License as published by the Free Software Foundation;
15  * either version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  * See the GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License along with this
22  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */

25 package org.jrobin.graph;
26
27 /**
28  * <p>Represents a value grid marker (grid line with or without label on the Y axis).</p>
29  *
30  * @author Arne Vandamme (cobralord@jrobin.org)
31  */

32 class ValueMarker
33 {
34     // ================================================================
35
// -- Members
36
// ================================================================
37
private double value = 0;
38     private boolean major = false;
39
40
41     // ================================================================
42
// -- Constructors
43
// ================================================================
44
/**
45      * Constructs a ValueMarker object by specifying the value at which the grid line
46      * should appear, and specifying if this grid line is a major line or not. In case of a
47      * major grid line, the value will be shown as a label next to the line.
48      * @param value Value as a double at which the grid line should appear.
49      * @param major True if this marker is a major grid line (with label), false if not.
50      */

51     ValueMarker( double value, boolean major )
52     {
53         this.major = major;
54         this.value = value;
55     }
56     
57     // ================================================================
58
// -- Protected methods
59
// ================================================================
60
double getValue()
61     {
62         return value;
63     }
64     
65     boolean isMajor()
66     {
67         return major;
68     }
69 }
70
Popular Tags