Browse Source

将原先的是否圆角属性换成圆角半径

master
kerry 8 years ago
parent
commit
cfb08a1d0a
  1. 8
      designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java
  2. 12
      designer_form/src/com/fr/design/gui/xpane/LayoutBorderPane.java

8
designer_form/src/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java

@ -27,8 +27,6 @@ import com.fr.stable.StringUtils;
*/ */
public class XBorderStyleWidgetCreator extends XWidgetCreator{ public class XBorderStyleWidgetCreator extends XWidgetCreator{
private int noneSize = 0;
protected static final Dimension BORDER_PREFERRED_SIZE = new Dimension(250, 150); protected static final Dimension BORDER_PREFERRED_SIZE = new Dimension(250, 150);
public XBorderStyleWidgetCreator(Widget widget, Dimension initSize) { public XBorderStyleWidgetCreator(Widget widget, Dimension initSize) {
@ -58,7 +56,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
protected void initBorderStyle() { protected void initBorderStyle() {
LayoutBorderStyle style = toData().getBorderStyle(); LayoutBorderStyle style = toData().getBorderStyle();
if (style != null && style.getBorder() != Constants.LINE_NONE) { if (style != null && style.getBorder() != Constants.LINE_NONE) {
this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.isCorner() ? style.getBorderRadius() : noneSize)); this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.getBorderRadius()));
} else { } else {
this.setBorder(DEFALUTBORDER); this.setBorder(DEFALUTBORDER);
} }
@ -108,8 +106,8 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
//标题的边框样式目前是取对应的控件的边框样式 //标题的边框样式目前是取对应的控件的边框样式
title.setBorder(style.getBorder()); title.setBorder(style.getBorder());
title.setColor(style.getColor()); title.setColor(style.getColor());
title.setCorner(style.isCorner()); // title.setCorner(style.isCorner());
WidgetTitle wTitle = style.getTitle(); WidgetTitle wTitle = style.getTitle();
//设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个 //设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个
title.setWidgetName(wTitle.TITLE_NAME_INDEX + this.toData().getWidgetName()); title.setWidgetName(wTitle.TITLE_NAME_INDEX + this.toData().getWidgetName());

12
designer_form/src/com/fr/design/gui/xpane/LayoutBorderPane.java

@ -58,6 +58,7 @@ public class LayoutBorderPane extends BasicPane {
private static final int RIGHTANGLE_BORDERS = 1; private static final int RIGHTANGLE_BORDERS = 1;
private static final int ROUNDED_BORDERS = 2; private static final int ROUNDED_BORDERS = 2;
private static final int MAX_WIDTH = 220; private static final int MAX_WIDTH = 220;
private static final int NO_RADIUS = 0;
private LayoutBorderStyle borderStyle = new LayoutBorderStyle(); private LayoutBorderStyle borderStyle = new LayoutBorderStyle();
@ -362,7 +363,7 @@ public class LayoutBorderPane extends BasicPane {
transparencyPane.add(new UILabel(" %"), BorderLayout.EAST); transparencyPane.add(new UILabel(" %"), BorderLayout.EAST);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p,p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p,p,p,p};
double[] columnSize = { p, MAX_WIDTH}; double[] columnSize = { p, MAX_WIDTH};
JPanel rightTopContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ JPanel rightTopContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Frame_Style")), borderTypeCombo}, {new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Frame_Style")), borderTypeCombo},
@ -510,7 +511,6 @@ public class LayoutBorderPane extends BasicPane {
style.setColor(currentLineColorPane.getColor()); style.setColor(currentLineColorPane.getColor());
style.setBackground(backgroundPane.update()); style.setBackground(backgroundPane.update());
style.setAlpha((float)(numberDragPane.updateBean()/maxNumber)); style.setAlpha((float)(numberDragPane.updateBean()/maxNumber));
style.setCorner(true);
WidgetTitle title = style.getTitle() == null ? new WidgetTitle() : style.getTitle(); WidgetTitle title = style.getTitle() == null ? new WidgetTitle() : style.getTitle();
title.setTextObject(formulaPane.updateBean()); title.setTextObject(formulaPane.updateBean());
FRFont frFont = title.getFrFont(); FRFont frFont = title.getFrFont();
@ -774,9 +774,9 @@ public class LayoutBorderPane extends BasicPane {
public void populate(LayoutBorderStyle style) { public void populate(LayoutBorderStyle style) {
if(style.getBorder() == Constants.LINE_NONE) { if(style.getBorder() == Constants.LINE_NONE) {
group.setSelected(noBorder.getModel(), true); group.setSelected(noBorder.getModel(), true);
} else if(style.isCorner()) { } else if(style.getBorderRadius() != NO_RADIUS) {
group.setSelected(RoundedBorder.getModel(), true); group.setSelected(RoundedBorder.getModel(), true);
} else { } else {
group.setSelected(normalBorder.getModel(), true); group.setSelected(normalBorder.getModel(), true);
} }
} }
@ -817,7 +817,7 @@ public class LayoutBorderPane extends BasicPane {
} else { } else {
borderStyle.setColor(currentLineColorPane.getColor()); borderStyle.setColor(currentLineColorPane.getColor());
borderStyle.setBorder(currentLineCombo.getSelectedLineStyle()); borderStyle.setBorder(currentLineCombo.getSelectedLineStyle());
borderStyle.setCorner(border != RIGHTANGLE_BORDERS); borderStyle.setBorderRadius((int)borderCornerSpinner.getValue());
} }
layoutBorderPreviewPane.repaint(); layoutBorderPreviewPane.repaint();

Loading…
Cancel
Save