Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
mengao 7 years ago
parent
commit
d115f4a5ba
  1. 5
      designer/src/com/fr/design/actions/cell/CellAttributeAction.java
  2. 2
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  3. 6
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  4. 11
      designer/src/com/fr/design/widget/ValueWidgetPane.java
  5. 4
      designer/src/com/fr/design/widget/WidgetEventPane.java
  6. 25
      designer/src/com/fr/design/widget/WidgetEventPaneNoPop.java
  7. 17
      designer/src/com/fr/design/widget/WidgetManageCardPane.java
  8. 6
      designer/src/com/fr/design/widget/WidgetPane.java
  9. 33
      designer/src/com/fr/grid/selection/CellSelection.java
  10. 1
      designer_base/src/com/fr/design/constants/UIConstants.java
  11. 12
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  12. 22
      designer_base/src/com/fr/design/extra/PluginUtils.java
  13. 2
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  14. 28
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  15. 32
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  16. 11
      designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java
  17. 6
      designer_base/src/com/fr/design/menu/KeySetUtils.java
  18. 5
      designer_base/src/com/fr/start/BaseDesigner.java
  19. 35
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  20. 2
      designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java
  21. 30
      designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java
  22. 4
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  23. 5
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  24. 7
      designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java
  25. 3
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  26. 6
      designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java
  27. 20
      designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java
  28. 9
      designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java
  29. 69
      designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java
  30. 7
      designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java

