Révision 2326
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java (revision 2326) | ||
|---|---|---|
| 20 | 20 |
import org.jfree.chart.plot.XYPlot; |
| 21 | 21 |
import org.jfree.data.category.CategoryDataset; |
| 22 | 22 |
import org.jfree.data.category.DefaultCategoryDataset; |
| 23 |
import org.jfree.data.general.DatasetUtilities;
|
|
| 23 |
import org.jfree.data.general.DatasetUtils; |
|
| 24 | 24 |
import org.jfree.data.general.PieDataset; |
| 25 | 25 |
import org.jfree.data.xy.IntervalXYDataset; |
| 26 | 26 |
import org.jfree.data.xy.XYSeriesCollection; |
| ... | ... | |
| 42 | 42 |
|
| 43 | 43 |
/** |
| 44 | 44 |
* Charts engine providing methods to create charts using the JFreeChart library. |
| 45 |
* |
|
| 45 | 46 |
* @author sjacquot |
| 46 | 47 |
* |
| 47 | 48 |
*/ |
| ... | ... | |
| 61 | 62 |
/** |
| 62 | 63 |
* The charts engine description. |
| 63 | 64 |
*/ |
| 64 |
public final static String DESCRIPTION = "JFreeChart/Java2D";
|
|
| 65 |
public final static String DESCRIPTION = "JFreeChart"; |
|
| 65 | 66 |
|
| 66 | 67 |
/** |
| 67 | 68 |
* The rendering theme. |
| ... | ... | |
| 111 | 112 |
} |
| 112 | 113 |
|
| 113 | 114 |
// Custom range axis for ticks drawing options |
| 114 |
plot.setRangeAxis(new ExtendedNumberAxis((NumberAxis) plot.getRangeAxis(), true, true, DatasetUtilities.findMinimumRangeValue(plot.getDataset()).doubleValue(), DatasetUtilities.findMaximumRangeValue(plot.getDataset()).doubleValue()));
|
|
| 115 |
plot.setRangeAxis(new ExtendedNumberAxis((NumberAxis) plot.getRangeAxis(), true, true, DatasetUtils.findMinimumRangeValue(plot.getDataset()).doubleValue(), DatasetUtils.findMaximumRangeValue(plot.getDataset()).doubleValue()));
|
|
| 115 | 116 |
|
| 116 | 117 |
|
| 117 | 118 |
// Domain axis integer tick units, X |
| ... | ... | |
| 754 | 755 |
|
| 755 | 756 |
// FIXME: recursive addition of subdirectories of root font paths |
| 756 | 757 |
// static protected void traverseDir(File folder, DefaultFontMapper mapper) {
|
| 757 |
// File[] files = folder.listFiles(IOUtils.HIDDENFILE_FILTER);
|
|
| 758 |
// File[] files = folder.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 758 | 759 |
// for (int i = 0; i < files.length; i++) {
|
| 759 | 760 |
// if (files[i].isDirectory()) {
|
| 760 | 761 |
// mapper.insertDirectory(files[i].getPath()); |
| ... | ... | |
| 769 | 770 |
String fontName = null; |
| 770 | 771 |
// Category plots |
| 771 | 772 |
if(chart.getPlot() instanceof CategoryPlot) {
|
| 772 |
fontName = chart.getCategoryPlot().getRenderer().getBaseItemLabelFont().getFontName();
|
|
| 773 |
fontName = chart.getCategoryPlot().getRenderer().getDefaultItemLabelFont().getFontName();
|
|
| 773 | 774 |
} |
| 774 | 775 |
// XY plots |
| 775 | 776 |
else if(chart.getPlot() instanceof XYPlot) {
|
| 776 |
fontName = chart.getXYPlot().getRenderer().getBaseItemLabelFont().getFontName();
|
|
| 777 |
fontName = chart.getXYPlot().getRenderer().getDefaultItemLabelFont().getFontName();
|
|
| 777 | 778 |
} |
| 778 | 779 |
// other plots that have no renderer, eg. SpiderWebPlot |
| 779 | 780 |
else {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartCreator.java (revision 2326) | ||
|---|---|---|
| 5 | 5 |
import java.util.ArrayList; |
| 6 | 6 |
|
| 7 | 7 |
import org.jfree.chart.JFreeChart; |
| 8 |
import org.jfree.chart.axis.SymbolAxis; |
|
| 8 | 9 |
import org.jfree.chart.plot.CategoryPlot; |
| 9 | 10 |
import org.jfree.chart.plot.XYPlot; |
| 10 | 11 |
import org.txm.chartsengine.core.ChartCreator; |
| ... | ... | |
| 27 | 28 |
public abstract class JFCChartCreator extends ChartCreator {
|
| 28 | 29 |
|
| 29 | 30 |
|
| 30 |
|
|
| 31 | 31 |
@Override |
| 32 | 32 |
public void updateChart(ChartResult result) {
|
| 33 | 33 |
this.updateChart(result, true); |
| ... | ... | |
| 78 | 78 |
if(chart.getPlot() instanceof CategoryPlot) {
|
| 79 | 79 |
CategoryPlot plot = (CategoryPlot) chart.getPlot(); |
| 80 | 80 |
// grid visibility |
| 81 |
plot.setDomainGridlinesVisible(result.isGridVisible()); |
|
| 81 |
plot.setDomainGridlinesVisible(result.isGridVisible() && result.isDomainGridLinesVisible());
|
|
| 82 | 82 |
plot.setRangeGridlinesVisible(result.isGridVisible()); |
| 83 | 83 |
|
| 84 | 84 |
// force the renderer initialization to override theme settings |
| ... | ... | |
| 90 | 90 |
else if(chart.getPlot() instanceof XYPlot) {
|
| 91 | 91 |
XYPlot plot = (XYPlot) chart.getPlot(); |
| 92 | 92 |
// grid visibility |
| 93 |
plot.setDomainGridlinesVisible(result.isGridVisible() && result.isDomainGridLinesVisible()); |
|
| 93 | 94 |
plot.setRangeGridlinesVisible(result.isGridVisible()); |
| 94 |
plot.setDomainGridlinesVisible(result.isGridVisible()); |
|
| 95 | 95 |
|
| 96 | 96 |
// force the renderer initialization to override theme settings |
| 97 | 97 |
if(plot.getRenderer() instanceof IRendererWithItemSelection) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionCategoryLineAndShapeRenderer.java (revision 2326) | ||
|---|---|---|
| 75 | 75 |
* Initializes the tool tip generator. |
| 76 | 76 |
*/ |
| 77 | 77 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 78 |
this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 78 |
this.setDefaultToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 79 | 79 |
|
| 80 | 80 |
@Override |
| 81 | 81 |
public String generateToolTip(CategoryDataset dataset, int row, int column) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionCategoryStepRenderer.java (revision 2326) | ||
|---|---|---|
| 1 | 1 |
package org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers; |
| 2 | 2 |
|
| 3 |
import java.awt.AlphaComposite; |
|
| 4 | 3 |
import java.awt.BasicStroke; |
| 5 | 4 |
import java.awt.Color; |
| 6 |
import java.awt.Composite; |
|
| 7 | 5 |
import java.awt.Font; |
| 8 |
import java.awt.GradientPaint; |
|
| 9 |
import java.awt.Graphics2D; |
|
| 10 | 6 |
import java.awt.Paint; |
| 11 | 7 |
import java.awt.Stroke; |
| 12 |
import java.awt.geom.Line2D; |
|
| 13 |
import java.awt.geom.Point2D; |
|
| 14 |
import java.awt.geom.Rectangle2D; |
|
| 15 | 8 |
import java.text.DecimalFormat; |
| 16 | 9 |
|
| 17 |
import org.jfree.chart.axis.CategoryAxis; |
|
| 18 |
import org.jfree.chart.axis.ValueAxis; |
|
| 19 | 10 |
import org.jfree.chart.labels.CategoryToolTipGenerator; |
| 20 |
import org.jfree.chart.plot.CategoryMarker; |
|
| 21 |
import org.jfree.chart.plot.CategoryPlot; |
|
| 22 |
import org.jfree.chart.plot.IntervalMarker; |
|
| 23 |
import org.jfree.chart.plot.Marker; |
|
| 24 |
import org.jfree.chart.plot.PlotOrientation; |
|
| 25 |
import org.jfree.chart.plot.ValueMarker; |
|
| 26 | 11 |
import org.jfree.chart.renderer.category.CategoryStepRenderer; |
| 27 |
import org.jfree.data.Range; |
|
| 28 | 12 |
import org.jfree.data.category.CategoryDataset; |
| 29 | 13 |
import org.jfree.data.category.DefaultCategoryDataset; |
| 30 |
import org.jfree.text.TextUtilities; |
|
| 31 |
import org.jfree.ui.GradientPaintTransformer; |
|
| 32 |
import org.jfree.ui.LengthAdjustmentType; |
|
| 33 |
import org.jfree.ui.RectangleAnchor; |
|
| 34 | 14 |
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages; |
| 35 | 15 |
import org.txm.chartsengine.jfreechart.core.renderers.MouseOverItemSelector; |
| 36 | 16 |
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection; |
| ... | ... | |
| 82 | 62 |
* Initializes the tool tip generator. |
| 83 | 63 |
*/ |
| 84 | 64 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 85 |
this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 65 |
this.setDefaultToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 86 | 66 |
|
| 87 | 67 |
@Override |
| 88 | 68 |
public String generateToolTip(CategoryDataset dataset, int row, int column) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYCardinalSplineRenderer.java (revision 2326) | ||
|---|---|---|
| 22 | 22 |
import org.jfree.chart.plot.PlotOrientation; |
| 23 | 23 |
import org.jfree.chart.plot.ValueMarker; |
| 24 | 24 |
import org.jfree.chart.plot.XYPlot; |
| 25 |
import org.jfree.chart.text.TextUtils; |
|
| 26 |
import org.jfree.chart.ui.GradientPaintTransformer; |
|
| 27 |
import org.jfree.chart.ui.LengthAdjustmentType; |
|
| 28 |
import org.jfree.chart.ui.RectangleAnchor; |
|
| 25 | 29 |
import org.jfree.data.Range; |
| 26 | 30 |
import org.jfree.data.xy.XYDataset; |
| 27 | 31 |
import org.jfree.data.xy.XYSeriesCollection; |
| 28 |
import org.jfree.text.TextUtilities; |
|
| 29 |
import org.jfree.ui.GradientPaintTransformer; |
|
| 30 |
import org.jfree.ui.LengthAdjustmentType; |
|
| 31 |
import org.jfree.ui.RectangleAnchor; |
|
| 32 | 32 |
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages; |
| 33 | 33 |
import org.txm.chartsengine.jfreechart.core.renderers.MouseOverItemSelector; |
| 34 | 34 |
import org.txm.chartsengine.jfreechart.core.renderers.XYCardinalSplineRenderer; |
| ... | ... | |
| 87 | 87 |
* Initializes the tool tip generator. |
| 88 | 88 |
*/ |
| 89 | 89 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 90 |
this.setBaseToolTipGenerator(new XYToolTipGenerator() {
|
|
| 90 |
this.setDefaultToolTipGenerator(new XYToolTipGenerator() {
|
|
| 91 | 91 |
|
| 92 | 92 |
@Override |
| 93 | 93 |
public String generateToolTip(XYDataset dataset, int series, int item) {
|
| ... | ... | |
| 155 | 155 |
LengthAdjustmentType.EXPAND, anchor); |
| 156 | 156 |
//TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); |
| 157 | 157 |
// Draw rotated marker label |
| 158 |
TextUtilities.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY());
|
|
| 158 |
TextUtils.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY()); |
|
| 159 | 159 |
} |
| 160 | 160 |
g2.setComposite(originalComposite); |
| 161 | 161 |
} |
| ... | ... | |
| 257 | 257 |
anchor); |
| 258 | 258 |
//TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); |
| 259 | 259 |
// Draw rotated marker label |
| 260 |
TextUtilities.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY());
|
|
| 260 |
TextUtils.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY()); |
|
| 261 | 261 |
} |
| 262 | 262 |
g2.setComposite(originalComposite); |
| 263 | 263 |
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYSplineRenderer.java (revision 2326) | ||
|---|---|---|
| 23 | 23 |
import org.jfree.chart.plot.ValueMarker; |
| 24 | 24 |
import org.jfree.chart.plot.XYPlot; |
| 25 | 25 |
import org.jfree.chart.renderer.xy.XYSplineRenderer; |
| 26 |
import org.jfree.chart.text.TextUtils; |
|
| 27 |
import org.jfree.chart.ui.GradientPaintTransformer; |
|
| 28 |
import org.jfree.chart.ui.LengthAdjustmentType; |
|
| 29 |
import org.jfree.chart.ui.RectangleAnchor; |
|
| 26 | 30 |
import org.jfree.data.Range; |
| 27 | 31 |
import org.jfree.data.xy.XYDataset; |
| 28 | 32 |
import org.jfree.data.xy.XYSeriesCollection; |
| 29 |
import org.jfree.text.TextUtilities; |
|
| 30 |
import org.jfree.ui.GradientPaintTransformer; |
|
| 31 |
import org.jfree.ui.LengthAdjustmentType; |
|
| 32 |
import org.jfree.ui.RectangleAnchor; |
|
| 33 | 33 |
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages; |
| 34 | 34 |
import org.txm.chartsengine.jfreechart.core.renderers.MouseOverItemSelector; |
| 35 | 35 |
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection; |
| ... | ... | |
| 71 | 71 |
*/ |
| 72 | 72 |
public ItemSelectionXYSplineRenderer(int precision, boolean linesVisible, boolean shapesVisible) {
|
| 73 | 73 |
super(precision); |
| 74 |
this.setBaseLinesVisible(linesVisible);
|
|
| 75 |
this.setBaseShapesVisible(shapesVisible);
|
|
| 74 |
this.setDefaultLinesVisible(linesVisible);
|
|
| 75 |
this.setDefaultShapesVisible(shapesVisible);
|
|
| 76 | 76 |
this.mouseOverItemSelector = new MouseOverItemSelector(this); |
| 77 | 77 |
this.markerLabelRotationAngle = 0; |
| 78 | 78 |
|
| ... | ... | |
| 106 | 106 |
* Initializes the tool tip generator. |
| 107 | 107 |
*/ |
| 108 | 108 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 109 |
this.setBaseToolTipGenerator(new XYToolTipGenerator() {
|
|
| 109 |
this.setDefaultToolTipGenerator(new XYToolTipGenerator() {
|
|
| 110 | 110 |
|
| 111 | 111 |
@Override |
| 112 | 112 |
public String generateToolTip(XYDataset dataset, int series, int item) {
|
| ... | ... | |
| 174 | 174 |
LengthAdjustmentType.EXPAND, anchor); |
| 175 | 175 |
//TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); |
| 176 | 176 |
// Draw rotated marker label |
| 177 |
TextUtilities.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY());
|
|
| 177 |
TextUtils.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY()); |
|
| 178 | 178 |
} |
| 179 | 179 |
g2.setComposite(originalComposite); |
| 180 | 180 |
} |
| ... | ... | |
| 276 | 276 |
anchor); |
| 277 | 277 |
//TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); |
| 278 | 278 |
// Draw rotated marker label |
| 279 |
TextUtilities.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY());
|
|
| 279 |
TextUtils.drawRotatedString(label, g2, Math.toRadians(90), (float) coordinates.getX(), (float) coordinates.getY()); |
|
| 280 | 280 |
} |
| 281 | 281 |
g2.setComposite(originalComposite); |
| 282 | 282 |
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYLineAndShapeRenderer.java (revision 2326) | ||
|---|---|---|
| 120 | 120 |
* Initializes the tool tip generator. |
| 121 | 121 |
*/ |
| 122 | 122 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 123 |
this.setBaseToolTipGenerator(new XYToolTipGenerator() {
|
|
| 123 |
this.setDefaultToolTipGenerator(new XYToolTipGenerator() {
|
|
| 124 | 124 |
|
| 125 | 125 |
@Override |
| 126 | 126 |
public String generateToolTip(XYDataset dataset, int series, int item) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYStepRenderer.java (revision 2326) | ||
|---|---|---|
| 26 | 26 |
import org.jfree.chart.plot.XYPlot; |
| 27 | 27 |
import org.jfree.chart.renderer.xy.XYItemRendererState; |
| 28 | 28 |
import org.jfree.chart.renderer.xy.XYStepRenderer; |
| 29 |
import org.jfree.chart.text.TextUtils; |
|
| 30 |
import org.jfree.chart.ui.GradientPaintTransformer; |
|
| 31 |
import org.jfree.chart.ui.LengthAdjustmentType; |
|
| 32 |
import org.jfree.chart.ui.RectangleAnchor; |
|
| 33 |
import org.jfree.chart.ui.RectangleEdge; |
|
| 29 | 34 |
import org.jfree.data.Range; |
| 30 | 35 |
import org.jfree.data.xy.XYDataset; |
| 31 | 36 |
import org.jfree.data.xy.XYSeriesCollection; |
| 32 |
import org.jfree.text.TextUtilities; |
|
| 33 |
import org.jfree.ui.GradientPaintTransformer; |
|
| 34 |
import org.jfree.ui.LengthAdjustmentType; |
|
| 35 |
import org.jfree.ui.RectangleAnchor; |
|
| 36 |
import org.jfree.ui.RectangleEdge; |
|
| 37 | 37 |
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages; |
| 38 | 38 |
import org.txm.chartsengine.jfreechart.core.renderers.MouseOverItemSelector; |
| 39 | 39 |
import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector; |
| ... | ... | |
| 76 | 76 |
* @param shapesVisible |
| 77 | 77 |
*/ |
| 78 | 78 |
public ItemSelectionXYStepRenderer(boolean linesVisible, boolean shapesVisible) {
|
| 79 |
this.setBaseLinesVisible(linesVisible);
|
|
| 80 |
this.setBaseShapesVisible(shapesVisible);
|
|
| 81 |
this.setShapesVisible(true);
|
|
| 79 |
this.setDefaultLinesVisible(linesVisible);
|
|
| 80 |
this.setDefaultShapesVisible(shapesVisible);
|
|
| 81 |
//this.setShapesVisible(true); // FIXME: SJ: code for old jfreechart library, to remove after checking all works well
|
|
| 82 | 82 |
|
| 83 | 83 |
// Multiple items selector |
| 84 | 84 |
this.multipleItemsSelector = new MultipleItemsSelector(this); |
| ... | ... | |
| 101 | 101 |
* Initializes the tool tip generator. |
| 102 | 102 |
*/ |
| 103 | 103 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 104 |
this.setBaseToolTipGenerator(new XYToolTipGenerator() {
|
|
| 104 |
this.setDefaultToolTipGenerator(new XYToolTipGenerator() {
|
|
| 105 | 105 |
|
| 106 | 106 |
@Override |
| 107 | 107 |
public String generateToolTip(XYDataset dataset, int series, int item) {
|
| ... | ... | |
| 244 | 244 |
LengthAdjustmentType.EXPAND, anchor); |
| 245 | 245 |
|
| 246 | 246 |
// Draw rotated marker labels rather than horizontal |
| 247 |
TextUtilities.drawRotatedString(label, g2,
|
|
| 247 |
TextUtils.drawRotatedString(label, g2, |
|
| 248 | 248 |
(float) coordinates.getX(), (float) coordinates.getY() - 3, |
| 249 | 249 |
marker.getLabelTextAnchor(), 3.14 / 2, (float) coordinates.getX(), (float) coordinates.getY()); |
| 250 | 250 |
|
| ... | ... | |
| 350 | 350 |
anchor); |
| 351 | 351 |
|
| 352 | 352 |
// Draw rotated marker labels rather than horizontal |
| 353 |
TextUtilities.drawRotatedString(label, g2,
|
|
| 353 |
TextUtils.drawRotatedString(label, g2, |
|
| 354 | 354 |
(float) coordinates.getX(), (float) coordinates.getY() - 3, |
| 355 | 355 |
marker.getLabelTextAnchor(), 3.14 / 2, (float) coordinates.getX(), (float) coordinates.getY()); |
| 356 | 356 |
} |
| ... | ... | |
| 452 | 452 |
super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis, dataset, series, item, crosshairState, pass); |
| 453 | 453 |
|
| 454 | 454 |
// force shape rendering because the XYStepRenderer doesn't manage it by default |
| 455 |
EntityCollection entities = null; |
|
| 456 |
if(info != null) {
|
|
| 457 |
entities = info.getOwner().getEntityCollection(); |
|
| 458 |
} |
|
| 459 |
drawSecondaryPass(g2, plot, dataset, pass, series, item, domainAxis, dataArea, rangeAxis, crosshairState, entities); |
|
| 455 |
// EntityCollection entities = null; |
|
| 456 |
// if(info != null) {
|
|
| 457 |
// entities = info.getOwner().getEntityCollection(); |
|
| 458 |
// } |
|
| 459 |
// |
|
| 460 |
// drawSecondaryPass(g2, plot, dataset, pass, series, item, domainAxis, dataArea, rangeAxis, crosshairState, entities); |
|
| 460 | 461 |
} |
| 461 | 462 |
} |
| 462 | 463 |
|
| ... | ... | |
| 499 | 500 |
g2.setStroke(new BasicStroke(1)); |
| 500 | 501 |
|
| 501 | 502 |
|
| 502 |
Font font = getBaseItemLabelFont();
|
|
| 503 |
Font font = getDefaultItemLabelFont();
|
|
| 503 | 504 |
|
| 504 | 505 |
// compute the multi line label bounds |
| 505 | 506 |
String[] lines = label.split("\n");
|
| ... | ... | |
| 507 | 508 |
double height = 0; |
| 508 | 509 |
for(int i = 0; i < lines.length; i++) {
|
| 509 | 510 |
if(i == 0) {
|
| 510 |
font = getBaseItemLabelFont().deriveFont(Font.BOLD);
|
|
| 511 |
font = getDefaultItemLabelFont().deriveFont(Font.BOLD);
|
|
| 511 | 512 |
} |
| 512 | 513 |
else {
|
| 513 |
font = getBaseItemLabelFont();
|
|
| 514 |
font = getDefaultItemLabelFont();
|
|
| 514 | 515 |
} |
| 515 | 516 |
|
| 516 | 517 |
Rectangle2D lineBounds = font.getStringBounds(lines[i], g2.getFontRenderContext()); |
| ... | ... | |
| 551 | 552 |
// label |
| 552 | 553 |
for(int i = 0; i < lines.length; i++) {
|
| 553 | 554 |
if(i == 0) {
|
| 554 |
font = getBaseItemLabelFont().deriveFont(Font.BOLD);
|
|
| 555 |
font = getDefaultItemLabelFont().deriveFont(Font.BOLD);
|
|
| 555 | 556 |
} |
| 556 | 557 |
else {
|
| 557 |
font = getBaseItemLabelFont();
|
|
| 558 |
font = getDefaultItemLabelFont();
|
|
| 558 | 559 |
} |
| 559 | 560 |
g2.setFont(font); |
| 560 | 561 |
g2.drawString(lines[i], labelScreenX, labelScreenY += g2.getFontMetrics().getHeight()); |
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionCategoryBarRenderer.java (revision 2326) | ||
|---|---|---|
| 136 | 136 |
* Initializes the tool tip generator. |
| 137 | 137 |
*/ |
| 138 | 138 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 139 |
this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 139 |
this.setDefaultToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 140 | 140 |
|
| 141 | 141 |
@Override |
| 142 | 142 |
public String generateToolTip(CategoryDataset dataset, int row, int column) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYBarRenderer.java (revision 2326) | ||
|---|---|---|
| 58 | 58 |
* Initializes the tool tip generator. |
| 59 | 59 |
*/ |
| 60 | 60 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 61 |
this.setBaseToolTipGenerator(new XYToolTipGenerator() {
|
|
| 61 |
this.setDefaultToolTipGenerator(new XYToolTipGenerator() {
|
|
| 62 | 62 |
|
| 63 | 63 |
@Override |
| 64 | 64 |
public String generateToolTip(XYDataset dataset, int series, int item) {
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/HighchartsDefaultTheme.java (revision 2326) | ||
|---|---|---|
| 28 | 28 |
import org.jfree.chart.renderer.xy.XYSplineRenderer; |
| 29 | 29 |
import org.jfree.chart.renderer.xy.XYStepRenderer; |
| 30 | 30 |
import org.jfree.chart.title.LegendTitle; |
| 31 |
import org.jfree.ui.RectangleEdge; |
|
| 32 |
import org.jfree.ui.RectangleInsets; |
|
| 33 |
import org.jfree.util.ShapeUtilities; |
|
| 34 |
import org.txm.chartsengine.core.ChartsEngine; |
|
| 31 |
import org.jfree.chart.ui.RectangleEdge; |
|
| 32 |
import org.jfree.chart.ui.RectangleInsets; |
|
| 33 |
import org.jfree.chart.util.ShapeUtils; |
|
| 35 | 34 |
import org.txm.chartsengine.core.results.ChartResult; |
| 36 | 35 |
import org.txm.chartsengine.jfreechart.core.JFCChartsEngine; |
| 37 | 36 |
import org.txm.chartsengine.jfreechart.core.renderers.XYCardinalSplineRenderer; |
| 38 |
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection; |
|
| 39 | 37 |
import org.txm.chartsengine.jfreechart.core.themes.base.BlockRoundBorder; |
| 40 | 38 |
import org.txm.chartsengine.jfreechart.core.themes.base.CategoryAxisBetweenTicks; |
| 41 | 39 |
import org.txm.chartsengine.jfreechart.core.themes.base.JFCTheme; |
| ... | ... | |
| 68 | 66 |
|
| 69 | 67 |
// Title |
| 70 | 68 |
this.setTitlePaint(Color.decode("#4B4B6D"));
|
| 71 |
|
|
| 69 |
this.setSubtitlePaint(Color.decode("#4B4B6D"));
|
|
| 70 |
|
|
| 72 | 71 |
// Axis |
| 73 | 72 |
this.setAxisLabelPaint(Color.decode("#4D759E"));
|
| 74 | 73 |
this.setAxisOffset(new RectangleInsets(0, 0, 0, 0)); |
| ... | ... | |
| 93 | 92 |
// TODO : useless for this theme ? |
| 94 | 93 |
//this.setBaselinePaint(Color.decode("#C0D0E0"));
|
| 95 | 94 |
//this.setSmallFont(regularFont.deriveFont(Font.BOLD)); |
| 96 |
//this.setSubtitlePaint(Color.decode("#C0D0E0"));
|
|
| 97 | 95 |
|
| 98 | 96 |
|
| 99 | 97 |
// Series paints (Highchart color codes) |
| 100 |
// FIXME: this should be moved to a preference as discussed |
|
| 98 |
// FIXME: SJ: this should be moved to a preference as discussed
|
|
| 101 | 99 |
this.seriesPaints = new ArrayList<Color>(); |
| 102 | 100 |
this.seriesPaints.add(0, Color.decode("#2F7ED8")); // Blue
|
| 103 | 101 |
this.seriesPaints.add(1, Color.decode("#0D233A")); // Dark blue
|
| ... | ... | |
| 111 | 109 |
// Series shape (Highchart shapes) |
| 112 | 110 |
this.seriesShapes = new HashMap<Integer, Shape>(); |
| 113 | 111 |
// Diamond |
| 114 |
this.seriesShapes.put(1, ShapeUtilities.createDiamond(itemShapesScalingFactor * 3.4f));
|
|
| 112 |
this.seriesShapes.put(1, ShapeUtils.createDiamond(itemShapesScalingFactor * 3.4f)); |
|
| 115 | 113 |
// Ellipse |
| 116 | 114 |
float size = 6.4f * itemShapesScalingFactor; |
| 117 | 115 |
this.seriesShapes.put(0, new Ellipse2D.Float(-size / 2, -size / 2, size, size)); |
| 118 | 116 |
// Triangle |
| 119 |
this.seriesShapes.put(3, ShapeUtilities.createUpTriangle(itemShapesScalingFactor * 3.2f));
|
|
| 117 |
this.seriesShapes.put(3, ShapeUtils.createUpTriangle(itemShapesScalingFactor * 3.2f)); |
|
| 120 | 118 |
|
| 121 | 119 |
|
| 122 | 120 |
// Series stroke |
| ... | ... | |
| 222 | 220 |
// Items colors |
| 223 | 221 |
//ArrayList<Color> palette = this.applySeriesPaint(result); |
| 224 | 222 |
|
| 225 |
renderer.setBaseOutlinePaint(Color.WHITE);
|
|
| 223 |
renderer.setDefaultOutlinePaint(Color.WHITE);
|
|
| 226 | 224 |
|
| 227 | 225 |
// Grid |
| 228 |
//plot.setRangeGridlineStroke(new BasicStroke()); |
|
| 229 |
//plot.setDomainGridlinesVisible(false); |
|
| 226 |
// use plain stroke for charts using string symbol axis |
|
| 227 |
if(plot.getDomainAxis() instanceof SymbolAxis) {
|
|
| 228 |
plot.setRangeGridlineStroke(new BasicStroke()); |
|
| 229 |
} |
|
| 230 |
//plot.setDomainGridlinesVisible(false); |
|
| 230 | 231 |
|
| 231 | 232 |
// Legends |
| 232 | 233 |
if(legendTitle != null) {
|
| ... | ... | |
| 247 | 248 |
|
| 248 | 249 |
// Do not trace the grid bands for symbol axes |
| 249 | 250 |
if(plot.getDomainAxis() instanceof SymbolAxis) {
|
| 250 |
//((SymbolAxis)plot.getDomainAxis()).setGridBandsVisible(false);
|
|
| 251 |
((SymbolAxis)plot.getDomainAxis()).setGridBandsVisible(false); |
|
| 251 | 252 |
} |
| 252 | 253 |
|
| 253 |
((ItemSelectionXYBarRenderer)renderer).setBaseOutlinePaint(Color.RED);
|
|
| 254 |
((ItemSelectionXYBarRenderer)renderer).setDefaultOutlinePaint(Color.RED);
|
|
| 254 | 255 |
((ItemSelectionXYBarRenderer)renderer).setDrawBarOutline(true); |
| 255 | 256 |
|
| 256 | 257 |
} |
| ... | ... | |
| 446 | 447 |
// renderer.setSeriesShape(3, shape); |
| 447 | 448 |
|
| 448 | 449 |
// Used for item selection mouse over |
| 449 |
renderer.setBaseOutlinePaint(Color.WHITE);
|
|
| 450 |
renderer.setDefaultOutlinePaint(Color.WHITE);
|
|
| 450 | 451 |
|
| 451 | 452 |
} |
| 452 | 453 |
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/SymbolAxisBetweenTicks.java (revision 2326) | ||
|---|---|---|
| 9 | 9 |
import java.util.List; |
| 10 | 10 |
|
| 11 | 11 |
import org.jfree.chart.axis.AxisState; |
| 12 |
import org.jfree.chart.axis.CategoryLabelPosition; |
|
| 13 |
import org.jfree.chart.axis.CategoryLabelWidthType; |
|
| 14 | 12 |
import org.jfree.chart.axis.NumberTick; |
| 15 | 13 |
import org.jfree.chart.axis.SymbolAxis; |
| 16 | 14 |
import org.jfree.chart.axis.Tick; |
| ... | ... | |
| 18 | 16 |
import org.jfree.chart.axis.ValueAxis; |
| 19 | 17 |
import org.jfree.chart.axis.ValueTick; |
| 20 | 18 |
import org.jfree.chart.plot.XYPlot; |
| 21 |
import org.jfree.data.general.DatasetUtilities;
|
|
| 22 |
import org.jfree.text.G2TextMeasurer;
|
|
| 23 |
import org.jfree.text.TextBlock;
|
|
| 24 |
import org.jfree.text.TextLine;
|
|
| 25 |
import org.jfree.text.TextUtilities;
|
|
| 26 |
import org.jfree.ui.RectangleEdge;
|
|
| 27 |
import org.jfree.ui.TextAnchor;
|
|
| 19 |
import org.jfree.chart.text.G2TextMeasurer;
|
|
| 20 |
import org.jfree.chart.text.TextBlock;
|
|
| 21 |
import org.jfree.chart.text.TextLine;
|
|
| 22 |
import org.jfree.chart.text.TextUtils;
|
|
| 23 |
import org.jfree.chart.ui.RectangleEdge;
|
|
| 24 |
import org.jfree.chart.ui.TextAnchor;
|
|
| 25 |
import org.jfree.data.general.DatasetUtils;
|
|
| 28 | 26 |
|
| 29 | 27 |
/** |
| 30 | 28 |
* Class providing a way to draw tick marks of series axis between the series items rather than on theirs middle. |
| ... | ... | |
| 91 | 89 |
ValueTick tick = (ValueTick) iterator.next(); |
| 92 | 90 |
|
| 93 | 91 |
// Skip the ticks out of range |
| 94 |
if(tick.getValue() < DatasetUtilities.findMinimumDomainValue(((XYPlot)this.getPlot()).getDataset()).doubleValue()
|
|
| 95 |
|| tick.getValue() > DatasetUtilities.findMaximumDomainValue(((XYPlot)this.getPlot()).getDataset()).doubleValue()
|
|
| 92 |
if(tick.getValue() < DatasetUtils.findMinimumDomainValue(((XYPlot)this.getPlot()).getDataset()).doubleValue() |
|
| 93 |
|| tick.getValue() > DatasetUtils.findMaximumDomainValue(((XYPlot)this.getPlot()).getDataset()).doubleValue() |
|
| 96 | 94 |
) {
|
| 97 | 95 |
continue; |
| 98 | 96 |
} |
| ... | ... | |
| 102 | 100 |
g2.setPaint(getTickLabelPaint()); |
| 103 | 101 |
float[] anchorPoint = calculateAnchorPoint(tick, cursor, |
| 104 | 102 |
dataArea, edge); |
| 105 |
TextUtilities.drawRotatedString(tick.getText(), g2,
|
|
| 103 |
TextUtils.drawRotatedString(tick.getText(), g2, |
|
| 106 | 104 |
anchorPoint[0], anchorPoint[1], tick.getTextAnchor(), |
| 107 | 105 |
tick.getAngle(), tick.getRotationAnchor()); |
| 108 | 106 |
} |
| ... | ... | |
| 222 | 220 |
} |
| 223 | 221 |
|
| 224 | 222 |
// avoid to draw overlapping tick labels |
| 225 |
Rectangle2D bounds = TextUtilities.getTextBounds(tickLabel, g2,
|
|
| 223 |
Rectangle2D bounds = TextUtils.getTextBounds(tickLabel, g2, |
|
| 226 | 224 |
g2.getFontMetrics()); |
| 227 | 225 |
double tickLabelLength = isVerticalTickLabels() |
| 228 | 226 |
? bounds.getHeight() : bounds.getWidth(); |
| ... | ... | |
| 281 | 279 |
|
| 282 | 280 |
float ratio = 0.1f; |
| 283 | 281 |
|
| 284 |
TextBlock label = TextUtilities.createTextBlock(tickLabel, getTickLabelFont(), getTickLabelPaint(), l * ratio, 1, new G2TextMeasurer(g2));
|
|
| 282 |
TextBlock label = TextUtils.createTextBlock(tickLabel, getTickLabelFont(), getTickLabelPaint(), l * ratio, 1, new G2TextMeasurer(g2)); |
|
| 285 | 283 |
|
| 286 | 284 |
Tick tick = new NumberTick(new Double(currentTickValue), ((TextLine)label.getLines().get(0)).getLastTextFragment().getText(), anchor, rotationAnchor, angle); |
| 287 | 285 |
ticks.add(tick); |
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/JFCTheme.java (revision 2326) | ||
|---|---|---|
| 137 | 137 |
|
| 138 | 138 |
|
| 139 | 139 |
/** |
| 140 |
* Creates fonts from the charts engine preferences current font. |
|
| 140 |
* Creates fonts from the result font parameter or charts engine preferences current font.
|
|
| 141 | 141 |
*/ |
| 142 | 142 |
public void createFonts(ChartResult result) {
|
| 143 | 143 |
|
| ... | ... | |
| 273 | 273 |
*/ |
| 274 | 274 |
public XYStepRenderer createXYStepRenderer(boolean linesVisible, boolean shapesVisible) {
|
| 275 | 275 |
XYStepRenderer renderer = new XYStepRenderer(); |
| 276 |
renderer.setBaseLinesVisible(linesVisible);
|
|
| 277 |
renderer.setBaseShapesVisible(shapesVisible);
|
|
| 276 |
renderer.setDefaultLinesVisible(linesVisible);
|
|
| 277 |
renderer.setDefaultShapesVisible(shapesVisible);
|
|
| 278 | 278 |
return renderer; |
| 279 | 279 |
} |
| 280 | 280 |
|
| ... | ... | |
| 302 | 302 |
*/ |
| 303 | 303 |
public XYSplineRenderer createXYSplineRenderer(boolean linesVisible, boolean shapesVisible) {
|
| 304 | 304 |
XYSplineRenderer renderer = new XYSplineRenderer(this.splineRendererPrecision); |
| 305 |
renderer.setBaseLinesVisible(linesVisible);
|
|
| 306 |
renderer.setBaseShapesVisible(shapesVisible);
|
|
| 305 |
renderer.setDefaultLinesVisible(linesVisible);
|
|
| 306 |
renderer.setDefaultShapesVisible(shapesVisible);
|
|
| 307 | 307 |
return renderer; |
| 308 | 308 |
} |
| 309 | 309 |
|
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/CategoryAxisBetweenTicks.java (revision 2326) | ||
|---|---|---|
| 10 | 10 |
import org.jfree.chart.axis.CategoryAxis; |
| 11 | 11 |
import org.jfree.chart.plot.CategoryPlot; |
| 12 | 12 |
import org.jfree.chart.plot.Plot; |
| 13 |
import org.jfree.ui.RectangleEdge; |
|
| 13 |
import org.jfree.chart.ui.RectangleEdge;
|
|
| 14 | 14 |
|
| 15 | 15 |
/** |
| 16 | 16 |
* Class providing a way to draw tick marks of category axis between the category items rather than on theirs middle. |
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/ExtendedNumberAxis.java (revision 2326) | ||
|---|---|---|
| 9 | 9 |
import org.jfree.chart.axis.NumberAxis; |
| 10 | 10 |
import org.jfree.chart.axis.NumberTick; |
| 11 | 11 |
import org.jfree.chart.axis.TickType; |
| 12 |
import org.jfree.ui.RectangleEdge; |
|
| 12 |
import org.jfree.chart.ui.RectangleEdge;
|
|
| 13 | 13 |
|
| 14 | 14 |
/** |
| 15 | 15 |
* An axis with extended drawing options as drawing only positive/negative ticks values or not drawing values greater/lower than a specified value. |
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/renderers/XYCardinalSplineRenderer.java (revision 2326) | ||
|---|---|---|
| 11 | 11 |
import org.jfree.chart.plot.XYPlot; |
| 12 | 12 |
import org.jfree.chart.renderer.xy.XYItemRendererState; |
| 13 | 13 |
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; |
| 14 |
import org.jfree.chart.ui.RectangleEdge; |
|
| 14 | 15 |
import org.jfree.data.xy.XYDataset; |
| 15 |
import org.jfree.ui.RectangleEdge; |
|
| 16 | 16 |
|
| 17 | 17 |
/** |
| 18 | 18 |
* A renderer using cardinal curves for drawing more precisely than the XYSplineRenderer. |
| tmp/org.txm.chartsengine.jfreechart.core/plugin.xml (revision 2326) | ||
|---|---|---|
| 6 | 6 |
point="org.txm.chartsengine.chartsengine"> |
| 7 | 7 |
<ChartsEngine |
| 8 | 8 |
class="org.txm.chartsengine.jfreechart.core.JFCChartsEngine" |
| 9 |
description="Java"
|
|
| 9 |
description="JFreeChart"
|
|
| 10 | 10 |
name="jfreechart_charts_engine"> |
| 11 | 11 |
</ChartsEngine> |
| 12 | 12 |
</extension> |
| tmp/org.txm.chartsengine.jfreechart.core/META-INF/MANIFEST.MF (revision 2326) | ||
|---|---|---|
| 10 | 10 |
rue |
| 11 | 11 |
Bundle-Version: 1.0.0.qualifier |
| 12 | 12 |
Bundle-Name: JFreeChart Charts Engine Core |
| 13 |
Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0";visib |
|
| 14 |
ility:=reexport,org.txm.libs.jfreechart;bundle-version="1.0.17";visib
|
|
| 15 |
ility:=reexport,org.txm.libs.itext;visibility:=reexport,org.txm.libs.
|
|
| 16 |
jfreesvg;bundle-version="1.7.0";visibility:=reexport |
|
| 13 |
Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport,
|
|
| 14 |
org.txm.libs.jfreechart;bundle-version="1.5.0";visibility:=reexport,
|
|
| 15 |
org.txm.libs.itext;visibility:=reexport,
|
|
| 16 |
org.txm.libs.jfreesvg;bundle-version="1.7.0";visibility:=reexport
|
|
| 17 | 17 |
Bundle-ManifestVersion: 2 |
| 18 | 18 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
| 19 | 19 |
Bundle-Vendor: Textometrie.org |
| tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java (revision 2326) | ||
|---|---|---|
| 11 | 11 |
import org.txm.chartsengine.core.results.ChartResult; |
| 12 | 12 |
import org.txm.core.results.Parameter; |
| 13 | 13 |
import org.txm.core.results.TXMParameters; |
| 14 |
import org.txm.searchengine.cqp.corpus.Partition; |
|
| 14 | 15 |
import org.txm.specificities.core.messages.SpecificitiesCoreMessages; |
| 15 | 16 |
import org.txm.specificities.core.preferences.SpecificitiesPreferences; |
| 16 | 17 |
import org.txm.statsengine.core.StatException; |
| ... | ... | |
| 62 | 63 |
|
| 63 | 64 |
|
| 64 | 65 |
/** |
| 65 |
* Creates an empty SpecificitiesSelection.
|
|
| 66 |
* Creates an not computed specificities selection chart.
|
|
| 66 | 67 |
* @param parent |
| 67 | 68 |
*/ |
| 68 | 69 |
public SpecificitiesSelection(Specificities parent) {
|
| 69 |
super(parent);
|
|
| 70 |
this(null, parent);
|
|
| 70 | 71 |
} |
| 71 | 72 |
|
| 72 | 73 |
/** |
| 73 |
* |
|
| 74 |
* Creates an not computed specificities selection chart.
|
|
| 74 | 75 |
* @param parametersNodePath |
| 75 | 76 |
*/ |
| 76 | 77 |
public SpecificitiesSelection(String parametersNodePath) {
|
| 77 |
super(parametersNodePath);
|
|
| 78 |
this(parametersNodePath, null);
|
|
| 78 | 79 |
} |
| 79 | 80 |
|
| 80 | 81 |
|
| 81 | 82 |
/** |
| 83 |
* Creates an not computed specificities selection chart. |
|
| 84 |
* @param parametersNodePath |
|
| 85 |
* @param parent |
|
| 86 |
*/ |
|
| 87 |
public SpecificitiesSelection(String parametersNodePath, Specificities parent) {
|
|
| 88 |
super(parametersNodePath, parent); |
|
| 89 |
|
|
| 90 |
this.domainGridLinesVisible = false; |
|
| 91 |
} |
|
| 92 |
|
|
| 93 |
/** |
|
| 82 | 94 |
* @return true if selection is found in the specificities table |
| 83 | 95 |
*/ |
| 84 | 96 |
@Override |
| ... | ... | |
| 96 | 108 |
selectedSpecificitiesIndex[i] = zeros; |
| 97 | 109 |
} |
| 98 | 110 |
|
| 99 |
//find words in the specif table |
|
| 111 |
// find words in the specif table
|
|
| 100 | 112 |
int n = 0; |
| 101 | 113 |
for (int i = 0; i < rowNames.length; i++) {
|
| 102 | 114 |
double[] line = tableLines[i]; |
| ... | ... | |
| 117 | 129 |
|
| 118 | 130 |
@Override |
| 119 | 131 |
public void clean() {
|
| 120 |
//does nothing
|
|
| 132 |
// nothing to do
|
|
| 121 | 133 |
} |
| 122 | 134 |
|
| 123 | 135 |
/** |
| tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/jfreechart/JFCSpecificitiesBarChartCreator.java (revision 2326) | ||
|---|---|---|
| 7 | 7 |
import org.jfree.chart.axis.NumberAxis; |
| 8 | 8 |
import org.jfree.chart.plot.Marker; |
| 9 | 9 |
import org.jfree.chart.plot.ValueMarker; |
| 10 |
import org.jfree.data.general.DatasetUtilities; |
|
| 10 |
import org.jfree.chart.ui.RectangleAnchor; |
|
| 11 |
import org.jfree.chart.ui.TextAnchor; |
|
| 12 |
import org.jfree.data.general.DatasetUtils; |
|
| 11 | 13 |
import org.jfree.data.xy.XYSeries; |
| 12 | 14 |
import org.jfree.data.xy.XYSeriesCollection; |
| 13 |
import org.jfree.ui.RectangleAnchor; |
|
| 14 |
import org.jfree.ui.TextAnchor; |
|
| 15 |
import org.txm.chartsengine.core.ChartsEngine; |
|
| 16 | 15 |
import org.txm.chartsengine.core.results.ChartResult; |
| 17 | 16 |
import org.txm.chartsengine.jfreechart.core.JFCChartCreator; |
| 18 |
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection; |
|
| 19 | 17 |
import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis; |
| 20 | 18 |
import org.txm.chartsengine.jfreechart.core.themes.base.SymbolAxisBetweenTicks; |
| 21 | 19 |
import org.txm.specificities.core.functions.SpecificitiesSelection; |
| ... | ... | |
| 136 | 134 |
|
| 137 | 135 |
|
| 138 | 136 |
// Custom range axis for ticks drawing options |
| 139 |
double minimumValue = DatasetUtilities.findMinimumRangeValue(chart.getXYPlot().getDataset()).doubleValue();
|
|
| 140 |
double maximumValue = DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue();
|
|
| 137 |
double minimumValue = DatasetUtils.findMinimumRangeValue(chart.getXYPlot().getDataset()).doubleValue(); |
|
| 138 |
double maximumValue = DatasetUtils.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue(); |
|
| 141 | 139 |
// Adjust ticks values according to data set contains only positives values or only negatives values |
| 142 | 140 |
if(minimumValue > 0) {
|
| 143 | 141 |
minimumValue = 0; |
| tmp/org.txm.chartsengine.r.feature/feature.xml (revision 2326) | ||
|---|---|---|
| 57 | 57 |
version="0.0.0" |
| 58 | 58 |
unpack="false"/> |
| 59 | 59 |
|
| 60 |
<plugin |
|
| 61 |
id="org.txm.chartsengine.raster.rcp" |
|
| 62 |
download-size="0" |
|
| 63 |
install-size="0" |
|
| 64 |
version="0.0.0"/> |
|
| 65 |
|
|
| 66 |
<plugin |
|
| 67 |
id="org.txm.chartsengine.rcp" |
|
| 68 |
download-size="0" |
|
| 69 |
install-size="0" |
|
| 70 |
version="0.0.0"/> |
|
| 71 |
|
|
| 72 |
<plugin |
|
| 73 |
id="org.txm.chartsengine.svgbatik.rcp" |
|
| 74 |
download-size="0" |
|
| 75 |
install-size="0" |
|
| 76 |
version="0.0.0"/> |
|
| 77 |
|
|
| 60 | 78 |
</feature> |
| tmp/org.txm.chartsengine.jfreechart.feature/feature.xml (revision 2326) | ||
|---|---|---|
| 37 | 37 |
</license> |
| 38 | 38 |
|
| 39 | 39 |
<requires> |
| 40 |
<import plugin="org.txm.libs.jfreechart" version="1.0.17" match="greaterOrEqual"/> |
|
| 40 |
<import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/> |
|
| 41 |
<import plugin="org.txm.libs.jfreechart" version="1.5.0" match="greaterOrEqual"/> |
|
| 41 | 42 |
<import plugin="org.txm.libs.itext"/> |
| 42 | 43 |
<import plugin="org.txm.libs.jfreesvg" version="1.7.0" match="greaterOrEqual"/> |
| 43 |
<import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/> |
|
| 44 | 44 |
<import plugin="org.txm.chartsengine.rcp" version="1.0.0" match="greaterOrEqual"/> |
| 45 | 45 |
<import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/> |
| 46 |
<import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/> |
|
| 46 | 47 |
</requires> |
| 47 | 48 |
|
| 48 | 49 |
<plugin |
| ... | ... | |
| 59 | 60 |
version="0.0.0" |
| 60 | 61 |
unpack="false"/> |
| 61 | 62 |
|
| 63 |
<plugin |
|
| 64 |
id="org.txm.chartsengine.raster.rcp" |
|
| 65 |
download-size="0" |
|
| 66 |
install-size="0" |
|
| 67 |
version="0.0.0"/> |
|
| 68 |
|
|
| 69 |
<plugin |
|
| 70 |
id="org.txm.chartsengine.rcp" |
|
| 71 |
download-size="0" |
|
| 72 |
install-size="0" |
|
| 73 |
version="0.0.0"/> |
|
| 74 |
|
|
| 75 |
<plugin |
|
| 76 |
id="org.txm.chartsengine.svgbatik.rcp" |
|
| 77 |
download-size="0" |
|
| 78 |
install-size="0" |
|
| 79 |
version="0.0.0"/> |
|
| 80 |
|
|
| 62 | 81 |
</feature> |
| tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/events/JFCDefaultChartMouseListener.java (revision 2326) | ||
|---|---|---|
| 221 | 221 |
// System.err.println("DefaultChartMouseListener.chartMouseClicked(): ");
|
| 222 | 222 |
// System.out.println("DefaultChartMouseListener.chartMouseClicked(): call backs count: " + eventCallBacks.size());
|
| 223 | 223 |
// System.err.println("DefaultChartMouseListener.chartMouseClicked(): click count: " + event.getTrigger().getClickCount());
|
| 224 |
Log.finest("DefaultChartMouseListener.chartMouseClicked(): entity type: " + entity);
|
|
| 225 |
Log.finest("DefaultChartMouseListener.chartMouseClicked(): eventArea: " + eventArea);
|
|
| 224 |
Log.finest("JFCDefaultChartMouseListener.chartMouseClicked(): entity type: " + entity);
|
|
| 225 |
Log.finest("JFCDefaultChartMouseListener.chartMouseClicked(): eventArea: " + eventArea);
|
|
| 226 | 226 |
|
| 227 | 227 |
|
| 228 | 228 |
// Set the composite current menu |
| ... | ... | |
| 236 | 236 |
if(!t.isEmpty() && chartComponent.getChartEditor().getComposite().getMenu() != null && chartComponent.getChartEditor().getComposite().getMenu().getItemCount() > 0) {
|
| 237 | 237 |
|
| 238 | 238 |
// FIXME: Debug |
| 239 |
Log.finest("DefaultChartMouseListener.chartMouseClicked(...).new Runnable() {...}.run(): menu = " + chartComponent.getChartEditor().getComposite().getMenu());
|
|
| 239 |
Log.finest("JFCDefaultChartMouseListener.chartMouseClicked(...).new Runnable() {...}.run(): menu = " + chartComponent.getChartEditor().getComposite().getMenu());
|
|
| 240 | 240 |
|
| 241 | 241 |
chartComponent.getChartEditor().getComposite().getMenu().getItem(0).setText(t); |
| 242 | 242 |
} |
| tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/MultipleSpiderWebPlot.java (revision 2326) | ||
|---|---|---|
| 86 | 86 |
import org.jfree.chart.plot.PlotState; |
| 87 | 87 |
import org.jfree.chart.plot.SpiderWebPlot; |
| 88 | 88 |
import org.jfree.chart.title.TextTitle; |
| 89 |
import org.jfree.chart.util.ParamChecks; |
|
| 89 |
import org.jfree.chart.ui.RectangleEdge; |
|
| 90 |
import org.jfree.chart.ui.RectangleInsets; |
|
| 91 |
import org.jfree.chart.util.Args; |
|
| 92 |
import org.jfree.chart.util.ObjectUtils; |
|
| 93 |
import org.jfree.chart.util.PaintUtils; |
|
| 94 |
import org.jfree.chart.util.SerialUtils; |
|
| 95 |
import org.jfree.chart.util.ShapeUtils; |
|
| 96 |
import org.jfree.chart.util.TableOrder; |
|
| 90 | 97 |
import org.jfree.data.category.CategoryDataset; |
| 91 |
import org.jfree.data.category.CategoryToPieDataset; |
|
| 92 | 98 |
import org.jfree.data.category.DefaultCategoryDataset; |
| 93 | 99 |
import org.jfree.data.general.DatasetChangeEvent; |
| 94 |
import org.jfree.data.general.DatasetUtilities; |
|
| 95 |
import org.jfree.data.general.PieDataset; |
|
| 96 |
import org.jfree.io.SerialUtilities; |
|
| 97 |
import org.jfree.ui.RectangleEdge; |
|
| 98 |
import org.jfree.ui.RectangleInsets; |
|
| 99 |
import org.jfree.util.ObjectUtilities; |
|
| 100 |
import org.jfree.util.PaintUtilities; |
|
| 101 |
import org.jfree.util.ShapeUtilities; |
|
| 102 |
import org.jfree.util.TableOrder; |
|
| 100 |
import org.jfree.data.general.DatasetUtils; |
|
| 103 | 101 |
|
| 104 | 102 |
/** |
| 105 | 103 |
* A plot that displays multiple pie plots using data from a |
| ... | ... | |
| 232 | 230 |
* @see #getPieChart() |
| 233 | 231 |
*/ |
| 234 | 232 |
public void setPieChart(JFreeChart pieChart) {
|
| 235 |
ParamChecks.nullNotPermitted(pieChart, "pieChart");
|
|
| 233 |
Args.nullNotPermitted(pieChart, "pieChart");
|
|
| 236 | 234 |
if (!(pieChart.getPlot() instanceof SpiderWebPlot)) {
|
| 237 | 235 |
throw new IllegalArgumentException("The 'pieChart' argument must "
|
| 238 | 236 |
+ "be a chart based on a SpiderWebPlot."); |
| ... | ... | |
| 257 | 255 |
* @param order the order (<code>null</code> not permitted). |
| 258 | 256 |
*/ |
| 259 | 257 |
public void setDataExtractOrder(TableOrder order) {
|
| 260 |
ParamChecks.nullNotPermitted(order, "order");
|
|
| 258 |
Args.nullNotPermitted(order, "order");
|
|
| 261 | 259 |
this.dataExtractOrder = order; |
| 262 | 260 |
fireChangeEvent(); |
| 263 | 261 |
} |
| ... | ... | |
| 304 | 302 |
* @since 1.0.2 |
| 305 | 303 |
*/ |
| 306 | 304 |
public void setAggregatedItemsKey(Comparable key) {
|
| 307 |
ParamChecks.nullNotPermitted(key, "key");
|
|
| 305 |
Args.nullNotPermitted(key, "key");
|
|
| 308 | 306 |
this.aggregatedItemsKey = key; |
| 309 | 307 |
fireChangeEvent(); |
| 310 | 308 |
} |
| ... | ... | |
| 330 | 328 |
* @since 1.0.2 |
| 331 | 329 |
*/ |
| 332 | 330 |
public void setAggregatedItemsPaint(Paint paint) {
|
| 333 |
ParamChecks.nullNotPermitted(paint, "paint");
|
|
| 331 |
Args.nullNotPermitted(paint, "paint");
|
|
| 334 | 332 |
this.aggregatedItemsPaint = paint; |
| 335 | 333 |
fireChangeEvent(); |
| 336 | 334 |
} |
| ... | ... | |
| 370 | 368 |
* @since 1.0.12 |
| 371 | 369 |
*/ |
| 372 | 370 |
public void setLegendItemShape(Shape shape) {
|
| 373 |
ParamChecks.nullNotPermitted(shape, "shape");
|
|
| 371 |
Args.nullNotPermitted(shape, "shape");
|
|
| 374 | 372 |
this.legendItemShape = shape; |
| 375 | 373 |
fireChangeEvent(); |
| 376 | 374 |
} |
| ... | ... | |
| 396 | 394 |
drawOutline(g2, area); |
| 397 | 395 |
|
| 398 | 396 |
// check that there is some data to display... |
| 399 |
if (DatasetUtilities.isEmptyOrNull(this.dataset)) {
|
|
| 397 |
if (DatasetUtils.isEmptyOrNull(this.dataset)) {
|
|
| 400 | 398 |
drawNoDataMessage(g2, area); |
| 401 | 399 |
return; |
| 402 | 400 |
} |
| ... | ... | |
| 602 | 600 |
if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
|
| 603 | 601 |
return false; |
| 604 | 602 |
} |
| 605 |
if (!PaintUtilities.equal(this.aggregatedItemsPaint,
|
|
| 603 |
if (!PaintUtils.equal(this.aggregatedItemsPaint, |
|
| 606 | 604 |
that.aggregatedItemsPaint)) {
|
| 607 | 605 |
return false; |
| 608 | 606 |
} |
| 609 |
if (!ObjectUtilities.equal(this.spiderChart, that.spiderChart)) {
|
|
| 607 |
if (!ObjectUtils.equal(this.spiderChart, that.spiderChart)) {
|
|
| 610 | 608 |
return false; |
| 611 | 609 |
} |
| 612 |
if (!ShapeUtilities.equal(this.legendItemShape, that.legendItemShape)) {
|
|
| 610 |
if (!ShapeUtils.equal(this.legendItemShape, that.legendItemShape)) {
|
|
| 613 | 611 |
return false; |
| 614 | 612 |
} |
| 615 | 613 |
if (!super.equals(obj)) {
|
| ... | ... | |
| 631 | 629 |
MultipleSpiderWebPlot clone = (MultipleSpiderWebPlot) super.clone(); |
| 632 | 630 |
clone.spiderChart = (JFreeChart) this.spiderChart.clone(); |
| 633 | 631 |
clone.sectionPaints = new HashMap(this.sectionPaints); |
| 634 |
clone.legendItemShape = ShapeUtilities.clone(this.legendItemShape);
|
|
| 632 |
clone.legendItemShape = ShapeUtils.clone(this.legendItemShape); |
|
| 635 | 633 |
return clone; |
| 636 | 634 |
} |
| 637 | 635 |
|
| ... | ... | |
| 644 | 642 |
*/ |
| 645 | 643 |
private void writeObject(ObjectOutputStream stream) throws IOException {
|
| 646 | 644 |
stream.defaultWriteObject(); |
| 647 |
SerialUtilities.writePaint(this.aggregatedItemsPaint, stream);
|
|
| 648 |
SerialUtilities.writeShape(this.legendItemShape, stream);
|
|
| 645 |
SerialUtils.writePaint(this.aggregatedItemsPaint, stream); |
|
| 646 |
SerialUtils.writeShape(this.legendItemShape, stream); |
|
| 649 | 647 |
} |
| 650 | 648 |
|
| 651 | 649 |
/** |
| ... | ... | |
| 659 | 657 |
private void readObject(ObjectInputStream stream) |
| 660 | 658 |
throws IOException, ClassNotFoundException {
|
| 661 | 659 |
stream.defaultReadObject(); |
| 662 |
this.aggregatedItemsPaint = SerialUtilities.readPaint(stream);
|
|
| 663 |
this.legendItemShape = SerialUtilities.readShape(stream);
|
|
| 660 |
this.aggregatedItemsPaint = SerialUtils.readPaint(stream); |
|
| 661 |
this.legendItemShape = SerialUtils.readShape(stream); |
|
| 664 | 662 |
this.sectionPaints = new HashMap(); |
| 665 | 663 |
} |
| 666 | 664 |
|
| tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCTextsBalanceSpiderChartCreator.java (revision 2326) | ||
|---|---|---|
| 9 | 9 |
import org.jfree.chart.plot.SpiderWebPlot; |
| 10 | 10 |
import org.jfree.data.category.CategoryDataset; |
| 11 | 11 |
import org.jfree.data.category.DefaultCategoryDataset; |
| 12 |
import org.jfree.util.Log; |
|
| 13 | 12 |
import org.txm.chartsengine.core.results.ChartResult; |
| 14 | 13 |
import org.txm.chartsengine.jfreechart.core.JFCChartCreator; |
| 15 | 14 |
import org.txm.textsbalance.core.functions.TextsBalance; |
| tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 2326) | ||
|---|---|---|
| 49 | 49 |
*/ |
| 50 | 50 |
protected boolean needsToSquareOff; |
| 51 | 51 |
|
| 52 |
|
|
| 53 |
/** |
|
| 54 |
* To show/hide domain grid lines. |
|
| 55 |
*/ |
|
| 56 |
protected boolean domainGridLinesVisible; |
|
| 57 |
|
|
| 52 | 58 |
|
| 53 |
|
|
| 54 | 59 |
/** |
| 55 | 60 |
* The chart type; |
| 56 | 61 |
*/ |
| ... | ... | |
| 128 | 133 |
this.needsToResetView = false; |
| 129 | 134 |
this.needsToClearItemsSelection = false; |
| 130 | 135 |
this.needsToSquareOff = false; |
| 136 |
this.domainGridLinesVisible = true; |
|
| 131 | 137 |
} |
| 132 | 138 |
|
| 133 | 139 |
|
| ... | ... | |
| 449 | 455 |
} |
| 450 | 456 |
|
| 451 | 457 |
/** |
| 452 |
* @return the needsToSquareOff |
|
| 458 |
* Gets the square off constraint state. |
|
| 459 |
* @return the square off constraint state |
|
| 453 | 460 |
*/ |
| 454 | 461 |
public boolean needsToSquareOff() {
|
| 455 | 462 |
return needsToSquareOff; |
| ... | ... | |
| 457 | 464 |
|
| 458 | 465 |
|
| 459 | 466 |
/** |
| 460 |
* @param needsToSquareOff the needsToSquareOff to set |
|
| 467 |
* Sets the square off constraint state. |
|
| 468 |
* @param needsToSquareOff the square off constraint state to set |
|
| 461 | 469 |
*/ |
| 462 | 470 |
public void setNeedsToSquareOff(boolean needsToSquareOff) {
|
| 463 | 471 |
this.needsToSquareOff = needsToSquareOff; |
| ... | ... | |
| 465 | 473 |
|
| 466 | 474 |
|
| 467 | 475 |
/** |
| 476 |
* Gets the title visibility state. |
|
| 468 | 477 |
* @return the titleVisible |
| 469 | 478 |
*/ |
| 470 | 479 |
public boolean isTitleVisible() {
|
| ... | ... | |
| 472 | 481 |
} |
| 473 | 482 |
|
| 474 | 483 |
/** |
| 484 |
* Sets the title visibility state. |
|
| 475 | 485 |
* @param titleVisible the titleVisible to set |
| 476 | 486 |
*/ |
| 477 | 487 |
public void setTitleVisible(boolean titleVisible) {
|
| ... | ... | |
| 479 | 489 |
} |
| 480 | 490 |
|
| 481 | 491 |
/** |
| 492 |
* Gets the legend visibility state. |
|
| 482 | 493 |
* @return the legendVisible |
| 483 | 494 |
*/ |
| 484 | 495 |
public boolean isLegendVisible() {
|
| ... | ... | |
| 486 | 497 |
} |
| 487 | 498 |
|
| 488 | 499 |
/** |
| 500 |
* Sets the legend visibility state. |
|
| 489 | 501 |
* @param legendVisible the legendVisible to set |
| 490 | 502 |
*/ |
| 491 | 503 |
public void setLegendVisible(boolean legendVisible) {
|
| ... | ... | |
| 493 | 505 |
} |
| 494 | 506 |
|
| 495 | 507 |
/** |
| 508 |
* Gets the grid visibility state. |
|
| 496 | 509 |
* @return the gridVisible |
| 497 | 510 |
*/ |
| 498 | 511 |
public boolean isGridVisible() {
|
| ... | ... | |
| 500 | 513 |
} |
| 501 | 514 |
|
| 502 | 515 |
/** |
| 516 |
* Gets the domain grid lines visibility state. |
|
| 517 |
* @return the domainGridLinesVisible |
|
| 518 |
*/ |
|
| 519 |
public boolean isDomainGridLinesVisible() {
|
|
| 520 |
return domainGridLinesVisible; |
|
| 521 |
} |
|
| 522 |
|
|
| 523 |
|
|
| 524 |
/** |
|
| 525 |
* Sets the visiiblity visibility state. |
|
| 503 | 526 |
* @param gridVisible the gridVisible to set |
| 504 | 527 |
*/ |
| 505 | 528 |
public void setGridVisible(boolean gridVisible) {
|
| ... | ... | |
| 508 | 531 |
|
| 509 | 532 |
|
| 510 | 533 |
/** |
| 534 |
* Gets the rendering color mode as integer. |
|
| 511 | 535 |
* @return the renderingColorsMode |
| 512 | 536 |
*/ |
| 513 | 537 |
public int getRenderingColorsMode() {
|
| ... | ... | |
| 516 | 540 |
|
| 517 | 541 |
|
| 518 | 542 |
/** |
| 543 |
* Gets the rendering color mode. |
|
| 519 | 544 |
* @param renderingColorsMode the renderingColorsMode to set |
| 520 | 545 |
*/ |
| 521 | 546 |
public void setRenderingColorsMode(int renderingColorsMode) {
|
| ... | ... | |
| 524 | 549 |
|
| 525 | 550 |
|
| 526 | 551 |
/** |
| 552 |
* Gets the font. |
|
| 527 | 553 |
* @return the font |
| 528 | 554 |
*/ |
| 529 | 555 |
public String getFont() {
|
| ... | ... | |
| 532 | 558 |
|
| 533 | 559 |
|
| 534 | 560 |
/** |
| 561 |
* Sets the font. |
|
| 535 | 562 |
* @param font the font to set |
| 536 | 563 |
*/ |
| 537 | 564 |
public void setFont(String font) {
|
| ... | ... | |
| 541 | 568 |
|
| 542 | 569 |
|
| 543 | 570 |
/** |
| 544 |
* @return the monoStyle |
|
| 571 |
* Gets the multiple line strokes state. |
|
| 572 |
* @return the multipleLineStrokes |
|
| 545 | 573 |
*/ |
| 546 | 574 |
public boolean isMultipleLineStrokes() {
|
| 547 | 575 |
return multipleLineStrokes; |
| ... | ... | |
| 550 | 578 |
|
| 551 | 579 |
|
| 552 | 580 |
/** |
| 553 |
* @param multipleStrokes the monoStyle to set |
|
| 581 |
* Sets the multiple line strokes state. |
|
| 582 |
* @param multipleStrokes the multiple line strokes state to set |
|
| 554 | 583 |
*/ |
| 555 | 584 |
public void setMultipleLineStrokes(boolean multipleStrokes) {
|
| 556 | 585 |
this.multipleLineStrokes = multipleStrokes; |
| ... | ... | |
| 576 | 605 |
|
| 577 | 606 |
|
| 578 | 607 |
/** |
| 608 |
* Sets the chart object. |
|
| 579 | 609 |
* @param chart the chart to set |
| 580 | 610 |
*/ |
| 581 | 611 |
public void setChart(Object chart) {
|
| 582 | 612 |
this.chart = chart; |
| 583 | 613 |
} |
| 584 | 614 |
|
| 615 |
|
|
| 616 |
|
|
| 585 | 617 |
} |
| tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/Theme.java (revision 2326) | ||
|---|---|---|
| 5 | 5 |
|
| 6 | 6 |
import java.awt.Color; |
| 7 | 7 |
import java.util.ArrayList; |
| 8 |
import java.util.Collections; |
|
| 8 | 9 |
|
| 9 | 10 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
| 10 | 11 |
|
| ... | ... | |
| 193 | 194 |
*/ |
| 194 | 195 |
public ArrayList<Color> getGrayScalePaletteFor(int itemsCount) {
|
| 195 | 196 |
ArrayList<Color> palette = new ArrayList<Color>(itemsCount); |
| 196 |
|
|
| 197 |
for(int i = 0; i < itemsCount; i++) {
|
|
| 198 |
int c; |
|
| 199 |
if(i == 0) {
|
|
| 200 |
c = 1; |
|
| 201 |
} |
|
| 202 |
else {
|
|
| 203 |
c = (int)((double)255 / itemsCount * i); |
|
| 204 |
} |
|
| 205 |
palette.add(new Color(c, c, c)); |
|
| 197 |
|
|
| 198 |
// special case of 1 items count palette, better to use gray rather than black |
|
| 199 |
if(itemsCount == 1) {
|
|
| 200 |
palette.add(new Color(128, 128, 128)); |
|
| 206 | 201 |
} |
| 202 |
else {
|
|
| 203 |
for(int i = 0; i < itemsCount; i++) {
|
|
| 204 |
int c; |
|
| 205 |
if(i == 0) {
|
|
| 206 |
c = 1; |
|
| 207 |
} |
|
| 208 |
else {
|
|
| 209 |
c = (int)((double)255 / itemsCount * i); |
|
| 210 |
} |
|
| 211 |
palette.add(new Color(c, c, c)); |
|
| 212 |
} |
|
| 213 |
} |
|
| 214 |
|
|
| 207 | 215 |
return palette; |
| 208 | 216 |
} |
| 209 | 217 |
|
| tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java (revision 2326) | ||
|---|---|---|
| 39 | 39 |
public Eigenvalues(String parametersNodePath, TXMResult parent) {
|
| 40 | 40 |
super(parametersNodePath, parent); |
| 41 | 41 |
this.setVisible(false); |
| 42 |
this.domainGridLinesVisible = false; |
|
| 42 | 43 |
} |
| 43 | 44 |
|
| 44 | 45 |
/** |
| tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCEigenvaluesChartCreator.java (revision 2326) | ||
|---|---|---|
| 4 | 4 |
import org.jfree.chart.JFreeChart; |
| 5 | 5 |
import org.jfree.chart.axis.NumberAxis; |
| 6 | 6 |
import org.jfree.data.category.DefaultCategoryDataset; |
| 7 |
import org.jfree.data.general.DatasetUtilities; |
|
| 8 |
import org.jfree.data.xy.XYSeriesCollection; |
|
| 7 |
import org.jfree.data.general.DatasetUtils; |
|
| 9 | 8 |
import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.CAEigenvaluesItemSelectionRenderer; |
| 10 | 9 |
import org.txm.ca.core.functions.CA; |
| 11 | 10 |
import org.txm.ca.core.functions.Eigenvalues; |
| ... | ... | |
| 72 | 71 |
} |
| 73 | 72 |
|
| 74 | 73 |
// Custom range axis for ticks drawing options |
| 75 |
chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue()));
|
|
| 74 |
chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtils.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue())); |
|
| 76 | 75 |
|
| 77 | 76 |
super.updateChart(result); |
| 77 |
|
|
| 78 |
// force the hide of the domain axis lines |
|
| 79 |
chart.getCategoryPlot().setDomainGridlinesVisible(false); |
|
| 80 |
|
|
| 78 | 81 |
} |
| 79 | 82 |
|
| 80 | 83 |
|
| tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCCAChartCreator.java (revision 2326) | ||
|---|---|---|
| 14 | 14 |
import org.jfree.chart.labels.ItemLabelPosition; |
| 15 | 15 |
import org.jfree.chart.plot.PlotOrientation; |
| 16 | 16 |
import org.jfree.chart.plot.XYPlot; |
| 17 |
import org.jfree.ui.TextAnchor; |
|
| 17 |
import org.jfree.chart.ui.TextAnchor;
|
|
| 18 | 18 |
import org.txm.ca.core.chartsengine.base.CAChartCreator; |
| 19 | 19 |
import org.txm.ca.core.chartsengine.base.Utils; |
| 20 | 20 |
import org.txm.ca.core.chartsengine.jfreechart.datasets.CAXYDataset; |
| ... | ... | |
| 85 | 85 |
|
| 86 | 86 |
renderer.setSeriesVisible(0, ca.isShowVariables()); |
| 87 | 87 |
renderer.setSeriesVisible(1, ca.isShowIndividuals()); |
| 88 |
chart.setTitle(Utils.createCAFactorialMapChartTitle(ca)); |
|
| 89 | 88 |
|
| 89 |
// Create chart title |
|
| 90 |
chart.setTitle(Utils.createCAFactorialMapChartTitle(ca)); |
|
| 91 |
|
|
| 90 | 92 |
// Create the limits border |
| 91 | 93 |
this.createCAFactorialMapChartLimitsBorder(chart); |
| 92 | 94 |
|
| ... | ... | |
| 96 | 98 |
// Draw the point shapes and the item labels |
| 97 | 99 |
if(ca.isShowPointShapes()) {
|
| 98 | 100 |
|
| 99 |
renderer.setSeriesItemLabelPaint(0, renderer.getBaseItemLabelPaint());
|
|
| 100 |
renderer.setSeriesItemLabelPaint(1, renderer.getBaseItemLabelPaint());
|
|
| 101 |
renderer.setSeriesItemLabelPaint(0, renderer.getDefaultItemLabelPaint());
|
|
| 102 |
renderer.setSeriesItemLabelPaint(1, renderer.getDefaultItemLabelPaint());
|
|
| 101 | 103 |
|
| 102 | 104 |
// Labels position |
| 103 | 105 |
ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, TextAnchor.BOTTOM_CENTER, 0.0); |
| 104 |
renderer.setBasePositiveItemLabelPosition(position);
|
|
| 105 |
renderer.setBaseNegativeItemLabelPosition(position);
|
|
| 106 |
renderer.setDefaultPositiveItemLabelPosition(position);
|
|
| 107 |
renderer.setDefaultNegativeItemLabelPosition(position);
|
|
| 106 | 108 |
|
| 107 | 109 |
renderer.setItemLabelAnchorOffset(1); |
| 108 | 110 |
|
| ... | ... | |
| 120 | 122 |
|
| 121 | 123 |
// Labels position |
| 122 | 124 |
ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, 0.0); |
| 123 |
renderer.setBasePositiveItemLabelPosition(position);
|
|
| 124 |
renderer.setBaseNegativeItemLabelPosition(position);
|
|
| 125 |
renderer.setDefaultPositiveItemLabelPosition(position);
|
|
| 126 |
renderer.setDefaultNegativeItemLabelPosition(position);
|
|
| 125 | 127 |
|
| 126 | 128 |
renderer.setItemLabelAnchorOffset(0); |
| 127 | 129 |
} |
| tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CAItemSelectionRenderer.java (revision 2326) | ||
|---|---|---|
| 47 | 47 |
|
| 48 | 48 |
@Override |
| 49 | 49 |
public void init() {
|
| 50 |
this.setBaseLinesVisible(false);
|
|
| 51 |
this.setBaseOutlinePaint(Color.decode("#666666"));
|
|
| 50 |
this.setDefaultLinesVisible(false);
|
|
| 51 |
this.setDefaultOutlinePaint(Color.decode("#666666"));
|
|
| 52 | 52 |
|
| 53 | 53 |
|
| 54 | 54 |
// Items colors (Highcharts color codes) |
| ... | ... | |
| 154 | 154 |
} |
| 155 | 155 |
}; |
| 156 | 156 |
|
| 157 |
this.setBaseItemLabelGenerator(generator);
|
|
| 158 |
this.setBaseItemLabelsVisible(true);
|
|
| 157 |
this.setDefaultItemLabelGenerator(generator);
|
|
| 158 |
this.setDefaultItemLabelsVisible(true);
|
|
| 159 | 159 |
} |
| 160 | 160 |
|
| 161 | 161 |
@Override |
| tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CAEigenvaluesItemSelectionRenderer.java (revision 2326) | ||
|---|---|---|
| 43 | 43 |
|
| 44 | 44 |
@Override |
| 45 | 45 |
public void initToolTipGenerator(final IRendererWithItemSelection renderer) {
|
| 46 |
this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 46 |
this.setDefaultToolTipGenerator(new CategoryToolTipGenerator() {
|
|
| 47 | 47 |
|
| 48 | 48 |
@Override |
| 49 | 49 |
public String generateToolTip(CategoryDataset dataset, int row, int column) {
|
| tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/adapters/PartitionDimensionsAdapterFactory.java (revision 2326) | ||
|---|---|---|
| 24 | 24 |
"platform:/plugin/"+ FrameworkUtil.getBundle(PartitionDimensionsAdapterFactory.class).getSymbolicName() + "/icons/dimensions.png"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 25 | 25 |
|
| 26 | 26 |
|
| 27 |
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
| 27 | 28 |
@Override |
| 28 | 29 |
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
| 29 | 30 |
if(this.canAdapt(adapterType) && adaptableObject instanceof PartitionDimensions) {
|
| tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 2326) | ||
|---|---|---|
| 12 | 12 |
import org.txm.chartsengine.core.results.ChartResult; |
| 13 | 13 |
import org.txm.core.results.Parameter; |
| 14 | 14 |
import org.txm.core.results.TXMParameters; |
| 15 |
import org.txm.lexicaltable.core.functions.LexicalTable; |
|
| 15 | 16 |
import org.txm.partition.core.messages.PartitionCoreMessages; |
| 16 | 17 |
import org.txm.partition.core.preferences.PartitionDimensionsPreferences; |
| 17 | 18 |
import org.txm.searchengine.cqp.clientExceptions.CqiClientException; |
| ... | ... | |
| 61 | 62 |
* @param partition |
| 62 | 63 |
*/ |
| 63 | 64 |
public PartitionDimensions(Partition partition) {
|
| 64 |
super(partition);
|
|
| 65 |
this(null, partition);
|
|
| 65 | 66 |
} |
| 66 | 67 |
|
| 67 | 68 |
/** |
| ... | ... | |
| 69 | 70 |
* @param parametersNodePath |
| 70 | 71 |
*/ |
| 71 | 72 |
public PartitionDimensions(String parametersNodePath) {
|
| 72 |
super(parametersNodePath); |
|
| 73 |
super(parametersNodePath, null);
|
|
| 73 | 74 |
} |
| 74 | 75 |
|
| 76 |
/** |
|
| 77 |
* Creates a not computed partition dimensions. |
|
| 78 |
* @param parametersNodePath |
|
| 79 |
* @param partition |
|
| 80 |
*/ |
|
| 81 |
public PartitionDimensions(String parametersNodePath, Partition partition) {
|
|
| 82 |
super(parametersNodePath, partition); |
|
| 83 |
|
|
| 84 |
this.domainGridLinesVisible = false; |
|
| 85 |
} |
|
| 86 |
|
|
| 75 | 87 |
|
| 76 | 88 |
@Override |
| 77 | 89 |
public boolean loadParameters() {
|
| tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/jfreechart/JFCPartitionDimensionsBarChartCreator.java (revision 2326) | ||
|---|---|---|
| 7 | 7 |
import org.jfree.chart.axis.NumberAxis; |
| 8 | 8 |
import org.jfree.chart.title.TextTitle; |
| 9 | 9 |
import org.jfree.chart.title.Title; |
| 10 |
import org.jfree.data.general.DatasetUtilities;
|
|
| 10 |
import org.jfree.data.general.DatasetUtils; |
|
| 11 | 11 |
import org.jfree.data.xy.XYSeries; |
| 12 | 12 |
import org.jfree.data.xy.XYSeriesCollection; |
| 13 | 13 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
| ... | ... | |
| 41 | 41 |
// Create the chart |
| 42 | 42 |
chart = this.getChartsEngine().createXYBarChart(dataset, null, PartitionCoreMessages.part, PartitionCoreMessages.numberOfWords, false, true); |
| 43 | 43 |
// Custom range axis for ticks drawing options |
| 44 |
chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue()));
|
|
| 44 |
chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, DatasetUtils.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue())); |
|
| 45 | 45 |
|
| 46 | 46 |
return chart; |
| 47 | 47 |
|
| ... | ... | |
| 96 | 96 |
// Create chart title |
| 97 | 97 |
chart.setTitle(Utils.createPartitionDimensionsChartTitle(partitionDimensions)); |
| 98 | 98 |
|
| 99 |
|
|
| 100 |
|
|
| 101 |
super.updateChart(result); |
|
| 102 |
|
|
| 103 |
|
|
| 104 | 99 |
// Subtitle |
| 105 | 100 |
if(chart.getSubtitleCount() > 0) {
|
| 106 | 101 |
chart.removeSubtitle(chart.getSubtitle(0)); |
| ... | ... | |
| 109 | 104 |
((Color)this.getChartsEngine().getJFCTheme().getAxisLabelPaint()), Title.DEFAULT_POSITION, |
| 110 | 105 |
Title.DEFAULT_HORIZONTAL_ALIGNMENT, |
| 111 | 106 |
Title.DEFAULT_VERTICAL_ALIGNMENT, Title.DEFAULT_PADDING)); |
| 107 |
|
|
| 108 |
|
|
| 109 |
super.updateChart(result); |
|
Formats disponibles : Unified diff