@ -0,0 +1,16 @@ |
|||||||
|
package com.fr.design.utils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制SVG图标的函数式接口 |
||||||
|
* |
||||||
|
* @author obo |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/24 |
||||||
|
*/ |
||||||
|
public interface SvgDraw<T> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制svg图标的具体逻辑,方法体 |
||||||
|
* */ |
||||||
|
void drawSVG(); |
||||||
|
} |
@ -0,0 +1,73 @@ |
|||||||
|
package com.fr.design.utils; |
||||||
|
|
||||||
|
import com.fr.base.svg.SVGLoader; |
||||||
|
import com.fr.base.svg.SystemScaleUtils; |
||||||
|
import org.jetbrains.annotations.NotNull; |
||||||
|
|
||||||
|
import java.awt.Graphics; |
||||||
|
import java.awt.Graphics2D; |
||||||
|
import java.awt.Image; |
||||||
|
import java.awt.image.ImageObserver; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用于绘制svg图片缩放(高分屏下) |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2022/5/6 |
||||||
|
*/ |
||||||
|
public class SvgDrawUtils { |
||||||
|
|
||||||
|
private static final boolean HI_DPI_ENABLED = SystemScaleUtils.isJreHiDPIEnabled(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制svg前若环境支持高清化则对缩放比例进行适配 |
||||||
|
* */ |
||||||
|
public static void beforeDraw(Graphics2D g2) { |
||||||
|
if (HI_DPI_ENABLED) { |
||||||
|
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制svg后还原缩放矩阵 |
||||||
|
* */ |
||||||
|
public static void afterDraw(Graphics2D g2) { |
||||||
|
if (HI_DPI_ENABLED) { |
||||||
|
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 计算高缩放下绘制svg图标时新的的位置x,y |
||||||
|
* @param position 旧坐标的值 |
||||||
|
* @return 新的position值 |
||||||
|
* */ |
||||||
|
public static int calculatePosition(int position) { |
||||||
|
return HI_DPI_ENABLED ? (int) (position * SVGLoader.SYSTEM_SCALE) : position; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制svg图像的完整逻辑 |
||||||
|
* @param graphics 绘图 |
||||||
|
* @param svgDraw 具体绘制逻辑 |
||||||
|
* */ |
||||||
|
public static void doDrawSVG(@NotNull Graphics graphics, @NotNull final SvgDraw<Graphics> svgDraw) { |
||||||
|
SvgDrawUtils.beforeDraw((Graphics2D) graphics); |
||||||
|
svgDraw.drawSVG(); |
||||||
|
SvgDrawUtils.afterDraw((Graphics2D) graphics); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制前对坐标x和y进行处理 |
||||||
|
* @param graphics 绘图 |
||||||
|
* @param image svg的Image对象 |
||||||
|
* @param x x坐标 |
||||||
|
* @param y y坐标 |
||||||
|
* @param imageObserver 图像观察器 |
||||||
|
* */ |
||||||
|
public static void drawImage(Graphics graphics, Image image, int x, int y, ImageObserver imageObserver) { |
||||||
|
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
|
||||||
|
graphics.drawImage(image, SvgDrawUtils.calculatePosition(x), SvgDrawUtils.calculatePosition(y), imageObserver); |
||||||
|
} |
||||||
|
} |
@ -1,28 +0,0 @@ |
|||||||
package com.fr.design.utils; |
|
||||||
|
|
||||||
import com.fr.base.svg.SVGLoader; |
|
||||||
import com.fr.base.svg.SystemScaleUtils; |
|
||||||
import java.awt.Graphics2D; |
|
||||||
|
|
||||||
/** |
|
||||||
* 用于绘制svg图片缩放(高分屏下) |
|
||||||
* |
|
||||||
* @author hades |
|
||||||
* @version 11.0 |
|
||||||
* Created by hades on 2022/5/6 |
|
||||||
*/ |
|
||||||
public class SvgPaintUtils { |
|
||||||
|
|
||||||
public static void beforePaint(Graphics2D g2) { |
|
||||||
if (SystemScaleUtils.isJreHiDPIEnabled()) { |
|
||||||
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public static void afterPaint(Graphics2D g2) { |
|
||||||
if (SystemScaleUtils.isJreHiDPIEnabled()) { |
|
||||||
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 242 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 443 B |
After Width: | Height: | Size: 443 B |
After Width: | Height: | Size: 447 B |
After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 705 B |
After Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 295 B |
@ -1,37 +0,0 @@ |
|||||||
package com.fr.design.locale.impl; |
|
||||||
|
|
||||||
import com.fr.general.GeneralContext; |
|
||||||
import com.fr.general.IOUtils; |
|
||||||
import com.fr.general.locale.LocaleMark; |
|
||||||
|
|
||||||
import java.awt.image.BufferedImage; |
|
||||||
import java.util.HashMap; |
|
||||||
import java.util.Locale; |
|
||||||
import java.util.Map; |
|
||||||
|
|
||||||
/** |
|
||||||
* 根据本地化信息设置服务器图表空数据提示图标 |
|
||||||
* |
|
||||||
* @author obo |
|
||||||
* @version 11.0 |
|
||||||
* Created by obo on 2023/3/22 |
|
||||||
*/ |
|
||||||
public class EmptyDataMark implements LocaleMark<BufferedImage> { |
|
||||||
|
|
||||||
private Map<Locale, BufferedImage> map = new HashMap<>(); |
|
||||||
|
|
||||||
private static final BufferedImage ZH_EMPTY_DATA = IOUtils.readImage("com/fr/design/images/zh_emptydata.png"); |
|
||||||
private static final BufferedImage US_EMPTY_DATA = IOUtils.readImage("/com/fr/design/images/us_emptydata.png"); |
|
||||||
private static final BufferedImage ZH_TRADITIONAL_EMPTY_DATA = IOUtils.readImage("/com/fr/design/images/zh_traditional_emptydata.png"); |
|
||||||
|
|
||||||
public EmptyDataMark() { |
|
||||||
map.put(Locale.CHINA, ZH_EMPTY_DATA); |
|
||||||
map.put(Locale.US, US_EMPTY_DATA); |
|
||||||
map.put(Locale.TAIWAN, ZH_TRADITIONAL_EMPTY_DATA); |
|
||||||
} |
|
||||||
@Override |
|
||||||
public BufferedImage getValue() { |
|
||||||
BufferedImage result = map.get(GeneralContext.getLocale()); |
|
||||||
return result == null ? US_EMPTY_DATA : result; |
|
||||||
} |
|
||||||
} |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,37 @@ |
|||||||
|
package com.fr.design.designer.properties.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; |
||||||
|
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.NumberEditorMobileDefinePane; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数字控件属性面板注册 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class NumberEditorMobilePropertyUI extends AbstractWidgetPropertyUIProvider { |
||||||
|
private XCreator xCreator; |
||||||
|
|
||||||
|
public NumberEditorMobilePropertyUI(XCreator xCreator) { |
||||||
|
this.xCreator = xCreator; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractPropertyTable createWidgetAttrTable() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BasicPane createWidgetAttrPane() { |
||||||
|
return new NumberEditorMobileDefinePane(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String tableTitle() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.fr.design.designer.properties.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; |
||||||
|
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.PasswordMobileDefinePane; |
||||||
|
|
||||||
|
/** |
||||||
|
* 密码控件移动端属性注册 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class PasswordMobilePropertyUI extends AbstractWidgetPropertyUIProvider { |
||||||
|
private XCreator xCreator; |
||||||
|
|
||||||
|
public PasswordMobilePropertyUI(XCreator xCreator) { |
||||||
|
this.xCreator = xCreator; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractPropertyTable createWidgetAttrTable() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BasicPane createWidgetAttrPane() { |
||||||
|
return new PasswordMobileDefinePane(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String tableTitle() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.fr.design.designer.properties.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; |
||||||
|
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.TextAreaAdvancedDefinePane; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文本域控件移动端属性 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/29 |
||||||
|
*/ |
||||||
|
public class TextAreaMobilePropertyUI extends AbstractWidgetPropertyUIProvider { |
||||||
|
private XCreator xCreator; |
||||||
|
|
||||||
|
public TextAreaMobilePropertyUI(XCreator xCreator) { |
||||||
|
this.xCreator = xCreator; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractPropertyTable createWidgetAttrTable() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BasicPane createWidgetAttrPane() { |
||||||
|
return new TextAreaAdvancedDefinePane(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String tableTitle() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,94 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.foldablepane.UIExpandablePane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.component.MobileTextEditSettingPane; |
||||||
|
import com.fr.form.ui.TextEditor; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.FlowLayout; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> 文本类组件移动端高级属性的定义面板,基础扩展可以直接继承此面板 |
||||||
|
* <p> 往内部添加其他配置 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class BaseTextEditorMobileDefinePane extends MobileWidgetDefinePane { |
||||||
|
|
||||||
|
private XCreator xCreator; |
||||||
|
protected MobileTextEditSettingPane textSettingPane; |
||||||
|
|
||||||
|
public BaseTextEditorMobileDefinePane(XCreator xCreator) { |
||||||
|
this.xCreator = xCreator; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void initPropertyGroups(Object source) { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); |
||||||
|
addPropertyPanesToContainer(container); |
||||||
|
this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH); |
||||||
|
this.repaint(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 添加其他属性面板 |
||||||
|
* |
||||||
|
* @param container 展开容器 |
||||||
|
*/ |
||||||
|
protected void addPropertyPanesToContainer(JPanel container) { |
||||||
|
initSettingPane(container); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始化文本类基础面板 |
||||||
|
* |
||||||
|
* @param container |
||||||
|
*/ |
||||||
|
protected void initSettingPane(JPanel container) { |
||||||
|
textSettingPane = new MobileTextEditSettingPane(); |
||||||
|
container.add(textSettingPane); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populate(FormDesigner designer) { |
||||||
|
TextEditor textEditor = (TextEditor) xCreator.toData(); |
||||||
|
textSettingPane.populateBean(textEditor.getMobileTextEditAttr()); |
||||||
|
this.bindListeners2Widgets(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void bindListeners2Widgets() { |
||||||
|
reInitAllListeners(); |
||||||
|
AttributeChangeListener changeListener = new AttributeChangeListener() { |
||||||
|
@Override |
||||||
|
public void attributeChange() { |
||||||
|
update(); |
||||||
|
} |
||||||
|
}; |
||||||
|
this.addAttributeChangeListener(changeListener); |
||||||
|
} |
||||||
|
|
||||||
|
private void reInitAllListeners() { |
||||||
|
initListener(this); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update() { |
||||||
|
TextEditor textEditor = (TextEditor) xCreator.toData(); |
||||||
|
textSettingPane.updateBean(textEditor.getMobileTextEditAttr()); |
||||||
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); |
||||||
|
} |
||||||
|
|
||||||
|
public XCreator getxCreator() { |
||||||
|
return xCreator; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
import com.fr.form.ui.NumberEditor; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数字控件 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class NumberEditorMobileDefinePane extends BaseTextEditorMobileDefinePane { |
||||||
|
public NumberEditorMobileDefinePane(XCreator xCreator) { |
||||||
|
super(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populate(FormDesigner designer) { |
||||||
|
NumberEditor numberEditor = (NumberEditor) getxCreator().toData(); |
||||||
|
textSettingPane.populateBean(numberEditor.getMobileTextEditAttr()); |
||||||
|
this.bindListeners2Widgets(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update() { |
||||||
|
NumberEditor numberEditor = (NumberEditor) getxCreator().toData(); |
||||||
|
textSettingPane.updateBean(numberEditor.getMobileTextEditAttr()); |
||||||
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.component.MobilePasswordEditSettingPane; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
|
||||||
|
/** |
||||||
|
* 密码控件移动端高级属性 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class PasswordMobileDefinePane extends BaseTextEditorMobileDefinePane { |
||||||
|
public PasswordMobileDefinePane(XCreator xCreator) { |
||||||
|
super(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void initSettingPane(JPanel container) { |
||||||
|
textSettingPane = new MobilePasswordEditSettingPane(); |
||||||
|
container.add(textSettingPane); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.widget.ui.designer.mobile.component.MobileTextAreaSettingPane; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文本域控件 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/29 |
||||||
|
*/ |
||||||
|
public class TextAreaAdvancedDefinePane extends BaseTextEditorMobileDefinePane { |
||||||
|
public TextAreaAdvancedDefinePane(XCreator xCreator) { |
||||||
|
super(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void initSettingPane(JPanel container) { |
||||||
|
textSettingPane = new MobileTextAreaSettingPane(); |
||||||
|
container.add(textSettingPane); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,43 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile.component; |
||||||
|
|
||||||
|
import com.fr.base.mobile.MobileTextEditAttr; |
||||||
|
import com.fr.design.gui.icheckbox.UICheckBox; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
/** |
||||||
|
* 密码控件编辑属性设置面板 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/30 |
||||||
|
*/ |
||||||
|
public class MobilePasswordEditSettingPane extends MobileTextEditSettingPane { |
||||||
|
// 显示字数统计
|
||||||
|
private UICheckBox showPassword; |
||||||
|
|
||||||
|
public MobilePasswordEditSettingPane() { |
||||||
|
super(); |
||||||
|
showPassword = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Password"), false); |
||||||
|
this.add(showPassword, BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected boolean getClearDefaultState() { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(MobileTextEditAttr ob) { |
||||||
|
super.populateBean(ob); |
||||||
|
// 要兼容处理一下,为null 的话赋默认值,默认开启
|
||||||
|
this.showPassword.setSelected(ob.isShowPassword() == null || ob.isShowPassword()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void updateBean(MobileTextEditAttr ob) { |
||||||
|
super.updateBean(ob); |
||||||
|
ob.setShowPassword(showPassword.isSelected()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile.component; |
||||||
|
|
||||||
|
import com.fr.base.mobile.MobileTextEditAttr; |
||||||
|
import com.fr.design.gui.icheckbox.UICheckBox; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文本域控件 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/29 |
||||||
|
*/ |
||||||
|
public class MobileTextAreaSettingPane extends MobileTextEditSettingPane { |
||||||
|
// 显示字数统计
|
||||||
|
private UICheckBox showWordCount; |
||||||
|
|
||||||
|
public MobileTextAreaSettingPane() { |
||||||
|
super(); |
||||||
|
showWordCount = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Word_Count"), false); |
||||||
|
this.add(showWordCount, BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(MobileTextEditAttr ob) { |
||||||
|
super.populateBean(ob); |
||||||
|
// 要兼容处理一下,为null 的话赋默认值,默认不开启
|
||||||
|
this.showWordCount.setSelected(ob.isShowWordCount() != null && ob.isShowWordCount()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void updateBean(MobileTextEditAttr ob) { |
||||||
|
super.updateBean(ob); |
||||||
|
ob.setShowWordCount(showWordCount.isSelected()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile.component; |
||||||
|
|
||||||
|
import com.fr.base.mobile.MobileTextEditAttr; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.icheckbox.UICheckBox; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.VerticalFlowLayout; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.FlowLayout; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文本类基础设置 |
||||||
|
* |
||||||
|
* @author Coral.Chen |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/3/29 |
||||||
|
*/ |
||||||
|
public class MobileTextEditSettingPane extends BasicBeanPane<MobileTextEditAttr> { |
||||||
|
// 允许一键清空
|
||||||
|
protected UICheckBox allowOneClickClear; |
||||||
|
|
||||||
|
public MobileTextEditSettingPane() { |
||||||
|
initLayout(); |
||||||
|
allowOneClickClear = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Allow_One_Click_Clear"), getClearDefaultState()); |
||||||
|
this.add(allowOneClickClear, BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
protected boolean getClearDefaultState() { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
protected void initLayout() { |
||||||
|
VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(FlowLayout.LEADING, 0, 5); |
||||||
|
verticalFlowLayout.setAlignLeft(true); |
||||||
|
this.setLayout(verticalFlowLayout); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(MobileTextEditAttr ob) { |
||||||
|
allowOneClickClear.setSelected(ob.isAllowOneClickClear() != null && ob.isAllowOneClickClear()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public MobileTextEditAttr updateBean() { |
||||||
|
// do nothing
|
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void updateBean(MobileTextEditAttr ob) { |
||||||
|
ob.setAllowOneClickClear(allowOneClickClear.isSelected()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |