neil 9 years ago
parent
commit
4632414215
  1. 3
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  2. 20
      designer/src/com/fr/design/module/DesignerModule.java
  3. 10
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  4. 1
      designer_base/src/com/fr/design/beans/BasicBeanPane.java
  5. 7
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  6. 8
      designer_base/src/com/fr/design/style/AlignmentPane.java
  7. 20
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  8. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/datalabel/ChartLabelFontPane.java
  9. 21
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyFitLayoutAdapter.java
  10. 20
      designer_form/src/com/fr/design/designer/creator/XWBodyFitLayout.java
  11. 2
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  12. 63
      designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java
  13. 111
      designer_form/src/com/fr/design/designer/properties/BodyMobileLayoutPropertiesGroupModel.java
  14. 8
      designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java

3
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -279,8 +279,10 @@ public class BBSLoginDialog extends UIDialog {
* @return 同上 * @return 同上
*/ */
public static boolean login(String username, String password) { public static boolean login(String username, String password) {
if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {
try { try {
username = URLEncoder.encode(username, EncodeConstants.ENCODING_GBK); username = URLEncoder.encode(username, EncodeConstants.ENCODING_GBK);
password = URLEncoder.encode(password, EncodeConstants.ENCODING_GBK);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());
} }
@ -297,6 +299,7 @@ public class BBSLoginDialog extends UIDialog {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());
} }
} }
}
return false; return false;
} }

20
designer/src/com/fr/design/module/DesignerModule.java

