Example usage for javax.swing JSplitPane setDividerLocation

List of usage examples for javax.swing JSplitPane setDividerLocation

Introduction

In this page you can find the example usage for javax.swing JSplitPane setDividerLocation.

Prototype

@BeanProperty(description = "The location of the divider.")
public void setDividerLocation(int location) 

Source Link

Document

Sets the location of the divider.

Usage

From source file:ja.lingo.application.gui.main.settings.dictionaries.add.AddPanel.java

public AddPanel(JDialog parentDialog, IEngine engine) {
    Arguments.assertNotNull("parentDialog", parentDialog);
    Arguments.assertNotNull("engine", engine);

    this.parentDialog = parentDialog;
    this.engine = engine;

    fileChooser = new FileChooser();

    encodingComboBox = new JComboBox();
    encodingAutoComboBox = new JComboBox(new String[] { resources.text("encoding_auto") });
    encodingAutoComboBox.setEnabled(false);

    encodingCardPanel = new CardPanel();
    encodingCardPanel.add(encodingComboBox);
    encodingCardPanel.add(encodingAutoComboBox);

    readerList = Components//from  w w  w . j  a  v a  2s .  co m
            .list(new StaticListModel<IDictionaryReader>(new ReaderLabelBuilder(), engine.getReaders()));
    readerList.setSelectedIndex(0);

    editorPane = Components.editorPane();
    editorPane.addHyperlinkListener(new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                Browser.openUrl(e.getURL().toExternalForm());
            }
        }
    });

    continueButton = Buttons.continue1();
    continueButton.setDefaultCapable(true);

    closeButton = Buttons.cancel();

    JPanel buttonPanel = new JPanel(new GridLayout(1, 2, GAP5, GAP5));
    buttonPanel.add(continueButton);
    buttonPanel.add(closeButton);

    JPanel listReaderPanel = new JPanel(new BorderLayout());
    listReaderPanel.add(resources.label("reader"), BorderLayout.NORTH);
    listReaderPanel.add(new JScrollPane(readerList), BorderLayout.CENTER);

    readerList.setPreferredSize(new Dimension(50, 50));
    listReaderPanel.setPreferredSize(new Dimension(100, 100));

    JPanel descriptionReaderPanel = new JPanel(new BorderLayout());
    descriptionReaderPanel.add(resources.label("readerDescription"), BorderLayout.NORTH);
    descriptionReaderPanel.add(new JScrollPane(editorPane), BorderLayout.CENTER);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listReaderPanel, descriptionReaderPanel);
    splitPane.setContinuousLayout(true);
    splitPane.setDividerLocation(130);

    gui = new JPanel(new TableLayout(new double[][] { { TableLayout.PREFERRED, GAP5, TableLayout.FILL },
            { TableLayout.FILL, // 0: reader panel
                    GAP5, TableLayout.PREFERRED, // 2: file
                    GAP5, TableLayout.PREFERRED, // 4: encoding
                    GAP5 * 2, TableLayout.PREFERRED // 6: button panel
            } }));

    gui.add(splitPane, "0, 0, 2, 0");

    gui.add(resources.label("file"), "0, 2");
    gui.add(fileChooser.getGui(), "2, 2");

    gui.add(resources.label("encoding"), "0, 4");
    gui.add(encodingCardPanel.getGui(), "2, 4");

    gui.add(buttonPanel, "0, 6, 2, 6, right, center");

    Gaps.applyBorder7(gui);

    ActionBinder.bind(this);

    if (encodingComboBox.getModel().getSize() > 0) {
        encodingComboBox.setSelectedIndex(0);
    }

    // filters
    for (IDictionaryReader reader : engine.getReaders()) {
        fileChooser.getChooser().addChoosableFileFilter(reader.getFileFilter());
    }

    onReaderSelected();
    onFileFieldEdited();
}

From source file:com.joey.software.Tools.AScanViewerTool.java

