Browse Source

Merge remote-tracking branch 'origin/final/10.0' into final/10.0

final/10.0
Destiny.Lin 1 year ago
parent
commit
eed4de1f69
  1. 14
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  2. 14
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  3. 24
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java
  5. 2
      designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java
  6. 12
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  7. 52
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java
  8. 0
      designer-chart/src/main/resources/com/fr/design/images/en_us_emptydata.png
  9. 0
      designer-chart/src/main/resources/com/fr/design/images/zh_cn_emptydata.png
  10. BIN
      designer-chart/src/main/resources/com/fr/design/images/zh_tw_emptydata.png
  11. 110
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  12. 37
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  13. 13
      designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPane.java
  14. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  15. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  16. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardMainLayoutDefinePane.java
  17. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java
  18. 28
      designer-realize/src/main/java/com/fr/design/mainframe/ReportHyperlinkGroupPane.java
  19. 49
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

14
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -185,12 +185,24 @@ public abstract class UpdateAction extends ShortCut implements Action {
* @param resource 图标资源路径
*/
public void setSmallIcon(String resource) {
setSmallIcon(resource, true);
}
/**
* 使用传入资源url的方式设置Icon会自动设置_normal.svg然后通过needDisable参数判断是否需要自动设置_disable.svg
* 因为有些地方是不需要设置灰化图标的所以不存在灰化图标资源这边如果一并设置就会报错文件找不到
* @param resource
* @param needDisable
*/
public void setSmallIcon(String resource, boolean needDisable) {
if (StringUtils.equals(resource, StringUtils.EMPTY)) {
this.putValue(Action.SMALL_ICON, null);
return;
}
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
if (needDisable) {
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}
}
public void setSmallIcon(Icon[] smallIcon, boolean white) {

14
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -766,8 +766,8 @@ public class MutilTempalteTabPane extends JComponent {
// 如果关闭的模板是当前选中的模板,则重新激活当前 selectIndex 的模板;
// selectIndex 没有变化,但是对应的模板已经变成了前一张模板
if (closeIconIndex == selectedIndex || isCloseCurrent) {
// 如果 closeIconIndex 是最后一个被渲染画出的,那么预览上一个,防止数组越界
if (closeIconIndex >= maxPaintIndex) {
// 如果当前关闭的模板在最右侧,那么预览上一个,防止数组越界
if (selectedIndex >= maxPaintIndex) {
// selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true
selectedIndex--;
}
@ -953,6 +953,10 @@ public class MutilTempalteTabPane extends JComponent {
return;
}
}
//参考CloseCurrentTemplateAction,在closeFormat与closeSpecifiedTemplate之前要先设定isCloseCurrent,这样关闭之后才会自动切换tab
if (checkCurrentClose(template)) {
setIsCloseCurrent(true);
}
closeFormat(template);
closeSpecifiedTemplate(template);
DesignerContext.getDesignerFrame().getContentFrame().repaint();
@ -985,6 +989,12 @@ public class MutilTempalteTabPane extends JComponent {
}
private boolean checkCurrentClose(JTemplate template) {
JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
//10.0无JTemplate.isValid
return currentTemplate != null && ComparatorUtils.equals(template.getPath(), currentTemplate.getPath());
}
private class MultiTemplateTabMouseMotionListener implements MouseMotionListener {
/**

24
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java

@ -9,10 +9,16 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Filter;
import com.fr.stable.Nameable;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.util.Arrays;
import java.util.stream.Stream;
/**
* Coder: zack
@ -27,6 +33,8 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
ShortCut4JControlPane[] shorts;
NameableCreator[] creators;
protected Filter<NameableCreator> creatorsFilter;
private ToolBarDef toolbarDef;
UIToolbar toolBar;
@ -38,6 +46,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
JControlPane() {
this.initShortCutFactory();
this.initCreatorsFilter();
this.initComponentPane();
}
@ -106,6 +115,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
this.checkButtonEnabled();
}
protected void initCreatorsFilter() {
this.creatorsFilter = nameableCreator -> true;
}
protected void initCardPane() {
this.controlUpdatePane = createControlUpdatePane();
@ -183,7 +196,12 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
}
public NameableCreator[] creators() {
return creators == null ? new NameableCreator[0] : creators;
if (creators == null) {
return new NameableCreator[0];
} else {
Stream<NameableCreator> nameableCreatorStream = Arrays.stream(creators).filter(creator -> creatorsFilter.accept(creator));
return nameableCreatorStream.toArray(NameableCreator[]::new);
}
}
/**

4
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java

@ -142,10 +142,6 @@ public class ShortCutFactory extends AbstractShortCutFactory {
private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) {
Filter<Class<? extends JavaScript>> filter = DesignModuleFactory.getHyperlinkGroupType().getFilter();
if (!filter.accept(creator.getHyperlink())) {
continue;
}
boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) ||
ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database"));
if (isTrue) {

2
designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java

@ -20,7 +20,7 @@ import java.net.URI;
public class ServicePlatformAction extends UpdateAction {
public ServicePlatformAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title"));
this.setSmallIcon("/com/fr/design/images/platform/platform");
this.setSmallIcon("/com/fr/design/images/platform/platform", false);
}
@Override

12
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java

@ -14,8 +14,8 @@ import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.locale.image.LocaleImageFactory;
import com.fr.general.locale.image.LocaleImageMark;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
@ -26,7 +26,6 @@ import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import java.io.File;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
@ -35,6 +34,8 @@ import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
/**
* Created by mengao on 2017/11/23.
@ -61,10 +62,11 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private Image emptyDataImage = DEFAULT_EMPTY_DATA_IMAGE;
private SwingWorker<Void, Void> imageWorker;
private static final String EMPTY_DATA_IMAGE_PATH = "/com/fr/design/images/emptydata.png";
static {
DEFAULT_EMPTY_DATA_IMAGE = GeneralContext.isChineseEnv() ? IOUtils.readImage("com/fr/design/images/zh_emptydata.png")
: IOUtils.readImage("com/fr/design/images/us_emptydata.png");
LocaleImageMark localeImageMark = LocaleImageFactory.getOrCreateLocaleMark(EMPTY_DATA_IMAGE_PATH);
DEFAULT_EMPTY_DATA_IMAGE = localeImageMark.getValue();
}
@Override

52
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java

@ -13,6 +13,7 @@ import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkP
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane;
import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
@ -21,7 +22,10 @@ import com.fr.design.hyperlink.ReportletHyperlinkPane;
import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.javascript.JavaScriptImplPane;
import com.fr.design.javascript.ParameterJavaScriptPane;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript;
import com.fr.js.FormHyperlinkProvider;
@ -148,24 +152,23 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
setPlot(plot);
HashMap paneMap = getHyperlinkMap(plot);
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
Map<String, NameObjectCreator> creators = new ListMap<>();
int size = list.size();
NameObjectCreator[] creators = new NameObjectCreator[list.size() + providers.size()];
for (int i = 0; i < size; i++) {
UIMenuNameableCreator uiMenuNameableCreator = list.get(i);
creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz());
NameObjectCreator creator = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz());
creators.put(uiMenuNameableCreator.getName(), creator);
}
//安装平台内打开插件时, 添加/替换 相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) {
NameableCreator creator = provider.createHyperlinkCreator();
if (creator != null) {
creators[size] = new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane());
size++;
creators.put(creator.menuName(), new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()));
}
}
refreshNameableCreator(creators);
refreshNameableCreator(creators.values().toArray(new NameObjectCreator[0]));
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
@ -281,4 +284,37 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
}
@Override
protected void initCreatorsFilter() {
this.creatorsFilter = nameableCreator -> {
Class<? extends JavaScript> clazz = nameableCreator.getHyperlink();
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template == null) {
return false;
}
if (template.isJWorkBook()) {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
return !ComparatorUtils.equals(clazz, formHyperlink.getClass());
} else {
// 如果是决策报表
if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
// 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink选项
return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class);
}
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
for (Class aClass : classes) {
if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) {
// 编辑的是决策报表中的图表,那么没有 ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项
if (ComparatorUtils.equals(aClass, clazz)) {
return false;
}
}
}
}
return true;
};
}
}

0
designer-chart/src/main/resources/com/fr/design/images/us_emptydata.png → designer-chart/src/main/resources/com/fr/design/images/en_us_emptydata.png

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

0
designer-chart/src/main/resources/com/fr/design/images/zh_emptydata.png → designer-chart/src/main/resources/com/fr/design/images/zh_cn_emptydata.png

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

BIN
designer-chart/src/main/resources/com/fr/design/images/zh_tw_emptydata.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

110
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -12,6 +12,7 @@ import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.XButton;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ilable.UILabel;
@ -27,17 +28,28 @@ import com.fr.form.ui.container.WTabTextDirection;
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background;
import com.fr.general.act.BorderPacker;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.act.BorderPacker;
import com.fr.general.act.TitlePacker;
import com.fr.general.cardtag.TemplateStyle;
import com.fr.stable.ProductConstants;
import com.fr.stable.unit.PT;
import javax.swing.*;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicLabelUI;
import java.awt.*;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
@ -243,52 +255,43 @@ public class XCardSwitchButton extends XButton {
//SwitchButton对应的XWCardLayout和XWCardTagLayout暂未存到xml中,重新打开时根据父子层关系获取
private void initRelateLayout(){
this.tagLayout = (XWCardTagLayout)this.getBackupParent();
private void initRelateLayout() {
this.tagLayout = (XWCardTagLayout) this.getBackupParent();
XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.tagLayout.getBackupParent();
XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout)titleLayout.getBackupParent();
XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout) titleLayout.getBackupParent();
this.cardLayout = borderLayout.getCardPart();
}
//是否进入点击关闭按钮区域
private boolean isSelectedClose(MouseEvent e, FormDesigner designer){
/**
* <p> 是否进入点击关闭按钮区域
* <p> 计算逻辑
* <p> 先得到鼠标的绝对坐标 -> tab布局的绝对坐标 -> 得到鼠标相对tab的坐标有参数面板时要减去参数面板的高度
* <p> 再计算删除区域位置的相对坐标通过对比判定鼠标是否在点击关闭按钮区域内鼠标的位置(ex,ey)
* <li> 当前点击tag删除区域的x坐标 < ex < 当前点击tag删除区域的x坐标 + 偏移量</li>
* <li> 当前点击tag删除区域的y坐标 < ey < 当前点击tag删除区域的y坐标 + 偏移量</li>
*
* @param e 鼠标事件
* @param designer 表单编辑对象
* @return true/false 在内/不在
*/
private boolean isSelectedClose(MouseEvent e, FormDesigner designer) {
int diff = designer.getHorizontalScaleValue();
// mouse position
// 这里是鼠标的绝对位置
int ex = e.getX() + diff;
int ey = e.getY();
//获取tab布局的位置,鼠标相对于tab按钮的位置
Container mainLayout = cardLayout.getBackupParent();
Point point = mainLayout.getLocation();
int y = 0;
int x = 0;
//遍历一下,不然是相对位置,嵌套后位置不对
while (mainLayout.getParent() != null){
if(mainLayout instanceof XWCardLayout){
y += mainLayout.getY();
}
mainLayout = mainLayout.getParent();
if(mainLayout instanceof XWCardMainBorderLayout){
x += mainLayout.getX();
y += mainLayout.getY();
}
}
double mainX = point.getX() + x;
double mainY = point.getY() + y;
// 获取tab布局的位置,鼠标相对于tab按钮的位置
double[] tabPositionInBody = getTabAbsolutePositionInBody();
// 参数界面对坐标的影响
JForm jform = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if(jform.getFormDesign().getParaComponent() != null){
if (jform.getFormDesign().getParaComponent() != null) {
ey -= jform.getFormDesign().getParaHeight();
}
//减掉tab布局的相对位置
ex -= mainX;
ey -= mainY;
ex -= tabPositionInBody[0];
ey -= tabPositionInBody[1];
XLayoutContainer titleLayout = tagLayout.getBackupParent();
Point titlePoint = titleLayout.getLocation();
@ -298,10 +301,43 @@ public class XCardSwitchButton extends XButton {
int width = button.getWidth();
// 鼠标进入按钮右侧删除图标区域
double recX = position.getX() + titlePoint.getX() + (width - CLOSE_ICON_RIGHT_OFFSET);
double recX = position.getX() + titlePoint.getX() + (width - CLOSE_ICON_RIGHT_OFFSET);
double recY = position.getY() + titlePoint.getY() + CLOSE_ICON_TOP_OFFSET;
// 比较的是相对位置的偏移量是否在一定距离内
// 所以要得到鼠标相对于当前tab块的坐标
return (recX < ex && ex < recX + CLOSE_ICON_RIGHT_OFFSET && ey < recY && ey > position.getY());
}
/**
* 获取tab布局在body内的绝对位置
*
* @return
*/
private double[] getTabAbsolutePositionInBody() {
// 获取tab布局的位置,鼠标相对于tab按钮的位置
Container mainLayout = cardLayout.getBackupParent();
// 这个point是当前tab布局的相对坐标,是相对于父容器的坐标
// 比如父级是一个absolute块,放在左上角,现在得到的point就是(0,0)
Point point = mainLayout.getLocation();
int y = 0;
int x = 0;
// 遍历一下,不然是相对位置,嵌套后位置不对
// 这里是要得到tab布局的绝对位置,所以要加上父组件的位置
while (mainLayout.getParent() != null) {
if (mainLayout instanceof XWCardLayout) {
y += mainLayout.getY();
}
mainLayout = mainLayout.getParent();
return (recX < ex && ex < recX + CLOSE_ICON_RIGHT_OFFSET && ey < recY && ey > position.getY());
if ((mainLayout instanceof XWCardMainBorderLayout) || (mainLayout instanceof XWAbsoluteLayout)) {
x += mainLayout.getX();
y += mainLayout.getY();
}
}
double mainX = point.getX() + x;
double mainY = point.getY() + y;
return new double[]{mainX, mainY};
}
//将当前switchButton改为选中状态
@ -313,7 +349,7 @@ public class XCardSwitchButton extends XButton {
}
}
@Override
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;

37
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

@ -25,20 +25,24 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WTabDisplayPosition;
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.act.BorderPacker;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.act.BorderPacker;
import com.fr.general.cardtag.DefaultTemplateStyle;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Rectangle;
import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent;
import java.util.HashMap;
@ -441,7 +445,7 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
}
private void fixTitleLayout(XLayoutContainer parent){
private void fixTitleLayout(XLayoutContainer parent) {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(formDesigner, parent);
if (layoutAdapter != null) {
@ -450,4 +454,31 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
}
}
/**
* <p> 对于tab组件WCardMainBorderLayout里面有两个子容器:
* <li> WCardTitleLayout里面包含两个部分一个是CardAddButton另一个是WCardTagLayout - tabpane0 </li>
* <li> WCardLayout里面放的是WTabFitLayout - tab00tab10</li>
* <p> 在右侧组件树选择删除WCardTagLayout时tabpane0按照现在的产品逻辑应该删除整个tab组件
*
* @param creator 组件
* @param designer 表单设计器
*/
@Override
public void deleteRelatedComponent(XCreator creator, FormDesigner designer) {
XWCardTagLayout tagLayout = (XWCardTagLayout) creator;
// 先删除所有tab按钮
tagLayout.removeAll();
//逐层回溯找出最外层的XWCardMainBorderLayout
XWCardTitleLayout cardTitleLayout = (XWCardTitleLayout) tagLayout.getBackupParent();
XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) cardTitleLayout.getBackupParent();
// 删除tab布局
SelectionModel selectionModel = designer.getSelectionModel();
if (mainLayout != null) {
selectionModel.setSelectedCreator(mainLayout);
selectionModel.deleteSelection();
}
LayoutUtils.layoutRootContainer(designer.getRootComponent());
FormHierarchyTreePane.getInstance().refreshRoot();
selectionModel.setSelectedCreator(designer.getRootComponent());
}
}

13
designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPane.java

@ -1,13 +1,14 @@
package com.fr.design.gui.xpane;
import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.form.javascript.FormEmailPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.ComparatorUtils;
import com.fr.js.EmailJavaScript;
import com.fr.js.JavaScript;
public class FormHyperlinkGroupPane extends HyperlinkGroupPane {
private static FormHyperlinkGroupPane singleton;
@ -23,6 +24,16 @@ public class FormHyperlinkGroupPane extends HyperlinkGroupPane {
return singleton;
}
@Override
protected void initCreatorsFilter() {
this.creatorsFilter = nameableCreator -> {
Class<? extends JavaScript> clazz = nameableCreator.getHyperlink();
// 决策报表没有 ChartHyperRelateFloatLink
return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class);
};
}
/**
* 生成添加按钮的NameableCreator
* 由于表单报表块的单元格超链和单元格条件属性超链中的emailPane都要用表单的emailPane这里调整下

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -68,7 +68,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"));
UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font"));
fontLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{
new Component[]{widgetValueLabel, formWidgetValuePane},

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -44,7 +44,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
new Component[]{widgetValueLabel, formWidgetValuePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictionaryEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font")), fontSizePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane},
new Component[]{buttonGroupDictPane, null}
};
double[] rowSize = {p, p, p, p, p, p, p};

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardMainLayoutDefinePane.java

@ -7,16 +7,13 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xpane.CardTagLayoutStylePane;
import com.fr.design.gui.xpane.LayoutStylePane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleCardTagWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -72,6 +69,9 @@ public class WCardMainLayoutDefinePane extends AbstractDataModify<WCardMainBorde
@Override
public void populateBean(WCardMainBorderLayout ob) {
WCardLayout cardLayout = ob.getCardPart();
if (cardLayout == null) {
return;
}
stylePane.populateBean((LayoutBorderStyle) cardLayout.getBorderStyle());
setCarousel.setSelected(cardLayout.isCarousel());
IntervalPane.setVisible(cardLayout.isCarousel());

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java

@ -24,7 +24,6 @@ import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.Background;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.cardtag.TemplateStyle;
import javax.swing.BorderFactory;
@ -107,8 +106,11 @@ public class WCardTagLayoutDefinePane extends AbstractDataModify<WCardTagLayout>
public void populateBean(WCardTagLayout ob) {
//标题背景和字体属性设置在WCardLayout上做兼容
XLayoutContainer topLayout = creator.getTopLayout();
if (topLayout.getComponentCount() == 0) {
// 没有子组件,不用做处理
return;
}
LayoutBorderStyle layoutBorderStyle = (LayoutBorderStyle) ((XWCardMainBorderLayout) topLayout).getCardPart().toData().getBorderStyle();
displayPositionGroup.setSelectedIndex(ob.getDisplayPosition().getType());
textDirectionGroup.setSelectedIndex(ob.getTextDirection().getType());
backgroundEditor.setValue(layoutBorderStyle.getTitle().getBackground());

28
designer-realize/src/main/java/com/fr/design/mainframe/ReportHyperlinkGroupPane.java

@ -1,21 +1,11 @@
package com.fr.design.mainframe;
import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import java.awt.*;
import com.fr.general.ComparatorUtils;
import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.bridge.StableFactory;
/**
* Created by plough on 2017/7/21.
@ -37,10 +27,20 @@ public class ReportHyperlinkGroupPane extends HyperlinkGroupPane {
}
protected void refreshPane() {
ElementCasePane reportPane = ((JWorkBook)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).getEditingElementCasePane();
ElementCasePane reportPane = ((JWorkBook) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).getEditingElementCasePane();
if (reportPane == null) {
return;
}
populate(reportPane);
}
@Override
protected void initCreatorsFilter() {
this.creatorsFilter = nameableCreator -> {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
return !ComparatorUtils.equals(nameableCreator.getHyperlink(), formHyperlink.getClass());
};
}
}

49
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -20,6 +20,7 @@ import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
@ -29,7 +30,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.ToLongFunction;
import java.util.stream.Collectors;
/**
* Created by XiaXiang on 2017/3/27.
@ -120,7 +121,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
return lessModelList;
}
SearchResult noConnectList = AlphaFineHelper.getNoConnectList(Holder.INSTANCE);
if(noConnectList != null){
if (noConnectList != null) {
return noConnectList;
}
for (int j = 0; j < searchText.length; j++) {
@ -184,7 +185,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
List<PluginModel> pluginModels = new ArrayList<>();
pluginModels.addAll(parseDefaultPluginModel(plugins));
pluginModels.forEach(m->this.defaultModelList.add(m));
pluginModels.forEach(m -> this.defaultModelList.add(m));
} catch (Exception e) {
FineLoggerFactory.getLogger().error("plugin search error :" + e.getMessage());
@ -196,33 +197,31 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
/**
* 将jsonobject转化为PluginModel
* 并按照更新时间排序取最新的10个
* */
* 并按照更新时间排序取最新的10个并过滤掉不是当前版本的
*/
List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) {
List<PluginModel> pluginModels = new ArrayList<>();
String version = "v" + ProductConstants.MAIN_VERSION;
if (!Collections.isEmpty(jsonObjects)) {
SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT);
try {
jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() {
@Override
public long applyAsLong(Map value) {
long time = 0L;
try {
time = format.parse((String) value.get(UPLOAD_TIME)).getTime();
} catch (ParseException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
return time;
}
}));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
for (int i = 0; i < DEFAULT_LIST_SIZE; i++) {
pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false));
}
pluginModels = jsonObjects.stream()
.filter(o -> ((Integer) o.get(version)) == 1)
.sorted((Map map1, Map map2) -> Long.compare(parseTime(map2), parseTime(map1)))
.limit(DEFAULT_LIST_SIZE)
.map(jsonObject -> getPluginModel(new JSONObject(jsonObject), false))
.collect(Collectors.toList());
}
return pluginModels;
}
private static long parseTime(Map value) {
SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT);
long t = 0L;
try {
t = format.parse((String) value.get(UPLOAD_TIME)).getTime();
} catch (ParseException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
return t;
}
}

Loading…
Cancel
Save