diff --git a/build.9.0.gradle b/build.9.0.gradle
index 8268c0f6bb..f2fe428502 100644
--- a/build.9.0.gradle
+++ b/build.9.0.gradle
@@ -11,12 +11,12 @@ task appletJar<<{
mkdir(dir:"./tmp")
mkdir(dir:"build/classes/main")
copy(todir:"build/classes/"){
- fileset(dir:"${basicDir}/core/build/classes/main")
fileset(dir:"${basicDir}/chart/build/classes/main")
fileset(dir:"${basicDir}/report/build/classes/main")
fileset(dir:"${basicDir}/platform/build/classes/main")
}
- unjar(src:"${libDir}/3rd.jar",dest:"./tmp")
+ unjar(src:"${libDir}/fr-core-9.0.jar",dest:"./tmp")
+ unjar(src:"${libDir}/fr-third-9.0.jar",dest:"./tmp")
unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp")
jar(jarfile:"build/libs/fr-applet-9.0.jar"){
fileset(dir:"build/classes"){
diff --git a/designer/designer.iml b/designer/designer.iml
deleted file mode 100644
index 9ff693f288..0000000000
--- a/designer/designer.iml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/ButtonGroupAction.java b/designer/src/com/fr/design/actions/ButtonGroupAction.java
index ad461c1f0d..b45a5d34a1 100644
--- a/designer/src/com/fr/design/actions/ButtonGroupAction.java
+++ b/designer/src/com/fr/design/actions/ButtonGroupAction.java
@@ -6,12 +6,12 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.ElementCasePane;
public abstract class ButtonGroupAction extends ElementCaseAction{
- protected Icon[] iconArray;
+ protected Icon[][] iconArray;
protected Integer[] valueArray;
private UIButtonGroup group;
- protected ButtonGroupAction(ElementCasePane t, Icon[] iconArray, Integer[] valueArray) {
+ protected ButtonGroupAction(ElementCasePane t, Icon[][] iconArray, Integer[] valueArray) {
super(t);
this.iconArray = iconArray;
this.valueArray = valueArray;
@@ -36,7 +36,7 @@ public abstract class ButtonGroupAction extends ElementCaseAction{
break;
}
}
- if(value == -1 && createToolBarComponent().hasClick()) {
+ if(createToolBarComponent().hasClick()) {
index = getSelectedIndex();
createToolBarComponent().setClickState(false);
}
diff --git a/designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java
index 49eab99114..457c5bf725 100644
--- a/designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java
+++ b/designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java
@@ -1,10 +1,10 @@
package com.fr.design.actions.cell;
import com.fr.design.actions.CellSelectionAction;
-import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
@@ -14,87 +14,93 @@ import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.stable.ReportConstants;
-// TODO ALEX_SEP 这个类与AbstractCellAction有什么关系?
+/**
+ * TODO ALEX_SEP 这个类与AbstractCellAction有什么关系?
+ *
+ * @author null
+ */
public abstract class AbstractCellElementAction extends CellSelectionAction {
- protected AbstractCellElementAction(ElementCasePane t) {
- super(t);
- }
-
- @Override
- protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
- final ElementCasePane ePane = this.getEditingComponent();
- final TemplateElementCase tplEC = ePane.getEditingElementCase();
- TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
- if (editCellElement == null) {
- editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
- tplEC.addCellElement(editCellElement);
- }
- if (tplEC != null) {
- SheetUtils.calculateDefaultParent(tplEC);
- }
- final CellSelection finalCS = cs;
- final BasicPane bp = populateBasicPane(editCellElement);
- BasicDialog dialog = bp.showWindow(DesignerContext.getDesignerFrame());
- dialog.addDialogActionListener(new DialogActionAdapter() {
- @Override
- public void doOk() {
- // 需要先行后列地增加新元素。
- for (int j = 0; j < finalCS.getRowSpan(); j++) {
- for (int i = 0; i < finalCS.getColumnSpan(); i++) {
- int column = i + finalCS.getColumn();
- int row = j + finalCS.getRow();
- TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row);
- if (editCellElement == null) {
- editCellElement = new DefaultTemplateCellElement(column, row);
- tplEC.addCellElement(editCellElement);
- }
- // alex:不加这一句话会导致跨行跨列的格子被多次update
- if (editCellElement.getColumn() != column || editCellElement.getRow() != row) {
- continue;
- }
- updateBasicPane(bp, editCellElement);
- // update cell attributes
- if (isNeedShinkToFit()) {
- // shink to fit.(如果value是String)
- Object editElementValue = editCellElement.getValue();
- if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) {
- // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面
- GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement);
- }
- }
- }
- }
- ePane.fireTargetModified();
- }
- });
+
+ protected AbstractCellElementAction() {
+ super();
+ }
+
+ protected AbstractCellElementAction(ElementCasePane t) {
+ super(t);
+ }
+
+ @Override
+ protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
+ final ElementCasePane ePane = this.getEditingComponent();
+ final TemplateElementCase tplEC = ePane.getEditingElementCase();
+ TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
+ if (editCellElement == null) {
+ editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
+ tplEC.addCellElement(editCellElement);
+ }
+ SheetUtils.calculateDefaultParent(tplEC);
+ final CellSelection finalCS = cs;
+ final BasicPane bp = populateBasicPane(editCellElement);
+ BasicDialog dialog = bp.showWindow(DesignerContext.getDesignerFrame());
+ dialog.addDialogActionListener(new DialogActionAdapter() {
+ @Override
+ public void doOk() {
+ // 需要先行后列地增加新元素。
+ for (int j = 0; j < finalCS.getRowSpan(); j++) {
+ for (int i = 0; i < finalCS.getColumnSpan(); i++) {
+ int column = i + finalCS.getColumn();
+ int row = j + finalCS.getRow();
+ TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row);
+ if (editCellElement == null) {
+ editCellElement = new DefaultTemplateCellElement(column, row);
+ tplEC.addCellElement(editCellElement);
+ }
+ // alex:不加这一句话会导致跨行跨列的格子被多次update
+ if (editCellElement.getColumn() != column || editCellElement.getRow() != row) {
+ continue;
+ }
+ updateBasicPane(bp, editCellElement);
+ // update cell attributes
+ if (isNeedShinkToFit()) {
+ // shink to fit.(如果value是String)
+ Object editElementValue = editCellElement.getValue();
+ if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) {
+ // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面
+ GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement);
+ }
+ }
+ }
+ }
+ ePane.fireTargetModified();
+ }
+ });
//控件设置记住dlg,提交入库智能添加单元格后可以show出来
DesignerContext.setReportWritePane(dialog);
- dialog.setVisible(true);
- return false;
- }
+ dialog.setVisible(true);
+ return false;
+ }
- /**
- * 初始化对话框
- *
- * @param cellElement
- * @return
- */
- protected abstract BasicPane populateBasicPane(TemplateCellElement cellElement);
+ /**
+ * 初始化对话框
+ *
+ * @param cellElement 单元格
+ * @return 对话框
+ */
+ protected abstract BasicPane populateBasicPane(TemplateCellElement cellElement);
- /**
- * 更新对话框之后,改变值
- *
- * @param cellElement
- * @return
- */
- protected abstract void updateBasicPane(BasicPane basicPane, TemplateCellElement cellElement);
+ /**
+ * 更新对话框之后,改变值
+ *
+ * @param cellElement 单元格
+ */
+ protected abstract void updateBasicPane(BasicPane basicPane, TemplateCellElement cellElement);
- /**
- * if isNeedShinkToFit,please override this method
- *
- * @return isNeedShinkToFit
- */
- protected boolean isNeedShinkToFit() {
- return false;
- }
+ /**
+ * if isNeedShinkToFit,please override this method
+ *
+ * @return isNeedShinkToFit
+ */
+ protected boolean isNeedShinkToFit() {
+ return false;
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/CellAttributeAction.java b/designer/src/com/fr/design/actions/cell/CellAttributeAction.java
index 949d72de0c..e2455a1599 100644
--- a/designer/src/com/fr/design/actions/cell/CellAttributeAction.java
+++ b/designer/src/com/fr/design/actions/cell/CellAttributeAction.java
@@ -1,5 +1,6 @@
package com.fr.design.actions.cell;
+import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
@@ -9,9 +10,9 @@ import com.fr.general.Inter;
public class CellAttributeAction extends CellAttributeTableAction {
public CellAttributeAction() {
this.setMenuKeySet(KeySetUtils.CELL_OTHER_ATTR);
- this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
+ this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
- // this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
}
@Override
diff --git a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
index 2906306d04..70812af32d 100644
--- a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
+++ b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
@@ -1,9 +1,10 @@
package com.fr.design.actions.cell;
-import java.awt.event.ActionEvent;
-
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.CellElementPropertyPane;
+import com.fr.design.mainframe.EastRegionContainerPane;
+
+import java.awt.event.ActionEvent;
/**
* 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表
@@ -20,4 +21,9 @@ public abstract class CellAttributeTableAction extends UpdateAction {
CellElementPropertyPane.getInstance().GoToPane(getID());
}
+ @Override
+ public void update() {
+ super.update();
+ this.setEnabled(EastRegionContainerPane.getInstance().isCellAttrPaneEnabled());
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java b/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
index f5307b2aca..e6f0fec248 100644
--- a/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
+++ b/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
@@ -1,24 +1,18 @@
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
-import com.fr.design.mainframe.ElementCasePane;
+import com.fr.design.actions.UpdateAction;
+import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils;
-import com.fr.design.present.CellWriteAttrPane;
-import com.fr.design.dialog.BasicPane;
-import com.fr.form.ui.Widget;
-import com.fr.general.FRLogger;
-import com.fr.grid.selection.CellSelection;
-import com.fr.grid.selection.Selection;
-import com.fr.privilege.finegrain.WidgetPrivilegeControl;
-import com.fr.report.cell.TemplateCellElement;
+
+import java.awt.event.ActionEvent;
/**
* Cell Widget Attribute.
*/
-public class CellWidgetAttrAction extends AbstractCellElementAction {
+public class CellWidgetAttrAction extends UpdateAction {
- public CellWidgetAttrAction(ElementCasePane t) {
- super(t);
+ public CellWidgetAttrAction() {
this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
@@ -26,47 +20,14 @@ public class CellWidgetAttrAction extends AbstractCellElementAction {
}
@Override
- protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
- CellWriteAttrPane pane = new CellWriteAttrPane(this.getEditingComponent());
- //got simple cell element from column and row.
- pane.populate(cellElement);
-
- return pane;
- }
-
- @Override
- protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
- CellWriteAttrPane pane = (CellWriteAttrPane) bp;
- if (cellElement.getWidget() == null) {
- pane.update(cellElement);
- return;
- }
- try {
- Widget oldWidget = (Widget) cellElement.getWidget().clone();
- pane.update(cellElement);
- //这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了
- Widget newWidget = cellElement.getWidget();
- if (newWidget.getClass() == oldWidget.getClass()) {
- newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
- }
- } catch (Exception e) {
- FRLogger.getLogger().error(e.getMessage());
- }
- }
-
- @Override
- protected boolean isNeedShinkToFit() {
- return true;
+ public void actionPerformed(ActionEvent e) {
+ EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
+ EastRegionContainerPane.getInstance().setWindow2PreferWidth();
}
@Override
public void update() {
- ElementCasePane ePane = this.getEditingComponent();
- Selection sel = ePane.getSelection();
- if (sel instanceof CellSelection) {
- this.setEnabled(true);
- } else {
- this.setEnabled(false);
- }
+ super.update();
+ this.setEnabled(EastRegionContainerPane.getInstance().isWidgetSettingsPaneEnabled());
}
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java b/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
new file mode 100644
index 0000000000..1aecf94d5f
--- /dev/null
+++ b/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
+ */
+package com.fr.design.actions.cell;
+
+import com.fr.base.BaseUtils;
+import com.fr.design.actions.UpdateAction;
+import com.fr.design.mainframe.EastRegionContainerPane;
+import com.fr.design.menu.KeySetUtils;
+
+import java.awt.event.ActionEvent;
+
+/**
+ * Condition Attributes.
+ */
+public class ConditionAttributesAction extends UpdateAction {
+ public ConditionAttributesAction() {
+ this.setMenuKeySet(KeySetUtils.CONDITION_ATTR);
+ this.setName(getMenuKeySet().getMenuKeySetName());
+ this.setMnemonic(getMenuKeySet().getMnemonic());
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png"));
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR);
+ EastRegionContainerPane.getInstance().setWindow2PreferWidth();
+ }
+
+ @Override
+ public void update() {
+ super.update();
+ this.setEnabled(EastRegionContainerPane.getInstance().isConditionAttrPaneEnabled());
+ }
+}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java b/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
index 27adef643a..63c38a042f 100644
--- a/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
+++ b/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
@@ -186,6 +186,7 @@ public class GlobalStyleMenuDef extends MenuDef {
}
stylePane.updateGlobalStyle(getEditingComponent());
+ CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer-Widget_Style"));
return true;
}
diff --git a/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java b/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
index 326b47f650..acc9b6302b 100644
--- a/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
+++ b/designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
@@ -1,40 +1,49 @@
package com.fr.design.actions.cell.style;
-import javax.swing.Icon;
-
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection;
-import com.fr.design.constants.UIConstants;
import com.fr.design.actions.ButtonGroupAction;
import com.fr.design.actions.utils.ReportActionUtils;
+import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
-import com.fr.general.Inter;
+import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.ElementCasePane;
+import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
+import com.fr.stable.Constants;
+
+import javax.swing.*;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface {
- public AlignmentAction(ElementCasePane t, Icon[] iconArray,
- Integer[] valueArray) {
- super(t, iconArray, valueArray);
- }
+ private static final Icon[][] ICONS = new Icon[][]{
+ {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png")},
+ {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png")},
+ {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")}};
- /**
- * executeStyle
- *
- * @param style
- * @param selectedStyle
- * @return style
- */
- public Style executeStyle(Style style, Style selectedStyle) {
- return style.deriveHorizontalAlignment(getSelectedValue());
- }
+ private static final Integer[] valueArray = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
+
+ public AlignmentAction(ElementCasePane t) {
+ super(t, ICONS, valueArray);
+ }
+
+
+ /**
+ * executeStyle
+ *
+ * @param style
+ * @param selectedStyle
+ * @return style
+ */
+ public Style executeStyle(Style style, Style selectedStyle) {
+ return style.deriveHorizontalAlignment(getSelectedValue());
+ }
/**
* 更新Style
@@ -45,67 +54,67 @@ public class AlignmentAction extends ButtonGroupAction implements StyleActionInt
setSelectedIndex(BaseUtils.getAlignment4Horizontal(style));
}
- /**
- * executeActionReturnUndoRecordNeeded
- *
- * @return
- */
- public boolean executeActionReturnUndoRecordNeeded() {
- ElementCasePane reportPane = this.getEditingComponent();
- if (reportPane == null) {
- return false;
- }
-
- return ReportActionUtils.executeAction(this, reportPane);
- }
-
- /**
- * update
- */
- public void update() {
- super.update();
-
- //peter:如果当前没有ReportFrame,不需要继续.
- if (!this.isEnabled()) {
- return;
- }
-
- //got simple cell element from row and column
- ElementCasePane reportPane = this.getEditingComponent();
- if (reportPane == null) {
- this.setEnabled(false);
- return;
- }
- Selection cs = reportPane.getSelection();
- TemplateElementCase tplEC = reportPane.getEditingElementCase();
-
- if (tplEC != null && cs instanceof FloatSelection) {
- FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
- Object value = selectedFloat.getValue();
- if (value instanceof BaseChartCollection) {
- this.setEnabled(false);
- return;
- }
- }
- this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
- }
-
- /**
- * 创建工具条,且有提示
- *
- * @return
- */
- public UIButtonGroup createToolBarComponent() {
- UIButtonGroup group = super.createToolBarComponent();
- if (group != null) {
- group.setForToolBarButtonGroup(true);
- group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
- }
- for (int i = 0; i < 3; i++) {
- group.getButton(i).setRoundBorder(true, UIConstants.ARC);
- group.getButton(i).setBorderPainted(true);
- }
- return group;
- }
+ /**
+ * executeActionReturnUndoRecordNeeded
+ *
+ * @return
+ */
+ public boolean executeActionReturnUndoRecordNeeded() {
+ ElementCasePane reportPane = this.getEditingComponent();
+ if (reportPane == null) {
+ return false;
+ }
+
+ return ReportActionUtils.executeAction(this, reportPane);
+ }
+
+ /**
+ * update
+ */
+ public void update() {
+ super.update();
+
+ //peter:如果当前没有ReportFrame,不需要继续.
+ if (!this.isEnabled()) {
+ return;
+ }
+
+ //got simple cell element from row and column
+ ElementCasePane reportPane = this.getEditingComponent();
+ if (reportPane == null) {
+ this.setEnabled(false);
+ return;
+ }
+ Selection cs = reportPane.getSelection();
+ TemplateElementCase tplEC = reportPane.getEditingElementCase();
+
+ if (tplEC != null && cs instanceof FloatSelection) {
+ FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
+ Object value = selectedFloat.getValue();
+ if (value instanceof BaseChartCollection) {
+ this.setEnabled(false);
+ return;
+ }
+ }
+ this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
+ }
+
+ /**
+ * 创建工具条,且有提示
+ *
+ * @return
+ */
+ public UIButtonGroup createToolBarComponent() {
+ UIButtonGroup group = super.createToolBarComponent();
+ if (group != null) {
+ group.setForToolBarButtonGroup(true);
+ group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
+ }
+ for (int i = 0; i < 3; i++) {
+ group.getButton(i).setRoundBorder(true, UIConstants.ARC);
+ group.getButton(i).setBorderPainted(true);
+ }
+ return group;
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
index 101d1f1f0d..7b62ffb513 100644
--- a/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
+++ b/designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
@@ -8,24 +8,27 @@ import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.gui.ibutton.UIToggleButton;
-import com.fr.general.FRFont;
-import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
+import com.fr.general.FRFont;
+import com.fr.general.Inter;
+
+import javax.swing.*;
/**
* Bold.
*/
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
- private UIToggleButton button;
- protected Style style;
+ private UIToggleButton button;
+ protected Style style;
+ private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png")};
- public ReportFontBoldAction(ElementCasePane t) {
- super(t);
+ public ReportFontBoldAction(ElementCasePane t) {
+ super(t);
- this.setName(Inter.getLocText("FRFont-bold"));
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
- }
+ this.setName(Inter.getLocText("FRFont-bold"));
+ this.setSmallIcon(ICONS, true);
+ }
/**
* 根据按钮状态获取格式
@@ -45,16 +48,17 @@ public class ReportFontBoldAction extends AbstractStyleAction implements ToggleB
createToolBarComponent().setSelected(true);
}
- return this.style;
- }
+ return this.style;
+ }
- protected void setSelectedFont(Style style) {
- this.style = StyleUtils.boldReportFont(style);
- }
- protected void setUnselectedFont(Style style) {
- this.style = StyleUtils.unBoldReportFont(style);
- }
+ protected void setSelectedFont(Style style) {
+ this.style = StyleUtils.boldReportFont(style);
+ }
+
+ protected void setUnselectedFont(Style style) {
+ this.style = StyleUtils.unBoldReportFont(style);
+ }
/**
* Update Style.
@@ -71,21 +75,21 @@ public class ReportFontBoldAction extends AbstractStyleAction implements ToggleB
createToolBarComponent().setSelected(isStyle(frFont));
}
- protected boolean isStyle(FRFont frFont) {
- return frFont.isBold();
- }
+ protected boolean isStyle(FRFont frFont) {
+ return frFont.isBold();
+ }
- /**
- * Gets component on toolbar.
- *
- * @return the created components on toolbar.
- */
- @Override
- public UIToggleButton createToolBarComponent() {
- if (button == null) {
- button = GUICoreUtils.createToolBarComponent(this);
- button.setEventBannded(true);
- }
- return button;
- }
+ /**
+ * Gets component on toolbar.
+ *
+ * @return the created components on toolbar.
+ */
+ @Override
+ public UIToggleButton createToolBarComponent() {
+ if (button == null) {
+ button = GUICoreUtils.createToolBarComponentWhiteIcon(this);
+ button.setEventBannded(true);
+ }
+ return button;
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
index 1e6c87a1aa..9fdf217dae 100644
--- a/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
+++ b/designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
@@ -10,16 +10,20 @@ import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
+import javax.swing.*;
+
/**
* Bold.
*/
public class ReportFontItalicAction extends ReportFontBoldAction {
-
- public ReportFontItalicAction(ElementCasePane t) {
+
+ private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png")};
+
+ public ReportFontItalicAction(ElementCasePane t) {
super(t);
- this.setName(Inter.getLocText("FRFont-italic"));
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
+ this.setName(Inter.getLocText("FR-Designer-FRFont_Italic"));
+ this.setSmallIcon(ICONS, true);
}
@@ -31,7 +35,6 @@ public class ReportFontItalicAction extends ReportFontBoldAction {
this.style = StyleUtils.unItalicReportFont(style);
}
-
protected boolean isStyle(FRFont frFont) {
return frFont.isItalic();
}
diff --git a/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java b/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
index e79782abfb..b44d696ce5 100644
--- a/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
+++ b/designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
@@ -11,15 +11,20 @@ import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.stable.Constants;
+import javax.swing.*;
+
/**
* Bold.
*/
public class ReportFontUnderlineAction extends ReportFontBoldAction {
- public ReportFontUnderlineAction(ElementCasePane t) {
+
+ private final static Icon[] ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline_white.png")};
+
+ public ReportFontUnderlineAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-Underline"));
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"));
+ this.setSmallIcon(ICONS, true);
}
protected void setSelectedFont (Style style) {
diff --git a/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java b/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java
index 8143409cfe..55c5f95ab2 100644
--- a/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java
+++ b/designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java
@@ -9,16 +9,34 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.report.cell.TemplateCellElement;
+/**
+ * 数据列过滤条件Action
+ *
+ * @author null
+ * @version 2017年11月17日15点11分
+ * @since 8.0
+ */
public class DSColumnConditionAction extends AbstractCellElementAction {
+ public DSColumnConditionAction() {
+ super();
+ this.setName(Inter.getLocText("Filter"));
+ this.setMnemonic('E');
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
+ }
+
public DSColumnConditionAction(ElementCasePane t) {
super(t);
-
this.setName(Inter.getLocText("Filter"));
this.setMnemonic('E');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
}
+ @Override
+ public void setEditingComponent(ElementCasePane casePane) {
+ super.setEditingComponent(casePane);
+ }
+
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
DSColumnConditionsPane dSColumnConditionsPane = new DSColumnConditionsPane();
diff --git a/designer/src/com/fr/design/actions/edit/HyperlinkAction.java b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java
new file mode 100644
index 0000000000..269d509174
--- /dev/null
+++ b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
+ */
+package com.fr.design.actions.edit;
+
+import com.fr.base.BaseUtils;
+import com.fr.design.actions.UpdateAction;
+import com.fr.design.mainframe.EastRegionContainerPane;
+import com.fr.design.menu.KeySetUtils;
+
+import java.awt.event.ActionEvent;
+
+/**
+ * HyperlinkAction.
+ */
+public class HyperlinkAction extends UpdateAction {
+
+ public HyperlinkAction() {
+ this.setMenuKeySet(KeySetUtils.HYPER_LINK);
+ this.setName(getMenuKeySet().getMenuKeySetName());
+ this.setMnemonic(getMenuKeySet().getMnemonic());
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK);
+ EastRegionContainerPane.getInstance().setWindow2PreferWidth();
+ }
+}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java
index e80e75fb9b..13a836c92a 100644
--- a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java
+++ b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java
@@ -139,7 +139,7 @@ public abstract class AbstractExportAction extends JWorkBookAction {
if (exporter instanceof AppExporter) {
AppExporter appExporter = (AppExporter) exporter;
if (exporter instanceof ExcelExporter || exporter instanceof CSVExporter
- || exporter instanceof PDFExporterProcessor || exporter instanceof WordExporter) {
+ || exporter instanceof PDFExporterProcessor || exporter instanceof WordExporter) {
ReportHelper.clearFormulaResult(tpl);// 清空rpt中的公式计算结果
appExporter.export(fileOutputStream, tpl.execute(parameterMap, ActorFactory.getActor(ActorConstants.TYPE_PAGE)
diff --git a/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java b/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java
index 499b9119df..56abd1e351 100644
--- a/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java
+++ b/designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java
@@ -3,8 +3,8 @@
*/
package com.fr.design.actions.insert.cell;
+import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
-import com.fr.base.Formula;
import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
@@ -48,6 +48,6 @@ public class FormulaCellAction extends AbstractCellAction implements WorkBookSup
@Override
public Class getCellValueClass() {
- return Formula.class;
+ return BaseFormula.class;
}
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
index 8f20a15773..292d4f2876 100644
--- a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
+++ b/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
@@ -4,6 +4,7 @@
package com.fr.design.actions.insert.flot;
import com.fr.base.BaseUtils;
+import com.fr.base.DynamicUnitList;
import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.actions.ElementCaseAction;
@@ -16,10 +17,14 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
+import com.fr.grid.Grid;
import com.fr.grid.selection.FloatSelection;
+import com.fr.report.ReportHelper;
import com.fr.report.cell.FloatElement;
+import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import com.fr.stable.bridge.StableFactory;
+import com.fr.stable.unit.FU;
import com.fr.stable.unit.OLDPIX;
import javax.swing.*;
@@ -30,13 +35,15 @@ import java.awt.*;
*/
public class ChartFloatAction extends ElementCaseAction {
+ private boolean isRecordNeeded;
+
/**
* 构造函数 图表插入悬浮元素
*/
public ChartFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_CHART);
- this.setName(getMenuKeySet().getMenuKeySetName() + "...");
+ this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/chart.png"));
}
@@ -64,9 +71,10 @@ public class ChartFloatAction extends ElementCaseAction {
* @return 是则返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
+ isRecordNeeded = false;
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (reportPane == null) {
- return false;
+ return isRecordNeeded;
}
reportPane.stopEditing();
@@ -78,25 +86,41 @@ public class ChartFloatAction extends ElementCaseAction {
chartDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
-
+ isRecordNeeded = true;
FloatElement newFloatElement;
try {
newFloatElement = new FloatElement(chartDialog.getChartCollection().clone());
- newFloatElement.setLeftDistance(new OLDPIX(20));
- newFloatElement.setTopDistance(new OLDPIX(20));
newFloatElement.setWidth(new OLDPIX(BaseChartCollection.CHART_DEFAULT_WIDTH));
newFloatElement.setHeight(new OLDPIX(BaseChartCollection.CHART_DEFAULT_HEIGHT));
+ Grid grid = reportPane.getGrid();
+ TemplateElementCase report = reportPane.getEditingElementCase();
+ DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
+ DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
+ int horizentalScrollValue = grid.getHorizontalValue();
+ int verticalScrollValue = grid.getVerticalValue();
+
+ int resolution = grid.getResolution();
+ int floatWdith = newFloatElement.getWidth().toPixI(resolution);
+ int floatHeight = newFloatElement.getWidth().toPixI(resolution);
+
+ int leftDifference = (grid.getWidth() - floatWdith) > 0 ? (grid.getWidth() - floatWdith) : 0;
+ int topDifference = (grid.getHeight() - floatHeight) > 0 ? (grid.getHeight() - floatHeight) : 0;
+ FU evtX_fu = FU.valueOfPix((leftDifference) / 2, resolution);
+ FU evtY_fu = FU.valueOfPix((topDifference) / 2, resolution);
+
+ FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU());
+ FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU());
+
+ newFloatElement.setLeftDistance(leftDistance);
+ newFloatElement.setTopDistance(topDistance);
+
Style style = newFloatElement.getStyle();
if (style != null) {
- newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black,
- Constants.LINE_NONE, Color.black,
- Constants.LINE_NONE, Color.black,
- Constants.LINE_NONE, Color.black));
+ newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black));
}
reportPane.getEditingElementCase().addFloatElement(newFloatElement);
reportPane.setSelection(new FloatSelection(newFloatElement.getName()));
- reportPane.fireTargetModified();
reportPane.fireSelectionChangeListener();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error in Float");
@@ -105,6 +129,6 @@ public class ChartFloatAction extends ElementCaseAction {
});
chartDialog.setVisible(true);
- return true;
+ return isRecordNeeded;
}
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
index de7cbe582c..99f0b3157e 100644
--- a/designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
+++ b/designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
@@ -1,98 +1,128 @@
-/*
- * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
- */
-package com.fr.design.actions.insert.flot;
-
-import com.fr.base.BaseUtils;
-import com.fr.base.DynamicUnitList;
-import com.fr.base.Formula;
-import com.fr.design.file.HistoryTemplateListPane;
-import com.fr.design.mainframe.ElementCasePane;
-import com.fr.design.menu.MenuKeySet;
-import com.fr.general.Inter;
-import com.fr.grid.Grid;
-import com.fr.grid.selection.FloatSelection;
-import com.fr.report.ReportHelper;
-import com.fr.report.cell.FloatElement;
-import com.fr.report.elementcase.TemplateElementCase;
-import com.fr.stable.unit.FU;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-
-/**
- * Insert formula.
- */
-public class FormulaFloatAction extends AbstractShapeAction {
- public FormulaFloatAction(ElementCasePane t) {
- super(t);
- this.setMenuKeySet(FLOAT_INSERT_FORMULA);
- this.setName(getMenuKeySet().getMenuKeySetName() + "...");
- this.setMnemonic(getMenuKeySet().getMnemonic());
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
- }
-
- public static final MenuKeySet FLOAT_INSERT_FORMULA = new MenuKeySet() {
- @Override
- public char getMnemonic() {
- return 'F';
- }
-
- @Override
- public String getMenuName() {
- return Inter.getLocText("FR-Designer_Insert_Formula");
- }
-
- @Override
- public KeyStroke getKeyStroke() {
- return null;
- }
- };
-
- /**
- * 动作
- *
- * @param e 事件
- */
- public void actionPerformed(ActionEvent e) {
- ElementCasePane jws = getEditingComponent();
- if (jws == null) {
- return;
- }
- //
- FloatElement floatElement = new FloatElement(new Formula(""));
- this.startDraw(floatElement);
- doWithDrawingFloatElement();
- jws.getGrid().startEditing();
- }
-
- private void doWithDrawingFloatElement() {
- ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
- Grid grid = jws.getGrid();
-
- ElementCasePane reportPane = grid.getElementCasePane();
- TemplateElementCase report = reportPane.getEditingElementCase();
- DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
- DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
-
- int horizentalScrollValue = grid.getHorizontalValue();
- int verticalScrollValue = grid.getVerticalValue();
-
- int resolution = grid.getResolution();
- int floatWdith = grid.getDrawingFloatElement().getWidth().toPixI(resolution);
- int floatHeight = grid.getDrawingFloatElement().getWidth().toPixI(resolution);
-
- FU evtX_fu = FU.valueOfPix((grid.getWidth() - floatWdith) / 2, resolution);
- FU evtY_fu = FU.valueOfPix((grid.getHeight() - floatHeight) / 2, resolution);
-
- FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU());
- FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU());
-
- grid.getDrawingFloatElement().setLeftDistance(leftDistance);
- grid.getDrawingFloatElement().setTopDistance(topDistance);
-
- report.addFloatElement(grid.getDrawingFloatElement());
- reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
- }
-
+/*
+ * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
+ */
+package com.fr.design.actions.insert.flot;
+
+import com.fr.base.BaseFormula;
+import com.fr.base.BaseUtils;
+import com.fr.base.DynamicUnitList;
+import com.fr.design.actions.ElementCaseAction;
+import com.fr.design.dialog.BasicDialog;
+import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.file.HistoryTemplateListPane;
+import com.fr.design.formula.FormulaFactory;
+import com.fr.design.formula.UIFormula;
+import com.fr.design.mainframe.DesignerContext;
+import com.fr.design.mainframe.ElementCasePane;
+import com.fr.design.menu.MenuKeySet;
+import com.fr.general.Inter;
+import com.fr.grid.Grid;
+import com.fr.grid.selection.FloatSelection;
+import com.fr.report.ReportHelper;
+import com.fr.report.cell.FloatElement;
+import com.fr.report.elementcase.TemplateElementCase;
+import com.fr.stable.unit.FU;
+
+import javax.swing.*;
+
+/**
+ * Insert formula.
+ */
+public class FormulaFloatAction extends ElementCaseAction {
+
+ private boolean returnValue = false;
+
+ public FormulaFloatAction(ElementCasePane t) {
+ super(t);
+ this.setMenuKeySet(FLOAT_INSERT_FORMULA);
+ this.setName(getMenuKeySet().getMenuKeySetName());
+ this.setMnemonic(getMenuKeySet().getMnemonic());
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
+ }
+
+ public static final MenuKeySet FLOAT_INSERT_FORMULA = new MenuKeySet() {
+ @Override
+ public char getMnemonic() {
+ return 'F';
+ }
+
+ @Override
+ public String getMenuName() {
+ return Inter.getLocText("FR-Designer_Insert_Formula");
+ }
+
+ @Override
+ public KeyStroke getKeyStroke() {
+ return null;
+ }
+ };
+
+ private void doWithDrawingFloatElement() {
+ ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
+ Grid grid = jws.getGrid();
+
+ ElementCasePane reportPane = grid.getElementCasePane();
+ TemplateElementCase report = reportPane.getEditingElementCase();
+ DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
+ DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
+
+ int horizentalScrollValue = grid.getHorizontalValue();
+ int verticalScrollValue = grid.getVerticalValue();
+
+ int resolution = grid.getResolution();
+ int floatWdith = grid.getDrawingFloatElement().getWidth().toPixI(resolution);
+ int floatHeight = grid.getDrawingFloatElement().getWidth().toPixI(resolution);
+
+ FU evtX_fu = FU.valueOfPix((grid.getWidth() - floatWdith) / 2, resolution);
+ FU evtY_fu = FU.valueOfPix((grid.getHeight() - floatHeight) / 2, resolution);
+
+ FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU());
+ FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU());
+
+ grid.getDrawingFloatElement().setLeftDistance(leftDistance);
+ grid.getDrawingFloatElement().setTopDistance(topDistance);
+
+ report.addFloatElement(grid.getDrawingFloatElement());
+ reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
+ }
+
+ /**
+ * 执行动作
+ *
+ * @return 成功返回true
+ */
+ @Override
+ public boolean executeActionReturnUndoRecordNeeded() {
+ final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
+ if (reportPane == null) {
+ return false;
+ }
+
+ reportPane.stopEditing();
+ final FloatElement floatElement = new FloatElement();
+ final UIFormula formulaPane = FormulaFactory.createFormulaPane();
+ formulaPane.populate(BaseFormula.createFormulaBuilder().build());
+
+ BasicDialog dialog = formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
+
+ @Override
+ public void doOk() {
+ floatElement.setValue(formulaPane.update());
+ if (reportPane == null) {
+ return;
+ }
+ reportPane.getGrid().setDrawingFloatElement(floatElement);
+ doWithDrawingFloatElement();
+ returnValue = true;
+ }
+
+ @Override
+ public void doCancel() {
+ returnValue = false;
+ }
+ });
+ dialog.setVisible(true);
+ return returnValue;
+ }
+
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java
index 8814936cde..9861499bf9 100644
--- a/designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java
+++ b/designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java
@@ -4,6 +4,7 @@
package com.fr.design.actions.insert.flot;
import com.fr.base.BaseUtils;
+import com.fr.base.DynamicUnitList;
import com.fr.base.ScreenResolution;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.dialog.BasicDialog;
@@ -14,9 +15,12 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.report.SelectImagePane;
import com.fr.general.Inter;
+import com.fr.grid.Grid;
import com.fr.grid.selection.FloatSelection;
+import com.fr.report.ReportHelper;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.cellattr.CellImage;
+import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.unit.FU;
@@ -34,7 +38,7 @@ public class ImageFloatAction extends ElementCaseAction {
public ImageFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_IMAGE);
- this.setName(getMenuKeySet().getMenuKeySetName() + "...");
+ this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/image.png"));
}
@@ -87,12 +91,33 @@ public class ImageFloatAction extends ElementCaseAction {
CoreGraphHelper.waitForImage(image);
floatElement.setValue(image);
-
- int resolution = ScreenResolution.getScreenResolution();
+ Grid grid = reportPane.getGrid();
+ int resolution = grid.getResolution();
floatElement.setWidth(FU.valueOfPix(image.getWidth(null), resolution));
floatElement.setHeight(FU.valueOfPix(image.getHeight(null), resolution));
+ TemplateElementCase report = reportPane.getEditingElementCase();
+ DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
+ DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
+ int horizentalScrollValue = grid.getHorizontalValue();
+ int verticalScrollValue = grid.getVerticalValue();
+
+ int floatWdith = floatElement.getWidth().toPixI(resolution);
+ int floatHeight = floatElement.getHeight().toPixI(resolution);
+
+ int leftDifference = (grid.getWidth() - floatWdith) > 0 ? (grid.getWidth() - floatWdith) : 0;
+ int topDifference = (grid.getHeight() - floatHeight) > 0 ? (grid.getHeight() - floatHeight) : 0;
+ FU evtX_fu = FU.valueOfPix((leftDifference) / 2, resolution);
+ FU evtY_fu = FU.valueOfPix((topDifference) / 2, resolution);
+
+ FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU());
+ FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU());
+
+ floatElement.setLeftDistance(leftDistance);
+ floatElement.setTopDistance(topDistance);
+
floatElement.setStyle(cellImage.getStyle());
- reportPane.addFloatElementToCenterOfElementPane(floatElement);
+// reportPane.addFloatElementToCenterOfElementPane(floatElement);
+ reportPane.getEditingElementCase().addFloatElement(floatElement);
reportPane.setSelection(new FloatSelection(floatElement.getName()));
returnValue = true;
diff --git a/designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
index 3f0be1c56d..6001e2e72b 100644
--- a/designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
+++ b/designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
@@ -26,7 +26,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
public TextBoxFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_TEXT);
- this.setName(getMenuKeySet().getMenuKeySetName() + "...");
+ this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/text.png"));
}
@@ -54,6 +54,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
*
* @param e 动作
*/
+ @Override
public void actionPerformed(ActionEvent e) {
ElementCasePane jws = getEditingComponent();
if (jws == null) {
@@ -67,7 +68,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
private void doWithDrawingFloatElement() {
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
- ;
+
Grid grid = jws.getGrid();
ElementCasePane reportPane = grid.getElementCasePane();
@@ -93,5 +94,6 @@ public class TextBoxFloatAction extends AbstractShapeAction {
report.addFloatElement(grid.getDrawingFloatElement());
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
+ reportPane.fireTargetModified();
}
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java b/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java
index d4a3db8a73..680244f895 100644
--- a/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java
+++ b/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java
@@ -1,5 +1,6 @@
package com.fr.design.cell.bar;
+import com.fr.design.constants.UIConstants;
import com.fr.general.ComparatorUtils;
import javax.swing.*;
@@ -63,48 +64,16 @@ public class DynamicScrollButton extends BasicArrowButton {
private void paintArrow(Graphics g, Dimension size) {
switch (direction) {
case SwingConstants.NORTH:
- g.drawLine(8, 5, 8, 5);
- g.drawLine(7, 6, 9, 6);
- g.drawLine(6, 7, 10, 7);
- g.drawLine(5, 8, 7, 8);
- g.drawLine(9, 8, 11, 8);
- g.drawLine(4, 9, 6, 9);
- g.drawLine(10, 9, 12, 9);
- g.drawLine(5, 10, 5, 10);
- g.drawLine(11, 10, 11, 10);
+ g.drawImage(UIConstants.ARROW_NORTH, 0, 0, this);
break;
case SwingConstants.SOUTH:
- g.drawLine(5, 6, 5, 6);
- g.drawLine(11, 6, 11, 6);
- g.drawLine(4, 7, 6, 7);
- g.drawLine(10, 7, 12, 7);
- g.drawLine(5, 8, 7, 8);
- g.drawLine(9, 8, 11, 8);
- g.drawLine(6, 9, 10, 9);
- g.drawLine(7, 10, 9, 10);
- g.drawLine(8, 11, 8, 11);
+ g.drawImage(UIConstants.ARROW_SOUTH, 0, 0, this);
break;
case SwingConstants.EAST:
- g.drawLine(6, 5, 6, 5);
- g.drawLine(6, 11, 6, 11);
- g.drawLine(7, 4, 7, 6);
- g.drawLine(7, 10, 7, 12);
- g.drawLine(8, 5, 8, 7);
- g.drawLine(8, 9, 8, 11);
- g.drawLine(9, 6, 9, 10);
- g.drawLine(10, 7, 10, 9);
- g.drawLine(11, 8, 11, 8);
+ g.drawImage(UIConstants.ARROW_EAST, 0, 0, this);
break;
case SwingConstants.WEST:
- g.drawLine(4, 8, 4, 8);
- g.drawLine(5, 7, 5, 9);
- g.drawLine(6, 6, 6, 10);
- g.drawLine(7, 5, 7, 7);
- g.drawLine(7, 9, 7, 11);
- g.drawLine(8, 4, 8, 6);
- g.drawLine(8, 10, 8, 12);
- g.drawLine(9, 5, 9, 5);
- g.drawLine(9, 11, 9, 11);
+ g.drawImage(UIConstants.ARROW_WEST, 0, 0, this);
break;
}
}
diff --git a/designer/src/com/fr/design/cell/clipboard/CellElementsClip.java b/designer/src/com/fr/design/cell/clipboard/CellElementsClip.java
index 64d649d3d3..191f14959e 100644
--- a/designer/src/com/fr/design/cell/clipboard/CellElementsClip.java
+++ b/designer/src/com/fr/design/cell/clipboard/CellElementsClip.java
@@ -12,6 +12,7 @@ import com.fr.report.cell.CellElement;
import com.fr.report.cell.CellElementComparator;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
+import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
/**
@@ -62,8 +63,12 @@ public class CellElementsClip implements Cloneable, java.io.Serializable {
if (sbuf.length() > 0 && sbuf.charAt(sbuf.length() - 1) != '\n') {
sbuf.append('\t');
}
-
- sbuf.append(cellElement.getValue());
+ //REPORT-5134:会复制出null
+ if (cellElement.getValue() == null) {
+ sbuf.append(StringUtils.EMPTY);
+ } else {
+ sbuf.append(cellElement.getValue());
+ }
}
return sbuf.toString();
diff --git a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java
index cc9c43564a..33e29c1f65 100644
--- a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java
+++ b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java
@@ -7,6 +7,7 @@ import java.awt.Point;
import javax.swing.event.EventListenerList;
+import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.event.CellEditorEvent;
import com.fr.grid.event.CellEditorListener;
@@ -114,6 +115,7 @@ public abstract class AbstractCellEditor implements CellEditor {
}
if(ePane != null) {
ePane.fireSelectionChangeListener();
+ EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ELEMENT);
}
}
diff --git a/designer/src/com/fr/design/cell/editor/FormulaCellEditor.java b/designer/src/com/fr/design/cell/editor/FormulaCellEditor.java
index e69742ea95..38b8b75518 100644
--- a/designer/src/com/fr/design/cell/editor/FormulaCellEditor.java
+++ b/designer/src/com/fr/design/cell/editor/FormulaCellEditor.java
@@ -3,7 +3,7 @@
*/
package com.fr.design.cell.editor;
-import com.fr.base.Formula;
+import com.fr.base.BaseFormula;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
@@ -34,7 +34,7 @@ public class FormulaCellEditor extends com.fr.design.cell.editor.AbstractCellEdi
*/
@Override
public Object getCellEditorValue() throws Exception {
- Formula newFormula = this.formulaEditorPane.update();
+ BaseFormula newFormula = this.formulaEditorPane.update();
if (newFormula.getContent() != null && newFormula.getContent().trim().length() > 1) {
return newFormula;
} else {
@@ -64,13 +64,13 @@ public class FormulaCellEditor extends com.fr.design.cell.editor.AbstractCellEdi
if (cellElement != null) {
value = cellElement.getValue();
}
- if (value == null || !(value instanceof Formula)) {
- value = new Formula("");
+ if (value == null || !(value instanceof BaseFormula)) {
+ value = BaseFormula.createFormulaBuilder().build();
}
this.formulaEditorPane = FormulaFactory.createFormulaPaneWhenReserveFormula();
- this.formulaEditorPane.populate((Formula) value);
+ this.formulaEditorPane.populate((BaseFormula) value);
return this.formulaEditorPane.showLargeWindow(SwingUtilities.getWindowAncestor(grid), new DialogActionAdapter() {
@Override
diff --git a/designer/src/com/fr/design/cell/editor/FormulaFloatEditor.java b/designer/src/com/fr/design/cell/editor/FormulaFloatEditor.java
index 046b3ebe30..23a41bbdde 100644
--- a/designer/src/com/fr/design/cell/editor/FormulaFloatEditor.java
+++ b/designer/src/com/fr/design/cell/editor/FormulaFloatEditor.java
@@ -3,7 +3,7 @@
*/
package com.fr.design.cell.editor;
-import com.fr.base.Formula;
+import com.fr.base.BaseFormula;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
@@ -31,7 +31,7 @@ public class FormulaFloatEditor extends AbstractFloatEditor {
*/
@Override
public Object getFloatEditorValue() throws Exception {
- Formula newFormula = this.formulaEditorPane.update();
+ BaseFormula newFormula = this.formulaEditorPane.update();
if (newFormula.getContent() != null && newFormula.getContent().trim().length() > 1) {
return newFormula;
} else {
@@ -59,12 +59,12 @@ public class FormulaFloatEditor extends AbstractFloatEditor {
public Component getFloatEditorComponent(Grid grid, FloatElement floatElement, int resolution) {
//populate data to UI
Object value = floatElement.getValue();
- if (value == null || !(value instanceof com.fr.base.Formula)) {
- value = new Formula("");
+ if (value == null || !(value instanceof BaseFormula)) {
+ value = BaseFormula.createFormulaBuilder().build();
}
this.formulaEditorPane = FormulaFactory.createFormulaPane();
- this.formulaEditorPane.populate((Formula) value);
+ this.formulaEditorPane.populate((BaseFormula) value);
return this.formulaEditorPane.showLargeWindow(SwingUtilities.getWindowAncestor(grid), new DialogActionAdapter() {
diff --git a/designer/src/com/fr/design/cell/editor/RichTextToolBar.java b/designer/src/com/fr/design/cell/editor/RichTextToolBar.java
index 0b5721975d..d480703718 100644
--- a/designer/src/com/fr/design/cell/editor/RichTextToolBar.java
+++ b/designer/src/com/fr/design/cell/editor/RichTextToolBar.java
@@ -3,9 +3,9 @@
*/
package com.fr.design.cell.editor;
+import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
-import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@@ -27,10 +27,27 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Element;
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyledDocument;
import java.awt.*;
-import java.awt.event.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.math.BigDecimal;
/**
@@ -311,12 +328,12 @@ public class RichTextToolBar extends BasicPane{
private ActionListener formulaActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
- formulaPane.populate(new Formula());
+ formulaPane.populate(BaseFormula.createFormulaBuilder().build());
formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
StyledDocument doc = (StyledDocument) textPane.getDocument();
- Formula fm = formulaPane.update();
+ BaseFormula fm = formulaPane.update();
String content = RichTextConverter.asFormula(fm.getContent());
int start = textPane.getSelectionStart();
AttributeSet attrs = start > 0 ? doc.getCharacterElement(start - 1).getAttributes() : new SimpleAttributeSet();
diff --git a/designer/src/com/fr/design/condition/HyperlinkPane.java b/designer/src/com/fr/design/condition/HyperlinkPane.java
index bbdecf6611..7ff03a7c88 100644
--- a/designer/src/com/fr/design/condition/HyperlinkPane.java
+++ b/designer/src/com/fr/design/condition/HyperlinkPane.java
@@ -37,7 +37,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane DSColumnPane.SETTING_DSRELATED) {
- selectCountPane = new SelectCountPane();
- selectCountPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Results_Filter"),null));
- }
-
- valuePane = new ValuePane();
- valuePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Custom_Data_Appearance"),null));
-
-
- JPanel extendablePane = null;
- if (setting > DSColumnPane.SETTING_DSRELATED) {
- // extendableDirectionPane
- JPanel extendableDirectionPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
-
- extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable")));
- extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable")));
-
- extendablePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("ExpandD-Expandable"));
- extendablePane.setLayout(new BorderLayout());
- extendablePane.add(extendableDirectionPane, BorderLayout.CENTER);
- }
-
- JPanel multiNumPane = null;
- if (setting > DSColumnPane.SETTING_DSRELATED) {
- multiNumPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Fill_blank_Data"));
- useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple"));
- multiNumPane.add(useMultiplyNumCheckBox);
- multiNumPane.add(new UILabel(InsetText));
-
- multiNumSpinner = new UISpinner(1, 10000, 1, 1);
- multiNumPane.add(multiNumSpinner);
-
- useMultiplyNumCheckBox.addActionListener(new ActionListener() {
-
- public void actionPerformed(ActionEvent e) {
- checkButtonEnabled();
- }
- });
- }
-
- double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
- TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
- double[] columnSize = {TableLayout.FILL};
-
- Component[][] components = null;
- if (setting > DSColumnPane.SETTING_DSRELATED) {
- components = new Component[][]{
- {sortPane},
- {selectCountPane},
- {valuePane},
- {extendablePane},
- {multiNumPane}
- };
- } else {
- components = new Component[][]{
- {sortPane},
- {valuePane}
- };
- }
- this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
- }
-
- @Override
- protected String title4PopupWindow() {
- return Inter.getLocText("Advanced");
- }
-
- public void populate(TemplateCellElement cellElement) {
- if (cellElement == null) {
- return;
- }
-
- sortPane.populate(cellElement);
- valuePane.populate(cellElement);
-
- if (selectCountPane != null) {
- selectCountPane.populate(cellElement);
-
- CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
- if (cellExpandAttr == null) {
- cellExpandAttr = new CellExpandAttr();
- cellElement.setCellExpandAttr(cellExpandAttr);
- }
-
- // extendable
- switch (cellExpandAttr.getExtendable()) {
- case CellExpandAttr.Both_EXTENDABLE:
- horizontalExtendableCheckBox.setSelected(true);
- verticalExtendableCheckBox.setSelected(true);
- break;
- case CellExpandAttr.Vertical_EXTENDABLE:
- horizontalExtendableCheckBox.setSelected(false);
- verticalExtendableCheckBox.setSelected(true);
- break;
- case CellExpandAttr.Horizontal_EXTENDABLE:
- horizontalExtendableCheckBox.setSelected(true);
- verticalExtendableCheckBox.setSelected(false);
- break;
- default: {
- horizontalExtendableCheckBox.setSelected(false);
- verticalExtendableCheckBox.setSelected(false);
- }
-
- }
-
- if (cellExpandAttr.getMultipleNumber() == -1) {
- this.useMultiplyNumCheckBox.setSelected(false);
- } else {
- this.useMultiplyNumCheckBox.setSelected(true);
- this.multiNumSpinner.setValue(cellExpandAttr.getMultipleNumber());
- }
-
- this.checkButtonEnabled();
- }
- }
-
- public void update(TemplateCellElement cellElement) {
- if (cellElement == null) {
- return;
- }
-
- sortPane.update(cellElement);
- valuePane.update(cellElement);
-
- if (selectCountPane != null) {
- selectCountPane.update(cellElement);
-
- CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
- if (cellExpandAttr == null) {
- cellExpandAttr = new CellExpandAttr();
- cellElement.setCellExpandAttr(cellExpandAttr);
- }
-
- // extendable
- if (horizontalExtendableCheckBox.isSelected()) {
- if (verticalExtendableCheckBox.isSelected()) {
- cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE);
- } else {
- cellExpandAttr.setExtendable(CellExpandAttr.Horizontal_EXTENDABLE);
- }
- } else {
- if (verticalExtendableCheckBox.isSelected()) {
- cellExpandAttr.setExtendable(CellExpandAttr.Vertical_EXTENDABLE);
- } else {
- cellExpandAttr.setExtendable(CellExpandAttr.None_EXTENDABLE);
- }
- }
-
- if (this.useMultiplyNumCheckBox.isSelected()) {
- cellExpandAttr.setMultipleNumber((int) this.multiNumSpinner.getValue());
- } else {
- cellExpandAttr.setMultipleNumber(-1);
- }
- }
- }
-
- private static class SortPane extends SortFormulaPane {
- private CellElement cellElement;
-
- @Override
- public void formulaAction() {
- if (cellElement == null) {
- return;
- }
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
-
- String[] displayNames = DesignTableDataManager.getSelectedColumnNames(
- DesignTableDataManager.getEditingTableDataSource(), ((DSColumn) value).getDSName());
-
- showFormulaDialog(displayNames);
- }
-
- void populate(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
- this.cellElement = cellElement;
-
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) value;
-
- int sort = dSColumn.getOrder();
- this.sortOrderComboBox.setSortOrder(new SortOrder(sort));
-
- String sortFormula = dSColumn.getSortFormula();
- if (sortFormula != null && sortFormula.length() >= 1) {
- sortFormulaTextField.setText(sortFormula);
- } else {
- sortFormulaTextField.setText(sortFormula);
- }
- }
-
- public void update(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) (cellElement.getValue());
-
- dSColumn.setOrder(this.sortOrderComboBox.getSortOrder().getOrder());
- //lance:sort formula
-
- String sText = null;
- if (!(sortFormulaTextField.getText() == null || sortFormulaTextField.getText().trim().equals("") || sortFormulaTextField.getText().trim().equals("$$$"))) {
- sText = new String(sortFormulaTextField.getText());
- }
- if (!(sText == null || sText.length() < 1)) {
- dSColumn.setSortFormula(sText);
- } else {
- dSColumn.setSortFormula(null);
- }
- }
- }
-
- private static class SelectCountPane extends JPanel {
-
- CellElement cellElement;
- // private Comparator sortComparator;
- private UIComboBox selectCountComboBox;
- private JPanel selectCountCardPane;
- private UITextField serialTextField;
-
- JFormulaField topFormulaPane;
- JFormulaField bottomFormulaPane;
-
- public SelectCountPane() {
- this.setLayout(FRGUIPaneFactory.createBorderLayout());
-
- selectCountComboBox = new UIComboBox(new String[]{
- Inter.getLocText("Undefined"),
- Inter.getLocText("BindColumn-Top_N"),
- Inter.getLocText("BindColumn-Bottom_N"),
- Inter.getLocText("Odd"),
- Inter.getLocText("Even"),
- Inter.getLocText("Specify"),});
- selectCountComboBox.addActionListener(new ActionListener() {
-
- public void actionPerformed(ActionEvent evt) {
- int selectIndex = selectCountComboBox.getSelectedIndex();
- CardLayout c1 = (CardLayout) selectCountCardPane.getLayout();
- if (selectIndex == 1) {
- c1.show(selectCountCardPane, "TOP");
- } else if (selectIndex == 2) {
- c1.show(selectCountCardPane, "BOTTOM");
- } else if (selectIndex == 3) {
- c1.show(selectCountCardPane, "ODD");
- } else if (selectIndex == 4) {
- c1.show(selectCountCardPane, "EVEN");
- } else if (selectIndex == 5) {
- c1.show(selectCountCardPane, "SPECIFY");
- } else {
- c1.show(selectCountCardPane, "UNDEFINE");
- }
- }
- });
-
- selectCountCardPane =FRGUIPaneFactory.createCardLayout_S_Pane();
- this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsetText), selectCountComboBox,
- new UILabel(InsetText), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST);
-// selectCountCardPane.setLayout(new CardLayout());
-
- //not define pane
-
- JPanel undefinedPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Undefined")), FlowLayout.LEFT);
- topFormulaPane = new JFormulaField("-1");
- bottomFormulaPane = new JFormulaField("-1");
- serialTextField = new UITextField(18);
- JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
- + " " + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FlowLayout.LEFT);
- JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
- + " " + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FlowLayout.LEFT);
- JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{
- serialTextField, new UILabel(
- Inter.getLocText(new String[]{
- "Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"},
- new String[]{": 1,2-3,5,8 ", ",", "$__count__"})
- )
- }, FlowLayout.LEFT);
- serialTextField.setToolTipText(Inter.getLocText("StyleFormat-Sample") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")");
- selectCountCardPane.add(undefinedPane, "UNDEFINE");
- selectCountCardPane.add(topFormulaPane, "TOP");
- selectCountCardPane.add(bottomFormulaPane, "BOTTOM");
- //odd
- selectCountCardPane.add(oddPane, "ODD");
- //even
- selectCountCardPane.add(evenPane, "EVEN");
- //specify
- selectCountCardPane.add(specifyPane, "SPECIFY");
- }
-
- public void populate(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
- this.cellElement = cellElement;
-
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) (cellElement.getValue());
- SelectCount selectCount = dSColumn.getSelectCount();
- this.topFormulaPane.populateElement(cellElement);
- this.bottomFormulaPane.populateElement(cellElement);
- if (selectCount != null) {
- int selectCountType = selectCount.getType();
- this.selectCountComboBox.setSelectedIndex(selectCountType);
- if (selectCountType == SelectCount.TOP) {
- this.topFormulaPane.populate(selectCount.getFormulaCount());
- } else if (selectCountType == SelectCount.BOTTOM) {
- this.bottomFormulaPane.populate(selectCount.getFormulaCount());
- } else if (selectCountType == SelectCount.SPECIFY) {
- this.serialTextField.setText(selectCount.getSerial());
- }
- }
- }
-
- public void update(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) (cellElement.getValue());
-
- //alex:SelectCount
- int selectCountSelectIndex = this.selectCountComboBox.getSelectedIndex();
- if (selectCountSelectIndex == 0) {
- dSColumn.setSelectCount(null);
- } else {
- SelectCount selectCount = new SelectCount();
- dSColumn.setSelectCount(selectCount);
- selectCount.setType(selectCountSelectIndex);
- if (selectCountSelectIndex == SelectCount.TOP) {
- selectCount.setFormulaCount(this.topFormulaPane.getFormulaText());
- } else if (selectCountSelectIndex == SelectCount.BOTTOM) {
- selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText());
- } else if (selectCountSelectIndex == SelectCount.SPECIFY) {
- selectCount.setSerial(this.serialTextField.getText());
- }
- }
- }
-
- private JFormattedTextField getTextField(JSpinner spinner) {
- JComponent editor = spinner.getEditor();
- if (editor instanceof JSpinner.DefaultEditor) {
- return ((JSpinner.DefaultEditor) editor).getTextField();
- } else {
- System.err.println("Unexpected editor type: "
- + spinner.getEditor().getClass()
- + " isn't a descendant of DefaultEditor");
- return null;
- }
- }
- }
-
- private static class JFormulaField extends JPanel {
- private CellElement cellElement;
- private UITextField formulaTextField;
- private String defaultValue;
-
- public JFormulaField(String defaultValue) {
- this.defaultValue = defaultValue;
-
- this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
- UILabel bottomLabel = new UILabel("=");
- bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12));
- this.add(bottomLabel);
- formulaTextField = new UITextField(24);
- this.add(formulaTextField);
- formulaTextField.setText(defaultValue);
-
- UIButton bottomFrmulaButton = new UIButton("...");
- this.add(bottomFrmulaButton);
- bottomFrmulaButton.setToolTipText(Inter.getLocText("Formula") + "...");
- bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height));
- bottomFrmulaButton.addActionListener(formulaButtonActionListener);
- }
-
- public void populate(String formulaContent) {
- this.formulaTextField.setText(formulaContent);
- }
- public void populateElement(CellElement cellElement) {
- this.cellElement = cellElement;
- }
-
- public String getFormulaText() {
- return this.formulaTextField.getText();
- }
-
- private ActionListener formulaButtonActionListener = new ActionListener() {
-
- public void actionPerformed(ActionEvent evt) {
- Formula valueFormula = new Formula();
- String text = formulaTextField.getText();
- if (text == null || text.length() <= 0) {
- valueFormula.setContent(defaultValue);
- } else {
- valueFormula.setContent(text);
- }
-
- final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula();
-
- if (cellElement == null) {
- return;
- }
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dsColumn = (DSColumn) value;
-
- String[] displayNames = DesignTableDataManager.getSelectedColumnNames(DesignTableDataManager.getEditingTableDataSource(), dsColumn.getDSName());
-
- formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames, true));
- formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(JFormulaField.this), new DialogActionAdapter() {
- @Override
- public void doOk() {
- Formula valueFormula = formulaPane.update();
- if (valueFormula.getContent().length() <= 1) {
- formulaTextField.setText(defaultValue);
- } else {
- formulaTextField.setText(valueFormula.getContent().substring(1));
- }
- }
- }).setVisible(true);
- }
- };
- }
-
- private static class ValuePane extends JPanel {
- private JFormulaField formulaField;
-
- public ValuePane() {
- this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
-
- this.add(new UILabel(InsetText + Inter.getLocText("Value") + ":"));
- this.add(Box.createHorizontalStrut(2));
- this.add((formulaField = new JFormulaField("$$$")));
- }
-
- public void populate(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
-
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) value;
-
- //formula
- String valueFormula = dSColumn.getResult();
- if (valueFormula == null) {
- valueFormula = "$$$";
- }
- formulaField.populateElement(cellElement);
- formulaField.populate(valueFormula);
- }
-
- public void update(CellElement cellElement) {
- if (cellElement == null) {
- return;
- }
- Object value = cellElement.getValue();
- if (value == null || !(value instanceof DSColumn)) {
- return;
- }
- DSColumn dSColumn = (DSColumn) (cellElement.getValue());
-
- //formula
- dSColumn.setResult(this.formulaField.getFormulaText());
- }
- }
-
- private void checkButtonEnabled() {
- if (useMultiplyNumCheckBox.isSelected()) {
- multiNumSpinner.setEnabled(true);
- } else {
- multiNumSpinner.setEnabled(false);
- }
- }
+package com.fr.design.dscolumn;
+
+import com.fr.base.BaseFormula;
+import com.fr.data.util.SortOrder;
+import com.fr.design.data.DesignTableDataManager;
+import com.fr.design.dialog.BasicPane;
+import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.formula.CustomVariableResolver;
+import com.fr.design.formula.FormulaFactory;
+import com.fr.design.formula.SortFormulaPane;
+import com.fr.design.formula.UIFormula;
+import com.fr.design.gui.ibutton.UIButton;
+import com.fr.design.gui.icheckbox.UICheckBox;
+import com.fr.design.gui.icombobox.UIComboBox;
+import com.fr.design.gui.ilable.UILabel;
+import com.fr.design.gui.ispinner.UISpinner;
+import com.fr.design.gui.itextfield.UITextField;
+import com.fr.design.layout.FRGUIPaneFactory;
+import com.fr.design.layout.TableLayout;
+import com.fr.design.layout.TableLayoutHelper;
+import com.fr.design.utils.gui.GUICoreUtils;
+import com.fr.general.Inter;
+import com.fr.report.cell.CellElement;
+import com.fr.report.cell.TemplateCellElement;
+import com.fr.report.cell.cellattr.CellExpandAttr;
+import com.fr.report.cell.cellattr.core.group.DSColumn;
+import com.fr.report.cell.cellattr.core.group.SelectCount;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM;
+import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY;
+import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.TOP;
+
+public class DSColumnAdvancedPane extends BasicPane {
+
+ private static final String InsetText = " ";
+ private SortPane sortPane;
+ private SelectCountPane selectCountPane;
+ private ValuePane valuePane;
+ private UICheckBox horizontalExtendableCheckBox;
+ private UICheckBox verticalExtendableCheckBox;
+ private UICheckBox useMultiplyNumCheckBox;
+ private UISpinner multiNumSpinner;
+
+ public DSColumnAdvancedPane() {
+ this(DSColumnPane.SETTING_ALL);
+ }
+
+ public DSColumnAdvancedPane(int setting) {
+ this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
+ this.setLayout(FRGUIPaneFactory.createBorderLayout());
+
+ sortPane = new SortPane();
+ sortPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Sort-Sort_Order"), null));
+
+ if (setting > DSColumnPane.SETTING_DSRELATED) {
+ selectCountPane = new SelectCountPane();
+ selectCountPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Results_Filter"), null));
+ }
+
+ valuePane = new ValuePane();
+ valuePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Custom_Data_Appearance"), null));
+
+
+ JPanel extendablePane = null;
+ if (setting > DSColumnPane.SETTING_DSRELATED) {
+ // extendableDirectionPane
+ JPanel extendableDirectionPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
+
+ extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable")));
+ extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable")));
+
+ extendablePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("ExpandD-Expandable"));
+ extendablePane.setLayout(new BorderLayout());
+ extendablePane.add(extendableDirectionPane, BorderLayout.CENTER);
+ }
+
+ JPanel multiNumPane = null;
+ if (setting > DSColumnPane.SETTING_DSRELATED) {
+ multiNumPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Fill_blank_Data"));
+ useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple"));
+ multiNumPane.add(useMultiplyNumCheckBox);
+ multiNumPane.add(new UILabel(InsetText));
+
+ multiNumSpinner = new UISpinner(1, 10000, 1, 1);
+ multiNumPane.add(multiNumSpinner);
+
+ useMultiplyNumCheckBox.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ checkButtonEnabled();
+ }
+ });
+ }
+
+ double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
+ TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
+ double[] columnSize = {TableLayout.FILL};
+
+ Component[][] components = null;
+ if (setting > DSColumnPane.SETTING_DSRELATED) {
+ components = new Component[][]{
+ {sortPane},
+ {selectCountPane},
+ {valuePane},
+ {extendablePane},
+ {multiNumPane}
+ };
+ } else {
+ components = new Component[][]{
+ {sortPane},
+ {valuePane}
+ };
+ }
+ this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
+ }
+
+ @Override
+ protected String title4PopupWindow() {
+ return Inter.getLocText("Advanced");
+ }
+
+ public void populate(TemplateCellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+
+ sortPane.populate(cellElement);
+ valuePane.populate(cellElement);
+
+ if (selectCountPane != null) {
+ selectCountPane.populate(cellElement);
+
+ CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
+ if (cellExpandAttr == null) {
+ cellExpandAttr = new CellExpandAttr();
+ cellElement.setCellExpandAttr(cellExpandAttr);
+ }
+
+ // extendable
+ switch (cellExpandAttr.getExtendable()) {
+ case CellExpandAttr.Both_EXTENDABLE:
+ horizontalExtendableCheckBox.setSelected(true);
+ verticalExtendableCheckBox.setSelected(true);
+ break;
+ case CellExpandAttr.Vertical_EXTENDABLE:
+ horizontalExtendableCheckBox.setSelected(false);
+ verticalExtendableCheckBox.setSelected(true);
+ break;
+ case CellExpandAttr.Horizontal_EXTENDABLE:
+ horizontalExtendableCheckBox.setSelected(true);
+ verticalExtendableCheckBox.setSelected(false);
+ break;
+ default: {
+ horizontalExtendableCheckBox.setSelected(false);
+ verticalExtendableCheckBox.setSelected(false);
+ }
+
+ }
+
+ if (cellExpandAttr.getMultipleNumber() == -1) {
+ this.useMultiplyNumCheckBox.setSelected(false);
+ } else {
+ this.useMultiplyNumCheckBox.setSelected(true);
+ this.multiNumSpinner.setValue(cellExpandAttr.getMultipleNumber());
+ }
+
+ this.checkButtonEnabled();
+ }
+ }
+
+ public void update(TemplateCellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+
+ sortPane.update(cellElement);
+ valuePane.update(cellElement);
+
+ if (selectCountPane != null) {
+ selectCountPane.update(cellElement);
+
+ CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
+ if (cellExpandAttr == null) {
+ cellExpandAttr = new CellExpandAttr();
+ cellElement.setCellExpandAttr(cellExpandAttr);
+ }
+
+ // extendable
+ if (horizontalExtendableCheckBox.isSelected()) {
+ if (verticalExtendableCheckBox.isSelected()) {
+ cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE);
+ } else {
+ cellExpandAttr.setExtendable(CellExpandAttr.Horizontal_EXTENDABLE);
+ }
+ } else {
+ if (verticalExtendableCheckBox.isSelected()) {
+ cellExpandAttr.setExtendable(CellExpandAttr.Vertical_EXTENDABLE);
+ } else {
+ cellExpandAttr.setExtendable(CellExpandAttr.None_EXTENDABLE);
+ }
+ }
+
+ if (this.useMultiplyNumCheckBox.isSelected()) {
+ cellExpandAttr.setMultipleNumber((int) this.multiNumSpinner.getValue());
+ } else {
+ cellExpandAttr.setMultipleNumber(-1);
+ }
+ }
+ }
+
+ private static class SortPane extends SortFormulaPane {
+ private CellElement cellElement;
+
+ @Override
+ public void formulaAction() {
+ if (cellElement == null) {
+ return;
+ }
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+
+ String[] displayNames = DesignTableDataManager.getSelectedColumnNames(
+ DesignTableDataManager.getEditingTableDataSource(), ((DSColumn) value).getDSName());
+
+ showFormulaDialog(displayNames);
+ }
+
+ void populate(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+ this.cellElement = cellElement;
+
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) value;
+
+ int sort = dSColumn.getOrder();
+ this.sortOrderComboBox.setSortOrder(new SortOrder(sort));
+
+ String sortFormula = dSColumn.getSortFormula();
+ if (sortFormula != null && sortFormula.length() >= 1) {
+ sortFormulaTextField.setText(sortFormula);
+ } else {
+ sortFormulaTextField.setText(sortFormula);
+ }
+ }
+
+ public void update(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) (cellElement.getValue());
+
+ dSColumn.setOrder(this.sortOrderComboBox.getSortOrder().getOrder());
+ //lance:sort formula
+
+ String sText = null;
+ if (!(sortFormulaTextField.getText() == null || sortFormulaTextField.getText().trim().equals("") || sortFormulaTextField.getText().trim().equals("$$$"))) {
+ sText = new String(sortFormulaTextField.getText());
+ }
+ if (!(sText == null || sText.length() < 1)) {
+ dSColumn.setSortFormula(sText);
+ } else {
+ dSColumn.setSortFormula(null);
+ }
+ }
+ }
+
+ private static class SelectCountPane extends JPanel {
+
+ CellElement cellElement;
+ // private Comparator sortComparator;
+ private UIComboBox selectCountComboBox;
+ private JPanel selectCountCardPane;
+ private UITextField serialTextField;
+
+ JFormulaField topFormulaPane;
+ JFormulaField bottomFormulaPane;
+
+ public SelectCountPane() {
+ this.setLayout(FRGUIPaneFactory.createBorderLayout());
+
+ selectCountComboBox = new UIComboBox(new String[]{
+ Inter.getLocText("Undefined"),
+ Inter.getLocText("BindColumn-Top_N"),
+ Inter.getLocText("BindColumn-Bottom_N"),
+ Inter.getLocText("Odd"),
+ Inter.getLocText("Even"),
+ Inter.getLocText("Specify"),});
+ selectCountComboBox.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent evt) {
+ int selectIndex = selectCountComboBox.getSelectedIndex();
+ CardLayout c1 = (CardLayout) selectCountCardPane.getLayout();
+ if (selectIndex == 1) {
+ c1.show(selectCountCardPane, "TOP");
+ } else if (selectIndex == 2) {
+ c1.show(selectCountCardPane, "BOTTOM");
+ } else if (selectIndex == 3) {
+ c1.show(selectCountCardPane, "ODD");
+ } else if (selectIndex == 4) {
+ c1.show(selectCountCardPane, "EVEN");
+ } else if (selectIndex == 5) {
+ c1.show(selectCountCardPane, "SPECIFY");
+ } else {
+ c1.show(selectCountCardPane, "UNDEFINE");
+ }
+ }
+ });
+
+ selectCountCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
+ this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsetText), selectCountComboBox,
+ new UILabel(InsetText), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST);
+// selectCountCardPane.setLayout(new CardLayout());
+
+ //not define pane
+
+ JPanel undefinedPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Undefined")), FlowLayout.LEFT);
+ topFormulaPane = new JFormulaField("-1");
+ bottomFormulaPane = new JFormulaField("-1");
+ serialTextField = new UITextField(18);
+ JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ + " " + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FlowLayout.LEFT);
+ JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ + " " + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FlowLayout.LEFT);
+ JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{
+ serialTextField, new UILabel(
+ Inter.getLocText(new String[]{
+ "Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"},
+ new String[]{": 1,2-3,5,8 ", ",", "$__count__"})
+ )
+ }, FlowLayout.LEFT);
+ serialTextField.setToolTipText(Inter.getLocText("StyleFormat-Sample") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")");
+ selectCountCardPane.add(undefinedPane, "UNDEFINE");
+ selectCountCardPane.add(topFormulaPane, "TOP");
+ selectCountCardPane.add(bottomFormulaPane, "BOTTOM");
+ //odd
+ selectCountCardPane.add(oddPane, "ODD");
+ //even
+ selectCountCardPane.add(evenPane, "EVEN");
+ //specify
+ selectCountCardPane.add(specifyPane, "SPECIFY");
+ }
+
+ public void populate(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+ this.cellElement = cellElement;
+
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) (cellElement.getValue());
+ SelectCount selectCount = dSColumn.getSelectCount();
+ this.topFormulaPane.populateElement(cellElement);
+ this.bottomFormulaPane.populateElement(cellElement);
+ if (selectCount != null) {
+ int selectCountType = selectCount.getType();
+ this.selectCountComboBox.setSelectedIndex(selectCountType);
+ if (selectCountType == TOP.getValue()) {
+ this.topFormulaPane.populate(selectCount.getFormulaCount());
+ } else if (selectCountType == BOTTOM.getValue()) {
+ this.bottomFormulaPane.populate(selectCount.getFormulaCount());
+ } else if (selectCountType == SPECIFY.getValue()) {
+ this.serialTextField.setText(selectCount.getSerial());
+ }
+ }
+ }
+
+ public void update(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) (cellElement.getValue());
+
+ //alex:SelectCount
+ int selectCountSelectIndex = this.selectCountComboBox.getSelectedIndex();
+ if (selectCountSelectIndex == 0) {
+ dSColumn.setSelectCount(null);
+ } else {
+ SelectCount selectCount = new SelectCount();
+ dSColumn.setSelectCount(selectCount);
+ selectCount.setType(selectCountSelectIndex);
+ if (selectCountSelectIndex == TOP.getValue()) {
+ selectCount.setFormulaCount(this.topFormulaPane.getFormulaText());
+ } else if (selectCountSelectIndex == BOTTOM.getValue()) {
+ selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText());
+ } else if (selectCountSelectIndex == SPECIFY.getValue()) {
+ selectCount.setSerial(this.serialTextField.getText());
+ }
+ }
+ }
+
+ private JFormattedTextField getTextField(JSpinner spinner) {
+ JComponent editor = spinner.getEditor();
+ if (editor instanceof JSpinner.DefaultEditor) {
+ return ((JSpinner.DefaultEditor) editor).getTextField();
+ } else {
+ System.err.println("Unexpected editor type: "
+ + spinner.getEditor().getClass()
+ + " isn't a descendant of DefaultEditor");
+ return null;
+ }
+ }
+ }
+
+ private static class JFormulaField extends JPanel {
+ private CellElement cellElement;
+ private UITextField formulaTextField;
+ private String defaultValue;
+
+ public JFormulaField(String defaultValue) {
+ this.defaultValue = defaultValue;
+
+ this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
+ UILabel bottomLabel = new UILabel("=");
+ bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12));
+ this.add(bottomLabel);
+ formulaTextField = new UITextField(24);
+ this.add(formulaTextField);
+ formulaTextField.setText(defaultValue);
+
+ UIButton bottomFrmulaButton = new UIButton("...");
+ this.add(bottomFrmulaButton);
+ bottomFrmulaButton.setToolTipText(Inter.getLocText("Formula") + "...");
+ bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height));
+ bottomFrmulaButton.addActionListener(formulaButtonActionListener);
+ }
+
+ public void populate(String formulaContent) {
+ this.formulaTextField.setText(formulaContent);
+ }
+
+ public void populateElement(CellElement cellElement) {
+ this.cellElement = cellElement;
+ }
+
+ public String getFormulaText() {
+ return this.formulaTextField.getText();
+ }
+
+ private ActionListener formulaButtonActionListener = new ActionListener() {
+
+ public void actionPerformed(ActionEvent evt) {
+ BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build();
+ String text = formulaTextField.getText();
+ if (text == null || text.length() <= 0) {
+ valueFormula.setContent(defaultValue);
+ } else {
+ valueFormula.setContent(text);
+ }
+
+ final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula();
+
+ if (cellElement == null) {
+ return;
+ }
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dsColumn = (DSColumn) value;
+
+ String[] displayNames = DesignTableDataManager.getSelectedColumnNames(DesignTableDataManager.getEditingTableDataSource(), dsColumn.getDSName());
+
+ formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames, true));
+ formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(JFormulaField.this), new DialogActionAdapter() {
+ @Override
+ public void doOk() {
+ BaseFormula valueFormula = formulaPane.update();
+ if (valueFormula.getContent().length() <= 1) {
+ formulaTextField.setText(defaultValue);
+ } else {
+ formulaTextField.setText(valueFormula.getContent().substring(1));
+ }
+ }
+ }).setVisible(true);
+ }
+ };
+ }
+
+ private static class ValuePane extends JPanel {
+ private JFormulaField formulaField;
+
+ public ValuePane() {
+ this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
+
+ this.add(new UILabel(InsetText + Inter.getLocText("Value") + ":"));
+ this.add(Box.createHorizontalStrut(2));
+ this.add((formulaField = new JFormulaField("$$$")));
+ }
+
+ public void populate(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) value;
+
+ //formula
+ String valueFormula = dSColumn.getResult();
+ if (valueFormula == null) {
+ valueFormula = "$$$";
+ }
+ formulaField.populateElement(cellElement);
+ formulaField.populate(valueFormula);
+ }
+
+ public void update(CellElement cellElement) {
+ if (cellElement == null) {
+ return;
+ }
+ Object value = cellElement.getValue();
+ if (value == null || !(value instanceof DSColumn)) {
+ return;
+ }
+ DSColumn dSColumn = (DSColumn) (cellElement.getValue());
+
+ //formula
+ dSColumn.setResult(this.formulaField.getFormulaText());
+ }
+ }
+
+ private void checkButtonEnabled() {
+ if (useMultiplyNumCheckBox.isSelected()) {
+ multiNumSpinner.setEnabled(true);
+ } else {
+ multiNumSpinner.setEnabled(false);
+ }
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/dscolumn/DSColumnConditionsPane.java b/designer/src/com/fr/design/dscolumn/DSColumnConditionsPane.java
index 228e88ae42..88e807e92b 100644
--- a/designer/src/com/fr/design/dscolumn/DSColumnConditionsPane.java
+++ b/designer/src/com/fr/design/dscolumn/DSColumnConditionsPane.java
@@ -38,7 +38,7 @@ public class DSColumnConditionsPane extends BasicPane {
if (setting > DSColumnPane.SETTING_DSRELATED) {
liteConditionPane = new DSColumnLiteConditionPane() {
- protected boolean needDoWithCondition(Condition liteCondition) {
+ protected boolean isNeedDoWithCondition(Condition liteCondition) {
return liteCondition != null;
}
};
diff --git a/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
index 530c92f844..61ac3bd361 100644
--- a/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
+++ b/designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
@@ -7,7 +7,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
-import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.report.cell.TemplateCellElement;
@@ -24,7 +23,7 @@ import java.awt.event.ItemListener;
* 这个pane是选中数据列后,在上方QuickRegion处显示的pane
*
* @author zhou, yaoh.wu
- * @version 2017年8月2日14点55分
+ * @version 2017年9月26日17点22分
* @since 8.0
*/
public class ResultSetGroupDockingPane extends ResultSetGroupPane {
@@ -41,12 +40,12 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private ItemListener listener;
- public ResultSetGroupDockingPane(ElementCasePane ePane) {
+ public ResultSetGroupDockingPane() {
super();
- this.initComponents(ePane);
+ this.initComponents();
}
- public void initComponents(ElementCasePane ePane) {
+ public void initComponents() {
goBox = new UIComboBox(new String[]{Inter.getLocText("BindColumn-Group"), Inter.getLocText("BindColumn-Select"), Inter.getLocText("BindColumn-Summary")});
initCardPane();
contentPane = layoutPane();
@@ -66,23 +65,23 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
};
goBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ee) {
- checkButtonEnabled();
int i = goBox.getSelectedIndex();
if (i == BIND_GROUP) {
cardLayout.show(cardPane, "groupPane");
- cardPane.setPreferredSize(new Dimension(156, 20));
- TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane,2,10);
+ cardPane.setPreferredSize(new Dimension(158, 20));
+ TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
} else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0));
- TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane,2,0);
+ TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
} else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane");
- cardPane.setPreferredSize(new Dimension(156, 20));
- TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane,2,10);
+ cardPane.setPreferredSize(new Dimension(158, 20));
+ TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE);
}
+ checkButtonEnabled();
}
});
@@ -96,7 +95,6 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
cardLayout = new CardLayout();
cardPane.setLayout(cardLayout);
- JPanel pane = new JPanel(new BorderLayout(3, 0));
groupComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkButtonEnabled();
@@ -104,7 +102,9 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
});
advancedButton = new UIButton(Inter.getLocText("Custom"));
advancedButton.addActionListener(groupAdvancedListener);
- pane.add(groupComboBox, BorderLayout.WEST);
+
+ JPanel pane = new JPanel(new BorderLayout(0, 10));
+ pane.add(groupComboBox, BorderLayout.NORTH);
pane.add(advancedButton, BorderLayout.CENTER);
cardPane.add(pane, "groupPane");
@@ -115,16 +115,16 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
@Override
public void populate(TemplateCellElement cellElement) {
+ //更新面板信息时可能会触发绑定在组件上的事件,先移除这些事件
+ this.removeListener();
this.cellElement = cellElement;
-
- if (isNPE(cellElement)) return;
+ if (isNPE(cellElement)) {
+ return;
+ }
DSColumn dSColumn = (DSColumn) cellElement.getValue();
-
- // populate groupPane
- // RecordGrouper
recordGrouper = dSColumn.getGrouper();
if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) {
- int mode = ((FunctionGrouper) recordGrouper).getDivideMode();
+ int mode = recordGrouper.getDivideMode();
if (mode == FunctionGrouper.GROUPING_MODE) {
cardLayout.show(cardPane, "groupPane");
this.goBox.setSelectedIndex(BIND_GROUP);
@@ -152,15 +152,17 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(ADVANCED);
}
-
checkButtonEnabled();
+ //加上面板组件的交互事件监听
+ this.addListener();
}
@Override
public void update() {
- if (isNPE(cellElement)) return;
+ if (isNPE(cellElement)) {
+ return;
+ }
DSColumn dSColumn = (DSColumn) cellElement.getValue();
-
if (this.goBox.getSelectedIndex() == BIND_GROUP) {
recordGrouper = updateGroupCombox();
} else if (this.goBox.getSelectedIndex() == BIND_SELECTED) {
@@ -190,12 +192,25 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
advancedButton.setEnabled(true);
}
}
+ if (advancedButton.isEnabled()) {
+ cardPane.setPreferredSize(new Dimension(158, 50));
+ cardPane.revalidate();
+ cardPane.repaint();
+ return;
+ }
+ if (groupComboBox.isEnabled() || functionComboBox.isEnabled()) {
+ cardPane.setPreferredSize(new Dimension(158, 20));
+ cardPane.revalidate();
+ cardPane.repaint();
+ return;
+ }
+ cardPane.setPreferredSize(new Dimension(158, 0));
+ cardPane.revalidate();
+ cardPane.repaint();
}
- public void addListener(ItemListener listener) {
- goBox.addItemListener(listener);
- groupComboBox.addItemListener(listener);
- functionComboBox.addItemListener(listener);
+
+ public void setListener(ItemListener listener) {
this.listener = listener;
}
@@ -207,4 +222,16 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
public void setRecordGrouper(RecordGrouper recordGrouper) {
this.recordGrouper = recordGrouper;
}
+
+ private void addListener() {
+ goBox.addItemListener(this.listener);
+ groupComboBox.addItemListener(this.listener);
+ functionComboBox.addItemListener(this.listener);
+ }
+
+ private void removeListener() {
+ goBox.removeItemListener(this.listener);
+ groupComboBox.removeItemListener(this.listener);
+ functionComboBox.removeItemListener(this.listener);
+ }
}
\ No newline at end of file
diff --git a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
index d672810286..362c281667 100644
--- a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
+++ b/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
@@ -41,7 +41,7 @@ import java.util.regex.Pattern;
*
* @author yaoh.wu
* @version 2017年8月3日
- * 复用对话框代码,保留对话框原始布局
+ * 复用对话框代码,保留对话框原始布局
* @since 8.0
*/
public class SelectedDataColumnPane extends BasicPane {
@@ -282,7 +282,7 @@ public class SelectedDataColumnPane extends BasicPane {
private void initWithParameterButton(final ElementCasePane casePane, final TemplateCellElement cellElement) {
final SelectedDataColumnPane that = this;
editorPane = new UITableEditorPane(new ParameterTableModel());
- paramButton = new UIButton(Inter.getLocText("TableData_Dynamic_Parameter_Setting"));
+ paramButton = new UIButton(Inter.getLocText("FR-Designer-Basic_Dynamic_Parameter_Injection"));
paramButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
diff --git a/designer/src/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java b/designer/src/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java
index 7321f2ca64..d03a6e47b0 100644
--- a/designer/src/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java
+++ b/designer/src/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java
@@ -1,6 +1,6 @@
package com.fr.design.dscolumn;
-import com.fr.base.Formula;
+import com.fr.base.BaseFormula;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.DSColumnLiteConditionPane;
import com.fr.design.dialog.BasicPane;
@@ -333,7 +333,7 @@ public class SpecifiedGroupAttrPane extends BasicPane {
formulaButton.setPreferredSize(new Dimension(25, valueField.getPreferredSize().height));
formulaButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
- Formula valueFormula = new Formula();
+ BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build();
String text = valueField.getText();
if (text == null || text.length() <= 0) {
valueFormula.setContent("$$$");
@@ -347,7 +347,7 @@ public class SpecifiedGroupAttrPane extends BasicPane {
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(FormulaGroupPane.this), new DialogActionAdapter(){
@Override
public void doOk() {
- Formula valueFormula = formulaPane.update();
+ BaseFormula valueFormula = formulaPane.update();
if (valueFormula.getContent().length() <= 1) {
valueField.setText("$$$");
} else {
diff --git a/designer/src/com/fr/design/expand/SortExpandAttrPane.java b/designer/src/com/fr/design/expand/SortExpandAttrPane.java
index d346dd890c..11260c74b4 100644
--- a/designer/src/com/fr/design/expand/SortExpandAttrPane.java
+++ b/designer/src/com/fr/design/expand/SortExpandAttrPane.java
@@ -24,11 +24,11 @@ public class SortExpandAttrPane extends JPanel {
public SortExpandAttrPane() {
this.setLayout(new BorderLayout(0, 4));
- Icon[] iconArray = {
- BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"),
- BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"),
- BaseUtils.readIcon("/com/fr/design/images/expand/des.png")
- };
+ Icon[][] iconArray = {
+ {BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")},
+ {BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"), BaseUtils.readIcon("/com/fr/design/images/expand/asc_selected.png")},
+ {BaseUtils.readIcon("/com/fr/design/images/expand/des.png"), BaseUtils.readIcon("/com/fr/design/images/expand/des_selected.png")}
+ };
String[] nameArray = { Inter.getLocText("Sort-Original"), Inter.getLocText("Sort-Ascending"), Inter.getLocText("Sort-Descending") };
sort_type_pane = new UIButtonGroup(iconArray);
sort_type_pane.setAllToolTips(nameArray);
diff --git a/designer/src/com/fr/design/headerfooter/HFAttributesEditDialog.java b/designer/src/com/fr/design/headerfooter/HFAttributesEditDialog.java
index f30a6e2129..f432c39f7b 100644
--- a/designer/src/com/fr/design/headerfooter/HFAttributesEditDialog.java
+++ b/designer/src/com/fr/design/headerfooter/HFAttributesEditDialog.java
@@ -3,8 +3,16 @@
*/
package com.fr.design.headerfooter;
-import com.fr.base.Formula;
-import com.fr.base.headerfooter.*;
+import com.fr.base.BaseFormula;
+import com.fr.base.headerfooter.DateHFElement;
+import com.fr.base.headerfooter.FormulaHFElement;
+import com.fr.base.headerfooter.HFElement;
+import com.fr.base.headerfooter.ImageHFElement;
+import com.fr.base.headerfooter.NewLineHFElement;
+import com.fr.base.headerfooter.NumberOfPageHFElement;
+import com.fr.base.headerfooter.PageNumberHFElement;
+import com.fr.base.headerfooter.TextHFElement;
+import com.fr.base.headerfooter.TimeHFElement;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
@@ -121,7 +129,7 @@ public class HFAttributesEditDialog extends BasicPane {
formulaButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
- Formula valueFormula = new Formula();
+ BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build();
String text = formulaContentField.getText();
if (text == null || text.length() <= 0) {
valueFormula.setContent("");
@@ -135,7 +143,7 @@ public class HFAttributesEditDialog extends BasicPane {
@Override
public void doOk() {
- Formula valueFormula = formulaPane.update();
+ BaseFormula valueFormula = formulaPane.update();
if (valueFormula.getContent().length() <= 1) {
formulaContentField.setText("");
} else {
diff --git a/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java b/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java
index 3a57b11ec5..a941660aa1 100644
--- a/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java
+++ b/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java
@@ -1,7 +1,6 @@
package com.fr.design.mainframe;
-import com.fr.base.BaseUtils;
+import com.fr.base.ConfigManager;
import com.fr.design.DesignerEnvManager;
-import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StableUtils;
@@ -102,7 +101,7 @@ public class ActiveKeyGenerator {
HashMap para = new HashMap();
para.put("uuid", envManager.getUUID());
para.put("key", key);
- para.put("username", envManager.getBBSName());
+ para.put("username", ConfigManager.getProviderInstance().getBbsUsername());
HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para);
if (timeout != -1) {
hc.setTimeout(timeout);
diff --git a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
index 79e52bfe14..23e4622e1d 100644
--- a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
+++ b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
@@ -238,7 +238,6 @@ public class AuthorityToolBarPane extends BasicBeanPane extends Tar
/**
* Constructor.
*/
- public ElementCasePane(T t) {
+ public ElementCasePane(T t) {
super(t);
// marks:能触发processEvent,不管是否给component增加listener。这里是使在reportPane中的任意位置滑动鼠标轮都能
// 下拉grid。
@@ -209,7 +161,7 @@ public abstract class ElementCasePane extends Tar
this.setLayout(new RGridLayout());
//todo 直接修改分辨率
- if (this.resolution == 0){
+ if (this.resolution == 0) {
this.resolution = ScreenResolution.getScreenResolution();
}
@@ -243,7 +195,6 @@ public abstract class ElementCasePane extends Tar
}
-
public int getMenuState() {
return DesignState.WORK_SHEET;
}
@@ -294,8 +245,8 @@ public abstract class ElementCasePane extends Tar
setFormatState(DesignerContext.FORMAT_STATE_NULL);
formatBrush.setSelected(false);
grid.setCursor(UIConstants.CELL_DEFAULT_CURSOR);
- if(DesignerContext.getReferencedElementCasePane() == null){
- return;
+ if (DesignerContext.getReferencedElementCasePane() == null) {
+ return;
}
((ElementCasePane) DesignerContext.getReferencedElementCasePane()).getGrid().setNotShowingTableSelectPane(true);
@@ -348,11 +299,11 @@ public abstract class ElementCasePane extends Tar
}
- public void setResolution(int resolution){
+ public void setResolution(int resolution) {
this.resolution = resolution;
}
- public int getResolution(){
+ public int getResolution() {
return this.resolution;
}
@@ -371,7 +322,7 @@ public abstract class ElementCasePane extends Tar
private void initDefaultEditors() {
Grid grid = this.getGrid();
grid.setDefaultCellEditor(DSColumn.class, new DSColumnCellEditor(this));
- grid.setDefaultCellEditor(Formula.class, new FormulaCellEditor(this));
+ grid.setDefaultCellEditor(BaseFormula.class, new FormulaCellEditor(this));
grid.setDefaultCellEditor(RichText.class, new RichTextCellEditor(this));
grid.setDefaultCellEditor(BiasTextPainter.class, new BiasTextPainterCellEditor(this));
@@ -1150,7 +1101,7 @@ public abstract class ElementCasePane extends Tar
HeadColumnAction headcolumnAction = new HeadColumnAction(this);
FootColumnAction footcolumnAction = new FootColumnAction(this);
- ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(),this.resolution);
+ ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(this, evt.getX(), evt.getY(), this.resolution);
ElementCase elementCase = this.getEditingElementCase();
boolean cancel = false;
ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr();
@@ -1268,11 +1219,7 @@ public abstract class ElementCasePane extends Tar
protected ToolBarDef createAlignmentToolBar() {
return ShortCut.asToolBarDef(new ShortCut[]{
- new AlignmentAction(this, new Icon[]{
- BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
- BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
- BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")},
- new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT})}
+ new AlignmentAction(this)}
);
}
@@ -1325,7 +1272,7 @@ public abstract class ElementCasePane extends Tar
* @return 返回正在编辑的状态.
*/
public EditingState createEditingState() {
- return new ElementCaseEditingState(this.selection, this.verScrollBar.getValue(), this.horScrollBar.getValue());
+ return new ElementCaseEditingState(this.selection, this.verScrollBar.getValue(), this.horScrollBar.getValue(), this.resolution);
}
public void setCellNeedTOFormat(CellSelection selection) {
@@ -1341,15 +1288,18 @@ public abstract class ElementCasePane extends Tar
protected Selection selection;
protected int verticalValue = 0;
protected int horizontalValue = 0;
+ protected int resolution = ScreenResolution.getScreenResolution();
- protected ElementCaseEditingState(Selection selection, int verticalValue, int horizontalValue) {
+ protected ElementCaseEditingState(Selection selection, int verticalValue, int horizontalValue, int resolution) {
try {
this.selection = selection.clone();
+ this.resolution = resolution;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
this.verticalValue = verticalValue;
this.horizontalValue = horizontalValue;
+ this.resolution = resolution;
}
@Override
@@ -1363,7 +1313,8 @@ public abstract class ElementCasePane extends Tar
ElementCasePane.this.getVerticalScrollBar().setValue(this.verticalValue);
ElementCasePane.this.getHorizontalScrollBar().setValue(this.horizontalValue);
-
+// ElementCasePane.this.setResolution(this.resolution);
+ HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(this.resolution);
// 重绘.
ElementCasePane.this.repaint();
}
diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
index cf63c4448e..8d25463ab8 100644
--- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
+++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
@@ -1,6 +1,7 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
+import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils;
@@ -44,58 +45,72 @@ public class ElementCasePaneDelegate extends ElementCasePane {
public ElementCasePaneDelegate(WorkSheet sheet) {
super(sheet);
this.addSelectionChangeListener(new SelectionListener() {
-
@Override
public void selectionChanged(SelectionEvent e) {
- //在编辑权限,所以要更新权限编辑面板
- if (BaseUtils.isAuthorityEditing()) {
- AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
- authorityPropertyPane.populate();
- EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
- EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
- EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
+ if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
return;
}
- CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
- CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
- QuickEditorRegion.getInstance().populate(getCurrentEditor());
- JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
- if (editingTemplate != null && !editingTemplate.isUpMode()) {
- Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
- // 模板初始化完成后,才能初始化超级链接面板
- HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
- hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
- if (editingSelection instanceof FloatSelection) {
- EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
- JPanel floatPane = new JPanel(new BorderLayout());
- floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
- floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
- EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
- } else {
- // 条件属性
- ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
- conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
-
- EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
- EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
- EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
- EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
- EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
- EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
- }
- EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
- EastRegionContainerPane.getInstance().removeParameterPane();
- }
+ refreshPropertyPanes();
}
});
this.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
- CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
+ if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
+ refreshPropertyPanes();
+ } else {
+ CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
+ }
}
});
}
+ private void refreshPropertyPanes() {
+ //在编辑权限,所以要更新权限编辑面板
+ if (BaseUtils.isAuthorityEditing()) {
+ AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
+ authorityPropertyPane.populate();
+ EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
+ EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
+ EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
+ return;
+ }
+ if (DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
+ CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
+ }
+ CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
+ QuickEditorRegion.getInstance().populate(getCurrentEditor());
+ JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
+ if (editingTemplate != null && !editingTemplate.isUpMode()) {
+ Selection editingSelection = getSelection();
+ // 模板初始化完成后,才能初始化超级链接面板
+ HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
+ hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
+ if (editingSelection instanceof FloatSelection) {
+ EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
+ JPanel floatPane = new JPanel(new BorderLayout());
+ floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
+ floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
+ EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
+ } else {
+ // 条件属性
+ ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
+ conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
+
+ EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
+ EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
+ EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
+ EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
+ EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
+ EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
+
+ EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
+ }
+ EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
+ EastRegionContainerPane.getInstance().removeParameterPane();
+ }
+ }
+
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;
@@ -122,6 +137,7 @@ public class ElementCasePaneDelegate extends ElementCasePane {
*
* @return 不是必须在可见范围.
*/
+ @Override
public boolean mustInVisibleRange() {
return false;
}
@@ -162,6 +178,9 @@ public class ElementCasePaneDelegate extends ElementCasePane {
for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[i]);
}
+
+ // 顺便更新右侧属性面板悬浮元素tab中的菜单项
+ ReportFloatPane.getInstance().refreshInsertFloatMenu(this);
}
// 格式菜单
@@ -169,12 +188,13 @@ public class ElementCasePaneDelegate extends ElementCasePane {
MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic());
menuDef.addShortCut(new CellExpandAttrAction());
- menuDef.addShortCut(new CellWidgetAttrAction(this));
menuDef.addShortCut(new GlobalStyleMenuDef(this));
-
// 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
+ menuDef.addShortCut(new CellWidgetAttrAction());
+ menuDef.addShortCut(new ConditionAttributesAction());
+ menuDef.addShortCut(new HyperlinkAction());
menuDef.addShortCut(SeparatorDef.DEFAULT);
menuDef.addShortCut(new MergeCellAction(this));
menuDef.addShortCut(new UnmergeCellAction(this));
diff --git a/designer/src/com/fr/design/mainframe/InformationCollector.java b/designer/src/com/fr/design/mainframe/InformationCollector.java
index 4bac9a15b0..7cc6eb6c44 100644
--- a/designer/src/com/fr/design/mainframe/InformationCollector.java
+++ b/designer/src/com/fr/design/mainframe/InformationCollector.java
@@ -3,6 +3,7 @@
*/
package com.fr.design.mainframe;
+import com.fr.base.ConfigManagerFactory;
import com.fr.base.FRContext;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.DialectFactory;
@@ -12,23 +13,51 @@ import com.fr.data.core.db.dml.Table;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
-import com.fr.general.*;
+import com.fr.general.ComparatorUtils;
+import com.fr.general.DateUtils;
+import com.fr.general.DesUtils;
+import com.fr.general.GeneralUtils;
+import com.fr.general.IOUtils;
+import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
-import com.fr.record.DBRecordManager;
-import com.fr.stable.*;
-import com.fr.stable.xml.*;
+import com.fr.json.JSONObject;
+import com.fr.record.DBRecordXManager;
+import com.fr.stable.ArrayUtils;
+import com.fr.stable.EncodeConstants;
+import com.fr.stable.ProductConstants;
+import com.fr.stable.StableUtils;
+import com.fr.stable.StringUtils;
+import com.fr.stable.xml.XMLPrintWriter;
+import com.fr.stable.xml.XMLReadable;
+import com.fr.stable.xml.XMLTools;
+import com.fr.stable.xml.XMLWriter;
+import com.fr.stable.xml.XMLableReader;
import com.fr.third.javax.xml.stream.XMLStreamException;
-import org.json.JSONObject;
-import java.io.*;
+import java.io.BufferedWriter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* @author neil
@@ -125,19 +154,23 @@ public class InformationCollector implements XMLReadable, XMLWriter {
JSONArray startStopArray = new JSONArray();
for (int i = 0; i < startStop.size(); i++) {
JSONObject jo = new JSONObject();
- jo.put(ATTR_START, startStop.get(i).getStartDate());
- jo.put(ATTR_STOP, startStop.get(i).getStopDate());
- startStopArray.put(jo);
+ try {
+ jo.put(ATTR_START, startStop.get(i).getStartDate());
+ jo.put(ATTR_STOP, startStop.get(i).getStopDate());
+ startStopArray.put(jo);
+ DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
+ content.put(XML_START_STOP, startStopArray);
+ content.put(XML_UUID, envManager.getUUID());
+ content.put(XML_JAR, GeneralUtils.readBuildNO());
+ content.put(XML_VERSION, ProductConstants.RELEASE_VERSION);
+ content.put(XML_USERNAME, ConfigManagerFactory.getProviderInstance().getBbsUsername());
+ content.put(XML_KEY, envManager.getActivationKey());
+ content.put(XML_OS, System.getProperty("os.name"));
+ } catch (JSONException e) {
+ FRContext.getLogger().error(e.getMessage(), e);
+ }
}
- DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
- content.put(XML_START_STOP, startStopArray);
- content.put(XML_UUID, envManager.getUUID());
- content.put(XML_JAR, GeneralUtils.readBuildNO());
- content.put(XML_VERSION, ProductConstants.RELEASE_VERSION);
- content.put(XML_USERNAME, envManager.getBBSName());
- content.put(XML_KEY, envManager.getActivationKey());
- content.put(XML_OS, System.getProperty("os.name"));
-
+
try {
return content.toString().getBytes(EncodeConstants.ENCODING_UTF_8);
} catch (UnsupportedEncodingException e) {
@@ -161,7 +194,12 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
String res = hc.getResponseText();
//服务器返回true,说明已经取得成功,清空当前记录的信息
- boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
+ boolean success = false;
+ try {
+ success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
+ } catch (JSONException e) {
+ FRContext.getLogger().error(e.getMessage(), e);
+ }
if (success){
this.reset();
}
@@ -179,7 +217,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
Table table = new Table(TABLE_NAME);
try {
- conn = DBRecordManager.getDB().createConnection();
+ conn = DBRecordXManager.getDB().createConnection();
ResultSet rs = selectAllFromLogDB(conn, table);
if(rs == null){
@@ -201,8 +239,13 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
String res = httpClient.getResponseText();
- boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
- //服务器返回true, 说明已经获取成功, 清空当前记录的信息
+ boolean success = false;
+ try {
+ success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
+ } catch (JSONException e) {
+ FRContext.getLogger().error(e.getMessage(), e);
+ }
+ //服务器返回true, 说明已经获取成功, 清空当前记录的信息
if (success) {
deleteLogDB(conn, table);
}
@@ -211,7 +254,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
private void deleteLogDB(Connection conn, Table table) {
try {
- conn = DBRecordManager.getDB().createConnection();
+ conn = DBRecordXManager.getDB().createConnection();
Delete delete = new Delete(table);
delete.execute(conn);
} catch (Exception e) {
@@ -254,7 +297,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
- content.put("username", envManager.getBBSName());
+ content.put("username", ConfigManagerFactory.getProviderInstance().getBbsUsername());
content.put("uuid", envManager.getUUID());
content.put("functions", functionArray);
diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java
index 2b23dabb7f..82d796a30d 100644
--- a/designer/src/com/fr/design/mainframe/JWorkBook.java
+++ b/designer/src/com/fr/design/mainframe/JWorkBook.java
@@ -92,7 +92,7 @@ public class JWorkBook extends JTemplate {
private UIModeControlContainer centerPane;
public ReportComponentComposite reportComposite;
private ParameterDefinitePane parameterPane;
- private int resolution;
+ private int resolution = ScreenResolution.getScreenResolution();
public JWorkBook() {
super(new WorkBook(new WorkSheet()), "WorkBook");
@@ -114,10 +114,13 @@ public class JWorkBook extends JTemplate {
if (isEditingPolySheet()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
} else {
- EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
- EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane());
- EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
+ if (isUpMode()) {
+ EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA);
+ } else {
+ EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
+ }
}
+ refreshToolArea();
}
private boolean isEditingPolySheet() {
@@ -129,6 +132,11 @@ public class JWorkBook extends JTemplate {
return getEditingElementCasePane();
}
+ @Override
+ public JComponent getCurrentReportComponentPane() {
+ return reportComposite;
+ }
+
@Override
protected UIModeControlContainer createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;
@@ -394,7 +402,6 @@ public class JWorkBook extends JTemplate {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution);
polyDezi.updateUI();
}
- HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
}
@Override
@@ -854,6 +861,11 @@ public class JWorkBook extends JTemplate {
return ReportHyperlinkGroupPane.getInstance(hyperlinkGroupPaneActionProvider);
}
+ @Override
+ public HyperlinkGroupPane getHyperLinkPaneNoPop(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
+ return ReportHyperlinkGroupPaneNoPop.getInstance(hyperlinkGroupPaneActionProvider);
+ }
+
public void setAuthorityMode(boolean isUpMode) {
centerPane.setAuthorityMode(isUpMode);
}
diff --git a/designer/src/com/fr/design/mainframe/ReportComponent.java b/designer/src/com/fr/design/mainframe/ReportComponent.java
index 6ca2685454..699f6c1c5b 100644
--- a/designer/src/com/fr/design/mainframe/ReportComponent.java
+++ b/designer/src/com/fr/design/mainframe/ReportComponent.java
@@ -44,6 +44,11 @@ public abstract class ReportComponent= textX && evtX < textX + textWidth) {
- if (getSelectedIndex() != i) {
+ boolean needRefreshPropertiesPane = getSelectedIndex() != i;
+ setSelectedIndex(i);
+ if (needRefreshPropertiesPane) {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
}
- setSelectedIndex(i);
+
isBlank = false;
reportComposite.setComposite();
if (isAuthorityEditing) {
diff --git a/designer/src/com/fr/design/mainframe/WorkSheetDesigner.java b/designer/src/com/fr/design/mainframe/WorkSheetDesigner.java
index d258120958..454315f958 100644
--- a/designer/src/com/fr/design/mainframe/WorkSheetDesigner.java
+++ b/designer/src/com/fr/design/mainframe/WorkSheetDesigner.java
@@ -4,11 +4,13 @@ import java.awt.BorderLayout;
import javax.swing.*;
+import com.fr.base.ScreenResolution;
import com.fr.design.DesignState;
import com.fr.design.actions.report.*;
import com.fr.design.designer.EditingState;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
+import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.*;
import com.fr.grid.selection.CellSelection;
@@ -21,6 +23,8 @@ import com.fr.stable.ArrayUtils;
public class WorkSheetDesigner extends ReportComponent {
+ private static final int HUND = 100;
+
public WorkSheetDesigner(WorkSheet sheet) {
super(sheet);
@@ -166,6 +170,13 @@ public class WorkSheetDesigner extends ReportComponent {
private static final int OFFSET = 45;
+ private static final String SELECTED_PATH = AlphaFineConstants.IMAGE_URL + "selected";
+ private static final String CELL_PATH = AlphaFineConstants.IMAGE_URL + "alphafine";
+ private static final String SUFFIX = ".png";
@Override
public Component getListCellRendererComponent(JList> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@@ -30,13 +33,13 @@ public class ContentCellRender implements ListCellRenderer