Package org.eobjects.datacleaner.panels

Examples of org.eobjects.datacleaner.panels.DCPanel


  public OpenAnalysisJobFileChooserAccessory(WindowContext windowContext, AnalyzerBeansConfiguration configuration,
      DCFileChooser fileChooser, Provider<OpenAnalysisJobActionListener> openAnalysisJobActionListenerProvider) {
    super();
    _windowContext = windowContext;
    _configuration = configuration;
    _centerPanel = new DCPanel();
    _centerPanel.setLayout(new VerticalLayout(0));
    _fileChooser = fileChooser;
    _fileChooser.addPropertyChangeListener(this);
    _openJobButton = getOpenJobButton();
    _openAnalysisJobActionListenerProvider = openAnalysisJobActionListenerProvider;

    setPreferredSize(220, 10);

    setBorder(new EmptyBorder(0, 10, 0, 0));
    setLayout(new BorderLayout());
    setVisible(false);

    final JLabel iconLabel = new JLabel(ImageManager.getInstance().getImageIcon("images/window/app-icon.png"));

    final JLabel headerLabel = new JLabel("DataCleaner analysis job:");
    headerLabel.setFont(WidgetUtils.FONT_HEADER1);

    final DCPanel northPanel = new DCPanel();
    northPanel.setLayout(new VerticalLayout(0));
    northPanel.add(iconLabel);
    northPanel.add(Box.createVerticalStrut(10));
    northPanel.add(headerLabel);
    northPanel.add(Box.createVerticalStrut(10));
    northPanel.add(_centerPanel);
    northPanel.add(Box.createVerticalStrut(10));

    final DCPanel southPanel = new DCPanel();
    southPanel.setLayout(new VerticalLayout(0));
    northPanel.add(Box.createVerticalStrut(4));
    southPanel.add(_openJobButton);
    southPanel.add(Box.createVerticalStrut(4));
    southPanel.add(getOpenAsTemplateButton());

    add(WidgetUtils.scrolleable(northPanel), BorderLayout.CENTER);
    add(southPanel, BorderLayout.SOUTH);
  }
View Full Code Here


    this(glassPane, text, xOnScreen, yOnScreen, null);
  }

  public DCPopupBubble(DCGlassPane glassPane, String text, int xOnScreen, int yOnScreen, String iconPath) {
    _glassPane = glassPane;
    _panel = new DCPanel(imageManager.getImage("images/window/popup-bubble.png"), 0, 0);
    _xOnScreen = xOnScreen;
    _yOnScreen = yOnScreen;
    final DCLabel label = DCLabel.bright(text);
    if (iconPath != null) {
      label.setIcon(imageManager.getImageIcon(iconPath));
View Full Code Here

    updateTableModel(table, list);

    final Image image = ImageManager.getInstance().getImage("images/actions/reorder-columns.png");

    final DCPanel tablePanel = table.toPanel();
    tablePanel.setBorder(new CompoundBorder(WidgetUtils.BORDER_SHADOW, WidgetUtils.BORDER_THIN));

    final JDialog dialog = new JDialog();

    final JButton button = new JButton("Save order", new ImageIcon(image));
    button.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        saveReorderedValue(list);
        dialog.dispose();
      }
    });

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

    final DCPanel panel = new DCPanel(WidgetUtils.BG_COLOR_BRIGHTEST, WidgetUtils.BG_COLOR_BRIGHT);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    panel.setLayout(new BorderLayout());
    panel.add(tablePanel, BorderLayout.CENTER);
    panel.add(buttonPanel, BorderLayout.SOUTH);

    dialog.setModal(true);
    dialog.setTitle("Reorder columns");
    dialog.setIconImage(image);
    dialog.getContentPane().add(panel);
    Dimension size = panel.getPreferredSize();
    size.width = Math.max(size.width, 300);
    size.height = Math.max(size.height, 400);
    dialog.setSize(size);
    WidgetUtils.centerOnScreen(dialog);
    dialog.setVisible(true);
