Package org.eobjects.datacleaner.panels

Examples of org.eobjects.datacleaner.panels.DCPanel


    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("Filename:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_filenameTextField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Character encoding:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_encodingComboBox, formPanel, 1, row);

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

        String filename = _filenameTextField.getFilename();
        if (StringUtils.isNullOrEmpty(filename)) {
          JOptionPane.showMessageDialog(TextFileDictionaryDialog.this,
              "Please fill out the filename or select a file using the 'Browse' button");
          return;
        }

        String encoding = (String) _encodingComboBox.getSelectedItem();
        if (StringUtils.isNullOrEmpty(filename)) {
          JOptionPane.showMessageDialog(TextFileDictionaryDialog.this, "Please select a character encoding");
          return;
        }

        TextFileDictionary dict = new TextFileDictionary(name, filename, encoding);

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

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

    final DCLabel descriptionLabel = DCLabel
        .brightMultiLine("A text file dictionary is a dictionary based on a text file containing values separated by linebreaks.");
    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);

    return mainPanel;
  }
View Full Code Here


      return renderCrosstab(singleCrosstab);
    }
  }

  public JComponent renderGroupedResult(PatternFinderResult result) {
    final DCPanel panel = new DCPanel();
    panel.setLayout(new VerticalLayout(0));
    final Map<String, Crosstab<?>> crosstabs = result.getGroupedCrosstabs();
    boolean collapsed = false;
    if (crosstabs.size() > MAX_EXPANDED_GROUPS) {
      collapsed = true;
    }

    final Set<Entry<String, Crosstab<?>>> entries = crosstabs.entrySet();
    for (Entry<String, Crosstab<?>> entry : entries) {
      final String groupName = entry.getKey();
      if (panel.getComponentCount() != 0) {
        panel.add(Box.createVerticalStrut(10));
      }
      final Crosstab<?> crosstab = entry.getValue();

      final Ref<JComponent> componentRef = new LazyRef<JComponent>() {
        @Override
        protected JComponent fetch() {
          logger.info("Rendering group result '{}'", groupName);
          final JComponent renderedResult = delegateRenderer.render(new CrosstabResult(crosstab));
          final DCPanel decoratedPanel = createDecoration(renderedResult);
          return decoratedPanel;
        }
      };
      final String expandedLabel = "Pattern finder for group '" + LabelUtils.getLabel(entry.getKey() + "'");
      final int patternCount = crosstab.getDimension(
View Full Code Here

    return panel;
  }

  private DCPanel createDecoration(JComponent renderedResult) {
    renderedResult.setBorder(WidgetUtils.BORDER_SHADOW);
    final DCPanel wrappingPanel = new DCPanel();
    wrappingPanel.setLayout(new BorderLayout());
    wrappingPanel.add(renderedResult, BorderLayout.CENTER);
    wrappingPanel.setBorder(new EmptyBorder(4, 20, 4, 4));
    return wrappingPanel;
  }
View Full Code Here

  @Override
  protected JComponent getWindowContent() {
    updateTable();

    final DCPanel tablePanel = _table.toPanel();

    final DCPanel pagingButtonPanel = createPagingButtonPanel();

    DCPanel panel = new DCPanel();
    panel.setLayout(new BorderLayout());
    _loadingIcon.setPreferredSize(300, 300);
    panel.add(_loadingIcon, BorderLayout.NORTH);
    panel.add(tablePanel, BorderLayout.CENTER);
    if (pagingButtonPanel != null) {
      panel.add(pagingButtonPanel, BorderLayout.SOUTH);
    }
    return panel;
  }
View Full Code Here

        _query.setFirstRow(newFirstRow);
        updateTable();
      }
    });

    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(_previousPageButton);
    buttonPanel.add(_nextPageButton);

    return buttonPanel;
  }
View Full Code Here

    setBackgroundPainter(null);
  }

  @Override
  public void add(JXTaskPane group) {
    DCPanel panel = createTaskPanePanel(group);
    super.add(panel);
  }
View Full Code Here

    DCPanel panel = createTaskPanePanel(group);
    super.add(panel);
  }

  public void add(JXTaskPane group, int index) {
    DCPanel panel = createTaskPanePanel(group);
    super.add(panel, index);
  }
View Full Code Here

    DCPanel panel = createTaskPanePanel(group);
    super.add(panel, index);
  }

  private DCPanel createTaskPanePanel(JXTaskPane group) {
    DCPanel panel = new DCPanel();
    panel.setBorder(WidgetUtils.BORDER_SHADOW);
    panel.setLayout(new BorderLayout());
    panel.add(group, BorderLayout.CENTER);
    return panel;
  }
View Full Code Here

  public JXTaskPane[] getTaskPanes() {
    Component[] components = getComponents();
    JXTaskPane[] result = new JXTaskPane[components.length];
    for (int i = 0; i < result.length; i++) {
      DCPanel panel = (DCPanel) components[i];
      result[i] = (JXTaskPane) panel.getComponent(0);
    }
    return result;
  }
View Full Code Here

        }
        return imageManager.getImageIcon("images/status/error.png");
      }
    });

    DCPanel panel = new DCPanel();
    panel.setPreferredSize(preferredSize);
    panel.setLayout(new BorderLayout());
    panel.add(visualizationViewer, BorderLayout.CENTER);
    return 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.