Fangjie Hu 8 years ago
parent
commit
9b00321cdf
  1. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  2. 14
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  3. 7
      designer_base/src/com/fr/design/mainframe/HelpDialogManager.java
  4. 2
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 2
      designer_chart/src/com/fr/design/chart/ChartPlotFactory.java
  6. 13
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/FunnelDataLabelPane.java
  7. 28
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FunnelPlotDataSeriesConditionPane.java
  8. 6
      designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java
  9. 67
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  10. 10
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  11. 1825
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  12. 2
      designer_form/src/com/fr/design/designer/creator/XChartEditor.java
  13. 6
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  14. 4
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  15. 39
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  16. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  17. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  18. 94
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
  19. 42
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java
  20. 53
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
  21. 10
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  22. 2
      designer_form/src/com/fr/design/gui/xpane/LayoutBorderPane.java
  23. 42
      designer_form/src/com/fr/design/mainframe/CoverReportPane.java
  24. 10
      designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java
  25. 8
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  26. 4
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java
  27. 26
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  28. 3
      designer_form/src/com/fr/design/mainframe/JForm.java
  29. 14
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
  30. 4
      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(); } } }

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

7
designer_base/src/com/fr/design/mainframe/HelpDialogManager.java

@ -35,11 +35,4 @@ public class HelpDialogManager {
}
return THIS;
}
public void destroyDialog() {
if (handler != null) {
handler.destroyHelpDialog();
}
handler = null;
}
}

2
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -138,8 +138,6 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单
menuList.add(createHelpMenuDef());
// 添加社区菜单
menuList.add(createCommunityMenuDef());
return menuList.toArray(new MenuDef[menuList.size()]);
}

2
designer_chart/src/com/fr/design/chart/ChartPlotFactory.java

