use of com.tencent.wstt.apt.chart.MemoryRealTimeChart in project GT by Tencent.
the class MemoryView method createChartPanel.
/**
* 初始化jfreechart
* @param rootFrame
*/
private void createChartPanel(Composite parent) {
chartComposite = new Composite(parent, SWT.NO_BACKGROUND | SWT.EMBEDDED);
FormData formData = new FormData();
formData.left = new FormAttachment(0, Constant.VIEW_MARGIN_WIDTH);
formData.right = new FormAttachment(viewer.getTable(), -Constant.VIEW_MARGIN_WIDTH);
formData.top = new FormAttachment(0, Constant.VIEW_MARGIN_WIDTH);
formData.bottom = new FormAttachment(100, -Constant.VIEW_MARGIN_WIDTH);
chartComposite.setLayoutData(formData);
Frame frame = SWT_AWT.new_Frame(chartComposite);
// 据说加入这个Panel可以无闪烁
Panel panel = new Panel(new BorderLayout()) {
private static final long serialVersionUID = 1L;
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
}
};
frame.add(panel);
JRootPane root = new JRootPane();
panel.add(root);
java.awt.Container contentPane = root.getContentPane();
memRealTimeChart = new MemoryRealTimeChart();
contentPane.add(memRealTimeChart);
}
Aggregations