Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/release/10.0)

* commit 'd72bc467a66226d2083ee76b5e787eb4aaeeba8e':
  CHART-21785 cpt编辑状态背景和当前页面颜色背景一样 design
  REPORT-62554 再打开设计器模板会空白
zheng-1641779399395
Hades 3 years ago
parent
commit
afbe5f618a
  1. 14
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  2. 16
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

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 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) {
if (DesignModeContext.isDuchampMode()) {
Style style = cellElement.getStyle();
@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils {
public static void adjustFloatElement(FloatElement floatElement) {
if (DesignModeContext.isDuchampMode()) {
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));
floatElement.setStyle(style);
}
}
public static Color adjustBack(Color color) {
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color;
return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color;
}
}

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

@ -73,15 +73,13 @@ class FormApp extends AbstractAppProvider {
@Override
public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult();
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
return getJForm(result.getBaseBook(), tplFile, result.getRef());
}
});
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
return getJForm(result.getBaseBook(), tplFile, result.getRef());
}
return emptyForm;
} 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
private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);

Loading…
Cancel
Save