public void createJPanel() {
    JSplitPane graphSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    graphSplit.setLeftComponent(previewPanel);
    graphSplit.setRightComponent(dataPanel);
    graphSplit.setOneTouchExpandable(true);
    graphSplit.setDividerLocation(400);

    JPanel graphHolder = new JPanel(new BorderLayout());
    graphHolder.add(graphSplit, BorderLayout.CENTER);
    graphHolder.setBorder(BorderFactory.createTitledBorder(""));

    JPanel tool = new JPanel(new BorderLayout());
    tool.add(saveCSVData, BorderLayout.SOUTH);
    tool.add(aScanType, BorderLayout.CENTER);

    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.add(graphHolder, BorderLayout.CENTER);
    leftPanel.add(tool, BorderLayout.SOUTH);

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.setOneTouchExpandable(true);/*from   w ww.j  a v a  2  s  .  com*/
    split.setRightComponent(imageViewPanel);
    split.setLeftComponent(leftPanel);
    split.setDividerLocation(600);

    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(split, BorderLayout.CENTER);

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(mainPanel);

    aScanType.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            imageViewPanel.setViewType(aScanType.getSelectedIndex());

        }
    });
    saveCSVData.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            try {
                File f = FileSelectionField.getUserFile();
                f = FileOperations.renameFileType(f, "csv");
                saveAScanData(f);
            } catch (Exception e1) {
                JOptionPane.showMessageDialog(null, "Error : " + e1.getLocalizedMessage(), "Error Saving Data",
                        JOptionPane.ERROR_MESSAGE);
                e1.printStackTrace();
            }
        }
    });
}

From source file:TreeIconDemo.java

public TreeIconDemo() {
    super(new GridLayout(1, 0));

    // Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);// w ww.j a  v  a 2s  .  co  m

    // Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    // Set the icon for leaf nodes.
    ImageIcon leafIcon = createImageIcon("images/middle.gif");
    if (leafIcon != null) {
        DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
        renderer.setLeafIcon(leafIcon);
        tree.setCellRenderer(renderer);
    } else {
        System.err.println("Leaf icon missing; using default.");
    }

    // Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    // Create the scroll pane and add the tree to it.
    JScrollPane treeView = new JScrollPane(tree);

    // Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    // Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); // XXX: ignored in some releases
    // of Swing. bug 4101306
    // workaround for bug 4101306:
    // treeView.setPreferredSize(new Dimension(100, 100));

    splitPane.setPreferredSize(new Dimension(500, 300));

    // Add the split pane to this panel.
    add(splitPane);
}

From source file:TreeDemo.java

public TreeDemo() {
    super(new GridLayout(1, 0));

    //Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);/*from ww  w .  ja va  2s  .  c o  m*/

    //Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    //Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    if (playWithLineStyle) {
        System.out.println("line style = " + lineStyle);
        tree.putClientProperty("JTree.lineStyle", lineStyle);
    }

    //Create the scroll pane and add the tree to it. 
    JScrollPane treeView = new JScrollPane(tree);

    //Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    //Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); //XXX: ignored in some releases
                                       //of Swing. bug 4101306
                                       //workaround for bug 4101306:
                                       //treeView.setPreferredSize(new Dimension(100, 100)); 

    splitPane.setPreferredSize(new Dimension(500, 300));

    //Add the split pane to this panel.
    add(splitPane);
}

From source file:components.TreeIconDemo.java

public TreeIconDemo() {
    super(new GridLayout(1, 0));

    //Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);/*from  w  ww  .j av  a 2 s  . com*/

    //Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    //Set the icon for leaf nodes.
    ImageIcon leafIcon = createImageIcon("images/middle.gif");
    if (leafIcon != null) {
        DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
        renderer.setLeafIcon(leafIcon);
        tree.setCellRenderer(renderer);
    } else {
        System.err.println("Leaf icon missing; using default.");
    }

    //Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    //Create the scroll pane and add the tree to it. 
    JScrollPane treeView = new JScrollPane(tree);

    //Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    //Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); //XXX: ignored in some releases
                                       //of Swing. bug 4101306
                                       //workaround for bug 4101306:
                                       //treeView.setPreferredSize(new Dimension(100, 100)); 

    splitPane.setPreferredSize(new Dimension(500, 300));

    //Add the split pane to this panel.
    add(splitPane);
}

From source file:i18nplugin.TranslatorEditor.java

