Changeset 751
- Timestamp:
- 03/15/09 13:35:43 (3 years ago)
- Location:
- DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui
- Files:
-
- 8 edited
-
dialogs/CsvConfigurationDialog.java (modified) (11 diffs)
-
panels/TableProfileResultsPanel.java (modified) (1 diff)
-
panels/TableValidationRuleResultsPanel.java (modified) (1 diff)
-
website/RegexSwapDialog.java (modified) (1 diff)
-
widgets/DataCleanerTable.java (modified) (4 diffs)
-
windows/DataSetWindow.java (modified) (2 diffs)
-
windows/PreviewDataWindow.java (modified) (2 diffs)
-
windows/ProfilerWindow.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/dialogs/CsvConfigurationDialog.java
r645 r751 18 18 19 19 import java.awt.BorderLayout; 20 import java.awt.Color;21 20 import java.awt.Component; 21 import java.awt.GridBagLayout; 22 22 import java.awt.event.ActionEvent; 23 23 import java.awt.event.ActionListener; … … 32 32 import javax.swing.JTextField; 33 33 import javax.swing.JToolBar; 34 import javax.swing.border.LineBorder;35 34 36 35 import dk.eobjects.datacleaner.data.DataContextSelection; … … 41 40 import dk.eobjects.metamodel.data.Row; 42 41 import dk.eobjects.metamodel.query.Query; 42 import dk.eobjects.metamodel.query.SelectItem; 43 import dk.eobjects.metamodel.schema.Column; 43 44 import dk.eobjects.metamodel.schema.Table; 44 45 … … 47 48 48 49 private static final long serialVersionUID = -8449807287294665745L; 50 49 51 private static final String COMMA_ACTION_CMD = ","; 50 52 private static final String SEMI_COLON_ACTION_CMD = ";"; … … 52 54 private static final String SINGLE_QUOTE_ACTION_CMD = "'"; 53 55 private static final String DOUBLE_QUOTE_ACTION_CMD = "\""; 54 private JPanel _dataConfigurationPanel; 56 private static final int PREVIEW_ROWS = 5; 57 58 private JPanel _panel; 55 59 private JTextField _sampleText; 56 60 private DataTable _table; … … 59 63 private DataContextSelection _dataContextSelection; 60 64 private File _file; 61 private JRadioButton _tabButton;65 private String _fileExtension; 62 66 private JPanel _tablePanel; 63 67 64 68 public CsvConfigurationDialog(DataContextSelection selection, File file) { 65 super( 600, 480);69 super(500, 480); 66 70 _file = file; 67 71 _dataContextSelection = selection; … … 78 82 add(toolbar, BorderLayout.SOUTH); 79 83 80 String fileExtension = DataContextSelection.getExtention(file); 81 if (DataContextSelection.EXTENSION_TAB_SEPARATED.equals(fileExtension)) { 82 _tabButton.setSelected(true); 83 _curSeparator = TAB_ACTION_CMD.charAt(0); 84 } 84 _fileExtension = DataContextSelection.getExtention(file); 85 85 86 86 updateContent(); … … 90 90 protected Component getContent() { 91 91 ButtonGroup delimitorGroup = new ButtonGroup(); 92 _dataConfigurationPanel = GuiHelper.createPanel().applyLayout(null) 93 .toComponent(); 94 JLabel delimitorLbl = new JLabel("Select the Delimitor:"); 95 addToPanel(delimitorLbl, 10, 5, 200, 20); 92 _panel = GuiHelper.createPanel().toComponent(); 93 94 JLabel delimitorLabel = new JLabel("Select the Delimitor:"); 95 GuiHelper.addToGridBag(delimitorLabel, _panel, 0, 0); 96 96 97 JRadioButton commaButton = GuiHelper.createRadio("Use Comma [,]", 97 98 delimitorGroup).toComponent(); … … 99 100 commaButton.setSelected(true); 100 101 commaButton.addActionListener(this); 101 addToPanel(commaButton, 10, 35, 150, 20);102 GuiHelper.addToGridBag(commaButton, _panel, 0, 1); 102 103 103 104 JRadioButton semiColonButton = GuiHelper.createRadio( … … 105 106 semiColonButton.setActionCommand(SEMI_COLON_ACTION_CMD); 106 107 semiColonButton.addActionListener(this); 107 addToPanel(semiColonButton, 10, 60, 150, 20); 108 109 _tabButton = GuiHelper.createRadio("Use Tab [ ]", delimitorGroup) 110 .toComponent(); 111 _tabButton.setActionCommand(TAB_ACTION_CMD); 112 _tabButton.addActionListener(this); 113 addToPanel(_tabButton, 10, 85, 150, 20); 114 115 delimitorGroup.add(_tabButton); 116 117 JLabel quotationLbl = new JLabel("Select the Quotation type:"); 108 GuiHelper.addToGridBag(semiColonButton, _panel, 0, 2); 109 110 JRadioButton tabButton = GuiHelper.createRadio("Use Tab [ ]", 111 delimitorGroup).toComponent(); 112 tabButton.setActionCommand(TAB_ACTION_CMD); 113 tabButton.addActionListener(this); 114 if (DataContextSelection.EXTENSION_TAB_SEPARATED.equals(_fileExtension)) { 115 tabButton.setSelected(true); 116 _curSeparator = TAB_ACTION_CMD.charAt(0); 117 } 118 GuiHelper.addToGridBag(tabButton, _panel, 0, 3); 119 120 delimitorGroup.add(tabButton); 121 122 JLabel quotationLabel = new JLabel("Select the Quotation type:"); 123 GuiHelper.addToGridBag(quotationLabel, _panel, 1, 0); 118 124 119 125 ButtonGroup quoteGroup = new ButtonGroup(); 120 addToPanel(quotationLbl, 200, 5, 200, 20); 121 JRadioButton doubleButton = GuiHelper.createRadio( 126 JRadioButton doubleQuoteButton = GuiHelper.createRadio( 122 127 "Use Double Quote [\"sample text\"]", quoteGroup).toComponent(); 123 doubleButton.setActionCommand(DOUBLE_QUOTE_ACTION_CMD); 124 doubleButton.setSelected(true); 125 doubleButton.addActionListener(this); 126 addToPanel(doubleButton, 200, 35, 200, 20); 127 JRadioButton singleButton = GuiHelper.createRadio( 128 doubleQuoteButton.setActionCommand(DOUBLE_QUOTE_ACTION_CMD); 129 doubleQuoteButton.setSelected(true); 130 doubleQuoteButton.addActionListener(this); 131 GuiHelper.addToGridBag(doubleQuoteButton, _panel, 1, 1); 132 133 JRadioButton singleQuoteButton = GuiHelper.createRadio( 128 134 "Use Single Quote ['sample text']", quoteGroup).toComponent(); 129 single Button.setActionCommand(SINGLE_QUOTE_ACTION_CMD);130 single Button.addActionListener(this);131 addToPanel(singleButton, 200, 60, 200, 20);135 singleQuoteButton.setActionCommand(SINGLE_QUOTE_ACTION_CMD); 136 singleQuoteButton.addActionListener(this); 137 GuiHelper.addToGridBag(singleQuoteButton, _panel, 1, 2); 132 138 133 139 _sampleText = new JTextField("Sample Text"); 134 140 _sampleText.setText("\"sample text1\", \"sample text2\", ..."); 135 141 _sampleText.setEnabled(false); 136 addToPanel(_sampleText, 10, 115, 400, 20);142 GuiHelper.addToGridBag(_sampleText, _panel, 0, 10, 2, 1); 137 143 138 144 JLabel tableHeading = new JLabel("Preview Data:"); 139 addToPanel(tableHeading, 10, 145, 200, 20); 140 141 _table = new DataTable(new DataSet(new ArrayList<Row>(0))); 145 GuiHelper.addToGridBag(tableHeading, _panel, 0, 11, 2, 1); 146 147 ArrayList<Row> initialData = new ArrayList<Row>(PREVIEW_ROWS); 148 SelectItem[] selectItems = new SelectItem[] { new SelectItem( 149 new Column("")) }; 150 for (int i = 0; i < PREVIEW_ROWS; i++) { 151 initialData.add(new Row(selectItems, new Object[] { "" })); 152 } 153 154 _table = new DataTable(new DataSet(initialData)); 142 155 _table.setName("previewTable"); 143 156 _tablePanel = _table.toPanel(); 144 _tablePanel.setBorder(new LineBorder(Color.GRAY, 1)); 145 _tablePanel.setLocation(10, 170); 146 _dataConfigurationPanel.add(_tablePanel); 147 // addToPanel(tablePanel, 10, 150, 580, 108); 148 return _dataConfigurationPanel; 149 } 150 151 private void addToPanel(Component c, int xPos, int yPos, int width, 152 int height) { 153 c.setLocation(xPos, yPos); 154 c.setSize(width, height); 155 _dataConfigurationPanel.add(c); 157 GuiHelper.addToGridBag(_tablePanel, _panel, 0, 12, 2, 1); 158 159 GridBagLayout layout = (GridBagLayout) _panel.getLayout(); 160 layout.columnWidths = new int[] { 240, 240 }; 161 162 return _panel; 156 163 } 157 164 … … 180 187 Query q = new Query(); 181 188 q.from(table).select(table.getColumns()); 182 q.setMaxRows( 5);189 q.setMaxRows(PREVIEW_ROWS); 183 190 184 191 _table.updateTable(dataContext.executeQuery(q)); 185 _tablePanel.setSize(_table.getPanelPreferredSize());186 192 } 187 193 -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/panels/TableProfileResultsPanel.java
r739 r751 164 164 MatrixTable matrixTable = new MatrixTable(matrix, 165 165 dataContext); 166 taskPane.add(new JScrollPane(matrixTable.toPanel(), 167 JScrollPane.VERTICAL_SCROLLBAR_NEVER, 168 JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)); 166 taskPane.add(matrixTable.toPanel()); 169 167 taskPaneContainer.add(taskPane); 170 168 } -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/panels/TableValidationRuleResultsPanel.java
r739 r751 170 170 evaluatedColumnIndexes)); 171 171 172 taskPane.add(new JScrollPane(dataTable.toPanel(), 173 JScrollPane.VERTICAL_SCROLLBAR_NEVER, 174 JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)); 172 taskPane.add(dataTable.toPanel()); 175 173 } 176 174 } -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/website/RegexSwapDialog.java
r744 r751 73 73 74 74 JSplitPane rightPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 75 new JScrollPane(regexSelectionTablePanel), regexDetailsPanel);75 regexSelectionTablePanel, regexDetailsPanel); 76 76 rightPane.setDividerLocation(170); 77 77 JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/widgets/DataCleanerTable.java
r723 r751 33 33 import javax.swing.JPanel; 34 34 import javax.swing.JPopupMenu; 35 import javax.swing.JScrollPane; 35 36 import javax.swing.JTable; 36 37 import javax.swing.table.DefaultTableModel; … … 41 42 import org.jdesktop.swingx.JXTable; 42 43 43 import dk.eobjects.datacleaner.gui.GuiBuilder;44 44 import dk.eobjects.datacleaner.gui.GuiHelper; 45 45 import dk.eobjects.datacleaner.profiler.MatrixValue; … … 110 110 public JPanel toPanel() { 111 111 if (_panel == null) { 112 GuiBuilder<JPanel> guiBuilder = GuiHelper.createPanel() 113 .applyBorderLayout(); 114 Dimension panelPreferredSize = getPanelPreferredSize(); 115 guiBuilder.applySize(panelPreferredSize); 116 _panel = guiBuilder.toComponent(); 112 _panel = GuiHelper.createPanel() 113 .applyBorderLayout().toComponent(); 117 114 _panel.add(getTableHeader(), BorderLayout.NORTH); 118 _panel.add(this, BorderLayout.CENTER); 115 _panel.add(new JScrollPane(this), BorderLayout.CENTER); 116 _panel.setPreferredSize(getPanelPreferredSize()); 119 117 } 120 118 return _panel; … … 127 125 Dimension headerSize = getTableHeader().getPreferredSize(); 128 126 d.height = headerSize.height + tableSize.height; 127 128 // Adding a 20 pixel buffer for horisontal scroll bars 129 // (Ticket #272) 130 d.height = d.height + 20; 129 131 return d; 130 132 } -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/windows/DataSetWindow.java
r604 r751 21 21 22 22 import javax.swing.ImageIcon; 23 import javax.swing.JScrollPane;24 23 25 24 import dk.eobjects.datacleaner.gui.GuiHelper; … … 45 44 46 45 _panel.setLayout(new BorderLayout()); 47 JScrollPane scrollPane = new JScrollPane(_dataTable.toPanel()); 48 _panel.add(scrollPane, BorderLayout.CENTER); 46 _panel.add(_dataTable.toPanel(), BorderLayout.CENTER); 49 47 50 48 Dimension tableSize = _dataTable.getPreferredSize(); -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/windows/PreviewDataWindow.java
r604 r751 21 21 22 22 import javax.swing.ImageIcon; 23 import javax.swing.JScrollPane;24 23 25 24 import dk.eobjects.datacleaner.gui.GuiHelper; … … 53 52 _panel.setLayout(new BorderLayout()); 54 53 DataTable dataTable = new DataTable(data); 55 JScrollPane scrollPane = new JScrollPane(dataTable.toPanel()); 56 _panel.add(scrollPane, BorderLayout.CENTER); 54 _panel.add(dataTable.toPanel(), BorderLayout.CENTER); 57 55 58 56 Dimension tableSize = dataTable.getPreferredSize(); -
DataCleaner/trunk/DataCleaner-gui/src/main/java/dk/eobjects/datacleaner/gui/windows/ProfilerWindow.java
r739 r751 194 194 columnSelectionPanel); 195 195 _tabbedPane.addTab("Metadata", GuiHelper 196 .getImageIcon("images/tab_metadata.png"), new JScrollPane( 197 metadataPanel)); 196 .getImageIcon("images/tab_metadata.png"), metadataPanel); 198 197 _tabbedPane.setUnclosableTab(0); 199 198 _tabbedPane.setUnclosableTab(1);
Note: See TracChangeset
for help on using the changeset viewer.