@ -14,15 +14,8 @@ import com.fr.design.actions.insert.flot.ImageFloatAction;
import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction;
import com.fr.design.actions.server.StyleListAction; import com.fr.design.actions.server.StyleListAction;
import com.fr.design.fun.ElementUIProvider; import com.fr.design.fun.ElementUIProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.hyperlink.ReportletHyperlinkPane;
import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.javascript.EmailPane;
import com.fr.design.javascript.JavaScriptImplPane;
import com.fr.design.javascript.ParameterJavaScriptPane;
import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.javascript.ProcessTransitionAdapter;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.bbs.BBSGuestPane; import com.fr.design.mainframe.bbs.BBSGuestPane;
@ -38,7 +31,6 @@ import com.fr.general.*;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.Excel2007ReportImporter;
import com.fr.io.importer.ExcelReportImporter; import com.fr.io.importer.ExcelReportImporter;
import com.fr.js.*;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.quickeditor.ChartQuickEditor; import com.fr.quickeditor.ChartQuickEditor;
@ -55,10 +47,11 @@ import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.fun.LogProvider; import com.fr.stable.fun.LogProvider;
import com.fr.stable.module.Module;
import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.plugin.PluginSimplify;
import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.CalculatorProviderContext;
import com.fr.stable.script.ValueConverter; import com.fr.stable.script.ValueConverter;
import com.fr.stable.web.ServletContext;
import com.fr.stable.web.ServletContextAdapter;
import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectTokenizer;
import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.stable.xml.ObjectXMLWriterFinder;
import com.fr.start.BBSGuestPaneProvider; import com.fr.start.BBSGuestPaneProvider;
@ -75,6 +68,15 @@ import java.util.Set;
public class DesignerModule extends DesignModule { public class DesignerModule extends DesignModule {
static {
ServletContext.addServletContextListener(new ServletContextAdapter() {
public void onServletStart() {
ModuleContext.startModule(DesignerModule.class.getName());
}
});
}
/** /**
* 启动设计器模块 * 启动设计器模块
*/ */

10
designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java

@ -173,10 +173,9 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
comboItemsMap = new HashMap<>(); comboItemsMap = new HashMap<>();
Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING); Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING);
providers.add(new DefaultSubmit()); addSubmitPane(new DefaultSubmit());
for (SubmitProvider provider : providers) { for (SubmitProvider provider : providers) {
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit()); addSubmitPane(provider);
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit());
} }
configTypes = new ArrayList<>(); configTypes = new ArrayList<>();
@ -211,6 +210,11 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
}); });
} }
private void addSubmitPane(SubmitProvider provider) {
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit());
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit());
}
@Override @Override
public void populateBean(WClassSubmiterProvider ob) { public void populateBean(WClassSubmiterProvider ob) {
editing = ob; editing = ob;

1
designer_base/src/com/fr/design/beans/BasicBeanPane.java

@ -8,6 +8,7 @@ import com.fr.design.dialog.BasicPane;
public abstract class BasicBeanPane<T> extends BasicPane { public abstract class BasicBeanPane<T> extends BasicPane {
/** /**
* Populate. * Populate.
*/ */

7
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -22,6 +22,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.report.fun.VerticalTextProcessor; import com.fr.report.fun.VerticalTextProcessor;
import com.fr.report.fun.impl.DefaultVerticalTextProcessor;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
@ -134,10 +135,8 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
private void initTextRotationCombox(){ private void initTextRotationCombox(){
ArrayList<String> selectOption = new ArrayList<String>(); ArrayList<String> selectOption = new ArrayList<String>();
selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle")); selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle"));
VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG); VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG, DefaultVerticalTextProcessor.class);
if (processor != null){
selectOption.addAll(Arrays.asList(processor.getComboxOption())); selectOption.addAll(Arrays.asList(processor.getComboxOption()));
}
textRotationComboBox = new UIComboBox(selectOption.toArray(new String[selectOption.size()])); textRotationComboBox = new UIComboBox(selectOption.toArray(new String[selectOption.size()]));
} }
@ -241,7 +240,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
} else { } else {
this.textComboBox.setSelectedIndex(0); this.textComboBox.setSelectedIndex(0);
} }
if (style.getVerticalText() == Style.VERTICALTEXT && ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) != null) { if (style.getVerticalText() == Style.VERTICALTEXT) {
textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2); textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2);
} else { } else {
textRotationComboBox.setSelectedIndex(0); textRotationComboBox.setSelectedIndex(0);

8
designer_base/src/com/fr/design/style/AlignmentPane.java

@ -16,8 +16,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.fun.VerticalTextProcessor;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import javax.swing.*; import javax.swing.*;
@ -126,9 +124,6 @@ public class AlignmentPane extends BasicPane {
directionBG.add(rightToLeftRB); directionBG.add(rightToLeftRB);
rightToLeftRB.setSelected(true); rightToLeftRB.setSelected(true);
if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){
return;
}
isVerticalTextPanel.add(isVerticalTextCheckBox); isVerticalTextPanel.add(isVerticalTextCheckBox);
isVerticalTextPanel.add(leftToRightRB); isVerticalTextPanel.add(leftToRightRB);
isVerticalTextPanel.add(rightToLeftRB); isVerticalTextPanel.add(rightToLeftRB);
@ -302,9 +297,6 @@ public class AlignmentPane extends BasicPane {
} }
private void populateVertical(Style style){ private void populateVertical(Style style){
if (ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG) == null){
return;
}
this.isVerticalTextCheckBox.setSelected(true); this.isVerticalTextCheckBox.setSelected(true);
this.rotationSpinner.setEnabled(false); this.rotationSpinner.setEnabled(false);
if (style.getTextDirection() == Style.LEFT_TO_RIGHT) { if (style.getTextDirection() == Style.LEFT_TO_RIGHT) {

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

@ -58,7 +58,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
if (classManager == null) { if (classManager == null) {
classManager = new ChartTypeInterfaceManager(); classManager = new ChartTypeInterfaceManager();
chartTypeInterfaces.clear(); chartTypeInterfaces.clear();
classManager.readXMLFile();
} }
return classManager; return classManager;
} }
@ -75,16 +74,15 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
GeneralContext.addPluginReadListener(new PluginReadListener() { GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override @Override
public void success() { public void success() {
if (chartTypeInterfaces != null) { ChartTypeInterfaceManager.getInstance().readDefault();
readDefault();
//重新注册designModuleFactory //重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
} }
}
}); });
} }
public static WidgetOption[] initWidgetOption(){ public static WidgetOption[] initWidgetOption(){
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) { for (int i = 0; i < typeName.length; i++) {
@ -101,7 +99,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
} }
private synchronized static void envChanged() { private synchronized static void envChanged() {
chartTypeInterfaces.clear(); classManager = null;
} }
private static void readDefault() { private static void readDefault() {
@ -132,6 +130,12 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
} }
} }
public static void addChartTypeInterface(IndependentChartUIProvider provider, String plotID) {
if (chartTypeInterfaces != null && !chartTypeInterfaces.containsKey(plotID)) {
chartTypeInterfaces.put(plotID, provider);
}
}
/** /**
* 增加界面接口定义 * 增加界面接口定义
* *
@ -141,7 +145,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
public void addChartInterface(String className, String plotID, PluginSimplify simplify) { public void addChartInterface(String className, String plotID, PluginSimplify simplify) {
if (StringUtils.isNotBlank(className)) { if (StringUtils.isNotBlank(className)) {
try { try {
Class<?> clazz = loader.loadClass(className); Class<?> clazz = Class.forName(className);
Authorize authorize = clazz.getAnnotation(Authorize.class); Authorize authorize = clazz.getAnnotation(Authorize.class);
if (authorize != null) { if (authorize != null) {
PluginLicenseManager.getInstance().registerPaid(authorize, simplify); PluginLicenseManager.getInstance().registerPaid(authorize, simplify);
@ -149,8 +153,8 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
IndependentChartUIProvider provider = (IndependentChartUIProvider) clazz.newInstance(); IndependentChartUIProvider provider = (IndependentChartUIProvider) clazz.newInstance();
if (PluginCollector.getCollector().isError(provider, IndependentChartUIProvider.CURRENT_API_LEVEL, simplify.getPluginName()) || !containsChart(plotID)) { if (PluginCollector.getCollector().isError(provider, IndependentChartUIProvider.CURRENT_API_LEVEL, simplify.getPluginName()) || !containsChart(plotID)) {
PluginMessage.remindUpdate(className); PluginMessage.remindUpdate(className);
} else if (!chartTypeInterfaces.containsKey(plotID)) { } else {
chartTypeInterfaces.put(plotID, provider); ChartTypeInterfaceManager.getInstance().addChartTypeInterface(provider, plotID);
} }
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
FRLogger.getLogger().error("class not found:" + e.getMessage()); FRLogger.getLogger().error("class not found:" + e.getMessage());

1
designer_chart/src/com/fr/design/mainframe/chart/gui/style/datalabel/ChartLabelFontPane.java

@ -58,6 +58,7 @@ public class ChartLabelFontPane extends BasicScrollPane<Chart> {
} }
cateTextAttrPane.populate(cateTextAttr); cateTextAttrPane.populate(cateTextAttr);
categoryName.setSelected(meterPlot.isShowCateName()); categoryName.setSelected(meterPlot.isShowCateName());
cateTextAttrPane.setEnabled(meterPlot.isShowCateName());
} }

21
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyFitLayoutAdapter.java

@ -1,21 +0,0 @@
package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.BodyMobileLayoutPropertiesGroupModel;
public class FRBodyFitLayoutAdapter extends FRFitLayoutAdapter {
public FRBodyFitLayoutAdapter(XLayoutContainer container) {
super(container);
}
/**
* 返回布局自身属性方便一些特有设置在layout刷新时处理
*/
@Override
public GroupModel getLayoutProperties() {
XWFitLayout xfl = (XWFitLayout) container;
return new BodyMobileLayoutPropertiesGroupModel(xfl);
}
}

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

