Browse Source

冲突

master
neil 9 years ago
parent
commit
565b8edc82
  1. 20
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  2. 15
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java

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

@ -9,7 +9,10 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.*; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
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.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseContainerProvider;
@ -18,6 +21,8 @@ import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.fun.FitProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -29,6 +34,7 @@ import java.beans.PropertyDescriptor;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{
private UILabel imageLable; private UILabel imageLable;
private JPanel coverPanel; private JPanel coverPanel;
private FormDesigner designer;
public XElementCase(ElementCaseEditor widget, Dimension initSize) { public XElementCase(ElementCaseEditor widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
@ -78,10 +84,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
}; };
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor();
if (processor == null){ this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ElementCaseEditor editor = this.toData();
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (processor == null) {
return propertyTableEditor; return propertyTableEditor;
} }
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); if (editor.getReportFitAttr() == null) {
editor.setReportFitInPc(processor.getFitStateInPC(fitAttr));
}
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
} }

15
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java

@ -1,6 +1,7 @@
package com.fr.design.designer.properties.mobile; package com.fr.design.designer.properties.mobile;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -27,17 +28,20 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
private XCreator xCreator; private XCreator xCreator;
private FormDesigner designer; private FormDesigner designer;
private boolean cascade = false;
public ElementCasePropertyTable(XCreator xCreator) { public ElementCasePropertyTable(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
} }
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr().getState() == 2 && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) {
((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true); ((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true);
cascade = true;
return revealHeightLimit(); return revealHeightLimit();
} }
CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault(); CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault();
cascade = ((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL;
return crp; return crp;
} }
@ -53,6 +57,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")),
new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class) new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightrestrict")) .setI18NName(Inter.getLocText("Form-EC_heightrestrict"))
.setRendererClass(BooleanRender.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App"))
}; };
List<CRPropertyDescriptor> defaultList = new ArrayList<>(); List<CRPropertyDescriptor> defaultList = new ArrayList<>();
@ -103,6 +108,14 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED);
} }
@Override
public boolean isCellEditable(int row, int column) {
if (cascade && row ==3 ) {
return false;
}
return super.isCellEditable(row, column);
}
public void populate(FormDesigner designer) { public void populate(FormDesigner designer) {
this.designer = designer; this.designer = designer;
initPropertyGroups(this.designer.getTarget()); initPropertyGroups(this.designer.getTarget());

Loading…
Cancel
Save