Browse Source

REPORT-107973 修改选中、已编辑单元格的背景色

newui
Leo.Qin 12 months ago
parent
commit
87182803b3
  1. 4
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  2. 11
      designer-realize/src/main/java/com/fr/grid/GridColumnUI.java
  3. 9
      designer-realize/src/main/java/com/fr/grid/GridRowUI.java

4
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -1173,7 +1173,9 @@ North.coverPane.radius = 8
Center.OuterShadowColor = #F2F4F8
Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor = #F8F9FC
Center.GridColumnRowColor=#e8e8e9
Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%)
Center.GridColumnRowEditedColor=#e9ecf1
Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10
Center.arc=10

11
designer-realize/src/main/java/com/fr/grid/GridColumnUI.java

@ -31,7 +31,10 @@ import java.awt.geom.Rectangle2D;
* @since 2012-3-22下午5:51:10
*/
public class GridColumnUI extends ComponentUI {
protected Color withoutDetailsBackground = UIManager.getColor("Center.GridColumnRowColor");
protected Color backgroundColor = UIManager.getColor("Center.GridColumnRowColor");
protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor");
protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor");
private int resolution ;
public GridColumnUI(int resolution){
@ -74,8 +77,8 @@ public class GridColumnUI extends ComponentUI {
columnLeftWidth = columnWidthList.getRangeValue(horizontalBeginValue, columnCount).toPixD(resolution);
}
columnLeftWidth = Math.min(verticalLineWidth, columnLeftWidth);
if (gridColumn.getBackground() != null) {
g2d.setPaint(this.withoutDetailsBackground);
if (editedBackground != null) {
g2d.setPaint(editedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, columnLeftWidth, size.getHeight()));
}
// draw left border line.
@ -114,7 +117,7 @@ public class GridColumnUI extends ComponentUI {
Selection sel = reportPane.getSelection();
int[] selectedColumn = sel.getSelectedColumns();
if (IntList.asList(selectedColumn).contain(i)) {
g2d.setColor(gridColumn.getSelectedBackground());
g2d.setColor(selectedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(tmpWidth1 + 1, 0, tmpIncreaseWidth - 1, size.height));
isSelectedBounds = true;
} else {

9
designer-realize/src/main/java/com/fr/grid/GridRowUI.java

@ -32,6 +32,9 @@ import java.awt.geom.Rectangle2D;
*/
public class GridRowUI extends ComponentUI {
private Color detailsBackground = UIManager.getColor("Center.GridColumnRowColor");
protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor");
protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor");
private int resolution ;
GridRowUI(int resolution){
@ -74,8 +77,8 @@ public class GridRowUI extends ComponentUI {
rowTopHeight = rowHeightList.getRangeValue(verticalBeginValue, rowCount).toPixD(resolution);
}
rowTopHeight = Math.min(horizontalLineHeight, rowTopHeight);
if (gridRow.getBackground() != null) {
g2d.setPaint(this.detailsBackground);
if (editedBackground != null) {
g2d.setPaint(editedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, size.getWidth(), rowTopHeight));
}
// draw top border line.
@ -110,7 +113,7 @@ public class GridRowUI extends ComponentUI {
Selection sel = reportPane.getSelection();
int[] selectedRows = sel.getSelectedRows();
if (IntList.asList(selectedRows).contain(i)) {
g2d.setPaint(gridRow.getSelectedBackground());
g2d.setPaint(selectedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, tmpHeight1 + 1, size.width, tmpIncreaseHeight - 1));
isSelectedBounds = true;
} else {

Loading…
Cancel
Save