@ -1,20 +0,0 @@
package com.fr.design.designer.creator;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRBodyFitLayoutAdapter;
import com.fr.form.ui.container.WFitLayout;
import java.awt.Dimension;
public class XWBodyFitLayout extends XWFitLayout {
public XWBodyFitLayout() {
this(new WFitLayout(), new Dimension());
}
public XWBodyFitLayout(WFitLayout widget, Dimension initSize) {
super(widget, initSize);
}
@Override
public LayoutAdapter getLayoutAdapter() {
return new FRBodyFitLayoutAdapter(this);
}
}

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

@ -1160,7 +1160,7 @@ public class XWFitLayout extends XLayoutContainer {
@Override @Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(new XWBodyFitLayout())}; return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(this)};
} }
} }

63
designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java

@ -1,40 +1,39 @@
package com.fr.design.designer.properties; package com.fr.design.designer.properties;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.beans.IntrospectionException;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.JTable;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
import com.fr.design.beans.GroupModel; import com.fr.base.FRContext;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.gui.itable.PropertyGroup;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.gui.xtable.ReportAppPropertyGroupModel;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor;
import com.fr.general.Inter;
public class BodyAppRelayoutTable extends AbstractPropertyTable { public class BodyAppRelayoutTable extends AbstractPropertyTable {
private XWBodyFitLayout xwBodyFitLayout; private XCreator xCreator;
private FormDesigner designer;
public BodyAppRelayoutTable(XWBodyFitLayout xwBodyFitLayout) { public BodyAppRelayoutTable(XCreator xCreator) {
super(); this.xCreator = xCreator;
setDesigner(xwBodyFitLayout);
} }
public static ArrayList<PropertyGroup> getCreatorPropertyGroup(XCreator source) { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
ArrayList<PropertyGroup> groups = new ArrayList<PropertyGroup>(); CRPropertyDescriptor[] propertyTableEditor = {
if (source instanceof XLayoutContainer) { new CRPropertyDescriptor("appRelayout", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class)
LayoutAdapter layoutAdapter = ((XLayoutContainer)source).getLayoutAdapter(); .setI18NName(Inter.getLocText("FR-Designer-App_ReLayout"))
if(layoutAdapter != null){ .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))
GroupModel m = layoutAdapter.getLayoutProperties(); };
if (m != null) { return propertyTableEditor;
groups.add(new PropertyGroup(m));
}
}
}
return groups;
} }
/** /**
@ -43,20 +42,24 @@ public class BodyAppRelayoutTable extends AbstractPropertyTable {
*/ */
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
groups = getCreatorPropertyGroup(xwBodyFitLayout); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
groups = new ArrayList<PropertyGroup>();
CRPropertyDescriptor[] propertyTableEditor = null;
try {
propertyTableEditor = supportedDescriptor();
}catch (IntrospectionException e) {
FRContext.getLogger().error(e.getMessage());
}
groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), xCreator, propertyTableEditor, designer)));
TableModel model = new BeanTableModel(); TableModel model = new BeanTableModel();
setModel(model); setModel(model);
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
TableColumn tc = this.getColumn(this.getColumnName(0));
tc.setPreferredWidth(30);
this.repaint(); this.repaint();
} }
private void setDesigner(XWBodyFitLayout xwBodyFitLayout) {
this.xwBodyFitLayout = xwBodyFitLayout;
}
/** /**
* 单元格tooltip * 单元格tooltip
@ -78,6 +81,6 @@ public class BodyAppRelayoutTable extends AbstractPropertyTable {
* 待说明 * 待说明
*/ */
public void firePropertyEdit() { public void firePropertyEdit() {
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED);
} }
} }

