Browse Source

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

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

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

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

8
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 ROUNDED_BORDERS = 2;
private static final int MAX_WIDTH = 220;
private static final int NO_RADIUS = 0;
private LayoutBorderStyle borderStyle = new LayoutBorderStyle();
@ -362,7 +363,7 @@ public class LayoutBorderPane extends BasicPane {
transparencyPane.add(new UILabel(" %"), BorderLayout.EAST);
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};
JPanel rightTopContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{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.setBackground(backgroundPane.update());
style.setAlpha((float)(numberDragPane.updateBean()/maxNumber));
style.setCorner(true);
WidgetTitle title = style.getTitle() == null ? new WidgetTitle() : style.getTitle();
title.setTextObject(formulaPane.updateBean());
FRFont frFont = title.getFrFont();
@ -774,7 +774,7 @@ public class LayoutBorderPane extends BasicPane {
public void populate(LayoutBorderStyle style) {
if(style.getBorder() == Constants.LINE_NONE) {
group.setSelected(noBorder.getModel(), true);
} else if(style.isCorner()) {
} else if(style.getBorderRadius() != NO_RADIUS) {
group.setSelected(RoundedBorder.getModel(), true);
} else {
group.setSelected(normalBorder.getModel(), true);
@ -817,7 +817,7 @@ public class LayoutBorderPane extends BasicPane {
} else {
borderStyle.setColor(currentLineColorPane.getColor());
borderStyle.setBorder(currentLineCombo.getSelectedLineStyle());
borderStyle.setCorner(border != RIGHTANGLE_BORDERS);
borderStyle.setBorderRadius((int)borderCornerSpinner.getValue());
}
layoutBorderPreviewPane.repaint();

Loading…
Cancel
Save