Browse Source

REPORT-3163 合作开发9.0设计器=>聚合报表=》控件名称面板

master
plough 8 years ago
parent
commit
c987fc5cd2
  1. 24
      designer/src/com/fr/poly/PolyBlockProperTable.java
  2. 50
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  3. 41
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java

24
designer/src/com/fr/poly/PolyBlockProperTable.java

@ -18,6 +18,7 @@ import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.gui.itable.PropertyGroup;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.general.Inter;
import com.fr.poly.group.PolyBoundsGroup;
@ -30,6 +31,9 @@ public class PolyBlockProperTable extends JPanel {
private UISpinner y;
private UISpinner width;
private UISpinner height;
private BasicPropertyPane blockPropertyPane;
private boolean isPopulating = false;
public PolyBlockProperTable() {
initPropertyPane();
@ -37,14 +41,18 @@ public class PolyBlockProperTable extends JPanel {
}
private void initPropertyPane() {
this.setLayout(new BorderLayout());
blockPropertyPane = new BasicPropertyPane();
UIExpandablePane basicPane = new UIExpandablePane("基本", 280, 20, blockPropertyPane);
this.add(basicPane, BorderLayout.NORTH);
x = new UISpinner(0, 1200, 1);
y = new UISpinner(0, 1200, 1);
width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1);
UIExpandablePane uiExpandablePane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height);
this.setLayout(new BorderLayout());
this.add(uiExpandablePane, BorderLayout.CENTER);
UIExpandablePane boundsPane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height);
this.add(boundsPane, BorderLayout.CENTER);
}
private void initListener(Container parentComponent) {
@ -86,7 +94,8 @@ public class PolyBlockProperTable extends JPanel {
// groups = new ArrayList<PropertyGroup>();
if (source instanceof TemplateBlock) {
TemplateBlock block = (TemplateBlock) source;
PolyNameGroup namegroup = new PolyNameGroup(block);
// PolyNameGroup namegroup = new PolyNameGroup(block);
blockPropertyPane.getWidgetNameField().setText(block.getBlockName());
// groups.add(new PropertyGroup(namegroup));
final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
@ -110,15 +119,18 @@ public class PolyBlockProperTable extends JPanel {
}
public void populate(PolyDesigner designer) {
isPopulating = true;
this.designer = designer;
initPropertyGroups(this.designer.getEditingTarget());
isPopulating = false;
}
public void update() {
TemplateBlock block = this.designer.getEditingTarget();
if (block == null) {
if (isPopulating || block == null) {
return;
}
block.setBlockName(blockPropertyPane.getWidgetNameField().getText());
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
boundsgroup.setValue(x.getValue(), 0, 1);
boundsgroup.setValue(y.getValue(), 1, 1);

50
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -0,0 +1,50 @@
package com.fr.design.mainframe.widget;
import com.fr.design.dialog.BasicPane;
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;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2017/8/7.
*/
public class BasicPropertyPane extends BasicPane {
protected UITextField widgetName;
public BasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(panel, BorderLayout.NORTH);
}
public UITextField getWidgetNameField() {
return widgetName;
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
}

41
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java

@ -1,49 +1,12 @@
package com.fr.design.mainframe.widget.ui;
import com.fr.design.dialog.BasicPane;
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;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/4.
*/
public class FormBasicPropertyPane extends BasicPane {
private UITextField widgetName;
public FormBasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(panel, BorderLayout.NORTH);
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
public class FormBasicPropertyPane extends BasicPropertyPane {
public void populate(Widget widget) {
widgetName.setText(widget.getWidgetName());

Loading…
Cancel
Save