|
|
|
@ -1,26 +1,30 @@
|
|
|
|
|
package com.fr.design.dscolumn; |
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.beans.PropertyChangeEvent; |
|
|
|
|
import java.beans.PropertyChangeListener; |
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.gui.frpane.UITabbedPane; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.beans.PropertyChangeEvent; |
|
|
|
|
import java.beans.PropertyChangeListener; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author null |
|
|
|
|
* @version 2018年2月9日13点47分 |
|
|
|
|
* @since 8.0 |
|
|
|
|
*/ |
|
|
|
|
public class DSColumnPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
private TableDataSource tplEC; |
|
|
|
@ -29,13 +33,52 @@ public class DSColumnPane extends BasicPane {
|
|
|
|
|
private DSColumnConditionsPane conditionPane = null; |
|
|
|
|
private DSColumnAdvancedPane advancedPane = null; |
|
|
|
|
private TemplateCellElement cellElement; |
|
|
|
|
protected Component lastSelectedComponent; |
|
|
|
|
private Component lastSelectedComponent; |
|
|
|
|
|
|
|
|
|
public static final int SETTING_ALL = 2; |
|
|
|
|
public static final int SETTING_DSRELATED = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ChangeListener appliedWizardTabChangeListener = new ChangeListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent evt) { |
|
|
|
|
try { |
|
|
|
|
if (lastSelectedComponent == null) { |
|
|
|
|
lastSelectedComponent = basicPane; |
|
|
|
|
} |
|
|
|
|
// selectTabComponent是正要切换到的那个Pane
|
|
|
|
|
Component selectTabComponent = tabbedPane.getSelectedComponent(); |
|
|
|
|
// denny: 如果切换Tab时上一个Pane是basicPane, 则刷新一下其他Pane,
|
|
|
|
|
// 因为选择的数据列可能改变, 导致后面过滤和使用公式用到的数据项改变
|
|
|
|
|
if (lastSelectedComponent == basicPane) { |
|
|
|
|
basicPane.update(cellElement); |
|
|
|
|
|
|
|
|
|
// denny_GUI: 刷新其他面板
|
|
|
|
|
refreshOtherTabs(); |
|
|
|
|
} |
|
|
|
|
// 切换标签的时候就,确认是否有没有添加到列表中的条件
|
|
|
|
|
lastSelectedComponent = selectTabComponent; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FRContext.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
/** |
|
|
|
|
* cellElement 改变时,刷新一下 |
|
|
|
|
* 比如:上边切换Tab时,basicPane Update了一下,可能会改变Field cellElement的值 |
|
|
|
|
*/ |
|
|
|
|
private PropertyChangeListener myPropertyChangeListener = new PropertyChangeListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void propertyChange(PropertyChangeEvent evt) { |
|
|
|
|
refreshOtherTabs(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public DSColumnPane() { |
|
|
|
|
this.initComponents(SETTING_ALL); |
|
|
|
|
this(SETTING_ALL); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public DSColumnPane(int setting) { |
|
|
|
@ -71,8 +114,12 @@ public class DSColumnPane extends BasicPane {
|
|
|
|
|
return Inter.getLocText("ExpandD-Data_Column"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* populate |
|
|
|
|
/** |
|
|
|
|
* 更新面板信息 |
|
|
|
|
* |
|
|
|
|
* @param tds 数据源 |
|
|
|
|
* @param cellElement 单元格 |
|
|
|
|
* @throws Exception e |
|
|
|
|
*/ |
|
|
|
|
public void populate(TableDataSource tds, TemplateCellElement cellElement) throws Exception { |
|
|
|
|
this.tplEC = tds; |
|
|
|
@ -85,15 +132,18 @@ public class DSColumnPane extends BasicPane {
|
|
|
|
|
// _denny: 这边需要克隆一下,因为在设置时,可能改变字段cellElement,但改变真实值是不被期望的
|
|
|
|
|
try { |
|
|
|
|
this.cellElement = (TemplateCellElement) cellElement.clone(); |
|
|
|
|
} catch (CloneNotSupportedException ce) { |
|
|
|
|
} catch (CloneNotSupportedException ignored) { |
|
|
|
|
} |
|
|
|
|
//REPORT-7744 9.0里面过滤条件和高级设置可以通过其他地方设置,populate的时候需要更新所有面板的信息,防止设置丢失
|
|
|
|
|
this.basicPane.populate(tds, this.cellElement); |
|
|
|
|
this.conditionPane.populate(tds, this.cellElement); |
|
|
|
|
this.advancedPane.populate(this.cellElement); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* update |
|
|
|
|
/** |
|
|
|
|
* update 保存 |
|
|
|
|
* |
|
|
|
|
* @return 单元格信息 |
|
|
|
|
*/ |
|
|
|
|
public CellElement update() { |
|
|
|
|
this.basicPane.update(cellElement); |
|
|
|
@ -101,50 +151,20 @@ public class DSColumnPane extends BasicPane {
|
|
|
|
|
this.advancedPane.update(cellElement); |
|
|
|
|
return cellElement; |
|
|
|
|
} |
|
|
|
|
public ChangeListener appliedWizardTabChangeListener = new ChangeListener() { |
|
|
|
|
|
|
|
|
|
public void stateChanged(ChangeEvent evt) { |
|
|
|
|
try { |
|
|
|
|
if (lastSelectedComponent == null) { |
|
|
|
|
lastSelectedComponent = basicPane; |
|
|
|
|
} |
|
|
|
|
//selectTabComponent是正要切换到的那个Pane
|
|
|
|
|
Component selectTabComponent = tabbedPane.getSelectedComponent(); |
|
|
|
|
// _denny: 如果切换Tab时上一个Pane是basicPane, 则刷新一下其他Pane,
|
|
|
|
|
// 因为选择的数据列可能改变, 导致后面过滤和使用公式用到的数据项改变
|
|
|
|
|
if (lastSelectedComponent == basicPane) { |
|
|
|
|
basicPane.update(cellElement); |
|
|
|
|
|
|
|
|
|
// denny_GUI: 刷新其他面板
|
|
|
|
|
refrushOtherTabs(); |
|
|
|
|
} |
|
|
|
|
// 切换标签的时候就,确认是否有没有添加到列表中的条件
|
|
|
|
|
lastSelectedComponent = selectTabComponent; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FRContext.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// cellElement 改变时,刷新一下
|
|
|
|
|
// 比如:上边切换Tab时,basicPane Update了一下,可能会改变Field cellElement的值
|
|
|
|
|
PropertyChangeListener myPropertyChangeListener = new PropertyChangeListener() { |
|
|
|
|
|
|
|
|
|
public void propertyChange(PropertyChangeEvent evt) { |
|
|
|
|
refrushOtherTabs(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//_denny:当数据tab中的数据发生变化的时候刷新后面的tab
|
|
|
|
|
public void refrushOtherTabs() { |
|
|
|
|
// ——deny:当JTabPane中加入一个Pane时,后面的Pane可能还没有初始化
|
|
|
|
|
/** |
|
|
|
|
* denny:当数据tab中的数据发生变化的时候刷新后面的tab |
|
|
|
|
*/ |
|
|
|
|
private void refreshOtherTabs() { |
|
|
|
|
// deny:当JTabPane中加入一个Pane时,后面的Pane可能还没有初始化
|
|
|
|
|
if (conditionPane == null || advancedPane == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.conditionPane.populate(tplEC, cellElement); |
|
|
|
|
this.advancedPane.populate(cellElement); |
|
|
|
|
} |
|
|
|
|
public void putElementcase(ElementCasePane t){ |
|
|
|
|
|
|
|
|
|
public void putElementcase(ElementCasePane t) { |
|
|
|
|
basicPane.putElementcase(t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|