Browse Source

Merge branch 'release/10.0' into final/10.0

# Conflicts:
#	designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
final/10.0
jeo 5 years ago
parent
commit
74038a86e7
  1. 15
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 5
      designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java
  3. 6
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java
  4. 21
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java
  5. 163
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  6. 2
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  7. 16
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  8. 8
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  9. 6
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  10. 5
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  11. 2
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  12. 77
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java
  13. 25
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java
  14. 2
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  15. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  16. 10
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  17. 17
      designer-base/src/main/java/com/fr/env/LocalEnvPane.java
  18. BIN
      designer-base/src/main/resources/com/fr/design/images/dialog/watermark/watermark_background_en.png
  19. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_en.png
  20. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_en.png
  21. 51
      designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java
  22. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  23. 1
      designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java
  24. 29
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java
  25. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  26. 9
      designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java
  27. 20
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  28. 3
      designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java
  29. 24
      designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java
  30. 11
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java
  31. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java
  32. 29
      designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java
  33. 20
      designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java
  34. 81
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java
  35. 5
      designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java
  36. 3
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  37. 46
      designer-realize/src/test/java/com.fr/design/mainframe/alphafine/AlphaFineHelperTest.java
  38. 66
      designer-realize/src/test/java/com/fr/design/widget/WidgetDefinePaneFactoryTest.java

