Browse Source

Merge branch 'release/10.0' of ssh://code.fineres.com:7999/~zheng/C-design into release/10.0

zheng-1641779399395
shine 3 years ago
parent
commit
043a81042d
  1. 5
      designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java
  2. 7
      designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java
  3. 26
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  4. 18
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  5. 18
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java
  6. 11
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  7. 2
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  8. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  9. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

5
designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java

@ -0,0 +1,5 @@
package com.fr.design.constants;
public class TableDataConstants {
public static final String SEPARATOR = "_";
}

7
designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java

@ -1,6 +1,7 @@
package com.fr.design.data; package com.fr.design.data;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.constants.TableDataConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -11,8 +12,6 @@ import com.fr.stable.StringUtils;
* Created by hades on 2020/4/27 * Created by hades on 2020/4/27
*/ */
public abstract class BasicTableDataUtils { public abstract class BasicTableDataUtils {
private static final String SEPARATOR = "_";
private static final int LEN = 2; private static final int LEN = 2;
@ -38,10 +37,10 @@ public abstract class BasicTableDataUtils {
public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) { public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) {
if (isCover) { if (isCover) {
return srcName + SEPARATOR + tdName; return srcName + TableDataConstants.SEPARATOR + tdName;
} }
if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称
tdName = srcName + SEPARATOR + tdName; tdName = srcName + TableDataConstants.SEPARATOR + tdName;
} }
int i = 0; int i = 0;
while (tds.getTableData(tdName) != null) { while (tds.getTableData(tdName) != null) {

26
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -57,6 +57,7 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
@ -68,6 +69,7 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull; import com.fr.third.javax.annotation.Nonnull;
import java.util.Set;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.Icon; import javax.swing.Icon;
@ -375,4 +377,28 @@ public class XCreatorUtils {
return xCreator; return xCreator;
} }
public static boolean isExtraContainer(XCreator creator) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);
for (FormWidgetOptionProvider provider : set) {
if (provider.isContainer()
&& ComparatorUtils.equals(provider.appearanceForWidget(), provider.appearanceForWidget())
&& ComparatorUtils.equals(provider.classForWidget(), creator.toData().getClass())) {
return true;
}
}
return false;
}
public static XLayoutContainer getParent(XCreator source) {
if (source.acceptType(XWCardTagLayout.class) ) {
return (XLayoutContainer)source.getParent();
}
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source);
boolean accept = (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) && !isExtraContainer(source);
if (accept) {
container = null;
}
return container;
}
} }

18
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -62,10 +62,6 @@ public class XWCardLayout extends XLayoutContainer {
public static final String DEFAULT_NAME = "cardlayout"; public static final String DEFAULT_NAME = "cardlayout";
//默认蓝色标题背景
private static final Color TITLE_COLOR = new Color(51, 132, 240);
public XWCardLayout(WCardLayout widget, Dimension initSize) { public XWCardLayout(WCardLayout widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
} }
@ -399,24 +395,10 @@ public class XWCardLayout extends XLayoutContainer {
@Override @Override
public void refreshStylePreviewEffect() { public void refreshStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
initBorderTitleStyle(style);
refreshBorderAndBackgroundStylePreviewEffect(); refreshBorderAndBackgroundStylePreviewEffect();
clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE));
} }
private void initBorderTitleStyle(BorderPacker style) {
//初始化默认标题样式
if (!initFlag) {
return;
}
style.setType(LayoutBorderStyle.TITLE);
style.setBorder(Constants.LINE_THIN);
TitlePacker widgetTitle = style.getTitle();
widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR));
initFlag = false;
}
//隐藏或显示标题部分 //隐藏或显示标题部分
protected void clearOrShowTitleLayout(boolean isTitleStyle) { protected void clearOrShowTitleLayout(boolean isTitleStyle) {
XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent(); XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent();

18
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.gui.xpane; package com.fr.design.gui.xpane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.JPanel; import javax.swing.JPanel;
/** /**
@ -10,6 +12,8 @@ import javax.swing.JPanel;
*/ */
public class CardTagLayoutStylePane extends LayoutStylePane { public class CardTagLayoutStylePane extends LayoutStylePane {
private LayoutBorderStyle backupStyleFromPopulating = new LayoutBorderStyle();
@Override @Override
protected JPanel createTitleStylePane(){ protected JPanel createTitleStylePane(){
JPanel panel = super.createTitleStylePane(); JPanel panel = super.createTitleStylePane();
@ -21,4 +25,18 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
return super.createBackgroundStylePane(false); return super.createBackgroundStylePane(false);
} }
@Override
public void populateBean(LayoutBorderStyle style) {
this.backupStyleFromPopulating = style;
super.populateBean(style);
}
@Override
public LayoutBorderStyle updateBean() {
LayoutBorderStyle style = super.updateBean();
style.setTitle(backupStyleFromPopulating.getTitle());
style.setType(backupStyleFromPopulating.getType());
return style;
}
} }

11
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -7,6 +7,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.gui.chart.ChartXMLTag; import com.fr.design.gui.chart.ChartXMLTag;
import com.fr.design.gui.core.FormWidgetOption; import com.fr.design.gui.core.FormWidgetOption;
@ -19,6 +20,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -99,6 +101,15 @@ public class FormParaWidgetPane extends JPanel {
synchronized (FormParaWidgetPane.class) { synchronized (FormParaWidgetPane.class) {
THIS = null; THIS = null;
} }
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null && !template.isJWorkBook()) {
DesignerContext.getDesignerFrame().resetToolkitByPlus(template);
}
}
});
} }
}, new PluginFilter() { }, new PluginFilter() {

2
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -1085,7 +1085,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} }
Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator(); Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = bindInfo.getName() + "-" + tdIterator.next(); String tdName = bindInfo.getName() + TableDataConstants.SEPARATOR + tdIterator.next();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName);
} }
} }

7
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -67,12 +67,9 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
initDefinePane(); initDefinePane();
} }
@Deprecated
public XLayoutContainer getParent(XCreator source) { public XLayoutContainer getParent(XCreator source) {
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); return XCreatorUtils.getParent(source);
if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) {
container = null;
}
return container;
} }
public WidgetBoundPane createWidgetBoundPane(XCreator xCreator) { public WidgetBoundPane createWidgetBoundPane(XCreator xCreator) {

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -61,15 +61,9 @@ public class WidgetBoundPane extends BasicPane {
initBoundPane(); initBoundPane();
} }
@Deprecated
public XLayoutContainer getParent(XCreator source) { public XLayoutContainer getParent(XCreator source) {
if(source.acceptType(XWCardTagLayout.class)){ return XCreatorUtils.getParent(source);
return (XLayoutContainer)source.getParent();
}
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source);
if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) {
container = null;
}
return container;
} }
public void initBoundPane() { public void initBoundPane() {

Loading…
Cancel
Save