Package org.eobjects.datacleaner.panels

Examples of org.eobjects.datacleaner.panels.DCPanel


    _splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    _splitPane.setBackground(WidgetUtils.BG_COLOR_DARK);
    _splitPane.setBorder(null);
    _splitPane.setDividerLocation(320);

    _treePanel = new DCPanel(WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_BRIGHTEST);
    _treePanel.setLayout(new BorderLayout());
    _datastoreComboBox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        String datastoreName = (String) _datastoreComboBox.getSelectedItem();
View Full Code Here


    return true;
  }

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

    int row = 0;
    DCLabel descriptionLabel = DCLabel
        .brightMultiLine("A datastore dictionary is a dictionary based on a column in one of your datastores. Please select a datastore in the form below and a tree of that datastore will appear. From here on you can select which column in the datastore to use for dictionary lookups.");
    descriptionLabel.setBorder(new EmptyBorder(0, 0, 0, 20));
    descriptionLabel.setPreferredSize(new Dimension(300, 100));
    WidgetUtils.addToGridBag(descriptionLabel, formPanel, 0, row, 2, 1);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Dictionary name:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_nameTextField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Datastore:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_datastoreComboBox, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Lookup column:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_columnTextField, formPanel, 1, row);

    row++;
    JButton createDictionaryButton = WidgetFactory.createButton("Save dictionary", "images/model/dictionary.png");
    createDictionaryButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        String name = _nameTextField.getText();
        if (StringUtils.isNullOrEmpty(name)) {
          JOptionPane.showMessageDialog(DatastoreDictionaryDialog.this,
              "Please fill out the name of the dictionary");
          return;
        }

        String datastoreName = (String) _datastoreComboBox.getSelectedItem();
        if (StringUtils.isNullOrEmpty(datastoreName)) {
          JOptionPane.showMessageDialog(DatastoreDictionaryDialog.this, "Please select a datastore");
          return;
        }

        String columnPath = _columnTextField.getText();
        if (StringUtils.isNullOrEmpty(columnPath)) {
          JOptionPane.showMessageDialog(DatastoreDictionaryDialog.this, "Please select a lookup column");
          return;
        }

        DatastoreDictionary dictionary = new DatastoreDictionary(name, datastoreName, columnPath);
        if (_originalDictionary != null) {
          _referenceDataCatalog.removeDictionary(_originalDictionary);
        }
        _referenceDataCatalog.addDictionary(dictionary);
        DatastoreDictionaryDialog.this.dispose();
      }
    });

    DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    buttonPanel.add(createDictionaryButton);

    WidgetUtils.addToGridBag(buttonPanel, formPanel, 0, row, 2, 1);

    _splitPane.add(formPanel);
    _splitPane.add(_treePanel);
View Full Code Here

    final JToolBar toolBar = WidgetFactory.createToolBar();
    toolBar.add(new HumanInferenceToolbarButton());
    toolBar.add(WidgetFactory.createToolBarSeparator());
    toolBar.add(closeButton);

    final DCPanel toolBarPanel = new DCPanel(WidgetUtils.BG_COLOR_DARKEST, WidgetUtils.BG_COLOR_DARKEST);
    toolBarPanel.setLayout(new BorderLayout());
    toolBarPanel.add(toolBar, BorderLayout.CENTER);

    final DCPanel panel = new DCPanel(WidgetUtils.BG_COLOR_DARK, WidgetUtils.BG_COLOR_DARK);
    panel.setLayout(new BorderLayout());
    panel.add(_tabbedPane, BorderLayout.CENTER);
    panel.add(toolBarPanel, BorderLayout.SOUTH);
    panel.setPreferredSize(getDialogWidth(), 500);
    return panel;
  }
View Full Code Here

        }
        updateStatusLabel();
      }
    });

    _sourceTabOuterPanel = new DCPanel(imageManager.getImage("images/window/source-tab-background.png"), 95, 95,
        WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_BRIGHTEST);
    _sourceTabOuterPanel.setLayout(new VerticalLayout(0));

    _schemaTreePanel = schemaTreePanel;
    _metadataPanel = metadataPanel;
View Full Code Here

    final JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel);

    final LoginStatusLabel loggedInStatusLabel = _injectorWithGlassPane.getInstance(LoginStatusLabel.class);
    statusBar.add(loggedInStatusLabel);

    final DCPanel toolBarPanel = new DCPanel(WidgetUtils.BG_COLOR_LESS_DARK, WidgetUtils.BG_COLOR_DARK);
    toolBarPanel.setLayout(new BorderLayout());
    toolBarPanel.add(toolBar, BorderLayout.CENTER);

    final DCPanel panel = new DCPersistentSizedPanel(_userPreferences, getClass().getName(), DEFAULT_WINDOW_WIDTH,
        DEFAULT_WINDOW_HEIGHT);
    panel.setLayout(new BorderLayout());
    panel.add(toolBarPanel, BorderLayout.NORTH);
    panel.add(_leftPanel, BorderLayout.WEST);
    panel.add(_tabbedPane, BorderLayout.CENTER);
    panel.add(statusBar, BorderLayout.SOUTH);

    WidgetUtils.centerOnScreen(this);

    initializeExistingComponents();