@ -72,7 +72,7 @@ public class ChartPlotFactory {
.setAxisPaneCls(XYChartStyleAxisPane.class)
.setDataLabelPaneClass(XYDataLabelPane.class));
map.put(FunnelPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(PieDataLabelPane.class));
.setDataLabelPaneClass(FunnelDataLabelPane.class));
}
private ChartPlotFactory() {

13
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/FunnelDataLabelPane.java

@ -0,0 +1,13 @@
package com.fr.design.chart.series.SeriesCondition.dlp;
import java.awt.*;
/**
* Created by Mitisky on 16/11/9.
*/
public class FunnelDataLabelPane extends DataLabelPane {
@Override
protected Component[] createComponents4ShowCategoryName() {
return new Component[0];
}
}

28
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FunnelPlotDataSeriesConditionPane.java

@ -0,0 +1,28 @@
package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.chart.chartattr.FunnelPlot;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.PiePlotChartConditionPane;
/**
* Created by Mitisky on 16/11/9.
*/
public class FunnelPlotDataSeriesConditionPane extends DataSeriesConditionPane {
@Override
protected ChartConditionPane createListConditionPane() {
return new PiePlotChartConditionPane();
}
/**
* 返回class对象
* @return class对象
*/
@Override
public Class<? extends Plot> class4Correspond() {
return FunnelPlot.class;
}
}

6
designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java

@ -3,6 +3,8 @@ package com.fr.design.chartinterface;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.impl.AbstractIndependentChartUIWithAPILevel;
import com.fr.design.chart.series.SeriesCondition.impl.FunnelPlotDataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
@ -34,6 +36,10 @@ public class FunnelIndependentChartInterface extends AbstractIndependentChartUIW
return new FunnelSeriesPane(parent, plot);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new FunnelPlotDataSeriesConditionPane();
}
/**
*图标路径
* @return 图标路径

67
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -1,10 +1,10 @@
package com.fr.design.mainframe.chart.gui;
import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -53,19 +53,14 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private ChartTypePane parent = null;
//记录鼠标当前是否在操作添加按钮
private boolean mouseOnChartTypeButtonPane = false;
//配置窗口属性
private UIMenuNameableCreator configCreator;
/**
* 鼠标事件是否在这个面板
* @return 返回是否
*/
public boolean isMouseOnChartTypeButtonPane() {
return this.mouseOnChartTypeButtonPane;
}
//处理 编辑一个button时,选中另一个button的问题.
//stopEditing不能直接relayout,否则click事件不响应了.
//所以:stopEditing--选中其他button则响应click之后relayout;普通失焦则直接relayout.
private boolean pressOtherButtonWhenEditing = false;
// private AWTEventListener awt = new AWTEventListener() {
// public void eventDispatched(AWTEvent event) {
@ -122,7 +117,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void initAddButton() {
addButton.setPreferredSize(new Dimension(20, 20));
addButton.addActionListener(addListener);
addButton.addMouseListener(mouseListener);
}
private void initConfigButton() {
@ -133,7 +127,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
ActionListener addListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
mouseOnChartTypeButtonPane = true;
String name = getNewChartName();
ChartChangeButton button = new ChartChangeButton(name);// some set selected
@ -188,15 +181,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
dialog.setVisible(true);
}
};
MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
super.mouseExited(e);
mouseOnChartTypeButtonPane = false;
}
};
private String getNewChartName() {
int count = indexList.size() + 1;
@ -352,12 +336,19 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
if (currentEditingEditor != null) {
String newName = currentEditingEditor.getText();
int selectedIndex = editingCollection.getSelectedIndex();
ChartChangeButton button = indexList.get(selectedIndex);
button.isMoveOn = false;
if (!ComparatorUtils.equals(editingCollection.getChartName(selectedIndex), newName)) {
editingCollection.setChartName(selectedIndex, newName);
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
button.changeChartName(newName);
}
buttonPane.remove(currentEditingEditor);
currentEditingEditor = null;
if(!pressOtherButtonWhenEditing) {
layoutPane(buttonPane);
}
}
}
@ -375,11 +366,25 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
buttonName = name;
this.setToolTipText(name);
nameField.addActionListener(new ActionListener() {
nameField.addActionListener(new ActionListener() {//enter
@Override
public void actionPerformed(ActionEvent e) {
pressOtherButtonWhenEditing = false;
stopEditing();
populateBean(editingCollection);
}
});
nameField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {//编辑状态lost才走这边
if (currentEditingEditor != null ) {
stopEditing();
}
}
});
}
@ -388,6 +393,11 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
return buttonName;
}
private void changeChartName(String name) {
this.setText(name);
buttonName = name;
}
public Dimension getPreferredSize() {
return new Dimension(B_W, B_H);
}
@ -467,17 +477,20 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
@Override
public void mouseClicked(MouseEvent e) {
mouseClick(e);
mouseOnChartTypeButtonPane = true;
if(pressOtherButtonWhenEditing){
relayoutPane();
pressOtherButtonWhenEditing = false;
}
}
public void mouseEntered(MouseEvent e) {
checkMoveOn(true);
mouseOnChartTypeButtonPane = true;
pressOtherButtonWhenEditing = currentEditingEditor != null;
}
public void mouseExited(MouseEvent e) {
checkMoveOn(false);
mouseOnChartTypeButtonPane = false;
pressOtherButtonWhenEditing = false;
}
};
}

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
*/
public void fix(XCreator creator ,int x, int y) {
int height = creator.getHeight();
int width = creator.getWidth();
if (x < 0) {
width += x;
x = 0;
} else if (x + creator.getWidth() > container.getWidth()) {
x = container.getWidth() - creator.getWidth();
width = container.getWidth() - x;
}
if (y < 0) {
height += y;
y = 0;
} 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

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

File diff suppressed because it is too large Load Diff

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
.getLocText("Form-Widget_Name")),
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")
.setPropertyChangeListener(new PropertyChangeAdapter() {

6
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -282,12 +282,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* @param e 点击事件
*/
public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){
HelpDialogManager.getInstance().setPane(coverPanel);
super.respondClick(editingMouseListener, e);
if (this.isHelpBtnOnFocus()) {
coverPanel.setMsgDisplay(e);
}else {
coverPanel.destroyHelpDialog();
switchTab(e,editingMouseListener);
} else {
switchTab(e, editingMouseListener);
}
}

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
.getLocText("FR-Designer_Form-Widget_Name")),
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")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@ -76,7 +76,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
}
}),
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"),
};
}

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.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.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.core.PropertyChangeAdapter;
import java.awt.*;
import java.beans.IntrospectionException;
/**
* Created by zhouping on 2016/10/14.
@ -52,4 +62,33 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
public boolean isSupportDrag() {
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(
CardTagWLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName(
CardTagWLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.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
.getLocText("FR-Designer_Form-Widget_Name")),
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"),
};
}

94
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.form.ui.Widget;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.general.FRLogger;
import com.fr.general.FRScreen;
import com.fr.general.Inter;
@ -92,46 +93,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
} else {
if (row == 0) {
if (state == WBodyLayoutType.FIT.getTypeValue()) {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
//备份一下组件间隔
int compInterval = xfl.toData().getCompInterval();
Component[] components = xwAbsoluteLayout.getComponents();
Arrays.sort(components, new ComparatorComponentLocation());
xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
xfl.remove(xwAbsoluteLayout);
for (Component comp : components) {
XCreator xCreator = (XCreator)comp;
if (xCreator.shouldScaleCreator()){
XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight());
xfl.add(parentPanel, xCreator.toData().getWidgetName());
parentPanel.updateChildBound(xfl.getActualMinHeight());
continue;
}
xfl.add(xCreator);
}
//这边计算的时候会先把组件间隔去掉
moveComponents2FitLayout(xfl);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i);
XCreator creator = (XCreator) comp;
creator.setBackupBound(components[i].getBounds());
}
//把组件间隔加上
if (xfl.toData().getCompInterval() != compInterval) {
xfl.moveContainerMargin();
xfl.moveCompInterval(xfl.getAcualInterval());
xfl.toData().setCompInterval(compInterval);
xfl.addCompInterval(xfl.getAcualInterval());
}
xfl.toData().setLayoutType(WBodyLayoutType.FIT);
return true;
return switch2FitBodyLayout();
}
}
if (row == 1) {
@ -166,7 +128,57 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
return true;
}
//把绝对布局中的元素按规则移动到自适应布局中
private boolean switch2FitBodyLayout() {
try {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
//备份一下组件间隔
int compInterval = xfl.toData().getCompInterval();
Component[] components = xwAbsoluteLayout.getComponents();
Arrays.sort(components, new ComparatorComponentLocation());
xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
xfl.remove(xwAbsoluteLayout);
for (Component comp : components) {
XCreator xCreator = (XCreator) comp;
if (xCreator.shouldScaleCreator()) {
XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight());
xfl.add(parentPanel, xCreator.toData().getWidgetName());
parentPanel.updateChildBound(xfl.getActualMinHeight());
continue;
}
xfl.add(xCreator);
}
//这边计算的时候会先把组件间隔去掉
moveComponents2FitLayout(xfl);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i);
XCreator creator = (XCreator) comp;
creator.setBackupBound(components[i].getBounds());
}
//把组件间隔加上
if (xfl.toData().getCompInterval() != compInterval) {
xfl.moveContainerMargin();
xfl.moveCompInterval(xfl.getAcualInterval());
xfl.toData().setCompInterval(compInterval);
xfl.addCompInterval(xfl.getAcualInterval());
}
xfl.toData().setLayoutType(WBodyLayoutType.FIT);
return true;
}
catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
return false;
}
}
// 把绝对布局中的元素按规则移动到自适应布局中
// 规则:各元素按顺序放置,其中每行最多4个元素,超出则换行,各元素均分body的高度和宽度
private void moveComponents2FitLayout(XWFitLayout xwFitLayout) {
int eachRowCount = 4;
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;
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.PropertyCellEditor;
import com.fr.design.designer.beans.ConstraintsGroupModel;
import com.fr.design.designer.creator.XCreator;
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.general.Inter;
@ -23,6 +31,7 @@ import java.awt.*;
//控件在自适应布局中宽度、高度属性,7.1.1不可编辑
public class FRFitLayoutConstraints implements ConstraintsGroupModel {
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 DefaultTableCellRenderer renderer;
@ -80,12 +89,18 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
public boolean setValue(Object value, int row, int column) {
if (column == 1) {
int v = value == null ? 0 : ((Number) value).intValue();
Rectangle bounds = new Rectangle(xCreator.getBounds());
int difference = 0;
Rectangle bounds = getBounds();
switch (row) {
case 0:
if(v < MINWIDTH){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Width") + Integer.toString(MINWIDTH));
v = xCreator.getWidth();
}
if (bounds.width == v){
return false;
}
difference = bounds.width - v;
bounds.width = v;
break;
case 1:
@ -96,25 +111,44 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
if (bounds.height == v){
return false;
}
difference = bounds.height - v;
bounds.height = v;
break;
}
WFitLayout wFitLayout = parent.toData();
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;
} else {
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
* @return 第row行可编辑返回true否则返回false
*/
public boolean isEditable(int row) {
return false;
return true;
}
}

