fr_shine 8 years ago
parent
commit
56cb8bbfe2
  1. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  2. 73
      designer_base/src/com/fr/design/actions/file/LocalePane.java
  3. 14
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  4. 40
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  5. 10
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  6. 67
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  7. 2
      designer_form/src/com/fr/design/designer/creator/XChartEditor.java
  8. 4
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  9. 39
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  10. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  11. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  12. 70
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
  13. 42
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java
  14. 11
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
  15. 9
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  16. 2
      designer_form/src/com/fr/design/gui/xpane/LayoutBorderPane.java
  17. 8
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  18. 4
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java
  19. 3
      designer_form/src/com/fr/design/mainframe/JForm.java
  20. 2
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

2
designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1 +1 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } } package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }

73
designer_base/src/com/fr/design/actions/file/LocalePane.java

@ -8,13 +8,7 @@ import java.awt.BorderLayout;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.RowFilter; import javax.swing.RowFilter;
@ -31,10 +25,7 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.FRLogger; import com.fr.general.*;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -43,12 +34,6 @@ import com.fr.stable.project.ProjectConstants;
* @since : 8.0 * @since : 8.0
*/ */
public class LocalePane extends BasicPane { public class LocalePane extends BasicPane {
private static final String FR = "fr.properties";
private static final String US = "fr_en_US.properties";
private static final String CN = "fr_zh_CN.properties";
private static final String JP = "fr_ja_JP.properties";
private static final String TW = "fr_zh_TW.properties";
private static final String KR = "fr_ko_KR.properties";
private static final String PREFIX = "fr_"; private static final String PREFIX = "fr_";
private static final int LOCALE_NAME_LEN = 5; private static final int LOCALE_NAME_LEN = 5;
@ -124,39 +109,35 @@ public class LocalePane extends BasicPane {
} }
private void initPredefinedProperties() { private void initPredefinedProperties() {
Properties fr = loadLocaleProperties(FR); Map<Locale, LocalePackage> map = Inter.getPredefinedPackageMap();
Properties us = loadLocaleProperties(US); LocalePackage chinese = map.get(Locale.SIMPLIFIED_CHINESE);
Properties cn = loadLocaleProperties(CN);
Properties jp = loadLocaleProperties(JP); List<String> sortKeys = new ArrayList<String>();
Properties tw = loadLocaleProperties(TW);
Properties kr = loadLocaleProperties(KR);
Set<ResourceBundle> bundles = chinese.getKindsOfResourceBundle();
Set<String> keys = fr.stringPropertyNames(); for (ResourceBundle bundle : bundles) {
List<String> sortKeys = new ArrayList<String>(keys); sortKeys.addAll(bundle.keySet());
}
Collections.sort(sortKeys); Collections.sort(sortKeys);
Vector<String> keyVector = new Vector<String>();
Vector<String> valueVector = new Vector<String>(); Map<Locale, Vector<String>> data = new HashMap<Locale, Vector<String>>();
Vector<String> usVector = new Vector<String>(); for (Map.Entry<Locale, LocalePackage> entry : map.entrySet()) {
Vector<String> cnVector = new Vector<String>(); Vector<String> column = new Vector<String>();
Vector<String> jpVector = new Vector<String>();
Vector<String> twVector = new Vector<String>();
Vector<String> krVector = new Vector<String>();
for (String key : sortKeys) { for (String key : sortKeys) {
keyVector.add(key); column.add(entry.getValue().getLocText(key));
valueVector.add(fr.getProperty(key));
usVector.add(us.getProperty(key));
cnVector.add(cn.getProperty(key));
jpVector.add(jp.getProperty(key));
twVector.add(tw.getProperty(key));
krVector.add(kr.getProperty(key));
} }
data.put(entry.getKey(), column);
}
Vector<String> keyVector = new Vector<String>();
keyVector.addAll(sortKeys);
predefineTableModel.addColumn(Inter.getLocText("Key"), keyVector); predefineTableModel.addColumn(Inter.getLocText("Key"), keyVector);
predefineTableModel.addColumn(Inter.getLocText("Value"), valueVector); for (Map.Entry<Locale, Vector<String>> entry : data.entrySet()) {
predefineTableModel.addColumn("en_US", usVector); predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue());
predefineTableModel.addColumn("zh_CN", cnVector); }
predefineTableModel.addColumn("ja_JP", jpVector);
predefineTableModel.addColumn("zh_TW", twVector);
predefineTableModel.addColumn("ko_KR", krVector);
} }
private void initCustomProperties() throws Exception { private void initCustomProperties() throws Exception {

14
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -232,7 +232,6 @@ public class UIResizableContainer extends JPanel {
verticalToolPane.setBounds(0, 0, toolPaneHeight, getHeight()); verticalToolPane.setBounds(0, 0, toolPaneHeight, getHeight());
} }
} }
} }
@Override @Override
@ -302,6 +301,15 @@ public class UIResizableContainer extends JPanel {
return this.downPane; return this.downPane;
} }
/**
* 得到参数面板
*
* @return
*/
public JComponent getParameterPane() {
return this.parameterPane;
}
/** /**
* 刷新下面板 * 刷新下面板
*/ */
@ -343,7 +351,7 @@ public class UIResizableContainer extends JPanel {
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y; toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y;
toolPaneY = toolPaneY < 0 ? 0 : toolPaneY; toolPaneY = toolPaneY < 0 ? 0 : toolPaneY;
toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight : toolPaneY; toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight();
refreshContainer(); refreshContainer();
} }
}); });
@ -366,7 +374,7 @@ public class UIResizableContainer extends JPanel {
if (e.getX() <= ARROW_RANGE) { if (e.getX() <= ARROW_RANGE) {
toolPaneY = 0; toolPaneY = 0;
} else if (e.getX() >= getWidth() - ARROW_RANGE) { } else if (e.getX() >= getWidth() - ARROW_RANGE) {
toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight; toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight();
} else { } else {
return; return;
} }

40
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -222,16 +222,16 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return ChartTypeManager.getInstance().containsPlot(plotID); return ChartTypeManager.getInstance().containsPlot(plotID);
} }
/** /**
* 把所有的pane加到list里 * 把所有的pane加到list里
* *
* @param paneList pane容器 * @param paneList pane容器
*/ */
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) { public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); List<Integer> priorityList = getPriorityInOrder();
while (iterator.hasNext()) { for (int i = 0; i < priorityList.size(); i++){
Map.Entry entry = (Map.Entry) iterator.next(); String priority = String.valueOf(priorityList.get(i));
String priority = (String) entry.getKey();
Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUIIterator.hasNext()) { while (chartUIIterator.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next();
@ -276,22 +276,20 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
} }
private String[] getTitle4PopupWindow(){ private String[] getTitle4PopupWindow(){
List<Integer> priorityList = new ArrayList<Integer>(); List<Integer> priorityList = getPriorityInOrder();
if (priorityList.size() == 0){
return new String[0];
}
int size = 0; int size = 0;
if (chartTypeInterfaces != null){ //获取总得图表格式
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); for (int i = 0; i < priorityList.size(); i++) {
while (iterator.hasNext()){ size += getChartSize(String.valueOf(priorityList.get(i)));
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
priorityList.add(Integer.valueOf(priority));
size += getChartSize(priority);
} }
String[] names = new String[size]; String[] names = new String[size];
priorityList = ChartTypeManager.orderInPriority(priorityList);
int index = 0; int index = 0;
for (int i = 0; i < priorityList.size(); i++){ for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i)); String priority = String.valueOf(priorityList.get(i));
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator(); Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
@ -301,7 +299,17 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return names; return names;
} }
return new String[0]; private List<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
priorityList.add(Integer.valueOf(priority));
}
}
return ChartTypeManager.orderInPriority(priorityList);
} }
private int fetchNames(Iterator chartUI, String[] names, int index) { private int fetchNames(Iterator chartUI, String[] names, int index) {

10
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -308,19 +308,23 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
* @param y 坐标y * @param y 坐标y
*/ */
public void fix(XCreator creator ,int x, int y) { public void fix(XCreator creator ,int x, int y) {
int height = creator.getHeight();
int width = creator.getWidth();
if (x < 0) { if (x < 0) {
width += x;
x = 0; x = 0;
} else if (x + creator.getWidth() > container.getWidth()) { } else if (x + creator.getWidth() > container.getWidth()) {
x = container.getWidth() - creator.getWidth(); width = container.getWidth() - x;
} }
if (y < 0) { if (y < 0) {
height += y;
y = 0; y = 0;
} else if (y + creator.getHeight() > container.getHeight()) { } else if (y + creator.getHeight() > container.getHeight()) {
y = container.getHeight() - creator.getHeight(); height = container.getHeight() - y;
} }
creator.setLocation(x, y); creator.setBounds(x, y, width, height);
} }
@Override @Override

67
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -24,6 +24,7 @@ import com.fr.design.designer.properties.FRFitLayoutConstraints;
import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
@ -44,6 +45,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 构造函数 * 构造函数
*
* @param container XWFitLayout容器 * @param container XWFitLayout容器
*/ */
public FRFitLayoutAdapter(XLayoutContainer container) { public FRFitLayoutAdapter(XLayoutContainer container) {
@ -104,7 +106,6 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
} }
private void addParentCreator(XCreator child) { private void addParentCreator(XCreator child) {
XLayoutContainer parentPanel = child.initCreatorWrapper(minHeight); XLayoutContainer parentPanel = child.initCreatorWrapper(minHeight);
container.add(parentPanel, child.toData().getWidgetName()); container.add(parentPanel, child.toData().getWidgetName());
@ -112,6 +113,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 能否对应位置放置当前组件 * 能否对应位置放置当前组件
*
* @param creator 组件 * @param creator 组件
* @param x 添加的位置x该位置是相对于container的 * @param x 添加的位置x该位置是相对于container的
* @param y 添加的位置y该位置是相对于container的 * @param y 添加的位置y该位置是相对于container的
@ -162,6 +164,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 是否在组件边缘 * 是否在组件边缘
*
* @param x 横坐标 * @param x 横坐标
* @param y 纵坐标 * @param y 纵坐标
* @return 是否在组件边缘 * @return 是否在组件边缘
@ -178,6 +181,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 是否在组件边缘 * 是否在组件边缘
*
* @param x 横坐标 * @param x 横坐标
* @param y 纵坐标 * @param y 纵坐标
* @param container 参照组件 * @param container 参照组件
@ -234,6 +238,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 判断是否鼠标在组件的三等分区域如果组件在布局管理器中间上下左右都可能会三等分 * 判断是否鼠标在组件的三等分区域如果组件在布局管理器中间上下左右都可能会三等分
*
* @param parentComp 鼠标所在区域的组件 * @param parentComp 鼠标所在区域的组件
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y
@ -245,6 +250,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 是否为组件交叉点区域 或者是相邻三组建中间点 * 是否为组件交叉点区域 或者是相邻三组建中间点
*
* @param currentComp 当前组件 * @param currentComp 当前组件
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y
@ -261,6 +267,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
protected void clearCompsList() { protected void clearCompsList() {
super.clearCompsList(); super.clearCompsList();
} }
private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) {
// 参数界面高度对纵坐标产生的影响 // 参数界面高度对纵坐标产生的影响
JForm jform = (JForm) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); JForm jform = (JForm) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
@ -284,6 +291,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 拖拽控件边框后根据控件的大小尺寸进行相关组件的调整 * 拖拽控件边框后根据控件的大小尺寸进行相关组件的调整
*
* @param creator 组件 * @param creator 组件
*/ */
@Override @Override
@ -328,6 +336,43 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
updateCreatorBackBound(); updateCreatorBackBound();
} }
/**
* 拖拽控件边框后根据控件的大小尺寸进行相关组件的调整
*
* @param backupBound 边界备份
* @param bounds 组件边界
* @param xCreator 组件
* @param row 选中的行
* @param difference 偏移量
*/
public void calculateBounds(Rectangle backupBound, Rectangle bounds, XCreator xCreator, int row, int difference) {
Rectangle rc = new Rectangle(0,0,0,0);
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator);
if (parent != null) {
Rectangle rec = ComponentUtils.getRelativeBounds(parent);
rc.x = rec.x;
rc.y = rec.y;
}
int x = backupBound.x - rc.x, y = backupBound.y - rc.y;
//处理左右延伸
switch (row) {
case 0:
if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight() +rc.x) {
x += difference;
}
break;
case 1:
if(backupBound.y + backupBound.height == container.getHeight() - margin.getBottom() +rc.y){
y += difference;
}
break;
}
bounds.setLocation(x,y);
xCreator.setBackupBound(backupBound);
xCreator.setBounds(bounds);
this.fix(xCreator);
}
private void dealLeft(Rectangle backupBound, int x, int[] posXs, int difference, XCreator creator) { private void dealLeft(Rectangle backupBound, int x, int[] posXs, int difference, XCreator creator) {
if (backupBound.x == margin.getLeft()) { if (backupBound.x == margin.getLeft()) {
return; return;
@ -614,11 +659,13 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//重新计算上下两侧组件size、point //重新计算上下两侧组件size、point
if (CalculateUpRelatComponent(difference)) { if (CalculateUpRelatComponent(difference)) {
CalculateDownRelatComponent(objY + difference, -difference); CalculateDownRelatComponent(objY + difference, -difference);
}; }
;
} }
/** /**
* 新拖入组件时计算调整其他关联组件位置大小 * 新拖入组件时计算调整其他关联组件位置大小
*
* @param child 新拖入的组件 * @param child 新拖入的组件
* @param x 鼠标所在x坐标 * @param x 鼠标所在x坐标
* @param y 鼠标所在y坐标 * @param y 鼠标所在y坐标
@ -659,6 +706,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 三等分区域时调整相关联的组件 * 三等分区域时调整相关联的组件
*
* @param currentComp 鼠标所在组件 * @param currentComp 鼠标所在组件
* @param child 待插入组件 * @param child 待插入组件
*/ */
@ -677,6 +725,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 重新计算内部组件大小 * 重新计算内部组件大小
*
* @param x 坐标x * @param x 坐标x
* @param y 坐标y * @param y 坐标y
* @param creatorWidth 删除的组件之前所在布局的宽度 * @param creatorWidth 删除的组件之前所在布局的宽度
@ -888,9 +937,9 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 拖拽组件时遍历某一侧组件得到该侧组件能够缩放的最小宽度tab布局最小宽度 = 内部组件数 * 单个组件最小宽度 * 拖拽组件时遍历某一侧组件得到该侧组件能够缩放的最小宽度tab布局最小宽度 = 内部组件数 * 单个组件最小宽度
*
* @param list 某一侧组件的集合 leftComps<Component> * @param list 某一侧组件的集合 leftComps<Component>
* @return int 最小宽度 * @return int 最小宽度
*
*/ */
private int getCompsMinWidth(List<?> list) { private int getCompsMinWidth(List<?> list) {
return getMaxCompsNum(list, true) * WLayout.MIN_WIDTH; return getMaxCompsNum(list, true) * WLayout.MIN_WIDTH;
@ -898,9 +947,9 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 拖拽组件遍历某一侧得到该侧组件能够缩放的最小高度tab布局最小高度 = 内部组件数 * 单个组件最小高度 + 标题高度 * 拖拽组件遍历某一侧得到该侧组件能够缩放的最小高度tab布局最小高度 = 内部组件数 * 单个组件最小高度 + 标题高度
*
* @param list 某一侧组件集合 * @param list 某一侧组件集合
* @return int 最小高度 * @return int 最小高度
*
*/ */
private int getCompsMinHeight(List<?> list) { private int getCompsMinHeight(List<?> list) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
@ -915,10 +964,10 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 根据子组件的横()坐标获取某一侧组件的最大内部组件数 * 根据子组件的横()坐标获取某一侧组件的最大内部组件数
*
* @param list 某一侧组件集合 * @param list 某一侧组件集合
* @param isHor 是否以横坐标为准 * @param isHor 是否以横坐标为准
* @return int 最大内部组件数 * @return int 最大内部组件数
*
*/ */
private int getMaxCompsNum(List<?> list, boolean isHor) { private int getMaxCompsNum(List<?> list, boolean isHor) {
int maxCompNums = 1; int maxCompNums = 1;
@ -940,6 +989,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 根据偏移量缩放内部组件大小,tab布局用到 * 根据偏移量缩放内部组件大小,tab布局用到
*
* @param creator tab布局 * @param creator tab布局
* @param offset 偏移量 * @param offset 偏移量
* @param isHor 是否为横向拖拽 * @param isHor 是否为横向拖拽
@ -998,6 +1048,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 删除或拉伸控件右边框 调整右侧组件位置大小 * 删除或拉伸控件右边框 调整右侧组件位置大小
*
* @param objX 调整后的坐标x * @param objX 调整后的坐标x
* @param objWidth 调整后的宽度 * @param objWidth 调整后的宽度
*/ */
@ -1016,9 +1067,9 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 实际拖拽偏移量是否超出了可调整的宽度范围 * 实际拖拽偏移量是否超出了可调整的宽度范围
*
* @param offset 实际偏移量 * @param offset 实际偏移量
* @return boolean 是否超出调整范围 * @return boolean 是否超出调整范围
*
*/ */
private boolean isBeyondAdjustWidthScope(int offset) { private boolean isBeyondAdjustWidthScope(int offset) {
boolean isBeyondScope = false; boolean isBeyondScope = false;
@ -1074,9 +1125,9 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 实际拖拽偏移量是否超出了可调整的高度范围 * 实际拖拽偏移量是否超出了可调整的高度范围
*
* @param offset 实际偏移量 * @param offset 实际偏移量
* @return boolean 是否超出调整范围 * @return boolean 是否超出调整范围
*
*/ */
private boolean isBeyondAdjustHeightScope(int offset) { private boolean isBeyondAdjustHeightScope(int offset) {
boolean isBeyondScope = false; boolean isBeyondScope = false;
@ -1095,6 +1146,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
} }
return false; return false;
} }
/** /**
* 删除或拉伸上边框 调整上方的组件位置大小 * 删除或拉伸上边框 调整上方的组件位置大小
*/ */
@ -1115,6 +1167,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
/** /**
* 不调整只计算位置 * 不调整只计算位置
*
* @return child的位置 * @return child的位置
*/ */
public int[] getChildPosition(Component currentComp, XCreator child, int x, int y) { public int[] getChildPosition(Component currentComp, XCreator child, int x, int y) {

2
designer_form/src/com/fr/design/designer/creator/XChartEditor.java

@ -86,7 +86,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("Form-Widget_Name")), .getLocText("Form-Widget_Name")),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {

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

@ -66,7 +66,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name")), .getLocText("FR-Designer_Form-Widget_Name")),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {
@ -76,7 +76,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
} }
}), }),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Designer_Layout-Padding")) .setI18NName(Inter.getLocText("FR-Designer_Layout-Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
}; };
} }

