|
|
|
@ -19,6 +19,7 @@ import com.fr.design.gui.icombobox.LineComboBox;
|
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.gui.style.BackgroundNoImagePane; |
|
|
|
|
import com.fr.design.gui.style.BackgroundSpecialPane; |
|
|
|
|
import com.fr.design.gui.style.FRFontPane; |
|
|
|
@ -57,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(); |
|
|
|
|
|
|
|
|
@ -67,7 +69,8 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
private UIComboBox borderStyleCombo; |
|
|
|
|
//边框粗细
|
|
|
|
|
private LineComboBox currentLineCombo; |
|
|
|
|
|
|
|
|
|
//边框圆角
|
|
|
|
|
private UISpinner borderCornerSpinner; |
|
|
|
|
//边框颜色
|
|
|
|
|
private UIColorButton currentLineColorPane; |
|
|
|
|
//主体背景
|
|
|
|
@ -136,7 +139,17 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
this.currentLineCombo = currentLineCombo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public UIColorButton getCurrentLineColorPane() { |
|
|
|
|
|
|
|
|
|
public UISpinner getBorderCornerSpinner() { |
|
|
|
|
return borderCornerSpinner; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setBorderCornerSpinner(UISpinner borderCornerSpinner) { |
|
|
|
|
this.borderCornerSpinner = borderCornerSpinner; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UIColorButton getCurrentLineColorPane() { |
|
|
|
|
return currentLineColorPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -337,6 +350,7 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
this.borderStyleCombo = new UIComboBox(BORDER_STYLE); |
|
|
|
|
this.currentLineCombo = new LineComboBox(BORDER_LINE_STYLE_ARRAY); |
|
|
|
|
this.currentLineColorPane = new UIColorButton(null); |
|
|
|
|
this.borderCornerSpinner = new UISpinner(0,1000,1,0); |
|
|
|
|
currentLineColorPane.setUI(getButtonUI(currentLineColorPane)); |
|
|
|
|
currentLineColorPane.set4ToolbarButton(); |
|
|
|
|
currentLineColorPane.setPreferredSize(new Dimension(20,20)); |
|
|
|
@ -349,13 +363,14 @@ 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}, |
|
|
|
|
{new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Render_Style")), borderStyleCombo}, |
|
|
|
|
{new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Border_Line")), currentLineCombo}, |
|
|
|
|
{new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Border_Color")), buttonPane}, |
|
|
|
|
{new UILabel(Inter.getLocText("plugin-ChartF_Radius")+":"),borderCornerSpinner}, |
|
|
|
|
{new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Body_Background")), backgroundPane}, |
|
|
|
|
{new UILabel(""),new UILabel(Inter.getLocText("FR-Designer-Widget-Style_Alpha"))}, |
|
|
|
|
{new UILabel(""),transparencyPane}, |
|
|
|
@ -373,6 +388,7 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
protected JPanel initBodyRightTopPane(){ |
|
|
|
|
this.borderTypeCombo = new UIComboBox(BORDER_TYPE); |
|
|
|
|
this.borderStyleCombo = new UIComboBox(BORDER_STYLE); |
|
|
|
|
this.borderCornerSpinner = new UISpinner(0,1000,1,0); |
|
|
|
|
this.currentLineCombo = new LineComboBox(BORDER_LINE_STYLE_ARRAY); |
|
|
|
|
this.currentLineColorPane = new UIColorButton(null); |
|
|
|
|
|
|
|
|
@ -490,11 +506,11 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
LayoutBorderStyle style = new LayoutBorderStyle(); |
|
|
|
|
style.setType(borderTypeCombo.getSelectedIndex()); |
|
|
|
|
style.setBorderStyle(borderStyleCombo.getSelectedIndex()); |
|
|
|
|
style.setBorderRadius((int)borderCornerSpinner.getValue()); |
|
|
|
|
style.setBorder(currentLineCombo.getSelectedLineStyle()); |
|
|
|
|
style.setColor(currentLineColorPane.getColor()); |
|
|
|
|
style.setBackground(backgroundPane.update()); |
|
|
|
|
style.setAlpha((float)(numberDragPane.updateBean()/maxNumber)); |
|
|
|
|
|
|
|
|
|
WidgetTitle title = style.getTitle() == null ? new WidgetTitle() : style.getTitle(); |
|
|
|
|
title.setTextObject(formulaPane.updateBean()); |
|
|
|
|
FRFont frFont = title.getFrFont(); |
|
|
|
@ -557,6 +573,13 @@ public class LayoutBorderPane extends BasicPane {
|
|
|
|
|
paintPreviewPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.borderCornerSpinner.setValue(borderStyle.getBorderRadius()); |
|
|
|
|
this.borderCornerSpinner.addChangeListener(new ChangeListener() { |
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
paintPreviewPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.currentLineCombo.setSelectedLineStyle(borderStyle.getBorder()); |
|
|
|
|
this.currentLineCombo.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
@ -751,9 +774,9 @@ 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()) { |
|
|
|
|
group.setSelected(RoundedBorder.getModel(), true); |
|
|
|
|
} else { |
|
|
|
|
} else if(style.getBorderRadius() != NO_RADIUS) { |
|
|
|
|
group.setSelected(RoundedBorder.getModel(), true); |
|
|
|
|
} else { |
|
|
|
|
group.setSelected(normalBorder.getModel(), true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -794,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(); |
|
|
|
|