Browse Source

Merge pull request #736 in DESIGN/design from ~PLOUGH/10-design:release/10.0 to release/10.0

* commit '8fdae48117630a2400b8be76a7362fe9e5b4de71':
  REPORT-14057 10.0日文国际化问题处理=>问题9、问题10 显示不全
  REPORT-14057 10.0日文国际化问题处理=>问题8 浏览器背景,标签显示不全
  REPORT-14057 10.0日文国际化问题处理=>问题7 控件名称显示不全
  REPORT-14057 10.0日文国际化问题处理=>问题4
bugfix/10.0
plough 6 years ago
parent
commit
1bdd0dcd2f
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 22
      designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java
  3. 26
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  4. 39
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java
  5. 1
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  6. 1
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

2
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -61,6 +61,7 @@ public class PreferencePane extends BasicPane {
private static final int CACHING_MAX = 10; private static final int CACHING_MAX = 10;
private static final int CACHING_DEFAULT = 5; private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5; private static final int CACHING_GAP = 5;
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
private static final String TYPE = "pressed"; private static final String TYPE = "pressed";
private static final String DISPLAY_TYPE = "+"; private static final String DISPLAY_TYPE = "+";
@ -472,6 +473,7 @@ public class PreferencePane extends BasicPane {
JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template")); JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template"));
UILabel memoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Max_Caching_Template")); UILabel memoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Max_Caching_Template"));
UILabel memoryTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip")); UILabel memoryTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip"));
memoryTipLabel.setLineWrap(MEMORY_TIP_LABEL_MAX_WIDTH);
memoryTipLabel.setBorder(BorderFactory.createEmptyBorder(0, CACHING_GAP, 0, 0)); memoryTipLabel.setBorder(BorderFactory.createEmptyBorder(0, CACHING_GAP, 0, 0));
cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT); cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT);
JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());

22
designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java

