本文整理汇总了Java中org.jfree.chart.LegendItemSource类的典型用法代码示例。如果您正苦于以下问题:Java LegendItemSource类的具体用法?Java LegendItemSource怎么用?Java LegendItemSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LegendItemSource类属于org.jfree.chart包,在下文中一共展示了LegendItemSource类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: LegendTitle
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Creates a new legend title with the specified arrangement.
*
* @param source the source.
* @param hLayout the horizontal item arrangement (<code>null</code> not
* permitted).
* @param vLayout the vertical item arrangement (<code>null</code> not
* permitted).
*/
public LegendTitle(LegendItemSource source,
Arrangement hLayout, Arrangement vLayout) {
this.sources = new LegendItemSource[] {source};
this.items = new BlockContainer(hLayout);
this.hLayout = hLayout;
this.vLayout = vLayout;
this.backgroundPaint = null;
this.legendItemGraphicEdge = RectangleEdge.LEFT;
this.legendItemGraphicAnchor = RectangleAnchor.CENTER;
this.legendItemGraphicLocation = RectangleAnchor.CENTER;
this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.itemFont = DEFAULT_ITEM_FONT;
this.itemPaint = DEFAULT_ITEM_PAINT;
this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:LegendTitle.java
示例2: LegendTitle
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Creates a new legend title with the specified arrangement.
*
* @param source the source.
* @param hLayout the horizontal item arrangement (<code>null</code> not
* permitted).
* @param vLayout the vertical item arrangement (<code>null</code> not
* permitted).
*/
public LegendTitle(LegendItemSource source,
Arrangement hLayout, Arrangement vLayout) {
this.sources = new LegendItemSource[] {source};
this.items = new BlockContainer(hLayout);
this.hLayout = hLayout;
this.vLayout = vLayout;
this.backgroundPaint = null;
this.legendItemGraphicEdge = RectangleEdge.LEFT;
this.legendItemGraphicAnchor = RectangleAnchor.CENTER;
this.legendItemGraphicLocation = RectangleAnchor.CENTER;
this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.itemFont = DEFAULT_ITEM_FONT;
this.itemPaint = DEFAULT_ITEM_PAINT;
this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.sortOrder = SortOrder.ASCENDING;
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:26,代码来源:LegendTitle.java
示例3: LegendTitle
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Creates a new legend title with the specified arrangement.
*
* @param source the source.
* @param hLayout the horizontal item arrangement ({@code null} not
* permitted).
* @param vLayout the vertical item arrangement ({@code null} not
* permitted).
*/
public LegendTitle(LegendItemSource source,
Arrangement hLayout, Arrangement vLayout) {
this.sources = new LegendItemSource[] {source};
this.items = new BlockContainer(hLayout);
this.hLayout = hLayout;
this.vLayout = vLayout;
this.backgroundPaint = null;
this.legendItemGraphicEdge = RectangleEdge.LEFT;
this.legendItemGraphicAnchor = RectangleAnchor.CENTER;
this.legendItemGraphicLocation = RectangleAnchor.CENTER;
this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.itemFont = DEFAULT_ITEM_FONT;
this.itemPaint = DEFAULT_ITEM_PAINT;
this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.sortOrder = SortOrder.ASCENDING;
}
开发者ID:jfree,项目名称:jfreechart,代码行数:26,代码来源:LegendTitle.java
示例4: LegendTitle
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Creates a new legend title with the specified arrangement.
*
* @param source the source.
* @param hLayout the horizontal item arrangement (<code>null</code> not
* permitted).
* @param vLayout the vertical item arrangement (<code>null</code> not
* permitted).
*/
public LegendTitle(LegendItemSource source,
Arrangement hLayout, Arrangement vLayout) {
this.sources = new LegendItemSource[] {source};
this.items = new BlockContainer(hLayout);
this.hLayout = hLayout;
this.vLayout = vLayout;
this.backgroundPaint = null;
this.legendItemGraphicEdge = RectangleEdge.LEFT;
this.legendItemGraphicAnchor = RectangleAnchor.CENTER;
this.legendItemGraphicLocation = RectangleAnchor.CENTER;
this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
this.itemFont = DEFAULT_ITEM_FONT;
this.itemPaint = DEFAULT_ITEM_PAINT;
this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
}
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:25,代码来源:LegendTitle.java
示例5: createLegend
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
public static LegendTitle createLegend() {
final LegendItemCollection legendItems = new LegendItemCollection();
FontRenderContext frc = new FontRenderContext(null, true, true);
Font legenfont = new Font(Font.SANS_SERIF, Font.PLAIN, 12);
GlyphVector gv = legenfont.createGlyphVector(frc, new char[] {'I', 'I'});
Shape shape = gv.getVisualBounds();
Rectangle2D bounds = shape.getBounds2D();
{
LegendItem li = new LegendItem("Standard error", null, null, null,
new ErrorIndicator(bounds), new BasicStroke(), ErrorIndicator.ERROR_INDICATOR_COLOR);
li.setLabelFont(legenfont);
legendItems.add(li);
}
LegendTitle legend = new LegendTitle(new LegendItemSource() {
@Override
public LegendItemCollection getLegendItems() {
return legendItems;
}});
legend.setPosition(RectangleEdge.BOTTOM);
legend.setMargin(new RectangleInsets(0,30,0,0));
legend.setPadding(RectangleInsets.ZERO_INSETS);
legend.setLegendItemGraphicPadding(new RectangleInsets(0,20,0,0));
legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
return legend;
}
开发者ID:uq-eresearch,项目名称:aorra,代码行数:26,代码来源:ErrorIndicatorLegend.java
示例6: createLegend
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
private LegendTitle createLegend() {
final LegendItemCollection legendItems = new LegendItemCollection();
FontRenderContext frc = new FontRenderContext(null, true, true);
GlyphVector gv = LEGEND_FONT.createGlyphVector(frc, new char[] {'X'});
Shape shape = gv.getGlyphVisualBounds(0);
for(Pair<String, Color> p : getLegend()) {
LegendItem li = new LegendItem(p.getLeft(), null, null, null, shape, p.getRight());
li.setLabelFont(LEGEND_FONT);
legendItems.add(li);
}
LegendTitle legend = new LegendTitle(new LegendItemSource() {
@Override
public LegendItemCollection getLegendItems() {
return legendItems;
}});
legend.setPosition(RectangleEdge.BOTTOM);
return legend;
}
开发者ID:uq-eresearch,项目名称:aorra,代码行数:19,代码来源:LandPracticeSystems.java
示例7: createLegend
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
public static void createLegend(JFreeChart kmPlot, List<KMPlotPointSeriesSet> plotPointSeriesSetCollection) {
LegendTitle legend = kmPlot.getLegend();
LegendItemSource[] sources = new LegendItemSource[1];
KMLegendItemSource legendSrc = new KMLegendItemSource();
Comparator<KMPlotPointSeriesSet> nameComparator = new Comparator<KMPlotPointSeriesSet>() {
public int compare(KMPlotPointSeriesSet series1, KMPlotPointSeriesSet series2) {
return series1.getName().compareToIgnoreCase(series2.getName());
}
};
Collections.sort(plotPointSeriesSetCollection, nameComparator);
LegendItem item ;
for (KMPlotPointSeriesSet plotPointSeries : plotPointSeriesSetCollection) {
Color color = plotPointSeries.getColor();
String title = plotPointSeries.getLegendTitle() + " (" + plotPointSeries.getGroupSize() + ")";
item = new LegendItem(title, null, null, null, new Rectangle2D.Double(2,2,10,10), color);
legendSrc.addLegendItem(item);
}
sources[0] = legendSrc;
legend.setSources(sources);
}
开发者ID:NCIP,项目名称:caintegrator,代码行数:22,代码来源:JFreeChartIKMPlottermpl.java
示例8: setSources
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Sets the legend item sources and sends a {@link TitleChangeEvent} to
* all registered listeners.
*
* @param sources the sources (<code>null</code> not permitted).
*/
public void setSources(LegendItemSource[] sources) {
if (sources == null) {
throw new IllegalArgumentException("Null 'sources' argument.");
}
this.sources = sources;
notifyListeners(new TitleChangeEvent(this));
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:LegendTitle.java
示例9: setSources
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Sets the legend item sources and sends a {@link TitleChangeEvent} to
* all registered listeners.
*
* @param sources the sources (<code>null</code> not permitted).
*/
public void setSources(LegendItemSource[] sources) {
if (sources == null) {
throw new IllegalArgumentException("Null 'sources' argument.");
}
this.sources = sources;
notifyListeners(new TitleChangeEvent(this));
}
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:14,代码来源:LegendTitle.java
示例10: removeItemFromLegend
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
protected void removeItemFromLegend(int itemToRemove, JFreeChart chart) {
LegendItemCollection legendItems = chart.getPlot().getLegendItems();
final LegendItemCollection newLegendItems = new LegendItemCollection();
for (int i = 0; i < legendItems.getItemCount(); i++) {
if (itemToRemove != i)
newLegendItems.add(legendItems.get(i));
}
LegendItemSource source = new LegendItemSource() {
@Override
public LegendItemCollection getLegendItems() {
return newLegendItems;
}
};
chart.removeLegend();
chart.addLegend(new LegendTitle(source));
}
开发者ID:BrainTech,项目名称:svarog,代码行数:22,代码来源:EvokedPotentialChart.java
示例11: createBarChart
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
private static JFreeChart createBarChart(ADCDataset dataset) {
AutoSubCategoryAxis categoryAxis = new AutoSubCategoryAxis(dataset);
categoryAxis.setCategoryLabelPositionOffset(0);
categoryAxis.setLabel(dataset.get(Attribute.X_AXIS_LABEL));
CategoryDataset fixedDataset = categoryAxis.getFixedDataset();
PartitionedNumberAxis vAxis = new PartitionedNumberAxis(
dataset.get(Attribute.Y_AXIS_LABEL));
CategoryPlot plot = new CategoryPlot(fixedDataset,
categoryAxis, vAxis, new Renderer(fixedDataset));
plot.setOrientation(PlotOrientation.VERTICAL);
JFreeChart chart = new JFreeChart(dataset.get(Attribute.TITLE),
JFreeChart.DEFAULT_TITLE_FONT, plot, false);
final LegendItemCollection items = new LegendItemCollection();
for(Condition c : Condition.values()) {
if(c != Condition.NOT_EVALUATED) {
items.add(new LegendItem(c.getLabel(), null, null, null,
new Rectangle2D.Double(-6.0, -6.0, 10.0,10.0), c.getColor()));
}
}
LegendTitle legend = new LegendTitle(new LegendItemSource() {
@Override
public LegendItemCollection getLegendItems() {
return items;
}});
legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
legend.setBackgroundPaint(Color.white);
legend.setPosition(RectangleEdge.BOTTOM);
chart.addLegend(legend);
new StandardChartTheme("JFree").apply(chart);
return chart;
}
开发者ID:uq-eresearch,项目名称:aorra,代码行数:32,代码来源:PSIIMaxHeq.java
示例12: SmartLegendTitle
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
public SmartLegendTitle(LegendItemSource source, Arrangement hLayout, Arrangement vLayout) {
super(source, hLayout, vLayout);
}
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:SmartLegendTitle.java
示例13: run
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
@Override
public void run() {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries serie = new XYSeries("insert", true, false);
for (int ligne = 0; ligne < getDatas().size(); ++ligne) {
serie.add(ligne, getDatas().get(ligne));
}
dataset.addSeries(serie);
NumberAxis Laxis = new NumberAxis("n°revision");
XYBarRenderer revBarRenderer = new XYBarRenderer();
XYPlot revPlot = new XYPlot();
revPlot.setDataset(dataset);
revPlot.setRangeAxis(Laxis);
revPlot.setRenderer(revBarRenderer);
XYSeriesCollection xySerieCollectiondataset = new XYSeriesCollection();
XYLineAndShapeRenderer lengthRenderer = new XYLineAndShapeRenderer();
int i = -1;
int iName = 0;
for (ArrayList<Integer> lengthSerie : lengths) {
serie = new XYSeries(legend.get(iName));
++iName;
lengthRenderer.setSeriesShapesVisible(++i, false);
// PROMPT LENGTHS DATA
for (int ligne = 0; ligne < lengthSerie.size(); ++ligne) {
serie.add(ligne, lengthSerie.get(ligne));
}
xySerieCollectiondataset.addSeries(serie);
}
NumberAxis Raxis = new NumberAxis("length");
XYPlot lengthPlot = new XYPlot();
lengthPlot.setDataset(xySerieCollectiondataset);
lengthPlot.setRangeAxis(Raxis);
lengthRenderer.setSeriesPaint(2, Color.MAGENTA);
lengthPlot.setRenderer(lengthRenderer);
CombinedDomainXYPlot mainPlot = new CombinedDomainXYPlot();
mainPlot.add(revPlot);
mainPlot.add(lengthPlot);
setChart(new JFreeChart("Spectrum of " + getOpName(), null, mainPlot,
false));
final LegendItemCollection legendItemsOld = mainPlot.getLegendItems();
LegendItemSource source = new LegendItemSource() {
public LegendItemCollection getLegendItems() {
LegendItemCollection lic = new LegendItemCollection();
int itemCount = legendItemsOld.getItemCount();
for (int i = 0; i < itemCount; i++) {
lic.add(legendItemsOld.get(i));
}
return lic;
}
};
getChart().addLegend(new LegendTitle(source));
getChart().getLegend().setPosition(RectangleEdge.TOP);
getChart().getLegend().getItemContainer().getBlocks();
if (!note.isEmpty()){
TextTitle legendText = new TextTitle("Notes : \n"+note);
legendText.setPosition(RectangleEdge.BOTTOM);
getChart().addSubtitle(legendText);
}
setFrame(new ChartFrame(getPageName(), getChart()));
}
开发者ID:Chat-Wane,项目名称:LSEQ,代码行数:73,代码来源:MultipleChartView.java
示例14: getSources
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Returns the legend item sources.
*
* @return The sources.
*/
public LegendItemSource[] getSources() {
return this.sources;
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:LegendTitle.java
示例15: getSources
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Returns the legend item sources.
*
* @return The sources.
*/
public LegendItemSource[] getSources() {
return this.sources;
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:9,代码来源:LegendTitle.java
示例16: setSources
import org.jfree.chart.LegendItemSource; //导入依赖的package包/类
/**
* Sets the legend item sources and sends a {@link TitleChangeEvent} to
* all registered listeners.
*
* @param sources the sources (<code>null</code> not permitted).
*/
public void setSources(LegendItemSource[] sources) {
ParamChecks.nullNotPermitted(sources, "sources");
this.sources = sources;
notifyListeners(new TitleChangeEvent(this));
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:12,代码来源:LegendTitle.java
注:本文中的org.jfree.chart.LegendItemSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论