Package org.eobjects.datacleaner.panels

Examples of org.eobjects.datacleaner.panels.DCPanel


    return true;
  }

  @Override
  protected JComponent getDialogContent() {
    final DCPanel driverClassOuterPanel = new DCPanel().setTitledBorder("Driver class name");
    driverClassOuterPanel.add(_driverClassNameComboBox);

    final JButton addButton = WidgetFactory.createSmallButton("images/actions/add.png");
    addButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        addFilenameTextField();
      }
    });
    final JButton removeButton = WidgetFactory.createSmallButton("images/actions/remove.png");
    removeButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        removeFilenameTextField();
      }
    });

    final DCPanel filesButtonPanel = new DCPanel();
    filesButtonPanel.setBorder(new EmptyBorder(0, 4, 0, 0));
    filesButtonPanel.setLayout(new VerticalLayout(2));
    filesButtonPanel.add(addButton);
    filesButtonPanel.add(removeButton);

    final DCPanel filesOuterPanel = new DCPanel().setTitledBorder("Driver JAR file(s)");
    filesOuterPanel.setLayout(new BorderLayout());
    filesOuterPanel.add(_filesPanel, BorderLayout.CENTER);
    filesOuterPanel.add(filesButtonPanel, BorderLayout.EAST);

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    buttonPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    buttonPanel.add(_addDriverButton);

    final DCPanel mainPanel = new DCPanel();
    mainPanel.setLayout(new VerticalLayout(4));
    mainPanel.add(driverClassOuterPanel);
    mainPanel.add(filesOuterPanel);
    mainPanel.add(buttonPanel);

    final DCPanel outerPanel = new DCPanel();
    outerPanel.setLayout(new BorderLayout());
    outerPanel.add(mainPanel, BorderLayout.CENTER);
    outerPanel.add(WidgetFactory.createStatusBar(_statusLabel), BorderLayout.SOUTH);

    outerPanel.setPreferredSize(400, 350);
    return outerPanel;
  }
View Full Code Here


            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;
View Full Code Here

              final ChartPanel chartPanel = new ChartPanel(chart);
              displayChartCallback.displayChart(chartPanel);
            }
          };

          DCPanel panel = AbstractCrosstabResultSwingRenderer.createActionableValuePanel(standardDeviation,
              Alignment.RIGHT, action, "images/chart-types/line.png");
          table.setValueAt(panel, rowNumber, columnNumber);
        }
      }
View Full Code Here

    return imageManager.getImage("images/actions/visualize.png");
  }

  @Override
  protected JComponent getWindowContent() {
    DCPanel panel = new DCPanel();
    panel.setLayout(new BorderLayout());
    panel.add(_scroll, BorderLayout.CENTER);
    panel.add(createButtonPanel(), BorderLayout.SOUTH);
    return panel;
  }
View Full Code Here

        _displayOutcomes = displayFilterOutcomesCheckBox.isSelected();
        refreshGraph();
      }
    });

    final DCPanel buttonPanel = new DCPanel(WidgetUtils.BG_COLOR_DARK, WidgetUtils.BG_COLOR_DARK);
    buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 4, 10));
    buttonPanel.setBorder(new MatteBorder(1, 0, 0, 0, WidgetUtils.BG_COLOR_MEDIUM));

    buttonPanel.add(new JLabel(imageManager.getImageIcon("images/model/column.png")));
    buttonPanel.add(displayColumnsCheckBox);
    buttonPanel.add(Box.createHorizontalStrut(20));
    buttonPanel.add(new JLabel(imageManager.getImageIcon("images/component-types/filter-outcome.png")));
    buttonPanel.add(displayFilterOutcomesCheckBox);

    return buttonPanel;
  }