15
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -24,6 +24,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogFormatter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.SupportLocale;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.general.xml.GeneralXMLTools;
@ -116,7 +117,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private Color paginationLineColor = Color.black; // line color of paper
private boolean supportCellEditorDef = false;
private boolean isDragPermited = false;
private Locale language = Locale.getDefault();
private Locale language = checkLocale(Locale.getDefault());
//2014-8-26默认显示全部, 因为以前的版本, 虽然是false, 实际上是显示所有表, 因此这边要兼容
private boolean useOracleSystemSpace = true;
private int cachingTemplateLimit = CACHINGTEMPLATE_LIMIT;
@ -1316,7 +1317,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String tmpVal;
if ((tmpVal = reader.getElementValue()) != null) {
if (!CommonUtils.isNumber(tmpVal)) {
setLanguage(CommonUtils.stringToLocale(tmpVal));
setLanguage(checkLocale(CommonUtils.stringToLocale(tmpVal)));
} else {
// 用于兼容10.0之前的版本
int value = Integer.parseInt(tmpVal);
@ -1365,6 +1366,16 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
}
/**
* 对国际化进行校验
* 非简繁英日韩的默认环境 设计器全部默认为英文版本
* @param locale
* @return
*/
private Locale checkLocale(Locale locale) {
return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US;
}
private void readReportLengthUnit(XMLableReader reader) {
String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {

5
designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java

@ -7,6 +7,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.TargetComponent;
import com.fr.general.IOUtils;
import javax.swing.KeyStroke;
import java.awt.event.KeyEvent;
@ -25,13 +26,13 @@ public class CutAction extends TemplateComponentAction {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setEnabled(!DesignModeContext.isBanCopyAndCut());
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
return DesignModeContext.doPaste(getEditingComponent());
return DesignModeContext.doCut(getEditingComponent());
}
}

6
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java

@ -1,6 +1,5 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -11,7 +10,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
/**
@ -51,9 +50,6 @@ public class AlphaFineAction extends UpdateAction {
final AlphaFineConfigPane alphaFineConfigPane = new AlphaFineConfigPane();
final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (!FRContext.isChineseEnv()) {
manager.setSearchOnLine(false);
}
alphaFineConfigPane.populate(manager);
DialogActionListener dialogActionListener = new DialogActionAdapter() {
public void doOk() {

21
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java

@ -189,23 +189,34 @@ public class AlphaFineConfigPane extends BasicPane {
}
public void populate(AlphaFineConfigManager alphaFineConfigManager) {
this.enabledCheckbox.setSelected(alphaFineConfigManager.isEnabled());
this.searchOnlineCheckbox.setEnabled(FRContext.isChineseEnv());
boolean enabled4Locale = FRContext.isChineseEnv();
this.searchOnlineCheckbox.setEnabled(enabled4Locale);
this.searchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine());
this.containActionCheckbox.setSelected(alphaFineConfigManager.isContainAction());
this.containTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate());
this.containFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent());
this.containDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine());
this.containDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.containDocumentCheckbox.setEnabled(enabled4Locale);
this.containPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine());
this.containPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.containPluginCheckbox.setEnabled(enabled4Locale);
this.containRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine());
this.containRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.containRecommendCheckbox.setEnabled(enabled4Locale);
this.shortcutsField.setText(getDisplayShortCut(alphaFineConfigManager.getShortcuts()));
this.needSegmentationCheckbox.setSelected(alphaFineConfigManager.isNeedSegmentationCheckbox());
this.needIntelligentCustomerService.setSelected(alphaFineConfigManager.isNeedIntelligentCustomerService() && alphaFineConfigManager.isSearchOnLine());
this.needIntelligentCustomerService.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.needIntelligentCustomerService.setEnabled(enabled4Locale);
shortCutKeyStore = convert2KeyStroke(alphaFineConfigManager.getShortcuts());
}

163
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -3,13 +3,19 @@
*/
package com.fr.design.constants;
import com.fr.base.BaseUtils;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Stroke;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
/**
@ -17,19 +23,19 @@ 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 Icon CPT_ICON = IOUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = IOUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Image APPFIT_V0 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png");
public static final Image APPFIT_V1 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");
public static final Image APPFIT_V2 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png");
public static final Image APPFIT_V3 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png");
public static final Image APPFIT_V4 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V4.png");
public static final Image APPFIT_H0 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png");
public static final Image APPFIT_H1 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png");
public static final Image APPFIT_H2 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png");
public static final Image APPFIT_H3 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png");
public static final Image APPFIT_H4 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png");
public static final Image APPFIT_V0 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png");
public static final Image APPFIT_V1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");
public static final Image APPFIT_V2 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png");
public static final Image APPFIT_V3 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png");
public static final Image APPFIT_V4 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V4.png");
public static final Image APPFIT_H0 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png");
public static final Image APPFIT_H1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png");
public static final Image APPFIT_H2 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png");
public static final Image APPFIT_H3 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png");
public static final Image APPFIT_H4 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0);
@ -45,15 +51,15 @@ public interface UIConstants {
* Cell default cursor.
*/
public static final Cursor CELL_DEFAULT_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/cell_default.png"),
IOUtils.readImage("/com/fr/base/images/cell/cursor/cell_default.png"),
new Point(16, 16), "CellDefaultCursor");
public static final Cursor DRAW_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/cursor_draw.png"),
IOUtils.readImage("/com/fr/base/images/cell/cursor/cursor_draw.png"),
new Point(16, 16), "DrawCursor");
public static final Cursor FORMAT_BRUSH_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/brush_cursor0.png"),
IOUtils.readImage("/com/fr/base/images/cell/cursor/brush_cursor0.png"),
new Point(16, 16), "formatBrushCursor");
/**
@ -140,63 +146,64 @@ public interface UIConstants {
public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_LIGHT = BaseUtils.readImage("com/fr/design/images/control/bar-light.png");
public static final BufferedImage ARROW_NORTH = BaseUtils.readImage("com/fr/design/images/control/up_arrow.png");
public static final BufferedImage ARROW_SOUTH = BaseUtils.readImage("com/fr/design/images/control/down_arrow.png");
public static final BufferedImage ARROW_EAST = BaseUtils.readImage("com/fr/design/images/control/east_arrow.png");
public static final BufferedImage ARROW_WEST = BaseUtils.readImage("com/fr/design/images/control/west_arrow.png");
public static final BufferedImage DRAG_BAR_RIGHT = BaseUtils.readImage("com/fr/design/images/control/barm.png");
public static final BufferedImage DRAG_BAR_LEFT = BaseUtils.readImage("com/fr/design/images/control/barl.png");
public static final BufferedImage DRAG_UP_NORMAL = BaseUtils.readImage("com/fr/design/images/control/upnor.png");
public static final BufferedImage DRAG_UP_PRESS = BaseUtils.readImage("com/fr/design/images/control/uppre.png");
public static final BufferedImage DRAG_DOWN_NORMAL = BaseUtils.readImage("com/fr/design/images/control/downnor.png");
public static final BufferedImage DRAG_DOWN_PRESS = BaseUtils.readImage("com/fr/design/images/control/downpre.png");
public static final BufferedImage DRAG_RIGHT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/rightnor.png");
public static final BufferedImage DRAG_RIGHT_PRESS = BaseUtils.readImage("com/fr/design/images/control/rightpre.png");
public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png");
public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png");
public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_LINE = BaseUtils.readImage("com/fr/design/images/control/dot-line.png");
public static final BufferedImage ACCESSIBLE_EDITOR_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final BufferedImage WATERMARK_BACKGROUND = BaseUtils.readImage("/com/fr/design/images/dialog/watermark/watermark_background.png");
public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png");
public static final BufferedImage ARROW_NORTH = IOUtils.readImage("com/fr/design/images/control/up_arrow.png");
public static final BufferedImage ARROW_SOUTH = IOUtils.readImage("com/fr/design/images/control/down_arrow.png");
public static final BufferedImage ARROW_EAST = IOUtils.readImage("com/fr/design/images/control/east_arrow.png");
public static final BufferedImage ARROW_WEST = IOUtils.readImage("com/fr/design/images/control/west_arrow.png");
public static final BufferedImage DRAG_BAR_RIGHT = IOUtils.readImage("com/fr/design/images/control/barm.png");
public static final BufferedImage DRAG_BAR_LEFT = IOUtils.readImage("com/fr/design/images/control/barl.png");
public static final BufferedImage DRAG_UP_NORMAL = IOUtils.readImage("com/fr/design/images/control/upnor.png");
public static final BufferedImage DRAG_UP_PRESS = IOUtils.readImage("com/fr/design/images/control/uppre.png");
public static final BufferedImage DRAG_DOWN_NORMAL = IOUtils.readImage("com/fr/design/images/control/downnor.png");
public static final BufferedImage DRAG_DOWN_PRESS = IOUtils.readImage("com/fr/design/images/control/downpre.png");
public static final BufferedImage DRAG_RIGHT_NORMAL = IOUtils.readImage("com/fr/design/images/control/rightnor.png");
public static final BufferedImage DRAG_RIGHT_PRESS = IOUtils.readImage("com/fr/design/images/control/rightpre.png");
public static final BufferedImage DRAG_LEFT_NORMAL = IOUtils.readImage("com/fr/design/images/control/leftnor.png");
public static final BufferedImage DRAG_LEFT_PRESS = IOUtils.readImage("com/fr/design/images/control/leftpre.png");
public static final BufferedImage DRAG_DOT = IOUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_LINE = IOUtils.readImage("com/fr/design/images/control/dot-line.png");
public static final BufferedImage ACCESSIBLE_EDITOR_DOT = IOUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = IOUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = IOUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = IOUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final BufferedImage WATERMARK_BACKGROUND = IOUtils.readImage("/com/fr/design/images/dialog/watermark/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WaterMark_Background_Icon_File_Name"));
public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
public static final Icon ARROW_UP_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png");
public static final Icon YES_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon EDIT_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editn.png");
public static final Icon EDIT_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editp.png");
public static final Icon HIDE_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hiden.png");
public static final Icon HIDE_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hidep.png");
public static final Icon VIEW_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewn.png");
public static final Icon VIEW_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewp.png");
public static final Icon RUN_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/run24.png");
public static final Icon RUN_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/runs.png");
public static final Icon PAGE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pageb24.png");
public static final Icon WRITE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writeb24.png");
public static final Icon ANA_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anab24.png");
public static final Icon PAGE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pages.png");
public static final Icon WRITE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writes.png");
public static final Icon ANA_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anas.png");
public static final Icon REFRESH_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/refresh.png");
public static final Icon FONT_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png");
public static final Icon HISTORY_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/history.png");
public static final Icon DELETE_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/close.png");
public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.png");
public static final Icon SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/search.png");
public static final Icon BLACK_SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/black_search.png");
public static final Icon CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit_white.png");
public static final Icon ARROW_DOWN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
public static final Icon ARROW_UP_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png");
public static final Icon YES_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon EDIT_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editn.png");
public static final Icon EDIT_PRESSED_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editp.png");
public static final Icon HIDE_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/hiden.png");
public static final Icon HIDE_PRESSED_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/hidep.png");
public static final Icon VIEW_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/viewn.png");
public static final Icon VIEW_PRESSED_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/viewp.png");
public static final Icon RUN_BIG_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/run24.png");
public static final Icon RUN_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/runs.png");
public static final Icon PAGE_BIG_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/pageb24.png");
public static final Icon WRITE_BIG_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/writeb24.png");
public static final Icon ANA_BIG_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/anab24.png");
public static final Icon PAGE_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/pages.png");
public static final Icon WRITE_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/writes.png");
public static final Icon ANA_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/anas.png");
public static final Icon REFRESH_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/refresh.png");
public static final Icon FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png");
public static final Icon HISTORY_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/history.png");
public static final Icon DELETE_ICON = IOUtils.readIcon("com/fr/design/images/m_file/close.png");
public static final Icon EDIT_ICON = IOUtils.readIcon("com/fr/design/images/m_file/edit.png");
public static final Icon SEARCH_ICON = IOUtils.readIcon("/com/fr/design/images/data/search.png");
public static final Icon BLACK_SEARCH_ICON = IOUtils.readIcon("/com/fr/design/images/data/black_search.png");
public static final Icon CLEAR_ICON = IOUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = IOUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = IOUtils.readIcon("/com/fr/design/images/control/edit_white.png");
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233);
@ -205,10 +212,10 @@ public interface UIConstants {
public static final int BUTTON_GROUP_ARC = 0;
public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");
public static final Icon CLOSE_OF_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close.png");
public static final Icon CLOSE_OVER_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_over.png");
public static final Icon CLOSE_PRESS_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_press.png");
public static final Icon PREVIEW_DOWN = IOUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");
public static final Icon CLOSE_OF_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close.png");
public static final Icon CLOSE_OVER_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close_over.png");
public static final Icon CLOSE_PRESS_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close_press.png");
public static final int CLOSE_AUTHORITY_HEIGHT_AND_WIDTH = 24;

2
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -129,7 +129,7 @@ public abstract class BasicPane extends JPanel {
* @param dimension 自定义尺寸
* @return 对话框
*/
protected BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) {
public BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);

