Browse Source

REPORT-46575【10.0.13冒烟】界面组件中硬编码的字体更改为统一UI字体

feature/big-screen
vito 4 years ago
parent
commit
233015a79a
  1. 22
      designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java
  2. 117
      designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java
  3. 7
      designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java
  4. 16
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java
  5. 5
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  6. 10
      designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java
  7. 45
      designer-form/src/main/java/com/fr/design/designer/creator/XButton.java
  8. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java
  9. 10
      designer-realize/src/main/java/com/fr/design/condition/FontPane.java
  10. 9
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  11. 12
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java
  12. 18
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  13. 5
      designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java
  14. 4
      designer-realize/src/main/java/com/fr/design/report/RichTextPane.java
  15. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java
  16. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java
  17. 4
      designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

22
designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java

@ -1,12 +1,14 @@
package com.fr.design.gui.date; package com.fr.design.gui.date;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.DesignUtils;
import javax.swing.text.AttributeSet; import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument; import javax.swing.text.PlainDocument;
import java.awt.*; import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
@ -21,7 +23,7 @@ public class CalendarNumberField extends UINumberField {
private static final int NUM_TEN = 10; private static final int NUM_TEN = 10;
public CalendarNumberField( double maxValue) { public CalendarNumberField(double maxValue) {
super(2, 0, 0, maxValue); super(2, 0, 0, maxValue);
this.setBorderPainted(false); this.setBorderPainted(false);
addFocusListener(new FocusAdapter() { addFocusListener(new FocusAdapter() {
@ -30,12 +32,12 @@ public class CalendarNumberField extends UINumberField {
setValue(getIntValue()); setValue(getIntValue());
} }
}); });
this.setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12)); this.setFont(DesignUtils.getDefaultGUIFont());
} }
public void setValue(int value) { public void setValue(int value) {
if (value < 0) { if (value < 0) {
value = (int)getMaxValue(); value = (int) getMaxValue();
} }
if (value > getMaxValue()) { if (value > getMaxValue()) {
value = 0; value = 0;
@ -43,7 +45,7 @@ public class CalendarNumberField extends UINumberField {
this.setText(getValueText(value)); this.setText(getValueText(value));
} }
public int getIntValue () { public int getIntValue() {
if (this.getText().length() == 0) { if (this.getText().length() == 0) {
return 0; return 0;
} }
@ -61,8 +63,7 @@ public class CalendarNumberField extends UINumberField {
} }
public void setFieldDocument() {
public void setFieldDocument(){
setDocument(new NumberDocument()); setDocument(new NumberDocument());
} }
@ -89,14 +90,15 @@ public class CalendarNumberField extends UINumberField {
super.insertString(offset, s, a); super.insertString(offset, s, a);
} }
private boolean isOverMaxOrMinValue( String strNew) { private boolean isOverMaxOrMinValue(String strNew) {
return (Double.parseDouble(strNew)<getMinValue() || Double.parseDouble(strNew)>getMaxValue()); return (Double.parseDouble(strNew) < getMinValue() || Double.parseDouble(strNew) > getMaxValue());
} }
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(24, 11); return new Dimension(24, 11);
} }
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }

117
designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java