5
designer/src/com/fr/design/actions/cell/CellAttributeAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
@ -9,9 +10,9 @@ import com.fr.general.Inter;
public class CellAttributeAction extends CellAttributeTableAction {
public CellAttributeAction() {
this.setMenuKeySet(KeySetUtils.CELL_OTHER_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
// this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
}
@Override

2
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -17,7 +17,7 @@ public class HyperlinkAction extends UpdateAction {
public HyperlinkAction() {
this.setMenuKeySet(KeySetUtils.HYPER_LINK);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
}

6
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -77,7 +77,7 @@ public class CellWidgetCardPane extends BasicPane {
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList();
eventPane = new WidgetEventPane(pane);
eventPane = initWidgetEventPane(pane);
eventTabPane.add(eventPane, BorderLayout.CENTER);
//k
center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
@ -111,6 +111,10 @@ public class CellWidgetCardPane extends BasicPane {
paneList.add(eventPane);
}
protected WidgetEventPane initWidgetEventPane(ElementCasePane pane){
return new WidgetEventPane(pane);
}
@Override
protected String title4PopupWindow() {
return "Widget";

11
designer/src/com/fr/design/widget/ValueWidgetPane.java

@ -42,6 +42,17 @@ public class ValueWidgetPane extends WidgetPane {
return jPanel;
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){
return new WidgetManageCardPane(pane);
}
/**
* 初始化所有事件.
*/
public void initAllListeners() {
}
@Override
public void populate(Widget widget) {
super.populate(widget);

4
designer/src/com/fr/design/widget/WidgetEventPane.java

@ -67,6 +67,10 @@ public class WidgetEventPane extends ObjectUIControlPane {
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane;
// 反射会用到
public WidgetEventListenerUpdatePane() {
this(null);
}
public WidgetEventListenerUpdatePane(ElementCasePane epane){
this.epane = epane;
super.initComponents();

25
designer/src/com/fr/design/widget/WidgetEventPaneNoPop.java

@ -0,0 +1,25 @@
package com.fr.design.widget;
import com.fr.design.mainframe.ElementCasePane;
import java.awt.*;
/**
* 没有悬浮弹窗的控件事件编辑面板
* Created by plough on 2017/8/28.
*/
public class WidgetEventPaneNoPop extends WidgetEventPane {
public WidgetEventPaneNoPop(ElementCasePane ePane) {
super(ePane);
}
@Override
protected boolean isNewStyle() {
return false;
}
@Override
protected void popupEditDialog(Point mousePos) {
// no pop, do nothing
}
}

17
designer/src/com/fr/design/widget/WidgetManageCardPane.java

@ -0,0 +1,17 @@
package com.fr.design.widget;
import com.fr.design.mainframe.ElementCasePane;
/**
* Created by kerry on 2017/8/29.
*/
public class WidgetManageCardPane extends CellWidgetCardPane{
public WidgetManageCardPane(ElementCasePane pane) {
super(pane);
}
protected WidgetEventPane initWidgetEventPane(ElementCasePane pane){
return new WidgetEventPaneNoPop(pane);
}
}

6
designer/src/com/fr/design/widget/WidgetPane.java

@ -61,7 +61,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane);
cellEditorCardPane = initWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
}
@ -81,6 +81,10 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
return jPanel;
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){
return new CellWidgetCardPane(pane);
}
protected JPanel createContentPane() {
return new JPanel();
}

33
designer/src/com/fr/grid/selection/CellSelection.java

@ -36,6 +36,7 @@ import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
import javax.swing.*;
@ -242,10 +243,10 @@ public class CellSelection extends Selection {
}
FU [] columnWidth = new FU[columnSpan];
FU [] rowHeight = new FU[rowSpan];
for(int i = 0; i < columnSpan; i++){
for (int i = 0; i < columnSpan; i++){
columnWidth[i] = ec.getColumnWidth(this.column + i);
}
for(int j = 0; j < rowSpan; j++){
for (int j = 0; j < rowSpan; j++){
rowHeight[j] = ec.getRowHeight(this.row + j);
}
transferable.addObject(new CellElementsClip(this.columnSpan, this.rowSpan, columnWidth, rowHeight, list.toArray(new TemplateCellElement[list.size()])));
@ -257,6 +258,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteCellElementsClip(CellElementsClip ceClip, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
CellSelection cs = ceClip.pasteAt(ec, column, row);
@ -273,6 +275,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteString(String str, ElementCasePane ePane) {
// 主要需要处理Excel当中的类型.
// Excel 的剪贴板格式
@ -297,7 +300,7 @@ public class CellSelection extends Selection {
ec.setCellValue(column + c, row + r, number);
} else {
// alex:对于100,000,000这种数值,先做一个取巧的解决方法
String newStr = Utils.replaceAllString(lineTextArray[c], ",", "");
String newStr = Utils.replaceAllString(lineTextArray[c], ",", StringUtils.EMPTY);
number = Utils.string2Number(newStr);
if (number != null) {
ec.setCellValue(column + c, row + r, Utils.string2Number(newStr));
@ -320,6 +323,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteOtherType(Object ob, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -341,6 +345,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 是则返回true
*/
@Override
public boolean canMergeCells(ElementCasePane ePane) {
return !this.isSelectedOneCell(ePane);
@ -351,6 +356,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean mergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -373,6 +379,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 是则返回true
*/
@Override
public boolean canUnMergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -393,6 +400,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean unMergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -434,9 +442,10 @@ public class CellSelection extends Selection {
popup.add(new CleanAuthorityAction(ePane).createMenuItem());
return popup;
}
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
popup.add(new EditCellAction(ePane).createMenuItem());
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
// richer:add global style menu
popup.add(new CellExpandAttrAction().createMenuItem());
if (!ConfigManager.getProviderInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
@ -455,13 +464,12 @@ public class CellSelection extends Selection {
} else {
popup.add(new StyleAction().createMenuItem());
}
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置
popup.add(new CellWidgetAttrAction().createMenuItem());
}
popup.add(new CellExpandAttrAction().createMenuItem());
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem());
popup.add(new ConditionAttributesAction().createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste
@ -483,17 +491,18 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean clear(Clear type, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
boolean isClear = true;
int cellRectangleCount = getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) {
isClear = clearCell(type, ec, rect);
isClear = hasclearCell(type, ec, rect);
}
return isClear;
}
private boolean clearCell(Clear type, TemplateElementCase ec, int rect) {
private boolean hasclearCell(Clear type, TemplateElementCase ec, int rect) {
List<CellElement> removeElementList = new ArrayList<CellElement>();
Rectangle cellRectangle = getCellRectangle(rect);
column = cellRectangle.x;
@ -541,6 +550,8 @@ public class CellSelection extends Selection {
((TemplateCellElement) element).setWidget(null);
}
break;
default:
break;
}
return true;
}
@ -608,6 +619,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean triggerDeleteAction(ElementCasePane ePane) {
final TemplateElementCase ec = ePane.getEditingElementCase();
final RowColumnPane rcPane = new RowColumnPane();
@ -638,6 +650,7 @@ public class CellSelection extends Selection {
* @param cr 行列
* @return 包含返回true
*/
@Override
public boolean containsColumnRow(ColumnRow cr) {
return new Rectangle(column, row, columnSpan, rowSpan).contains(cr.column, cr.row);
}
@ -678,7 +691,7 @@ public class CellSelection extends Selection {
if (cellElement != null && b) {
value = cellElement.getValue();
}
value = value == null ? "" : value;
value = value == null ? StringUtils.EMPTY : value;
//之前是少了个bigInteger,刚kunsnat又发现少了个bigDecimal,数字类型的都用stringEditor,没必要那个样子
QuickEditor editor = ActionFactory.getCellEditor((value instanceof Number) ? (Number.class) : (value.getClass()));
if (editor == null) {

1
designer_base/src/com/fr/design/constants/UIConstants.java

@ -17,6 +17,7 @@ import java.awt.image.BufferedImage;
*/
public interface UIConstants {
public static final Icon CPT_ICON = BaseUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);

12
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -140,7 +140,8 @@ public class PluginOperateUtils {
String result = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.getJSONArray("result");
jsCallback.execute(jsonArray.toString());
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(jsonArray);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -171,7 +172,8 @@ public class PluginOperateUtils {
String result = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(result);
JSONArray resultArr = resultJSONObject.getJSONArray("result");
jsCallback.execute(resultArr.toString());
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(resultArr);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -190,7 +192,9 @@ public class PluginOperateUtils {
try {
HttpClient httpClient = new HttpClient(plistUrl.toString());
String result = httpClient.getResponseText();
jsCallback.execute(result);
JSONArray jsonArray = new JSONArray(result);
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(jsonArray);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -300,4 +304,6 @@ public class PluginOperateUtils {
return pluginInfo.toString();
}
}

22
designer_base/src/com/fr/design/extra/PluginUtils.java

@ -7,6 +7,8 @@ import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONObject;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
@ -184,4 +186,24 @@ public class PluginUtils {
}
return null;
}
/**
* 在不同设计器版本下展示不同插件
* @return 插件
*/
public static JSONArray filterPluginsFromVersion(JSONArray oriJSONArray) throws Exception{
JSONArray resultJSONArray = JSONArray.create();
for(int i = 0; i < oriJSONArray.length(); i++){
JSONObject jo = oriJSONArray.getJSONObject(i);
String envVersion = jo.optString("env-version");
if(isCompatibleCurrentEnv(envVersion)){
resultJSONArray.put(jo);
}
}
return resultJSONArray;
}
private static boolean isCompatibleCurrentEnv(String envVersion){
return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion());
}
}

2
designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -77,7 +77,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
}else {
jsCallback.execute("failed");
FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Plugin_Install_Failed"), JOptionPane.ERROR_MESSAGE);
}
}
}

28
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -12,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
@ -104,6 +105,11 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
public abstract void saveSettings();
// 是否使用新样式
protected boolean isNewStyle() {
return true;
}
protected void initComponentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.creators = this.createNameableCreators();
@ -117,15 +123,19 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
UILabel selectLabel = new UILabel();
cardPane.add(selectLabel, "SELECT");
cardPane.add(controlUpdatePane, "EDIT");
popupEditDialog = new PopupEditDialog(cardPane);
// SplitPane
// JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
// mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
// mainSplitPane.setOneTouchExpandable(true);
this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 15));
// mainSplitPane.setDividerLocation(getLeftPreferredSize());
if (isNewStyle()) {
popupEditDialog = new PopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 15));
} else {
// SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER);
mainSplitPane.setDividerLocation(getLeftPreferredSize());
}
this.checkButtonEnabled();
}

32
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -106,22 +106,24 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
});
nameableList.getModel().addListDataListener(new ListDataListener() {
@Override
public void intervalAdded(ListDataEvent e) {
saveSettings();
}
if (isNewStyle()) {
nameableList.getModel().addListDataListener(new ListDataListener() {
@Override
public void intervalAdded(ListDataEvent e) {
saveSettings();
}
@Override
public void intervalRemoved(ListDataEvent e) {
saveSettings();
}
@Override
public void intervalRemoved(ListDataEvent e) {
saveSettings();
}
@Override
public void contentsChanged(ListDataEvent e) {
saveSettings();
}
});
@Override
public void contentsChanged(ListDataEvent e) {
saveSettings();
}
});
}
}
public UINameEdList createJNameList() {
@ -388,7 +390,7 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
private void popupEditDialog(Point mousePos) {
protected void popupEditDialog(Point mousePos) {
Rectangle currentCellBounds = nameableList.getCellBounds(editingIndex, editingIndex);
if (editingIndex < 0 || !currentCellBounds.contains(mousePos)) {
return;

11
designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java

@ -24,6 +24,7 @@ import java.awt.event.ActionListener;
public class UINameableListCellRenderer extends
JPanel implements ListCellRenderer {
private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
private static final Color BORDER_COLOR = new Color(201, 198, 184);
@ -49,7 +50,7 @@ public class UINameableListCellRenderer extends
return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH);
}
};
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
editButton.setIcon(listControlPane.isNewStyle() ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON);
editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
editButton.setHorizontalAlignment(SwingConstants.CENTER);
label = new UILabel();
@ -91,13 +92,17 @@ public class UINameableListCellRenderer extends
setBackground(bg == null ? list.getSelectionBackground() : bg);
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.WHITE);
editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON);
if (listControlPane.isNewStyle()) {
editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON);
}
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
label.setForeground(initialLabelForeground);
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
if (listControlPane.isNewStyle()) {
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
}
}
setText((value == null) ? "" : value.toString());

6
designer_base/src/com/fr/design/menu/KeySetUtils.java

@ -384,7 +384,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return "EXCEL"+Inter.getLocText("FR-Designer_ExportAndOutput");
return "EXCEL" + Inter.getLocText("FR-Designer_ExportAndOutput");
}
@Override
@ -756,7 +756,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("ExpandD-Cell_Expand_Attributes");
return Inter.getLocText("FR-Designer_Expand");
}
@Override
@ -978,7 +978,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M_Format_A-Cell_Attributes");
return Inter.getLocText("FR-Designer_Other");
}
@Override

5
designer_base/src/com/fr/start/BaseDesigner.java

@ -48,6 +48,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
private Timer timer;
public BaseDesigner(String[] args) {
BuildContext.setBuildFilePath(buildPropertiesPath());
if (isDebug()) {
setDebugEnv();
}
@ -59,7 +61,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
DesignUtils.clientSend(args);
return;
}
BuildContext.setBuildFilePath(buildPropertiesPath());
//下面这两句的位置不能随便调换,因为会影响语言切换的问题
initLanguage();
@ -116,7 +117,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
private void bindGlobalListener() {
GlobalListenerProviderManager.getInstance().init();
}

35
designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -1,7 +1,6 @@
package com.fr.design.widget;
import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.parameter.RootDesignDefinePane;
@ -53,29 +52,35 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(Button.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FormSubmitButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips")));
// if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) {
// defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
// }
defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout")));
defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout")));
defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));
defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, Inter.getLocText("FR-Designer_Para-Body")));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab"));
defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "tablayout"));
defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, "wFitLayout"));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "wCardMainBorderLayout"));
if (StableFactory.getMarkedClass(BridgeMark.CHART_EDITOR, AbstractBorderStyleWidget.class) != null) {
defineMap.put(StableFactory.getMarkedClass(BridgeMark.CHART_EDITOR, AbstractBorderStyleWidget.class), new Appearance(BorderStyleWidgetDefinePane.class, "chartEditor"));
}
defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, "wAbsoluteLayout"));
defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, "elementCaseEditor"));
defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, "wAbsoluteBodyLayout"));
defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, "wParameterLayout"));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "wCardMainBorderLayout"));
defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "wCardLayout"));
defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label"));
defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label"));
defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap());
defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "wTabFitLayout"));
//todo 添加扩展控件接口
// defineMap.putAll(getOtherWidgetOptionMap());
}
private FormWidgetDefinePaneFactoryBase() {
}
public static RN createWidgetDefinePane(XCreator creator, Widget widget, Operator operator) {
Appearance dn = defineMap.get(widget.getClass());
if(dn == null){
dn = new Appearance(DefaultWidgetDefinePane.class, "default");
}
DataModify<Widget> definePane = null;
try {
Constructor con = dn.getDefineClass().getConstructor(XCreator.class);

2
designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java

@ -13,9 +13,7 @@ import javax.swing.*;
public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements DataModify<T> {
protected XCreator creator;
public AbstractDataModify(){
}
public AbstractDataModify(XCreator xCreator){
this.creator = xCreator;
}

30
designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java

@ -0,0 +1,30 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.Widget;
/**
* Created by kerry on 2017/8/30.
*/
public class DefaultWidgetDefinePane extends AbstractDataModify<Widget> {
public DefaultWidgetDefinePane(XCreator xCreator){
super(xCreator);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
}
@Override
public String title4PopupWindow() {
return "default";
}
@Override
public void populateBean(Widget w) {
}
@Override
public Widget updateBean() {
return creator.toData();
}
}

4
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -33,10 +33,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
this.initComponents();
}
public FieldEditorDefinePane() {
this.initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
labelNameTextField = new UITextField();

5
designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -23,8 +24,8 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UICheckBox horizontalCheck;
private UICheckBox verticalCheck;
public IframeEditorDefinePane() {
this.initComponents();
public IframeEditorDefinePane(XCreator xCreator) {
super(xCreator);
}
private void initComponents() {

7
designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator;
import com.fr.form.ui.NoneWidget;
/**
@ -8,7 +9,11 @@ import com.fr.form.ui.NoneWidget;
* 用于处理没有控件的情况
*/
public class NoneWidgetDefinePane extends AbstractDataModify<NoneWidget> {
public NoneWidgetDefinePane(XCreator xCreator){
super(xCreator);
}
@Override
public String title4PopupWindow() {
return "none";

3
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -54,9 +54,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private ChangeListener minValueChangeListener;
public NumberEditorDefinePane() {
super();
}
@Override

6
designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer;
import com.fr.base.FRContext;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.Radio;
@ -11,8 +12,9 @@ import javax.swing.*;
import java.awt.*;
public class RadioDefinePane extends AbstractDataModify<Radio> {
public RadioDefinePane() {
this.iniComoponents();
public RadioDefinePane(XCreator xCreator) {
super(xCreator);
iniComoponents();
}
private void iniComoponents() {

20
designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java

@ -1,32 +1,18 @@
package com.fr.design.widget.ui.designer;
import com.fr.base.FRContext;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.NameWidget;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
public class UserEditorDefinePane extends AbstractDataModify<NameWidget> {
private NameWidget nWidget;
public UserEditorDefinePane() {
public UserEditorDefinePane(XCreator xCreator) {
super(xCreator);
this.initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel infoLabel = new UILabel();
FRFont frFont = FRContext.getDefaultValues().getFRFont();
infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24));
infoLabel.setText(Inter.getLocText(
"Widget-User_Defined_Editor") + ".");
infoLabel.setHorizontalAlignment(SwingConstants.CENTER);
this.add(infoLabel, BorderLayout.CENTER);
}
@Override

9
designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WriteUnableRepeatEditor;
@ -11,11 +12,11 @@ import java.awt.*;
public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEditor> extends FieldEditorDefinePane<WriteUnableRepeatEditor> {
// richer:是否去除重复的值
protected UICheckBox removeRepeatCheckBox;
public WriteUnableRepeatEditorPane(){
this.initComponents();
public WriteUnableRepeatEditorPane(XCreator xCreator){
super(xCreator);
}
@Override
protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();

69
designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java

@ -0,0 +1,69 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by kerry on 2017/8/29.
*/
public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBorderStyleWidget> {
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
public BorderStyleWidgetDefinePane(XCreator xCreator) {
super(xCreator);
initComponent();
}
public void initComponent() {
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), borderStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
advancePane.add(jPanel, BorderLayout.CENTER);
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane );
this.add(layoutExpandablePane, BorderLayout.CENTER);
}
@Override
public String title4PopupWindow() {
return "borderStyleWidget";
}
@Override
public void populateBean(AbstractBorderStyleWidget ob) {
borderStyleEditor.setValue(ob.getBorderStyle());
}
@Override
public AbstractBorderStyleWidget updateBean() {
AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData();
abstractBorderStyleWidget.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
return abstractBorderStyleWidget;
}
@Override
public DataCreatorUI dataUI() {
return null;
}
}

7
designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java

@ -1,7 +0,0 @@
//package com.fr.design.widget.ui.designer.layout;
//
///**
// * Created by ibm on 2017/8/7.
// */
//public class ChartEditorDefinePane extends {
//}
Loading…
Cancel
Save