Browse Source

Merge pull request #1016 in BA/design from ~HZZZ/design:REPORT-2419 to 9.0

* commit '40d291c9148ca1563ea2cf1bb25b056f59f99548':
  REPORT-2419
  REPORT-2419
  REPORT-2419
  REPORT-2419
  d
  d
master
superman 7 years ago
parent
commit
7af9797ec9
  1. 1
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  2. 2
      designer_base/src/com/fr/design/locale/designer.properties
  3. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  4. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  5. 8
      designer_base/src/com/fr/design/parameter/ParameterBridge.java
  6. 1
      designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java
  7. 30
      designer_form/src/com/fr/design/designer/creator/XLabel.java
  8. 13
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  9. 15
      designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java
  10. 18
      designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java
  11. 72
      designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

1
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -355,6 +355,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
reportParameterAttr.setShowWindow(bridge.isDisplay());
reportParameterAttr.setAlign(bridge.getPosition());
reportParameterAttr.setBackground(bridge.getDataBackground());
reportParameterAttr.setUseParamsTemplate(bridge.isUseParamsTemplate());
}
//这里不用 parameterUI 的原因是考虑到没有控件的时候设置宽度有效果但不保存,只有含有控件才保存属性
paraDesignEditor.getParaTarget().setDesignSize(new Dimension(bridge.getDesignWidth(),

2
designer_base/src/com/fr/design/locale/designer.properties

@ -2092,6 +2092,8 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes
FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table
FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image

2
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2093,6 +2093,8 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes
FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name
FR-Designer_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image

2
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2092,6 +2092,8 @@ FR-Designer_CellWrite_Show_As_HTML=\u7528HTML\u663E\u793A\u5185\u5BB9
FR-Designer_Datasource_Other_Attributes=\u5176\u4ED6\u5C5E\u6027
FR-Designer_Not_use_a_cell_attribute_table_editing=\u60A8\u4E0D\u53EF\u4EE5\u7528\u5355\u5143\u683C\u5C5E\u6027\u8868\u7F16\u8F91
FR-Designer_CellElement_Property_Table=\u5355\u5143\u683C\u5C5E\u6027\u8868
FR-Designer_Use_Params_Template=\u4F7F\u7528\u5E38\u7528\u53C2\u6570\u7EC4\u5408
FR-Designer_Label_Name=\u6807\u7B7E\u540D\u79F0
FR-Designer_T_Insert_Float=\u63D2\u5165\u60AC\u6D6E\u5143\u7D20
FR-Designer_Add_FloatElement=\u6DFB\u52A0\u5143\u7D20
FR-Designer_Insert_Image=\u63D2\u5165\u56FE\u7247

8
designer_base/src/com/fr/design/parameter/ParameterBridge.java

@ -16,6 +16,12 @@ public interface ParameterBridge {
*/
public boolean isDelayDisplayContent();
/**
* 是否启用参数模板
* @return 显示参数模板界面则返回true否则返回false
*/
public boolean isUseParamsTemplate();
/**
* 是否显示参数界面
* @return 显示参数界面则返回true否则返回false
@ -48,4 +54,6 @@ public interface ParameterBridge {
public void setDisplay(boolean showWindow);
public void setBackground(Background background);
public void setUseParamsTemplate(boolean isUse);
}

1
designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java

@ -68,5 +68,4 @@ public interface ParameterDesignerProvider {
void removeSelection();
ParameterBridge getParaComponent();
}

30
designer_form/src/com/fr/design/designer/creator/XLabel.java

@ -3,19 +3,11 @@
*/
package com.fr.design.designer.creator;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.beans.IntrospectionException;
import javax.swing.JComponent;
import javax.swing.SwingConstants;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.widget.editors.FontEditor;
import com.fr.design.mainframe.widget.editors.ItemCellEditor;
@ -23,10 +15,16 @@ import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.FontCellRenderer;
import com.fr.design.mainframe.widget.renderer.LabelHorizontalAlignmentRenderer;
import com.fr.form.ui.Label;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.beans.IntrospectionException;
/**
* @author richer
@ -42,6 +40,7 @@ public class XLabel extends XWidgetCreator {
/**
* 生成creator对应的控件widget
*
* @return 控件widget
*/
public Label toData() {
@ -50,6 +49,7 @@ public class XLabel extends XWidgetCreator {
/**
* 返回组件属性值
*
* @return 返回组件属性值
* @throws IntrospectionException 异常
*/
@ -59,7 +59,15 @@ public class XLabel extends XWidgetCreator {
new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
XCreator parent = (XCreator) XLabel.this.getParent();
((WParameterLayout) parent.toData()).refreshTagList();
}
}),
new CRPropertyDescriptor("wrap", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),

13
designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java

@ -412,6 +412,15 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
return false;
}
/**
* 是否启用参数模板
* @return 显示参数模板界面则返回true否则返回false
*/
public boolean isUseParamsTemplate() {
return false;
}
/**
* 是否显示参数界面
*
@ -485,6 +494,10 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
}
public void setUseParamsTemplate(boolean isUse) {
}
public void setPosition(int align) {
}

15
designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java

@ -67,6 +67,9 @@ public class XWParameterLayout extends XWAbsoluteLayout {
new CRPropertyDescriptor("position", this.data.getClass()).setEditorClass(WidgetDisplayPosition.class)
.setRendererClass(WidgetDisplayPositionRender.class).setI18NName(Inter.getLocText("FR-Designer_WidgetDisplyPosition"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("useParamsTemplate", this.data.getClass()).setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("FR-Designer_Use_Params_Template"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
};
ParameterWindowEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ParameterWindowEditorProcessor.MARK_STRING);
@ -124,6 +127,14 @@ public class XWParameterLayout extends XWAbsoluteLayout {
return toData().isDelayDisplayContent();
}
/**
* 是否启用参数模板
* @return 显示参数模板界面则返回true否则返回false
*/
public boolean isUseParamsTemplate() {
return toData().isUseParamsTemplate();
}
/**
* 是否显示参数界面
* @return 显示参数界面则返回true否则返回false
@ -152,6 +163,10 @@ public class XWParameterLayout extends XWAbsoluteLayout {
this.toData().setDelayDisplayContent(delayPlaying);
}
public void setUseParamsTemplate(boolean isUse) {
this.toData().setUseParamsTemplate(isUse);
}
public void setPosition(int align){
this.toData().setPosition(align);
}

18
designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java

@ -3,17 +3,17 @@
*/
package com.fr.design.designer.creator;
import java.awt.*;
import java.beans.IntrospectionException;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.awt.*;
import java.beans.IntrospectionException;
/**
* @author richer
@ -31,6 +31,7 @@ public abstract class XWidgetCreator extends XCreator {
/**
* 待说明
*
* @return 待说明
* @throws IntrospectionException
*/
@ -53,12 +54,17 @@ public abstract class XWidgetCreator extends XCreator {
public void propertyChange() {
makeVisible(toData().isVisible());
}
}) };
}),
new CRPropertyDescriptor("labelName", this.data.getClass(), "getLabelName", "setLabelName")
.setI18NName(Inter.getLocText("FR-Designer_Label_Name"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "FR-Designer_Advanced")
};
}
/**
* 待说明
*
* @return 待说明
*/
public Widget toData() {
@ -87,6 +93,7 @@ public abstract class XWidgetCreator extends XCreator {
private String name;
private String imagePath;
private float opacity = 0.4f;
public LimpidButton(String name, String imagePath, float opacity) {
this.name = name;
this.imagePath = imagePath;
@ -138,6 +145,7 @@ public abstract class XWidgetCreator extends XCreator {
/**
* 待说明
*
* @param visible 待说明
*/
public void makeVisible(boolean visible) {
@ -155,12 +163,12 @@ public abstract class XWidgetCreator extends XCreator {
((Graphics2D) g).setComposite(composite);
super.paint(g);
}
/**
* 重命名
*
* @param designer 表单设计器
* @param creator 当前组件
*
*/
public void ChangeCreatorName(FormDesigner designer, XCreator creator) {
String oldName = creator.toData().getWidgetName();

72
designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

@ -1,41 +1,12 @@
package com.fr.design.mainframe;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.RoundRectangle2D;
import java.util.EventObject;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.GroupRenderer;
import com.fr.design.gui.itable.HeaderRenderer;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.HeaderRenderer;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.Label;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WParameterLayout;
@ -43,6 +14,18 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.RoundRectangle2D;
import java.util.EventObject;
/**
* MobileParaWidgetTable主要显示参数面板容器的控件列表与MobileWidgetTable的区别就是该表多了UITextField这一列
* Created with IntelliJ IDEA.
@ -53,9 +36,10 @@ import com.fr.stable.StringUtils;
*/
class MobileParaWidgetTable extends JTable {
private final int WIDGET_NAME_COLUMN = 1;
private FormDesigner designer;
private String[][] cellData;
private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")};
private String[] headers = {Inter.getLocText("Form-Widget_Name")};
private static final int WIDGET_TABLE_ROW_HEIGHT = 22;
private static final int UITEXTFIELD_WIDTH = 40;
private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件
@ -156,9 +140,7 @@ class MobileParaWidgetTable extends JTable {
*/
@Override
public void mouseDragged(MouseEvent e) {
int width = getColumnModel().getColumn(1).getWidth();
//如果点击选中的是第二列,就可以拖动
if (selectedColumn == 1){
int width = getColumnModel().getColumn(0).getWidth();
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
draging = true;
moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString());
@ -168,15 +150,14 @@ class MobileParaWidgetTable extends JTable {
moveComponent.setForeground(Color.lightGray);
moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
}
/**
* 设置鼠标单击时处理的事件单击第二列的控件列表进入控件属性表
* 设置鼠标单击时处理的事件
* @param e
*/
@Override
public void mouseClicked(MouseEvent e) {
if(getSelectedRow() != -1 && getSelectedColumn() == 1){
if (getSelectedRow() != -1 && getSelectedColumn() == 0) {
String widgetName = cellData[getSelectedRow()][getSelectedColumn()];
if (StringUtils.isNotEmpty(widgetName)) {
int count = getEditingDesigner().getParaComponent().getComponentCount();
@ -241,7 +222,7 @@ class MobileParaWidgetTable extends JTable {
private String[][] getData() {
XLayoutContainer paraContainer = designer.getParaComponent();
if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) {
return new String[0][0];
return new String[0][1];
}
WParameterLayout para = (WParameterLayout) (paraContainer.toData());
@ -275,6 +256,7 @@ class MobileParaWidgetTable extends JTable {
*/
private class MobileCellEditor extends AbstractCellEditor implements TableCellEditor {
UITableTextField uiTableTextField;
MobileCellEditor() {
uiTableTextField = new UITableTextField();
uiTableTextField.addFocusListener(new FocusAdapter() {
@ -360,7 +342,7 @@ class MobileParaWidgetTable extends JTable {
}
Object[] rowValue = cellData[row];
if (column > -1 && column < rowValue.length) {
return cellData[row][column];
return cellData[row][WIDGET_NAME_COLUMN];
}
return null;
}
@ -381,24 +363,22 @@ class MobileParaWidgetTable extends JTable {
return;
}
if (aValue == null) {
cellData[row][column] = null;
cellData[row][WIDGET_NAME_COLUMN] = null;
return;
}
cellData[row][column] = aValue.toString();
cellData[row][WIDGET_NAME_COLUMN] = aValue.toString();
}
/**
* 是否可编辑 控件标签列可以编辑控件名不可编辑
*
* @param row 行号
* @param column 列号
* @return 是否可编辑
*/
public boolean isCellEditable(int row, int column) {
if(column ==1){
return false;
}
return true;
}
}

Loading…
Cancel
Save