Browse Source

Merge pull request #1241 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit 'da5c28534a23df820c77cd209cc6eb3c1c549a3f':
  REPORT-4604 设计器视觉修改 悬浮元素下拉框和超级链接下拉框视觉
  REPORT-4604 设计器视觉修改 缩放的JSpinner的UI改了下
  REPORT-4610 样式-金额线,数字框样式没有统一
  REPORT-4600 无法批量设置单元格属性样式
master
neil 7 years ago
parent
commit
6964993d8f
  1. 17
      designer/src/com/fr/design/present/CurrencyLinePane.java
  2. 5
      designer_base/src/com/fr/design/gui/imenu/UIMenuEastAttrItem.java
  3. 10
      designer_base/src/com/fr/design/gui/ispinner/UISpinnerUI.java
  4. 29
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  5. 2
      designer_base/src/com/fr/design/mainframe/JSliderPane.java

17
designer/src/com/fr/design/present/CurrencyLinePane.java

@ -6,6 +6,7 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -33,8 +34,8 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
private static final int VS_NUM = 4; private static final int VS_NUM = 4;
private static final int VG_NUM = 6; private static final int VG_NUM = 6;
private static final Dimension NORMAL_DIMENSION = new Dimension(155, 20); private static final Dimension NORMAL_DIMENSION = new Dimension(155, 20);
private UIBasicSpinner intPartSpinner; private UISpinner intPartSpinner;
private UIBasicSpinner deciPartSpinner; private UISpinner deciPartSpinner;
private UITextField textField; private UITextField textField;
private CurrencyLinePreviewPane CurrencyLinePreviewPane; private CurrencyLinePreviewPane CurrencyLinePreviewPane;
private int intPart = 9; private int intPart = 9;
@ -73,11 +74,11 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
protected void initComponents() { protected void initComponents() {
// 整数位选择 // 整数位选择
intPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(9, 1, 20, 1)); intPartSpinner = new UISpinner(1, 20, 1, 9);
intPartSpinner.setPreferredSize(NORMAL_DIMENSION); intPartSpinner.setPreferredSize(NORMAL_DIMENSION);
// 小数位选择 // 小数位选择
deciPartSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 10, 1)); deciPartSpinner = new UISpinner(1, 10, 1, 2);
deciPartSpinner.setPreferredSize(NORMAL_DIMENSION); deciPartSpinner.setPreferredSize(NORMAL_DIMENSION);
// 预览区域 // 预览区域
textField = new UITextField(10); textField = new UITextField(10);
@ -132,8 +133,8 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
*/ */
public CurrencyLineAttr update() { public CurrencyLineAttr update() {
CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); CurrencyLineAttr currencylineAttr = new CurrencyLineAttr();
currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); currencylineAttr.setintPart((int) this.intPartSpinner.getValue());
currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); currencylineAttr.setdeciPart((int) this.deciPartSpinner.getValue());
return currencylineAttr; return currencylineAttr;
} }
@ -225,8 +226,8 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
@Override @Override
public CurrencyLinePresent updateBean() { public CurrencyLinePresent updateBean() {
CurrencyLineAttr currencylineAttr = new CurrencyLineAttr(); CurrencyLineAttr currencylineAttr = new CurrencyLineAttr();
currencylineAttr.setintPart(((Integer) this.intPartSpinner.getValue()).intValue()); currencylineAttr.setintPart((int) this.intPartSpinner.getValue());
currencylineAttr.setdeciPart(((Integer) this.deciPartSpinner.getValue()).intValue()); currencylineAttr.setdeciPart((int) this.deciPartSpinner.getValue());
return new CurrencyLinePresent(currencylineAttr); return new CurrencyLinePresent(currencylineAttr);
} }

5
designer_base/src/com/fr/design/gui/imenu/UIMenuEastAttrItem.java

@ -62,7 +62,7 @@ public class UIMenuEastAttrItem extends JMenuItem {
if (menuItem.isOpaque()) { if (menuItem.isOpaque()) {
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 0); GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.POPUP_TITLE_BACKGROUND, 0);
} else { } else {
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.TOOLBARUI_BACKGROUND, 0); GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.TOOLBARUI_BACKGROUND, 0);
} }
@ -70,7 +70,7 @@ public class UIMenuEastAttrItem extends JMenuItem {
} }
else if (model.isArmed() || (menuItem instanceof JMenu && else if (model.isArmed() || (menuItem instanceof JMenu &&
model.isSelected())) { model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D)g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); GUIPaintUtils.fillPaint((Graphics2D)g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.POPUP_TITLE_BACKGROUND, 7);
g.setColor(oldColor); g.setColor(oldColor);
} }
} }
@ -95,7 +95,6 @@ public class UIMenuEastAttrItem extends JMenuItem {
fm.getAscent() - 1); fm.getAscent() - 1);
} }
} else { } else {
menuItem.setForeground(isArmed() ? Color.white : Color.black);
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text,
-1, 0, textRect.y + fm.getAscent()); -1, 0, textRect.y + fm.getAscent());
} }

10
designer_base/src/com/fr/design/gui/ispinner/UISpinnerUI.java

