|
|
|
@ -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 { |
|
|
|
|