/*
* ChartPanel.java
* Created on 2008年7月10日, 下午1:03
*/
package com.mwq.stat;
import com.mwq.stat.dataform.DataForm;
import com.mwq.stat.chart.AreaAnalyseRow;
import com.mwq.stat.chart.AreaCollectRow;
import com.mwq.stat.chart.Bar;
import com.mwq.stat.chart.BarAnalyseColumn;
import com.mwq.stat.chart.BarAnalyseRow;
import com.mwq.stat.chart.BarCollectColumn;
import com.mwq.stat.chart.BarCollectRow;
import com.mwq.stat.chart.PieAnalyseColumn;
import com.mwq.stat.chart.PieAnalyseRow;
import com.mwq.stat.frame.ProgressBarDialog;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractButton;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.JRadioButton;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
/**
* @author Administrator
*/
public class StatChartPanel extends javax.swing.JPanel {
private GridLayout chartPanelLayout;
private DefaultComboBoxModel unenabledComboBoxModel;
private DefaultComboBoxModel rowComboBoxModel;
private DefaultComboBoxModel columnComboBoxModel;
private ItemListener indexComboBoxListener;
/** Creates new form ChartPanel */
public StatChartPanel() {
initComponents();
chartRadioButtonActionPerformed(null);
unenabledComboBoxModel = (DefaultComboBoxModel) indexComboBox
.getModel();
Vector rowItems = new Vector();
rowItems.add("全部");
Vector<Vector> tableData = DataForm.getTableData();
for (int row = 0; row < tableData.size(); row++) {
rowItems.add(tableData.get(row).get(0));
}
rowComboBoxModel = new DefaultComboBoxModel(rowItems);
Vector columnItems = new Vector();
columnItems.addAll(DataForm.getColumnName());
columnItems.set(0, "全部");
columnComboBoxModel = new DefaultComboBoxModel(columnItems);
indexComboBoxListener = indexComboBox.getItemListeners()[0];
}
private void setTypeEnabled(boolean radioButtons, boolean comboBox) {
if (rowRadioButton.isEnabled() != radioButtons) {// 单选按钮的可用性发生改变
rowRadioButton.setEnabled(radioButtons);
columnRadioButton.setEnabled(radioButtons);
}
if (indexComboBox.isEnabled() != comboBox) {// 组合框的可用性发生改变
indexComboBox.setEnabled(comboBox);
if (!comboBox) {// 变为不可用
indexComboBox.setModel(unenabledComboBoxModel);// 设置为不可用的组合框模型
}
}
if (comboBox) {// 组合框可用
if (rowRadioButton.isSelected()) {// 行单选按钮被选中
indexComboBox.setModel(rowComboBoxModel);// 设置为行组合框模型
} else {// 列单选按钮被选中
indexComboBox.setModel(columnComboBoxModel);// 设置为列组合框模型
}
indexComboBox.removeItemListener(indexComboBoxListener);// 移去选中项事件监听器
indexComboBox.setSelectedIndex(1);// 设置组合框的选中项
indexComboBox.addItemListener(indexComboBoxListener);// 添加选中项事件监听器
}
}
private void refreshChartsPanel(ChartPanel chartPanel) {
chartsPanel.removeAll();// 清空统计图面板
if (chartPanelLayout.getColumns() != 1) {// 确定是否为一列
chartPanelLayout.setColumns(1);
}
chartsPanel.add(chartPanel);// 添加统计图到面板中
SwingUtilities.updateComponentTreeUI(chartsPanel);// 刷新统计图面板
}
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
chartButtonGroup = new javax.swing.ButtonGroup();
typeButtonGroup = new javax.swing.ButtonGroup();
tablePopupMenu = new javax.swing.JPopupMenu();
barMenuItem = new javax.swing.JMenuItem();
barCollectMenu = new javax.swing.JMenu();
barCollectRowMenuItem = new javax.swing.JMenuItem();
barCollectColumnMenuItem = new javax.swing.JMenuItem();
barAnalyesMenu = new javax.swing.JMenu();
barAnalyesRowMenuItem = new javax.swing.JMenuItem();
barAnalyesColumnMenuItem = new javax.swing.JMenuItem();
pieAnalyesMenu = new javax.swing.JMenu();
pieAnalyesRowMenuItem = new javax.swing.JMenuItem();
pieAnalyesColumnMenuItem = new javax.swing.JMenuItem();
areaCollectMenuItem = new javax.swing.JMenuItem();
areaAnalyesMenuItem = new javax.swing.JMenuItem();
chartToolBar = new javax.swing.JToolBar();
saveButton = new javax.swing.JButton();
saveButton.setText("保存图片");
jSeparator1 = new javax.swing.JToolBar.Separator();
barRadioButton = new javax.swing.JRadioButton();
barRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
barRadioButton.setText("概 览");
barCollectRadioButton = new javax.swing.JRadioButton();
barCollectRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
barCollectRadioButton.setText("汇 总");
barAnalyesRadioButton = new javax.swing.JRadioButton();
barAnalyesRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
barAnalyesRadioButton.setText("分 析");
pieAnalyseRadioButton = new javax.swing.JRadioButton();
pieAnalyseRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
pieAnalyseRadioButton.setText("分 析");
areaCollectRadioButton = new javax.swing.JRadioButton();
areaCollectRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
areaCollectRadioButton.setText("汇 总");
areaAnalyseRadioButton = new javax.swing.JRadioButton();
areaAnalyseRadioButton.setVerticalTextPosition(SwingConstants.BOTTOM);
areaAnalyseRadioButton.setText("分 析");
jSeparator2 = new javax.swing.JToolBar.Separator();
typePanel = new javax.swing.JPanel();
rowRadioButton = new javax.swing.JRadioButton();
columnRadioButton = new javax.swing.JRadioButton();
indexComboBox = new javax.swing.JComboBox();
chartsScrollPane = new javax.swing.JScrollPane();
chartsPanel = new javax.swing.JPanel();
barMenuItem.setText("柱型图概览");
tablePopupMenu.add(barMenuItem);
barCollectMenu.setText("柱型图汇总");
barCollectRowMenuItem.setText("选定行");
barCollectMenu.add(barCollectRowMenuItem);
barCollectColumnMenuItem.setText("选定列");
barCollectMenu.add(barCollectColumnMenuItem);
tablePopupMenu.add(barCollectMenu);
barAnalyesMenu.setText("柱型图分析");
barAnalyesRowMenuItem.setText("选定行");
barAnalyesMenu.add(barAnalyesRowMenuItem);
barAnalyesColumnMenuItem.setText("选定列");
barAnalyesMenu.add(barAnalyes
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
决策分析系统(java) (157个子文件)
StatChartPanel.class 17KB
ExportTableToPDF.class 12KB
StatTablePanel.class 9KB
ChartDialog.class 7KB
UpdateHeadingDialog.class 6KB
BarAnalyseColumn.class 5KB
BarAnalyseRow.class 5KB
ExportTableToExcel.class 5KB
BarCollectRow.class 5KB
SwingResourceManager.class 4KB
BarCollectColumn.class 4KB
ProgressBarDialog.class 4KB
PieAnalyseColumn.class 4KB
PieAnalyseRow.class 4KB
Bar.class 4KB
AreaAnalyseRow.class 4KB
AreaCollectRow.class 4KB
DataForm.class 3KB
StatChartPanel$12.class 3KB
StatChartPanel$13.class 2KB
MTable.class 2KB
StatFrame$1.class 2KB
MListSelectionListener.class 1KB
StatTablePanel$1.class 1KB
StatFrame.class 1KB
ScreenSize.class 1KB
FloatColumnTableModel.class 1KB
StatPanel.class 1KB
FixedColumnTableModel.class 1KB
StatChartPanel$11.class 1KB
Today.class 1009B
UpdateHeadingDialog$5.class 979B
ProgressBarDialog$1.class 923B
ChartDialog$4.class 881B
UpdateHeadingDialog$3.class 874B
UpdateHeadingDialog$4.class 874B
UpdateHeadingDialog$1.class 832B
UpdateHeadingDialog$2.class 832B
ChartDialog$1.class 818B
ChartDialog$3.class 818B
ChartDialog$2.class 818B
StatChartPanel$2.class 803B
StatTablePanel$4.class 803B
StatChartPanel$8.class 803B
StatChartPanel$4.class 803B
StatTablePanel$3.class 803B
StatTablePanel$2.class 803B
StatChartPanel$1.class 803B
StatChartPanel$7.class 803B
StatChartPanel$5.class 803B
StatChartPanel$6.class 803B
StatChartPanel$3.class 803B
StatChartPanel$9.class 803B
UpdateHeadingDialog$5$1.class 799B
StatChartPanel$10.class 798B
StatTablePanel$5.class 796B
ProgressBarDialog$1$1.class 787B
ChartDialog$4$1.class 751B
DataFormInterface.class 508B
.classpath 527B
readme.doc 137KB
jfreechart-1.0.13.jar 1.36MB
iText-2.1.3.jar 1.02MB
jxl.jar 709KB
itextasian-1.5.2.jar 322KB
jcommon-1.0.6.jar 301KB
StatChartPanel.java 37KB
ExportTableToPDF.java 15KB
ChartDialog.java 13KB
StatTablePanel.java 13KB
UpdateHeadingDialog.java 8KB
ExportTableToExcel.java 5KB
ProgressBarDialog.java 5KB
SwingResourceManager.java 5KB
BarAnalyseColumn.java 4KB
BarAnalyseRow.java 4KB
BarCollectRow.java 3KB
PieAnalyseRow.java 3KB
BarCollectColumn.java 3KB
Bar.java 3KB
PieAnalyseColumn.java 3KB
AreaAnalyseRow.java 3KB
AreaCollectRow.java 3KB
DataForm.java 3KB
StatFrame.java 2KB
MTable.java 2KB
MListSelectionListener.java 1KB
StatPanel.java 1KB
FloatColumnTableModel.java 1KB
FixedColumnTableModel.java 920B
ScreenSize.java 765B
Today.java 666B
DataFormInterface.java 406B
title.png 2KB
title.png 2KB
title_on.png 2KB
title_on.png 2KB
excel.png 2KB
excel.png 2KB
excel_on.png 2KB
共 157 条
- 1
- 2
zhuxun198
- 粉丝: 5
- 资源: 244
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- lab7_02.c
- 基于 SpringCloud 和 Vue3 的OA系统
- 软考高级项目管理师-项目采购管理思维导图
- WordsVector (1).ipynb
- yolov7 车牌检测 车牌识别 中文车牌识别 检测 支持双层车牌 支持12种中文车牌
- 20240429_112025.m4a
- "麦嘟学编程"似乎是一个与编程学习相关的品牌或社区名称,它可能是一个在线教育平台、博客、论坛或社交媒体群组等,旨在帮助人们学习编
- OpenCV(Open Source Computer Vision Library)是一个开源的计算机视觉和机器学习软件库,由
- Redis入门基础篇+源码(springboot、maven)
- ChatGPT-4是由OpenAI开发的人工智能模型,是GPT(Generative Pre-trained Transform
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0