-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Column refactoring enabled, row background behaviour updated, minor r…
…efactoring, added req & resp in Add New Sitemap Issue
- Loading branch information
Showing
9 changed files
with
687 additions
and
349 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package hvqzao.flow.ui; | ||
|
||
import static hvqzao.flow.ui.Helper.cellBackground; | ||
import java.awt.Component; | ||
import java.awt.GridBagLayout; | ||
import java.awt.Insets; | ||
import javax.swing.JCheckBox; | ||
import javax.swing.JLabel; | ||
import javax.swing.JTable; | ||
import javax.swing.SwingUtilities; | ||
import javax.swing.table.TableCellRenderer; | ||
|
||
public class BooleanTableCellRenderer extends JCheckBox implements TableCellRenderer { | ||
|
||
public BooleanTableCellRenderer() { | ||
super(); | ||
initialize(); | ||
} | ||
|
||
private void initialize() { | ||
setOpaque(true); | ||
putClientProperty("JComponent.sizeVariant", "small"); | ||
SwingUtilities.updateComponentTreeUI(this); | ||
setLayout(new GridBagLayout()); | ||
setMargin(new Insets(0, 0, 0, 0)); | ||
setHorizontalAlignment(JLabel.CENTER); | ||
setBorderPainted(true); | ||
} | ||
|
||
@Override | ||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { | ||
//int modelRow = table.convertRowIndexToModel(row); | ||
setBackground(cellBackground(table.getRowCount(), row, isSelected)); | ||
if (value instanceof Boolean) { | ||
setSelected((Boolean) value); | ||
} | ||
return this; | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/hvqzao/flow/DialogWrapper.java → src/hvqzao/flow/ui/DialogWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package hvqzao.flow; | ||
package hvqzao.flow.ui; | ||
|
||
import javax.swing.JButton; | ||
import javax.swing.JScrollPane; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package hvqzao.flow.ui; | ||
|
||
import static hvqzao.flow.FlowExtension.getSortOrder; | ||
import java.awt.Color; | ||
|
||
public class Helper { | ||
|
||
private static final Color COLOR_HIGHLIGHT = new Color(255, 206, 130); | ||
private static final Color COLOR_DARKGRAY = new Color(240, 240, 240); | ||
private static final Color COLOR_LIGHTGRAY = new Color(250, 250, 250); | ||
|
||
public static Color cellBackground(int rowCount, int row, boolean isSelected) { | ||
int r = row; | ||
if (getSortOrder() < 1) { | ||
r = rowCount - row; | ||
} | ||
if (isSelected) { | ||
return COLOR_HIGHLIGHT; | ||
} else if (r % 20 == 1) { | ||
return COLOR_DARKGRAY; // new Color(225, 225, 225); | ||
} else if (r % 2 == 1) { | ||
return COLOR_LIGHTGRAY; // new Color(240, 240, 240); | ||
} else { | ||
return Color.WHITE; | ||
} | ||
} | ||
} |