PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/src/main/java/com/googlecode/charts4j/Plot.java

http://charts4j.googlecode.com/
Java | 150 lines | 13 code | 12 blank | 125 comment | 0 complexity | f529dd23dc506b29039f71765a446ffa MD5 | raw file
  1/**
  2 *
  3 * The MIT License
  4 *
  5 * Copyright (c) 2011 the original author or authors.
  6 *
  7 * Permission is hereby granted, free of charge, to any person obtaining a copy
  8 * of this software and associated documentation files (the "Software"), to deal
  9 * in the Software without restriction, including without limitation the rights
 10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 11 * copies of the Software, and to permit persons to whom the Software is
 12 * furnished to do so, subject to the following conditions:
 13
 14 * The above copyright notice and this permission notice shall be included in
 15 * all copies or substantial portions of the Software.
 16
 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 23 * THE SOFTWARE.
 24 */
 25
 26package com.googlecode.charts4j;
 27
 28/**
 29 * Top level plot interface. All plots can be annotated with {@link Marker}s.
 30 *
 31 * @author Julien Chastang (julien.c.chastang at gmail dot com)
 32 *
 33 */
 34public interface Plot extends Kloneable<Plot> {
 35
 36    /**
 37     * Set the legend.
 38     *
 39     * @param legend
 40     *            plot legend. Cannot be null.
 41     */
 42    void setLegend(final String legend);
 43
 44    /**
 45     * Set the color for this plot.
 46     *
 47     * @param color
 48     *            color. Cannot be null
 49     */
 50    void setColor(final Color color);
 51
 52    /**
 53     * Add a shape marker to a point.
 54     *
 55     * @param shape
 56     *            Arrows, Diamonds, etc. Cannot be null.
 57     * @param color
 58     *            Color of the shape maker. Cannot be null.
 59     * @param size
 60     *            The size of the shape marker. Must be > 0.
 61     * @param index
 62     *            The index of the point decorated with a shape marker. Must be >=
 63     *            0.
 64     */
 65    void addShapeMarker(final Shape shape, final Color color, final int size, final int index);
 66
 67    /**
 68     * Add a text marker to a point.
 69     *
 70     * @param text
 71     *            Text marker. Cannot be null.
 72     * @param color
 73     *            Color of text marker. Cannot be null.
 74     * @param size
 75     *            The font size of the text marker. Must be > 0.
 76     * @param index
 77     *            The index at which the text marker should be added. Must be >=
 78     *            0.
 79     */
 80    void addTextMarker(final String text, final Color color, final int size, final int index);
 81
 82    /**
 83     * Add a shape marker to each point on a plot.
 84     *
 85     * @param shape
 86     *            Arrows, Diamonds, etc. Cannot be null.
 87     * @param color
 88     *            Color of the shape maker. Cannot be null.
 89     * @param size
 90     *            The size of the shape marker. Must be > 0.
 91     */
 92    void addShapeMarkers(final Shape shape, final Color color, final int size);
 93
 94    /**
 95     * Add a {@link Marker}.
 96     *
 97     * @param marker
 98     *            The text or shape marker. Cannot be null.
 99     * @param index
100     *            The index at which the text marker should be added. Must be >=
101     *            0.
102     */
103    void addMarker(final Marker marker, final int index);
104
105    /**
106     * Add a {@link Marker} to each point on a plot.
107     *
108     * @param marker
109     *            The text or shape marker. Cannot be null.
110     */
111    void addMarkers(final Marker marker);
112
113    /**
114     * Add a {@link Marker}.
115     *
116     * @param marker
117     *            The text or shape marker. Cannot be null.
118     * @param n
119     *            Marker on every n-th data point. Must be >= 1.
120     */
121    void addMarkers(final Marker marker, final int n);
122
123    /**
124     * Add a {@link Marker}.
125     *
126     * @param marker
127     *            The text or shape marker. Cannot be null.
128     * @param startIndex
129     *            The start index for the marker range. Must be >= 0.
130     * @param endIndex
131     *            The end index for the marker range. Must be positive and >
132     *            start index. End point exclusive.
133     * @param n
134     *            Marker on every n-th data point. Must be >= 1.
135     */
136    void addMarkers(final Marker marker, final int startIndex, final int endIndex, final int n);
137
138    /**
139     * Add {@link Marker}s.
140     *
141     * @param marker
142     *            The text or shape marker. Cannot be null.
143     * @param startIndex
144     *            The start index for the marker range. Must be >= 0.
145     * @param endIndex
146     *            The end index for the marker range. Must be positive and >
147     *            start index. End point exclusive.
148     */
149    void addMarkers(final Marker marker, final int startIndex, final int endIndex);
150}