本文整理汇总了Java中org.jfree.chart.ChartPanel.setPopupMenu方法的典型用法代码示例。如果您正苦于以下问题:Java ChartPanel.setPopupMenu方法的具体用法?Java ChartPanel.setPopupMenu怎么用?Java ChartPanel.setPopupMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.ChartPanel
的用法示例。
在下文中一共展示了ChartPanel.setPopupMenu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComponent
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
@Override
public JComponent createComponent() {
ChartDataPlugin plugin = chartDataFramework
.getChartDataPlugin(chartSource.getChartType());
try {
chartPanel = new ChartPanel(plugin.createChart(element));
chartPanel.setPopupMenu(null);
} catch (ChartNotSetupedException e) {
JOptionPane.showMessageDialog(framework.getMainFrame(),
ChartResourceManager.getString("Error.chartNotSetuped"));
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
close();
}
});
return new JPanel();
}
return chartPanel;
}
示例2: createPanel
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public JPanel createPanel(XYDataset dataset) {
JFreeChart chart = createChart(dataset);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setVerticalAxisTrace(true);
chartPanel.setHorizontalAxisTrace(true);
chartPanel.setPopupMenu(null);
chartPanel.setDomainZoomable(true);
chartPanel.setRangeZoomable(true);
return chartPanel;
}
示例3: updateCharts
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
* Updates the charts.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private void updateCharts() {
for (int i = 0; i < listOfChartPanels.size(); i++) {
JPanel panel = listOfChartPanels.get(i);
panel.removeAll();
final ChartPanel chartPanel = new ChartPanel(getModel().getChartOrNull(i)) {
private static final long serialVersionUID = -6953213567063104487L;
@Override
public Dimension getPreferredSize() {
return DIMENSION_CHART_PANEL_ENLARGED;
}
};
chartPanel.setPopupMenu(null);
chartPanel.setBackground(COLOR_TRANSPARENT);
chartPanel.setOpaque(false);
chartPanel.addMouseListener(enlargeAndHoverAndPopupMouseAdapter);
panel.add(chartPanel, BorderLayout.CENTER);
JPanel openChartPanel = new JPanel(new GridBagLayout());
openChartPanel.setOpaque(false);
GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.CENTER;
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
JButton openChartButton = new JButton(OPEN_CHART_ACTION);
openChartButton.setOpaque(false);
openChartButton.setContentAreaFilled(false);
openChartButton.setBorderPainted(false);
openChartButton.addMouseListener(enlargeAndHoverAndPopupMouseAdapter);
openChartButton.setHorizontalAlignment(SwingConstants.LEFT);
openChartButton.setHorizontalTextPosition(SwingConstants.LEFT);
openChartButton.setIcon(null);
Font font = openChartButton.getFont();
Map attributes = font.getAttributes();
attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
openChartButton.setFont(font.deriveFont(attributes).deriveFont(10.0f));
openChartPanel.add(openChartButton, gbc);
panel.add(openChartPanel, BorderLayout.SOUTH);
panel.revalidate();
panel.repaint();
}
}