View Full Code Here

    return 400;
  }

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

    // temporary variable to make it easier to refactor the layout
    WidgetUtils.addToGridBag(DCLabel.bright("Datastore name:"), formPanel, 0, 0);
    WidgetUtils.addToGridBag(_datastoreNameField, formPanel, 1, 0);

    final DCPanel checkBoxPanel = new DCPanel().setTitledBorder("Contained datastores");
    checkBoxPanel.setLayout(new VerticalLayout(4));

    for (JCheckBox checkBox : _checkBoxes) {
      checkBoxPanel.add(checkBox);
    }

    WidgetUtils.addToGridBag(checkBoxPanel, formPanel, 0, 1, 2, 1);

    _addDatastoreButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        final List<Datastore> datastores = new ArrayList<Datastore>();

        for (JCheckBox checkBox : _checkBoxes) {
          if (checkBox.isSelected()) {
            String datastoreName = checkBox.getText();
            Datastore datastore = _mutableDatastoreCatalog.getDatastore(datastoreName);
            if (datastore == null) {
              throw new IllegalStateException("No such datastore: " + datastoreName);
            }
            datastores.add(datastore);
          }
        }

        final Datastore datastore = new CompositeDatastore(_datastoreNameField.getText(), datastores);

        if (_originalDatastore != null) {
          _mutableDatastoreCatalog.removeDatastore(_originalDatastore);
        }

        _mutableDatastoreCatalog.addDatastore(datastore);
        dispose();
      }
    });

    DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    buttonPanel.add(_addDatastoreButton);

    DCPanel centerPanel = new DCPanel();
    centerPanel.setLayout(new VerticalLayout(4));
    centerPanel.add(formPanel);
    centerPanel.add(buttonPanel);

    JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel);

    _outerPanel.setLayout(new BorderLayout());
    _outerPanel.add(centerPanel, BorderLayout.CENTER);
View Full Code Here

  private final DCPanel _sourceComboBoxPanel;
  private final DCPanel _buttonPanel;
  private final List<SourceColumnComboBox> _sourceColumnComboBoxes;

  public MultiSourceColumnComboBoxPanel() {
    _sourceComboBoxPanel = new DCPanel();
    _buttonPanel = new DCPanel();
    _sourceComboBoxPanel.setBorder(new EmptyBorder(0, 4, 0, 0));
    _sourceComboBoxPanel.setLayout(new VerticalLayout());
    _sourceColumnComboBoxes = new ArrayList<SourceColumnComboBox>();

    JButton addButton = WidgetFactory.createSmallButton("images/actions/add.png");
View Full Code Here

   * Creates a panel containing ButtonPanel and SourceComboboxPanel
   *
   * @return DCPanel
   */
  public DCPanel createPanel() {
    DCPanel parentPanel = new DCPanel();
    parentPanel.setLayout(new BorderLayout());
    parentPanel.add(_sourceComboBoxPanel, BorderLayout.CENTER);
    parentPanel.add(_buttonPanel, BorderLayout.EAST);
    return parentPanel;
  }
View Full Code Here

    _progressBars[index].setMaximum((int) (bytes / 100));
  }

  @Override
  protected JComponent getDialogContent() {
    DCPanel centerPanel = new DCPanel();
    centerPanel.setLayout(new VerticalLayout(4));

    for (int i = 0; i < _files.length; i++) {

      final JLabel ofLabel = new JLabel(" of ");
      ofLabel.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);

      final DCPanel textPanel = new DCPanel();
      textPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
      textPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
      textPanel.add(_currentBytesLabels[i]);
      textPanel.add(ofLabel);
      textPanel.add(_expectedBytesLabels[i]);

      centerPanel.add(_infoLabels[i]);
      centerPanel.add(_progressBars[i]);
      centerPanel.add(textPanel);
    }

    final DCPanel mainPanel = new DCPanel();
    mainPanel.setLayout(new BorderLayout());
    mainPanel.add(centerPanel, BorderLayout.CENTER);

    return mainPanel;
  }
View Full Code Here

    return 465;
  }

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

    int row = 0;
    WidgetUtils.addToGridBag(DCLabel.bright("Dictionary name:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_nameTextField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Values:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_valuesTextArea, formPanel, 1, row);

    row++;
    final JButton createDictionaryButton = WidgetFactory.createButton("Save dictionary", "images/model/dictionary.png");
    createDictionaryButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        String name = _nameTextField.getText();
        if (StringUtils.isNullOrEmpty(name)) {
          JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the name of the dictionary");
          return;
        }

        String values = _valuesTextArea.getText();
        if (StringUtils.isNullOrEmpty(values)) {
          JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the values");
          return;
        }

        SimpleDictionary dict = new SimpleDictionary(name, values.split("\n"));

        if (_originalDictionary != null) {
          _catalog.removeDictionary(_originalDictionary);
        }
        _catalog.addDictionary(dict);
        SimpleDictionaryDialog.this.dispose();
      }
    });

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    buttonPanel.add(createDictionaryButton);
    WidgetUtils.addToGridBag(buttonPanel, formPanel, 0, row, 2, 1);

    final DCLabel descriptionLabel = DCLabel
        .brightMultiLine("A simple dictionary is a dictionary that you enter directly in DataCleaner. In the 'Values' field you can enter each value of the dictionary on a separate line.");
    descriptionLabel.setBorder(new EmptyBorder(10, 10, 10, 20));
    descriptionLabel.setPreferredSize(new Dimension(300, 100));

    final DCPanel mainPanel = new DCPanel();
    mainPanel.setLayout(new VerticalLayout(4));
    mainPanel.add(descriptionLabel);
    mainPanel.add(formPanel);

    final JScrollPane scroll = WidgetUtils.scrolleable(mainPanel);
    return scroll;
  }
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.