private void createGui() {
    setLayout(new FormLayout("fill:min:grow", "fill:min:grow, pref"));
    CellConstraints cc = new CellConstraints();

    // Top// w ww  .j  a v  a  2 s .c om
    PanelBuilder topPanel = new PanelBuilder(new FormLayout("fill:10dlu:grow", "pref, 5dlu, fill:pref:grow"));
    topPanel.setBorder(Borders.DLU4_BORDER);
    topPanel.addSeparator(mLocalizer.msg("original", "Original text"), cc.xy(1, 1));

    mOriginal = new JTextArea();
    mOriginal.setWrapStyleWord(false);
    mOriginal.setEditable(false);

    topPanel.add(new JScrollPane(mOriginal), cc.xy(1, 3));

    // Bottom
    PanelBuilder bottomPanel = new PanelBuilder(
            new FormLayout("fill:10dlu:grow", "pref, 5dlu, fill:pref:grow"));
    bottomPanel.setBorder(Borders.DLU4_BORDER);
    bottomPanel.addSeparator(mLocalizer.msg("translation", "Translation"), cc.xy(1, 1));
    mTranslation = new JTextArea();
    mTranslation.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
            updateState();
        }

        public void insertUpdate(DocumentEvent e) {
            updateState();
        }

        public void removeUpdate(DocumentEvent e) {
            updateState();
        }
    });
    mOriginal.setBackground(mTranslation.getBackground());
    mOriginal.setForeground(mTranslation.getForeground());

    bottomPanel.add(new JScrollPane(mTranslation), cc.xy(1, 3));

    // Splitpane

    final JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    split.setBorder(null);

    split.setTopComponent(topPanel.getPanel());
    split.setBottomComponent(bottomPanel.getPanel());

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            split.setDividerLocation(0.5);
        }
    });

    add(split, cc.xy(1, 1));

    // translation state
    PanelBuilder panel = new PanelBuilder(new FormLayout("pref, 2dlu, fill:10dlu:grow", "pref, 3dlu, pref"));
    panel.setBorder(Borders.DLU4_BORDER);
    panel.addSeparator(mLocalizer.msg("state", "State"), cc.xyw(1, 1, 3));
    mIcon = new JLabel();
    panel.add(mIcon, cc.xy(1, 3));
    mState = new JLabel("-");
    panel.add(mState, cc.xy(3, 3));

    add(panel.getPanel(), cc.xy(1, 2));
}

From source file:edu.ucla.stat.SOCR.chart.demo.PowerTransformQQNormalPlotChart.java

public void init() {

    sliderPanel = new JPanel();
    powerSlider = new FloatSlider("Power", 1.0, -10.0, 10.0);
    powerSlider.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80));
    powerSlider.addObserver(this);
    powerSlider.setToolTipText("Slider for adjusting the value of power.");
    sliderPanel.add(this.powerSlider);

    super.init();
    depLabel.setText("Data"); // Y

    toolBar = new JToolBar();
    createActionComponents(toolBar);/*from   w  ww. j av a 2s  . c o m*/
    JPanel toolBarContainer = new JPanel();
    toolBarContainer.add(toolBar);

    JSplitPane toolContainer = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolBarContainer,
            new JScrollPane(sliderPanel));
    toolContainer.setContinuousLayout(true);
    toolContainer.setDividerLocation(0.6);
    this.getContentPane().add(toolContainer, BorderLayout.NORTH);
}

From source file:org.eobjects.datacleaner.widgets.result.DateGapAnalyzerResultSwingRenderer.java

