本文整理汇总了Java中org.jfree.ui.ApplicationFrame类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationFrame类的具体用法?Java ApplicationFrame怎么用?Java ApplicationFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationFrame类属于org.jfree.ui包,在下文中一共展示了ApplicationFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new Dimension(1024, 400));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Cash flow to chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例2: showGraph
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
private void showGraph() {
final JFreeChart chart = ChartFactory.createScatterPlot(
title, // chart title
xValue, // x axis label
yValue, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
false // urls
);
XYPlot plot = (XYPlot) chart.getPlot();
DemoRenderer renderer = new DemoRenderer();
// renderer.setBasePaint(Color.blue);
// renderer.setSeriesLinesVisible(0, true);
plot.setRenderer(renderer);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(640, 480));
final ApplicationFrame frame = new ApplicationFrame(title);
frame.setContentPane(chartPanel);
frame.pack();
frame.setVisible(true);
}
示例3: showChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Starting point for the demonstration application.
*/
public static void showChart(
String name, String xAxis, String yAxis1, XYDataset dataset1, String yAxis2,
XYDataset dataset2
) {
final JFreeChart chart = createChart(name, xAxis, yAxis1, dataset1, yAxis2, dataset2);
final ChartPanel chartPanel = createPanel(chart);
final ApplicationFrame app = new ApplicationFrame(name);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
app.setContentPane(chartPanel);
app.pack();
RefineryUtilities.centerFrameOnScreen(app);
app.setVisible(true);
}
示例4: run
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
@Override
public void run(final String arg0) {
// http://www.math.hu-berlin.de/~ccafm/lehre_BZQ_Numerik/allg/JAVA_Pakete/JFreeChart/JFreeChart-Tutorial.html
final String title = "Contrast Transfer Function";
final XYSplineRenderer spline = new XYSplineRenderer();
spline.setSeriesPaint(0, Color.RED);
spline.setSeriesPaint(1, Color.BLUE);
spline.setSeriesShapesVisible(0, false);
spline.setSeriesShapesVisible(1, false);
final NumberAxis xax = new NumberAxis("q in 1/nm");
final NumberAxis yax = new NumberAxis("CTF");
final XYPlot plot = new XYPlot(createDataset(), xax, yax, spline);
final JFreeChart chart = new JFreeChart(plot);
final ChartPanel chartPanel = new ChartPanel(chart);
final ApplicationFrame chartFrame = new ApplicationFrame(title);
chartFrame.setContentPane(chartPanel);
chartFrame.pack();
RefineryUtilities.centerFrameOnScreen(chartFrame);
chartFrame.setVisible(true);
}
示例5: getMenu
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
public static JMenuBar getMenu( JFreeChart chart,ApplicationFrame jg ){
Action SaveAs = new SaveAs_Action(chart,"Save as...",null,"Save as...");
Action Quit = new Quit_Action(jg,"Quit",null,"Quit");
JMenuBar JMB = new JMenuBar();
JMenu file = new JMenu("File");
JMB.add(file);
file.add(SaveAs);file.add(Quit);
return JMB;
}
示例6: getMenu
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
public static JMenuBar getMenu( Chart3D chart,ApplicationFrame jg ){
Action SaveAs = new SaveAs_Action3D(chart,"Save as...",null,"Save as...");
Action Quit = new Quit_Action(jg,"Quit",null,"Quit");
JMenuBar JMB = new JMenuBar();
JMenu file = new JMenu("File");
JMB.add(file);
file.add(SaveAs);file.add(Quit);
return JMB;
}
示例7: Quit_Action
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
public Quit_Action(ApplicationFrame ed, String text, ImageIcon icon,
String desc) {
// String desc, Integer mnemonic) { like mnemomnic=KeyEvent.VK_AT
// will be updated after "escape" command mode is introduced
// (like in "vi")
super(text, icon);
TEdit = ed;
putValue(SHORT_DESCRIPTION, desc);
// putValue(MNEMONIC_KEY, mnemonic); //change it after "escape" is done
}
示例8: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new Dimension(1024, 400));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Buy and sell signals to chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例9: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new java.awt.Dimension(740, 300));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Candlestick chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例10: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new java.awt.Dimension(500, 270));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Indicators to chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例11: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
*
* @param chart
* the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new Dimension(1024, 400));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Buy and sell signals to chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例12: displayChart
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Displays a chart in a frame.
*
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new java.awt.Dimension(500, 270));
// Application frame
ApplicationFrame frame = new ApplicationFrame("BTC/USD with Chande " +
"Moving Oscillator");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例13: createStateTrans
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
/**
* Create State Transition Matrix.
*
* @param eList
* list with possible events
* @param seqList
* list with sequences
* @return JTable
*/
public static Container createStateTrans(final EventList eList,
final List<EventList> seqList) {
// Create frame
final Dimension frameDimension = new Dimension(
(int) (PageSize.A4.getWidth()), (int) (PageSize.A4.getHeight()));
ApplicationFrame frame = new ApplicationFrame("Vidney");
frame.setSize(frameDimension);
String[][] matrix = setUp(eList);
String[][] matrixUse = fillMatrix(matrix, seqList);
String[][] outputM = new String[matrixUse.length - 1][matrixUse.length];
for (int i = 1; i < matrixUse[0].length; i++) {
for (int j = 0; j < matrixUse[1].length; j++) {
outputM[i - 1][j] = matrixUse[i][j];
}
}
JTable table = new JTable(outputM, matrixUse[0]);
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setColumnHeaderView(table.getTableHeader());
scrollPane.setPreferredSize(table.getPreferredSize());
JPanel p = new JPanel(new BorderLayout());
p.add(scrollPane, BorderLayout.CENTER);
// Not a very clean way
frame.setContentPane(p);
frame.setVisible(true);
frame.setVisible(false);
return scrollPane;
}
示例14: display
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
public static void display(JFreeChart plot) {
ApplicationFrame frame = new ApplicationFrame(plot.getTitle().getText());
ChartPanel plotPanel = new ChartPanel(plot);
plotPanel.setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT));
frame.setContentPane(plotPanel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
示例15: main
import org.jfree.ui.ApplicationFrame; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
final File inputcsv = new File("/Volumes/SSD/training_latlng");
final List<double[]> data = new ArrayList<double[]>(10000000);
// read in images
final BufferedReader br = new BufferedReader(new FileReader(inputcsv));
String line;
int i = 0;
br.readLine();
while ((line = br.readLine()) != null) {
final String[] parts = line.split(" ");
final double longitude = Double.parseDouble(parts[2]);
final double latitude = Double.parseDouble(parts[1]);
data.add(new double[] { longitude, latitude });
if (longitude >= -0.1 && longitude < 0 && latitude > 50 && latitude < 54)
System.out.println(parts[0] + " " + latitude + " " + longitude);
// if (i++ % 10000 == 0)
// System.out.println(i);
}
br.close();
System.out.println("Done reading");
final float[][] dataArr = new float[2][data.size()];
for (i = 0; i < data.size(); i++) {
dataArr[0][i] = (float) data.get(i)[0];
dataArr[1][i] = (float) data.get(i)[1];
}
final NumberAxis domainAxis = new NumberAxis("X");
domainAxis.setRange(-180, 180);
final NumberAxis rangeAxis = new NumberAxis("Y");
rangeAxis.setRange(-90, 90);
final FastScatterPlot plot = new FastScatterPlot(dataArr, domainAxis, rangeAxis);
final JFreeChart chart = new JFreeChart("Fast Scatter Plot", plot);
chart.getRenderingHints().put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
final ApplicationFrame frame = new ApplicationFrame("Title");
frame.setContentPane(chartPanel);
frame.pack();
frame.setVisible(true);
}