Java Code Examples for org.jfree.chart.labels.ItemLabelAnchor#OUTSIDE12

The following examples show how to use org.jfree.chart.labels.ItemLabelAnchor#OUTSIDE12 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartFactory.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a bar chart.  The chart object returned by this method uses a
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis}
 * for the domain axis, a {@link NumberAxis} as the range axis, and a
 * {@link BarRenderer} 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 legend  a flag specifying whether or not a legend is required.
 *
 * @return A bar chart.
 */
public static JFreeChart createBarChart(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
    BarRenderer renderer = new BarRenderer();
    ItemLabelPosition position1 = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
    renderer.setBasePositiveItemLabelPosition(position1);
    ItemLabelPosition position2 = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
    renderer.setBaseNegativeItemLabelPosition(position2);
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator());
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example 2
Source File: Histogram.java    From chipster with MIT License 5 votes vote down vote up
private void updateHistogram() throws MicroarrayException, IOException {

		updateChipBox();

		int barCount = ((SpinnerNumberModel) barCountSpinner.getModel()).getNumber().intValue();
		String expression = ((Variable) chipBox.getSelectedItem()).getExpression();
		FloatArrayList histogram = getHistogram(barCount, expression);

		if (histogram != null) {
			CategoryDataset dataset = toCategoryDataset(histogram);

			CategoryAxis categoryAxis = new CategoryAxis("value");
			ValueAxis valueAxis = new NumberAxis("count");

			BarRenderer renderer = new BarRenderer();
			ItemLabelPosition position1 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
			renderer.setBasePositiveItemLabelPosition(position1);
			ItemLabelPosition position2 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
			renderer.setBaseNegativeItemLabelPosition(position2);

			CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
			plot.setOrientation(PlotOrientation.VERTICAL);
			JFreeChart chart = new JFreeChart(data.getName(), JFreeChart.DEFAULT_TITLE_FONT, plot, false);

			visualisationPanel.removeAll();
			visualisationPanel.add(makePanel(chart), BorderLayout.CENTER);
			visualisationPanel.validate();

		} else {
			throw new IllegalArgumentException("histogram not supported for " + data.getName());
		}

	}
 
Example 3
Source File: AbstractRenderer.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}
 