39
designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java

@ -2,9 +2,19 @@ package com.fr.design.designer.creator;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.core.PropertyChangeAdapter;
import java.awt.*; import java.awt.*;
import java.beans.IntrospectionException;
/** /**
* Created by zhouping on 2016/10/14. * Created by zhouping on 2016/10/14.
@ -52,4 +62,33 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
public boolean isSupportDrag() { public boolean isSupportDrag() {
return false; return false;
} }
/**
* 得到属性名
*
* @return 属性名
* @throws java.beans.IntrospectionException
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name")),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
}
})
};
}
@Override
protected void initStyle() {
initBorderStyle();
}
} }

2
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -283,7 +283,7 @@ public class XWCardLayout extends XLayoutContainer {
} }
}), }),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
CardTagWLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( CardTagWLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {

2
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -64,7 +64,7 @@ public class XWTabFitLayout extends XWFitLayout {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name")), .getLocText("FR-Designer_Form-Widget_Name")),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Designer_Layout-Padding")) .setI18NName(Inter.getLocText("FR-Designer_Layout-Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
}; };
} }

70
designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

@ -9,6 +9,7 @@ import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.general.FRLogger;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -92,6 +93,43 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
} else { } else {
if (row == 0) { if (row == 0) {
if (state == WBodyLayoutType.FIT.getTypeValue()) { if (state == WBodyLayoutType.FIT.getTypeValue()) {
return switch2FitBodyLayout();
}
}
if (row == 1) {
layout.setCompState(state);
return true;
}
return false;
}
}
int state = 0;
if(value instanceof Integer) {
state = (Integer)value;
}
if (column == 0 || state < 0) {
return false;
} else {
if (row == 0) {
layout.setCompState(state);
return true;
}
return false;
}
}
/**
* 是否可编辑
* @param row
* @return
*/
@Override
public boolean isEditable(int row) {
return true;
}
private boolean switch2FitBodyLayout() {
try {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
//备份一下组件间隔 //备份一下组件间隔
int compInterval = xfl.toData().getCompInterval(); int compInterval = xfl.toData().getCompInterval();
@ -133,40 +171,14 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
xfl.toData().setLayoutType(WBodyLayoutType.FIT); xfl.toData().setLayoutType(WBodyLayoutType.FIT);
return true; return true;
} }
} catch (Exception e){
if (row == 1) { FRLogger.getLogger().error(e.getMessage());
layout.setCompState(state);
return true;
}
return false; return false;
} }
} }
int state = 0;
if(value instanceof Integer) {
state = (Integer)value;
}
if (column == 0 || state < 0) {
return false;
} else {
if (row == 0) {
layout.setCompState(state);
return true;
}
return false;
}
}
/**
* 是否可编辑
* @param row
* @return
*/
@Override
public boolean isEditable(int row) {
return true;
}
// 把绝对布局中的元素按规则移动到自适应布局中 // 把绝对布局中的元素按规则移动到自适应布局中
// 规则:各元素按顺序放置,其中每行最多4个元素,超出则换行,各元素均分body的高度和宽度
private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { private void moveComponents2FitLayout(XWFitLayout xwFitLayout) {
int eachRowCount = 4; int eachRowCount = 4;
Component[] components = xwFitLayout.getComponents(); Component[] components = xwFitLayout.getComponents();

42
designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java

@ -1,10 +1,18 @@
package com.fr.design.designer.properties; package com.fr.design.designer.properties;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor; import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor; import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.design.designer.beans.ConstraintsGroupModel; import com.fr.design.designer.beans.ConstraintsGroupModel;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -23,6 +31,7 @@ import java.awt.*;
//控件在自适应布局中宽度、高度属性,7.1.1不可编辑 //控件在自适应布局中宽度、高度属性,7.1.1不可编辑
public class FRFitLayoutConstraints implements ConstraintsGroupModel { public class FRFitLayoutConstraints implements ConstraintsGroupModel {
private static final int MINHEIGHT = XCreator.SMALL_PREFERRED_SIZE.height; private static final int MINHEIGHT = XCreator.SMALL_PREFERRED_SIZE.height;
private static final int MINWIDTH = XCreator.SMALL_PREFERRED_SIZE.width;
private static final int ROWNUM = 2; private static final int ROWNUM = 2;
private DefaultTableCellRenderer renderer; private DefaultTableCellRenderer renderer;
@ -80,12 +89,18 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
public boolean setValue(Object value, int row, int column) { public boolean setValue(Object value, int row, int column) {
if (column == 1) { if (column == 1) {
int v = value == null ? 0 : ((Number) value).intValue(); int v = value == null ? 0 : ((Number) value).intValue();
Rectangle bounds = new Rectangle(xCreator.getBounds()); int difference = 0;
Rectangle bounds = getBounds();
switch (row) { switch (row) {
case 0: case 0:
if(v < MINWIDTH){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Width") + Integer.toString(MINWIDTH));
v = xCreator.getWidth();
}
if (bounds.width == v){ if (bounds.width == v){
return false; return false;
} }
difference = bounds.width - v;
bounds.width = v; bounds.width = v;
break; break;
case 1: case 1:
@ -96,25 +111,44 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
if (bounds.height == v){ if (bounds.height == v){
return false; return false;
} }
difference = bounds.height - v;
bounds.height = v; bounds.height = v;
break; break;
} }
WFitLayout wFitLayout = parent.toData(); WFitLayout wFitLayout = parent.toData();
wFitLayout.setBounds(xCreator.toData(),bounds); wFitLayout.setBounds(xCreator.toData(),bounds);
xCreator.setBounds(bounds); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Rectangle backupBounds = getBounds();
FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator);
if (layoutAdapter != null) {
layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference);
}
return true; return true;
} else { } else {
return false; return false;
} }
} }
public Rectangle getBounds(){
Rectangle bounds = new Rectangle(xCreator.getBounds());
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator);
if (parent == null) {
return bounds;
}
Rectangle rec = ComponentUtils.getRelativeBounds(parent);
bounds.x += rec.x;
bounds.y += rec.y;
return bounds;
}
/** /**
* 该行是否可编辑 * 该行是否可编辑
* @param row * @param row
* @return 第row行可编辑返回true否则返回false * @return 第row行可编辑返回true否则返回false
*/ */
public boolean isEditable(int row) { public boolean isEditable(int row) {
return false; return true;
} }
} }

