Révision 892
tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGPanel.java (revision 892) | ||
---|---|---|
95 | 95 |
this.svgCanvas = new JSVGCanvas(null, true, false); |
96 | 96 |
this.add("Center", svgCanvas); //$NON-NLS-1$ |
97 | 97 |
|
98 |
// FIXME : needed for automatic refresh after dynamically modifying the SVG DOM
|
|
98 |
// TODO: needed for automatic refresh after dynamically modifying the SVG DOM
|
|
99 | 99 |
//svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC); |
100 | 100 |
|
101 | 101 |
List<Interactor> list = svgCanvas.getInteractors(); |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 892) | ||
---|---|---|
1545 | 1545 |
this.monitor = monitor; |
1546 | 1546 |
|
1547 | 1547 |
if (!this.isDirty() && !this.isDirtyFromHistory()) { |
1548 |
|
|
1549 |
// FIXME: Debug |
|
1550 | 1548 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped."); |
1551 |
|
|
1552 | 1549 |
skipComputing = true; |
1553 | 1550 |
} |
1554 | 1551 |
else if (!this.isDirty()) { |
1555 |
|
|
1556 |
// FIXME: Debug |
|
1557 | 1552 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result is not dirty, computing skipped."); |
1558 |
|
|
1559 | 1553 |
skipComputing = true; |
1560 | 1554 |
} |
1561 | 1555 |
|
... | ... | |
1580 | 1574 |
|
1581 | 1575 |
// Computing requirements test |
1582 | 1576 |
if (!this.canCompute()) { |
1583 |
// FIXME: Debug |
|
1584 | 1577 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": missing or wrong parameters, computing aborted."); |
1585 |
|
|
1586 | 1578 |
return false; |
1587 | 1579 |
} |
1588 | 1580 |
|
1589 | 1581 |
// Computing |
1590 | 1582 |
if (!this._compute()) { |
1591 |
|
|
1592 |
// FIXME: Debug |
|
1593 | 1583 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing failed."); |
1594 |
|
|
1595 | 1584 |
return false; |
1596 | 1585 |
} |
1597 | 1586 |
|
1598 |
// FIXME: Children cascade computing
|
|
1587 |
// Children cascade computing |
|
1599 | 1588 |
if(deepComputing) { |
1600 | 1589 |
|
1601 |
// FIXME: Debug |
|
1602 | 1590 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": cascade computing of " + this.children.size() + " children."); |
1603 | 1591 |
|
1604 |
|
|
1605 | 1592 |
for (int i = 0; i < this.children.size(); i++) { |
1606 | 1593 |
// FIXME: may be better to add a member needFullRecomputing in TXMResult? |
1607 | 1594 |
this.getChild(i).setDirty(); // force recomputing even if some parameters of the result itself have not changed |
... | ... | |
1633 | 1620 |
if(!skipComputing) { |
1634 | 1621 |
this.dirty = false; // the computing was successful, the result is no more dirty |
1635 | 1622 |
this.hasBeenComputedOnce = true; |
1636 |
// FIXME: Debug |
|
1637 | 1623 |
Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing of result type " + this.getClass() + " done."); |
1638 | 1624 |
} |
1639 | 1625 |
|
tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java (revision 892) | ||
---|---|---|
284 | 284 |
|
285 | 285 |
@Override |
286 | 286 |
public boolean loadParameters() { |
287 |
// not implemented in TxmObjects
|
|
287 |
// TODO: not yet implemented in TxmObjects
|
|
288 | 288 |
return true; |
289 | 289 |
} |
290 | 290 |
|
291 | 291 |
@Override |
292 | 292 |
public boolean saveParameters() { |
293 |
// FIXME: need to do something?
|
|
293 |
// TODO: need to do something?
|
|
294 | 294 |
return true; |
295 | 295 |
} |
296 | 296 |
} |
tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF (revision 892) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 |
Require-Bundle: org.txm.rcp;bundle-version="0.7.8";visibility:=reexport |
|
2 |
Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport, |
|
3 |
org.txm.rcp;bundle-version="0.7.8";visibility:=reexport |
|
3 | 4 |
Export-Package: org.txm.chartsengine.rcp,org.txm.chartsengine.rcp.edit |
4 | 5 |
ors,org.txm.chartsengine.rcp.events,org.txm.chartsengine.rcp.handlers |
5 | 6 |
,org.txm.chartsengine.rcp.messages,org.txm.chartsengine.rcp.preferenc |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java (revision 892) | ||
---|---|---|
76 | 76 |
|
77 | 77 |
|
78 | 78 |
/** |
79 |
* Linked editors. |
|
80 |
*/ |
|
81 |
//FIXME: should be at TXMEditor level |
|
82 |
protected ArrayList<EditorPart> linkedEditors = null; |
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
/** |
|
87 | 79 |
* |
88 | 80 |
*/ |
89 | 81 |
public ChartEditor() { |
... | ... | |
585 | 577 |
} |
586 | 578 |
|
587 | 579 |
/** |
588 |
* Links the specified editor to this editor. |
|
589 |
* @param editor |
|
590 |
*/ |
|
591 |
//FIXME: should be at TXMEditor level |
|
592 |
public void addLinkedEditor(final EditorPart editor) { |
|
593 |
if (this.linkedEditors == null) { |
|
594 |
this.linkedEditors = new ArrayList<EditorPart>(); |
|
595 |
} |
|
596 |
if (!this.linkedEditors.contains(editor)) { |
|
597 |
this.linkedEditors.add(editor); |
|
598 |
|
|
599 |
// FIXME: debug |
|
600 |
//System.err.println(this.getClass().getSimpleName() + ": A linked editor of type \"" + editor.getClass().getSimpleName() + "\" has been added to this one. Linked editors count: " + this.linkedEditors.size() + "."); |
|
601 |
|
|
602 |
// FIXME: temporary solution to break the link with chart editor from another TXM result editor when its closed |
|
603 |
// a better solution would be to redefine the onclose event in a root class of all TXM editors |
|
604 |
editor.getSite().getPage().addPartListener(new IPartListener() { |
|
605 |
|
|
606 |
@Override |
|
607 |
public void partOpened(IWorkbenchPart part) { |
|
608 |
// TODO Auto-generated method stub |
|
609 |
|
|
610 |
} |
|
611 |
|
|
612 |
@Override |
|
613 |
public void partDeactivated(IWorkbenchPart part) { |
|
614 |
// TODO Auto-generated method stub |
|
615 |
|
|
616 |
} |
|
617 |
|
|
618 |
@Override |
|
619 |
public void partClosed(IWorkbenchPart part) { |
|
620 |
if(part.equals(editor)) { |
|
621 |
// FIXME: Debug |
|
622 |
//System.out.println("ChartEditor.addLinkedEditor(...).new IPartListener() {...}.partClosed()"); |
|
623 |
// TODO Auto-generated method stub |
|
624 |
removeLinkedEditor(editor); |
|
625 |
editor.getSite().getPage().removePartListener(this); |
|
626 |
} |
|
627 |
} |
|
628 |
|
|
629 |
@Override |
|
630 |
public void partBroughtToTop(IWorkbenchPart part) { |
|
631 |
// TODO Auto-generated method stub |
|
632 |
|
|
633 |
} |
|
634 |
|
|
635 |
@Override |
|
636 |
public void partActivated(IWorkbenchPart part) { |
|
637 |
// TODO Auto-generated method stub |
|
638 |
|
|
639 |
} |
|
640 |
}); |
|
641 |
|
|
642 |
|
|
643 |
} |
|
644 |
} |
|
645 |
|
|
646 |
/** |
|
647 |
* Unlinks the specified editor from this editor. |
|
648 |
* @param editor |
|
649 |
*/ |
|
650 |
//FIXME: should be at TXMEditor level |
|
651 |
public void removeLinkedEditor(EditorPart editor) { |
|
652 |
if(this.linkedEditors != null) { |
|
653 |
if(this.linkedEditors.remove(editor)) { |
|
654 |
// FIXME: debug |
|
655 |
//System.err.println(this.getClass().getSimpleName() + ": A linked editor of type \"" + editor.getClass().getSimpleName() + "\" has been removed from this one. Linked editors count: " + this.linkedEditors.size() + "."); |
|
656 |
} |
|
657 |
} |
|
658 |
if(this.linkedEditors.isEmpty()) { |
|
659 |
this.linkedEditors = null; |
|
660 |
} |
|
661 |
} |
|
662 |
|
|
663 |
/** |
|
664 |
* Gets the linked editors to this one if exist. |
|
665 |
* @return |
|
666 |
*/ |
|
667 |
//FIXME: should be at TXMEditor level |
|
668 |
public ArrayList<EditorPart> getLinkedEditors() { |
|
669 |
return this.linkedEditors; |
|
670 |
} |
|
671 |
|
|
672 |
/** |
|
673 |
* Gets the first linked editor of the specified class if exists. |
|
674 |
* @param editorClass |
|
675 |
* @return |
|
676 |
*/ |
|
677 |
//FIXME: should be at TXMEditor level |
|
678 |
public EditorPart getLinkedEditor(Class editorClass) { |
|
679 |
EditorPart editor = null; |
|
680 |
if(this.linkedEditors != null) { |
|
681 |
for(int i = 0; i < this.linkedEditors.size(); i++) { |
|
682 |
if(this.linkedEditors.get(i).getClass().equals(editorClass)) { |
|
683 |
editor = this.linkedEditors.get(i); |
|
684 |
break; |
|
685 |
} |
|
686 |
} |
|
687 |
} |
|
688 |
return editor; |
|
689 |
} |
|
690 |
|
|
691 |
/** |
|
692 |
* Gets the linked editors of the specified class if exist otherwise returns an empty list. |
|
693 |
* @param editorClass |
|
694 |
* @return |
|
695 |
*/ |
|
696 |
//FIXME: should be at TXMEditor level |
|
697 |
public ArrayList<EditorPart> getLinkedEditors(Class editorClass) { |
|
698 |
ArrayList<EditorPart> editors = new ArrayList<EditorPart>(); |
|
699 |
if(this.linkedEditors != null) { |
|
700 |
for(int i = 0; i < this.linkedEditors.size(); i++) { |
|
701 |
if(this.linkedEditors.get(i).getClass().equals(editorClass)) { |
|
702 |
editors.add(this.linkedEditors.get(i)); |
|
703 |
} |
|
704 |
} |
|
705 |
} |
|
706 |
return editors; |
|
707 |
} |
|
708 |
|
|
709 |
// FIXME: useless ? |
|
710 |
// /** |
|
711 |
// * Gets the first linked editor linked to the specified editor input. |
|
712 |
// * @param editorClass |
|
713 |
// * @return |
|
714 |
// */ |
|
715 |
// public EditorPart getLinkedEditor(IEditorInput editorInput) { |
|
716 |
// EditorPart editor = null; |
|
717 |
// if(this.linkedEditors != null) { |
|
718 |
// for(int i = 0; i < this.linkedEditors.size(); i++) { |
|
719 |
// if(this.linkedEditors.get(i).getEditorInput().equals(editorInput)) { |
|
720 |
// editor = this.linkedEditors.get(i); |
|
721 |
// break; |
|
722 |
// } |
|
723 |
// } |
|
724 |
// } |
|
725 |
// return editor; |
|
726 |
// } |
|
727 |
|
|
728 |
/** |
|
729 | 580 |
* To check whether this editor was already opened when calling SWTChartsComponentsProvider.openEditor(). |
730 | 581 |
* @return the wasAlreadyOpened |
731 | 582 |
*/ |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java (revision 892) | ||
---|---|---|
112 | 112 |
plot.setRenderer(this.jfcTheme.createXYLineAndShapeRenderer(result, chart, linesVisible, shapesVisible)); |
113 | 113 |
} |
114 | 114 |
else { |
115 |
// Custom XYSplineRenderer selection renderer |
|
116 |
//plot.setRenderer(this.theme.createXYSplineRenderer(linesVisible, shapesVisible)); |
|
117 |
// FIXME : tests for curves |
|
118 | 115 |
plot.setRenderer(this.jfcTheme.createXYCardinalSplineRenderer(linesVisible, shapesVisible)); |
119 | 116 |
} |
120 | 117 |
|
... | ... | |
315 | 312 |
chart.getCategoryPlot().getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits()); |
316 | 313 |
} |
317 | 314 |
|
318 |
// FIXME: Apply theme to the chart |
|
319 |
//this.theme.apply(chart); |
|
320 |
|
|
321 | 315 |
return chart; |
322 | 316 |
} |
323 | 317 |
|
... | ... | |
419 | 413 |
} |
420 | 414 |
|
421 | 415 |
|
422 |
|
|
423 |
|
|
424 |
|
|
425 |
|
|
426 |
|
|
427 |
// |
|
428 |
// @Override |
|
429 |
// public File createCAH2dChartFile(CAH cah, File file) { |
|
430 |
// return this.export(this.createCAH2dChart(cah), file); |
|
431 |
// } |
|
432 |
// |
|
433 |
// |
|
434 |
// @Override |
|
435 |
// public JFreeChart createCAH3dChart(CAH cah) { |
|
436 |
// // FIXME : tests CAH 3d |
|
437 |
// return null; |
|
438 |
// } |
|
439 |
// |
|
440 |
// |
|
441 |
// @Override |
|
442 |
// public File createCAH3dChartFile(CAH cah, File file) { |
|
443 |
// return this.export(this.createCAH3dChart(cah), file); |
|
444 |
// } |
|
445 |
|
|
446 |
|
|
447 |
|
|
448 |
|
|
449 |
// @Override |
|
450 |
// public JFreeChart createPartitionDimensionsChart(Partition partition, boolean sortPartsBySize) { |
|
451 |
// |
|
452 |
// JFreeChart chart = null; |
|
453 |
// |
|
454 |
// |
|
455 |
// // FIXME: XYBarPlot and test symbol axis |
|
456 |
// try { |
|
457 |
// // Creating the data set from the partition result |
|
458 |
// XYSeriesCollection dataset = new XYSeriesCollection(); |
|
459 |
// |
|
460 |
// XYSeries series = new XYSeries(ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_CATEGORY); |
|
461 |
// dataset.addSeries(series); |
|
462 |
// |
|
463 |
// List<Part> parts; |
|
464 |
// |
|
465 |
// // Sort parts by descendant size order |
|
466 |
// if (sortPartsBySize) { |
|
467 |
// parts = partition.getPartsSortedBySize(); |
|
468 |
// } |
|
469 |
// // Default parts order |
|
470 |
// else { |
|
471 |
// parts = partition.getParts(); |
|
472 |
// } |
|
473 |
// |
|
474 |
// |
|
475 |
// String[] xAxisSymbols = new String[parts.size()]; |
|
476 |
// |
|
477 |
// |
|
478 |
// for (int i = 0 ; i < parts.size() ; i++) { |
|
479 |
// series.add(i, parts.get(i).getSize()); |
|
480 |
// |
|
481 |
// // Add X axis symbol |
|
482 |
// xAxisSymbols[i] = parts.get(i).getName(); |
|
483 |
// } |
|
484 |
// |
|
485 |
// // Create chart title |
|
486 |
// String title = this.createPartitionDimensionsChartTitle(partition, sortPartsBySize); |
|
487 |
// |
|
488 |
// // Create the chart |
|
489 |
// chart = this.createXYBarChart(dataset, title, ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_Y_AXIS_LABEL, false, true, false, xAxisSymbols); |
|
490 |
// ((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS); |
|
491 |
// |
|
492 |
// |
|
493 |
// // Custom range axis for ticks drawing options |
|
494 |
// chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue())); |
|
495 |
// |
|
496 |
// this.theme.apply(chart); |
|
497 |
// |
|
498 |
// } |
|
499 |
// catch(CqiClientException e) { |
|
500 |
// // TODO Auto-generated catch block |
|
501 |
// e.printStackTrace(); |
|
502 |
// } |
|
503 |
// |
|
504 |
// |
|
505 |
// |
|
506 |
// // FIXME: Category bar plot |
|
507 |
//// try { |
|
508 |
//// // Creating the data set from the partition result |
|
509 |
//// DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
510 |
//// String category = ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_CATEGORY; |
|
511 |
//// |
|
512 |
//// |
|
513 |
//// List<Part> parts; |
|
514 |
//// |
|
515 |
//// // Sort parts by descendant size order |
|
516 |
//// if (sortPartsBySize) { |
|
517 |
//// parts = partition.getPartsSortedBySize(); |
|
518 |
//// } |
|
519 |
//// // Default parts order |
|
520 |
//// else { |
|
521 |
//// parts = partition.getParts(); |
|
522 |
//// } |
|
523 |
//// |
|
524 |
//// for (int i = 0 ; i < parts.size() ; i++) { |
|
525 |
//// dataset.setValue(parts.get(i).getSize(), category, parts.get(i).getName()); |
|
526 |
//// } |
|
527 |
//// |
|
528 |
//// // Create chart title |
|
529 |
//// String title = this.createPartitionDimensionsChartTitle(partition, sortPartsBySize); |
|
530 |
//// |
|
531 |
//// // Create the chart |
|
532 |
//// chart = this.createCategoryBarChart(dataset, title, ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_Y_AXIS_LABEL, false, true); |
|
533 |
//// ((IItemSelectionRenderer) chart.getCategoryPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS); |
|
534 |
//// |
|
535 |
//// |
|
536 |
//// // Custom range axis for ticks drawing options |
|
537 |
//// chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue())); |
|
538 |
//// |
|
539 |
//// } |
|
540 |
//// catch(CqiClientException e) { |
|
541 |
//// // TODO Auto-generated catch block |
|
542 |
//// e.printStackTrace(); |
|
543 |
//// } |
|
544 |
// |
|
545 |
// |
|
546 |
// |
|
547 |
// |
|
548 |
// return chart; |
|
549 |
// } |
|
550 |
// |
|
551 |
// |
|
552 |
// @Override |
|
553 |
// public File createPartitionDimensionsChartFile(Partition partition, boolean sortPartsBySize, File file) { |
|
554 |
// return this.export(this.createPartitionDimensionsChart(partition, sortPartsBySize), file); |
|
555 |
// } |
|
556 |
|
|
557 |
|
|
558 |
// @Override |
|
559 |
// public JFreeChart createSpecificitiesChart(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banality, boolean grayscale) { |
|
560 |
// |
|
561 |
// JFreeChart chart = null; |
|
562 |
// |
|
563 |
// |
|
564 |
// // FIXME: XY bar chart version |
|
565 |
// // Create the data set |
|
566 |
// final XYSeriesCollection dataset = new XYSeriesCollection(); |
|
567 |
// |
|
568 |
// |
|
569 |
// String[] xAxisSymbols; |
|
570 |
// |
|
571 |
// // Transpose the data set |
|
572 |
// if(transpose) { |
|
573 |
// xAxisSymbols = new String[specificitiesResult.getSelectedTypeNames().length]; |
|
574 |
// |
|
575 |
// for(int i = 0; i < specificitiesResult.getSelectedPartNames().length; i++) { |
|
576 |
// XYSeries series = new XYSeries(specificitiesResult.getSelectedPartNames()[i]); |
|
577 |
// dataset.addSeries(series); |
|
578 |
// |
|
579 |
// |
|
580 |
// for(int j = 0; j < specificitiesResult.getSelectedTypeNames().length; j++) { |
|
581 |
// series.add(j, specificitiesResult.getSelectedSpecificitiesIndex()[j][i]); |
|
582 |
// // Add X axis symbol |
|
583 |
// xAxisSymbols[j] = specificitiesResult.getSelectedTypeNames()[j]; |
|
584 |
// } |
|
585 |
// } |
|
586 |
// |
|
587 |
// } |
|
588 |
// else { |
|
589 |
// xAxisSymbols = new String[specificitiesResult.getSelectedPartNames().length]; |
|
590 |
// |
|
591 |
// for(int i = 0; i < specificitiesResult.getSelectedTypeNames().length; i++) { |
|
592 |
// |
|
593 |
// XYSeries series = new XYSeries(specificitiesResult.getSelectedTypeNames()[i]); |
|
594 |
// dataset.addSeries(series); |
|
595 |
// |
|
596 |
// for(int j = 0; j < specificitiesResult.getSelectedPartNames().length; j++) { |
|
597 |
// series.add(j, specificitiesResult.getSelectedSpecificitiesIndex()[i][j]); |
|
598 |
// // Add X axis symbol |
|
599 |
// xAxisSymbols[j] = specificitiesResult.getSelectedPartNames()[j]; |
|
600 |
// } |
|
601 |
// } |
|
602 |
// } |
|
603 |
// |
|
604 |
// if(drawBars) { |
|
605 |
// // Create the bar chart |
|
606 |
// chart = this.createXYBarChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false, false, xAxisSymbols); |
|
607 |
// } |
|
608 |
// else { |
|
609 |
// // Create the line chart |
|
610 |
// chart = this.createXYLineChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, |
|
611 |
// true, false, true, true, true, false, false, xAxisSymbols); |
|
612 |
// } |
|
613 |
// |
|
614 |
// ((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_SPECIFICITIES); |
|
615 |
// |
|
616 |
// |
|
617 |
// // Custom range axis for ticks drawing options |
|
618 |
// double minimumValue = DatasetUtilities.findMinimumRangeValue(chart.getXYPlot().getDataset()).doubleValue(); |
|
619 |
// double maximumValue = DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue(); |
|
620 |
// // Adjust ticks values according to data set contains only positives values or only negatives values |
|
621 |
// if(minimumValue > 0) { |
|
622 |
// minimumValue = 0; |
|
623 |
// } |
|
624 |
// if(maximumValue < 0) { |
|
625 |
// maximumValue = banality; |
|
626 |
// } |
|
627 |
// |
|
628 |
// // Custom range axis to cut the values to minimum and maximum values |
|
629 |
// chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), true, true, minimumValue, maximumValue)); |
|
630 |
// |
|
631 |
// |
|
632 |
// // Add positive banality marker |
|
633 |
// Marker marker = new ValueMarker(banality); |
|
634 |
// marker.setPaint(Color.red); |
|
635 |
// marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, banality)); |
|
636 |
// marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
637 |
// marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
638 |
// chart.getXYPlot().addRangeMarker(marker); |
|
639 |
// |
|
640 |
// |
|
641 |
// // Add negative banality marker |
|
642 |
// marker = new ValueMarker(-banality); |
|
643 |
// marker.setPaint(Color.red); |
|
644 |
// marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, -banality)); |
|
645 |
// marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
646 |
// marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
647 |
// chart.getXYPlot().addRangeMarker(marker); |
|
648 |
// |
|
649 |
// |
|
650 |
// |
|
651 |
// // FIXME: Category bar chart version |
|
652 |
//// // Create the data set |
|
653 |
//// final DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
654 |
//// |
|
655 |
//// // Transpose the data set |
|
656 |
//// if(transpose) { |
|
657 |
//// for(int i = 0; i < specificitiesResult.getSelectedTypeNames().length; i++) { |
|
658 |
//// for(int j = 0; j < specificitiesResult.getSelectedPartNames().length; j++) { |
|
659 |
//// dataset.addValue(specificitiesResult.getSelectedSpecificitiesIndex()[i][j], |
|
660 |
//// specificitiesResult.getSelectedPartNames()[j], |
|
661 |
//// specificitiesResult.getSelectedTypeNames()[i]); |
|
662 |
//// } |
|
663 |
//// } |
|
664 |
//// } |
|
665 |
//// else { |
|
666 |
//// for(int i = 0; i < specificitiesResult.getSelectedPartNames().length; i++) { |
|
667 |
//// for(int j = 0; j < specificitiesResult.getSelectedTypeNames().length; j++) { |
|
668 |
//// dataset.addValue(specificitiesResult.getSelectedSpecificitiesIndex()[j][i], |
|
669 |
//// specificitiesResult.getSelectedTypeNames()[j], |
|
670 |
//// specificitiesResult.getSelectedPartNames()[i]); |
|
671 |
//// } |
|
672 |
//// } |
|
673 |
//// } |
|
674 |
//// |
|
675 |
//// if(drawBars) { |
|
676 |
//// // Create the bar chart |
|
677 |
//// chart = this.createCategoryBarChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false); |
|
678 |
//// } |
|
679 |
//// else { |
|
680 |
//// // Create the line chart |
|
681 |
//// chart = this.createCategoryLineChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false); |
|
682 |
//// } |
|
683 |
//// ((IItemSelectionRenderer) chart.getCategoryPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_SPECIFICITIES); |
|
684 |
//// |
|
685 |
//// |
|
686 |
//// // Custom range axis for ticks drawing options |
|
687 |
//// double minimumValue = DatasetUtilities.findMinimumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue(); |
|
688 |
//// double maximumValue = DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue(); |
|
689 |
//// // Adjust ticks values according to data set contains only positives values or only negatives values |
|
690 |
//// if(minimumValue > 0) { |
|
691 |
//// minimumValue = 0; |
|
692 |
//// } |
|
693 |
//// if(maximumValue < 0) { |
|
694 |
//// maximumValue = banality; |
|
695 |
//// } |
|
696 |
//// |
|
697 |
//// // Custom range axis to cut the values to minimum and maximum values |
|
698 |
//// chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), true, true, minimumValue, maximumValue)); |
|
699 |
//// |
|
700 |
//// |
|
701 |
//// // Add positive banality marker |
|
702 |
//// Marker marker = new ValueMarker(banality); |
|
703 |
//// marker.setPaint(Color.red); |
|
704 |
//// marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, banality)); |
|
705 |
//// marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
706 |
//// marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
707 |
//// chart.getCategoryPlot().addRangeMarker(marker); |
|
708 |
//// |
|
709 |
//// |
|
710 |
//// // Add negative banality marker |
|
711 |
//// marker = new ValueMarker(-banality); |
|
712 |
//// marker.setPaint(Color.red); |
|
713 |
//// marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, -banality)); |
|
714 |
//// marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
715 |
//// marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
716 |
//// chart.getCategoryPlot().addRangeMarker(marker); |
|
717 |
// |
|
718 |
// |
|
719 |
// int itemsColorsRenderingMode = ChartsEngine.RENDERING_COLORS_MODE; |
|
720 |
// // Grayscale |
|
721 |
// if(grayscale) { |
|
722 |
// itemsColorsRenderingMode = ChartsEngine.RENDERING_GRAYSCALE_MODE; |
|
723 |
// } |
|
724 |
// |
|
725 |
// // Re-apply theme to the chart to match the colors rendering mode |
|
726 |
// // FIXME : the rendering mode should be pass to all methods, even base methods as createXYLineChart(), createBarChart(), etc. |
|
727 |
// this.theme.applyThemeToChart(chart, itemsColorsRenderingMode); |
|
728 |
// |
|
729 |
// return chart; |
|
730 |
// } |
|
731 |
|
|
732 |
|
|
733 |
// @Override |
|
734 |
// public File createSpecificitiesChartFile(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean grayscale, File file) { |
|
735 |
// return this.export(this.createSpecificitiesChart(specificitiesResult, transpose, drawBars, drawLines, banalite, grayscale), file); |
|
736 |
// } |
|
737 |
|
|
738 |
|
|
739 |
// @Override |
|
740 |
// public JFreeChart createProgressionChart(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative) { |
|
741 |
// |
|
742 |
// JFreeChart chart = null; |
|
743 |
// |
|
744 |
// // Create the dataset |
|
745 |
// XYSeriesCollection dataset = new XYSeriesCollection(); |
|
746 |
// List<int[]> positions = progression.getAllpositions(); |
|
747 |
// List<Query> queries = progression.getQueries(); |
|
748 |
// // Y axis label |
|
749 |
// String yAxisLabel; |
|
750 |
// |
|
751 |
// // Cumulative |
|
752 |
// if(cumulative) { |
|
753 |
// for(int i = 0; i < progression.getAllpositions().size(); i++) { |
|
754 |
// int[] list = positions.get(i); |
|
755 |
// Query query = queries.get(i); |
|
756 |
// XYSeries series = new XYSeries(query.toString() + " " + list.length); |
|
757 |
// int c = 1; |
|
758 |
// for(int j = 0; j < list.length; j++) { |
|
759 |
// // Add a first point to draw a vertical line |
|
760 |
// if(j == 0) { |
|
761 |
// series.add(list[j], 0); |
|
762 |
// } |
|
763 |
// series.add(list[j], c++); |
|
764 |
// } |
|
765 |
// |
|
766 |
// // FIXME: add a dummy point to draw horizontal line between last point and max X corpus |
|
767 |
// series.add(progression.getXmaxCorpus(), --c); |
|
768 |
// dataset.addSeries(series); |
|
769 |
// } |
|
770 |
// |
|
771 |
// // Create the chart |
|
772 |
// yAxisLabel = ChartsEngineMessages.ChartsEngine_PROGRESSION_Y_AXIS_CUMULATIVE_LABEL; |
|
773 |
// chart = this.createXYStepChart(dataset, this.createProgressionChartTitle(progression, cumulative), |
|
774 |
// JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel, true, true, true, true, true); |
|
775 |
// |
|
776 |
// |
|
777 |
// // Custom renderer |
|
778 |
// chart.getXYPlot().setRenderer(this.theme.createProgressionRenderer()); |
|
779 |
// |
|
780 |
// } |
|
781 |
// // FIXME : Density, to implement when textometry R package will store the result in the Progression class |
|
782 |
// else { |
|
783 |
// |
|
784 |
// // FIXME : density not yet implemented |
|
785 |
// System.err.println("JFCChartsEngine.createProgressionChart(): density mode not yet implemented."); |
|
786 |
// |
|
787 |
// for(int i = 0; i < progression.getAllpositions().size(); i++) { |
|
788 |
// int[] liste = positions.get(i); |
|
789 |
// Query query = queries.get(i); |
|
790 |
// XYSeries series = new XYSeries(query.toString() + " " + liste.length); |
|
791 |
// |
|
792 |
// for(int j = 0; j < liste.length; j++) { |
|
793 |
// |
|
794 |
// // FIXME : tests y |
|
795 |
// // y <- c( c(0), y , c(y[[length(x)]]) ) // R code |
|
796 |
// // FIXME : random Y value |
|
797 |
// double y = progression.getAllpositions().get(i)[j] * Math.random(); |
|
798 |
// // double y = progression.getAllpositions().get(i)[j]; |
|
799 |
// series.add(liste[j], y); |
|
800 |
// } |
|
801 |
// dataset.addSeries(series); |
|
802 |
// } |
|
803 |
// |
|
804 |
// // Create the chart |
|
805 |
// yAxisLabel = ChartsEngineMessages.ChartsEngine_PROGRESSION_Y_AXIS_NOT_CUMULATIVE_LABEL; |
|
806 |
// chart = this.createXYLineChart(dataset, this.createProgressionChartTitle(progression, cumulative), |
|
807 |
// JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel, |
|
808 |
// true, true, true, false, true, false, true, null); |
|
809 |
// } |
|
810 |
// |
|
811 |
// |
|
812 |
// |
|
813 |
// ((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PROGRESSION); |
|
814 |
// ((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).getItemsSelector().setResultData(progression); |
|
815 |
// |
|
816 |
// |
|
817 |
// // Add the limit markers |
|
818 |
// BasicStroke dashedStroke = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] {2f}, 0f); |
|
819 |
// Marker marker = new ValueMarker(progression.getXminCorpus()); |
|
820 |
// marker.setPaint(Color.gray); |
|
821 |
// marker.setStroke(dashedStroke); |
|
822 |
// chart.getXYPlot().addDomainMarker(marker); |
|
823 |
// marker = new ValueMarker(progression.getXmaxCorpus()); |
|
824 |
// marker.setPaint(Color.gray); |
|
825 |
// marker.setStroke(dashedStroke); |
|
826 |
// chart.getXYPlot().addDomainMarker(marker); |
|
827 |
// |
|
828 |
// |
|
829 |
//// // FIXME : limit with annotations rather than markers (marker height is dynamically adapted to the real chart height. |
|
830 |
// // Annotation have a fixed height) |
|
831 |
//// XYLineAnnotation annotation = new XYLineAnnotation(0, 0, 0, dataset.getRangeUpperBound(true), dashedStroke, Color.gray); |
|
832 |
//// chart.getXYPlot().addAnnotation(annotation, true); |
|
833 |
// |
|
834 |
// // Add the part markers |
|
835 |
// if(progression.getStructurePositions().length > 0) { |
|
836 |
// for(int i = 0; i < progression.getStructurePositions().length; i++) { |
|
837 |
// if(progression.getStructurePositions()[i] != 0) { |
|
838 |
// marker = new ValueMarker(progression.getStructurePositions()[i]); |
|
839 |
// marker.setPaint(Color.black); |
|
840 |
// marker.setLabel(progression.getStructureNames()[i]); |
|
841 |
// marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
842 |
// marker.setLabelTextAnchor(TextAnchor.HALF_ASCENT_LEFT); |
|
843 |
// |
|
844 |
// |
|
845 |
// // FIXME: test of rotated annotations rather than using marker label. The problem with this is that the position of annotation is not adjusted when zooming/dezooming. |
|
846 |
// // FIXME: the best approach is to redefine the drawing method of |
|
847 |
////// double start = marker.getStartValue(); |
|
848 |
////// double end = TempIntervalMarker.getEndValue(); |
|
849 |
////// double middle = (end - start)/2; |
|
850 |
//// XYTextAnnotation updateLabel = new XYTextAnnotation("Update", progression.getStructurePositions()[i], 0); |
|
851 |
//// updateLabel.setFont(new Font("Sans Serif", Font.BOLD, 10)); |
|
852 |
//// updateLabel.setRotationAnchor(TextAnchor.BASELINE_CENTER); |
|
853 |
//// updateLabel.setTextAnchor(TextAnchor.BASELINE_CENTER); |
|
854 |
//// updateLabel.setRotationAngle(3.14 / 2); |
|
855 |
//// updateLabel.setPaint(Color.black); |
|
856 |
//// chart.getXYPlot().addAnnotation(updateLabel); |
|
857 |
// |
|
858 |
// |
|
859 |
// |
|
860 |
// chart.getXYPlot().addDomainMarker(marker); |
|
861 |
// } |
|
862 |
// } |
|
863 |
// } |
|
864 |
// |
|
865 |
// // Custom domain axis for ticks drawing options |
|
866 |
// chart.getXYPlot().setDomainAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getDomainAxis(), true, true, progression.getXminCorpus(), progression.getXmaxCorpus())); |
|
867 |
// |
|
868 |
// // Custom range axis for ticks drawing options |
|
869 |
// chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, progression.getMaxY())); |
|
870 |
// |
|
871 |
// // Match the X-axis origin value to the min x corpus (for subcorpus case) |
|
872 |
// chart.getXYPlot().getDomainAxis().setLowerBound(progression.getXminCorpus()); |
|
873 |
// |
|
874 |
// |
|
875 |
// int itemsColorsRenderingMode = Theme.ITEMS_RENDERING_COLORS_MODE; |
|
876 |
// // Grayscale |
|
877 |
// if(grayscale) { |
|
878 |
// itemsColorsRenderingMode = Theme.ITEMS_RENDERING_GRAYSCALE_MODE; |
|
879 |
// } |
|
880 |
// |
|
881 |
// // Re-apply theme to the chart to match the colors rendering mode |
|
882 |
// // FIXME : the rendering mode should be pass to all methods, even base methods as createXYLineChart(), createBarChart(), etc. |
|
883 |
// // or better, to be stocked into a member variable in the theme ? |
|
884 |
// this.theme.applyThemeToChart(chart, itemsColorsRenderingMode, monostyle); |
|
885 |
// |
|
886 |
// return chart; |
|
887 |
// } |
|
888 |
// |
|
889 |
// @Override |
|
890 |
// public File createProgressionChartFile(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative, File file) { |
|
891 |
// return this.export(this.createProgressionChart(progression, grayscale, monostyle, cumulative), file); |
|
892 |
// } |
|
893 |
|
|
894 |
|
|
895 |
|
|
896 |
|
|
897 |
|
|
898 | 416 |
/** |
899 | 417 |
* @return the theme |
900 | 418 |
*/ |
... | ... | |
1036 | 554 |
* @param drawingAreaHeight |
1037 | 555 |
* @return |
1038 | 556 |
*/ |
1039 |
// FIXME : enhance this method to add compression mode and quality, see : ImageIO.getImageWritersByFormatName("jpg") for that
|
|
557 |
// TODO : enhance this method to add compression mode and quality, see : ImageIO.getImageWritersByFormatName("jpg") for that
|
|
1040 | 558 |
public static File exportRasterImage(JFreeChart chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) { |
1041 | 559 |
|
1042 | 560 |
BufferedImage bufferedImage = ((JFreeChart) chart).createBufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB, null); |
... | ... | |
1573 | 1091 |
return false; |
1574 | 1092 |
} |
1575 | 1093 |
|
1576 |
|
|
1577 |
|
|
1578 |
|
|
1579 | 1094 |
@Override |
1580 | 1095 |
public boolean start(IProgressMonitor monitor) throws Exception { |
1581 | 1096 |
// TODO Auto-generated method stub |
1582 | 1097 |
return false; |
1583 | 1098 |
} |
1584 | 1099 |
|
1585 |
|
|
1586 |
|
|
1587 | 1100 |
@Override |
1588 | 1101 |
public boolean stop() throws Exception { |
1589 | 1102 |
// TODO Auto-generated method stub |
1590 | 1103 |
return false; |
1591 | 1104 |
} |
1592 | 1105 |
|
1593 |
|
|
1594 |
|
|
1595 | 1106 |
@Override |
1596 | 1107 |
public String getName() { |
1597 | 1108 |
return JFCChartsEngine.NAME; |
1598 | 1109 |
} |
1599 | 1110 |
|
1600 |
|
|
1601 |
// FIXME: old version |
|
1602 |
// /** |
|
1603 |
// * Constrains axes ticks to square aspect ratio. |
|
1604 |
// * @param width |
|
1605 |
// * @param height |
|
1606 |
// */ |
|
1607 |
// public void squareOffGraph(JFreeChart chart, double width, double height) { |
|
1608 |
// |
|
1609 |
// if(getChart().getPlot() instanceof XYPlot) { |
|
1610 |
// |
|
1611 |
// ValueAxis xAxis = ((XYPlot)getChart().getPlot()).getDomainAxis(0); |
|
1612 |
// ValueAxis yAxis = ((XYPlot)getChart().getPlot()).getRangeAxis(0); |
|
1613 |
// |
|
1614 |
// double xLower = xAxis.getLowerBound(); |
|
1615 |
// double xUpper = xAxis.getUpperBound(); |
|
1616 |
// |
|
1617 |
// double yLower = yAxis.getLowerBound(); |
|
1618 |
// double yUpper = yAxis.getUpperBound(); |
|
1619 |
// |
|
1620 |
// if(width > height) { |
|
1621 |
// double idealXRange = (yUpper - yLower) * width / height; |
|
1622 |
// double currXRange = xUpper - xLower; |
|
1623 |
// |
|
1624 |
// double xDelta = (idealXRange - currXRange) / 2; |
|
1625 |
// |
|
1626 |
// // Are we within a pixel of being square? |
|
1627 |
// if ((int)(xDelta * width) == 0) { |
|
1628 |
// return; |
|
1629 |
// } |
|
1630 |
// |
|
1631 |
// xAxis.setLowerBound(xLower - xDelta); |
|
1632 |
// xAxis.setUpperBound(xUpper + xDelta); |
|
1633 |
// } |
|
1634 |
// else if(height > width) { |
|
1635 |
// double idealYRange = (xUpper - xLower) * height / width; |
|
1636 |
// double currYRange = yUpper - yLower; |
|
1637 |
// |
|
1638 |
// double yDelta = (idealYRange - currYRange) / 2; |
|
1639 |
// |
|
1640 |
// // Are we within a pixel of being square? |
|
1641 |
// if ((int)(yDelta * height) == 0) { |
|
1642 |
// return; |
|
1643 |
// } |
|
1644 |
// |
|
1645 |
// yAxis.setLowerBound(yLower - yDelta); |
|
1646 |
// yAxis.setUpperBound(yUpper + yDelta); |
|
1647 |
// } |
|
1648 |
// } |
|
1649 |
// } |
|
1650 |
|
|
1651 |
|
|
1652 |
// FIXME: unit aspect ratio constraint tests |
|
1653 |
// public void squareOffGraph2(JFreeChart chart) { |
|
1654 |
// |
|
1655 |
// if(getChart().getPlot() instanceof XYPlot) { |
|
1656 |
// XYPlot plot = (XYPlot) getChart().getPlot(); |
|
1657 |
// ValueAxis domainAxis = plot.getDomainAxis(); |
|
1658 |
// Rectangle2D dataArea = getScreenDataArea(); |
|
1659 |
// ValueAxis rangeAxis = plot.getRangeAxis(); |
|
1660 |
// |
|
1661 |
// // Now modify axes ranges to ensure aspect ratio is 1 |
|
1662 |
// double rl = rangeAxis.getRange().getLowerBound(); |
|
1663 |
// double ru = rangeAxis.getRange().getUpperBound(); |
|
1664 |
// |
|
1665 |
// double rls = rangeAxis.valueToJava2D(rl, dataArea, plot.getRangeAxisEdge()); |
|
1666 |
// double rus = rangeAxis.valueToJava2D(ru, dataArea, plot.getRangeAxisEdge()); |
|
1667 |
// |
|
1668 |
//// double rangeratio = Math.abs((rus - rls) / (ru - rl)); |
|
1669 |
// |
|
1670 |
// double dl = domainAxis.getRange().getLowerBound(); |
|
1671 |
// double du = domainAxis.getRange().getUpperBound(); |
|
1672 |
// double dls = domainAxis.valueToJava2D(dl, dataArea, plot.getDomainAxisEdge()); |
|
1673 |
// double dus = domainAxis.valueToJava2D(du, dataArea, plot.getDomainAxisEdge()); |
|
1674 |
// |
|
1675 |
// // System.out.println("ItemSelectionXYLineAndShapeRenderer.drawSecondaryPass(): " + (rls - rus)); |
|
1676 |
// |
|
1677 |
//// double domainratio = Math.abs((dus - dls) / (du - dl)); |
|
1678 |
//// |
|
1679 |
//// // precision limit to ensure we don't keep rendering |
|
1680 |
//// double eps = 1.01; |
|
1681 |
//// if (rangeratio / domainratio > eps) { |
|
1682 |
//// rangeAxis.setAutoRange(false); |
|
1683 |
//// double totalrange = Math.abs(ru - rl) * rangeratio / domainratio; |
|
1684 |
//// double l = (ru - rl) / 2 - totalrange / 2; |
|
1685 |
//// double u = (ru - rl) / 2 + totalrange / 2; |
|
1686 |
//// rangeAxis.setRange(new Range(l, u)); |
|
1687 |
//// } else if (domainratio / rangeratio > eps) { |
|
1688 |
//// domainAxis.setAutoRange(false); |
|
1689 |
//// double totalrange = Math.abs(du - dl) * domainratio / rangeratio; |
|
1690 |
//// double l = (du - dl) / 2 - totalrange / 2; |
|
1691 |
//// double u = (du - dl) / 2 + totalrange / 2; |
|
1692 |
//// domainAxis.setRange(new Range(l, u)); |
|
1693 |
//// } |
|
1694 |
// |
|
1695 |
// |
|
1696 |
// double xPixelsWidth = Math.abs(dus + dls); |
|
1697 |
// double yPixelsHeight = Math.abs(rus + rls); |
|
1698 |
// |
|
1699 |
// // FIXME: tests 3 |
|
1700 |
// //System.out.println("ItemSelectionXYLineAndShapeRenderer.drawSecondaryPass(): " + getPlot().getRangeAxis().getFixedDimension()); |
|
1701 |
// |
|
1702 |
// //System.out.println("ItemSelectionXYLineAndShapeRenderer.drawSecondaryPass(): xPixelsWidth " + xPixelsWidth); |
|
1703 |
// |
|
1704 |
// |
|
1705 |
// |
|
1706 |
// if(rangeAxis.getRange().getLength() > domainAxis.getRange().getLength()) { |
|
1707 |
// |
|
1708 |
// // Shrink X axis pixels width |
|
1709 |
// if(xPixelsWidth > yPixelsHeight) { |
|
1710 |
// |
|
1711 |
// double newPixelsWidth = plot.getDomainAxis().getRange().getLength() * yPixelsHeight / plot.getRangeAxis().getRange().getLength(); |
|
1712 |
// |
|
1713 |
// xPixelsWidth = (xPixelsWidth - newPixelsWidth) / 2; |
|
1714 |
// |
|
1715 |
// |
|
1716 |
// //System.out.println("ItemSelectionXYLineAndShapeRenderer.drawSecondaryPass() newPixelsWidth : " + newPixelsWidth); |
|
1717 |
// |
|
1718 |
// // FIXME: axis space version |
|
1719 |
// AxisSpace xAxisSpace = new AxisSpace(); |
|
1720 |
// xAxisSpace.add(xPixelsWidth, plot.getRangeAxisEdge()); |
|
1721 |
// xAxisSpace.add(xPixelsWidth, plot.getRangeAxisEdge(1)); |
|
1722 |
// // xAxisSpace.shrink(new Rectangle2D.Double(50, 0, 20, 50), null); |
|
1723 |
// plot.setFixedRangeAxisSpace(xAxisSpace); |
|
1724 |
// |
|
1725 |
// // FIXME: insets version |
|
1726 |
// // double top, double left, double bottom, double right |
|
1727 |
//// plot.setInsets(new RectangleInsets(plot.getInsets().getTop(), xPixelsWidth, plot.getInsets().getBottom(), xPixelsWidth)); |
|
1728 |
// |
|
1729 |
// // FIXME: auto range tests |
|
1730 |
// //plot.getRangeAxis().setAutoRange(false); |
|
1731 |
// //plot.getRangeAxis().setAutoRangeMinimumSize(200); |
|
1732 |
// |
|
1733 |
// } |
|
1734 |
// // Shrink Y axis pixels height |
|
1735 |
// else |
|
1736 |
// if(yPixelsHeight > xPixelsWidth) { |
|
1737 |
// |
|
1738 |
// double newPixelsHeight = plot.getRangeAxis().getRange().getLength() * xPixelsWidth / plot.getDomainAxis().getRange().getLength(); |
|
1739 |
// |
|
1740 |
// yPixelsHeight = (yPixelsHeight - newPixelsHeight) / 2; |
|
1741 |
// |
|
1742 |
// //System.out.println("ItemSelectionXYLineAndShapeRenderer.drawSecondaryPass() newPixelsHeight : " + newPixelsHeight); |
|
1743 |
// |
|
1744 |
// // FIXME: axis space version |
|
1745 |
// AxisSpace yAxisSpace = new AxisSpace(); |
|
1746 |
// yAxisSpace.add(yPixelsHeight, plot.getDomainAxisEdge()); |
|
1747 |
// yAxisSpace.add(yPixelsHeight, plot.getDomainAxisEdge(1)); |
|
1748 |
// plot.setFixedDomainAxisSpace(yAxisSpace); |
|
1749 |
// |
|
1750 |
// // FIXME: insets version |
|
1751 |
// // double top, double left, double bottom, double right |
|
1752 |
//// plot.setInsets(new RectangleInsets(yPixelsHeight, plot.getInsets().getLeft(), yPixelsHeight, plot.getInsets().getRight())); |
|
1753 |
// |
|
1754 |
// // FIXME: auto range tests |
|
1755 |
// //plot.getDomainAxis().setAutoRange(false); |
|
1756 |
// //plot.getDomainAxis().setAutoRangeMinimumSize(200); |
|
1757 |
// } |
|
1758 |
// } |
|
1759 |
// } |
|
1760 |
// } |
|
1761 |
|
|
1762 |
|
|
1763 |
// FIXME: unit aspect ratio constraint tests |
|
1764 |
// public void squareOffGraph3(JFreeChart chart) { |
|
1765 |
// ValueAxis rangeAxis = getChart().getXYPlot().getRangeAxis(); |
|
1766 |
// ValueAxis domainAxis = getChart().getXYPlot().getDomainAxis(); |
|
1767 |
// //Rectangle2D dataArea = new Rectangle2D.Double(0, 0, 1600, 500); |
|
1768 |
// Rectangle2D dataArea = new Rectangle2D.Double(0, 0, getWidth(), getHeight()); |
|
1769 |
// //Rectangle2D dataArea = getScreenDataArea(); |
|
1770 |
// |
|
1771 |
// double rl = rangeAxis.getRange().getLowerBound(); |
|
1772 |
// double ru = rangeAxis.getRange().getUpperBound(); |
|
1773 |
// |
|
1774 |
// double rls = rangeAxis.valueToJava2D(rl, dataArea, |
|
1775 |
// getChart().getXYPlot().getRangeAxisEdge()); |
|
1776 |
// double rus = rangeAxis.valueToJava2D(ru, dataArea, |
|
1777 |
// getChart().getXYPlot().getRangeAxisEdge()); |
|
1778 |
// |
|
1779 |
// double rangeratio = Math.abs((rus - rls) / (ru - rl)); |
|
1780 |
// |
|
1781 |
// double dl = domainAxis.getRange().getLowerBound(); |
|
1782 |
// double du = domainAxis.getRange().getUpperBound(); |
|
1783 |
// |
|
1784 |
// double dls = domainAxis.valueToJava2D(dl, dataArea, |
|
1785 |
// getChart().getXYPlot().getDomainAxisEdge()); |
|
1786 |
// double dus = domainAxis.valueToJava2D(du, dataArea, |
|
1787 |
// getChart().getXYPlot().getDomainAxisEdge()); |
|
1788 |
// double domainratio = Math.abs((dus - dls) / (du - dl)); |
|
1789 |
// |
|
1790 |
// // precision limit to ensure we don't keep rendering |
|
1791 |
// double eps = 1.01; |
|
1792 |
// if (rangeratio / domainratio > eps) { |
|
1793 |
// rangeAxis.setAutoRange(false); |
|
1794 |
// double totalrange = Math.abs(ru - rl) * rangeratio / domainratio; |
|
1795 |
// double l = (ru - rl) / 2 - totalrange / 2; |
|
1796 |
// double u = (ru - rl) / 2 + totalrange / 2; |
|
1797 |
// rangeAxis.setRange(new Range(l, u)); |
|
1798 |
// } else if (domainratio / rangeratio > eps) { |
|
1799 |
// domainAxis.setAutoRange(false); |
|
1800 |
// double totalrange = Math.abs(du - dl) * domainratio / rangeratio; |
|
1801 |
// double l = (du - dl) / 2 - totalrange / 2; |
|
1802 |
// double u = (du - dl) / 2 + totalrange / 2; |
|
1803 |
// domainAxis.setRange(new Range(l, u)); |
|
1804 |
// } |
|
1805 |
// } |
|
1806 | 1111 |
|
1807 |
|
|
1808 |
|
|
1809 |
|
|
1810 | 1112 |
} |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartCreator.java (revision 892) | ||
---|---|---|
100 | 100 |
else if(result.getChart() instanceof File) { |
101 | 101 |
// creates a new chart but using the same file |
102 | 102 |
this.createChartFile(result, (File)result.getChart()); |
103 |
|
|
104 |
// FIXME: using new file |
|
105 |
//this.createChartFile(result, preferencesNode); |
|
106 |
|
|
107 | 103 |
} |
108 |
|
|
109 |
|
|
110 | 104 |
} |
111 | 105 |
|
112 | 106 |
|
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/SymbolAxisBetweenTicks.java (revision 892) | ||
---|---|---|
277 | 277 |
} |
278 | 278 |
|
279 | 279 |
|
280 |
// FIXME: ratio tests for label truncation system in partition dimensions and specificities |
|
281 |
//l -= getPlot().getInsets().getBottom(); |
|
282 | 280 |
l += 1000; |
283 | 281 |
|
284 | 282 |
float ratio = 0.1f; |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/CategoryAxisBetweenTicks.java (revision 892) | ||
---|---|---|
97 | 97 |
if(categoriesCount > 1) { |
98 | 98 |
xDecals = getCategoryStart(1, categoriesCount, dataArea, edge) - getCategoryEnd(0, categoriesCount, dataArea, edge); |
99 | 99 |
xDecals /= 2; |
100 |
// FIXME : xDecals computing bug if category margin is different from 0 |
|
101 |
// the code below doesn't fix the problem |
|
102 |
// xDecals -= dataArea.getWidth() * getCategoryMargin() / categoriesCount; |
|
103 |
// xDecals -= dataArea.getWidth() * getCategoryMargin() / categoriesCount; |
|
104 | 100 |
} |
105 | 101 |
|
106 |
// TODO : First tick, see compatibility with setLowerMargin(), the lower margin value must be computed here else, for example if the lower value = 0, the first tick will be outside of the chart |
|
107 |
// if(categoriesCount > 0) { |
|
108 |
// //x = dataArea.getMinX() + xDecals; |
|
109 |
// x = getCategoryStart(0, categoriesCount, dataArea, edge) - xDecals; |
|
110 |
// line.setLine(x, cursor, x, cursor - il); |
|
111 |
// g2.draw(line); |
|
112 |
// line.setLine(x, cursor, x, cursor + ol); |
|
113 |
// g2.draw(line); |
|
114 |
// } |
|
115 |
|
|
116 |
|
|
117 | 102 |
int i = 0; |
118 | 103 |
|
119 | 104 |
while (i < categoriesCount - 1) { // TODO : (- 1) for not drawing the last tick because of same problem of margin as above |
tmp/org.txm.chartsengine.jfreechart.core/META-INF/MANIFEST.MF (revision 892) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 |
Require-Bundle: org.txm.libs.jfreechart;bundle-version="1.0.17";visibility:=reexport, |
|
2 |
Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport, |
|
3 |
org.txm.libs.jfreechart;bundle-version="1.0.17";visibility:=reexport, |
|
3 | 4 |
org.txm.libs.itext;visibility:=reexport, |
4 |
org.txm.libs.jfreesvg;bundle-version="1.7.0";visibility:=reexport, |
|
5 |
org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport |
|
5 |
org.txm.libs.jfreesvg;bundle-version="1.7.0";visibility:=reexport |
|
6 | 6 |
Export-Package: org.txm.chartsengine.jfreechart.core, |
7 | 7 |
org.txm.chartsengine.jfreechart.core.preferences, |
8 | 8 |
org.txm.chartsengine.jfreechart.core.renderers, |
tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java (revision 892) | ||
---|---|---|
308 | 308 |
return query.toString(); |
309 | 309 |
} |
310 | 310 |
|
311 |
//FIXME move/replace this to a link / with a command call |
|
312 |
// public Object toConcordance(){ |
|
313 |
// String query = buildQuery(); |
|
314 |
// if (query == null) return null; |
|
315 |
// |
|
316 |
// Concordance concordance = new Concordance(corpus); |
|
317 |
// concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null); |
|
318 |
// TXMResultEditorInput editorInput = new TXMResultEditorInput(concordance); |
|
319 |
// IWorkbenchPage page = this.getSite().getPage(); |
|
320 |
// try { |
|
321 |
// ConcordanceEditor conceditor = (ConcordanceEditor) page |
|
322 |
// .openEditor(editorInput, "ConcordanceEditor"); //$NON-NLS-1$ |
|
323 |
// return conceditor; |
|
324 |
// } catch (PartInitException e) { |
|
325 |
// System.err.println(NLS.bind(Messages.GetConcordances_4, e)); |
|
326 |
// } |
|
327 |
// return null; |
|
328 |
// } |
|
329 |
// |
|
330 |
// public Object toIndex() { |
|
331 |
// String query = buildQuery(); |
|
332 |
// if (query == null) return null; |
|
333 |
// try { |
|
334 |
// Index index = new Index(corpus); |
|
335 |
// index.setParameters(new Query(query), Arrays.asList(corpus.getWordProperty()), null, null, null, null); |
|
336 |
// TXMResultEditorInput editorInput = new TXMResultEditorInput(index); |
|
337 |
// IWorkbenchPage page = this.getSite().getPage(); |
|
338 |
// |
|
339 |
// IndexEditor voceditor = (IndexEditor) page |
|
340 |
// .openEditor(editorInput, |
|
341 |
// "org.txm.rcp.editors.index.IndexEditor"); //$NON-NLS-1$ |
|
342 |
// voceditor.setFocus(query); |
|
343 |
// voceditor.computeResult(); |
|
344 |
// return voceditor; |
|
345 |
// } catch (Exception e) { |
|
346 |
// System.err.println(NLS.bind(Messages.GetConcordances_4, e)); |
|
347 |
// } |
|
348 |
// return null; |
|
349 |
// } |
|
350 |
|
|
351 | 311 |
public boolean backToText(Match m) { |
352 | 312 |
// Match m = line.getMatch(); |
353 | 313 |
internalView.getCurrentPage(); |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java (revision 892) | ||
---|---|---|
40 | 40 |
import org.txm.searchengine.cqp.corpus.Property; |
41 | 41 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
42 | 42 |
import org.txm.searchengine.cqp.corpus.query.Match; |
43 |
import org.txm.searchengine.cqp.corpus.query.Query; |
|
44 | 43 |
import org.txm.utils.logger.Log; |
45 | 44 |
|
46 | 45 |
/** |
... | ... | |
55 | 54 |
* To keep track of the concordance lines and recomputing only if the selected item is out of this range. |
56 | 55 |
*/ |
57 | 56 |
protected int lastConcordanceTopLine = -1; |
58 |
//protected int lastConcordanceBottomLine = -1; |
|
59 | 57 |
|
60 | 58 |
/** |
61 | 59 |
* To keep track of the concordance lines sort and recomputing only if the sorting order has changed. |
62 | 60 |
*/ |
63 | 61 |
protected LineComparator lastSortingComparator = null; |
64 | 62 |
|
65 |
//FIXME: version with TXMBrowser old system edition |
|
66 |
// @Override |
|
67 |
// public void processEvent(final AWTEvent event, final int eventArea, final Object o) { |
|
68 |
// |
|
69 |
// // Need to run this in the SWT UI thread because it's called from the AWT UI thread in TBX charts engine layer |
|
70 |
// chartEditor.getComposite().getDisplay().asyncExec(new Runnable() { |
|
71 |
// public void run() { |
|
72 |
// |
|
73 |
// // Mouse event |
|
74 |
// if(event instanceof MouseEvent) { |
|
75 |
// |
|
76 |
// MouseEvent mouseEvent = (MouseEvent)event; |
|
77 |
// |
|
78 |
// //return if it's not the left mouse button |
|
79 |
// if(mouseEvent.getButton() != MouseEvent.BUTTON1) { |
|
80 |
// return; |
|
81 |
// } |
|
82 |
// |
|
83 |
// |
|
84 |
// ChartMouseEvent chartEvent = (ChartMouseEvent) o; |
|
85 |
// ChartEntity entity = chartEvent.getEntity(); |
|
86 |
// final ArrayList<Integer> selectedPointPositions = Utils.getChartCreator(chartEditor.getChartsEngine()).getSelectedPointPositions(chartEditor.getChart()); |
|
87 |
// |
|
88 |
// if(event.getID() == MouseEvent.MOUSE_CLICKED && mouseEvent.getClickCount() == 2 && eventArea == EventCallBack.AREA_ITEM && !selectedPointPositions.isEmpty()) { |
|
89 |
// |
|
90 |
// // Linked edition (CTRL/CMD + double click) |
|
91 |
// if((mouseEvent.getModifiers() & ZoomAndPanCallBack.keyboardZoomModifierKeyMask) != 0) { |
|
92 |
// // Updates the linked editor |
|
93 |
// updateLinkedEditionEditor((TXMBrowser) chartEditor.getLinkedEditor(TXMBrowser.class), selectedPointPositions); |
|
94 |
// } |
|
95 |
// // Linked concordance |
|
96 |
// else { |
|
97 |
// // Updates the linked editor |
|
98 |
// updateLinkedConcordanceEditor(chartEditor.getLinkedEditors(ConcordanceEditor.class), selectedPointPositions); |
|
99 |
// } |
|
100 |
// } |
|
101 |
// else if(event.getID() == MouseEvent.MOUSE_CLICKED && mouseEvent.getClickCount() == 1 && eventArea == EventCallBack.AREA_ITEM) { |
|
102 |
// |
|
103 |
// // Get the linked concordance editors and update the one linked to the progression curve if it exists |
|
104 |
// ArrayList<EditorPart> linkedConcordancesEditors = chartEditor.getLinkedEditors(ConcordanceEditor.class); |
|
105 |
// if(!linkedConcordancesEditors.isEmpty()) { |
|
106 |
// updateLinkedConcordanceEditor(linkedConcordancesEditors, selectedPointPositions); |
|
107 |
// } |
|
108 |
// |
|
109 |
// |
|
110 |
// // Get the linked edition editor and update it if exists |
|
111 |
// TXMBrowser linkedEditionEditor = (TXMBrowser)chartEditor.getLinkedEditor(TXMBrowser.class); |
|
112 |
// if(linkedEditionEditor != null) { |
|
113 |
// updateLinkedEditionEditor(linkedEditionEditor, selectedPointPositions); |
|
114 |
// } |
|
115 |
// |
|
116 |
// } |
|
117 |
// else if(event.getID() == MouseEvent.MOUSE_CLICKED && mouseEvent.getClickCount() == 2 && eventArea == EventCallBack.AREA_EMPTY) { |
|
118 |
// // FIXME: debug |
|
119 |
// //System.err.println("ProgressionMouseClickedCallBack.processEvent(...).new Runnable() {...}.run(): double click in empty area"); |
|
120 |
// } |
|
121 |
// else if(event.getID() == MouseEvent.MOUSE_CLICKED && mouseEvent.getClickCount() == 1 && eventArea == EventCallBack.AREA_EMPTY) { |
|
122 |
// // FIXME: debug |
|
123 |
// //System.err.println("ProgressionMouseClickedCallBack.processEvent(...).new Runnable() {...}.run(): single click in empty area"); |
|
124 |
// } |
|
125 |
// } |
|
126 |
// // Key event |
|
127 |
// else if(event instanceof KeyEvent) { |
|
128 |
// KeyEvent keyEvent = (KeyEvent)event; |
|
129 |
// |
|
130 |
// // return if zoom and pan modifier |
|
131 |
// if((keyEvent.getModifiers() & ZoomAndPanCallBack.keyboardZoomModifierKeyMask) != 0) { |
|
132 |
// return; |
|
133 |
// } |
|
134 |
// |
|
135 |
// // Arrow keys |
|
136 |
// if(keyEvent.getKeyCode() == KeyEvent.VK_LEFT || keyEvent.getKeyCode() == KeyEvent.VK_RIGHT) { |
|
137 |
// |
|
138 |
// final ArrayList<Integer> selectedPointPositions = Utils.getChartCreator(chartEditor.getChartsEngine()).getSelectedPointPositions(chartEditor.getChart()); |
|
139 |
// |
|
140 |
// // Get the linked concordance editors and update the one linked to the progression curve if it exists |
|
141 |
// ArrayList<EditorPart> linkedConcordancesEditors = chartEditor.getLinkedEditors(ConcordanceEditor.class); |
|
142 |
// if(!linkedConcordancesEditors.isEmpty()) { |
|
143 |
// updateLinkedConcordanceEditor(linkedConcordancesEditors, selectedPointPositions); |
|
144 |
// } |
|
145 |
// |
|
146 |
// // Get the linked edition editor and update it if exists |
|
147 |
// TXMBrowser linkedEditionEditor = (TXMBrowser)chartEditor.getLinkedEditor(TXMBrowser.class); |
|
148 |
// if(linkedEditionEditor != null) { |
|
149 |
// updateLinkedEditionEditor(linkedEditionEditor, selectedPointPositions); |
|
150 |
// } |
|
151 |
// } |
|
152 |
// } |
|
153 |
// } |
|
154 |
// }); |
|
155 |
// |
|
156 |
// } |
|
157 |
|
|
158 |
//FIXME: version with new SynopticEditionEditor system edition |
|
159 | 63 |
@Override |
160 | 64 |
public void processEvent(final AWTEvent event, final int eventArea, final Object o) { |
161 | 65 |
|
... | ... | |
258 | 162 |
*/ |
259 | 163 |
public void updateLinkedConcordanceEditor(ArrayList<EditorPart> linkedEditors, final ArrayList<Integer> selectedPointPositions) { |
260 | 164 |
|
261 |
// FIXME: Debug
|
|
262 |
//System.err.println("ProgressionEventCallBack.updateLinkedConcordanceEditor(): linked editors count: " + linkedEditors.size());
|
|
165 |
// Debug |
|
166 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(): linked editors count: " + linkedEditors.size());
|
|
263 | 167 |
|
264 | 168 |
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
265 | 169 |
IWorkbenchPage page = window.getActivePage(); |
... | ... | |
369 | 273 |
chartEditor.setFocus(); |
370 | 274 |
} |
371 | 275 |
|
372 |
|
|
276 |
|
|
277 |
/** |
|
278 |
* |
|
279 |
* @param linkedEditor |
|
280 |
* @param selectedPointPositions |
|
281 |
* @param loadLines |
|
282 |
*/ |
|
373 | 283 |
public void updateLinkedConcordanceEditor(final ConcordanceEditor linkedEditor, final ArrayList<Integer> selectedPointPositions, boolean loadLines) { |
374 | 284 |
|
375 | 285 |
final TableViewer tableViewer = linkedEditor.getLineTableViewer(); |
... | ... | |
448 | 358 |
ArrayList<Color> seriesColors = chartEditor.getResult().getChartCreator().getSeriesShapesColors(chartEditor.getChart()); |
449 | 359 |
RGBA selectedWordColor = new RGBA(255, 10, 10); |
450 | 360 |
|
451 |
//FIXME: old color |
|
452 |
//RGBA lightred = new RGBA(249,208,208); |
|
453 |
|
|
454 | 361 |
// Unhighlight all tokens |
455 | 362 |
if(linkedEditor != null) { |
456 | 363 |
linkedEditor.removeHighlightWords(); |
... | ... | |
538 | 445 |
} |
539 | 446 |
} |
540 | 447 |
|
541 |
//FIXME: version with TXMBroser old system edition |
|
542 |
// /** |
|
543 |
// * Updates the linked edition editor. |
|
544 |
// * If the editor doesn't exist it will be created. |
|
545 |
// * @param editor |
|
546 |
// */ |
|
547 |
// public void updateLinkedEditionEditor(TXMBrowser linkedEditor, ArrayList<Integer> selectedPointPositions) { |
|
548 |
// |
|
549 |
// try { |
|
550 |
// |
|
551 |
// // Unhighlight all tokens if no selected points |
|
552 |
// if(selectedPointPositions.size() < 1) { |
|
553 |
// linkedEditor.setWordsIds(new ArrayList<String>(), new ArrayList<String>()); |
|
554 |
// linkedEditor.showPage(linkedEditor.getCurrentPage()); |
|
555 |
// return; |
|
556 |
// } |
|
557 |
// |
|
558 |
// Corpus corpus = ((Progression2) chartEditor.getResultData()).getCorpus(); |
|
559 |
// StructuralUnit textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$ |
|
560 |
// Property textP = textS.getProperty("id"); //$NON-NLS-1$ |
|
561 |
// Match selectedWordMatch = new Match(selectedPointPositions.get(selectedPointPositions.size() - 1), selectedPointPositions.get(selectedPointPositions.size() - 1)); |
|
562 |
// String textId = selectedWordMatch.getValueForProperty(textP); |
|
563 |
// |
|
564 |
// Text text = corpus.getText(textId); |
|
565 |
// if(text == null) { |
|
566 |
// Log.severe("Text " + textId + " is missing."); |
|
567 |
// return; |
|
568 |
// } |
|
569 |
// |
|
570 |
// Edition edition = text.getEdition(corpus.getMainCorpus().getDefaultEdition()); |
|
571 |
// if(edition == null) { |
|
572 |
// Log.severe("Default edition is missing."); |
|
573 |
// return; |
|
574 |
// } |
|
575 |
// |
|
576 |
// // Get the current selected word to highlight more |
|
577 |
// List<String> selectedWordIds = selectedWordMatch.getValuesForProperty(corpus.getProperty("id")); //$NON-NLS-1$; |
|
578 |
// |
|
579 |
// // Get all words to highlight from the progression chart data set |
|
580 |
// ArrayList<Integer> allPointPositions = ((ProgressionChartCreator)chartEditor.getEditorInput().getChartsEngine().getChartCreator(Progression2.class)).getAllPointPositions(chartEditor.getChart()); |
|
581 |
// |
|
582 |
// ArrayList<String> wordIds = new ArrayList<String>(allPointPositions.size()); |
|
583 |
// for(int i = 0; i < allPointPositions.size(); i++) { |
|
584 |
// Match match = new Match(allPointPositions.get(i), allPointPositions.get(i)); |
|
585 |
// if(match.getValueForProperty(textP).equals(textId)) { |
|
586 |
// wordIds.add(match.getValueForProperty(corpus.getProperty("id"))); //$NON-NLS-1$; |
|
587 |
// } |
|
588 |
// } |
|
589 |
// |
|
590 |
// Page openPage = edition.getPageForWordId(selectedWordIds.get(0)); |
|
591 |
// |
|
592 |
// if(openPage != null) { |
|
593 |
// |
|
594 |
// // Create the linked editor if needed |
|
595 |
// if(linkedEditor == null || linkedEditor.isDisposed()) { |
|
596 |
// linkedEditor = OpenBrowser.openEdition(openPage.getFile().getAbsolutePath(), openPage.getFile().getName()); |
|
597 |
// linkedEditor.setEdition(edition); |
|
598 |
// chartEditor.addLinkedEditor(linkedEditor); |
|
599 |
// |
|
600 |
// |
|
601 |
// int position = EModelService.BELOW;; |
|
602 |
// EditorPart parentEditor = chartEditor; |
|
603 |
// // Split vertically if there is already a concordance editor otherwise split horizontally |
|
604 |
// ConcordanceEditor linkedConcordanceEditor = (ConcordanceEditor)chartEditor.getLinkedEditor(ConcordanceEditor.class); |
|
605 |
// if(linkedConcordanceEditor != null) { |
|
606 |
// position = EModelService.RIGHT_OF; |
|
607 |
// parentEditor = linkedConcordanceEditor; |
|
608 |
// } |
|
609 |
// |
|
610 |
// // Split and add linked editor |
|
611 |
// SWTEditorsUtils.addEditor(parentEditor, linkedEditor, position); |
|
612 |
// } |
|
613 |
// |
|
614 |
// linkedEditor.showPage(openPage); |
|
615 |
// // Highlight tokens |
|
616 |
// linkedEditor.setWordsIds(wordIds, selectedWordIds); |
|
617 |
// |
|
618 |
// IWorkbenchPage attachedPage = linkedEditor.getEditorSite().getPage(); |
|
619 |
// attachedPage.activate(linkedEditor); |
|
620 |
// } |
|
621 |
// } |
|
622 |
// catch(Exception e) { |
|
623 |
// Log.printStackTrace(e); |
|
624 |
// } |
|
625 |
// } |
|
626 |
|
|
627 |
|
|
628 |
|
|
629 | 448 |
|
630 | 449 |
|
631 | 450 |
} |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/themes/base/swing/ItemSelectionJFCChartPanel.java (revision 892) | ||
---|---|---|
30 | 30 |
|
31 | 31 |
|
32 | 32 |
/** |
33 |
* |
|
33 | 34 |
* @author sjacquot |
34 | 35 |
* |
35 | 36 |
*/ |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/testers/__IsJFCComposite.java (revision 892) | ||
---|---|---|
19 | 19 |
public boolean test(Object receiver, String property, Object[] args, |
20 | 20 |
Object expectedValue) { |
21 | 21 |
|
22 |
//FIXME: Debug |
|
23 | 22 |
System.out.println("IsJFCComposite.test() recevier = " + receiver.getClass()); |
24 | 23 |
System.out.println("IsJFCComposite.test() property = " + property); |
25 | 24 |
System.out.println("IsJFCComposite.test() args = " + args); |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java (revision 892) | ||
---|---|---|
30 | 30 |
//super(chartEditor, parent, SWT.EMBEDDED | SWT.NO_BACKGROUND); |
31 | 31 |
super(chartEditor, parent, SWT.EMBEDDED); |
32 | 32 |
//super(parent, SWT.EMBEDDED | SWT.NO_MERGE_PAINTS | SWT.NO_BACKGROUND); // do not fix the transparency problem |
33 |
// |
|
34 |
// //this.chartComponent = (IChartComponent) panel; |
|
35 |
// // FIXME : transparency doesn't work with tool tips |
|
36 |
// // The problem here is that we normally need a JFrame but it seems to be impossible to embed a JFrame |
|
37 |
//// this.setBackgroundMode(SWT.INHERIT_FORCE); // do not fix |
|
38 |
//// ToolTipManager.sharedInstance().setLightWeightPopupEnabled(true); // do not fix |
|
39 |
// |
|
40 |
// this.frame = SWT_AWT.new_Frame(this); |
|
41 |
// // Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel |
|
42 |
// //this.rootPanel = new Panel(new BorderLayout()); |
|
43 |
// //this.rootPanel = new JRootPane(); |
|
44 |
// this.rootPanel = new JPanel(new BorderLayout()); |
|
45 |
// |
|
46 |
// |
|
47 |
// |
|
48 |
// this.frame.add(this.rootPanel); |
|
49 |
// |
|
50 |
// |
|
51 |
// |
|
52 |
// this.frame.setVisible(true); |
|
53 |
//// this.frame.pack(); |
|
54 |
//// this.pack(true); |
|
55 |
//// parent.pack(); |
|
56 |
//// this.layout(true); |
|
57 |
//// parent.layout(true); |
|
58 |
// |
|
59 |
// // To fix MAC OS X + Java 1.7/1.8 SWT_AWT BUG |
|
60 |
// // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=418245#c12 |
|
61 |
//// SwingUtilities.invokeLater(new Runnable() { |
|
62 |
//// |
|
63 |
//// |
|
64 |
//// @Override |
|
65 |
//// public void run() { |
|
66 |
// |
|
67 |
// |
|
68 |
// |
|
69 |
// |
|
70 |
//// // Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel |
|
71 |
//// this.rootPanel = new Panel(new BorderLayout()); |
|
72 |
//// //rootPanel.add(this.getChartPanel()); // commenter cette ligne pour le test de scrolling ci-dessous |
|
73 |
//// this.frame.add(this.rootPanel); |
|
74 |
// |
|
75 |
// |
|
76 |
// // FIXME: test, smarter way to embed the frame ? Actually it doesn't fix neither the tooltip transparency nor the cursor change on pan under Mac OS X |
|
77 |
// // // Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel |
|
78 |
// // Panel rootPanel = new Panel(new BorderLayout()); |
|
79 |
// //// rootPanel.add(this.chartPanel); // commenter cette ligne pour le test de scrolling ci-dessous |
|
80 |
// // frame.add(rootPanel); |
|
81 |
// // JRootPane rootPane = new JRootPane(); |
|
82 |
// // rootPanel.add(rootPane); |
|
83 |
// // rootPane.getContentPane().add(this.chartPanel); |
|
84 |
// |
|
85 |
// |
|
86 |
// |
|
87 |
// // FIXME: tests with a JApplet as Rootpane rather than Panel |
|
88 |
// // JApplet rootPanel = new JApplet(); |
|
89 |
// // rootPanel.add(this.chartPanel); // commenter cette ligne pour le test de scrolling ci-dessous |
|
90 |
// // frame.add(rootPanel); |
|
91 |
// |
|
92 |
// |
|
93 |
// |
|
94 |
// |
|
95 |
// // FIXME : tests scroll Swing: les width des panel sont définies dans les méthodes de JFCChartsSwingComponentsProvider |
|
96 |
// // FIXME : ce code fait bugger le changement de couleur des barres au mouse over et la bordure colorée des tooltips |
|
97 |
// // FIXME : ce code augmente à fond la RAM consommée, il y a un prob de composants en double ? |
Formats disponibles : Unified diff