Browse Source

Merge branch 'release/10.0' of ssh://code.fineres.com:7999/~zheng/C-design into release/10.0

zheng-1641779399395
shine 3 years ago
parent
commit
042a5d0752
  1. 5
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  2. 6
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  3. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  4. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  5. 19
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  6. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  7. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java
  8. 11
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  9. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  10. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  11. 21
      designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java

5
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -379,7 +379,10 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
* @param l
*/
public void removeChangeListener(ChangeListener l) {
this.listenerList.remove(ChangeListener.class, l);
for (int i = 0; i < labelButtonList.size(); i++) {
labelButtonList.get(i).removeChangeListener(l);
listenerList.remove(ChangeListener.class, l);
}
}

6
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -46,12 +46,12 @@ public class WidgetBoundsPaneFactory {
private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked) {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")),
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()),
ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
};
@ -65,7 +65,7 @@ public class WidgetBoundsPaneFactory {
}
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
return createBoundsPane(width, height, null);
return createBoundsPane(width, height, null, NameAttribute.DEFAULT);
}
public static JPanel createRightPane(Component com1, Component com2) {

5
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -363,4 +363,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return false;
}
@Override
public boolean isComponent() {
return true;
}
}

8
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -897,4 +897,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
}
return ((XCreator) this.getParent()).getLevel() + 1;
}
/**
* 是否是组件控件还是组件
* @return 是否是组件
*/
public boolean isComponent() {
return false;
}
}

19
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -356,4 +356,23 @@ public class XCreatorUtils {
}
return null;
}
/**
* 把控件例如textEditor外层的容器剥掉
* @param xCreator 控件
* @return 内层控件
*/
public static XCreator getXCreatorInnerWidget(XCreator xCreator) {
if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
return (XCreator) xCreator.getComponent(0);
}
}
if (xCreator.acceptType(XWTitleLayout.class)) {
return (XCreator) xCreator.getComponent(0);
}
return xCreator;
}
}

5
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -365,4 +365,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public void releaseResources() {
imageLable.setIcon(null);
}
@Override
public boolean isComponent() {
return true;
}
}

5
designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java

@ -586,4 +586,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
public void setDragInAble(boolean dragInAble) {
this.dragInAble = dragInAble;
}
@Override
public boolean isComponent() {
return true;
}
}

11
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -113,7 +113,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
}
private void initComponents() {
XCreator innerCreator = getXCreatorDedicated();
XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER);
@ -166,7 +166,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
private void initDefinePane() {
currentEditorDefinePane = null;
XCreator creator = getXCreatorDedicated();
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() {
@Override
public void did(DataCreatorUI ui, String cardName) {
@ -190,11 +190,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
currentEditorDefinePane = definePane;
}
private XCreator getXCreatorDedicated() {
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
}
@Override
public String title4PopupWindow() {
return "Widget";
@ -283,7 +278,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
}
public void fireValueChanged() {
XCreator creator = getXCreatorDedicated();
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
creator.firePropertyChange();
}

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -35,7 +35,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, WidgetBoundsPaneFactory.NameAttribute.WIDGET));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, getNameAttribute()));
}
@Override

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -89,7 +89,20 @@ public class WidgetBoundPane extends BasicPane {
ratioLockedButton.setLockEnabled(false);
}
this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton));
this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton, getNameAttribute()));
}
protected WidgetBoundsPaneFactory.NameAttribute getNameAttribute() {
WidgetBoundsPaneFactory.NameAttribute nameAttribute = WidgetBoundsPaneFactory.NameAttribute.DEFAULT;
if (!isComponent()) {
nameAttribute = WidgetBoundsPaneFactory.NameAttribute.WIDGET;
}
return nameAttribute;
}
protected boolean isComponent() {
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.creator);
return creator.isComponent();
}

21
designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java

@ -109,15 +109,7 @@ public class EffectItemGroup {
Object value = cellElement.getValue();
if (value instanceof ChartCollection) {
ChartCollection chartCollection = (ChartCollection) value;
for (int index = 0; index < chartCollection.getChartCount(); index++) {
Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class);
Plot plot = chart.getPlot();
if (plot == null) {
continue;
}
SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode);
initChartPlot(plot, chartSourceNode, false);
}
initChartEditorByChartCollection(chartCollection, cellSourceNode);
}
}
@ -127,16 +119,23 @@ public class EffectItemGroup {
private void initChartEditor() {
ChartEditor editor = (ChartEditor) this.widget;
ChartCollection chartCollection = (ChartCollection) editor.getChartCollection();
initChartEditorByChartCollection(chartCollection, null);
}
private void initChartEditorByChartCollection(ChartCollection chartCollection, SourceNode sourceNode) {
for (int index = 0; index < chartCollection.getChartCount(); index++) {
ChartProvider chartProvider = chartCollection.getChart(index, ChartProvider.class);
if (chartProvider instanceof Chart) {
Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class);
Plot plot = chart.getPlot();
if (plot == null) {
continue;
}
SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null);
SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), sourceNode);
initChartPlot(plot, plotSourceNode, false);
}
}
}
private void initChartPlot(Plot plot, SourceNode sourceNode, boolean isSubChart) {

Loading…
Cancel
Save