Browse Source

Merge pull request #1047 in BA/design from ~MOMEAK/design9.0:9.0 to 9.0

* commit '2269bf41c3dec2b39b7db3f616f83d80f0bcf048':
  REPORT-2897 9.0设计器修改 控件设置网页框
  REPORT-2897 9.0设计器修改 控件设置网页框
master
superman 7 years ago
parent
commit
10b23d11cd
  1. 66
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  2. 9
      designer_base/src/com/fr/design/gui/frpane/ReportletParameterViewPane.java
  3. 11
      designer_base/src/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

66
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -1,17 +1,13 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.util.List;
import javax.swing.BorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -20,11 +16,24 @@ import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private static final int P_W = 610;
private static final int P_H = 580;
private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck;
private UICheckBox verticalCheck;
private UIButton parameterViewPaneButton;
private List<ParameterProvider> list;
public IframeEditorDefinePane() {
this.initComponents();
@ -44,22 +53,55 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
parameterViewPaneButton.addActionListener(parameterListener);
parameterViewPane = new ReportletParameterViewPane();
java.awt.Component[][] coms = {
{horizontalCheck, null},
{verticalCheck, null},
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()},
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE);
contentPane.add(panel);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH);
}
ActionListener parameterListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
List<ParameterProvider> paraList = parameterViewPane.update();
list = new ArrayList<ParameterProvider>();
ParameterProvider pr = null;
for (ParameterProvider parameterProvider : paraList) {
try {
pr = (ParameterProvider) parameterProvider.clone();
} catch (CloneNotSupportedException e1) {
e1.printStackTrace();
}
list.add(pr);
}
UIDialog dialog = parameterViewPane.showUnsizedWindow(SwingUtilities.getWindowAncestor(new JPanel()), new DialogActionListener() {
@Override
public void doOk() {
}
@Override
public void doCancel() {
parameterViewPane.update(list);
}
});
dialog.setSize(P_W, P_H);
dialog.setVisible(true);
}
};
@Override
protected String title4PopupWindow() {

9
designer_base/src/com/fr/design/gui/frpane/ReportletParameterViewPane.java

@ -23,6 +23,7 @@ import java.util.List;
/**
* Defin hyperlink.
* in fact,this is a TablEditorPane
*
* @editor zhou
* @since 2012-3-23下午3:48:10
*/
@ -53,6 +54,7 @@ public class ReportletParameterViewPane extends BasicPane {
/**
* 初始化组件
*
* @param actions Chart的热点链接actions
* @param useParaType 类型
*/
@ -84,6 +86,7 @@ public class ReportletParameterViewPane extends BasicPane {
/**
* 增加事件监听
*
* @param l 加的东东
*/
public void addTableEditorListener(TableModelListener l) {
@ -117,8 +120,14 @@ public class ReportletParameterViewPane extends BasicPane {
return editorPane.update();
}
public void update(List list) {
editorPane.update(list);
}
/**
* 更新
*
* @return 数组
*/
public KV[] updateKV() {

11
designer_base/src/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -1,12 +1,12 @@
package com.fr.design.gui.itableeditorpane;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import javax.swing.*;
@ -87,6 +87,7 @@ public class UITableEditorPane<T> extends BasicPane {
/**
* 增加事件监听
*
* @param l 加的东东
*/
public void addTableListener(TableModelListener l) {
@ -95,6 +96,7 @@ public class UITableEditorPane<T> extends BasicPane {
/**
* 移除事件监听
*
* @param l 去的东东
*/
public void removeTableListener(TableModelListener l) {
@ -126,6 +128,11 @@ public class UITableEditorPane<T> extends BasicPane {
return tableModel.getList();
}
public void update(List list) {
tableModel.stopCellEditing();
tableModel.setList(list);
}
public int getSelectedRow() {
return this.editTable.getSelectedRow();
}

Loading…
Cancel
Save