View Full Code Here

          list.set(index - 1, col1);
          updateTableModel(table, list);
        }
      });

      final DCPanel buttonPanel = new DCPanel();
      buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
      if (i == list.size() - 1) {
        buttonPanel.add(Box.createHorizontalStrut(moveDownButton.getPreferredSize().width));
      } else {
        buttonPanel.add(moveDownButton);
      }
      buttonPanel.add(Box.createHorizontalStrut(6));
      if (i == 0) {
        buttonPanel.add(Box.createHorizontalStrut(moveUpButton.getPreferredSize().width));
      } else {
        buttonPanel.add(moveUpButton);
      }

      tableModel.setValueAt(list.get(i).getName(), i, 0);
      tableModel.setValueAt(buttonPanel, i, 1);
    }
View Full Code Here

    toolBar.add(visitProjectButton);

    final JScrollPane licenseLabelScroll = WidgetUtils.scrolleable(licenseLabel);
    licenseLabelScroll.setBorder(new CompoundBorder(new EmptyBorder(10, 0, 10, 0), WidgetUtils.BORDER_THIN));

    final DCPanel headerPanel = new DCPanel();
    headerPanel.setLayout(new VerticalLayout());
    headerPanel.add(toolBar);
    headerPanel.add(Box.createVerticalStrut(20));
    headerPanel.add(licenseHeader);

    final DCPanel panel = new DCPanel(WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_BRIGHTEST);
    panel.setBorder(new EmptyBorder(4, 4, 4, 4));
    panel.setLayout(new BorderLayout());
    panel.add(headerPanel, BorderLayout.NORTH);
    panel.add(licenseLabelScroll, BorderLayout.CENTER);

    return panel;
  }
View Full Code Here

   *
   * @param comp
   * @return
   */
  public static DCPanel decorateWithShadow(JComponent comp, boolean outline, int margin) {
    DCPanel panel = new DCPanel();
    panel.setLayout(new BorderLayout());
    Border border = BORDER_SHADOW;
    if (outline) {
      border = new CompoundBorder(border, BORDER_THIN);
    }
    if (margin > 0) {
      border = new CompoundBorder(new EmptyBorder(margin, margin, margin, margin), border);
    }
    panel.setBorder(border);
    panel.add(comp, BorderLayout.CENTER);
    return panel;
  }
View Full Code Here

    final JButton linkedInButton = new JButton(imageManager.getImageIcon("images/links/linkedin.png"));
    linkedInButton.addActionListener(new OpenBrowserAction("http://www.linkedin.com/groups?gid=3352784"));
    linkedInButton.setToolTipText("Join the DataCleaner LinkedIn group");
    linkedInButton.setBorder(null);

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new HorizontalLayout());
    buttonPanel.add(datacleanerButton);
    buttonPanel.add(Box.createHorizontalStrut(10));
    buttonPanel.add(bloggerButton);
    buttonPanel.add(Box.createHorizontalStrut(10));
    buttonPanel.add(linkedInButton);

    final HumanInferenceToolbarButton humanInferenceButton = new HumanInferenceToolbarButton(
        imageManager.getImageIcon("images/powered-by-human-inference-bright.png"));

    final DCPanel contentPanel = new DCPanel();
    contentPanel.setLayout(new VerticalLayout());
    contentPanel.add(headerLabel);
    contentPanel.add(DCLabel.dark("Copyright (C) 2010 eobjects.org"));
    contentPanel.add(Box.createVerticalStrut(20));
    contentPanel.add(DCPanel.around(humanInferenceButton));
    contentPanel.add(Box.createVerticalStrut(20));
    contentPanel.add(DCLabel.dark("Licensed under the LGPL license"));
    contentPanel.add(DCLabel.dark("(see Licensing tab)."));
    contentPanel.add(Box.createVerticalStrut(30));
    contentPanel.add(DCLabel.dark("Java runtime information:"));
    contentPanel.add(DCLabel.dark("  " + System.getProperty("java.vm.name")));
    contentPanel.add(DCLabel.dark("  by " + System.getProperty("java.vm.vendor")));
    contentPanel.add(DCLabel.dark("  version " + System.getProperty("java.runtime.version")));
    contentPanel.add(Box.createVerticalStrut(30));
    contentPanel.add(buttonPanel);

    final DCPanel mainPanel = new DCPanel(imageManager.getImage("images/window/app-icon-hires.png"), 97, 10,
        WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_BRIGHTEST);
    mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    mainPanel.setLayout(new VerticalLayout());
    mainPanel.add(contentPanel);

    return mainPanel;
  }