@ -64,6 +64,28 @@ public class UILabel extends JLabel {
return preferredSize; return preferredSize;
} }
/**
* 到达指定宽度后换行
*/
public void setLineWrap(int width) {
insertPrefixToText("<html><body style='width: " + width + "px'>");
}
/**
* 自动换行
*/
public void setLineWrap() {
insertPrefixToText("<html><body>");
}
private void insertPrefixToText(String prefix) {
String text = this.getText();
if (StringUtils.isEmpty(text)) {
return;
}
this.setText(prefix + text);
}
public static void main(String[] args) { public static void main(String[] args) {
// UILabel label = new UILabel("shishi",SwingConstants.LEFT); // UILabel label = new UILabel("shishi",SwingConstants.LEFT);

26
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -1,24 +1,22 @@
package com.fr.design.style.background.gradient; package com.fr.design.style.background.gradient;
import java.awt.BorderLayout; import com.fr.base.background.GradientBackground;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane;
import com.fr.general.Background;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import com.fr.base.background.GradientBackground; import java.awt.Dimension;
import com.fr.design.layout.FRGUIPaneFactory; import java.awt.event.ActionEvent;
import com.fr.general.Background; import java.awt.event.ActionListener;
import com.fr.design.style.background.BackgroundDetailPane;
/** /**
* 渐变色的面板不是很pp面板应用显得繁琐有写可以写成控件类型比如色彩选择的可以做得花哨点 * 渐变色的面板不是很pp面板应用显得繁琐有写可以写成控件类型比如色彩选择的可以做得花哨点
@ -44,6 +42,8 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
gradientBar = new GradientBar(4, 254); gradientBar = new GradientBar(4, 254);
blankJp.add(gradientBar); blankJp.add(gradientBar);
UILabel jl = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient")); UILabel jl = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient"));
jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
jl.setLineWrap();
jl.setHorizontalAlignment(SwingConstants.CENTER); jl.setHorizontalAlignment(SwingConstants.CENTER);
gradientPanel.add(jl, BorderLayout.NORTH); gradientPanel.add(jl, BorderLayout.NORTH);
gradientPanel.add(blankJp, BorderLayout.SOUTH); gradientPanel.add(blankJp, BorderLayout.SOUTH);

39
designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java

@ -10,16 +10,26 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.report.web.Location; import com.fr.report.web.Location;
import com.fr.report.web.ToolBarManager; import com.fr.report.web.ToolBarManager;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.GraphDrawHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import java.awt.*; import javax.swing.table.TableColumnModel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -34,6 +44,7 @@ import java.awt.image.ImageObserver;
public class ToolBarDragPane extends WidgetToolBarPane { public class ToolBarDragPane extends WidgetToolBarPane {
private static final int COLUMN = 4; private static final int COLUMN = 4;
private static final int MIN_COLUMN_WIDTH = 15;
private int row = 7; private int row = 7;
private DefaultTableModel toolbarButtonTableModel; private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable; private JTable layoutTable;
@ -169,10 +180,6 @@ public class ToolBarDragPane extends WidgetToolBarPane {
layoutTable.setColumnSelectionAllowed(false); layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false); layoutTable.setRowSelectionAllowed(false);
layoutTable.setBackground(Color.WHITE); layoutTable.setBackground(Color.WHITE);
int columnWidth = Integer.parseInt(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Layout_Table_Column_Width"));
for (int i = 0; i < layoutTable.getColumnModel().getColumnCount(); i++) {
layoutTable.getColumnModel().getColumn(i).setPreferredWidth(columnWidth);
}
layoutTable.addMouseListener(new MouseAdapter() { layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) { if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) {
@ -188,6 +195,23 @@ public class ToolBarDragPane extends WidgetToolBarPane {
}); });
} }
// 根据控件名称长度,设置合适的列宽
private static void resizeColumnWidth(JTable table) {
final TableColumnModel columnModel = table.getColumnModel();
for (int column = 0; column < table.getColumnCount(); column++) {
int width = MIN_COLUMN_WIDTH; // Min width
for (int row = 0; row < table.getRowCount(); row++) {
WidgetOption widgetOption = (WidgetOption) table.getValueAt(row, column);
if (widgetOption == null) {
continue;
}
String optionName = widgetOption.optionName();
width = Math.max(GraphDrawHelper.getWidth(optionName), width);
}
columnModel.getColumn(column).setPreferredWidth(width);
}
}
private boolean isSelectedtable() { private boolean isSelectedtable() {
for (int i = 0; i < layoutTable.getColumnCount(); i++) { for (int i = 0; i < layoutTable.getColumnCount(); i++) {
@ -229,6 +253,7 @@ public class ToolBarDragPane extends WidgetToolBarPane {
toolbarButtonTableModel.setValueAt(buttonArray[i], i % row, i / row); toolbarButtonTableModel.setValueAt(buttonArray[i], i % row, i / row);
} }
} }
resizeColumnWidth(layoutTable);
} }

1
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -46,6 +46,7 @@ public class WebCssPane extends BasicPane {
northPane.add(chooseFile, FlowLayout.RIGHT); northPane.add(chooseFile, FlowLayout.RIGHT);
outnorth.add(northPane,BorderLayout.NORTH); outnorth.add(northPane,BorderLayout.NORTH);
UILabel infor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning")); UILabel infor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning"));
infor.setLineWrap();
infor.setForeground(new Color(207, 42, 39)); infor.setForeground(new Color(207, 42, 39));
outnorth.add(infor,BorderLayout.CENTER); outnorth.add(infor,BorderLayout.CENTER);
this.add(outnorth, BorderLayout.NORTH); this.add(outnorth, BorderLayout.NORTH);

1
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -96,6 +96,7 @@ public class WebJsPane extends BasicPane {
northPane.add(chooseFile); northPane.add(chooseFile);
firstnorth.add(northPane,BorderLayout.NORTH); firstnorth.add(northPane,BorderLayout.NORTH);
infor1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1")); infor1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1"));
infor1.setLineWrap();
infor1.setForeground(new Color(207, 42, 39)); infor1.setForeground(new Color(207, 42, 39));
firstnorth.add(infor1,BorderLayout.CENTER); firstnorth.add(infor1,BorderLayout.CENTER);

Loading…
Cancel
Save