本文整理汇总了Java中org.jfree.chart.title.Title类的典型用法代码示例。如果您正苦于以下问题:Java Title类的具体用法?Java Title怎么用?Java Title使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Title类属于org.jfree.chart.title包,在下文中一共展示了Title类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XYTitleAnnotation
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Creates a new annotation to be displayed at the specified (x, y)
* location.
*
* @param x the x-coordinate (in data space).
* @param y the y-coordinate (in data space).
* @param title the title (<code>null</code> not permitted).
* @param anchor the title anchor (<code>null</code> not permitted).
*/
public XYTitleAnnotation(double x, double y, Title title,
RectangleAnchor anchor) {
if (title == null) {
throw new IllegalArgumentException("Null 'title' argument.");
}
if (anchor == null) {
throw new IllegalArgumentException("Null 'anchor' argument.");
}
this.coordinateType = XYCoordinateType.RELATIVE;
this.x = x;
this.y = y;
this.maxWidth = 0.0;
this.maxHeight = 0.0;
this.title = title;
this.anchor = anchor;
}
示例2: testEquals
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Some checks for the equals() method.
*/
public void testEquals() {
// use the TextTitle class because it is a concrete subclass
Title t1 = new TextTitle();
Title t2 = new TextTitle();
assertEquals(t1, t2);
t1.setPosition(RectangleEdge.LEFT);
assertFalse(t1.equals(t2));
t2.setPosition(RectangleEdge.LEFT);
assertTrue(t1.equals(t2));
t1.setHorizontalAlignment(HorizontalAlignment.RIGHT);
assertFalse(t1.equals(t2));
t2.setHorizontalAlignment(HorizontalAlignment.RIGHT);
assertTrue(t1.equals(t2));
t1.setVerticalAlignment(VerticalAlignment.BOTTOM);
assertFalse(t1.equals(t2));
t2.setVerticalAlignment(VerticalAlignment.BOTTOM);
assertTrue(t1.equals(t2));
}
示例3: getLegend
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns the nth legend for a chart, or <code>null</code>.
*
* @param index the legend index (zero-based).
*
* @return The legend (possibly <code>null</code>).
*
* @see #addLegend(LegendTitle)
*/
public LegendTitle getLegend(int index) {
int seen = 0;
Iterator iterator = this.subtitles.iterator();
while (iterator.hasNext()) {
Title subtitle = (Title) iterator.next();
if (subtitle instanceof LegendTitle) {
if (seen == index) {
return (LegendTitle) subtitle;
}
else {
seen++;
}
}
}
return null;
}
示例4: getLegend
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns the nth legend for a chart, or <code>null</code>.
*
* @param index the legend index (zero-based).
*
* @return The legend (possibly <code>null</code>).
*
* @see #addLegend(LegendTitle)
*/
public LegendTitle getLegend(int index) {
int seen = 0;
Iterator iterator = this.subtitles.iterator();
while (iterator.hasNext()) {
Title subtitle = (Title) iterator.next();
if (subtitle instanceof LegendTitle) {
if (seen == index) {
return (LegendTitle) subtitle;
}
else {
seen++;
}
}
}
return null;
}
示例5: setSubtitles
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Sets the title list for the chart (completely replaces any existing
* titles) and sends a {@link ChartChangeEvent} to all registered
* listeners.
*
* @param subtitles the new list of subtitles (<code>null</code> not
* permitted).
*
* @see #getSubtitles()
*/
public void setSubtitles(List subtitles) {
if (subtitles == null) {
throw new NullPointerException("Null 'subtitles' argument.");
}
setNotify(false);
clearSubtitles();
Iterator iterator = subtitles.iterator();
while (iterator.hasNext()) {
Title t = (Title) iterator.next();
if (t != null) {
addSubtitle(t);
}
}
setNotify(true); // this fires a ChartChangeEvent
}
示例6: getLegend
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns the nth legend for a chart, or {@code null}.
*
* @param index the legend index (zero-based).
*
* @return The legend (possibly {@code null}).
*
* @see #addLegend(LegendTitle)
*/
public LegendTitle getLegend(int index) {
int seen = 0;
Iterator iterator = this.subtitles.iterator();
while (iterator.hasNext()) {
Title subtitle = (Title) iterator.next();
if (subtitle instanceof LegendTitle) {
if (seen == index) {
return (LegendTitle) subtitle;
}
else {
seen++;
}
}
}
return null;
}
示例7: setSubtitles
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Sets the title list for the chart (completely replaces any existing
* titles) and sends a {@link ChartChangeEvent} to all registered
* listeners.
*
* @param subtitles the new list of subtitles ({@code null} not
* permitted).
*
* @see #getSubtitles()
*/
public void setSubtitles(List subtitles) {
if (subtitles == null) {
throw new NullPointerException("Null 'subtitles' argument.");
}
setNotify(false);
clearSubtitles();
Iterator iterator = subtitles.iterator();
while (iterator.hasNext()) {
Title t = (Title) iterator.next();
if (t != null) {
addSubtitle(t);
}
}
setNotify(true); // this fires a ChartChangeEvent
}
示例8: XYTitleAnnotation
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Creates a new annotation to be displayed at the specified (x, y)
* location.
*
* @param x the x-coordinate (in data space).
* @param y the y-coordinate (in data space).
* @param title the title (<code>null</code> not permitted).
* @param anchor the title anchor (<code>null</code> not permitted).
*/
public XYTitleAnnotation(double x, double y, Title title,
RectangleAnchor anchor) {
if (title == null) {
throw new IllegalArgumentException("Null 'title' argument.");
}
if (anchor == null) {
throw new IllegalArgumentException("Null 'anchor' argument.");
}
this.coordinateType = XYCoordinateType.RELATIVE;
this.x = x;
this.y = y;
this.maxWidth = 0.0;
this.maxHeight = 0.0;
this.title = title;
this.anchor = anchor;
}
示例9: XYTitleAnnotation
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Creates a new annotation to be displayed at the specified (x, y)
* location.
*
* @param x the x-coordinate (in data space).
* @param y the y-coordinate (in data space).
* @param title the title (<code>null</code> not permitted).
* @param anchor the title anchor (<code>null</code> not permitted).
*/
public XYTitleAnnotation(double x, double y, Title title,
RectangleAnchor anchor) {
super();
if (title == null) {
throw new IllegalArgumentException("Null 'title' argument.");
}
if (anchor == null) {
throw new IllegalArgumentException("Null 'anchor' argument.");
}
this.coordinateType = XYCoordinateType.RELATIVE;
this.x = x;
this.y = y;
this.maxWidth = 0.0;
this.maxHeight = 0.0;
this.title = title;
this.anchor = anchor;
}
示例10: getLegend
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns the nth legend for a chart, or <code>null</code>.
*
* @param index the legend index (zero-based).
*
* @return The legend (possibly <code>null</code>).
*/
public LegendTitle getLegend(int index) {
int seen = 0;
Iterator iterator = this.subtitles.iterator();
while (iterator.hasNext()) {
Title subtitle = (Title) iterator.next();
if (subtitle instanceof LegendTitle) {
if (seen == index) {
return (LegendTitle) subtitle;
}
else {
seen++;
}
}
}
return null;
}
示例11: getLegend
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns the nth legend for a chart, or <code>null</code>.
*
* @param index the legend index (zero-based).
* @return The legend (possibly <code>null</code>).
* @see #addLegend(LegendTitle)
*/
public LegendTitle getLegend(int index) {
int seen = 0;
Iterator iterator = this.subtitles.iterator();
while (iterator.hasNext()) {
Title subtitle = (Title) iterator.next();
if (subtitle instanceof LegendTitle) {
if (seen == index) {
return (LegendTitle) subtitle;
} else {
seen++;
}
}
}
return null;
}
示例12: setSubtitles
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Sets the title list for the chart (completely replaces any existing titles) and sends a {@link ChartChangeEvent}
* to all registered listeners.
*
* @param subtitles the new list of subtitles (<code>null</code> not permitted).
* @see #getSubtitles()
*/
public void setSubtitles(List subtitles) {
if (subtitles == null) {
throw new NullPointerException("Null 'subtitles' argument.");
}
setNotify(false);
clearSubtitles();
Iterator iterator = subtitles.iterator();
while (iterator.hasNext()) {
Title t = (Title) iterator.next();
if (t != null) {
addSubtitle(t);
}
}
setNotify(true); // this fires a ChartChangeEvent
}
示例13: testEquals
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Problem that the equals(...) method distinguishes all fields.
*/
public void testEquals() {
// use the TextTitle class because it is a concrete subclass
Title t1 = new TextTitle();
Title t2 = new TextTitle();
assertEquals(t1, t2);
t1.setPosition(RectangleEdge.LEFT);
assertFalse(t1.equals(t2));
t2.setPosition(RectangleEdge.LEFT);
assertTrue(t1.equals(t2));
t1.setHorizontalAlignment(HorizontalAlignment.RIGHT);
assertFalse(t1.equals(t2));
t2.setHorizontalAlignment(HorizontalAlignment.RIGHT);
assertTrue(t1.equals(t2));
t1.setVerticalAlignment(VerticalAlignment.BOTTOM);
assertFalse(t1.equals(t2));
t2.setVerticalAlignment(VerticalAlignment.BOTTOM);
assertTrue(t1.equals(t2));
t1.setSpacer(new Spacer(Spacer.ABSOLUTE, 5.0, 10.0, 15.0, 20.0));
assertFalse(t1.equals(t2));
t2.setSpacer(new Spacer(Spacer.ABSOLUTE, 5.0, 10.0, 15.0, 20.0));
assertTrue(t1.equals(t2));
}
示例14: getSubtitle
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Returns a chart subtitle.
*
* @param index the index of the chart subtitle (zero based).
*
* @return a chart subtitle.
*/
public Title getSubtitle(int index) {
// check arguments...
if ((index < 0) || (index == getSubtitleCount())) {
throw new IllegalArgumentException("JFreeChart.getSubtitle(...): index out of range.");
}
return (Title) this.subtitles.get(index);
}
示例15: addSubtitle
import org.jfree.chart.title.Title; //导入依赖的package包/类
/**
* Adds a chart subtitle, and notifies registered listeners that the chart has been modified.
*
* @param subtitle the subtitle.
*/
public void addSubtitle(Title subtitle) {
if (subtitle != null) {
this.subtitles.add(subtitle);
subtitle.addChangeListener(this);
fireChartChanged();
}
}