/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. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. * THE SOFTWARE.
  22. */
  23. package com.googlecode.charts4j;
  24. /**
  25. * Top level plot interface. All plots can be annotated with {@link Marker}s.
  26. *
  27. * @author Julien Chastang (julien.c.chastang at gmail dot com)
  28. *
  29. */
  30. public interface Plot extends Kloneable<Plot> {
  31. /**
  32. * Set the legend.
  33. *
  34. * @param legend
  35. * plot legend. Cannot be null.
  36. */
  37. void setLegend(final String legend);
  38. /**
  39. * Set the color for this plot.
  40. *
  41. * @param color
  42. * color. Cannot be null
  43. */
  44. void setColor(final Color color);
  45. /**
  46. * Add a shape marker to a point.
  47. *
  48. * @param shape
  49. * Arrows, Diamonds, etc. Cannot be null.
  50. * @param color
  51. * Color of the shape maker. Cannot be null.
  52. * @param size
  53. * The size of the shape marker. Must be > 0.
  54. * @param index
  55. * The index of the point decorated with a shape marker. Must be >=
  56. * 0.
  57. */
  58. void addShapeMarker(final Shape shape, final Color color, final int size, final int index);
  59. /**
  60. * Add a text marker to a point.
  61. *
  62. * @param text
  63. * Text marker. Cannot be null.
  64. * @param color
  65. * Color of text marker. Cannot be null.
  66. * @param size
  67. * The font size of the text marker. Must be > 0.
  68. * @param index
  69. * The index at which the text marker should be added. Must be >=
  70. * 0.
  71. */
  72. void addTextMarker(final String text, final Color color, final int size, final int index);
  73. /**
  74. * Add a shape marker to each point on a plot.
  75. *
  76. * @param shape
  77. * Arrows, Diamonds, etc. Cannot be null.
  78. * @param color
  79. * Color of the shape maker. Cannot be null.
  80. * @param size
  81. * The size of the shape marker. Must be > 0.
  82. */
  83. void addShapeMarkers(final Shape shape, final Color color, final int size);
  84. /**
  85. * Add a {@link Marker}.
  86. *
  87. * @param marker
  88. * The text or shape marker. Cannot be null.
  89. * @param index
  90. * The index at which the text marker should be added. Must be >=
  91. * 0.
  92. */
  93. void addMarker(final Marker marker, final int index);
  94. /**
  95. * Add a {@link Marker} to each point on a plot.
  96. *
  97. * @param marker
  98. * The text or shape marker. Cannot be null.
  99. */
  100. void addMarkers(final Marker marker);
  101. /**
  102. * Add a {@link Marker}.
  103. *
  104. * @param marker
  105. * The text or shape marker. Cannot be null.
  106. * @param n
  107. * Marker on every n-th data point. Must be >= 1.
  108. */
  109. void addMarkers(final Marker marker, final int n);
  110. /**
  111. * Add a {@link Marker}.
  112. *
  113. * @param marker
  114. * The text or shape marker. Cannot be null.
  115. * @param startIndex
  116. * The start index for the marker range. Must be >= 0.
  117. * @param endIndex
  118. * The end index for the marker range. Must be positive and >
  119. * start index. End point exclusive.
  120. * @param n
  121. * Marker on every n-th data point. Must be >= 1.
  122. */
  123. void addMarkers(final Marker marker, final int startIndex, final int endIndex, final int n);
  124. /**
  125. * Add {@link Marker}s.
  126. *
  127. * @param marker
  128. * The text or shape marker. Cannot be null.
  129. * @param startIndex
  130. * The start index for the marker range. Must be >= 0.
  131. * @param endIndex
  132. * The end index for the marker range. Must be positive and >
  133. * start index. End point exclusive.
  134. */
  135. void addMarkers(final Marker marker, final int startIndex, final int endIndex);
  136. }