Browse Source

Pull request #5971: REPORT-59932 【固定布局-原布局推荐4.1】剪切问题

Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x

* commit 'ac008319d7992d2d5681efd8fb0acce01f93eb51':
  代码调整
  REPORT-59948 && REPORT-59948
  命名修改
  REPORT-59932 【固定布局-原布局推荐4.1】剪切问题
research/11.0
kerry 3 years ago
parent
commit
4a6bd9b0b6
  1. 18
      designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java
  2. 11
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  3. 7
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

18
designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

@ -140,11 +140,28 @@ public class SelectionModel {
if (cutSelection != null) {
cutSelection.cut2ClipBoard(clipboard);
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED);
setSelectedCreator(hasSelectedParaComponent() ? designer.getParaComponent() : designer.getRootComponent());
designer.repaint();
}
}
}
/**
* 判断是否选中参数面板中的组件
* @return boolean
*/
private boolean hasSelectedParaComponent() {
XCreator[] roots = selection.getSelectedCreators();
if (roots.length > 0) {
for (XCreator creator : roots) {
if ((creator.getParent() instanceof XWParameterLayout)) {
return true;
}
}
}
return false;
}
/**
* 复制当前选中的组件到剪切板
*/
@ -322,7 +339,6 @@ public class SelectionModel {
setSelectedCreator(isInPara? designer.getParaComponent() : designer.getRootComponent());
// 触发事件
designer.repaint();
}

11
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -29,7 +29,9 @@ import com.fr.design.scrollruler.VerticalRuler;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.IOUtils;
import com.fr.stable.AssistUtils;
@ -212,10 +214,15 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
GUICoreUtils.showPopupMenu(popupMenu, fixLayoutSwitchButton, 0, -59);
}
});
button.setVisible(!isAbsoluteBodyLayout());
return button;
}
private boolean isAbsoluteBodyLayout() {
return ((WFitLayout) designer.getRootComponent().toData()).getBodyLayoutType() == WBodyLayoutType.ABSOLUTE;
}
/**
* 增加表单的页面大小控制界面包括手动修改和滑块拖动
@ -261,7 +268,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
public void switchBodyLayout(XLayoutContainer xLayoutContainer) {
this.fixLayoutSwitchButton.setVisible(xLayoutContainer.supportFixLayout());
this.switchLayout(true);
this.switchLayout(false);
}
private void switchLayout(boolean isFixLayout) {

7
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -4,11 +4,9 @@ import com.fr.base.io.IOFile;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedComponentStyle;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
@ -23,7 +21,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.widget.FRWidgetFactory;
@ -41,9 +38,6 @@ import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -170,7 +164,6 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle());
boundPane.populate();
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
WidgetPropertyPane.getInstance().getEditingFormDesigner().switchBodyLayout((XLayoutContainer) creator);
}
public WAbsoluteBodyLayout updateSubPane() {

Loading…
Cancel
Save