Browse Source

Merge pull request #3108 in DESIGN/design from release/10.0 to bugfix/10.0

* commit 'f6f1ed8bf13d21e6f95f0d32c69b54cf8a893b5c':
  CHART-15835  标签面板调整
  CHART-17429   仪表盘轴重置面板时候重置html页面监听
  代码修改
  删除无用import
  删除无用域
  KERNEL-6224 新增模板操作事件
bugfix/10.0
superman 4 years ago
parent
commit
8786cae5e8
  1. 21
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java
  4. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  5. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  6. 3
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

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

@ -49,6 +49,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview; import com.fr.design.preview.PagePreview;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.event.EventDispatcher;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.MemFILE; import com.fr.file.MemFILE;
@ -107,7 +108,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private DesignModelAdapter<T, ?> designModel; private DesignModelAdapter<T, ?> designModel;
private PreviewProvider previewType; private PreviewProvider previewType;
protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer();
public int resolution = ScreenResolution.getScreenResolution();
private PluginEventListener pluginListener; private PluginEventListener pluginListener;
@ -125,6 +125,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public JTemplate(T t, FILE file, boolean isNewFile) { public JTemplate(T t, FILE file, boolean isNewFile) {
super(t); super(t);
beforeInit();
// 判断是否切换设计器状态到禁止拷贝剪切 // 判断是否切换设计器状态到禁止拷贝剪切
if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT); DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT);
@ -301,6 +302,20 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
/**
* 模板初始化之前
*/
private void beforeInit() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this);
}
/**
* 模板激活之前之前
*/
protected void beforeActive() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this);
}
/** /**
* 模板关闭时 * 模板关闭时
*/ */
@ -309,6 +324,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
PluginListenerRegistration.getInstance().stopListen(this.pluginListener); PluginListenerRegistration.getInstance().stopListen(this.pluginListener);
} }
/** /**
* 刷新内部资源 * 刷新内部资源
* *
@ -1076,6 +1092,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活指定的template * 激活指定的template
*/ */
public void activeJTemplate(int index, JTemplate jt) { public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this); DesignerContext.getDesignerFrame().activateJTemplate(this);
} }
@ -1083,6 +1100,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活已存在的模板 * 激活已存在的模板
*/ */
public void activeOldJTemplate() { public void activeOldJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this); DesignerContext.getDesignerFrame().activateJTemplate(this);
} }
@ -1090,6 +1108,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活新的模板 * 激活新的模板
*/ */
public void activeNewJTemplate() { public void activeNewJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().addAndActivateJTemplate(this); DesignerContext.getDesignerFrame().addAndActivateJTemplate(this);
} }

19
designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java

@ -0,0 +1,19 @@
package com.fr.design.mainframe;
import com.fr.event.Event;
/**
* Created by kerry on 2020-12-11
*/
public enum JTemplateEvent implements Event<JTemplate> {
/**
* 模板初始化之前
*/
BEFORE_TEMPLATE_INIT,
/**
* 模板激活之前
*/
BEFORE_TEMPLATE_ACTIVE
}

3
designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

@ -208,6 +208,7 @@ public class JVirtualTemplate extends JTemplate {
@Override @Override
public void activeJTemplate(int index, JTemplate jt) { public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
historyList.set(index, jt); historyList.set(index, jt);
DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt); DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt);
@ -217,11 +218,13 @@ public class JVirtualTemplate extends JTemplate {
@Override @Override
public void activeOldJTemplate() { public void activeOldJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
} }
@Override @Override
public void activeNewJTemplate() { public void activeNewJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
} }

1
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -176,6 +176,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
gaugeStyle = gaugePlot.getGaugeStyle(); gaugeStyle = gaugePlot.getGaugeStyle();
reLayoutPane(false); reLayoutPane(false);
parent.initAllListeners(); parent.initAllListeners();
setParentPane(parent);
} }
populateBean(gaugePlot.getGaugeAxis()); populateBean(gaugePlot.getGaugeAxis());
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -158,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
return jPanel; return jPanel;
} }
private JPanel createLabelBorderPane() { protected JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane(); borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return borderPaneWithTitle; return borderPaneWithTitle;
} }
private JPanel createLabelBackgroundPane() { protected JPanel createLabelBackgroundPane() {
backgroundPane = new VanChartBackgroundWithOutImagePane() { backgroundPane = new VanChartBackgroundWithOutImagePane() {
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents() {

3
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
@ -49,7 +48,6 @@ public class FormDesignerUI extends ComponentUI {
private FormDesigner designer; private FormDesigner designer;
private SelectionModel selectionModel; private SelectionModel selectionModel;
private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0); private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0);
private float time;
public FormDesignerUI() { public FormDesignerUI() {
} }
@ -71,7 +69,6 @@ public class FormDesignerUI extends ComponentUI {
@Override @Override
public void paint(final Graphics g, JComponent c) { public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent(); XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution();
AffineTransform at = new AffineTransform(); AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) { if (rootComponent.getParent() != null) {
at.translate(designer.getPaintX(), designer.getPaintY()); at.translate(designer.getPaintX(), designer.getPaintY());

Loading…
Cancel
Save