本文整理汇总了Java中org.jfree.chart.event.ChartChangeEventType类的典型用法代码示例。如果您正苦于以下问题:Java ChartChangeEventType类的具体用法?Java ChartChangeEventType怎么用?Java ChartChangeEventType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChartChangeEventType类属于org.jfree.chart.event包,在下文中一共展示了ChartChangeEventType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChartChangeListner
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
private ChartChangeListener getChartChangeListner() {
return new ChartChangeListener() {
@Override
public void chartChanged(ChartChangeEvent event) {
// Is weird. This works well for zoom-in. When we add new CCI or
// RIS. This event function will be triggered too. However, the
// returned draw area will always be the old draw area, unless
// you move your move over.
// Even I try to capture event.getType() == ChartChangeEventType.NEW_DATASET
// also doesn't work.
if (event.getType() == ChartChangeEventType.GENERAL) {
ChartJDialog.this.chartLayerUI.updateTraceInfos();
// Re-calculating high low value.
ChartJDialog.this.updateHighLowJLabels();
}
}
};
}
示例2: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The range axis bounds will be recalculated if necessary.
*
* @param event information about the event (not used here).
*/
public void datasetChanged(DatasetChangeEvent event) {
int count = this.rangeAxes.size();
for (int axisIndex = 0; axisIndex < count; axisIndex++) {
ValueAxis yAxis = getRangeAxis(axisIndex);
if (yAxis != null) {
yAxis.configure();
}
}
if (getParent() != null) {
getParent().datasetChanged(event);
}
else {
PlotChangeEvent e = new PlotChangeEvent(this);
e.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(e);
}
}
示例3: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The range axis bounds will be recalculated if necessary.
*
* @param event information about the event (not used here).
*/
@Override
public void datasetChanged(DatasetChangeEvent event) {
for (ValueAxis yAxis : this.rangeAxes.values()) {
if (yAxis != null) {
yAxis.configure();
}
}
if (getParent() != null) {
getParent().datasetChanged(event);
} else {
PlotChangeEvent e = new PlotChangeEvent(this);
e.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(e);
}
}
示例4: chartChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of changes to the chart (or any of its components),
* and redraws the chart.
*
* @param event
*/
public void chartChanged( ChartChangeEvent event ) {
/*
* Do not look at event.getSource(), since the source of the event is
* likely to be one of the chart's components rather than the chart itself.
*/
if ( event.getType() == ChartChangeEventType.DATASET_UPDATED ) {
repaint();
}
else if ( event.getType() == ChartChangeEventType.NEW_DATASET ) {
repaint();
}
else {
updateAll();
}
}
示例5: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The range axis bounds will be recalculated if necessary.
*
* @param event information about the event (not used here).
*/
@Override
public void datasetChanged(DatasetChangeEvent event) {
int count = this.rangeAxes.size();
for (int axisIndex = 0; axisIndex < count; axisIndex++) {
ValueAxis yAxis = getRangeAxis(axisIndex);
if (yAxis != null) {
yAxis.configure();
}
}
if (getParent() != null) {
getParent().datasetChanged(event);
}
else {
PlotChangeEvent e = new PlotChangeEvent(this);
e.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(e);
}
}
示例6: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The axis ranges are updated if necessary.
*
* @param event information about the event (not used here).
*/
public void datasetChanged(DatasetChangeEvent event) {
configureDomainAxes();
configureRangeAxes();
if (getParent() != null) {
getParent().datasetChanged(event);
}
else {
PlotChangeEvent e = new PlotChangeEvent(this);
e.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(e);
}
}
示例7: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The axis ranges are updated if necessary.
*
* @param event information about the event (not used here).
*/
@Override
public void datasetChanged(DatasetChangeEvent event) {
configureDomainAxes();
configureRangeAxes();
if (getParent() != null) {
getParent().datasetChanged(event);
}
else {
PlotChangeEvent e = new PlotChangeEvent(this);
e.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(e);
}
}
示例8: createCompositeChart
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
Control createCompositeChart(final Composite parent, EventLogParser logParser,
String title) {
mChart = ChartFactory.createTimeSeriesChart(
null,
null /* timeAxisLabel */,
null /* valueAxisLabel */,
null, /* dataset. set below */
true /* legend */,
false /* tooltips */,
false /* urls */);
// get the font to make a proper title. We need to convert the swt font,
// into an awt font.
Font f = parent.getFont();
FontData[] fData = f.getFontData();
// event though on Mac OS there could be more than one fontData, we'll only use
// the first one.
FontData firstFontData = fData[0];
java.awt.Font awtFont = SWTUtils.toAwtFont(parent.getDisplay(),
firstFontData, true /* ensureSameSize */);
mChart.setTitle(new TextTitle(title, awtFont));
final XYPlot xyPlot = mChart.getXYPlot();
xyPlot.setRangeCrosshairVisible(true);
xyPlot.setRangeCrosshairLockedOnData(true);
xyPlot.setDomainCrosshairVisible(true);
xyPlot.setDomainCrosshairLockedOnData(true);
mChart.addChangeListener(new ChartChangeListener() {
@Override
public void chartChanged(ChartChangeEvent event) {
ChartChangeEventType type = event.getType();
if (type == ChartChangeEventType.GENERAL) {
// because the value we need (rangeCrosshair and domainCrosshair) are
// updated on the draw, but the notification happens before the draw,
// we process the click in a future runnable!
parent.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
processClick(xyPlot);
}
});
}
}
});
mChartComposite = new ChartComposite(parent, SWT.BORDER, mChart,
ChartComposite.DEFAULT_WIDTH,
ChartComposite.DEFAULT_HEIGHT,
ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH,
ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT,
3000, // max draw width. We don't want it to zoom, so we put a big number
3000, // max draw height. We don't want it to zoom, so we put a big number
true, // off-screen buffer
true, // properties
true, // save
true, // print
true, // zoom
true); // tooltips
mChartComposite.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
mValueTypeDataSetMap.clear();
mDataSetCount = 0;
mOccurrenceDataSet = null;
mChart = null;
mChartComposite = null;
mValueDescriptorSeriesMap.clear();
mOcurrenceDescriptorSeriesMap.clear();
}
});
return mChartComposite;
}
示例9: datasetChanged
import org.jfree.chart.event.ChartChangeEventType; //导入依赖的package包/类
/**
* Receives notification of a change to the plot's dataset.
* <P>
* The plot reacts by passing on a plot change event to all registered
* listeners.
*
* @param event information about the event (not used here).
*/
@Override
public void datasetChanged(DatasetChangeEvent event) {
PlotChangeEvent newEvent = new PlotChangeEvent(this);
newEvent.setType(ChartChangeEventType.DATASET_UPDATED);
notifyListeners(newEvent);
}