@Override
public JComponent render(DateGapAnalyzerResult result) {

    final TaskSeriesCollection dataset = new TaskSeriesCollection();
    final Set<String> groupNames = result.getGroupNames();
    final TaskSeries completeDurationTaskSeries = new TaskSeries(LABEL_COMPLETE_DURATION);
    final TaskSeries gapsTaskSeries = new TaskSeries(LABEL_GAPS);
    final TaskSeries overlapsTaskSeries = new TaskSeries(LABEL_OVERLAPS);
    for (final String groupName : groupNames) {
        final String groupDisplayName;

        if (groupName == null) {
            if (groupNames.size() == 1) {
                groupDisplayName = "All";
            } else {
                groupDisplayName = LabelUtils.NULL_LABEL;
            }/*from  w  w w . j  a va  2  s .c  o m*/
        } else {
            groupDisplayName = groupName;
        }

        final TimeInterval completeDuration = result.getCompleteDuration(groupName);
        final Task completeDurationTask = new Task(groupDisplayName,
                createTimePeriod(completeDuration.getFrom(), completeDuration.getTo()));
        completeDurationTaskSeries.add(completeDurationTask);

        // plot gaps
        {
            final SortedSet<TimeInterval> gaps = result.getGaps(groupName);

            int i = 1;
            Task rootTask = null;
            for (TimeInterval interval : gaps) {
                final TimePeriod timePeriod = createTimePeriod(interval.getFrom(), interval.getTo());

                if (rootTask == null) {
                    rootTask = new Task(groupDisplayName, timePeriod);
                    gapsTaskSeries.add(rootTask);
                } else {
                    Task task = new Task(groupDisplayName + " gap" + i, timePeriod);
                    rootTask.addSubtask(task);
                }

                i++;
            }
        }

        // plot overlaps
        {
            final SortedSet<TimeInterval> overlaps = result.getOverlaps(groupName);

            int i = 1;
            Task rootTask = null;
            for (TimeInterval interval : overlaps) {
                final TimePeriod timePeriod = createTimePeriod(interval.getFrom(), interval.getTo());

                if (rootTask == null) {
                    rootTask = new Task(groupDisplayName, timePeriod);
                    overlapsTaskSeries.add(rootTask);
                } else {
                    Task task = new Task(groupDisplayName + " overlap" + i, timePeriod);
                    rootTask.addSubtask(task);
                }

                i++;
            }
        }
    }
    dataset.add(overlapsTaskSeries);
    dataset.add(gapsTaskSeries);
    dataset.add(completeDurationTaskSeries);

    final SlidingGanttCategoryDataset slidingDataset = new SlidingGanttCategoryDataset(dataset, 0,
            GROUPS_VISIBLE);

    final JFreeChart chart = ChartFactory.createGanttChart(
            "Date gaps and overlaps in " + result.getFromColumnName() + " / " + result.getToColumnName(),
            result.getGroupColumnName(), "Time", slidingDataset, true, true, false);
    ChartUtils.applyStyles(chart);

    // make sure the 3 timeline types have correct coloring
    {
        final CategoryPlot plot = (CategoryPlot) chart.getPlot();

        plot.setDrawingSupplier(new DCDrawingSupplier(WidgetUtils.ADDITIONAL_COLOR_GREEN_BRIGHT,
                WidgetUtils.ADDITIONAL_COLOR_RED_BRIGHT, WidgetUtils.BG_COLOR_BLUE_BRIGHT));
    }

    final ChartPanel chartPanel = new ChartPanel(chart);

    chartPanel.addChartMouseListener(new ChartMouseListener() {
        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
            Cursor cursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
            ChartEntity entity = event.getEntity();
            if (entity instanceof PlotEntity) {
                cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
            }
            chartPanel.setCursor(cursor);
        }

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            // do nothing
        }
    });

    final int visibleLines = Math.min(GROUPS_VISIBLE, groupNames.size());

    chartPanel.setPreferredSize(new Dimension(0, visibleLines * 50 + 200));

    final JComponent decoratedChartPanel;

    StringBuilder chartDescription = new StringBuilder();
    chartDescription
            .append("<html><p>The chart displays the recorded timeline based on FROM and TO dates.<br/><br/>");
    chartDescription.append(
            "The <b>red items</b> represent gaps in the timeline and the <b>green items</b> represent points in the timeline where more than one record show activity.<br/><br/>");
    chartDescription.append(
            "You can <b>zoom in</b> by clicking and dragging the area that you want to examine in further detail.");

    if (groupNames.size() > GROUPS_VISIBLE) {
        final JScrollBar scroll = new JScrollBar(JScrollBar.VERTICAL);
        scroll.setMinimum(0);
        scroll.setMaximum(groupNames.size());
        scroll.addAdjustmentListener(new AdjustmentListener() {

            @Override
            public void adjustmentValueChanged(AdjustmentEvent e) {
                int value = e.getAdjustable().getValue();
                slidingDataset.setFirstCategoryIndex(value);
            }
        });

        chartPanel.addMouseWheelListener(new MouseWheelListener() {

            @Override
            public void mouseWheelMoved(MouseWheelEvent e) {
                int scrollType = e.getScrollType();
                if (scrollType == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
                    int wheelRotation = e.getWheelRotation();
                    scroll.setValue(scroll.getValue() + wheelRotation);
                }
            }
        });

        final DCPanel outerPanel = new DCPanel();
        outerPanel.setLayout(new BorderLayout());
        outerPanel.add(chartPanel, BorderLayout.CENTER);
        outerPanel.add(scroll, BorderLayout.EAST);
        chartDescription.append("<br/><br/>Use the right <b>scrollbar</b> to scroll up and down on the chart.");
        decoratedChartPanel = outerPanel;

    } else {
        decoratedChartPanel = chartPanel;
    }

    chartDescription.append("</p></html>");

    final JLabel chartDescriptionLabel = new JLabel(chartDescription.toString());

    chartDescriptionLabel.setBorder(new EmptyBorder(4, 10, 4, 10));

    final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.add(decoratedChartPanel);
    split.add(chartDescriptionLabel);
    split.setDividerLocation(550);

    return split;
}

