Browse Source

Merge pull request #6769 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '538bcda0047060ad0800a66d50b9f4377d208314':
  CHART-22020 【设计器】大屏编辑器-第一次启动设计器-插件加载成功后,reportlets根目录显示不了FVS模板,只有点击工具栏的刷新按钮才能出现
  REPORT-62275 tab高度弹窗撤销问题
  CHART-21785 cpt编辑状态背景和当前页面颜色背景一样 design
  REPORT-62554 再打开设计器模板会空白
feature/10.0
superman 3 years ago
parent
commit
2a9d0bfd7a
  1. 18
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  2. 10
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 14
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  4. 13
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  5. 16
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

18
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -34,6 +34,7 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event; import com.fr.event.Event;
@ -101,6 +102,23 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE);
} }
}); });
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
DesignerFrameFileDealerPane.getInstance().refresh();
DesignerFrameFileDealerPane.getInstance().stateChange();
}
});
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign, App.MARK_STRING);
}
});
} }
private List<FileToolbarStateChangeListener> otherToolbarStateChangeListeners = new ArrayList<>(); private List<FileToolbarStateChangeListener> otherToolbarStateChangeListeners = new ArrayList<>();

10
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -581,6 +581,16 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
fireSuperTargetModified(); fireSuperTargetModified();
} }
public void undoToCurrent() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
BaseUndoState current = JTemplate.this.getUndoState();
current.applyState();
}
});
}
/** /**
* 模板更新 * 模板更新
*/ */

14
designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java

@ -18,6 +18,16 @@ public class AdjustWorkBookDefaultStyleUtils {
private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43);
private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110);
private static Color currentStoryBack = null;
public static void setCurrentStoryBack(Color color) {
currentStoryBack = color;
}
private static Color getCurrentStoryBack() {
return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack;
}
public static void adjustCellElement(CellElement cellElement) { public static void adjustCellElement(CellElement cellElement) {
if (DesignModeContext.isDuchampMode()) { if (DesignModeContext.isDuchampMode()) {
Style style = cellElement.getStyle(); Style style = cellElement.getStyle();
@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils {
public static void adjustFloatElement(FloatElement floatElement) { public static void adjustFloatElement(FloatElement floatElement) {
if (DesignModeContext.isDuchampMode()) { if (DesignModeContext.isDuchampMode()) {
Style style = floatElement.getStyle(); Style style = floatElement.getStyle();
style = style.deriveBackground(ColorBackground.getInstance(TEMPLATE_BACKGROUND)); style = style.deriveBackground(ColorBackground.getInstance(getCurrentStoryBack()));
style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE));
floatElement.setStyle(style); floatElement.setStyle(style);
} }
} }
public static Color adjustBack(Color color) { public static Color adjustBack(Color color) {
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color;
} }
} }

13
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -65,17 +65,8 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
if (minConstraint > value) { if (minConstraint > value) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null && jt.getUndoManager().canUndo()) { if (jt != null) {
// 自适应布局平分高度导致变矮的场景,优先做撤销 jt.undoToCurrent();
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
jt.undo();
}
});
} else if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
} }
return true; return true;
} else { } else {

16
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -73,15 +73,13 @@ class FormApp extends AbstractAppProvider {
@Override @Override
public JTemplate<?, ?> call() throws Exception { public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult(); OpenResult<Form, Parameter[]> result = worker.getResult();
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, return getJForm(result.getBaseBook(), tplFile, result.getRef());
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
} }
}); });
worker.start(tplFile.getPath()); worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult(); OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) { if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, return getJForm(result.getBaseBook(), tplFile, result.getRef());
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
} }
return emptyForm; return emptyForm;
} else { } else {
@ -90,6 +88,16 @@ class FormApp extends AbstractAppProvider {
} }
} }
@Nullable
private JForm getJForm(Form form, FILE file, Parameter[] parameters) {
try {
return new JForm(form, file, parameters);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
return null;
}
}
@Nullable @Nullable
private Form getForm(FILE tplFile) { private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);

Loading…
Cancel
Save