View Full Code Here

    return _descriptor.toString();
  }

  @Override
  public JToolTip createToolTip() {
    DCPanel panel = new DCPanel();
    panel.setOpaque(true);
    panel.setBackground(WidgetUtils.BG_COLOR_DARK);

    JLabel iconLabel = new JLabel(IconUtils.getDescriptorIcon(_descriptor, IconUtils.ICON_SIZE_LARGE));
    iconLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
    iconLabel.setOpaque(false);

    JLabel nameLabel = new JLabel(_descriptor.getDisplayName());
    nameLabel.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
    nameLabel.setOpaque(false);
    nameLabel.setFont(WidgetUtils.FONT_HEADER1);

    // if the bean has a description, add it in the CENTER of the tooltip
    String description = _descriptor.getDescription();
    if (StringUtils.isNullOrEmpty(description)) {

      WidgetUtils.addToGridBag(iconLabel, panel, 0, 0);
      WidgetUtils.addToGridBag(nameLabel, panel, 1, 0);

    } else {
      String[] lines = description.split("\n");

      WidgetUtils.addToGridBag(iconLabel, panel, 0, 0, 1, lines.length + 1, GridBagConstraints.WEST);
      WidgetUtils.addToGridBag(nameLabel, panel, 1, 0);

      int width = 0;
      int height = 0;

      for (int i = 0; i < lines.length; i++) {
        String line = lines[i];
        JTextArea textArea = new JTextArea();
        textArea.setText(line.trim());
        textArea.setEditable(false);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        textArea.setOpaque(false);
        textArea.setBorder(null);
        textArea.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        textArea.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
        textArea.setColumns(30);

        Dimension ps = textArea.getPreferredSize();
        height += ps.height + 8;
        width = Math.max(ps.width, width);

        WidgetUtils.addToGridBag(textArea, panel, 1, i + 1);
      }

      // TODO: Make a more accurate width/height calculation
      width += iconLabel.getPreferredSize().width + 50;
      height += nameLabel.getPreferredSize().height + 50;
      panel.setPreferredSize(new Dimension(width, height));
    }

    Border border = new CompoundBorder(WidgetUtils.BORDER_THIN, WidgetUtils.BORDER_EMPTY);
    panel.setBorder(border);

    JToolTip toolTip = new DCToolTip(this, panel);
    return toolTip;
  }
View Full Code Here

    }

    CrosstabPanel valueCombinationPanel = crosstabResultSwingRenderer.renderInternal(new CrosstabResult(
        valueCombinationCrosstab), true);

    DCPanel panel = new DCPanel();
    panel.setLayout(new VerticalLayout(4));

    JLabel label = new JLabel("Column statistics:");
    label.setFont(WidgetUtils.FONT_HEADER1);
    panel.add(label);
    panel.add(columnStatisticsPanel);

    panel.add(Box.createVerticalStrut(4));

    label = new JLabel("Frequency of combinations:");
    label.setFont(WidgetUtils.FONT_HEADER1);
    panel.add(label);
    panel.add(valueCombinationPanel);

    return panel;
  }
View Full Code Here

    super(windowContext);
    _databaseDriverCatalog = databaseDriverCatalog;
    _databaseDriversPanel = databaseDriversPanel;
    _userPreferences = userPreferences;
    _filenameTextFields = new ArrayList<FilenameTextField>();
    _filesPanel = new DCPanel();
    _filesPanel.setLayout(new VerticalLayout(4));

    final Set<String> classNames = new TreeSet<String>();
    classNames.add("");
    final List<DatabaseDriverDescriptor> drivers = _databaseDriverCatalog.getDatabaseDrivers();
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.