Browse Source
* 'feature/x' of ssh://code.fineres.com:7999/~fanglei/design10.0: (92 commits) REPORT-60538 英日韩环境未屏蔽在线组件库 REPORT-61276 决策报表-最新的release包,打开决策报表会打开一个空cpt;新建frm正常 REPORT-61205 标准色视觉修改 REPORT-61275 部分任务默认工具栏展开 REPORT-61267 【FR11】【组件背景分离】组件复用-组件标题图案的“图案相对位置”切换不生效了,只有在重新上传图案的时候才生效;“位置”也不生效 REPORT-61249 视觉图变动 无JIRA任务 换一下svg图片,原来的svg图片有点变形 REPORT-61237【固定布局-原布局推荐4.1】决策报表-自适应布局-新建空白模板,切换到固定布局,此时无法往设计画布里拖入组件 REPORT-61055 【主题获取】主题导出插件几个小问题 REPORT-60991 导出参数设置面板添加无响应 REPORT-52578 10.0兼容新自适应插件的同步代码在11.0中需要改成异步的 REPORT-61105 & REPORT-61096 & REPORT-61012 控件联动及兼容老模板调整 REPORT-61177 解决引导页弹窗展示变成半透明的问题 REPORT-61207 行间距减小,放在window上文字截断 REPORT-61219 【主题获取】右键有主题的组件,鼠标从获取主题滑到详细说明,两个都被选中了 REPORT-60942 加载图视觉更新 REPORT-60661 国际化url适配 REPORT-60661 国际化url适配 REPORT-60661 国际化url适配 REPORT-61125 交互优化更新 ... # Conflicts: # designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.javafeature/x
方磊
3 years ago
134 changed files with 1988 additions and 954 deletions
@ -0,0 +1,11 @@
|
||||
package com.fr.design.beans; |
||||
|
||||
import javax.swing.JComponent; |
||||
|
||||
public interface ErrorMsgTextFieldAdapter { |
||||
void setText(String str); |
||||
|
||||
String getText(); |
||||
|
||||
JComponent getErrorMsgTextField(); |
||||
} |
@ -0,0 +1,46 @@
|
||||
package com.fr.design.beans; |
||||
|
||||
import com.fr.design.gui.itextfield.UITextField; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.DocumentEvent; |
||||
import javax.swing.event.DocumentListener; |
||||
|
||||
public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter { |
||||
private final UITextField uiTextField = new UITextField(); |
||||
|
||||
public UITextFieldAdapter(){ |
||||
addDocumentListener(); |
||||
} |
||||
@Override |
||||
public void setText(String str) { |
||||
uiTextField.setText(str); |
||||
} |
||||
|
||||
@Override |
||||
public String getText() { |
||||
return uiTextField.getText(); |
||||
} |
||||
|
||||
public void addDocumentListener() { |
||||
uiTextField.getDocument().addDocumentListener(new DocumentListener() { |
||||
|
||||
public void changedUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
|
||||
public void insertUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
|
||||
public void removeUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
@Override |
||||
public JComponent getErrorMsgTextField() { |
||||
return uiTextField; |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.fr.design.data; |
||||
|
||||
public class NameChangeBean { |
||||
private String oldName; |
||||
private String changedName; |
||||
|
||||
public NameChangeBean(String oldName, String changedName) { |
||||
this.oldName = oldName; |
||||
this.changedName = changedName; |
||||
} |
||||
|
||||
public String getOldName() { |
||||
return oldName; |
||||
} |
||||
|
||||
public void setOldName(String oldName) { |
||||
this.oldName = oldName; |
||||
} |
||||
|
||||
public String getChangedName() { |
||||
return changedName; |
||||
} |
||||
|
||||
public void setChangedName(String changedName) { |
||||
this.changedName = changedName; |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.formula; |
||||
|
||||
public class FormulaCheckerException extends Exception { |
||||
public FormulaCheckerException() { |
||||
|
||||
} |
||||
|
||||
public FormulaCheckerException(String message) { |
||||
super(message); |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.gui.frpane.RegFieldPane; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
public interface RegPaneProvider extends Immutable { |
||||
int CURRENT_LEVEL = 1; |
||||
String XML_TAG = "RegPaneProvider"; |
||||
|
||||
RegFieldPane createRegPane(); |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.ErrorMsgTextFieldAdapter; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
public interface TextFieldAdapterProvider extends Immutable { |
||||
String XML_TAG = "TextFieldAdapterProvider"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
ErrorMsgTextFieldAdapter createTextFieldAdapter(); |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.RegPaneProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* 2021/10/8 15:19 |
||||
*/ |
||||
@API(level = RegPaneProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractRegPaneProvider implements RegPaneProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.TextFieldAdapterProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* 2021/10/8 15:17 |
||||
*/ |
||||
@API(level = TextFieldAdapterProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractTextFieldAdapterProvider implements TextFieldAdapterProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
@ -0,0 +1,47 @@
|
||||
package com.fr.design.gui.frpane; |
||||
|
||||
import java.awt.Component; |
||||
import java.awt.Container; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/9/17 |
||||
*/ |
||||
public class AttributeChangeUtils { |
||||
private static AbstractAttrNoScrollPane findNearestAttrNoScrollPaneAncestor(Component c) { |
||||
for(Container p = c.getParent(); p != null; p = p.getParent()) { |
||||
if (p instanceof AbstractAttrNoScrollPane) { |
||||
return (AbstractAttrNoScrollPane) p; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static void changeComposedUI(Component composedComponent, boolean fireMiddleStateChanged, UIChangeAction action) { |
||||
AbstractAttrNoScrollPane attrPane = findNearestAttrNoScrollPaneAncestor(composedComponent); |
||||
boolean oldAutoFire = true; |
||||
|
||||
if (!fireMiddleStateChanged) { |
||||
// 禁止属性面板自动处理属性更新
|
||||
if (attrPane != null) { |
||||
oldAutoFire = attrPane.isAutoFireAttributesChanged(); |
||||
attrPane.setAutoFireAttributesChanged(false); |
||||
} |
||||
} |
||||
|
||||
// 更新UI
|
||||
action.changeComposedUI(); |
||||
|
||||
if (!fireMiddleStateChanged) { |
||||
// 恢复属性面板自动处理属性更新
|
||||
if (attrPane != null) { |
||||
attrPane.setAutoFireAttributesChanged(oldAutoFire); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public interface UIChangeAction { |
||||
void changeComposedUI(); |
||||
} |
||||
} |
@ -0,0 +1,98 @@
|
||||
package com.fr.design.mainframe.guide.ui; |
||||
|
||||
import javax.swing.JPanel; |
||||
import javax.swing.Timer; |
||||
import java.awt.AlphaComposite; |
||||
import java.awt.BasicStroke; |
||||
import java.awt.Color; |
||||
import java.awt.Composite; |
||||
import java.awt.Dimension; |
||||
import java.awt.Graphics; |
||||
import java.awt.Graphics2D; |
||||
import java.awt.Image; |
||||
import java.awt.Point; |
||||
import java.awt.RenderingHints; |
||||
import java.awt.Stroke; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-10-23 |
||||
*/ |
||||
public class GuideLoadingPane extends JPanel { |
||||
private static final BasicStroke STROKE = new BasicStroke(4); |
||||
private static final int FPS = 30; |
||||
private static final int START_ANGLE = 90; |
||||
private static GuideLoadingPane imagePanel; |
||||
private Image image; |
||||
private int angle; |
||||
private Timer timer; |
||||
|
||||
public static GuideLoadingPane getInstance() { |
||||
if (imagePanel == null) { |
||||
imagePanel = new GuideLoadingPane(); |
||||
} |
||||
return imagePanel; |
||||
} |
||||
|
||||
public GuideLoadingPane() { |
||||
this.setOpaque(false); |
||||
this.setPreferredSize(new Dimension(50, 50)); |
||||
timer = new Timer(1000 / FPS, new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
repaint(); |
||||
angle -= 180 / FPS; // 5 degrees per 100 ms = 50 degrees/second
|
||||
if (angle > -270) { |
||||
angle += 2 * 360; |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public void start() { |
||||
angle = START_ANGLE; |
||||
timer.start(); |
||||
} |
||||
|
||||
public void stop() { |
||||
timer.stop(); |
||||
} |
||||
|
||||
@Override |
||||
public void paintComponent(Graphics g) { |
||||
super.paintComponent(g); |
||||
Graphics2D g2 = (Graphics2D) g; |
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
||||
|
||||
Composite oldComposite = g2.getComposite(); |
||||
Stroke oldStroke = g2.getStroke(); |
||||
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); |
||||
|
||||
int d = Math.min(getWidth(), getHeight()); |
||||
int r = d / 2; |
||||
Point circlePoint = new Point(getWidth() / 2, getHeight() / 2); |
||||
|
||||
g2.setColor(Color.WHITE); |
||||
g2.fillOval(circlePoint.x - r, circlePoint.y - r, d, d); |
||||
|
||||
g2.setColor(Color.BLACK); |
||||
int waitCircleD = d / 10; |
||||
int waitCircleR = waitCircleD / 2; |
||||
|
||||
g2.fillOval(circlePoint.x - r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); |
||||
g2.fillOval(circlePoint.x - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); |
||||
g2.fillOval(circlePoint.x + r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); |
||||
|
||||
|
||||
g2.setStroke(STROKE); |
||||
g2.setColor(Color.decode("#419BF9")); |
||||
|
||||
int lineWidth = (int) STROKE.getLineWidth(); |
||||
g2.drawArc(circlePoint.x - r + lineWidth / 2 , circlePoint.y - r + lineWidth / 2, d - lineWidth, d - lineWidth, angle, -90); |
||||
|
||||
g2.setStroke(oldStroke); |
||||
g2.setComposite(oldComposite); |
||||
} |
||||
} |
@ -1,28 +0,0 @@
|
||||
package com.fr.design.mainframe.guide.ui; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.Graphics; |
||||
import java.awt.Image; |
||||
import java.awt.Toolkit; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-10-23 |
||||
*/ |
||||
public class ImagePanel extends JPanel { |
||||
|
||||
|
||||
private Image image; |
||||
|
||||
public ImagePanel(String imagePath) { |
||||
image = Toolkit.getDefaultToolkit().createImage(ImagePanel.class |
||||
.getResource(imagePath)); |
||||
} |
||||
|
||||
@Override |
||||
public void paintComponent(Graphics g) { |
||||
super.paintComponent(g); |
||||
if (image != null) { |
||||
g.drawImage(image, 0, 0, getWidth(), getHeight(), this); |
||||
} |
||||
} |
||||
} |
Before Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 2.1 KiB |
@ -1,77 +0,0 @@
|
||||
package com.fr.design.actions; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.fit.DesignerUIModeConfig; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.design.report.fit.menupane.TemplateFitAttrPane; |
||||
import com.fr.report.fit.FitProvider; |
||||
import com.fr.report.fit.ReportFitAttr; |
||||
|
||||
import javax.swing.KeyStroke; |
||||
import java.awt.event.ActionEvent; |
||||
|
||||
/** |
||||
* Created by Administrator on 2015/7/6 0006. |
||||
*/ |
||||
public class FormFitAttrAction extends JTemplateAction { |
||||
private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'T'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return DesignerUIModeConfig.getInstance().newUIMode() ? |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_PC_Adaptive_Attr") : |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
public FormFitAttrAction(JTemplate jTemplate) { |
||||
super(jTemplate); |
||||
initMenuStyle(); |
||||
} |
||||
|
||||
private void initMenuStyle() { |
||||
this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE); |
||||
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(DesignerUIModeConfig.getInstance().newUIMode() ? |
||||
"/com/fr/design/images/reportfit/fit.png" : |
||||
"/com/fr/design/images/reportfit/fit"); |
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
final JTemplate jwb = getEditingComponent(); |
||||
if (jwb == null) { |
||||
return; |
||||
} |
||||
final FitProvider wbTpl = (FitProvider) jwb.getTarget(); |
||||
ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); |
||||
TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(jwb); |
||||
showFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); |
||||
} |
||||
|
||||
private void showFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) { |
||||
attrPane.populateBean(fitAttr); |
||||
UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { |
||||
@Override |
||||
public void doOk() { |
||||
wbTpl.setReportFitAttr(attrPane.updateBean()); |
||||
jwb.fireTargetModified(); |
||||
} |
||||
}); |
||||
dialog.setVisible(true); |
||||
} |
||||
} |
@ -0,0 +1,54 @@
|
||||
package com.fr.design.mainframe.share.ui.actions; |
||||
|
||||
import com.fr.design.gui.imenu.UIMenuItem; |
||||
import com.fr.design.mainframe.share.ui.constants.ColorConstants; |
||||
import com.fr.general.IOUtils; |
||||
|
||||
import javax.swing.Action; |
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.Icon; |
||||
import java.awt.Graphics; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/10/19 |
||||
*/ |
||||
public class LoadingMenuItem extends UIMenuItem { |
||||
private boolean loading = false; |
||||
|
||||
private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/form/images/loading.gif"); |
||||
|
||||
public LoadingMenuItem(Action action) { |
||||
super(action); |
||||
setOpaque(true); |
||||
setBackground(ColorConstants.BACKGROUND); |
||||
setUI(new SharedComponentActionMenuItemUI()); |
||||
} |
||||
|
||||
public void startLoading() { |
||||
loading = true; |
||||
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); |
||||
revalidate(); |
||||
repaint(); |
||||
} |
||||
|
||||
public void stopLoading() { |
||||
loading = false; |
||||
setBorder(BorderFactory.createEmptyBorder()); |
||||
revalidate(); |
||||
repaint(); |
||||
} |
||||
|
||||
public boolean isLoading() { |
||||
return loading; |
||||
} |
||||
|
||||
@Override |
||||
protected void paintBorder(Graphics g) { |
||||
super.paintBorder(g); |
||||
if (loading) { |
||||
profileIcon.paintIcon(this, g, getWidth() - 20, 0); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,75 @@
|
||||
package com.fr.design.mainframe.share.ui.actions; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.gui.imenu.UIMenuItemUI; |
||||
import com.fr.design.gui.imenu.UIPopupMenu; |
||||
import com.fr.design.mainframe.share.ui.constants.ColorConstants; |
||||
import com.fr.design.utils.gui.GUIPaintUtils; |
||||
import com.fr.stable.Constants; |
||||
|
||||
import javax.swing.ButtonModel; |
||||
import javax.swing.JMenu; |
||||
import javax.swing.JMenuItem; |
||||
import javax.swing.MenuSelectionManager; |
||||
import java.awt.Color; |
||||
import java.awt.Component; |
||||
import java.awt.Container; |
||||
import java.awt.Graphics; |
||||
import java.awt.Graphics2D; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/10/18 |
||||
*/ |
||||
public class SharedComponentActionMenuItemUI extends UIMenuItemUI { |
||||
|
||||
@Override |
||||
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { |
||||
ButtonModel model = menuItem.getModel(); |
||||
Color oldColor = g.getColor(); |
||||
int menuWidth = menuItem.getWidth(); |
||||
int menuHeight = menuItem.getHeight(); |
||||
|
||||
g.setColor(ColorConstants.BACKGROUND); |
||||
g.fillRect(0, 0, menuWidth, menuHeight); |
||||
if (menuItem.isOpaque()) { |
||||
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
} else { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); |
||||
} |
||||
g.setColor(oldColor); |
||||
} else if (model.isArmed() || (menuItem instanceof JMenu && |
||||
model.isSelected())) { |
||||
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
||||
g.setColor(oldColor); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void doClick(MenuSelectionManager msm) { |
||||
if (hasLoadingMenuItem()) { |
||||
return; |
||||
} |
||||
|
||||
if (menuItem instanceof LoadingMenuItem) { |
||||
menuItem.doClick(0); |
||||
} else { |
||||
super.doClick(msm); |
||||
} |
||||
} |
||||
|
||||
private boolean hasLoadingMenuItem() { |
||||
Container parent = menuItem.getParent(); |
||||
if (parent instanceof UIPopupMenu) { |
||||
Component[] components = parent.getComponents(); |
||||
for (Component component: components) { |
||||
if (component instanceof LoadingMenuItem && ((LoadingMenuItem) component).isLoading()) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue