Browse Source

Merge branch 'release' of http://www.finedevelop.com:2015/scm/~xiaoxia/design into release

master
xiaoxia 8 years ago
parent
commit
651c390ef7
  1. 6
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  2. 18
      designer_base/src/com/fr/design/data/BasicTableDataTreePane.java
  3. 3
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  4. 37
      designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
  5. 23
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  6. 2
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  7. 13
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  8. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  9. 3
      designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java
  10. 2
      designer_form/src/com/fr/design/mainframe/FormDesigner.java

6
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -61,11 +61,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.getRegComboBox().addActionListener(new ActionListener() { regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
if (!StringUtils.isNotEmpty(regExp.toRegText())) { getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable());
getRegErrorMsgTextField().setEnabled(false);
} else {
getRegErrorMsgTextField().setEnabled(true);
}
} }
}); });

18
designer_base/src/com/fr/design/data/BasicTableDataTreePane.java

@ -118,7 +118,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
if (StringUtils.isBlank(tempName)) { if (StringUtils.isBlank(tempName)) {
nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"})); nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"}));
dg.setButtonEnabled(false); dg.setButtonEnabled(false);
} else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName, allDSNames)) { } else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName)) {
String[] waring = new String[]{"DS-TableData", "Utils-has_been_existed", "PLEASE", "Rename"}; String[] waring = new String[]{"DS-TableData", "Utils-has_been_existed", "PLEASE", "Rename"};
String[] sign = new String[]{tempName, ",", "", "!"}; String[] sign = new String[]{tempName, ",", "", "!"};
nPanel.setShowText(Inter.getLocText(waring, sign)); nPanel.setShowText(Inter.getLocText(waring, sign));
@ -324,20 +324,22 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
private String createDsName(String prefix) { private String createDsName(String prefix) {
int count = 1; int count = 1;
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
while (isDsNameRepeaded(prefix + count, allDSNames)) { while (isDsNameRepeaded(prefix + count)) {
count++; count++;
} }
return prefix + count; return prefix + count;
} }
private boolean isDsNameRepeaded(String name, String[] names) { protected boolean isDsNameRepeaded(String name) {
boolean repeat = false; if (allDSNames == null) {
for (int i = 0; i < names.length; i++) { allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
if (ComparatorUtils.equals(name, names[i])) { }
repeat = true; for (int i = 0; i < allDSNames.length; i++) {
if (ComparatorUtils.equals(name, allDSNames[i])) {
return true;
} }
} }
return repeat; return false;
} }
protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) { protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) {

3
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -276,13 +276,14 @@ public class TableDataTreePane extends BasicTableDataTreePane {
* @param tableDataSource 数据集 * @param tableDataSource 数据集
*/ */
public void addTableData(String srcName, TableDataSource tableDataSource) { public void addTableData(String srcName, TableDataSource tableDataSource) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook(); TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator(); Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next(); String tdName = (String) tdIterator.next();
TableData td = tableDataSource.getTableData(tdName); TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName; tdName = srcName + tdName;
} }
int i = 0; int i = 0;

37
designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java

@ -23,6 +23,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.Arrays;
public class TreeSettingPane extends BasicPane implements DataCreatorUI { public class TreeSettingPane extends BasicPane implements DataCreatorUI {
private JTreeControlPane controlPane; private JTreeControlPane controlPane;
@ -133,7 +134,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
for (LayerConfig layerConfig : layerConfigList) { for (LayerConfig layerConfig : layerConfigList) {
layerConfigs[i++] = layerConfig; layerConfigs[i++] = layerConfig;
} }
this.layerDataControlPane.populate(new NameObject("tree", layerConfigs)); this.layerDataControlPane.populate(new NameObject("Tree Layer Data", layerConfigs));
} else { } else {
buildBox.setSelectedIndex(2); buildBox.setSelectedIndex(2);
} }
@ -154,10 +155,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
te.setAutoBuild(true); te.setAutoBuild(true);
te.setLayerBuild(false);
te.setDictionary(dictionary); te.setDictionary(dictionary);
te.setNodeOrDict(dictionary); te.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else if (buildBox.getSelectedIndex() == 2) {
te.setAutoBuild(false); te.setAutoBuild(false);
te.setLayerBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
@ -174,6 +177,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
te.setNodeOrDict(editor.getTreeNodeAttr()); te.setNodeOrDict(editor.getTreeNodeAttr());
te.setPerformanceFirst(editor.isPerformanceFirst()); te.setPerformanceFirst(editor.isPerformanceFirst());
} }
} else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
te.setAutoBuild(false);
te.setLayerBuild(true);
te.setLayerConfigs(Arrays.asList(configs));
} }
return te; return te;
} }
@ -206,15 +214,17 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
tcb.setAutoBuild(true); tcb.setAutoBuild(true);
tcb.setDictionary(dictionary); tcb.setLayerBuild(false);
tcb.setNodeOrDict(dictionary); tcb.setDictionary(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { tcb.setNodeOrDict(dictionary);
tcb.setAutoBuild(false); } else if (buildBox.getSelectedIndex() == 2) {
NameObject no = this.controlPane.update(); tcb.setAutoBuild(false);
if (no != null) { tcb.setLayerBuild(false);
if (no.getObject() instanceof TreeComboBoxEditor) { NameObject no = this.controlPane.update();
return (TreeComboBoxEditor) no.getObject(); if (no != null) {
} if (no.getObject() instanceof TreeComboBoxEditor) {
return (TreeComboBoxEditor) no.getObject();
}
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
tcb.setAllowBlank(editor.isAllowBlank()); tcb.setAllowBlank(editor.isAllowBlank());
@ -230,7 +240,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
tcb.setNodeOrDict(editor.getTreeNodeAttr()); tcb.setNodeOrDict(editor.getTreeNodeAttr());
tcb.setPerformanceFirst(editor.isPerformanceFirst()); tcb.setPerformanceFirst(editor.isPerformanceFirst());
} }
} }else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
tcb.setAutoBuild(false);
tcb.setLayerBuild(true);
tcb.setLayerConfigs(Arrays.asList(configs));
}
return tcb; return tcb;
} }

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