16
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -206,5 +206,21 @@ public class PluginOperateUtils {
return pluginInfo.toString();
}
public static String getSwitchedInfo(PluginTaskResult result) {
StringBuilder pluginInfo = new StringBuilder();
List<PluginTaskResult> pluginTaskResults = result.asList();
for (PluginTaskResult pluginTaskResult : pluginTaskResults) {
PluginTask pluginTask = pluginTaskResult.getCurrentTask();
if (pluginTask == null) {
continue;
}
PluginMarker pluginMarker = pluginTask.getToMarker();
PluginContext pluginContext = PluginManager.getContext(pluginMarker);
if (pluginContext != null && pluginContext.getSelfState() == 1) {
pluginInfo.append("\n").append(pluginContext.getSwitchedReason());
}
}
return pluginInfo.toString();
}
}

8
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -12,6 +12,7 @@ import com.fr.general.IOUtils;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants;
@ -301,10 +302,9 @@ public class WebViewDlgHelper {
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update") + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
httpClient.asGet();
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
String text = httpClient.getResponseText();
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update");
if (url != null) {
String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
JSONObject resultJSONObject = new JSONObject(text);
String isLatest = resultJSONObject.optString("result");
if (!ComparatorUtils.equals(isLatest, LATEST)) {

6
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -36,10 +36,12 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
@Override
public void done(PluginTaskResult result) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
String switchedInfo = PluginOperateUtils.getSwitchedInfo(result);
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success"));
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) {
int rv = JOptionPane.showOptionDialog(
null,

5
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java

@ -35,9 +35,10 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback {
protected void allDone(PluginTaskResult result) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
String switchedInfo = PluginOperateUtils.getSwitchedInfo(result);
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success"));
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){
int rv = JOptionPane.showOptionDialog(
null,

2
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -263,9 +263,9 @@ public class HistoryTemplateListCache implements CallbackEvent {
JTemplate<?, ?> template = iterator.next();
String tPath = template.getPath();
if (isDir ? tPath.startsWith(path) : tPath.equals(path)) {
int size = getHistoryCount();
iterator.remove();
int index = iterator.nextIndex();
int size = getHistoryCount();
if (size == index + 1 && index > 0) {
//如果删除的是后一个Tab,则定位到前一个
MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1);

77
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java

@ -0,0 +1,77 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.mainframe.App;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* Created by alex sung on 2019/7/23.
*/
public class FileNodeConstants {
private static List<String> supportFileType;
private static ReadWriteLock rwl = new ReentrantReadWriteLock();
private FileNodeConstants() {
}
static {
initSupportedTypes();
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent pluginEvent) {
initSupportedTypes();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext pluginContext) {
return pluginContext.contain(PluginModule.ExtraDesign);
}
});
}
private static void addAppExtensions(String[] extensions) {
for (int i = 0, size = extensions.length; i < size; i++) {
if (!supportFileType.contains(extensions[i])) {
supportFileType.add(extensions[i]);
}
}
}
private static void initSupportedTypes() {
try {
rwl.writeLock().lock();
supportFileType = new ArrayList<>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes()));
//通过插件扩展的
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App app : apps) {
addAppExtensions(app.defaultExtensions());
}
} finally {
rwl.writeLock().unlock();
}
}
public static String[] getSupportFileTypes() {
try {
rwl.readLock().lock();
return supportFileType.toArray(new String[0]);
} finally {
rwl.readLock().unlock();
}
}
}

25
designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java

@ -1,10 +1,11 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.BaseUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.project.ProjectConstants;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import javax.swing.JTree;
@ -29,7 +30,8 @@ import java.util.Stack;
* File Tree.
*/
public class JFileTree extends AbstractFileTree {
protected FileFilter fileFilter;
private FileFilter fileFilter;
public JFileTree() {
this(null);
@ -68,11 +70,11 @@ public class JFileTree extends AbstractFileTree {
DefaultMutableTreeNode rootTreeNode = (DefaultMutableTreeNode) defaultTreeModel.getRoot();
rootTreeNode.removeAllChildren();
for (int k = 0; k < rootFiles.length; k++) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode(new RootFile(rootFiles[k]));
for (File rootFile : rootFiles) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode(new RootFile(rootFile));
rootTreeNode.add(node);
if (rootFiles[k].isDirectory()) {
if (rootFile.isDirectory()) {
node.add(new DefaultMutableTreeNode(Boolean.TRUE));
}
}
@ -93,6 +95,7 @@ public class JFileTree extends AbstractFileTree {
this.fileFilter = fileFilter;
}
@Nullable
public File getSelectedFile() {
TreePath selectedTreePath = this.getSelectionPath();
if (selectedTreePath == null) {
@ -140,7 +143,7 @@ public class JFileTree extends AbstractFileTree {
File rootFile = rootLocalFile.getFile();
// 是父子关系,开始找孩子.
if (AbstractFileTree.isParentFile(rootFile, currentFile)) {
Stack nameStack = new Stack(); // 将所有的名字加入Stack.
Stack<String> nameStack = new Stack<>(); // 将所有的名字加入Stack.
while (true) {
if (ComparatorUtils.equals(rootFile, currentFile)) {
break;
@ -153,7 +156,7 @@ public class JFileTree extends AbstractFileTree {
}
DefaultMutableTreeNode curChildTreeNode = rootChildTreeNode;
while (!nameStack.isEmpty()) {
String name = (String) nameStack.pop();
String name = nameStack.pop();
this.expandTreeNode(curChildTreeNode);
for (int j = 0; j < curChildTreeNode.getChildCount(); j++) {
DefaultMutableTreeNode tmpChildTreeNode =
@ -198,9 +201,8 @@ public class JFileTree extends AbstractFileTree {
if (files == null) {
return new FileDirectoryNode[0];
}
List fileNodeList = new ArrayList();
for (int k = 0; k < files.length; k++) {
File tmpFile = files[k];
List<FileDirectoryNode> fileNodeList = new ArrayList<>();
for (File tmpFile : files) {
// 文件属性为隐藏的话 不放入列表
if (tmpFile.isHidden()) {
continue;
@ -256,7 +258,7 @@ public class JFileTree extends AbstractFileTree {
// 得到本地tree图标
Icon tmpIcon = view.getSystemIcon(currentFile);
if (currentFile.isDirectory() && fBuf.length() > 0) {
tmpIcon = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png");
tmpIcon = IOUtils.readIcon("/com/fr/design/images/gui/folder.png");
}
this.setIcon(tmpIcon);
this.setName(null);
@ -299,6 +301,7 @@ public class JFileTree extends AbstractFileTree {
*/
@Override
public int compare(FileDirectoryNode v1, FileDirectoryNode v2) {
//noinspection Duplicates
if (v1.isDirectory()) {
if (v2.isDirectory()) {
return v1.getName().toLowerCase().compareTo(v2.getName().toLowerCase());

2
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -228,7 +228,7 @@ public class TemplateFileTree extends EnvFileTree {
if (fileNodes == null) {
fileNodes = new FileNode[0];
}
Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes()));
Arrays.sort(fileNodes, new FileNodeComparator(FileNodeConstants.getSupportFileTypes()));
return fileNodes;
}

4
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -532,7 +532,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
String oldName = fnf.getName();
String suffix = fnf.isDirectory() ? StringUtils.EMPTY : oldName.substring(oldName.lastIndexOf(CoreConstants.DOT), oldName.length());
oldName = oldName.replace(suffix, StringUtils.EMPTY);
oldName = StringUtils.replaceLast(oldName, suffix, StringUtils.EMPTY);
this.setLayout(new BorderLayout());
this.setModal(true);
@ -651,7 +651,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
String oldName = fnf.getName();
String suffix = fnf.isDirectory() ? StringUtils.EMPTY : oldName.substring(oldName.lastIndexOf(CoreConstants.DOT), oldName.length());
oldName = oldName.replaceAll(suffix, StringUtils.EMPTY);
oldName = StringUtils.replaceLast(oldName, suffix, StringUtils.EMPTY);
// 输入为空或者没有修改
if (ComparatorUtils.equals(userInput, oldName)) {

10
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -1,6 +1,5 @@
package com.fr.design.report.fit.menupane;
import com.fr.base.BaseUtils;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -8,18 +7,17 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.report.fit.FitProvider;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.KeyStroke;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
/**
* Created by Administrator on 2015/7/6 0006.
*/
public class ReportFitAttrAction extends JTemplateAction {
private static final Dimension MEDIUM = new Dimension(430, 400);
private static final MenuKeySet REPORT_FIT_ATTR = new MenuKeySet() {
@Override
public char getMnemonic() {
@ -67,7 +65,7 @@ public class ReportFitAttrAction extends JTemplateAction {
}
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/reportfit/fit.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/reportfit/fit.png"));
}
/**
@ -75,6 +73,7 @@ public class ReportFitAttrAction extends JTemplateAction {
*
* @param e 事件
*/
@Override
public void actionPerformed(ActionEvent e) {
final JTemplate jwb = getEditingComponent();
if (jwb == null) {
@ -93,14 +92,13 @@ public class ReportFitAttrAction extends JTemplateAction {
private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) {
attrPane.populateBean(fitAttr);
UIDialog dialog = attrPane.showUnsizedWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportFitAttr(attrPane.updateBean());
jwb.fireTargetModified();
}
});
dialog.setSize(MEDIUM);
dialog.setVisible(true);
}

17
designer-base/src/main/java/com/fr/env/LocalEnvPane.java vendored

@ -6,9 +6,9 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.filetree.JFileTree;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.filter.OnlyShowDirectoryFileFilter;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
@ -33,8 +33,9 @@ public class LocalEnvPane extends BasicBeanPane<LocalDesignerWorkspaceInfo> {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(northPane, BorderLayout.NORTH);
northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST);
northPane.add(pathTextField = new UITextField(), BorderLayout.CENTER);
northPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST);
pathTextField = new UITextField();
northPane.add(pathTextField, BorderLayout.CENTER);
// 删除选择文件按钮 添加JFileTree
@ -54,19 +55,23 @@ public class LocalEnvPane extends BasicBeanPane<LocalDesignerWorkspaceInfo> {
@Override
public void valueChanged(TreeSelectionEvent e) {
pathTextField.setText(localEnvTree.getSelectedFile().getPath());
File selectFile = localEnvTree.getSelectedFile();
if (selectFile == null) {
return;
}
pathTextField.setText(selectFile.getPath());
}
});
UITextArea description = new UITextArea();
centerPane.add(description, BorderLayout.SOUTH);
description.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Env_Des1"));
description.setText(Toolkit.i18nText("Fine-Design_Basic_Env_Des1"));
description.setEditable(false);
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location");
return Toolkit.i18nText("Fine-Design_Basic_Location");
}
@Override

BIN
designer-base/src/main/resources/com/fr/design/images/dialog/watermark/watermark_background_en.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_en.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_en.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

51
designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java

@ -0,0 +1,51 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.extension.FileExtension;
import com.fr.base.io.BaseBook;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.mainframe.AbstractAppProvider;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILE;
import com.fr.stable.fun.mark.Mutable;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
/**
* Created by alex sung on 2019/7/25.
*/
public class FileNodeConstantsTest {
@Test
public void supportFileTypesTest(){
ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class);
Set<Mutable> apps = new HashSet<Mutable>(){{add(new MockCptxApp());}};
EasyMock.expect(extra.getArray(App.MARK_STRING)).andReturn(apps).anyTimes();
EasyMock.replay(extra);
Assert.assertEquals(1, extra.getArray(App.MARK_STRING).size());
App app = (App) extra.getArray(App.MARK_STRING).iterator().next();
Assert.assertEquals("cptx", app.defaultExtensions()[0]);
}
private class MockCptxApp extends AbstractAppProvider{
@Override
public String[] defaultExtensions() {
return new String[] {FileExtension.CPTX.getExtension()};
}
@Override
public JTemplate openTemplate(FILE tplFile) {
return null;
}
@Override
public BaseBook asIOFile(FILE tplFile) {
return null;
}
}
}

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -20,7 +20,6 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient;
import com.fr.geojson.helper.GEOJSONHelper;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.base.ViewCenter;
import com.fr.plugin.chart.map.VanChartMapPlot;
@ -576,7 +575,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
mapDataTree.changeRootNode(this.getRootNode());
if(samePlotChange) {
String nodePath = GEOJSONHelper.getDefaultJSONURL();
String nodePath = ChartGEOJSONHelper.getDefaultJSONURL();
mapPlot.setGeoUrl(nodePath);
mapDataTree.setSelectNodePath(nodePath);
selectTreePath = mapDataTree.getSelectionPath();

1
designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java

@ -56,6 +56,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
for (String selectedRole : selectedArray) {
for (Widget widget : widgets) {
widget.changeVisibleAuthorityState(selectedRole, widgetVisible.isSelected());
widgetAvailable.setEnabled(widgetVisible.isSelected());
}
}
doAfterAuthority();

29
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java

@ -1,16 +1,20 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import java.awt.Component;
public class ButtonGroupDictPane extends JPanel {
@ -26,16 +30,23 @@ public class ButtonGroupDictPane extends JPanel {
*
*/
public void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.columnLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":");
UILabel dictLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"));
this.columnLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":", dictLabel.getPreferredSize().width);
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{adaptiveCheckbox, columnLabel, columnSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = {
new Component[] {adaptiveCheckbox, null},
new Component[] {columnLabel, columnSpinner},
};
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(jPanel);
}

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -19,6 +19,7 @@ import com.fr.design.mainframe.MobileWidgetListPane;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.ui.container.WParameterLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter;
import com.fr.log.FineLoggerFactory;
@ -87,9 +88,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).size() != 0) {
tipLabel = null;
} else {
if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).isEmpty()) {
((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue());
}
Component[][] components = new Component[][]{
@ -127,10 +126,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
@Override
public void mouseClicked(MouseEvent e) {
try {
//todo 添加对应插件下载地址
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("plugin.download")));
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("plugin.mobile.style")));
} catch (Exception exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
}
}
@Override

9
designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java

@ -24,6 +24,7 @@ import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -34,6 +35,7 @@ import java.awt.event.ActionListener;
public class BiasTextPainterCellEditor extends AbstractCellEditor {
private BiasTextPainterPane biasTextPainterPane = null;
private static final double MULTIPLE = 1.5;
/**
* Constructor.
@ -84,8 +86,10 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
Window parentWindow = SwingUtilities.getWindowAncestor(grid);
this.biasTextPainterPane = new BiasTextPainterPane();
Dimension dimension = this.biasTextPainterPane.getPreferredSize();
Dimension wrapDimension = new Dimension((int) (dimension.width * MULTIPLE), (int) (dimension.height * MULTIPLE));
this.biasTextPainterPane.populate(biasTextPainter);
return this.biasTextPainterPane.showSmallWindow(parentWindow, new DialogActionAdapter() {
return this.biasTextPainterPane.showWindowWithCustomSize(parentWindow, new DialogActionAdapter() {
@Override
public void doOk() {
@ -96,7 +100,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
public void doCancel() {
BiasTextPainterCellEditor.this.fireEditingCanceled();
}
});
}, wrapDimension);
}
public static class BiasTextPainterPane extends BasicPane {
@ -142,7 +146,6 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
group.add(choice2);
choicePane.add(choice1);
// choicePane.add(new UILabel(" "));
choicePane.add(choice2);
centerPane.add(choicePane, BorderLayout.SOUTH);

20
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -15,6 +15,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.general.GeneralContext;
import com.fr.general.ProcessCanceledException;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSON;
@ -34,6 +35,25 @@ public class AlphaFineHelper {
private static AlphaFineDialog alphaFineDialog;
private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com";
private AlphaFineHelper() {
}
/**
* 根据国际化调整配置
*/
public static void switchConfig4Locale() {
AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (!GeneralContext.isChineseEnv()) {
manager.setSearchOnLine(false);
manager.setContainDocument(false);
manager.setContainPlugin(false);
manager.setContainRecommend(false);
manager.setNeedIntelligentCustomerService(false);
}
}
/**
* 弹出alphafine搜索面板
*/

3
designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -62,8 +62,7 @@ public class CellElementEditPane extends BasicPane {
@Override
public void tabChanged(int index) {
card.show(center, paneList.get(index).title4PopupWindow());
paneList.get(index).populateBean(cellelement, ePane);// 设置面板变了,也要populate
paneList.get(index).addAttributeChangeListener(listener);
populate(ePane);
if (titleChangeListener != null) {
titleChangeListener.fireTitleChange(getSelectedTabName());
}

24
designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

@ -1,6 +1,5 @@
package com.fr.design.report;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.border.UITitledBorder;
@ -15,14 +14,27 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.report.stable.WorkSheetAttr;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -87,6 +99,7 @@ public class ReportColumnsPane extends BasicPane{
};
onOffButtonGroup = new UIButtonGroup(textArray) {
@Override
protected void initButton(UIToggleButton labelButton) {
labelButton.setSize(new Dimension(60,20));
labelButton.setPreferredSize(new Dimension(60, 20));
@ -190,7 +203,7 @@ public class ReportColumnsPane extends BasicPane{
JPanel sampleLablePane = new JPanel(new GridLayout(1,2));
sampleLablePane.setPreferredSize(new Dimension(524, 130));
JPanel rPane = new JPanel();
UILabel rLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Icon_File_Name")));
UILabel rLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Icon_File_Name")));
rLabel.setBorder(BorderFactory.createEmptyBorder(5,45,0,49));
rPane.add(rLabel);
rowButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Horizontally"));
@ -198,7 +211,7 @@ public class ReportColumnsPane extends BasicPane{
rPane.add(rowButton);
sampleLablePane.add(rPane);
JPanel cPane = new JPanel();
UILabel cLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/col.png"));
UILabel cLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Col_Icon_File_Name")));
cLabel.setBorder(BorderFactory.createEmptyBorder(5,49,0,49));
cPane.add(cLabel);
colButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Vertically"));
@ -552,6 +565,7 @@ public class ReportColumnsPane extends BasicPane{
/**
* 判断输入是否合法
*/
@Override
public void checkValid() throws Exception {
String repeatText = repeatColDataTextField.getText().trim();
if(StringUtils.isEmpty(repeatText)){

11
designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java

@ -35,6 +35,7 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.util.List;
/**
* 新的拖拽ToolBar button以实现自定义工具栏 报表web设置那儿的.应该不叫ToolBarDragPane因为实际没有提供drag功能
@ -225,6 +226,16 @@ public class ToolBarDragPane extends WidgetToolBarPane {
public void setAllEnabled(boolean b) {
GUICoreUtils.setEnabled(this, b);
isEnabled = b;
removeAllListener(northToolBar.getToolBarButtons());
}
private void removeAllListener(List<ToolBarButton> toolBarButtons) {
for (ToolBarButton button : toolBarButtons) {
button.setEnabled(isEnabled);
if (!isEnabled) {
button.removeMouseListener(button);
}
}
}
/**

2
designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java

@ -122,8 +122,8 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
choseComboBox.removeItemListener(itemListener);
choseComboBox.setSelectedIndex(SERVER_SET);
choseComboBox.addItemListener(itemListener);
checkEnabled(false);
populateServerSettings();
checkEnabled(false);
return;
}
// 模板设置

29
designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java

@ -48,6 +48,7 @@ import com.fr.report.web.button.write.AppendRowButton;
import com.fr.report.web.button.write.DeleteRowButton;
import com.fr.stable.bridge.BridgeMark;
import com.fr.stable.bridge.StableFactory;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.Map;
@ -60,7 +61,9 @@ import java.util.Map;
* Time : 上午11:17
*/
public class WidgetDefinePaneFactory {
private static Map<Class<? extends Widget>, Appearance> defineMap = new HashMap<Class<? extends Widget>, Appearance>();
private static Map<Class<? extends Widget>, Appearance> pluginDefineMap = ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap();
static {
defineMap.put(NumberEditor.class, new Appearance(NumberEditorDefinePane.class, WidgetConstants.NUMBER + ""));
@ -91,24 +94,32 @@ public class WidgetDefinePaneFactory {
defineMap.put(AppendRowButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(DeleteRowButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(TreeNodeToggleButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap());
}
private WidgetDefinePaneFactory() {
}
@Nullable
public static RN createWidgetDefinePane(Widget widget, Operator operator) {
Appearance dn = defineMap.get(widget.getClass());
DataModify<Widget> definePane = null;
try {
definePane = (DataModify) dn.getDefineClass().newInstance();
definePane.populateBean(widget);
operator.did(definePane.dataUI(), dn.getDisplayName());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
// 再走一遍插件。
if (dn == null) {
dn = pluginDefineMap.get(widget.getClass());
}
if (dn != null) {
DataModify<Widget> definePane = null;
try {
definePane = (DataModify) dn.getDefineClass().newInstance();
definePane.populateBean(widget);
operator.did(definePane.dataUI(), dn.getDisplayName());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return new RN(definePane, dn.getDisplayName());
}
return new RN(definePane, dn.getDisplayName());
return null;
}
public static class RN {

20
designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java

@ -18,6 +18,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup;
@ -42,23 +43,28 @@ public class ButtonGroupDictPane extends JPanel {
adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
adaptiveCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
}
});
this.columnLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":");
UILabel dictLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"));
this.columnLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":", dictLabel.getPreferredSize().width);
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p, f};
Component[][] n_components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane, null},
{adaptiveCheckbox, columnLabel, columnSpinner}
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = {
new Component[] {dictLabel, dictPane},
new Component[] {adaptiveCheckbox, null},
new Component[] {columnLabel, columnSpinner}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel);

81
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -32,11 +32,20 @@ import com.fr.stable.ColumnRowGroup;
import com.fr.stable.StringUtils;
import com.fr.write.DMLConfigJob;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
public class SmartInsertDBManipulationPane extends DBManipulationPane {
private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1);
@ -115,6 +124,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*
* @param evt 事件对象
*/
@Override
public void actionPerformed(ActionEvent evt) {
BasicPane bPane = new BasicPane() {
@Override
@ -131,6 +141,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
double f = TableLayout.FILL;
bPane.add(TableLayoutHelper.createTableLayoutPane(coms, new double[]{p, p}, new double[]{p, f}), BorderLayout.NORTH);
BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this), new DialogActionAdapter() {
@Override
public void doOk() {
int row_offset = ((Number) rowSpinner.getValue()).intValue();
int column_offset = ((Number) columnSpinner.getValue()).intValue();
@ -177,6 +188,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*
* @param evt 事件s
*/
@Override
public void actionPerformed(ActionEvent evt) {
showCellWindow(false);
}
@ -192,6 +204,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*
* @param e 事件s
*/
@Override
public void actionPerformed(ActionEvent e) {
showCellWindow(true);
}
@ -268,6 +281,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*
* @throws Exception
*/
@Override
public void checkValid() throws Exception {
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel();
int cnt = model.getRowCount();
@ -294,6 +308,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 单元格组要记录下之前的选中情况
private CellSelection oriCellSelection = null;
private List<String> newAdd = new ArrayList<String>();
private List<String> oldAdd = new ArrayList<String>();
public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) {
this(model, actionReportPane, false);
}
@ -347,6 +365,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*
* @throws Exception
*/
@Override
public void checkValid() throws Exception {
SmartInsertDBManipulationPane.this.checkValid();
}
@ -402,19 +421,21 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少
ColumnRowGroup add = new ColumnRowGroup();
int removeCount = 0;
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) {
removeCount = dealDragSelection(add, cellselection);
dealDragSelection(add, cellselection, newValue);
} else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection);
} else {
add.addColumnRow(ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()));
ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
String allColumnRow = columnRow.toString();
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}
}
if (add.getSize() > 0) {
newValue.addAll(add);
} else if (removeCount > 0) {
newValue.splice(newValue.getSize() - removeCount, removeCount);
}
kcv.cv.obj = newValue;
@ -424,6 +445,32 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
oriCellSelection = cellselection;
}
private void dealDragSelection(ColumnRowGroup add, CellSelection cellselection, ColumnRowGroup newValue) {
int c = cellselection.getColumn();
int cs = cellselection.getColumnSpan();
int r = cellselection.getRow();
int rs = cellselection.getRowSpan();
String allColumnRow = newValue.toString();
newAdd.clear();
for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) {
ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j);
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}
newAdd.add(columnRow.toString());
}
}
int oldSize = oldAdd.size();
int newSize = newAdd.size();
if (oldSize > newSize && oldAdd.containsAll(newAdd)) {
int diff = oldSize - newSize;
newValue.splice(newValue.getSize() - diff, diff);
}
oldAdd.clear();
oldAdd.addAll(newAdd);
}
private ColumnRowGroup getColumnRowGroupValue(Object oriValue) {
ColumnRowGroup newValue = new ColumnRowGroup();
if (oriValue instanceof ColumnRowGroup) {
@ -438,26 +485,6 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow();
}
private int dealDragSelection(ColumnRowGroup add, CellSelection cellselection) {
int removeCount = 0;
if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() + 1) {
for (int i = 0; i < cellselection.getColumnSpan(); i++) {
add.addColumnRow(ColumnRow.valueOf(
cellselection.getColumn() + i, cellselection.getRow() + cellselection.getRowSpan() - 1));
}
} else if (cellselection.getRowSpan() == oriCellSelection.getRowSpan() - 1) {
removeCount = cellselection.getColumnSpan();
} else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() + 1) {
for (int i = 0; i < cellselection.getRowSpan(); i++) {
add.addColumnRow(ColumnRow.valueOf(
cellselection.getColumn() + cellselection.getColumnSpan() - 1, cellselection.getRow() + i));
}
} else if (cellselection.getColumnSpan() == oriCellSelection.getColumnSpan() - 1) {
removeCount = cellselection.getRowSpan();
}
return removeCount;
}
private void dealSelectColRow(ColumnRowGroup add, CellSelection se) {
int c = se.getColumn(), cs = se.getColumnSpan(),
r = se.getRow(), rs = se.getRowSpan();

5
designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java

@ -136,6 +136,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
* @date 2014-11-24-下午3:48:19
*/
public void resetSelectionAndChooseState() {
boolean chooseBlock = designer.isChooseBlock();
designer.setChooseType(SelectionType.INNER);
if (DesignerMode.isAuthorityEditing()) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
@ -167,7 +168,9 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
conditionAttributesGroupPane.populate(editComponent);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
if (chooseBlock) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR);
}
}
// 超级链接

3
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -47,6 +47,7 @@ import com.fr.design.mainframe.InformationCollector;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.bbs.BBSGuestPane;
import com.fr.design.mainframe.bbs.UserInfoPane;
import com.fr.design.mainframe.form.FormECCompositeProvider;
@ -134,6 +135,7 @@ public class DesignerActivator extends Activator {
DesignerSocketIO.update();
UserInfoPane.getInstance().updateBBSUserInfo();
storePassport();
AlphaFineHelper.switchConfig4Locale();
}
private void loadLogAppender() {
@ -413,4 +415,3 @@ public class DesignerActivator extends Activator {
DesignerSocketIO.close();
}
}

46
designer-realize/src/test/java/com.fr/design/mainframe/alphafine/AlphaFineHelperTest.java

@ -0,0 +1,46 @@
package com.fr.design.mainframe.alphafine;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.general.GeneralContext;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.junit.Assert.*;
@RunWith(PowerMockRunner.class)
public class AlphaFineHelperTest {
@Test
@PrepareForTest({GeneralContext.class, DesignerEnvManager.class})
@SuppressStaticInitializationFor("com.fr.design.mainframe.alphafine.AlphaFineHelper")
public void testSwitchConfig4Locale() throws Exception {
PowerMock.mockStatic(GeneralContext.class);
EasyMock.expect(GeneralContext.isChineseEnv()).andReturn(true).times(1).andReturn(false).times(1);
DesignerEnvManager manager = EasyMock.mock(DesignerEnvManager.class);
EasyMock.expect(manager.getAlphaFineConfigManager()).andReturn(new AlphaFineConfigManager()).anyTimes();
EasyMock.replay(manager);
PowerMock.mockStatic(DesignerEnvManager.class);
EasyMock.expect(DesignerEnvManager.getEnvManager()).andReturn(manager).anyTimes();
PowerMock.replayAll();
AlphaFineHelper.switchConfig4Locale();
AlphaFineConfigManager config = manager.getAlphaFineConfigManager();
Assert.assertEquals(true, config.isSearchOnLine());
AlphaFineHelper.switchConfig4Locale();
Assert.assertEquals(false, config.isSearchOnLine());
}
}

66
designer-realize/src/test/java/com/fr/design/widget/WidgetDefinePaneFactoryTest.java

@ -0,0 +1,66 @@
package com.fr.design.widget;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.widget.ui.ButtonDefinePane;
import com.fr.form.ui.Button;
import com.fr.form.ui.Widget;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.HashMap;
import java.util.Map;
@RunWith(PowerMockRunner.class)
@PowerMockIgnore("javax.swing.*")
public class WidgetDefinePaneFactoryTest {
@Test
@PrepareForTest({ExtraDesignClassManager.class, WidgetDefinePaneFactory.class})
public void testCreateWidgetDefinePane() throws Exception {
Map<Class<? extends Widget>, Appearance> map = new HashMap<>();
ExtraDesignClassManager mockDesignManager = EasyMock.mock(ExtraDesignClassManager.class);
EasyMock.expect(mockDesignManager.getCellWidgetOptionsMap()).andReturn(map).anyTimes();
EasyMock.replay(mockDesignManager);
PowerMock.mockStatic(ExtraDesignClassManager.class);
EasyMock.expect(ExtraDesignClassManager.getInstance()).andReturn(mockDesignManager).anyTimes();
PowerMock.replayAll(ExtraDesignClassManager.class);
Button mockWidget = EasyMock.mock(Button.class);
EasyMock.replay(mockWidget);
ButtonDefinePane mockPane = EasyMock.mock(ButtonDefinePane.class);
mockPane.populateBean(EasyMock.anyObject(Button.class));
EasyMock.expectLastCall();
EasyMock.replay(mockPane);
Operator mockOperator = EasyMock.mock(Operator.class);
mockOperator.did(EasyMock.anyObject(DataCreatorUI.class), EasyMock.anyString());
EasyMock.replay(mockOperator);
WidgetDefinePaneFactory.RN rn1 = WidgetDefinePaneFactory.createWidgetDefinePane(mockWidget, mockOperator);
Assert.assertNull(rn1);
Appearance appearance = new Appearance(ButtonDefinePane.class, "test");
map.put(mockWidget.getClass(), appearance);
WidgetDefinePaneFactory.RN rn2 = WidgetDefinePaneFactory.createWidgetDefinePane(mockWidget, mockOperator);
Assert.assertNotNull(rn2);
map.clear();
WidgetDefinePaneFactory.RN rn3 = WidgetDefinePaneFactory.createWidgetDefinePane(mockWidget, mockOperator);
Assert.assertNull(rn3);
}
}
Loading…
Cancel
Save