Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* DataCleaner (community edition)
* Copyright (C) 2014 Neopost - Customer Information Management
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.datacleaner.components.fillpattern.swing;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.Arrays;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.event.ChangeListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import org.datacleaner.api.AnalyzerResult;
import org.datacleaner.api.InputColumn;
import org.datacleaner.bootstrap.WindowContext;
import org.datacleaner.components.fillpattern.FillPattern;
import org.datacleaner.components.fillpattern.FillPatternAnalyzer;
import org.datacleaner.components.fillpattern.FillPatternGroup;
import org.datacleaner.components.fillpattern.FillPatternResult;
import org.datacleaner.panels.DCPanel;
import org.datacleaner.result.AnnotatedRowsResult;
import org.datacleaner.result.renderer.RendererFactory;
import org.datacleaner.storage.RowAnnotationFactory;
import org.datacleaner.util.IconUtils;
import org.datacleaner.util.LabelUtils;
import org.datacleaner.util.WidgetUtils;
import org.datacleaner.widgets.Alignment;
import org.datacleaner.widgets.result.AbstractCrosstabResultSwingRenderer;
import org.datacleaner.widgets.table.DCTable;
import org.datacleaner.widgets.table.DCTableCellRenderer;
import org.datacleaner.windows.DetailsResultWindow;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
import org.jdesktop.swingx.decorator.Highlighter;
public class FillPatternGroupTablePanel extends JPanel {
private static final long serialVersionUID = 1L;
public FillPatternGroupTablePanel(WindowContext windowContext, RendererFactory rendererFactory,
FillPatternResult result, FillPatternGroup group) {
final List> inspectedColumns = result.getInspectedColumns();
final String[] headers = new String[1 + inspectedColumns.size()];
headers[0] = LabelUtils.COUNT_LABEL;
for (int i = 0; i < inspectedColumns.size(); i++) {
headers[1 + i] = inspectedColumns.get(i).getName();
}
final TableModel tableModel = new DefaultTableModel(headers, group.getPatternCount());
int row = 0;
for (FillPattern fillPattern : group) {
int column = 0;
final int observationCount = fillPattern.getObservationCount();
final Object observationCountValue =
createObservationCountValue(windowContext, rendererFactory, result, fillPattern, observationCount);
tableModel.setValueAt(observationCountValue, row, column);
column++;
final List