11
designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java

@ -17,6 +17,7 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
@ -145,7 +146,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
layout.setCompState(state); layout.setCompState(state);
return true; return true;
}else if (row == 0) { }else if (row == 0) {
layout.setLayoutType(WBodyLayoutType.parse(state)); try {
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) { if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body"); WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
@ -167,12 +168,16 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout})); FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout}));
} } else {
else {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()})); FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
} }
}catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
return false;
}
layout.setLayoutType(WBodyLayoutType.parse(state));
return true; return true;
} }
return false; return false;

9
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -230,14 +230,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
if (p.getParameterArray().length == 0) { EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
EastRegionContainerPane.getInstance().setParameterHeight(30);
} else {
//参数面板独立后只能这边触发调整高度,根据参数个数调整换行,计算高度
EastRegionContainerPane.getInstance().setParameterHeight((p.getParameterArray().length + 5) / 6 * 30 + 80);
}
} }
/** /**

2
designer_form/src/com/fr/design/gui/xpane/LayoutBorderPane.java

@ -280,7 +280,7 @@ public class LayoutBorderPane extends BasicPane {
Constants.LINE_THICK, //3px Constants.LINE_THICK, //3px
}; };
public final static String[] BORDER_TYPE = new String[]{Inter.getLocText("FR-Designer-Widget-Style_Standard"), Inter.getLocText("FR-Designer-Widget-Style_Title")}; public final static String[] BORDER_TYPE = new String[]{Inter.getLocText("FR-Designer-Widget-Style_Standard"), Inter.getLocText("FR-Designer-Widget-Style_Custom")};
public final static String[] BORDER_STYLE= new String[]{Inter.getLocText("FR-Designer-Widget-Style_Common"), Inter.getLocText("FR-Designer-Widget-Style_Shadow")}; public final static String[] BORDER_STYLE= new String[]{Inter.getLocText("FR-Designer-Widget-Style_Common"), Inter.getLocText("FR-Designer-Widget-Style_Shadow")};
private final static Dimension BUTTON_SIZE = new Dimension(24, 20); private final static Dimension BUTTON_SIZE = new Dimension(24, 20);

8
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -198,13 +198,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
getParameterArray() == null ? new Parameter[0] : getParameterArray()); getParameterArray() == null ? new Parameter[0] : getParameterArray());
ParameterPropertyPane.getInstance().repaintContainer(); ParameterPropertyPane.getInstance().repaintContainer();
if (getParameterArray().length == 0) { EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
EastRegionContainerPane.getInstance().setParameterHeight(30);
} else {
//参数面板独立后只能这边触发调整高度,根据参数个数调整换行,计算高度
EastRegionContainerPane.getInstance().setParameterHeight((getParameterArray().length + 5) / 6 * 30 + 80);
}
} }
private void removeSame(Parameter[] parameters, List<String> namelist){ private void removeSame(Parameter[] parameters, List<String> namelist){

4
designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -79,7 +79,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
this.componentTree = null; this.componentTree = null;
// this.searchTextField = null; // this.searchTextField = null;
// this.searchResult = null; // this.searchResult = null;
add(new JScrollPane(), BorderLayout.CENTER); // add(new JScrollPane(), BorderLayout.CENTER);
} }
@Override @Override
@ -109,7 +109,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
adjustPosition(treeModel, formDesigner); adjustPosition(treeModel, formDesigner);
} }
JPanel widgetPane = new JPanel(); JPanel widgetPane = new JPanel();
widgetPane.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0)); widgetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout()); widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
add(widgetPane, BorderLayout.NORTH); add(widgetPane, BorderLayout.NORTH);
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer-Selected_Widget") + " ", widgetPane.add(new UILabel(Inter.getLocText("FR-Designer-Selected_Widget") + " ",

3
designer_form/src/com/fr/design/mainframe/JForm.java

@ -657,7 +657,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isSelectRootPane() { public boolean isSelectRootPane() {
return formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator(); return (formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator())
|| (formDesign.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWAbsoluteBodyLayout.class));
} }

2
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -47,7 +47,7 @@ public class ParameterPropertyPane extends JPanel{
initParameterListener(); initParameterListener();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(2, 5, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(toolbarPane, BorderLayout.CENTER); this.add(toolbarPane, BorderLayout.CENTER);
} }

Loading…
Cancel
Save