111
designer_form/src/com/fr/design/designer/properties/BodyMobileLayoutPropertiesGroupModel.java

@ -1,111 +0,0 @@
package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
import com.fr.form.ui.container.WFitLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class BodyMobileLayoutPropertiesGroupModel implements GroupModel {
private PropertyCellEditor reLayoutEditor;
private CheckBoxCellRenderer reLayoutrenderer;
private WFitLayout layout;
private XWFitLayout xfl;
public BodyMobileLayoutPropertiesGroupModel(XWFitLayout xfl) {
this.xfl = xfl;
this.layout = xfl.toData();
reLayoutrenderer = new CheckBoxCellRenderer();
reLayoutEditor = new PropertyCellEditor(new BooleanEditor());
}
@Override
public String getGroupName() {
return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout");
}
@Override
public int getRowCount() {
return 1;
}
@Override
public TableCellRenderer getRenderer(int row) {
return reLayoutrenderer;
}
@Override
public TableCellEditor getEditor(int row) {
return reLayoutEditor;
}
@Override
public Object getValue(int row, int column) {
if (column == 0) {
return Inter.getLocText("FR-Designer-App_ReLayout");
}else {
return layout.getAppRelayout();
}
}
@Override
public boolean setValue(Object value, int row, int column) {
int state = 0;
boolean appRelayoutState = true;
if(value instanceof Integer) {
state = (Integer)value;
}else if (value instanceof Boolean) {
appRelayoutState = (boolean)value;
}
if (column == 0 || state < 0) {
return false;
} else {
layout.setAppRelayout(appRelayoutState);
return true;
}
}
/**
* 是否可编辑
* @param row
* @return
*/
@Override
public boolean isEditable(int row) {
return true;
}
private class CheckBoxCellRenderer extends UICheckBox implements TableCellRenderer {
public CheckBoxCellRenderer() {
super();
setOpaque(true);
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value instanceof Boolean) {
setSelected(((Boolean) value).booleanValue());
setEnabled(table.isCellEditable(row, column));
if (isSelected) {
setBackground(table.getSelectionBackground());
setForeground(table.getSelectionForeground());
} else {
setForeground(table.getForeground());
setBackground(table.getBackground());
}
} else {
return null;
}
return this;
}
}
}

8
designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java

@ -1,7 +1,7 @@
package com.fr.design.designer.properties.mobile; package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWBodyFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.BodyAppRelayoutTable; import com.fr.design.designer.properties.BodyAppRelayoutTable;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
@ -14,13 +14,13 @@ public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator; private XCreator xCreator;
public BodyMobilePropertyUI(XWBodyFitLayout xWBodyFitLayout) { public BodyMobilePropertyUI(XWFitLayout xwFitLayout) {
this.xCreator = xWBodyFitLayout; this.xCreator = xwFitLayout;
} }
@Override @Override
public AbstractPropertyTable createWidgetAttrTable() { public AbstractPropertyTable createWidgetAttrTable() {
return new BodyAppRelayoutTable((XWBodyFitLayout) xCreator); return new BodyAppRelayoutTable(xCreator);
} }
@Override @Override

Loading…
Cancel
Save