// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
package demo;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.swing.*;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.filechooser.FileFilter;
import javax.swing.tree.*;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.ui.*;
// Referenced classes of package demo:
// MemoryUsageDemo, DemoDescription
public class SuperDemo extends ApplicationFrame
implements ActionListener, TreeSelectionListener
{
static class DisplayDemo
implements Runnable
{
private SuperDemo app;
private DemoDescription demoDescription;
public void run()
{
try
{
Class class1 = Class.forName(demoDescription.getClassName());
Method method = class1.getDeclaredMethod("createDemoPanel", null);
JPanel jpanel = (JPanel)method.invoke(null, null);
app.chartContainer.removeAll();
app.chartContainer.add(jpanel);
app.displayPanel.validate();
String s = class1.getName();
String s1 = s;
int i = s.lastIndexOf('.');
if (i > 0)
s1 = s.substring(i + 1);
s1 = s1 + ".html";
app.displayDescription(s1);
}
catch (ClassNotFoundException classnotfoundexception)
{
classnotfoundexception.printStackTrace();
}
catch (NoSuchMethodException nosuchmethodexception)
{
nosuchmethodexception.printStackTrace();
}
catch (InvocationTargetException invocationtargetexception)
{
invocationtargetexception.printStackTrace();
}
catch (IllegalAccessException illegalaccessexception)
{
illegalaccessexception.printStackTrace();
}
}
public DisplayDemo(SuperDemo superdemo, DemoDescription demodescription)
{
app = superdemo;
demoDescription = demodescription;
}
}
static class PDFExportTask
implements Runnable
{
JFreeChart chart;
int width;
int height;
File file;
public void run()
{
try
{
SuperDemo.saveChartAsPDF(file, chart, width, height, new DefaultFontMapper());
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
}
public PDFExportTask(JFreeChart jfreechart, int i, int j, File file1)
{
chart = jfreechart;
file = file1;
width = i;
height = j;
jfreechart.setBorderVisible(true);
jfreechart.setPadding(new RectangleInsets(2D, 2D, 2D, 2D));
}
}
public static final String EXIT_COMMAND = "EXIT";
private JPanel displayPanel;
private JPanel chartContainer;
private JPanel descriptionContainer;
private JTextPane descriptionPane;
public SuperDemo(String s)
{
super(s);
setContentPane(createContent());
setJMenuBar(createMenuBar());
}
private JComponent createContent()
{
JPanel jpanel = new JPanel(new BorderLayout());
JTabbedPane jtabbedpane = new JTabbedPane();
JPanel jpanel1 = new JPanel(new BorderLayout());
jpanel1.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JSplitPane jsplitpane = new JSplitPane(1);
JTree jtree = new JTree(createTreeModel());
jtree.addTreeSelectionListener(this);
JScrollPane jscrollpane = new JScrollPane(jtree);
jscrollpane.setPreferredSize(new Dimension(300, 100));
jsplitpane.setLeftComponent(jscrollpane);
jsplitpane.setRightComponent(createChartDisplayPanel());
jpanel1.add(jsplitpane);
jtabbedpane.add("Demos", jpanel1);
MemoryUsageDemo memoryusagedemo = new MemoryUsageDemo(0x493e0);
(new MemoryUsageDemo.DataGenerator(memoryusagedemo, 1000)).start();
jtabbedpane.add("Memory Usage", memoryusagedemo);
jtabbedpane.add("Source Code", createSourceCodePanel());
jtabbedpane.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
jpanel.add(jtabbedpane);
return jpanel;
}
private JMenuBar createMenuBar()
{
JMenuBar jmenubar = new JMenuBar();
JMenu jmenu = new JMenu("File", true);
jmenu.setMnemonic('F');
JMenuItem jmenuitem = new JMenuItem("Export to PDF...", 112);
jmenuitem.setActionCommand("EXPORT_TO_PDF");
jmenuitem.addActionListener(this);
jmenu.add(jmenuitem);
jmenu.addSeparator();
JMenuItem jmenuitem1 = new JMenuItem("Exit", 120);
jmenuitem1.setActionCommand("EXIT");
jmenuitem1.addActionListener(this);
jmenu.add(jmenuitem1);
jmenubar.add(jmenu);
return jmenubar;
}
private JPanel createSourceCodePanel()
{
JPanel jpanel = new JPanel(new BorderLayout());
jpanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JEditorPane jeditorpane = new JEditorPane();
jeditorpane.setEditable(false);
java.net.URL url = (demo.SuperDemo.class).getResource("source.html");
if (url != null)
try
{
jeditorpane.setPage(url);
}
catch (IOException ioexception)
{
System.err.println("Attempted to read a bad URL: " + url);
}
else
System.err.println("Couldn't find file: source.html");
JScrollPane jscrollpane = new JScrollPane(jeditorpane);
jscrollpane.setVerticalScrollBarPolicy(20);
jscrollpane.setPreferredSize(new Dimension(250, 145));
jscrollpane.setMinimumSize(new Dimension(10, 10));
jpanel.add(jscrollpane);
return jpanel;
}
public void actionPerformed(ActionEvent actionevent)
{
String s = actionevent.getActionCommand();
if (s.equals("EXPORT_TO_PDF"))
exportToPDF();
else
if (s.equals("EXIT"))
attemptExit();
}
private void exportToPDF()
{
java.awt.Component component = chartContainer.getComponent(0);
if (component instanceof ChartPanel)
{
JFileChooser jfilechooser = new JFileChooser();
jfilechooser.setName("untitled.pdf");
jfilechooser.setFileFilter(new FileFilter() {
public boolean accept(File file)
{
return file.isDirectory() || file.getName().endsWith(".pdf");
}
public String getDescription()
{
return "Portable Document Format (PDF)";
}
});
int i = jfilechooser.showSaveDialog(this);
if (i == 0)
{
ChartPanel chartpanel = (ChartPanel)component;
try
{
JFreeChart jfreechart = (JFreeChart)chartpanel.getChart().clone();
PDFExportTask pdfexporttask = new PDFExportTask(jfreechart, chartpanel.getWidth(), chartpanel.getHeight(), jfilechooser.getSelectedFile());
Thread thread = new Thread(pdfexporttask);
thread.start();
}
catch (CloneNotSupportedException clonenotsupportedexception)
{
clonenotsupportedexception.printStackTrace();
}
}
} else
{
String s = "Unable to export the selected item. There is ";
s = s + "either no chart selected,\nor else the chart is not ";
s = s + "at the expected location in the component hierarchy\n";
s = s + "(future versions of the demo may include code to ";
s = s + "handle these special cases).";
JOptionPane.showMessageDialog(this, s, "PDF Export", 1);
}
}
public static void writeChartAsPDF(OutputStream outputstream, JFreeChart jfreechart, int i, int j, FontMapper fontmapper)
throws IOException
{
Rectangle rectangle = new Rectangle(i, j);
Document document = new Document(rectangle, 50F, 50F, 50F, 50F);
try
{
PdfWriter pdfwriter = PdfWriter.getInstance(document, outputstream);
document.addAuthor("JFreeChart");
document.addSubject("Demonstration");
document.open();
PdfContentByte pdfcontentbyte = pdfwriter.getDirectContent();
PdfTemplate pdftemplate = pdfcontentbyte.createTemplate(i, j);
Graphics2D graphics2d = pdftemplate.createGraphics(i, j, fontmapper);
没有合适的资源?快使用搜索试试~ 我知道了~
Java反编译工具+jfreechart
共300个文件
java:291个
txt:2个
exe:2个
5星 · 超过95%的资源 需积分: 10 15 下载量 75 浏览量
2008-08-29
09:01:58
上传
评论
收藏 2MB RAR 举报
温馨提示
Java反编译工具(内含jfreechart-1.0.9-demo源码)
资源推荐
资源详情
资源评论
收起资源包目录
Java反编译工具+jfreechart (300个子文件)
Jad.dll 240KB
Ext.dll 64KB
XJad.exe 354KB
Jad.exe 161KB
Jad.exe.1.5.8.g 484KB
Config.ini 93B
jfreechart-1.0.9-demo.jar 734KB
SuperDemo.java 61KB
DifferenceChartDemo2.java 43KB
XYBoxAnnotationDemo1.java 40KB
CombinedXYPlotDemo1.java 28KB
PriceVolumeDemo1.java 26KB
CombinedXYPlotDemo3.java 19KB
TimeSeriesDemo8.java 19KB
TimeSeriesDemo7.java 18KB
PriceVolumeDemo2.java 14KB
GanttRenderer2.java 13KB
TimeSeriesDemo1.java 11KB
SurveyResultsDemo1.java 10KB
CrosshairDemo2.java 10KB
HighLowChartDemo2.java 9KB
HighLowChartDemo1.java 9KB
CandlestickChartDemo1.java 9KB
DialDemo2a.java 9KB
StackedBarChartDemo4.java 8KB
CrosshairDemo1.java 8KB
ExtendedStackedBarRenderer.java 8KB
CombinedTimeSeriesDemo1.java 7KB
AnnotationDemo1.java 7KB
DrawStringDemo.java 7KB
CrosshairDemo3.java 6KB
GanttDemo3.java 6KB
CompassFormatDemo2.java 6KB
OverlaidXYPlotDemo2.java 6KB
DualAxisDemo2.java 6KB
YieldCurveDemo.java 6KB
StackedXYBarChartDemo2.java 6KB
MarkerDemo2.java 6KB
MarkerDemo1.java 6KB
CylinderRenderer.java 6KB
PeriodAxisDemo1.java 6KB
MouseOverDemo1.java 6KB
ImageMapDemo6.java 6KB
AnnotationDemo2.java 6KB
ClusteredXYBarRendererDemo1.java 6KB
DualAxisDemo1.java 6KB
XYTitleAnnotationDemo1.java 6KB
PerformanceTest1.java 6KB
StackedBarChartDemo2.java 6KB
CategoryLabelPositionsDemo1.java 6KB
ChartPanelSerializationTest.java 5KB
DialDemo2.java 5KB
CombinedXYPlotDemo4.java 5KB
CombinedCategoryPlotDemo1.java 5KB
TranslateDemo1.java 5KB
OverlaidBarChartDemo1.java 5KB
MultiplePieChartDemo4.java 5KB
LineChartDemo5.java 5KB
PieChartDemo4.java 5KB
CombinedXYPlotDemo5.java 5KB
XYLineAndShapeRendererDemo2.java 5KB
MouseListenerDemo3.java 5KB
QuarterDateFormatDemo.java 5KB
ImageMapDemo7.java 5KB
PlotOrientationDemo1.java 5KB
DynamicDataDemo3.java 5KB
DynamicDataDemo2.java 5KB
CombinedCategoryPlotDemo2.java 5KB
XYBlockChartDemo1.java 5KB
GradientPaintTransformerDemo1.java 5KB
HighLowChartDemo3.java 5KB
BarChartDemo7.java 5KB
CombinedXYPlotDemo2.java 5KB
GanttDemo1.java 5KB
DualAxisDemo5.java 5KB
DualAxisDemo3.java 5KB
StackedBarChart3DDemo2.java 5KB
PeriodAxisDemo2.java 5KB
GanttDemo2.java 5KB
AreaChartDemo1.java 5KB
PlotOrientationDemo2.java 5KB
OverlaidXYPlotDemo1.java 5KB
MultipleAxisDemo1.java 5KB
StackedBarChart3DDemo4.java 5KB
BarChart3DDemo1.java 5KB
XYBlockChartDemo3.java 5KB
HideSeriesDemo2.java 4KB
RegressionDemo1.java 4KB
XYBarChartDemo1.java 4KB
StackedBarChart3DDemo1.java 4KB
DialDemo1.java 4KB
XYSplineRendererDemo1.java 4KB
StackedBarChart3DDemo3.java 4KB
ItemLabelDemo2.java 4KB
DualAxisDemo4.java 4KB
BarChart3DDemo4.java 4KB
DialDemo5.java 4KB
HideSeriesDemo3.java 4KB
BarChartDemo9.java 4KB
ImageMapDemo3.java 4KB
共 300 条
- 1
- 2
- 3
资源评论
- 水笙赵2013-07-03挺好的 ,正是我想要的~~
- rfheh2012-08-10good,比较简单绿色的工具,看源码也方便了
- acw20002014-02-18十分不错 就是有点小wenti
Poineer1213
- 粉丝: 12
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功