@ -138,8 +138,31 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单 // 添加帮助菜单
menuList.add(createHelpMenuDef()); menuList.add(createHelpMenuDef());
// 添加社区菜单
addCommunityMenuDef(menuList);
return menuList.toArray(new MenuDef[menuList.size()]); return menuList.toArray(new MenuDef[menuList.size()]);
} }
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){
Locale locale = FRContext.getLocale();
Locale [] locales =supportCommunityLocales();
for(int i = 0; i < locales.length; i++) {
if(locale.equals(locales[i])){
menuList.add(createCommunityMenuDef());
break;
}
}
}
public Locale[] supportCommunityLocales() {
return new Locale[]{
Locale.CHINA,
Locale.JAPAN,
Locale.TAIWAN,
Locale.US,
};
}
public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) { public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) {
// 给菜单加插件入口 // 给菜单加插件入口

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

@ -485,7 +485,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
extraChartDesignInterfaceList.add(tagName); extraChartDesignInterfaceList.add(tagName);
} }
if (IndependentChartUIProvider.XML_TAG.equals(tagName)) { if (IndependentChartUIProvider.XML_TAG.equals(tagName)) {
addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("priority", ChartTypeManager.CHART_PRIORITY),reader.getAttrAsString("plotID", ""), simplify); addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("priority", ChartTypeManager.DEFAULT_PRIORITY),reader.getAttrAsString("plotID", ""), simplify);
} }
} }
} }

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

@ -27,13 +27,22 @@ import java.util.Iterator;
* Time : 上午9:16 * Time : 上午9:16
*/ */
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> { public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
protected Plot plot;
public DataSeriesConditionPane(Plot plot) {
public DataSeriesConditionPane() { this.plot = plot;
initAvailableActionList(); initAvailableActionList();
initComponents(); initComponents();
} }
public void setPlot(Plot plot) {
this.plot = plot;
}
public DataSeriesConditionPane() {
this(null);
}
private void initAvailableActionList() { private void initAvailableActionList() {
addBasicAction(); addBasicAction();
addAxisPositionAction(); addAxisPositionAction();

2
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -432,7 +432,7 @@ public class ChartDatapointLabelPane extends BasicPane{
this.percentFormatPane = new FormatPane(); this.percentFormatPane = new FormatPane();
} }
if(this.percentFormat == null){ if(this.percentFormat == null){
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%"); DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%");
percentFormatPane.populateBean(defaultFormat); percentFormatPane.populateBean(defaultFormat);
this.percentFormat = defaultFormat; this.percentFormat = defaultFormat;
} }

3
designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java

@ -21,6 +21,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.general.ComparatorUtils;
public class WidgetPropertyTable extends AbstractPropertyTable { public class WidgetPropertyTable extends AbstractPropertyTable {
@ -71,7 +72,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
if (size == 0 || size == 1) { if (size == 0 || size == 1) {
XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection() XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection()
.getSelectedCreator(); .getSelectedCreator();
if (designer.isRoot(creator)) { if (ComparatorUtils.equals(creator, designer.getRootComponent())) {
groups = designer.getDesignerMode().createRootDesignerPropertyGroup(); groups = designer.getDesignerMode().createRootDesignerPropertyGroup();
} else { } else {
groups = getCreatorPropertyGroup(designer, creator); groups = getCreatorPropertyGroup(designer, creator);

2
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -853,7 +853,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isRoot(XCreator comp) { public boolean isRoot(XCreator comp) {
return comp == rootComponent; return comp == rootComponent || comp.acceptType(XWAbsoluteBodyLayout.class);
} }
// 计算鼠标事件e所发生的位置相对根组件的位置关系 // 计算鼠标事件e所发生的位置相对根组件的位置关系

Loading…
Cancel
Save