Browse Source

REPORT-62440 表头排序内置

feature/x
Henry.Wang 3 years ago
parent
commit
20452f96e5
  1. 2
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java
  2. 2
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortItemPane.java
  3. 7
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortPane.java
  4. 1
      designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortGroupPane.java
  5. 1
      designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortItemPane.java
  6. 1
      designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortPane.java
  7. 5
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java
  8. 5
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java
  9. 1
      designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java
  10. 1
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  11. 1
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CellSortExpressionPane.java
  12. 1
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceEditPane.java
  13. 8
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java
  14. 2
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceSortExpressionPane.java
  15. 3
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java
  16. 1
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java
  17. 6
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java
  18. 6
      designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java

2
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java

@ -11,7 +11,6 @@ import com.fr.report.core.sort.sortexpression.SortExpression;
public class CellDSColumnSortGroupPane extends AbstractSortGroupPane {
DSColumn dsColumn;
public CellDSColumnSortGroupPane(int sortGroupPaneWidth, int sortGroupPaneRightWidth) {
super(sortGroupPaneWidth, sortGroupPaneRightWidth);
}
@ -20,7 +19,6 @@ public class CellDSColumnSortGroupPane extends AbstractSortGroupPane {
this.dsColumn = dsColumn;
}
@Override
protected AbstractSortItemPane refreshSortItemPane(int sortItemPaneWidth, int sortItemPaneRightWidth, SortExpression sortExpression) {
CellDSColumnSortItemPane cellDSColumnSortItemPane = new CellDSColumnSortItemPane( sortItemPaneWidth, sortItemPaneRightWidth);

2
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortItemPane.java

@ -12,7 +12,6 @@ import java.awt.*;
public class CellDSColumnSortItemPane extends AbstractSortItemPane {
UIComboBox sortAreaUiComboBox;
public CellDSColumnSortItemPane(int sortItemPaneWidth, int sortItemPaneRightWidth) {
@ -44,7 +43,6 @@ public class CellDSColumnSortItemPane extends AbstractSortItemPane {
sortAreaUiComboBox.registerChangeListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
super.removeListener(uiObserverListener);
sortAreaUiComboBox.removeChangeListener();

7
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortPane.java

@ -9,20 +9,16 @@ import com.fr.report.core.sort.common.CellSortAttr;
public class CellDSColumnSortPane extends AbstractSortPane {
public CellDSColumnSortPane() {
super(220, 150);
}
@Override
protected void initSortGroupPane() {
sortGroupPane = new CellDSColumnSortGroupPane(sortPaneWidth, sortPaneRightWidth);
this.add(sortGroupPane);
}
@Override
protected CellSortAttr getCellSortAttr(TemplateCellElement cellElement) {
if (cellElement.getValue() instanceof DSColumn) {
@ -40,13 +36,12 @@ public class CellDSColumnSortPane extends AbstractSortPane {
if (cellElement.getValue() instanceof DSColumn) {
DSColumn dsColumn = ((DSColumn) cellElement.getValue());
TableDataColumn tableDataColumn = dsColumn.getColumn();
if (tableDataColumn instanceof TableDataColumn.ColumnName) {
if (tableDataColumn instanceof TableDataColumn) {
selfSortArea = TableDataColumn.getColumnName(tableDataColumn);
}
}
}
public void populateBean(TemplateCellElement cellElement) {
if (cellElement.getValue() instanceof DSColumn) {
DSColumn dsColumn = ((DSColumn) cellElement.getValue());

1
designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortGroupPane.java

@ -6,7 +6,6 @@ import com.fr.report.core.sort.sortexpression.SortExpression;
public class CellExpandSortGroupPane extends AbstractSortGroupPane {
public CellExpandSortGroupPane(int sortGroupPaneWidth, int sortGroupPaneRightWidth) {
super(sortGroupPaneWidth, sortGroupPaneRightWidth);
}

1
designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortItemPane.java

@ -41,7 +41,6 @@ public class CellExpandSortItemPane extends AbstractSortItemPane {
columnRowPane.addListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
super.removeListener(uiObserverListener);
columnRowPane.removeListener(uiObserverListener);

1
designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortPane.java

@ -27,7 +27,6 @@ public class CellExpandSortPane extends AbstractSortPane {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
}
@Override
protected void initSortGroupPane() {
sortGroupPane = new CellExpandSortGroupPane(sortPaneWidth, sortPaneRightWidth);

5
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java

@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.List;
public abstract class AbstractSortItemPane extends JPanel {
protected int sortItemPaneWidth;
protected int sortItemPaneRightWidth;
List<SortExpressionPane> sortExpressionPanes = new ArrayList<>();
@ -73,7 +72,6 @@ public abstract class AbstractSortItemPane extends JPanel {
this.add(sortRulePane);
}
void initSortBasisPanel() {
sortBasisPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP));
sortBasisUiComboBox = new UIComboBox(getSortNames());
@ -90,8 +88,6 @@ public abstract class AbstractSortItemPane extends JPanel {
}
}
});
sortBasisPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Basis"), SwingConstants.LEFT));
sortBasisPanel.add(AbstractSortPane.createIntervalUILabel());
sortBasisPanel.add(sortBasisUiComboBox);
@ -124,7 +120,6 @@ public abstract class AbstractSortItemPane extends JPanel {
} else if (sortExpression.getSortRule() == SortRule.NO_SORT) {
sortRuleUiComboBox.setSelectedIndex(2);
}
for (int i = 0; i < sortExpressionPanes.size(); i++) {
if (StringUtils.equals(sortExpression.getSortName(), sortExpressionPanes.get(i).getSortName())) {
if (currentSortExpressionPane != null) {

5
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java

@ -28,7 +28,6 @@ public abstract class AbstractSortPane extends JPanel {
protected String selfSortArea;
protected String defaultHeaderArea;
public AbstractSortPane(int sortPaneWidth, int sortPaneRightWidth) {
this.sortPaneWidth = sortPaneWidth;
this.sortPaneRightWidth = sortPaneRightWidth;
@ -36,7 +35,6 @@ public abstract class AbstractSortPane extends JPanel {
initComponents();
}
private void initComponents() {
initSortGroupPane();
sortHeaderPane = new SortHeaderPane(sortPaneWidth, sortPaneRightWidth + 5);
@ -46,7 +44,6 @@ public abstract class AbstractSortPane extends JPanel {
protected abstract void initSortGroupPane();
protected void initUIObserverListener() {
}
protected abstract CellSortAttr getCellSortAttr(TemplateCellElement cellElement);
@ -72,7 +69,6 @@ public abstract class AbstractSortPane extends JPanel {
refresh();
}
protected void populateSortArea(TemplateCellElement cellElement) {
int row = cellElement.getRow();
int column = cellElement.getColumn();
@ -107,7 +103,6 @@ public abstract class AbstractSortPane extends JPanel {
sortHeaderPane.removeListener(uiObserverListener);
}
protected void refresh() {
validate();
repaint();

1
designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

@ -61,7 +61,6 @@ public class SortColumnRowPane extends JPanel {
return columnRow != null && columnRow.getRow() != -1 && columnRow.getColumn() != -1;
}
void initTextField() {
colJTextField = new JTextField();
colJTextField.setEditable(false);

1
designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java

@ -13,7 +13,6 @@ import java.awt.event.MouseEvent;
public class SortUIExpandablePane extends JPanel {
private static final long serialVersionUID = 1L;
private HeaderPane headerPane;
private AbstractSortItemPane contentPane;

1
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CellSortExpressionPane.java

@ -13,7 +13,6 @@ public class CellSortExpressionPane extends SortExpressionPane<CellSortExpressio
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
}
@Override
public String getSortName() {
return InterProviderFactory.getProvider().getLocText("Fine-Engine_Sort_Cell");

1
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceEditPane.java

@ -36,7 +36,6 @@ public class CustomSequenceEditPane extends BasicPane {
initComponents();
}
void initComponents() {
this.setLayout(new BorderLayout());
initReferenceSequencePanel();

8
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

@ -1,6 +1,7 @@
package com.fr.design.sort.expressionpane;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField;
@ -16,8 +17,6 @@ import java.util.List;
public class CustomSequencePane extends JPanel {
protected UITextField textField;
protected UIButton button;
List<String> customSequence;
@ -28,13 +27,10 @@ public class CustomSequencePane extends JPanel {
}
protected void initComponents(int width) {
textField = new UITextField();
textField.setEditable(false);
textField.setPreferredSize(new Dimension(width - 20, 20));
// 添加一公式编辑器按钮
Icon icon = BaseUtils.readIcon("/com/fr/design/images/control/refresh.png");
Icon icon = IconUtils.readIcon("/com/fr/design/images/control/refresh.png");
button = new UIButton(icon);
button.setBackground(Color.RED);
button.setPreferredSize(new Dimension(24, 20));

2
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceSortExpressionPane.java

@ -1,7 +1,5 @@
package com.fr.design.sort.expressionpane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.locale.InterProviderFactory;
import com.fr.report.core.sort.sortexpression.CustomSequenceSortExpression;

3
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -33,7 +33,6 @@ public class HeaderAreaPane extends JPanel {
initLayeredPane();
}
void initUILabel() {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Area"), SwingConstants.LEFT);
this.add(uiLabel);
@ -45,7 +44,6 @@ public class HeaderAreaPane extends JPanel {
this.add(areaJLayeredPane);
}
public void populateBean(ColumnRow columnRow) {
areaJLayeredPane.populateBean(columnRow);
}
@ -142,7 +140,6 @@ public class HeaderAreaPane extends JPanel {
areaJLayeredPane.addListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
areaJLayeredPane.removeListener(uiObserverListener);
}

1
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java

@ -84,7 +84,6 @@ public class HeaderSettingPane extends JPanel {
headerSortRulePane.addListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
uiCheckBox.removeChangeListener();
headerSortRulePane.removeListener(uiObserverListener);

6
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java

@ -23,8 +23,6 @@ import java.io.InputStream;
import java.util.ArrayList;
public class HeaderSortRulePane extends JPanel {
private static final String ASC_ICON_TEMPLATE_PATH = "/com/fr/design/images/sort/asc.svg";
private static final String DES_ICON_TEMPLATE_PATH = "/com/fr/design/images/sort/des.svg";
private static final String NOSORT_ICON_TEMPLATE_PATH = "/com/fr/design/images/sort/nosort.svg";
@ -35,7 +33,6 @@ public class HeaderSortRulePane extends JPanel {
UICheckBox desUICheckBox;
UICheckBox nosortUICheckBox;
HeaderSortRulePane() {
initComponents();
initState();
@ -75,7 +72,6 @@ public class HeaderSortRulePane extends JPanel {
nosortIconButton.refreshIconLabelColor(new Color(33, 33, 34));
}
class IconButton extends JPanel {
JLayeredPane jLayeredPane;
String iconTemplatePath;
@ -195,7 +191,6 @@ public class HeaderSortRulePane extends JPanel {
}
}
public void populateBean(SortHeader.SortItem[] sortItems) {
initState();
if (sortItems != null) {
@ -245,7 +240,6 @@ public class HeaderSortRulePane extends JPanel {
nosortUICheckBox.registerChangeListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
ascIconButton.removeListener(uiObserverListener);
desIconButton.removeListener(uiObserverListener);

6
designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java

@ -22,7 +22,6 @@ public class SortHeaderPane extends JPanel {
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
void initHeaderArea() {
this.headerAreaPane = new HeaderAreaPane(sortHeaderPaneWidth, sortHeaderPaneRightWidth);
this.add(headerAreaPane);
@ -33,7 +32,6 @@ public class SortHeaderPane extends JPanel {
this.add(headerSettingPane);
}
public void populateBean(SortHeader sortHeader, String defaultHeaderArea) {
this.sortHeader = sortHeader;
ColumnRow columnRow = null;
@ -65,10 +63,8 @@ public class SortHeaderPane extends JPanel {
headerSettingPane.addListener(uiObserverListener);
}
public void removeListener(UIObserverListener uiObserverListener) {
headerAreaPane.removeListener(uiObserverListener);
headerSettingPane.removeListener(uiObserverListener);
}
}
}
Loading…
Cancel
Save