@ -7,8 +7,8 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
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.utils.DesignUtils;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -45,8 +45,8 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class UICalendarPanel extends JPanel { public class UICalendarPanel extends JPanel {
private static final Font FONT_SONG = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12); private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12);
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"),0,12); private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12);
private static final int WEEKDAY_COUNT = 7; private static final int WEEKDAY_COUNT = 7;
private static final int TOTAL_DAYS_COUNT = 42; private static final int TOTAL_DAYS_COUNT = 42;
@ -108,13 +108,13 @@ public class UICalendarPanel extends JPanel {
} }
// << < yyyy/MM/dd > >> // << < yyyy/MM/dd > >>
private JPanel createNorthPane () { private JPanel createNorthPane() {
JPanel pNorth = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); JPanel pNorth = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
pNorth.setBackground(new Color(0xFFFFFF)); pNorth.setBackground(new Color(0xFFFFFF));
pNorth.setPreferredSize(new Dimension(1, 22)); pNorth.setPreferredSize(new Dimension(1, 22));
pNorth.add(Box.createHorizontalStrut(5)); pNorth.add(Box.createHorizontalStrut(5));
pNorth.add(createSkipButton(Calendar.YEAR, -1 , new Icon[] { pNorth.add(createSkipButton(Calendar.YEAR, -1, new Icon[]{
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_hover.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_click.png") BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_click.png")
@ -130,7 +130,7 @@ public class UICalendarPanel extends JPanel {
monthLabel = new UILabel("", UILabel.CENTER); monthLabel = new UILabel("", UILabel.CENTER);
monthLabel.setBackground(new Color(0xFFFFFF)); monthLabel.setBackground(new Color(0xFFFFFF));
monthLabel.setForeground(new Color(0x000000)); monthLabel.setForeground(new Color(0x000000));
monthLabel.setFont(FONT_SONG); monthLabel.setFont(FONT_UI);
pNorth.add(Box.createHorizontalGlue()); pNorth.add(Box.createHorizontalGlue());
pNorth.add(monthLabel); pNorth.add(monthLabel);
pNorth.add(Box.createHorizontalGlue()); pNorth.add(Box.createHorizontalGlue());
@ -144,7 +144,7 @@ public class UICalendarPanel extends JPanel {
monthPlus.setHorizontalAlignment(SwingConstants.RIGHT); monthPlus.setHorizontalAlignment(SwingConstants.RIGHT);
pNorth.add(monthPlus); pNorth.add(monthPlus);
pNorth.add(Box.createHorizontalStrut(11)); pNorth.add(Box.createHorizontalStrut(11));
pNorth.add(createSkipButton(Calendar.YEAR, 1 , new Icon[] { pNorth.add(createSkipButton(Calendar.YEAR, 1, new Icon[]{
BaseUtils.readIcon("/com/fr/design/images/calender/year_add.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_add.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/year_add_hover.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_add_hover.png"),
BaseUtils.readIcon("/com/fr/design/images/calender/year_add_click.png") BaseUtils.readIcon("/com/fr/design/images/calender/year_add_click.png")
@ -161,9 +161,9 @@ public class UICalendarPanel extends JPanel {
pWeeks.setPreferredSize(new Dimension(216, 22)); pWeeks.setPreferredSize(new Dimension(216, 22));
pWeeks.setBackground(new Color(0xFFFFFF)); pWeeks.setBackground(new Color(0xFFFFFF));
pWeeks.setOpaque(true); pWeeks.setOpaque(true);
String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), String[] strWeeks = new String[]{StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat")
}; };
for (int i = 1; i <= WEEKDAY_COUNT; i++) { for (int i = 1; i <= WEEKDAY_COUNT; i++) {
UILabel label = new UILabel(); UILabel label = new UILabel();
@ -197,32 +197,32 @@ public class UICalendarPanel extends JPanel {
return pCenter; return pCenter;
} }
private JPanel createSouthPane () { private JPanel createSouthPane() {
JPanel sPane = new JPanel(); JPanel sPane = new JPanel();
sPane.setPreferredSize(new Dimension(216, 30)); sPane.setPreferredSize(new Dimension(216, 30));
sPane.setBackground(Color.WHITE); sPane.setBackground(Color.WHITE);
sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6)); sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6));
UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":"); UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":");
timeLabel.setBorder(BorderFactory.createEmptyBorder(0,9,0,5)); timeLabel.setBorder(BorderFactory.createEmptyBorder(0, 9, 0, 5));
timeLabel.setFont(FONT_SONG); timeLabel.setFont(FONT_UI);
sPane.add(timeLabel); sPane.add(timeLabel);
hms = new HMSPane(); hms = new HMSPane();
sPane.add(hms); sPane.add(hms);
UILabel gap = new UILabel(); UILabel gap = new UILabel();
gap.setPreferredSize(new Dimension(26,1)); gap.setPreferredSize(new Dimension(26, 1));
sPane.add(gap); sPane.add(gap);
UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) { UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(32,18); return new Dimension(32, 18);
} }
public Insets getInsets() { public Insets getInsets() {
return new Insets(0, 0, 0, 0); return new Insets(0, 0, 0, 0);
} }
}; };
okButton.setFont(FONT_SONG); okButton.setFont(FONT_UI);
okButton.setVerticalAlignment(SwingConstants.CENTER); okButton.setVerticalAlignment(SwingConstants.CENTER);
okButton.addActionListener(new ActionListener() { okButton.addActionListener(new ActionListener() {
@ -248,11 +248,12 @@ public class UICalendarPanel extends JPanel {
/** /**
* 创建上一月,下一月,上一年,下一年"按钮" * 创建上一月,下一月,上一年,下一年"按钮"
*
* @param field int * @param field int
* @param amount int * @param amount int
* @return UILabel * @return UILabel
*/ */
protected UILabel createSkipButton(final int field, final int amount,final Icon[] icons) { protected UILabel createSkipButton(final int field, final int amount, final Icon[] icons) {
if (icons.length != 3) { if (icons.length != 3) {
return new UILabel(); return new UILabel();
} }
@ -311,7 +312,7 @@ public class UICalendarPanel extends JPanel {
gp.setBorder(null); gp.setBorder(null);
UIDayLabel label = new UIDayLabel(setupCalendar.getTime()); UIDayLabel label = new UIDayLabel(setupCalendar.getTime());
label.setHorizontalAlignment(SwingConstants.RIGHT); label.setHorizontalAlignment(SwingConstants.RIGHT);
label.setBorder(BorderFactory.createEmptyBorder(0,0,0,9)); label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 9));
label.addMouseListener(dayBttListener); label.addMouseListener(dayBttListener);
if ("1".equals(label.getText())) { if ("1".equals(label.getText())) {
isCurrentMonth = !isCurrentMonth; isCurrentMonth = !isCurrentMonth;
@ -328,7 +329,7 @@ public class UICalendarPanel extends JPanel {
days.setSelectedIndex(i); days.setSelectedIndex(i);
this.selectedDate = label.getDate(); this.selectedDate = label.getDate();
this.calendar.setTime(this.selectedDate); this.calendar.setTime(this.selectedDate);
}else { } else {
gp.add(label, BorderLayout.CENTER); gp.add(label, BorderLayout.CENTER);
days.add(gp); days.add(gp);
} }
@ -337,7 +338,7 @@ public class UICalendarPanel extends JPanel {
} }
public void updateHMS() { public void updateHMS() {
if (hms != null){ if (hms != null) {
hms.populate(this.calendar); hms.populate(this.calendar);
hms.validate(); hms.validate();
} }
@ -388,9 +389,9 @@ public class UICalendarPanel extends JPanel {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if (isEnabled()) { if (isEnabled()) {
UIDayLabel com = (UIDayLabel) e.getComponent(); UIDayLabel com = (UIDayLabel) e.getComponent();
GradientPane gp = (GradientPane)com.getParent(); GradientPane gp = (GradientPane) com.getParent();
if (days.selectedIndex != -1) { if (days.selectedIndex != -1) {
((GradientPane)days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); ((GradientPane) days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM));
} }
gp.setGradientBackground(new GradientBackground(new Color(0x097BD9), new Color(0x41A3EE), GradientBackground.TOP2BOTTOM)); gp.setGradientBackground(new GradientBackground(new Color(0x097BD9), new Color(0x41A3EE), GradientBackground.TOP2BOTTOM));
days.setSelectedIndex(gp.getIndex()); days.setSelectedIndex(gp.getIndex());
@ -413,7 +414,7 @@ public class UICalendarPanel extends JPanel {
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
if (isEnabled()) { if (isEnabled()) {
JComponent com = (JComponent) e.getComponent(); JComponent com = (JComponent) e.getComponent();
GradientPane gp = (GradientPane)com.getParent(); GradientPane gp = (GradientPane) com.getParent();
if (gp.getIndex() == days.selectedIndex) { if (gp.getIndex() == days.selectedIndex) {
return; return;
} }
@ -426,7 +427,7 @@ public class UICalendarPanel extends JPanel {
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
if (isEnabled()) { if (isEnabled()) {
JComponent com = (JComponent) e.getComponent(); JComponent com = (JComponent) e.getComponent();
GradientPane gp = (GradientPane)com.getParent(); GradientPane gp = (GradientPane) com.getParent();
if (gp.getIndex() != days.selectedIndex) { if (gp.getIndex() != days.selectedIndex) {
gp.setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); gp.setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM));
} }
@ -489,7 +490,7 @@ public class UICalendarPanel extends JPanel {
this.isGradientBackground = isGradientBackground; this.isGradientBackground = isGradientBackground;
} }
public void paint(Graphics g){ public void paint(Graphics g) {
super.paint(g); super.paint(g);
if (isGradientBackground && gradientBackground != null) { if (isGradientBackground && gradientBackground != null) {
gradientBackground.paint(g, new Rectangle(this.getWidth(), this.getHeight())); gradientBackground.paint(g, new Rectangle(this.getWidth(), this.getHeight()));
@ -509,7 +510,7 @@ public class UICalendarPanel extends JPanel {
this.index = i; this.index = i;
} }
public int getIndex () { public int getIndex() {
return this.index; return this.index;
} }
@ -530,12 +531,12 @@ public class UICalendarPanel extends JPanel {
public DayPane() { public DayPane() {
floateIndex = -1; floateIndex = -1;
selectedIndex = -1; selectedIndex = -1;
this.setLayout(new GridLayout(6,7,1,1)); this.setLayout(new GridLayout(6, 7, 1, 1));
this.setBackground(new Color(0xFFFFFF)); this.setBackground(new Color(0xFFFFFF));
this.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, new Color(0xDADADA))); this.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, new Color(0xDADADA)));
} }
public void paint (Graphics g) { public void paint(Graphics g) {
super.paint(g); super.paint(g);
int width = 31; int width = 31;
int height = 19; int height = 19;
@ -543,11 +544,11 @@ public class UICalendarPanel extends JPanel {
g.setColor(new Color(0xDADADA)); g.setColor(new Color(0xDADADA));
int start_x = 30; int start_x = 30;
int start_y = 19; int start_y = 19;
for (int i = 0; i < 6; i ++) { for (int i = 0; i < 6; i++) {
g.drawLine(start_x, 0, start_x, getHeight()); g.drawLine(start_x, 0, start_x, getHeight());
start_x += width; start_x += width;
} }
for (int i = 0; i < 5; i ++){ for (int i = 0; i < 5; i++) {
g.drawLine(0, start_y, getWidth(), start_y); g.drawLine(0, start_y, getWidth(), start_y);
start_y += height; start_y += height;
} }
@ -558,25 +559,25 @@ public class UICalendarPanel extends JPanel {
} }
if (selectedIndex > -1) { if (selectedIndex > -1) {
g.setColor(selectedColor); g.setColor(selectedColor);
paintChindPane(g,selectedIndex); paintChindPane(g, selectedIndex);
} }
g.setColor(oldColor); g.setColor(oldColor);
} }
private void paintChindPane(Graphics g, int index) { private void paintChindPane(Graphics g, int index) {
if (index%7 == 0 ) { if (index % 7 == 0) {
int y1 = index/7*19; int y1 = index / 7 * 19;
g.drawLine(0,y1,30,y1); g.drawLine(0, y1, 30, y1);
g.drawLine(0,y1 + 19, 30, y1 +19); g.drawLine(0, y1 + 19, 30, y1 + 19);
g.drawLine(30, y1, 30 ,y1 + 19); g.drawLine(30, y1, 30, y1 + 19);
}else if (index%7 == 6) { } else if (index % 7 == 6) {
int y1 = index/7*19; int y1 = index / 7 * 19;
g.drawLine(185,y1,216,y1); g.drawLine(185, y1, 216, y1);
g.drawLine(185,y1 + 19, 216, y1 +19); g.drawLine(185, y1 + 19, 216, y1 + 19);
g.drawLine(185, y1, 185 ,y1 + 19); g.drawLine(185, y1, 185, y1 + 19);
} else { } else {
int x1 = index%7*31 -1; int x1 = index % 7 * 31 - 1;
int y1 = index/7*19; int y1 = index / 7 * 19;
g.drawRect(x1, y1, 31, 19); g.drawRect(x1, y1, 31, 19);
} }
} }
@ -599,7 +600,7 @@ public class UICalendarPanel extends JPanel {
} }
private class HMSPane extends JPanel{ private class HMSPane extends JPanel {
private boolean isRolOver; private boolean isRolOver;
private UIButton preButton; private UIButton preButton;
private UIButton nextButton; private UIButton nextButton;
@ -608,7 +609,7 @@ public class UICalendarPanel extends JPanel {
private CalendarNumberField sField; private CalendarNumberField sField;
private CalendarNumberField selectedNumberField; private CalendarNumberField selectedNumberField;
public HMSPane () { public HMSPane() {
this.setPreferredSize(new Dimension(101, 18)); this.setPreferredSize(new Dimension(101, 18));
this.setLayout(new BorderLayout(0, 0)); this.setLayout(new BorderLayout(0, 0));
this.setBackground(null); this.setBackground(null);
@ -633,7 +634,7 @@ public class UICalendarPanel extends JPanel {
} }
private void initComponents() { private void initComponents() {
JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT,0,2)); JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 2));
jp.setBackground(null); jp.setBackground(null);
jp.setBorder(null); jp.setBorder(null);
@ -649,13 +650,13 @@ public class UICalendarPanel extends JPanel {
jp.add(sField); jp.add(sField);
this.add(jp, BorderLayout.CENTER); this.add(jp, BorderLayout.CENTER);
preButton = new UIButton(UIConstants.ARROW_UP_ICON){ preButton = new UIButton(UIConstants.ARROW_UP_ICON) {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
}; };
preButton.setRoundBorder(true, Constants.LEFT); preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON){ nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
@ -673,7 +674,7 @@ public class UICalendarPanel extends JPanel {
MouseAdapter backgroundAdapter = new MouseAdapter() { MouseAdapter backgroundAdapter = new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
HMSPane.this.selectedNumberField = (CalendarNumberField)e.getComponent(); HMSPane.this.selectedNumberField = (CalendarNumberField) e.getComponent();
} }
@Override @Override
@ -710,17 +711,17 @@ public class UICalendarPanel extends JPanel {
}); });
} }
private UILabel createGapLabel () { private UILabel createGapLabel() {
UILabel uiLabel = new UILabel(":"); UILabel uiLabel = new UILabel(":");
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
uiLabel.setBackground(null); uiLabel.setBackground(null);
uiLabel.setBorder(null); uiLabel.setBorder(null);
uiLabel.setPreferredSize(new Dimension(6,10)); uiLabel.setPreferredSize(new Dimension(6, 10));
return uiLabel; return uiLabel;
} }
public Insets getInsets() { public Insets getInsets() {
return new Insets(1,3,1,0); return new Insets(1, 3, 1, 0);
} }
public void paint(Graphics g) { public void paint(Graphics g) {
@ -729,7 +730,7 @@ public class UICalendarPanel extends JPanel {
} }
public void paintBorder(Graphics g) { public void paintBorder(Graphics g) {
Graphics2D g2d = (Graphics2D)g; Graphics2D g2d = (Graphics2D) g;
if (isRolOver) { if (isRolOver) {
Shape shape = new RoundRectangle2D.Double(1, 1, 86, 15, UIConstants.ARC, UIConstants.ARC); Shape shape = new RoundRectangle2D.Double(1, 1, 86, 15, UIConstants.ARC, UIConstants.ARC);
GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE); GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE);
@ -738,7 +739,7 @@ public class UICalendarPanel extends JPanel {
} }
} }
public void populate(Calendar calendar){ public void populate(Calendar calendar) {
this.hField.setValue(calendar.get(Calendar.HOUR_OF_DAY)); this.hField.setValue(calendar.get(Calendar.HOUR_OF_DAY));
this.mField.setValue(calendar.get(Calendar.MINUTE)); this.mField.setValue(calendar.get(Calendar.MINUTE));
this.sField.setValue(calendar.get(Calendar.SECOND)); this.sField.setValue(calendar.get(Calendar.SECOND));
@ -751,15 +752,15 @@ public class UICalendarPanel extends JPanel {
} }
} }
public static void main(String[] args){ public static void main(String[] args) {
JFrame frame = new JFrame(); JFrame frame = new JFrame();
UICalendarPanel calendarPanel = new UICalendarPanel(); UICalendarPanel calendarPanel = new UICalendarPanel();
final UITextField field = new UITextField(); final UITextField field = new UITextField();
field.setPreferredSize(new Dimension(120, 25)); field.setPreferredSize(new Dimension(120, 25));
calendarPanel.addDateChangeListener(new ChangeListener(){ calendarPanel.addDateChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e){ public void stateChanged(ChangeEvent e) {
Date selectedDate = (Date)e.getSource(); Date selectedDate = (Date) e.getSource();
SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd"); SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd");
field.setText(f.format(selectedDate)); field.setText(f.format(selectedDate));
} }

7
designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java

@ -1,14 +1,13 @@
package com.fr.design.gui.date; package com.fr.design.gui.date;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.DesignUtils;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
public class UIDayLabel extends UILabel { public class UIDayLabel extends UILabel {
private Date date = null; private Date date = null;
@ -28,13 +27,13 @@ public class UIDayLabel extends UILabel {
public UIDayLabel(Date date, boolean isSmallLabel) { public UIDayLabel(Date date, boolean isSmallLabel) {
setHorizontalAlignment(UILabel.CENTER); setHorizontalAlignment(UILabel.CENTER);
setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"), 0, 12)); setFont(DesignUtils.getDefaultGUIFont());
this.date = date; this.date = date;
setPreferredSize(new Dimension(30, 18)); setPreferredSize(new Dimension(30, 18));
if (isSmallLabel) { if (isSmallLabel) {
setText(dayFormat.format(date)); setText(dayFormat.format(date));
} else { } else {
setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Today")+":" + dateFormat.format(new Date())); setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Today") + ":" + dateFormat.format(new Date()));
} }
} }

16
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -1,16 +1,18 @@
package com.fr.design.gui.itree.filetree; package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.filetree.IOFileNodeFilter; import com.fr.file.filetree.IOFileNodeFilter;
import javax.swing.JPanel;
import javax.swing.*; import javax.swing.JScrollPane;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -32,7 +34,7 @@ public class ReportletPane extends BasicPane {
textPane.setEditable(false); textPane.setEditable(false);
textPane.setLineWrap(true); textPane.setLineWrap(true);
textPane.setFont(FRContext.getDefaultValues().getFRFont().deriveFont(Font.BOLD, 12)); textPane.setFont(DesignUtils.getDefaultGUIFont().applyStyle(Font.BOLD));
textPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter")); textPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter"));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -41,6 +43,7 @@ public class ReportletPane extends BasicPane {
switchButton = new UIButton("switch"); switchButton = new UIButton("switch");
centerPane.add(GUICoreUtils.createBorderPane(switchButton, BorderLayout.WEST), BorderLayout.NORTH); centerPane.add(GUICoreUtils.createBorderPane(switchButton, BorderLayout.WEST), BorderLayout.NORTH);
switchButton.addActionListener(new ActionListener() { switchButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
switchCardPane(t_panel.isVisible()); switchCardPane(t_panel.isVisible());
} }
@ -50,7 +53,7 @@ public class ReportletPane extends BasicPane {
centerPane.add(cardPane, BorderLayout.CENTER); centerPane.add(cardPane, BorderLayout.CENTER);
cardPane.setLayout(card = new CardLayout()); cardPane.setLayout(card = new CardLayout());
templateReportletTree = new TemplateFileTree(); templateReportletTree = new TemplateFileTree();
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class",".frm",".form"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form"});
templateReportletTree.setFileNodeFilter(filter); templateReportletTree.setFileNodeFilter(filter);
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree(); classReportletTree = new ClassFileTree();
@ -77,6 +80,7 @@ public class ReportletPane extends BasicPane {
* *
* @throws Exception 抛错 * @throws Exception 抛错
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
String path = this.getSelectedReportletPath(); String path = this.getSelectedReportletPath();
if (path == null) { if (path == null) {

5
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -16,9 +15,9 @@ import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.menu.SnapChatUtil; import com.fr.design.menu.SnapChatUtil;
import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChat;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime; import com.fr.plugin.context.PluginRuntime;
@ -1251,7 +1250,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
super.paint(g); super.paint(g);
Image button; Image button;
g.setColor(new Color(69, 135, 255)); g.setColor(new Color(69, 135, 255));
g.setFont(FRFont.getInstance().applySize(14)); g.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
if (buttonType.equals(NO_BUTTON)) { if (buttonType.equals(NO_BUTTON)) {
return; return;
} }

10
designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java

@ -13,9 +13,9 @@ 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;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JButton; import javax.swing.JButton;
@ -37,7 +37,6 @@ import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.EventQueue; import java.awt.EventQueue;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
@ -60,7 +59,6 @@ public class JSliderPane extends JPanel {
private static final double ONEPOINTEIGHT = 1.8; private static final double ONEPOINTEIGHT = 1.8;
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
private static final int FONT_SIZE = 12;
private static final int SPINNER_WIDTH = 45; private static final int SPINNER_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20; private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50; private static final int HALF_HUNDRED = 50;
@ -194,9 +192,9 @@ public class JSliderPane extends JPanel {
fiveTenButton = new UIRadioButton("50%"); fiveTenButton = new UIRadioButton("50%");
twoFiveButton = new UIRadioButton("25%"); twoFiveButton = new UIRadioButton("25%");
selfAdaptButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Self_Adapt_Button")); selfAdaptButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Self_Adapt_Button"));
selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); selfAdaptButton.setFont(DesignUtils.getDefaultGUIFont());
customButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Custom_Button")); customButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Custom_Button"));
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); customButton.setFont(DesignUtils.getDefaultGUIFont());
twoHundredButton.addItemListener(radioButtonItemListener); twoHundredButton.addItemListener(radioButtonItemListener);
oneHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener);
sevenFiveButton.addItemListener(radioButtonItemListener); sevenFiveButton.addItemListener(radioButtonItemListener);
@ -265,7 +263,7 @@ public class JSliderPane extends JPanel {
JPanel spinnerPanel = new JPanel(new FlowLayout()); JPanel spinnerPanel = new JPanel(new FlowLayout());
spinnerPanel.add(showValSpinner); spinnerPanel.add(showValSpinner);
UILabel percent = new UILabel("%"); UILabel percent = new UILabel("%");
percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); percent.setFont(DesignUtils.getDefaultGUIFont());
spinnerPanel.add(percent); spinnerPanel.add(percent);
spinnerPanel.setBackground(BACK_COLOR); spinnerPanel.setBackground(BACK_COLOR);
return spinnerPanel; return spinnerPanel;

45
designer-form/src/main/java/com/fr/design/designer/creator/XButton.java

@ -14,11 +14,11 @@ import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor;
import com.fr.design.mainframe.widget.editors.ShortCutTextEditor; import com.fr.design.mainframe.widget.editors.ShortCutTextEditor;
import com.fr.design.mainframe.widget.renderer.FontCellRenderer; import com.fr.design.mainframe.widget.renderer.FontCellRenderer;
import com.fr.design.mainframe.widget.renderer.IconCellRenderer; import com.fr.design.mainframe.widget.renderer.IconCellRenderer;
import com.fr.design.utils.DesignUtils;
import com.fr.form.parameter.FormSubmitButton; import com.fr.form.parameter.FormSubmitButton;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -29,7 +29,6 @@ import java.awt.AlphaComposite;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@ -41,14 +40,13 @@ import java.beans.IntrospectionException;
*/ */
public class XButton extends XWidgetCreator { public class XButton extends XWidgetCreator {
public final static Background DEFAULTBG = new GradientBackground(new Color(247,247,247),new Color(210,210,210), GradientBackground.TOP2BOTTOM); public final static Background DEFAULTBG = new GradientBackground(new Color(247, 247, 247), new Color(210, 210, 210), GradientBackground.TOP2BOTTOM);
public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12);
public final static Color DEFAULTFOREGROUNDCOLOR = Color.BLACK; public final static Color DEFAULTFOREGROUNDCOLOR = Color.BLACK;
private Background bg; private Background bg;
private UILabel contentLabel; private UILabel contentLabel;
public XButton(Button widget, Dimension initSize) { public XButton(Button widget, Dimension initSize) {
this(new FreeButton(widget),initSize); this(new FreeButton(widget), initSize);
} }
public XButton(FreeButton widget, Dimension initSize) { public XButton(FreeButton widget, Dimension initSize) {
@ -76,7 +74,8 @@ public class XButton extends XWidgetCreator {
} }
/** /**
*根据下拉框选择返回按钮样式的默认设置或自定义设置列表 * 根据下拉框选择返回按钮样式的默认设置或自定义设置列表
*
* @return 列表 * @return 列表
* @throws IntrospectionException 抛错 * @throws IntrospectionException 抛错
*/ */
@ -87,7 +86,7 @@ public class XButton extends XWidgetCreator {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), crp); return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), crp);
} }
protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException{ protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException {
CRPropertyDescriptor[] crPropertyDescriptors = { CRPropertyDescriptor[] crPropertyDescriptors = {
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName( new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"),
@ -117,16 +116,17 @@ public class XButton extends XWidgetCreator {
}; };
return crPropertyDescriptors[i]; return crPropertyDescriptors[i];
} }
protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException{
protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException {
return new CRPropertyDescriptor[]{ return new CRPropertyDescriptor[]{
creatNonListenerStyle(0) .setPropertyChangeListener(new PropertyChangeAdapter() { creatNonListenerStyle(0).setPropertyChangeListener(new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
setButtonText(((FreeButton) data).getText()); setButtonText(((FreeButton) data).getText());
} }
}), }),
creatNonListenerStyle(1) .setPropertyChangeListener(new PropertyChangeAdapter() { creatNonListenerStyle(1).setPropertyChangeListener(new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
checkButonType(); checkButonType();
@ -141,7 +141,7 @@ public class XButton extends XWidgetCreator {
}), }),
creatNonListenerStyle(3), creatNonListenerStyle(3),
creatNonListenerStyle(4), creatNonListenerStyle(4),
creatNonListenerStyle(5) .setPropertyChangeListener( creatNonListenerStyle(5).setPropertyChangeListener(
new PropertyChangeAdapter() { new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
@ -193,6 +193,7 @@ public class XButton extends XWidgetCreator {
}; };
} }
@Override @Override
protected JComponent initEditor() { protected JComponent initEditor() {
if (editor == null) { if (editor == null) {
@ -211,10 +212,10 @@ public class XButton extends XWidgetCreator {
super.paintComponent(g); super.paintComponent(g);
//不可见时,按钮.4f透明 //不可见时,按钮.4f透明
AlphaComposite composite = this.data.isVisible() ? (AlphaComposite)((Graphics2D)g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER,HALF_OPACITY); AlphaComposite composite = this.data.isVisible() ? (AlphaComposite) ((Graphics2D) g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER, HALF_OPACITY);
((Graphics2D)g).setComposite(composite); ((Graphics2D) g).setComposite(composite);
Dimension panelSize = (contentLabel).getSize(); Dimension panelSize = (contentLabel).getSize();
if(bg != null) { if (bg != null) {
bg.paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight())); bg.paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight()));
} }
} }
@ -230,14 +231,14 @@ public class XButton extends XWidgetCreator {
if (!button.isCustomStyle()) { if (!button.isCustomStyle()) {
l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148)));
bg = DEFAULTBG; bg = DEFAULTBG;
contentLabel.setFont(DEFAULTFT); contentLabel.setFont(DesignUtils.getDefaultGUIFont());
contentLabel.setForeground(DEFAULTFOREGROUNDCOLOR); contentLabel.setForeground(DEFAULTFOREGROUNDCOLOR);
editor.setLayout(new BorderLayout()); editor.setLayout(new BorderLayout());
editor.add(l, BorderLayout.CENTER); editor.add(l, BorderLayout.CENTER);
} else { } else {
l.setBorder(null); l.setBorder(null);
editor.setLayout(new BorderLayout()); editor.setLayout(new BorderLayout());
editor.add(l,BorderLayout.CENTER); editor.add(l, BorderLayout.CENTER);
if (button.getFont() != null) { if (button.getFont() != null) {
contentLabel.setFont(button.getFont().applyResolutionNP( contentLabel.setFont(button.getFont().applyResolutionNP(
FontTransformUtil.getDesignerFontResolution())); FontTransformUtil.getDesignerFontResolution()));
@ -276,8 +277,10 @@ public class XButton extends XWidgetCreator {
/** /**
* 初始化按钮的Size * 初始化按钮的Size
*
* @return 尺寸 * @return 尺寸
*/ */
@Override
public Dimension initEditorSize() { public Dimension initEditorSize() {
FreeButton button = (FreeButton) data; FreeButton button = (FreeButton) data;
if (checkbutton(button)) { if (checkbutton(button)) {
@ -285,9 +288,11 @@ public class XButton extends XWidgetCreator {
} }
return super.initEditorSize(); return super.initEditorSize();
} }
private boolean checkbutton(FreeButton button){
return (button.isCustomStyle() && button.getButtonHeight() > 0 && button.getButtonWidth() > 0) ; private boolean checkbutton(FreeButton button) {
return (button.isCustomStyle() && button.getButtonHeight() > 0 && button.getButtonWidth() > 0);
} }
@Override @Override
protected String getIconName() { protected String getIconName() {
return "button_16.png"; return "button_16.png";
@ -295,9 +300,9 @@ public class XButton extends XWidgetCreator {
/** /**
* data属性改变触发其他操作 * data属性改变触发其他操作
*
*/ */
public void firePropertyChange(){ @Override
public void firePropertyChange() {
FreeButton button = (FreeButton) data; FreeButton button = (FreeButton) data;
setButtonText(button.getText()); setButtonText(button.getText());
checkButonType(); checkButonType();

14
designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java

@ -1,15 +1,14 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.FRContext;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.form.ui.Radio; import com.fr.form.ui.Radio;
import com.fr.general.FRFont;
import javax.swing.SwingConstants;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*; import java.awt.Font;
/** /**
* @deprecated * @deprecated
@ -25,8 +24,7 @@ public class RadioDefinePane extends AbstractDataModify<Radio> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel infoLabel = new UILabel(); UILabel infoLabel = new UILabel();
FRFont frFont = FRContext.getDefaultValues().getFRFont(); infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD));
infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24));
infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText(
"Fine-Design_Report_No_Editor_Property_Definition") + "."); "Fine-Design_Report_No_Editor_Property_Definition") + ".");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER); infoLabel.setHorizontalAlignment(SwingConstants.CENTER);
@ -45,6 +43,6 @@ public class RadioDefinePane extends AbstractDataModify<Radio> {
@Override @Override
public Radio updateBean() { public Radio updateBean() {
return (Radio)creator.toData(); return (Radio) creator.toData();
} }
} }

10
designer-realize/src/main/java/com/fr/design/condition/FontPane.java

@ -7,13 +7,13 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.style.FRFontPane; import com.fr.design.style.FRFontPane;
import com.fr.design.style.FRFontPreviewArea; import com.fr.design.style.FRFontPreviewArea;
import com.fr.general.FRFont; import com.fr.design.utils.DesignUtils;
import com.fr.report.cell.cellattr.highlight.FRFontHighlightAction; import com.fr.report.cell.cellattr.highlight.FRFontHighlightAction;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.SwingUtilities;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -60,7 +60,7 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
this.add(frFontPreviewPane); this.add(frFontPreviewPane);
this.add(editFRFontButton); this.add(editFRFontButton);
this.add(this.fontScopeComboBox); this.add(this.fontScopeComboBox);
this.frFontPreviewPane.setFontObject(FRFont.getInstance()); this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont());
} }
@Override @Override

9
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.alphafine; package com.fr.design.mainframe.alphafine;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.utils.DesignUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import java.awt.Color; import java.awt.Color;
@ -73,15 +74,15 @@ public class AlphaFineConstants {
public static final String HIGH_LIGHT_COLOR = "rgb(51,148,240)"; public static final String HIGH_LIGHT_COLOR = "rgb(51,148,240)";
public static final Font SMALL_FONT = new Font("Song_TypeFace", 0, 10); public static final Font SMALL_FONT = DesignUtils.getDefaultGUIFont().applySize(10);
public static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 12); public static final Font MEDIUM_FONT = DesignUtils.getDefaultGUIFont().applySize(12);
public static final Font MEDIUM_FONT_ANOTHER = new Font("HiraginoSansGB-W3", 0, 12); public static final Font MEDIUM_FONT_ANOTHER = new Font("HiraginoSansGB-W3", 0, 12);
public static final Font LARGE_FONT = new Font("Song_TypeFace", 0, 18); public static final Font LARGE_FONT = DesignUtils.getDefaultGUIFont().applySize(18);
public static final Font GREATER_FONT = new Font("Song_TypeFace", 0, 20); public static final Font GREATER_FONT = DesignUtils.getDefaultGUIFont().applySize(20);
public static final String IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/"; public static final String IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/";

12
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java

@ -3,10 +3,14 @@ package com.fr.design.mainframe.alphafine.preview;
import com.bulenkov.iconloader.IconLoader; import com.bulenkov.iconloader.IconLoader;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.general.FRFont; import com.fr.design.utils.DesignUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
/** /**
* Created by XiaXiang on 2017/8/14. * Created by XiaXiang on 2017/8/14.
@ -23,7 +27,7 @@ public class NoResultPane extends JPanel {
image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0));
UILabel description = new UILabel(title); UILabel description = new UILabel(title);
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); description.setForeground(AlphaFineConstants.MEDIUM_GRAY);
description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); description.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0));
description.setHorizontalAlignment(SwingConstants.CENTER); description.setHorizontalAlignment(SwingConstants.CENTER);
add(image, BorderLayout.CENTER); add(image, BorderLayout.CENTER);

18
designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -8,16 +8,24 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPassWordField;
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.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.*; import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.*; import java.awt.Color;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -37,7 +45,7 @@ public class BBSLoginDialog extends UIDialog {
private static final int DIALOG_WIDTH = 400; private static final int DIALOG_WIDTH = 400;
private static final int DIALOG_HEIGHT = 200; private static final int DIALOG_HEIGHT = 200;
private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14); private static final Font DEFAULT_FONT = DesignUtils.getDefaultGUIFont().applySize(14);
private static final int TIME_OUT = 10000; private static final int TIME_OUT = 10000;
private static final int BUTTON_WIDTH = 90; private static final int BUTTON_WIDTH = 90;

5
designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

@ -12,6 +12,7 @@ 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.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.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -32,7 +33,6 @@ import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -59,7 +59,6 @@ public class ReportColumnsPane extends BasicPane{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column") com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column")
}; };
private static final String FONT_NAME = "simsun";
private static final int FONT_SIZE = 14; private static final int FONT_SIZE = 14;
private UIButtonGroup onOffButtonGroup; private UIButtonGroup onOffButtonGroup;
@ -109,7 +108,7 @@ public class ReportColumnsPane extends BasicPane{
onOffButtonGroup.addActionListener(onOffListener); onOffButtonGroup.addActionListener(onOffListener);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns")); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"));
FRFont uiLableFont = FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE); FRFont uiLableFont = DesignUtils.getDefaultGUIFont().applySize(FONT_SIZE);
uiLabel.setFont(uiLableFont); uiLabel.setFont(uiLableFont);
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont); int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont);

4
designer-realize/src/main/java/com/fr/design/report/RichTextPane.java

@ -1,12 +1,12 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.FRContext;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.cell.editor.RichTextToolBar;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -37,7 +37,7 @@ public class RichTextPane extends BasicPane {
//12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题. //12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题.
//直接弄个jtexarea放到jframe里也有同样问题, 不知道是字体渲染bug还是jdk问题 //直接弄个jtexarea放到jframe里也有同样问题, 不知道是字体渲染bug还是jdk问题
public static final FRFont DEFAUL_FONT = FRContext.getDefaultValues().getFRFont().applySize(13); public static final FRFont DEFAUL_FONT = DesignUtils.getDefaultGUIFont().applySize(13);
private RichTextEditingPane textPane; private RichTextEditingPane textPane;
//用于populate时动态更新按钮 //用于populate时动态更新按钮

12
designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java

@ -1,14 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.form.ui.Radio; import com.fr.form.ui.Radio;
import com.fr.general.FRFont;
import javax.swing.SwingConstants;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*; import java.awt.Font;
/** /**
* @deprecated * @deprecated
@ -23,8 +22,7 @@ public class RadioDefinePane extends AbstractDataModify<Radio> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel infoLabel = new UILabel(); UILabel infoLabel = new UILabel();
FRFont frFont = FRContext.getDefaultValues().getFRFont(); infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD));
infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24));
infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText(
"Fine-Design_Report_No_Editor_Property_Definition") + "."); "Fine-Design_Report_No_Editor_Property_Definition") + ".");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER); infoLabel.setHorizontalAlignment(SwingConstants.CENTER);

12
designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java

@ -1,14 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.form.ui.NameWidget; import com.fr.form.ui.NameWidget;
import com.fr.general.FRFont;
import javax.swing.SwingConstants;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*; import java.awt.Font;
public class UserEditorDefinePane extends AbstractDataModify<NameWidget> { public class UserEditorDefinePane extends AbstractDataModify<NameWidget> {
private NameWidget nWidget; private NameWidget nWidget;
@ -20,8 +19,7 @@ public class UserEditorDefinePane extends AbstractDataModify<NameWidget> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel infoLabel = new UILabel(); UILabel infoLabel = new UILabel();
FRFont frFont = FRContext.getDefaultValues().getFRFont(); infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD));
infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24));
infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText(
"Fine-Design_Report_Widget_User_Defined_Editor") + "."); "Fine-Design_Report_Widget_User_Defined_Editor") + ".");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER); infoLabel.setHorizontalAlignment(SwingConstants.CENTER);

4
designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

@ -8,6 +8,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.DesignUtils;
import com.fr.quickeditor.FloatQuickEditor; import com.fr.quickeditor.FloatQuickEditor;
import com.fr.report.ReportHelper; import com.fr.report.ReportHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -20,7 +21,6 @@ import javax.swing.event.DocumentListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -77,7 +77,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
} }
private void initTextField() { private void initTextField() {
stringTextField.setFont(new Font("Dialog", Font.PLAIN, 12)); stringTextField.setFont(DesignUtils.getDefaultGUIFont());
stringTextField.setOpaque(true); stringTextField.setOpaque(true);
stringTextField.setLineWrap(true); stringTextField.setLineWrap(true);
stringTextField.setWrapStyleWord(true); stringTextField.setWrapStyleWord(true);

Loading…
Cancel
Save