|
|
@ -1,17 +1,13 @@ |
|
|
|
package com.fr.design.widget.ui; |
|
|
|
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.constants.LayoutConstants; |
|
|
|
|
|
|
|
import com.fr.design.dialog.DialogActionListener; |
|
|
|
|
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
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.frpane.ReportletParameterViewPane; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
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.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
@ -20,11 +16,24 @@ import com.fr.form.ui.IframeEditor; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
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> { |
|
|
|
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int P_W = 610; |
|
|
|
|
|
|
|
private static final int P_H = 580; |
|
|
|
private UITextField srcTextField; |
|
|
|
private UITextField srcTextField; |
|
|
|
private ReportletParameterViewPane parameterViewPane; |
|
|
|
private ReportletParameterViewPane parameterViewPane; |
|
|
|
private UICheckBox horizontalCheck; |
|
|
|
private UICheckBox horizontalCheck; |
|
|
|
private UICheckBox verticalCheck; |
|
|
|
private UICheckBox verticalCheck; |
|
|
|
|
|
|
|
private UIButton parameterViewPaneButton; |
|
|
|
|
|
|
|
private List<ParameterProvider> list; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IframeEditorDefinePane() { |
|
|
|
public IframeEditorDefinePane() { |
|
|
|
this.initComponents(); |
|
|
|
this.initComponents(); |
|
|
@ -44,22 +53,55 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { |
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); |
|
|
|
|
|
|
|
parameterViewPaneButton.addActionListener(parameterListener); |
|
|
|
|
|
|
|
parameterViewPane = new ReportletParameterViewPane(); |
|
|
|
|
|
|
|
|
|
|
|
java.awt.Component[][] coms = { |
|
|
|
java.awt.Component[][] coms = { |
|
|
|
{horizontalCheck, null}, |
|
|
|
{horizontalCheck, null}, |
|
|
|
{verticalCheck, null}, |
|
|
|
{verticalCheck, null}, |
|
|
|
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, |
|
|
|
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, |
|
|
|
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; |
|
|
|
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
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); |
|
|
|
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); |
|
|
|
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 |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|