From source file:TreeIconDemo2.java

public TreeIconDemo2() {
    super(new GridLayout(1, 0));

    //Create the nodes.
    DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
    createNodes(top);//from   ww w .j  a  v a 2  s  .  c om

    //Create a tree that allows one selection at a time.
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    //Enable tool tips.
    ToolTipManager.sharedInstance().registerComponent(tree);

    //Set the icon for leaf nodes.
    ImageIcon tutorialIcon = createImageIcon("images/middle.gif");
    if (tutorialIcon != null) {
        tree.setCellRenderer(new MyRenderer(tutorialIcon));
    } else {
        System.err.println("Tutorial icon missing; using default.");
    }

    //Listen for when the selection changes.
    tree.addTreeSelectionListener(this);

    //Create the scroll pane and add the tree to it. 
    JScrollPane treeView = new JScrollPane(tree);

    //Create the HTML viewing pane.
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    initHelp();
    JScrollPane htmlView = new JScrollPane(htmlPane);

    //Add the scroll panes to a split pane.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(treeView);
    splitPane.setBottomComponent(htmlView);

    Dimension minimumSize = new Dimension(100, 50);
    htmlView.setMinimumSize(minimumSize);
    treeView.setMinimumSize(minimumSize);
    splitPane.setDividerLocation(100); //XXX: ignored in some releases
                                       //of Swing. bug 4101306
                                       //workaround for bug 4101306:
                                       //treeView.setPreferredSize(new Dimension(100, 100)); 

    splitPane.setPreferredSize(new Dimension(500, 300));

    //Add the split pane to this panel.
    add(splitPane);
}

From source file:test.integ.be.fedict.performance.util.PerformanceResultDialog.java

public PerformanceResultDialog(PerformanceResultsData data) {

    super((Frame) null, "Performance test results");
    setSize(1000, 800);//ww  w  . java  2 s .c om

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);
    JMenu fileMenu = new JMenu("File");
    menuBar.add(fileMenu);
    JMenuItem savePerformanceMenuItem = new JMenuItem("Save Performance");
    fileMenu.add(savePerformanceMenuItem);
    savePerformanceMenuItem.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setDialogTitle("Save as PNG...");
            int result = fileChooser.showSaveDialog(PerformanceResultDialog.this);
            if (JFileChooser.APPROVE_OPTION == result) {
                File file = fileChooser.getSelectedFile();
                try {
                    ChartUtilities.saveChartAsPNG(file, performanceChart, 1024, 768);
                } catch (IOException e) {
                    JOptionPane.showMessageDialog(null, "error saving to file: " + e.getMessage());
                }
            }
        }

    });
    JMenuItem saveMemoryMenuItem = new JMenuItem("Save Memory");
    fileMenu.add(saveMemoryMenuItem);
    saveMemoryMenuItem.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setDialogTitle("Save as PNG...");
            int result = fileChooser.showSaveDialog(PerformanceResultDialog.this);
            if (JFileChooser.APPROVE_OPTION == result) {
                File file = fileChooser.getSelectedFile();
                try {
                    ChartUtilities.saveChartAsPNG(file, memoryChart, 1024, 768);
                } catch (IOException e) {
                    JOptionPane.showMessageDialog(null, "error saving to file: " + e.getMessage());
                }
            }
        }

    });

    // memory chart
    memoryChart = getMemoryChart(data.getIntervalSize(), data.getMemory());

    // performance chart
    performanceChart = getPerformanceChart(data.getIntervalSize(), data.getPerformance(),
            data.getExpectedRevokedCount());

    Container container = getContentPane();
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    if (null != performanceChart) {
        splitPane.setTopComponent(new ChartPanel(performanceChart));
    }
    if (null != memoryChart) {
        splitPane.setBottomComponent(new ChartPanel(memoryChart));
    }
    splitPane.setDividerLocation(getHeight() / 2);
    splitPane.setDividerSize(1);
    container.add(splitPane);

    setVisible(true);
}