53
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.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import javax.swing.table.DefaultTableCellRenderer;
@ -145,34 +146,38 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
layout.setCompState(state);
return true;
}else if (row == 0) {
layout.setLayoutType(WBodyLayoutType.parse(state));
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xfl.getComponents();
xfl.removeAll();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0,0));
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
XCreator xCreator = (XCreator)component;
//部分控件被ScaleLayout包裹着,绝对布局里面要放出来
if (xCreator.acceptType(XWScaleLayout.class)){
if (xCreator.getComponentCount() > 0 && ((XCreator)xCreator.getComponent(0)).shouldScaleCreator()) {
component = xCreator.getComponent(0);
component.setBounds(xCreator.getBounds());
try {
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xfl.getComponents();
xfl.removeAll();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
XCreator xCreator = (XCreator) component;
//部分控件被ScaleLayout包裹着,绝对布局里面要放出来
if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
component = xCreator.getComponent(0);
component.setBounds(xCreator.getBounds());
}
}
xwAbsoluteBodyLayout.add(component);
}
xwAbsoluteBodyLayout.add(component);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout}));
} else {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
}
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout}));
}
else {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
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 false;

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

@ -112,9 +112,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
EastRegionContainerPane.getInstance().replaceDownPane(
FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceUpPane(
WidgetPropertyPane.getInstance(this));
} else {
EastRegionContainerPane.getInstance().removeParameterPane();
showAuthorityEditPane();
}
@ -231,13 +234,6 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
if (p.getParameterArray().length == 0) {
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
};
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")};
private final static Dimension BUTTON_SIZE = new Dimension(24, 20);

42
designer_form/src/com/fr/design/mainframe/CoverReportPane.java

@ -1,8 +1,6 @@
package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants;
import com.fr.form.share.ShareConstants;
@ -13,6 +11,8 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* 报表块的封面如果后面所有的组件都有帮助信息的话就抽接口吧
@ -43,18 +43,6 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
public CoverReportPane(String helpMsg) {
super();
this.helpMsg = helpMsg;
add(controlButton);
// if (WidgetPropertyPane.getInstance().getEditingFormDesigner() != null) {
// WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() {
// @Override
// public void fireCreatorModified(DesignerEvent evt) {
// if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED)
// || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) {
// destroyHelpDialog();
// }
// }
// });
// }
}
public String getHelpMsg() {
@ -63,12 +51,16 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
public void setHelpMsg(String helpMsg) {
this.helpMsg = helpMsg;
//帮助信息为空就不显示帮助按钮
if (StringUtils.isNotEmpty(helpMsg)) {
add(controlButton);
}
}
public void setMsgDisplay(MouseEvent e) {
if (helpDialog == null) {
controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH);
controlButton.repaint();
// controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH);
controlButton.setVisible(false);
helpDialog = new ElementCaseHelpDialog(DesignerContext.getDesignerFrame(), helpMsg);
double screenValue = FRScreen.getByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue();
int offsetX = 0;
@ -80,12 +72,14 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
int rY = 165 + e.getY();//165是设计器最上面几个面板的高度
helpDialog.setLocationRelativeTo(DesignerContext.getDesignerFrame(), rX, rY);
helpDialog.showWindow();
helpDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
helpDialog = null;
controlButton.setVisible(true);
}
});
HelpDialogManager.getInstance().setPane(this);
} else {
controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH);
controlButton.repaint();
helpDialog.dispose();
helpDialog = null;
}
}
@ -135,8 +129,8 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{
@Override
public void setVisible(boolean aFlag) {
super.setVisible(aFlag);
if (aFlag) {
HelpDialogManager.getInstance().setPane(this);
}
// if (aFlag) {
// HelpDialogManager.getInstance().setPane(this);
// }
}
}

