Browse Source

Merge remote-tracking branch 'basic/dev' into dev

master
xiaohu 8 years ago
parent
commit
935502624a
  1. 17
      designer/src/com/fr/grid/DefaultGridUIProcessor.java
  2. 26
      designer/src/com/fr/grid/Grid.java
  3. 49
      designer/src/com/fr/grid/GridUI.java
  4. 23
      designer_base/src/com/fr/design/fun/GridUIProcessor.java
  5. 4
      designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java
  6. 4
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java
  7. 4
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java
  8. 15
      designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java
  9. 6
      designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java
  10. 4
      designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java
  11. 4
      designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java
  12. 4
      designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java
  13. 4
      designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java
  14. 2
      designer_chart/src/com/fr/design/module/ChartDesignerModule.java
  15. 4
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  16. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  17. 19
      designer_form/src/com/fr/design/mainframe/FormModelAdapter.java

17
designer/src/com/fr/grid/DefaultGridUIProcessor.java

@ -0,0 +1,17 @@
package com.fr.grid;
import com.fr.design.fun.impl.AbstractGridUIProcessor;
import javax.swing.plaf.ComponentUI;
/**
* Created by Administrator on 2016/6/28/0028.
*/
public class DefaultGridUIProcessor extends AbstractGridUIProcessor{
@Override
public ComponentUI appearanceForGrid(int resolution) {
return new GridUI(resolution);
}
}

26
designer/src/com/fr/grid/Grid.java

@ -3,20 +3,11 @@
*/
package com.fr.grid;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.util.Hashtable;
import java.util.Iterator;
import com.fr.base.DynamicUnitList;
import com.fr.design.cell.editor.CellEditor;
import com.fr.design.cell.editor.FloatEditor;
import com.fr.design.cell.editor.FormulaCellEditor;
import com.fr.design.cell.editor.GeneralCellEditor;
import com.fr.design.cell.editor.GeneralFloatEditor;
import com.fr.design.cell.editor.TextCellEditor;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.cell.editor.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.fun.GridUIProcessor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -40,6 +31,13 @@ import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.StringUtils;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.util.Hashtable;
import java.util.Iterator;
/**
* Grid used to paint and edit grid.
*
@ -144,7 +142,9 @@ public class Grid extends BaseGridComponent {
*
*/
public void updateUI() {
this.setUI(new GridUI(resolution));
GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor());
ComponentUI localComponentUI = localGridUIProcessor.appearanceForGrid(this.resolution);
setUI(localComponentUI);
}
/**

49
designer/src/com/fr/grid/GridUI.java

@ -1,38 +1,6 @@
package com.fr.grid;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.Line2D.Double;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.Formula;
import com.fr.base.GraphHelper;
import com.fr.base.Margin;
import com.fr.base.PaperSize;
import com.fr.base.Utils;
import com.fr.base.*;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageBackground;
import com.fr.design.constants.UIConstants;
@ -70,6 +38,15 @@ import com.fr.stable.script.CalculatorUtils;
import com.fr.stable.unit.FU;
import com.fr.third.antlr.ANTLRException;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.awt.geom.*;
import java.awt.geom.Line2D.Double;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GridUI extends ComponentUI {
public static int INVALID_INTEGER = Integer.MIN_VALUE;// 作为不合法的数值.
@ -438,7 +415,7 @@ public class GridUI extends ComponentUI {
paintDetailedCellElements(g2d, cells, tmpCellElement, reportPane, selectedCellElement, hideWidth, hideHeight, oldClip, report);
paintBorder(g2d, tmpCellElement, report);
paintFatherLeft(g2d);
paintFatherLeft(g2d, selectedCellElement, report);
}
private void paintDetailedCellElements(Graphics2D g2d, Iterator cells, TemplateCellElement tmpCellElement, ElementCasePane reportPane,
@ -565,7 +542,7 @@ public class GridUI extends ComponentUI {
}
}
private void paintFatherLeft(Graphics2D g2d) {
protected void paintFatherLeft(Graphics2D g2d, CellElement selectedCellElement, TemplateElementCase report) {
// 画左父格子.
if (validate(this.left_col_row_rect) && this.left_col_row_rect.getHeight() > 5) {
g2d.setPaint(Color.BLUE);
@ -827,7 +804,7 @@ public class GridUI extends ComponentUI {
}
}
private void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) {
protected void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) {
// denny: 标记格子的边框
formulaCellArea = new Area(new Rectangle2D.Double(this.tmpRectangle.getX(),
this.tmpRectangle.getY(), this.tmpRectangle.getWidth(),

23
designer_base/src/com/fr/design/fun/GridUIProcessor.java

@ -0,0 +1,23 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Immutable;
import javax.swing.plaf.ComponentUI;
/**
* 自定义单元格ui接口
*
* @return
*/
public interface GridUIProcessor extends Immutable {
String MARK_STRING = "GridUIProcessor";
int CURRENT_LEVEL = 1;
/**
* 自定义gridui, 用于实现一些自定义的格子绘制.
*
* @return 自定义gridui
*/
ComponentUI appearanceForGrid(int paramInt);
}

