Browse Source

REPORT-14057 10.0日文国际化问题处理=>问题8 浏览器背景,标签显示不全

bugfix/10.0
plough 6 years ago
parent
commit
b1d5ed6ca3
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 18
      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

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

@ -473,7 +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.setLineWrapWithMaximumWidth(MEMORY_TIP_LABEL_MAX_WIDTH); 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());

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

@ -65,15 +65,25 @@ public class UILabel extends JLabel {
} }
/** /**
* 指定最大宽度文字内容到达最大宽度后自动换行 * 到达指定宽度后换行
*/ */
public void setLineWrapWithMaximumWidth(int width) { 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(); String text = this.getText();
if (StringUtils.isEmpty(text)) { if (StringUtils.isEmpty(text)) {
return; return;
} }
String htmlText = "<html><body style='width: " + width + "px'>" + text; this.setText(prefix + text);
this.setText(htmlText);
} }

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);

Loading…
Cancel
Save