10
designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
@ -15,7 +16,7 @@ import java.awt.*;
public class ElementCaseHelpDialog extends UIDialog {
private static final int OUTER_WIDTH = 190;
private static final int OUTER_HEIGHT = 120;
private static final int OUTER_HEIGHT = 280;
private String helpMsg;
@ -25,7 +26,6 @@ public class ElementCaseHelpDialog extends UIDialog {
public ElementCaseHelpDialog(Frame parent, String helpMsg) {
super(parent);
this.helpMsg = helpMsg;
setUndecorated(true);
initHelpArea();
JPanel panel = (JPanel) getContentPane();
initComponents(panel);
@ -37,21 +37,23 @@ public class ElementCaseHelpDialog extends UIDialog {
textArea.setEditable(false);
textArea.setBorder(null);
helpArea = new UIScrollPane(textArea);
helpArea.setBounds(0, 0, 190, 120);
helpArea.setBounds(0, 0, OUTER_WIDTH, OUTER_HEIGHT);
helpArea.setBorder(null);
}
private void initComponents(JPanel contentPane) {
contentPane.setLayout(new BorderLayout());
add(helpArea, BorderLayout.CENTER);
this.applyClosingAction();
this.setTitle(Inter.getLocText("FR-Designer_Help"));
}
/**
* 打开帮助框
*/
public void showWindow() {
setVisible(true);
this.setResizable(false);
setVisible(true);
}
/**

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(
getParameterArray() == null ? new Parameter[0] : getParameterArray());
ParameterPropertyPane.getInstance().repaintContainer();
if (getParameterArray().length == 0) {
EastRegionContainerPane.getInstance().setParameterHeight(30);
} else {
//参数面板独立后只能这边触发调整高度,根据参数个数调整换行,计算高度
EastRegionContainerPane.getInstance().setParameterHeight((getParameterArray().length + 5) / 6 * 30 + 80);
}
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
}
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.searchTextField = null;
// this.searchResult = null;
add(new JScrollPane(), BorderLayout.CENTER);
// add(new JScrollPane(), BorderLayout.CENTER);
}
@Override
@ -109,7 +109,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
adjustPosition(treeModel, formDesigner);
}
JPanel widgetPane = new JPanel();
widgetPane.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
widgetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
add(widgetPane, BorderLayout.NORTH);
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer-Selected_Widget") + " ",

26
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.PluginWebBridge;
@ -19,6 +20,8 @@ import com.fr.form.share.ShareConstants;
import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
@ -29,6 +32,8 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Created with IntelliJ IDEA.
@ -220,10 +225,23 @@ public class FormWidgetDetailPane extends FormDockView{
downloadItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
BasicPane managerPane = new WebManagerPaneFactory().createReusePane();
UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane);
PluginWebBridge.getHelper().setDialogHandle(dlg);
dlg.setVisible(true);
String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
});

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
*/
public boolean isSelectRootPane() {
return formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator();
return (formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator())
|| (formDesign.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWAbsoluteBodyLayout.class));
}

14
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -107,7 +107,7 @@ public class UITreeComboBox extends JComboBox{
class UITreeComboBoxRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus){
if(tree != null ){
if(tree != null && tree.getSelectedTreePath().length > 0){
TreePath path = tree.getSelectedTreePath()[0];
tree.setAndScrollSelectionPath(path);
Object node = path.getLastPathComponent();
@ -131,14 +131,12 @@ public class UITreeComboBox extends JComboBox{
public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
TreePath[] paths = tree.getSelectedTreePath();
if (paths.length == 1) {
if (tree != null && paths.length > 0) {
tree.setAndScrollSelectionPath(paths[0]);
} else {
tree.setSelectionPaths(paths);
setSelectedItem(paths[0]);
MenuSelectionManager.defaultManager().clearSelectedPath();
}
setSelectedItem(paths[0]);
MenuSelectionManager.defaultManager().clearSelectedPath();
} else {
tree.refreshUI();
repaint();
@ -205,7 +203,7 @@ class TreePopup extends JPopupMenu implements ComboPopup{
}
}
public void show(){
public void show() {
updatePopup();
show(comboBox, 0, comboBox.getHeight());
comboBox.getTree().requestFocus();

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

@ -45,9 +45,9 @@ public class ParameterPropertyPane extends JPanel{
toolbarPane = new ParameterToolBarPane();
initParameterListener();
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);
}

Loading…
Cancel
Save