4
designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java

@ -13,4 +13,8 @@ public abstract class AbstractCellAttributeProvider implements CellAttributeProv
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

4
designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java

@ -13,6 +13,10 @@ public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcess
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
public String changeEnvPathBeforeConnect(String userName, String password, String path){
return path;
}

4
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java

@ -16,6 +16,10 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
/**
* 生成属性表

15
designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java

@ -0,0 +1,15 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.GridUIProcessor;
import com.fr.stable.fun.mark.API;
@API(level = GridUIProcessor.CURRENT_LEVEL)
public abstract class AbstractGridUIProcessor implements GridUIProcessor {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

6
designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java

@ -7,13 +7,17 @@ import com.fr.stable.fun.mark.API;
* Created by zhouping on 2015/9/20.
*/
@API(level = IndentationUnitProcessor.CURRENT_LEVEL)
public class AbstractIndentationUnitProcessor implements IndentationUnitProcessor {
public abstract class AbstractIndentationUnitProcessor implements IndentationUnitProcessor {
private int indentationUnit = 1;
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
public void setIndentationUnit(int value){
this.indentationUnit = value;

4
designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java

@ -14,4 +14,8 @@ public abstract class AbstractTDPaneProcessor implements TableDataPaneProcessor
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

4
designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java

@ -10,5 +10,9 @@ public abstract class AbstractTitleProcessor implements TitlePlaceProcessor {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

4
designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java

@ -15,4 +15,8 @@ public abstract class AbstractUIFormulaProcessor implements UIFormulaProcessor {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

4
designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java

@ -15,4 +15,8 @@ public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

2
designer_chart/src/com/fr/design/module/ChartDesignerModule.java

@ -1 +1 @@
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App<?>[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } }
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App<?>[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if(rowChart == null) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } }

4
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -94,6 +94,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
FitProvider wbTpl = (FitProvider) designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);

2
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java

@ -10,7 +10,7 @@ import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.gui.itable.PropertyGroup;
import com.fr.design.gui.xtable.ReportAppPropertyGroupModel;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor;
import com.fr.design.mainframe.widget.editors.RefinedDoubleEditor;
import com.fr.form.ui.ElementCaseEditor;

19
designer_form/src/com/fr/design/mainframe/FormModelAdapter.java

@ -1,20 +1,16 @@
package com.fr.design.mainframe;
import java.util.ArrayList;
import java.util.List;
import com.fr.base.Parameter;
import com.fr.design.DesignModelAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.form.main.Form;
import com.fr.form.main.WidgetGatherAdapter;
import com.fr.form.ui.ChartEditorProvider;
import com.fr.form.ui.DataControl;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.form.ui.*;
import com.fr.stable.js.WidgetName;
import java.util.ArrayList;
import java.util.List;
public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm> {
public FormModelAdapter(BaseJForm jForm) {
@ -100,4 +96,9 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm> {
return linkAbleList.toArray(new Widget[linkAbleList.size()]);
}
@Override
public Parameter[] getParameters() {
return this.getBook().getParameters();
}
}
Loading…
Cancel
Save