Example 4
Source File: PseudoSpectraRenderer.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Calculates the item label anchor point.
 *
 * @param anchor the anchor.
 * @param bar the bar.
 * @param orientation the plot orientation.
 *
 * @return The anchor point.
 */
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar,
    PlotOrientation orientation) {

  Point2D result = null;
  double offset = getItemLabelAnchorOffset();
  double x0 = bar.getX() - offset;
  double x1 = bar.getX();
  double x2 = bar.getX() + offset;
  double x3 = bar.getCenterX();
  double x4 = bar.getMaxX() - offset;
  double x5 = bar.getMaxX();
  double x6 = bar.getMaxX() + offset;

  double y0 = bar.getMaxY() + offset;
  double y1 = bar.getMaxY();
  double y2 = bar.getMaxY() - offset;
  double y3 = bar.getCenterY();
  double y4 = bar.getMinY() + offset;
  double y5 = bar.getMinY();
  double y6 = bar.getMinY() - offset;

  if (anchor == ItemLabelAnchor.CENTER) {
    result = new Point2D.Double(x3, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE1) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE2) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE3) {
    result = new Point2D.Double(x4, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE4) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE5) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE6) {
    result = new Point2D.Double(x3, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE7) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE8) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE9) {
    result = new Point2D.Double(x2, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE10) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE11) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE12) {
    result = new Point2D.Double(x3, y4);
  } else if (anchor == ItemLabelAnchor.OUTSIDE1) {
    result = new Point2D.Double(x5, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE2) {
    result = new Point2D.Double(x6, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE3) {
    result = new Point2D.Double(x6, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE4) {
    result = new Point2D.Double(x6, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE5) {
    result = new Point2D.Double(x5, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE6) {
    result = new Point2D.Double(x3, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE7) {
    result = new Point2D.Double(x1, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE8) {
    result = new Point2D.Double(x0, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE9) {
    result = new Point2D.Double(x0, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE10) {
    result = new Point2D.Double(x0, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE11) {
    result = new Point2D.Double(x1, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE12) {
    result = new Point2D.Double(x3, y6);
  }

  return result;

}
 
Example 5
Source File: AbstractRenderer.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}
 
Example 6
Source File: AbstractRenderer.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}
 
Example 7
Source File: PseudoSpectraRenderer.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Calculates the item label anchor point.
 *
 * @param anchor the anchor.
 * @param bar the bar.
 * @param orientation the plot orientation.
 *
 * @return The anchor point.
 */
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar,
    PlotOrientation orientation) {

  Point2D result = null;
  double offset = getItemLabelAnchorOffset();
  double x0 = bar.getX() - offset;
  double x1 = bar.getX();
  double x2 = bar.getX() + offset;
  double x3 = bar.getCenterX();
  double x4 = bar.getMaxX() - offset;
  double x5 = bar.getMaxX();
  double x6 = bar.getMaxX() + offset;

  double y0 = bar.getMaxY() + offset;
  double y1 = bar.getMaxY();
  double y2 = bar.getMaxY() - offset;
  double y3 = bar.getCenterY();
  double y4 = bar.getMinY() + offset;
  double y5 = bar.getMinY();
  double y6 = bar.getMinY() - offset;

  if (anchor == ItemLabelAnchor.CENTER) {
    result = new Point2D.Double(x3, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE1) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE2) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE3) {
    result = new Point2D.Double(x4, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE4) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE5) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE6) {
    result = new Point2D.Double(x3, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE7) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE8) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE9) {
    result = new Point2D.Double(x2, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE10) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE11) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE12) {
    result = new Point2D.Double(x3, y4);
  } else if (anchor == ItemLabelAnchor.OUTSIDE1) {
    result = new Point2D.Double(x5, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE2) {
    result = new Point2D.Double(x6, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE3) {
    result = new Point2D.Double(x6, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE4) {
    result = new Point2D.Double(x6, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE5) {
    result = new Point2D.Double(x5, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE6) {
    result = new Point2D.Double(x3, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE7) {
    result = new Point2D.Double(x1, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE8) {
    result = new Point2D.Double(x0, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE9) {
    result = new Point2D.Double(x0, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE10) {
    result = new Point2D.Double(x0, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE11) {
    result = new Point2D.Double(x1, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE12) {
    result = new Point2D.Double(x3, y6);
  }

  return result;

}
 
Example 8
Source File: ChartJFreeChartOutputHistogram.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
protected void resetRenderer(final IScope scope, final String serieid) {
	// AbstractCategoryItemRenderer
	// newr=(AbstractCategoryItemRenderer)this.getOrCreateRenderer(scope,
	// serieid);
	final CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
	final AbstractCategoryItemRenderer newr = (AbstractCategoryItemRenderer) plot.getRenderer();
	// if
	// (serieid!=this.getChartdataset().series.keySet().iterator().next())
	// newr=(AbstractCategoryItemRenderer)this.getOrCreateRenderer(scope,
	// serieid);

	final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);
	if (!IdPosition.containsKey(serieid)) {
		// DEBUG.LOG("pb!!!");
	} else {
		final int myrow = IdPosition.get(serieid);
		if (myserie.getMycolor() != null) {
			newr.setSeriesPaint(myrow, myserie.getMycolor());
		}

		if (this.series_label_position.equals("onchart")) {
			// ((BarRenderer)newr).setBaseItemLabelGenerator(new
			// LabelGenerator());
			newr.setDefaultItemLabelGenerator(new LabelGenerator());
			final ItemLabelPosition itemlabelposition =
					new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
			newr.setDefaultPositiveItemLabelPosition(itemlabelposition);
			newr.setDefaultNegativeItemLabelPosition(itemlabelposition);
			newr.setDefaultItemLabelsVisible(true);
		}

		if (newr instanceof BarRenderer) {
			if (gap >= 0) {
				((BarRenderer) newr).setMaximumBarWidth(1 - gap);

			}

		}
	}

}
 
Example 9
Source File: CustomClusteredXYBarRenderer.java    From openbd-core with GNU General Public License v3.0 4 votes vote down vote up
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar, PlotOrientation orientation) {
	Point2D result = null;
	double offset = getItemLabelAnchorOffset();
	double x0 = bar.getX() - offset;
	double x1 = bar.getX();
	double x2 = bar.getX() + offset;
	double x3 = bar.getCenterX();
	double x4 = bar.getMaxX() - offset;
	double x5 = bar.getMaxX();
	double x6 = bar.getMaxX() + offset;

	double y0 = bar.getMaxY() + offset;
	double y1 = bar.getMaxY();
	double y2 = bar.getMaxY() - offset;
	double y3 = bar.getCenterY();
	double y4 = bar.getMinY() + offset;
	double y5 = bar.getMinY();
	double y6 = bar.getMinY() - offset;

	if (anchor == ItemLabelAnchor.CENTER) {
		result = new Point2D.Double(x3, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE1) {
		result = new Point2D.Double(x4, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE2) {
		result = new Point2D.Double(x4, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE3) {
		result = new Point2D.Double(x4, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE4) {
		result = new Point2D.Double(x4, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE5) {
		result = new Point2D.Double(x4, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE6) {
		result = new Point2D.Double(x3, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE7) {
		result = new Point2D.Double(x2, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE8) {
		result = new Point2D.Double(x2, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE9) {
		result = new Point2D.Double(x2, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE10) {
		result = new Point2D.Double(x2, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE11) {
		result = new Point2D.Double(x2, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE12) {
		result = new Point2D.Double(x3, y4);
	} else if (anchor == ItemLabelAnchor.OUTSIDE1) {
		result = new Point2D.Double(x5, y6);
	} else if (anchor == ItemLabelAnchor.OUTSIDE2) {
		result = new Point2D.Double(x6, y5);
	} else if (anchor == ItemLabelAnchor.OUTSIDE3) {
		result = new Point2D.Double(x6, y3);
	} else if (anchor == ItemLabelAnchor.OUTSIDE4) {
		result = new Point2D.Double(x6, y1);
	} else if (anchor == ItemLabelAnchor.OUTSIDE5) {
		result = new Point2D.Double(x5, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE6) {
		result = new Point2D.Double(x3, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE7) {
		result = new Point2D.Double(x1, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE8) {
		result = new Point2D.Double(x0, y1);
	} else if (anchor == ItemLabelAnchor.OUTSIDE9) {
		result = new Point2D.Double(x0, y3);
	} else if (anchor == ItemLabelAnchor.OUTSIDE10) {
		result = new Point2D.Double(x0, y5);
	} else if (anchor == ItemLabelAnchor.OUTSIDE11) {
		result = new Point2D.Double(x1, y6);
	} else if (anchor == ItemLabelAnchor.OUTSIDE12) {
		result = new Point2D.Double(x3, y6);
	}

	return result;
}
 
Example 10
Source File: AbstractRenderer.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}
 
Example 11
Source File: AbstractRenderer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {

    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = false;

    this.itemLabelFontList = new ObjectList();
    this.baseItemLabelFont = new Font("Tahoma", Font.PLAIN, 10);

    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPositionList = new ObjectList();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPositionList = new ObjectList();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFont = new ObjectList();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();

    this.selectedItemAttributes = new RenderAttributes();
    this.selectedItemAttributes.setDefaultFillPaint(Color.WHITE);
}
 
Example 12
Source File: AbstractRenderer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {

    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = false;

    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = false;

    this.itemLabelFontList = new ObjectList();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPositionList = new ObjectList();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
    
    this.negativeItemLabelPositionList = new ObjectList();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;
    
    this.listenerList = new EventListenerList();

}
 
Example 13
Source File: AbstractRenderer.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {

    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;
    
    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontList = new ObjectList();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionList = new ObjectList();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
        ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER
    );
    
    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionList = new ObjectList();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
        ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER
    );

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;
    
    this.listenerList = new EventListenerList();

}
 
Example 14
Source File: AbstractRenderer.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}
 
Example 15
Source File: AbstractRenderer.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Default constructor.
 */
public AbstractRenderer() {
    this.seriesVisible = null;
    this.seriesVisibleList = new BooleanList();
    this.baseSeriesVisible = true;

    this.seriesVisibleInLegend = null;
    this.seriesVisibleInLegendList = new BooleanList();
    this.baseSeriesVisibleInLegend = true;

    this.paint = null;
    this.paintList = new PaintList();
    this.basePaint = DEFAULT_PAINT;
    this.autoPopulateSeriesPaint = true;

    this.fillPaint = null;
    this.fillPaintList = new PaintList();
    this.baseFillPaint = Color.white;
    this.autoPopulateSeriesFillPaint = false;

    this.outlinePaint = null;
    this.outlinePaintList = new PaintList();
    this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSeriesOutlinePaint = false;

    this.stroke = null;
    this.strokeList = new StrokeList();
    this.baseStroke = DEFAULT_STROKE;
    this.autoPopulateSeriesStroke = true;

    this.outlineStroke = null;
    this.outlineStrokeList = new StrokeList();
    this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSeriesOutlineStroke = false;

    this.shape = null;
    this.shapeList = new ShapeList();
    this.baseShape = DEFAULT_SHAPE;
    this.autoPopulateSeriesShape = true;

    this.itemLabelsVisible = null;
    this.itemLabelsVisibleList = new BooleanList();
    this.baseItemLabelsVisible = Boolean.FALSE;

    this.itemLabelFont = null;
    this.itemLabelFontMap = new HashMap<Integer, Font>();
    this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);

    this.itemLabelPaint = null;
    this.itemLabelPaintList = new PaintList();
    this.baseItemLabelPaint = Color.black;

    this.positiveItemLabelPosition = null;
    this.positiveItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.basePositiveItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

    this.negativeItemLabelPosition = null;
    this.negativeItemLabelPositionMap 
            = new HashMap<Integer, ItemLabelPosition>();
    this.baseNegativeItemLabelPosition = new ItemLabelPosition(
            ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

    this.createEntities = null;
    this.createEntitiesList = new BooleanList();
    this.baseCreateEntities = true;

    this.defaultEntityRadius = 3;

    this.legendShapeList = new ShapeList();
    this.baseLegendShape = null;

    this.treatLegendShapeAsLine = false;

    this.legendTextFontMap = new HashMap<Integer, Font>();
    this.baseLegendTextFont = null;

    this.legendTextPaint = new PaintList();
    this.baseLegendTextPaint = null;

    this.listenerList = new EventListenerList();
}