diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index dd1e885bf..cd969de4f 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -27,12 +27,26 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; +import java.util.HashSet; /** * @author zhou * @since 2012-5-28下午6:22:04 */ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { + + public static final HashSet BORDERSET = new HashSet() {{ + add("currentLineCombo"); + add("currentLineColorPane"); + add("outerToggleButton"); + add("topToggleButton"); + add("leftToggleButton"); + add("bottomToggleButton"); + add("rightToggleButton"); + add("innerToggleButton"); + add("horizontalToggleButton"); + add("verticalToggleButton"); + }}; private boolean insideMode = false; private UIToggleButton topToggleButton; @@ -197,16 +211,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse CellBorderStyle cellBorderStyle = this.update(); - if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineCombo") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineColorPane") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "outerToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "topToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "leftToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "bottomToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "rightToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "innerToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "horizontalToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "verticalToggleButton")) { + if (BORDERSET.contains(globalNameListener.getGlobalName())) { style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); } else {