当前位置: 首页>>代码示例>>Java>>正文


Java SortOrder类代码示例

本文整理汇总了Java中org.jfree.util.SortOrder的典型用法代码示例。如果您正苦于以下问题:Java SortOrder类的具体用法?Java SortOrder怎么用?Java SortOrder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SortOrder类属于org.jfree.util包,在下文中一共展示了SortOrder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LegendTitle

import org.jfree.util.SortOrder; //导入依赖的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

示例2: sortByKeys

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Sorts the items in the list by key.
 *
 * @param order  the sort order (<code>null</code> not permitted).
 */
public void sortByKeys(SortOrder order) {
    final int size = this.keys.size();
    final DefaultKeyedValue[] data = new DefaultKeyedValue[size];

    for (int i = 0; i < size; i++) {
        data[i] = new DefaultKeyedValue((Comparable) this.keys.get(i),
                (Number) this.values.get(i));
    }

    Comparator comparator = new KeyedValueComparator(
            KeyedValueComparatorType.BY_KEY, order);
    Arrays.sort(data, comparator);
    clear();

    for (int i = 0; i < data.length; i++) {
        final DefaultKeyedValue value = data[i];
        addValue(value.getKey(), value.getValue());
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:DefaultKeyedValues.java

示例3: sortByValues

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Sorts the items in the list by value.  If the list contains
 * <code>null</code> values, they will sort to the end of the list,
 * irrespective of the sort order.
 *
 * @param order  the sort order (<code>null</code> not permitted).
 */
public void sortByValues(SortOrder order) {
    final int size = this.keys.size();
    final DefaultKeyedValue[] data = new DefaultKeyedValue[size];
    for (int i = 0; i < size; i++) {
        data[i] = new DefaultKeyedValue((Comparable) this.keys.get(i),
                (Number) this.values.get(i));
    }

    Comparator comparator = new KeyedValueComparator(
            KeyedValueComparatorType.BY_VALUE, order);
    Arrays.sort(data, comparator);

    clear();
    for (int i = 0; i < data.length; i++) {
        final DefaultKeyedValue value = data[i];
        addValue(value.getKey(), value.getValue());
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:26,代码来源:DefaultKeyedValues.java

示例4: chosenClasses

import org.jfree.util.SortOrder; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private DefaultPieDataset chosenClasses(DefaultPieDataset dataset) {
		
	dataset.sortByValues(SortOrder.DESCENDING);
       List<String> keys = dataset.getKeys();
	DefaultPieDataset definitivedataset = new DefaultPieDataset();
	
	int i=0;
	double percentage=0;
	
	while(i<keys.size() && i<NUM_CLASSES){
		definitivedataset.setValue(keys.get(i), dataset.getValue(keys.get(i)));	
		percentage = percentage + dataset.getValue(keys.get(i)).doubleValue();
		i++;	
	}

   	if(i<keys.size())
   		definitivedataset.setValue(OTHERS_CLASSES, 100-percentage);
   	
   	return definitivedataset;
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:22,代码来源:ProfilerView.java

示例5: chosenClasses

import org.jfree.util.SortOrder; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private DefaultPieDataset chosenClasses(DefaultPieDataset dataset) {

	dataset.sortByValues(SortOrder.DESCENDING);
	List<String> keys = dataset.getKeys();
	DefaultPieDataset definitivedataset = new DefaultPieDataset();

	int i=0;
	double percentage=0;

	while(i<keys.size() && i<CLASSCHART){
		definitivedataset.setValue(keys.get(i), dataset.getValue(keys.get(i)));	
		percentage=percentage + dataset.getValue(keys.get(i)).doubleValue();
		i++;	
	}

	if(i<keys.size())
		definitivedataset.setValue(OTHERS_CLASSES, 100-percentage);

	return definitivedataset;
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:22,代码来源:ProfilerViewWithoutSplit.java

示例6: createBarChart3D

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Creates a bar chart with a 3D effect.
 * <P>
 * The chart object returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as the
 * range axis, and a {@link BarRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the plot orientation (horizontal or vertical) (<code>null</code>
 *                     not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A bar chart with a 3D effect.
 */
public static JFreeChart createBarChart3D(String title,
                                          String categoryAxisLabel,
                                          String valueAxisLabel,
                                          CategoryDataset dataset,
                                          PlotOrientation orientation,
                                          boolean legend,
                                          boolean tooltips,
                                          boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    BarRenderer3D renderer = new BarRenderer3D();
    if (tooltips) {
        renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setItemURLGenerator(new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    plot.setOrientation(orientation);
    if (orientation == PlotOrientation.HORIZONTAL) {
        // change rendering order to ensure that bar overlapping is the right way around
        plot.setRowRenderingOrder(SortOrder.DESCENDING);
        plot.setColumnRenderingOrder(SortOrder.DESCENDING);
    }
    plot.setForegroundAlpha(0.75f);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:57,代码来源:ChartFactory.java

示例7: createStackedBarChart3D

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with a 3D effect and default settings.
 * <P>
 * The chart object returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as the
 * range axis, and a {@link StackedBarRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the orientation (horizontal or vertical) (<code>null</code> not
 *                     permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A stacked bar chart with a 3D effect.
 */
public static JFreeChart createStackedBarChart3D(String title,
                                                 String categoryAxisLabel,
                                                 String valueAxisLabel,
                                                 CategoryDataset dataset,
                                                 PlotOrientation orientation,
                                                 boolean legend,
                                                 boolean tooltips,
                                                 boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    // create the renderer...
    CategoryItemRenderer renderer = new StackedBarRenderer3D();
    if (tooltips) {
        renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setItemURLGenerator(new StandardCategoryURLGenerator());
    }

    // create the plot...
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    plot.setOrientation(orientation);
    if (orientation == PlotOrientation.HORIZONTAL) {
        // change rendering order to ensure that bar overlapping is the right way around
        plot.setColumnRenderingOrder(SortOrder.DESCENDING);
    }

    // create the chart...
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:58,代码来源:ChartFactory.java

示例8: setRowRenderingOrder

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Sets the order in which the rows should be rendered.
 * 
 * @param order  the order (<code>null</code> not allowed).
 */
public void setRowRenderingOrder(SortOrder order) {
    if (order == null) {
        throw new IllegalArgumentException("Null 'order' argument.");
    }
    this.rowRenderingOrder = order;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:CategoryPlot.java

示例9: sortByKeys

import org.jfree.util.SortOrder; //导入依赖的package包/类
/**
 * Sorts the items in the list by key.
 *
 * @param order  the sort order (ascending or descending).
 */
public void sortByKeys(final SortOrder order) {

    final Comparator comparator = new KeyedValueComparator(
        KeyedValueComparatorType.BY_KEY, order
    );
    Collections.sort(this.data, comparator);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:DefaultKeyedValues.java


注:本文中的org.jfree.util.SortOrder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。