View Full Code Here

    final DCTable table = crosstabPanel.getTable();
    if (isInitiallyCharted(table) || isTooLimitedToChart(table)) {
      return crosstabPanel;
    }

    final DCPanel headerPanel = new DCPanel();
    headerPanel.setLayout(new FlowLayout(Alignment.RIGHT.getFlowLayoutAlignment(), 1, 1));

    final JButton chartButton = new JButton("Show distribution chart", ImageManager.getInstance().getImageIcon(
        "images/chart-types/bar.png"));
    chartButton.setMargin(new Insets(1, 1, 1, 1));
    chartButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        headerPanel.setVisible(false);
        displayChart(table, crosstabPanel.getDisplayChartCallback());
      }
    });

    headerPanel.add(chartButton);

    final DCPanel panel = new DCPanel();
    panel.setLayout(new BorderLayout());
    panel.add(headerPanel, BorderLayout.NORTH);
    panel.add(crosstabPanel, BorderLayout.CENTER);

    return panel;
  }
View Full Code Here

      final String expression = extractString(expressionObject);

      final String synonymCatalogName = "PF: " + expression;

      if (!_catalog.containsSynonymCatalog(synonymCatalogName)) {
        DCPanel panel = new DCPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));

        panel.add(Box.createHorizontalStrut(4));
        panel.add(new JLabel(expression));

        final JButton button = WidgetFactory.createSmallButton("images/actions/save.png");
        button.setToolTipText("Save as string pattern");
        button.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            _catalog.addStringPattern(new SimpleStringPattern(synonymCatalogName, expression));
            button.setEnabled(false);
          }
        });
        panel.add(Box.createHorizontalStrut(4));
        panel.add(button);

        table.setValueAt(panel, i, 0);
      }
    }
View Full Code Here

  @Inject
  public MultipleCharPropertyWidget(ConfiguredPropertyDescriptor propertyDescriptor,
      AbstractBeanJobBuilder<?, ?, ?> beanJobBuilder) {
    super(beanJobBuilder, propertyDescriptor);

    _textFieldPanel = new DCPanel();
    _textFieldPanel.setLayout(new VerticalLayout(2));

    char[] currentValue = (char[]) beanJobBuilder.getConfiguredProperty(propertyDescriptor);
    if (currentValue == null) {
      currentValue = new char[1];
    }
    updateComponents(currentValue);

    final JButton addButton = WidgetFactory.createSmallButton("images/actions/add.png");
    addButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        addCharField();
        fireValueChanged();
      }
    });

    final JButton removeButton = WidgetFactory.createSmallButton("images/actions/remove.png");
    removeButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        int componentCount = _textFieldPanel.getComponentCount();
        if (componentCount > 0) {
          _textFieldPanel.remove(componentCount - 1);
          _textFieldPanel.updateUI();
          fireValueChanged();
        }
      }
    });

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setBorder(new EmptyBorder(0, 4, 0, 0));
    buttonPanel.setLayout(new VerticalLayout(2));
    buttonPanel.add(addButton);
    buttonPanel.add(removeButton);

    final DCPanel outerPanel = new DCPanel();
    outerPanel.setLayout(new BorderLayout());

    outerPanel.add(_textFieldPanel, BorderLayout.CENTER);
    outerPanel.add(buttonPanel, BorderLayout.EAST);

    add(outerPanel);
  }
