public void actionPerformed(ActionEvent e) { ChartPlotter plotter = PlotterManager.getInstance().getPlotterInstance((String) plotters.getSelectedItem()); List<ParameterDescriptor> lst = PlotterManager.getInstance().getPlotterParameters((String) plotters.getSelectedItem()); params.fill(lst); yAxisTitle.setText(plotter.getDefaultYAxisTitle()); xAxisTitle.setText(plotter.getDefaultXAxisTitle()); }
private void initComponents() { setLayout(new BorderLayout(8, 5)); JPanel northPanel = new JPanel(); northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.PAGE_AXIS)); JLabel label; label = new JLabel("Chart title :"); northPanel.add(label); title = new JTextField(chartName); northPanel.add(title); label = new JLabel("X Axis title :"); northPanel.add(label); xAxisTitle = new JTextField(); northPanel.add(xAxisTitle); label = new JLabel("Y Axis title :"); northPanel.add(label); yAxisTitle = new JTextField(); northPanel.add(yAxisTitle); label = new JLabel("Available plotters :"); northPanel.add(label); plotters = new JComboBox(); for (String plot : PlotterManager.getInstance().getAvailablePlotters()) { plotters.addItem(plot); } ; plotters.addActionListener(new SelectPlotterListener()); northPanel.add(plotters); add(northPanel, BorderLayout.NORTH); params = new ParamTable(3); add( new JScrollPane(params) { public Dimension getPreferredSize() { int width = super.getPreferredSize().width; int height = params.getRowHeight() * 6; return new Dimension(width, height); } }, BorderLayout.CENTER); JButton accept = new JButton("Plot Chart"); accept.addActionListener(new AcceptListener()); add(accept, BorderLayout.SOUTH); plotters.setSelectedIndex(0); }