@ -5,7 +5,9 @@
package com.fr.design.gui.ispinner; package com.fr.design.gui.ispinner;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIButton;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
@ -42,8 +44,8 @@ public class UISpinnerUI extends BasicSpinnerUI {
} }
protected Component createPreviousButton() { protected Component createPreviousButton() {
JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.SOUTH)); // JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.SOUTH));
JButton b = new UIButton(UIConstants.ARROW_DOWN_ICON);
b.putClientProperty("isSpinnerButton", Boolean.TRUE); b.putClientProperty("isSpinnerButton", Boolean.TRUE);
b.setFocusable(false); b.setFocusable(false);
b.addActionListener(PREVIOUS_BUTTON_HANDLER); b.addActionListener(PREVIOUS_BUTTON_HANDLER);
@ -53,8 +55,8 @@ public class UISpinnerUI extends BasicSpinnerUI {
} }
protected Component createNextButton() { protected Component createNextButton() {
JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.NORTH)); // JButton b = new SpecialUIButton(new UISpinnerButtonUI(SwingConstants.NORTH));
JButton b = new UIButton(UIConstants.ARROW_UP_ICON);
b.putClientProperty("isSpinnerButton", Boolean.TRUE); b.putClientProperty("isSpinnerButton", Boolean.TRUE);
b.setFocusable(false); b.setFocusable(false);
b.addActionListener(NEXT_BUTTON_HANDLER); b.addActionListener(NEXT_BUTTON_HANDLER);

29
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -9,6 +9,8 @@ import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.icombobox.TextFontComboBox; import com.fr.design.gui.icombobox.TextFontComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
@ -34,7 +36,7 @@ import java.text.SimpleDateFormat;
* @author zhou * @author zhou
* @since 2012-5-24上午10:57:00 * @since 2012-5-24上午10:57:00
*/ */
public class FormatPane extends AbstractBasicStylePane { public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final long serialVersionUID = 724330854437726751L; private static final long serialVersionUID = 724330854437726751L;
private static final int LABLE_X = 4; private static final int LABLE_X = 4;
@ -61,7 +63,7 @@ public class FormatPane extends AbstractBasicStylePane {
private FRFontPane frFontPane; private FRFontPane frFontPane;
private boolean isRightFormate; private boolean isRightFormate;
private boolean isDate = false; private boolean isDate = false;
private boolean isFormat = false; private GlobalNameListener globalNameListener = null;
/** /**
* Constructor. * Constructor.
@ -87,13 +89,14 @@ public class FormatPane extends AbstractBasicStylePane {
UIComboBoxRenderer render = createComBoxRender(); UIComboBoxRenderer render = createComBoxRender();
typeComboBox.setRenderer(render); typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener); typeComboBox.addItemListener(itemListener);
typeComboBox.setGlobalName("typeComboBox");
contentPane.add(sampleLabel, BorderLayout.NORTH); contentPane.add(sampleLabel, BorderLayout.NORTH);
txtCenterPane = new JPanel(new BorderLayout()); txtCenterPane = new JPanel(new BorderLayout());
textField = new TextFontComboBox(); textField = new TextFontComboBox();
// textField.setItemArray(FormatField.getInstance().getFormatArray(getFormatContents()));
textField.addItemListener(textFieldItemListener); textField.addItemListener(textFieldItemListener);
textField.setEditable(true); textField.setEditable(true);
textField.setGlobalName("textField");
txtCenterPane.add(textField, BorderLayout.NORTH); txtCenterPane.add(textField, BorderLayout.NORTH);
contentPane.add(txtCenterPane, BorderLayout.CENTER); contentPane.add(txtCenterPane, BorderLayout.CENTER);
@ -333,7 +336,6 @@ public class FormatPane extends AbstractBasicStylePane {
centerPane.setPreferredSize(new Dimension(270, 65)); centerPane.setPreferredSize(new Dimension(270, 65));
cardLayout.show(centerPane, "show"); cardLayout.show(centerPane, "show");
} }
isFormat = true;
} }
} }
@ -343,7 +345,6 @@ public class FormatPane extends AbstractBasicStylePane {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
isFormat = true;
refreshPreviewLabel(); refreshPreviewLabel();
} }
} }
@ -355,7 +356,6 @@ public class FormatPane extends AbstractBasicStylePane {
*/ */
public void populateBean(Style style) { public void populateBean(Style style) {
this.populateBean(style.getFormat()); this.populateBean(style.getFormat());
isFormat = false;
this.frFontPane.populateBean(style.getFRFont()); this.frFontPane.populateBean(style.getFRFont());
} }
@ -364,8 +364,7 @@ public class FormatPane extends AbstractBasicStylePane {
* update * update
*/ */
public Style update(Style style) { public Style update(Style style) {
if (isFormat) { if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "textField") || ComparatorUtils.equals(globalNameListener.getGlobalName(), "typeComboBox")) {
isFormat = false;
return style.deriveFormat(this.update()); return style.deriveFormat(this.update());
} else { } else {
return style.deriveFRFont(this.frFontPane.update(style.getFRFont())); return style.deriveFRFont(this.frFontPane.update(style.getFRFont()));
@ -424,4 +423,18 @@ public class FormatPane extends AbstractBasicStylePane {
} }
} }
@Override
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
}
@Override
public boolean shouldResponseNameListener() {
return false;
}
@Override
public void setGlobalName(String name) {
}
} }

2
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -8,6 +8,7 @@ import com.fr.design.gui.ibutton.UISliderButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinnerUI;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -132,6 +133,7 @@ public class JSliderPane extends JPanel {
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
}; };
showValSpinner.setUI(new UISpinnerUI());
showValSpinner.setEnabled(true); showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener); showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));

Loading…
Cancel
Save