View Full Code Here

  @Override
  public char[] getValue() {
    Component[] components = _textFieldPanel.getComponents();
    List<Character> list = new ArrayList<Character>();
    for (int i = 0; i < components.length; i++) {
      DCPanel panel = (DCPanel) components[i];
      JTextComponent textComponent = (JTextComponent) panel.getComponent(0);
      String text = textComponent.getText();
      if (text != null && text.length() == 1) {
        list.add(text.charAt(0));
      }
    }
View Full Code Here

    return true;
  }

  @Override
  protected JComponent getDialogContent() {
    final DCPanel panel = new DCPanel();

    int row = 0;
    WidgetUtils.addToGridBag(DCLabel.bright("<html><b>Original value:</b></html>"), panel, 1, row);
    WidgetUtils.addToGridBag(DCLabel.bright("<html><b>New/mapped value:</b></html>"), panel, 2, row);

    row++;
    WidgetUtils.addToGridBag(new JLabel(imageManager.getImageIcon("images/model/datastore.png")), panel, 0, row);
    WidgetUtils.addToGridBag(DCLabel.bright(_metadata.getDatastoreName()), panel, 1, row, GridBagConstraints.WEST);

    DCPanel datastoreButtonPanel = new DCPanel();
    datastoreButtonPanel.setLayout(new HorizontalLayout(0));
    datastoreButtonPanel.add(_datastoreCombobox);
    datastoreButtonPanel.add(Box.createHorizontalStrut(4));
    datastoreButtonPanel.add(_autoMapButton);

    WidgetUtils.addToGridBag(datastoreButtonPanel, panel, 2, row, GridBagConstraints.WEST);

    Set<String> tableNames = _sourceColumnComboBoxes.keySet();
    for (final String tableName : tableNames) {
      row++;
      final JLabel tableLabel = DCLabel.bright("<html><b>" + tableName + "</b></html>");
      tableLabel.setIcon(imageManager.getImageIcon("images/model/table.png", IconUtils.ICON_SIZE_SMALL));
      WidgetUtils.addToGridBag(tableLabel, panel, 0, row, 2, 1, GridBagConstraints.WEST);

      final JButton clearButton = new JButton("Clear");
      clearButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          List<SourceColumnComboBox> comboBoxes = _sourceColumnComboBoxes.get(tableName);
          for (SourceColumnComboBox comboBox : comboBoxes) {
            comboBox.setModel(_datastore, false);
          }
        }
      });
      final DCPanel clearButtonPanel = new DCPanel();
      clearButtonPanel.add(clearButton);
      WidgetUtils.addToGridBag(clearButtonPanel, panel, 2, row, GridBagConstraints.CENTER);

      final List<SourceColumnComboBox> comboBoxes = _sourceColumnComboBoxes.get(tableName);
      for (SourceColumnComboBox comboBox : comboBoxes) {
        row++;
        WidgetUtils.addToGridBag(
            new JLabel(imageManager.getImageIcon("images/model/column.png", IconUtils.ICON_SIZE_SMALL)), panel,
            0, row);
        WidgetUtils.addToGridBag(DCLabel.bright(comboBox.getName()), panel, 1, row, GridBagConstraints.WEST);
        WidgetUtils.addToGridBag(comboBox, panel, 2, row, GridBagConstraints.WEST);
      }
    }
    row++;

    if (!_variableTextFields.isEmpty()) {
      final JLabel tableLabel = DCLabel.bright("<html><b>Job-level variables</b></html>");
      tableLabel.setIcon(imageManager.getImageIcon("images/filetypes/analysis_job.png", IconUtils.ICON_SIZE_SMALL));
      WidgetUtils.addToGridBag(tableLabel, panel, 0, row, 2, 1, GridBagConstraints.WEST);

      for (Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
        row++;
        String variableId = entry.getKey();
        JXTextField textField = entry.getValue();

        WidgetUtils.addToGridBag(
            new JLabel(imageManager.getImageIcon("images/model/variable.png", IconUtils.ICON_SIZE_SMALL)),
            panel, 0, row);
        WidgetUtils.addToGridBag(DCLabel.bright(variableId), panel, 1, row, GridBagConstraints.WEST);
        WidgetUtils.addToGridBag(textField, panel, 2, row, GridBagConstraints.WEST);
      }
      row++;
    }

    final DCPanel openButtonPanel = new DCPanel();
    openButtonPanel.add(_openButton);
    WidgetUtils.addToGridBag(openButtonPanel, panel, 2, row, GridBagConstraints.EAST);

    return WidgetUtils.scrolleable(panel);
  }
View Full Code Here

TOP

Related Classes of org.eobjects.datacleaner.panels.DCPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.