|
|
|
@ -464,8 +464,13 @@ public abstract class BorderUtils {
|
|
|
|
|
* changed, need to support undo/redo |
|
|
|
|
*/ |
|
|
|
|
public static boolean update(ElementCasePane reportPane, CellBorderStyle newCellBorderStyle) { |
|
|
|
|
Object[] selectionCellBorderObjects = createCellBorderObject(reportPane); |
|
|
|
|
return update(reportPane, selectionCellBorderObjects, newCellBorderStyle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean update(ElementCasePane reportPane, Object[] selectionCellBorderObjects, CellBorderStyle newCellBorderStyle) { |
|
|
|
|
boolean isBorderColorStyleChanged = false; |
|
|
|
|
Object[] fourObjectArray = createCellBorderObject(reportPane); |
|
|
|
|
Object[] fourObjectArray = selectionCellBorderObjects; |
|
|
|
|
if (fourObjectArray == null || fourObjectArray.length < NUMBER) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -526,44 +531,60 @@ public abstract class BorderUtils {
|
|
|
|
|
if (cellBorderStyle.getLeftStyle() != newCellBorderStyle.getLeftStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getLeftColor(), newCellBorderStyle.getLeftColor())) { |
|
|
|
|
style = style.deriveBorderLeft(newCellBorderStyle.getLeftStyle(), newCellBorderStyle.getLeftColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderLeft(cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) { |
|
|
|
|
style = style.deriveBorderLeft(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderLeft(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (tmpCellElement.getColumn() + tmpCellElement.getColumnSpan() == column + columnSpan) { |
|
|
|
|
if (cellBorderStyle.getRightStyle() != newCellBorderStyle.getRightStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getRightColor(), newCellBorderStyle.getRightColor())) { |
|
|
|
|
style = style.deriveBorderRight(newCellBorderStyle.getRightStyle(), newCellBorderStyle.getRightColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderRight(cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) { |
|
|
|
|
style = style.deriveBorderRight(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderRight(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (tmpCellElement.getRow() == row) { |
|
|
|
|
if (cellBorderStyle.getTopStyle() != newCellBorderStyle.getTopStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getTopColor(), newCellBorderStyle.getTopColor())) { |
|
|
|
|
style = style.deriveBorderTop(newCellBorderStyle.getTopStyle(), newCellBorderStyle.getTopColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderTop(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) { |
|
|
|
|
style = style.deriveBorderTop(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderTop(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (tmpCellElement.getRow() + tmpCellElement.getRowSpan() == row + rowSpan) { |
|
|
|
|
if (cellBorderStyle.getBottomStyle() != newCellBorderStyle.getBottomStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getBottomColor(), newCellBorderStyle.getBottomColor())) { |
|
|
|
|
style = style.deriveBorderBottom(newCellBorderStyle.getBottomStyle(), newCellBorderStyle.getBottomColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderBottom(cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle() |
|
|
|
|
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) { |
|
|
|
|
style = style.deriveBorderBottom(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor()); |
|
|
|
|
} else { |
|
|
|
|
style = style.deriveBorderBottom(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return style; |
|
|
|
|