Browse Source

解决冲突

master
mengao 7 years ago
parent
commit
11dfbd16d5
  1. 2
      build.performance.gradle
  2. 73
      designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
  3. 4
      designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
  4. 2
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  5. 3
      designer/src/com/fr/design/mainframe/JWorkBook.java
  6. 3
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  7. 28
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  8. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  9. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  10. 9
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  11. 3
      designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java
  12. 100
      designer/src/com/fr/design/report/ReportBackgroundPane.java
  13. 2
      designer/src/com/fr/design/report/ReportExportAttrPane.java
  14. 101
      designer/src/com/fr/design/report/VerifierListPane.java
  15. 2
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  16. 8
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  17. 7
      designer/src/com/fr/grid/IntelliElements.java
  18. 5
      designer/src/com/fr/start/Designer.java
  19. 3
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  20. 7
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  21. 5
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  22. 12
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  23. 34
      designer_base/src/com/fr/design/extra/PluginStoreConstants.java
  24. 7
      designer_base/src/com/fr/design/extra/WebViewDlgHelper.java
  25. 1
      designer_base/src/com/fr/design/gui/UILookAndFeel.java
  26. 3
      designer_base/src/com/fr/design/gui/borders/UITextFieldBorder.java
  27. 27
      designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java
  28. 17
      designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java
  29. 4
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  30. 3
      designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  31. 61
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  32. 89
      designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java
  33. 9
      designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java
  34. 5
      designer_base/src/com/fr/design/gui/ilable/UILabel.java
  35. 5
      designer_base/src/com/fr/design/gui/ilist/UINameEdList.java
  36. 47
      designer_base/src/com/fr/design/gui/ipasswordfield/UIPassWordField.java
  37. 512
      designer_base/src/com/fr/design/gui/ispinner/UISpinner.java
  38. 22
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  39. 83
      designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java
  40. 403
      designer_base/src/com/fr/design/gui/itextfield/UINumberField.java
  41. 9
      designer_base/src/com/fr/design/locale/designer.properties
  42. 17
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  43. 19
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  44. 16
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  45. 8
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  46. 18
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  47. 6
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java
  48. 3
      designer_base/src/com/fr/design/mainframe/loghandler/LogDetailPane.java
  49. 6
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  50. 4
      designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java
  51. 4
      designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java
  52. 191
      designer_base/src/com/fr/design/web/CustomIconPane.java
  53. 4
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  54. 13
      designer_chart/src/com/fr/design/chart/ChartTypePane.java
  55. 126
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  56. 45
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java
  57. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  58. 2
      designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java
  59. 61
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  60. 56
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  61. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  62. 155
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  63. 47
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  64. 347
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  65. 13
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  66. 42
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java
  67. 1
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  68. 1
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  69. 6
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  70. 2
      designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java
  71. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  72. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  73. 2
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java
  74. 33
      designer_form/src/com/fr/design/mainframe/FormArea.java
  75. 55
      designer_form/src/com/fr/design/mainframe/JForm.java

2
build.performance.gradle

@ -14,7 +14,7 @@ task appletJar<<{
fileset(dir:"${basicDir}/core/build/classes/main")
fileset(dir:"${basicDir}/chart/build/classes/main")
fileset(dir:"${basicDir}/report/build/classes/main")
fileset(dir:"${basicDir}/platform/build/classes/main")
fileset(dir:"${basicDir}/platform/build/classes/main")
}
unjar(src:"${libDir}/3rd.jar",dest:"./tmp")
unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp")

73
designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java

@ -6,24 +6,39 @@ package com.fr.design.actions.insert.flot;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.Formula;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.report.SelectImagePane;
import com.fr.general.Inter;
import com.fr.grid.Grid;
import com.fr.grid.selection.FloatSelection;
import com.fr.report.ReportHelper;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* Insert formula.
*/
public class FormulaFloatAction extends AbstractShapeAction {
public class FormulaFloatAction extends ElementCaseAction {
private boolean returnValue = false;
public FormulaFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_FORMULA);
@ -49,23 +64,6 @@ public class FormulaFloatAction extends AbstractShapeAction {
}
};
/**
* 动作
*
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
ElementCasePane jws = getEditingComponent();
if (jws == null) {
return;
}
//
FloatElement floatElement = new FloatElement(new Formula(""));
this.startDraw(floatElement);
doWithDrawingFloatElement();
jws.getGrid().startEditing();
}
private void doWithDrawingFloatElement() {
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
Grid grid = jws.getGrid();
@ -95,4 +93,43 @@ public class FormulaFloatAction extends AbstractShapeAction {
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
}
/**
* 执行动作
*
* @return 成功返回true
*/
@Override
public boolean executeActionReturnUndoRecordNeeded() {
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (reportPane == null) {
return false;
}
reportPane.stopEditing();
final FloatElement floatElement = new FloatElement();
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(new Formula(StringUtils.EMPTY));
BasicDialog dialog = formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
floatElement.setValue(formulaPane.update());
if (reportPane == null) {
return;
}
reportPane.getGrid().setDrawingFloatElement(floatElement);
doWithDrawingFloatElement();
returnValue = true;
}
@Override
public void doCancel() {
returnValue = false;
}
});
dialog.setVisible(true);
return returnValue;
}
}

4
designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java

@ -54,6 +54,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
*
* @param e 动作
*/
@Override
public void actionPerformed(ActionEvent e) {
ElementCasePane jws = getEditingComponent();
if (jws == null) {
@ -67,7 +68,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
private void doWithDrawingFloatElement() {
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
;
Grid grid = jws.getGrid();
ElementCasePane reportPane = grid.getElementCasePane();
@ -93,5 +94,6 @@ public class TextBoxFloatAction extends AbstractShapeAction {
report.addFloatElement(grid.getDrawingFloatElement());
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
reportPane.fireTargetModified();
}
}

2
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -47,7 +47,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
if (!isEditable()) {
if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
return;
}
doOnSelectionChanged(e);

3
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -92,7 +92,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
private UIModeControlContainer centerPane;
public ReportComponentComposite reportComposite;
private ParameterDefinitePane parameterPane;
private int resolution;
private int resolution = ScreenResolution.getScreenResolution();
public JWorkBook() {
super(new WorkBook(new WorkSheet()), "WorkBook");
@ -399,7 +399,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution);
polyDezi.updateUI();
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
}
@Override

3
designer/src/com/fr/design/mainframe/ReportComponentComposite.java

@ -33,6 +33,7 @@ public class ReportComponentComposite extends JComponent {
private static final int MAX = 400;
private static final int HUND = 100;
private static final int MIN = 10;
private static final int DIR = 15;
private JWorkBook parent;
private UIModeControlContainer parentContainer = null;
@ -71,7 +72,7 @@ public class ReportComponentComposite extends JComponent {
if (InputEventBaseOnOS.isControlDown(e)) {
int dir = e.getWheelRotation();
int old_resolution = (int) jSliderContainer.getShowVal().getValue();
jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN));
jSliderContainer.getShowVal().setValue(old_resolution - (dir * DIR));
}
}
};

28
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -670,6 +670,8 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.setText(null);
removeSearchResult();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
dealWithSearchResult(searchResultList.getSelectedValue());
}
}
});
@ -694,6 +696,15 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 处理搜索结果
* @param selectedValue
*/
private void dealWithSearchResult(AlphaCellModel selectedValue) {
doNavigate();
saveLocalHistory(selectedValue);
}
/**
* 当鼠标在搜索界面边界外点击时触发
*/
@ -725,6 +736,9 @@ public class AlphaFineDialog extends UIDialog {
//不处理
}
/**
* 导航到结果页面
*/
private void doNavigate() {
AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue();
@ -732,15 +746,15 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 保存本地本地常用
* 保存结果到本地本地常用
*
* @param cellModel
*/
private void saveHistory(AlphaCellModel cellModel) {
private void saveLocalHistory(AlphaCellModel cellModel) {
RecentSearchManager recentSearchManager = RecentSearchManager.getRecentSearchManger();
recentSearchManager.addRecentModel(storeText, cellModel);
recentSearchManager.saveXMLFile();
sendToServer(storeText, cellModel);
sendDataToServer(storeText, cellModel);
}
@ -750,7 +764,7 @@ public class AlphaFineDialog extends UIDialog {
* @param searchKey
* @param cellModel
*/
private void sendToServer(String searchKey, AlphaCellModel cellModel) {
private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
@ -908,8 +922,7 @@ public class AlphaFineDialog extends UIDialog {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate();
saveHistory(getSelectedValue());
dealWithSearchResult(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) {
searchTextField.requestFocus();
@ -926,8 +939,7 @@ public class AlphaFineDialog extends UIDialog {
int selectedIndex = getSelectedIndex();
AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && selectedValue.hasAction()) {
doNavigate();
saveHistory(selectedValue);
dealWithSearchResult(selectedValue);
} else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 19 KiB

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -16,6 +16,7 @@ import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
import java.util.Iterator;
import java.util.List;
@ -37,6 +38,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
@Override
public synchronized SearchResult getLessSearchResult(String searchText) {
searchText = searchText.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
this.modelList = new SearchResult();
this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {

9
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -6,15 +6,12 @@ import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.ibutton.FiveButtonLayout;
import com.fr.design.gui.style.*;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
@ -41,7 +38,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
super();
tabPane.setOneLineTab(true);
tabPane.setDrawLine(false);
tabPane.setLayout(new FiveButtonLayout(1));
tabPane.setLayout(new GridLayout(1, 3, 0, 0));
}
public static void main(String[] args) {
@ -164,8 +161,6 @@ public class CustomStylePane extends MultiTabPane<Style> {
*
*/
public void updateBean(Style ob) {
return;
}
}

3
designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -34,6 +34,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
private static final int MAX = 400;
private static final int HUND = 100;
private static final int MIN = 10;
private static final int DIR = 15;
private static final double MIN_TIME = 0.4;
public FormElementCaseDesigner elementCaseDesigner;
private BaseJForm jForm;
@ -61,7 +62,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
if (InputEventBaseOnOS.isControlDown(e)) {
int dir = e.getWheelRotation();
int old_resolution = (int) jSliderContainer.getShowVal().getValue();
jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN));
jSliderContainer.getShowVal().setValue(old_resolution - (dir * DIR));
}
}
};

100
designer/src/com/fr/design/report/ReportBackgroundPane.java

@ -1,47 +1,55 @@
package com.fr.design.report;
import java.awt.BorderLayout;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.style.background.BackgroundPane;
public class ReportBackgroundPane extends BasicPane {
private UICheckBox isPrintBackgroundCheckBox;
private BackgroundPane backgroundPane;
public ReportBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
backgroundPane = new BackgroundPane();
this.add(backgroundPane, BorderLayout.CENTER);
isPrintBackgroundCheckBox = new UICheckBox(
Inter.getLocText("ReportGUI-Print_Background"));
this.add(isPrintBackgroundCheckBox, BorderLayout.SOUTH);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"paper", "Background"});
}
/**
* Populate
*/
public void populate(ReportSettingsProvider reportSettings) {
this.backgroundPane.populate(reportSettings.getBackground());
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
}
/**
* update
*/
public void update(ReportSettingsProvider reportSettings) {
reportSettings.setBackground(this.backgroundPane.update());
reportSettings.setPrintBackground(this.isPrintBackgroundCheckBox.isSelected());
}
package com.fr.design.report;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.style.background.BackgroundPane;
public class ReportBackgroundPane extends BasicPane {
private UICheckBox isPrintBackgroundCheckBox;
private UICheckBox isExportBackgroundCheckBox;
private BackgroundPane backgroundPane;
public ReportBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
backgroundPane = new BackgroundPane();
this.add(backgroundPane, BorderLayout.CENTER);
isPrintBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Print_Background"));
isExportBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Export_Background"));
JPanel sourth = new JPanel();
sourth.add(isExportBackgroundCheckBox);
sourth.add(isPrintBackgroundCheckBox);
this.add(sourth, BorderLayout.SOUTH);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"paper", "Background"});
}
/**
* Populate
*/
public void populate(ReportSettingsProvider reportSettings) {
this.backgroundPane.populate(reportSettings.getBackground());
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
this.isExportBackgroundCheckBox.setSelected(reportSettings.isExportBackground());
}
/**
* update
*/
public void update(ReportSettingsProvider reportSettings) {
reportSettings.setBackground(this.backgroundPane.update());
reportSettings.setPrintBackground(this.isPrintBackgroundCheckBox.isSelected());
reportSettings.setExportBackground(this.isExportBackgroundCheckBox.isSelected());
}
}

2
designer/src/com/fr/design/report/ReportExportAttrPane.java

@ -31,7 +31,7 @@ public class ReportExportAttrPane extends BasicPane {
wordExportPane = new WordExportPane();
uiTabbedPane.addTab("Word", wordExportPane);
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>();
paneList = new ArrayList<AbstractExportPane>();
for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent());
paneList.add(provider.toExportPane());

101
designer/src/com/fr/design/report/VerifierListPane.java

@ -1 +1,100 @@
package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.ValueVerifier; import com.fr.report.write.WClassVerifier; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Set; /** * 校验列表 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", ValueVerifier.class, BuildInVerifierPane.class) }; Set<VerifyDefineProvider> set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING); for (VerifyDefineProvider provider : set) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", WClassVerifier.class, CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return "Verify Collections"; } public void populate(ReportWriteAttr reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List<NameObject> nameObjectList = new ArrayList<>(); int verifierCount = reportWriteAttr.getVerifierCount(); for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); nameObjectList.add(new NameObject(verifier.getName(), verifier)); } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { Verifier verifier = (Verifier) nameObject.getObject(); verifier.setName(nameObject.getName()); reportWriteAttr.addVerifier(verifier); } } } }
package com.fr.design.report;
import com.fr.data.Verifier;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.ValueVerifier;
import com.fr.report.write.WClassVerifier;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.Set;
/**
* 校验列表
*/
public class VerifierListPane extends ObjectJControlPane {
public VerifierListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{
new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}),
"/com/fr/web/images/reportlet.png",
ValueVerifier.class,
BuildInVerifierPane.class)
};
Set<VerifyDefineProvider> set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING);
for (VerifyDefineProvider provider : set) {
creators = ArrayUtils.add(creators, new NameObjectCreator(
provider.nameForVerifier(),
provider.iconPath(),
provider.classForVerifier(),
provider.appearanceForVerifier()
) {
});
}
creators = ArrayUtils.add(creators, new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "Verify"}),
"/com/fr/web/images/reportlet.png",
WClassVerifier.class,
CustomVerifierPane.class));
return creators;
}
@Override
protected String title4PopupWindow() {
return "Verify Collections";
}
public void populate(ReportWriteAttr reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
java.util.List<NameObject> nameObjectList = new ArrayList<NameObject>();
int verifierCount = reportWriteAttr.getVerifierCount();
for (int i = 0; i < verifierCount; i++) {
Verifier verifier = reportWriteAttr.getVerifier(i);
nameObjectList.add(new NameObject(verifier.getName(), verifier));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearVerifiers();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof Verifier) {
Verifier verifier = (Verifier) nameObject.getObject();
verifier.setName(nameObject.getName());
reportWriteAttr.addVerifier(verifier);
}
}
}
}

2
designer/src/com/fr/design/webattr/WriteWebSettingPane.java

@ -56,7 +56,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//sheet标签页显示位置
topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":", UILabel.LEFT);
sheetShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Sheet_Label_Page_Display_Position"), UILabel.LEFT);
ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton);

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

@ -68,7 +68,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
return;
}
List<NameObject> nameObjectList = new ArrayList<>();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
int submiterCount = reportWriteAttr.getSubmitVisitorCount();
for (int i = 0; i < submiterCount; i++) {
@ -169,8 +169,8 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
public CustomPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
customSubmitPanes = new HashMap<>();
comboItemsMap = new HashMap<>();
customSubmitPanes = new HashMap<String, BasicBeanPane>();
comboItemsMap = new HashMap<String, String>();
Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING);
addSubmitPane(new DefaultSubmit());
@ -178,7 +178,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
addSubmitPane(provider);
}
configTypes = new ArrayList<>();
configTypes = new ArrayList<String>();
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
String key = entry.getKey();
configTypes.add(comboItemsMap.get(key));

7
designer/src/com/fr/grid/IntelliElements.java

@ -194,7 +194,12 @@ public class IntelliElements {
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex);
applyStyle(newCellElement, sourceCellElement);//style
if (sourceCellElement.getValue() instanceof DSColumn) {
DSColumn dsColumn = (DSColumn) sourceCellElement.getValue();
DSColumn dsColumn = null;
try {
dsColumn = (DSColumn) ((DSColumn) sourceCellElement.getValue()).clone();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
newCellElement.setValue(dsColumn);
newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr());
} else if (sourceCellElement.getValue() instanceof Number) {

5
designer/src/com/fr/start/Designer.java

@ -1,6 +1,7 @@
package com.fr.start;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.core.ActionFactory;
@ -36,7 +37,6 @@ import com.fr.general.Inter;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.web.ServletContext;
import com.fr.stable.xml.XMLTools;
import javax.swing.*;
@ -450,7 +450,8 @@ public class Designer extends BaseDesigner {
InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime();
collector.saveXMLFile();
ServletContext.fireServletStopListener();
Env currentEnv = FRContext.getCurrentEnv();
currentEnv.doWhenServerShutDown();
}
}

3
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -25,7 +25,6 @@ import com.fr.plugin.AbstractExtraClassManager;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.solution.closeable.CloseableContainedSet;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraDesignClassManagerProvider;
import java.util.ArrayList;
@ -52,7 +51,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
}
static {
StableFactory.registerMarkedObject(PluginModule.ExtraDesign.getAgentName(), classManager);
PluginModule.registerAgent(PluginModule.ExtraDesign, classManager);
}
public TableDataNameObjectCreator[] getReportTableDataCreators() {

7
designer_base/src/com/fr/design/data/DesignTableDataManager.java

@ -36,6 +36,7 @@ import java.io.ByteArrayOutputStream;
import java.text.Collator;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
/**
* 设计器管理操作数据集的类:
@ -54,11 +55,11 @@ public abstract class DesignTableDataManager {
* 其实globalDsCache没有绝对的必要只是为了操作方便如果没有它那么每次清空服务器数据集或者存储过程的时候还要去遍历找一下
* 这个操作可能比较复杂 从减少代码复杂度的角度看还是很有必要的
*/
private static java.util.Map<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new HashMap<String, String>();
private static java.util.Map<String, TableDataWrapper> globalDsCache = new ConcurrentHashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new ConcurrentHashMap<String, String>();
// private static List<ChangeListener> dsListeners = new ArrayList<ChangeListener>();
private static Map<String, List<ChangeListener>> dsListenersMap = new HashMap<String, List<ChangeListener>>();
private static Map<String, List<ChangeListener>> dsListenersMap = new ConcurrentHashMap<String, List<ChangeListener>>();;
public static String NO_PARAMETER = "no_paramater_pane";

5
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -18,6 +18,7 @@ import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
@ -160,6 +161,10 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
@Override
public void populateBean(ClassTableData ob) {
if(StringUtils.isEmpty(ob.getClassName())) {
return;
}
this.editorPane.populate(ob.getParameters(Calculator.createCalculator()));
this.classNameTextField.setText(ob.getClassName());
}

12
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -36,8 +36,12 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override
public void itemStateChanged(ItemEvent e) {
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList();
List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems();
@ -64,7 +68,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
dsColumn.setDsName(tableDataWrappe.getTableDataName());
TableDataColumn column;
String columnExp = (String) this.columnNameComboBox.getSelectedItem();
if (StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#")) {
if (StringUtils.isNotBlank(columnExp) && checkColumnExp(columnExp)) {
String number = columnExp.substring(1);
Pattern pattern = Pattern.compile("[^\\d]");
if (pattern.matcher(number).find()) {
@ -80,6 +84,10 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
return dsColumn;
}
private boolean checkColumnExp (String columnExp) {
return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");
}
public String getIconName() {
return "ds_column";
}

34
designer_base/src/com/fr/design/extra/PluginStoreConstants.java

@ -1,34 +0,0 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import java.io.FileInputStream;
import java.util.Properties;
/**
* Created by vito on 16/4/22.
*/
public class PluginStoreConstants {
public static final String VERSION = loadAttribute("VERSION", "");
private static Properties PROP = null;
private static String loadAttribute(String key, String defaultValue) {
if (PROP == null) {
PROP = new Properties();
try {
PROP.load(new FileInputStream(StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), "scripts/store/web/plugin_store.properties")));
} catch (Exception e) {
}
}
String p = PROP.getProperty(key);
if (StringUtils.isEmpty(p)) {
p = defaultValue;
}
return p;
}
}

7
designer_base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -1,7 +1,6 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.frpane.UITabbedPane;
@ -12,6 +11,7 @@ import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject;
import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException;
import com.fr.stable.StableUtils;
@ -55,8 +55,8 @@ public class WebViewDlgHelper {
String indexPath = "index.html";
String mainIndexPath = StableUtils.pathJoin(installHome, indexPath);
checkAndCopyMainFile(mainIndexPath, mainJsPath);
updateShopScripts(SHOP_SCRIPTS);
showPluginDlg(mainIndexPath);
updateShopScripts(SHOP_SCRIPTS);
}
} else {
BasicPane traditionalStorePane = new BasicPane() {
@ -195,6 +195,7 @@ public class WebViewDlgHelper {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath));
// TODO: 2017/4/17 删除之前存放在安装目录下的script
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE);
}
} catch (InterruptedException | ExecutionException e) {
@ -209,7 +210,7 @@ public class WebViewDlgHelper {
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.VERSION);
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
httpClient.asGet();
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
String text = httpClient.getResponseText();

1
designer_base/src/com/fr/design/gui/UILookAndFeel.java

@ -171,6 +171,7 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("FormattedTextField.border", new UITextFieldBorder());
table.put("TextField.border", new UITextFieldBorder());
table.put("PasswordField.border", new UITextFieldBorder());
table.put("TextArea.border", new UITextFieldBorder());
}

3
designer_base/src/com/fr/design/gui/borders/UITextFieldBorder.java

@ -4,6 +4,7 @@
package com.fr.design.gui.borders;
import com.fr.design.constants.UIConstants;
import com.fr.design.utils.DrawRoutines;
import com.fr.design.utils.ThemeUtils;
@ -54,7 +55,7 @@ public class UITextFieldBorder extends AbstractBorder implements UIResource {
g, ThemeUtils.TEXT_BORDER_DISABLED_COLOR, x, y, w, h);
} else {
DrawRoutines.drawBorder(
g, ThemeUtils.TEXT_BORDER_COLOR, x, y, w, h);
g, UIConstants.POP_DIALOG_BORDER, x, y, w, h);
}
}
}

27
designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.js.JavaScript;
import javax.swing.*;
@ -14,7 +15,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
protected Class clazzOfObject;
protected Class clazzOfInitCase;
protected Class<? extends BasicBeanPane> clazzOfEditor;
public AbstractNameableCreator(String menuName, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.clazzOfObject = clazz;
@ -28,7 +29,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfObject = clazz;
this.clazzOfInitCase = clazz;
}
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath);
@ -36,7 +37,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfEditor = clazzOfEditor;
this.clazzOfInitCase = clazz;
}
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class clazz4Init, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath);
@ -50,7 +51,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
* get menuName
* @return
*/
public String menuName() {
public String menuName() {
return this.menuName;
}
@ -70,6 +71,14 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return this.clazzOfEditor;
}
/**
* get clazzOfObject
* @return clazzOfObject
*/
public Class <? extends JavaScript> getHyperlink() {
return this.clazzOfObject;
}
/**
*
* @param ob
@ -83,12 +92,12 @@ public abstract class AbstractNameableCreator implements NameableCreator {
doSthChanged4Icon(ob);
return ob;
}
return null;
}
protected void doSthChanged4Icon(Object ob){
}
/**
@ -99,9 +108,9 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return null;
}
public boolean isNeedParameterWhenPopulateJControlPane(){
return false;
}
public boolean isNeedParameterWhenPopulateJControlPane(){
return false;
}
public boolean equals(Object obj) {
return obj instanceof AbstractNameableCreator

17
designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java

@ -2,24 +2,27 @@ package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.js.JavaScript;
import com.fr.stable.Nameable;
import javax.swing.*;
public interface NameableCreator {
public String menuName();
public Icon menuIcon();
public String createTooltip();
public Nameable createNameable(UnrepeatedNameHelper helper);
public Class<? extends BasicBeanPane> getUpdatePane();
public Class <? extends JavaScript> getHyperlink();
public Object acceptObject2Populate(Object ob);
public void saveUpdatedBean(ListModelElement wrapper, Object bean);
public boolean isNeedParameterWhenPopulateJControlPane();
public boolean isNeedParameterWhenPopulateJControlPane();
}

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

@ -132,6 +132,10 @@ public abstract class UIListControlPane extends UIControlPane {
protected void doAfterLostFocus() {
UIListControlPane.this.updateControlUpdatePane();
}
@Override
protected void doAfterStopEditing() {
saveSettings();
}
};
nameEdList.setCellRenderer(new UINameableListCellRenderer(this));
return nameEdList;

3
designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -237,7 +237,8 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
public Dimension getPreferredSize() {
Dimension dimension = new Dimension();
dimension.height = super.getPreferredSize().height;
dimension.width = addButton.getWidth() - 2;
// 不能写死,否则出现国际化显示不全的问题
dimension.width = Math.max(addButton.getWidth() - 2, super.getPreferredSize().width);
return dimension;
}
};

61
designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -7,6 +7,7 @@ import com.fr.design.event.GlobalNameObserver;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.border.Border;
@ -28,7 +29,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
protected int selectedIndex = -1;
private List<T> objectList;// 起到一个render的作用
private GlobalNameListener globalNameListener = null;
private String buttonGroupName = "";
private String buttonGroupName = StringUtils.EMPTY;
private boolean isToolBarComponent = false;
private boolean isClick;
@ -179,34 +180,6 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
g2d.setClip(oldClip);
}
/**
* 重载Border画法
*
* @param g
*/
@Override
protected void paintBorder(Graphics g) {
if (isToolBarComponent) {
return;
}
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.SHADOW_GREY);
int width = 0;
for (int i = 0; i < labelButtonList.size() - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight();
g.drawLine(width, 0, width, height);
}
width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.BUTTON_GROUP_ARC, UIConstants.BUTTON_GROUP_ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
/**
* setSelectedItem
*
@ -369,21 +342,21 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
* @param args
*/
public static void main(String... args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
Icon[] a1 = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] a2 = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
UIButtonGroup<Integer> bb = new UIButtonGroup<Integer>(a1, a2);
bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height);
bb.setSelectedIndex(0);
bb.setEnabled(false);
content.add(bb);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
// JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(new BorderLayout());
// Icon[] a1 = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
// BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
// Integer[] a2 = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
// UIButtonGroup<Integer> bb = new UIButtonGroup<Integer>(a1, a2);
// bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height);
// bb.setSelectedIndex(0);
// bb.setEnabled(false);
// content.add(bb);
// GUICoreUtils.centerWindow(jf);
// jf.setSize(400, 400);
// jf.setVisible(true);
}

89
designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java

@ -1,12 +1,8 @@
package com.fr.design.gui.ibutton;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.*;
import javax.swing.border.Border;
import com.fr.design.constants.UIConstants;
import java.awt.*;
public class UITabGroup extends UIButtonGroup<Integer> {
private boolean isOneLineTab = false;
@ -22,7 +18,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
* @param index 序号
*/
public void tabChanged(int index) {
return;
}
public UITabGroup(Icon[] iconArray) {
@ -46,83 +42,6 @@ public class UITabGroup extends UIButtonGroup<Integer> {
}
}
@Override
protected void paintBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.LINE_COLOR);
if (!isTwoLine()) {
int width = isDrawLine ? ORIGINAL_WIDTH : 0;
for (int i = 0; i < labelButtonList.size() - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight();
g.drawLine(width, 0, width, height);
}
width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1;
if (isDrawLine) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else {
g2d.drawRect(0, 0, width, getHeight() - 1);
}
} else if (labelButtonList.size() % 2 != 0) {
paintOddNumberButtons(g, g2d);
} else {
int width = ORIGINAL_WIDTH;
int number = labelButtonList.size() / 2;
for (int i = 0; i < number - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight() * 2 + 1;
g.drawLine(width, 0, width, height);
}
width += labelButtonList.get(number - 1).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
if (isDrawLine) {
g2d.drawLine(0, getHeight() / 2, getWidth(), getHeight() / 2);
}
}
private void paintOddNumberButtons(Graphics g, Graphics2D g2d) {
int width = ORIGINAL_WIDTH;
int buttonHeight = labelButtonList.get(0).getHeight();
int upButtonCount = labelButtonList.size() / 2 + 1;
for (int i = 0; i < upButtonCount - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight() + 1;
g.drawLine(width, 0, width, height);
}
width += labelButtonList.get(upButtonCount - 1).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, buttonHeight + 1, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
int line2X = labelButtonList.get(upButtonCount).getX();
int line2Y = labelButtonList.get(upButtonCount).getY();
width = line2X;
width += labelButtonList.get(upButtonCount).getWidth();
int height = labelButtonList.get(upButtonCount).getHeight() + 1;
g.drawLine(width, line2Y, width, line2Y + height);
for (int i = upButtonCount + 1; i < labelButtonList.size() - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1;
height = labelButtonList.get(i).getHeight() + 1;
g.drawLine(width, line2Y, width, line2Y + height);
}
width += labelButtonList.get(upButtonCount).getWidth() + 1;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(line2X - 1, line2Y, width - line2X + 1, buttonHeight, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
protected boolean isTwoLine() {
return labelButtonList.size() >= BUTTON_NUMBER && !isOneLineTab;
}
public void setOneLineTab(boolean isOneLineTab) {
this.isOneLineTab = isOneLineTab;
}
@ -138,7 +57,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
@Override
protected Border getGroupBorder() {
if (!isDrawLine) {
return BorderFactory.createEmptyBorder(1, 1, 1, 1);
return BorderFactory.createEmptyBorder(0, 0, 0, 0);
}
return BorderFactory.createEmptyBorder(1, GAP, 1, GAP);
}

9
designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java

@ -13,12 +13,13 @@ import java.awt.*;
public class UIScrollPane extends JScrollPane {
private static final long serialVersionUID = 1L;
private static final int INCREAMENT = 30;
public UIScrollPane(Component c) {
super(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.setHorizontalScrollBar(createHorizontalScrollBar());
this.getVerticalScrollBar().setUnitIncrement(30);
this.getVerticalScrollBar().setBlockIncrement(30);
this.getVerticalScrollBar().setUnitIncrement(INCREAMENT);
this.getVerticalScrollBar().setBlockIncrement(INCREAMENT);
this.getHorizontalScrollBar().setOpaque(true);
this.getHorizontalScrollBar().setBackground(Color.WHITE);
this.getVerticalScrollBar().setOpaque(true);
@ -29,7 +30,7 @@ public class UIScrollPane extends JScrollPane {
/**
* 生成水平滚动条
*/
public JScrollBar createHorizontalScrollBar() {
public UIScrollBar createHorizontalScrollBar() {
UIScrollBar sbr = new UIScrollBar(JScrollBar.HORIZONTAL);
sbr.setBackground(UIConstants.NORMAL_BACKGROUND);
return sbr;
@ -39,7 +40,7 @@ public class UIScrollPane extends JScrollPane {
/**
* 生成垂直滚动条
*/
public JScrollBar createVerticalScrollBar() {
public UIScrollBar createVerticalScrollBar() {
UIScrollBar sbr = new UIScrollBar(JScrollBar.VERTICAL);
sbr.setBackground(UIConstants.NORMAL_BACKGROUND);
return sbr;

5
designer_base/src/com/fr/design/gui/ilable/UILabel.java

@ -29,6 +29,11 @@ public class UILabel extends JLabel {
super(text);
}
public UILabel(String text, boolean enable) {
super(text);
this.setEnabled(enable);
}
public UILabel(Icon image, int horizontalAlignment) {
super(image, horizontalAlignment);
}

5
designer_base/src/com/fr/design/gui/ilist/UINameEdList.java

@ -312,9 +312,14 @@ public class UINameEdList extends UIList implements CellEditorListener {
String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString();
setNameAt(name, editingIndex);
removeComp();
doAfterStopEditing();
}
}
protected void doAfterStopEditing() {
// default: do nothing
}
public String[] getAllNames() {
int length = this.getModel().getSize();
String[] names = new String[length];

47
designer_base/src/com/fr/design/gui/ipasswordfield/UIPassWordField.java

@ -1,8 +1,13 @@
package com.fr.design.gui.ipasswordfield;
import com.fr.design.constants.UIConstants;
import javax.swing.*;
import javax.swing.text.Document;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* Created with IntelliJ IDEA.
@ -12,24 +17,56 @@ import javax.swing.text.Document;
* To change this template use File | Settings | File Templates.
*/
public class UIPassWordField extends JPasswordField {
private boolean isRollOver;
public UIPassWordField () {
public UIPassWordField() {
super();
addRollOverListener();
}
public UIPassWordField (String text) {
public UIPassWordField(String text) {
super(text);
addRollOverListener();
}
public UIPassWordField (int columns) {
public UIPassWordField(int columns) {
super(columns);
addRollOverListener();
}
public UIPassWordField (String text, int columns) {
public UIPassWordField(String text, int columns) {
super(text, columns);
addRollOverListener();
}
public UIPassWordField (Document doc, String txt, int columns) {
public UIPassWordField(Document doc, String txt, int columns) {
super(doc, txt, columns);
addRollOverListener();
}
private void addRollOverListener() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
isRollOver = true;
UIPassWordField.this.repaint();
}
@Override
public void mouseExited(MouseEvent e) {
isRollOver = false;
UIPassWordField.this.repaint();
}
});
}
@Override
protected void paintBorder(Graphics g) {
if (isRollOver && this.isEnabled()) {
g.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
} else {
super.paintBorder(g);
}
}
}

512
designer_base/src/com/fr/design/gui/ispinner/UISpinner.java

@ -1,17 +1,5 @@
package com.fr.design.gui.ispinner;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
@ -19,185 +7,195 @@ import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itextfield.UITextFieldUI;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver {
protected double value;
private static final int SIZE = 20;
private static final int LEN = 13;
private UINumberField textField;
private UIButton preButton;
private UIButton nextButton;
private double minValue;
private double maxValue;
private double dierta;
private String spinnerName = "";
private UIObserverListener uiObserverListener;
private GlobalNameListener globalNameListener = null;
public UISpinner(double minValue, double maxValue, double dierta) {
this.minValue = minValue;
this.maxValue = maxValue;
this.dierta = dierta;
initComponents();
iniListener();
}
public UISpinner(double minValue, double maxValue, double dierta, double defaultValue) {
this(minValue, maxValue, dierta);
textField.setValue(defaultValue);
}
private void iniListener() {
if (shouldResponseChangeListener()) {
this.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (uiObserverListener == null) {
return;
}
uiObserverListener.doChange();
}
});
}
}
/**
* 给组件分别加上FocusListener
* @param focusListener 监听事件
*/
public void addUISpinnerFocusListenner(FocusListener focusListener) {
this.addFocusListener(focusListener);
this.textField.addFocusListener(focusListener);
this.preButton.addFocusListener(focusListener);
this.nextButton.addFocusListener(focusListener);
}
public double getValue() {
return value;
}
public void setGlobalName(String name) {
spinnerName = name;
}
public UINumberField getTextField() {
return textField;
}
public void setValue(double value) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(spinnerName);
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
return;
}
this.value = value;
textField.getDocument().removeDocumentListener(docListener);
textField.setValue(value);
textField.getDocument().addDocumentListener(docListener);
fireStateChanged();
}
public void setTextFieldValue(double value) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(spinnerName);
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
return;
}
this.value = value;
fireStateChanged();
}
public void setEnabled(boolean flag) {
super.setEnabled(flag);
this.textField.setEnabled(flag);
this.preButton.setEnabled(flag);
this.nextButton.setEnabled(flag);
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = SIZE;
return dim;
}
/**
*增加 a <code>ChangeListener</code> to the listener list.
* @param l 监听事件
*/
public void addChangeListener(ChangeListener l) {
this.listenerList.add(ChangeListener.class, l);
}
/**
*移除 a <code>ChangeListener</code> from the listener list.
* @param l 监听事件
*/
public void removeChangeListener(ChangeListener l) {
this.listenerList.remove(ChangeListener.class, l);
}
// august: Process the listeners last to first
protected void fireStateChanged() {
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
((ChangeListener) listeners[i + 1]).stateChanged(new ChangeEvent(this));
}
}
}
private void initComponents() {
textField = initNumberField();
textField.setMaxValue(maxValue);
textField.setMinValue(minValue);
setValue(value);
textField.setUI(new SpinnerTextFieldUI(textField));
preButton = new UIButton(UIConstants.ARROW_UP_ICON){
protected double value;
private static final int SIZE = 20;
private static final int LEN = 13;
private static final int WIDTH = 13;
private static final int HEIGHT = 10;
private UINumberField textField;
private UIButton preButton;
private UIButton nextButton;
private double minValue;
private double maxValue;
private double dierta;
private String spinnerName = StringUtils.EMPTY;
private UIObserverListener uiObserverListener;
private GlobalNameListener globalNameListener = null;
public UISpinner(double minValue, double maxValue, double dierta) {
this.minValue = minValue;
this.maxValue = maxValue;
this.dierta = dierta;
initComponents();
iniListener();
}
public UISpinner(double minValue, double maxValue, double dierta, double defaultValue) {
this(minValue, maxValue, dierta);
textField.setValue(defaultValue);
}
private void iniListener() {
if (shouldResponseChangeListener()) {
this.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (uiObserverListener == null) {
return;
}
uiObserverListener.doChange();
}
});
}
}
/**
* 给组件分别加上FocusListener
*
* @param focusListener 监听事件
*/
public void addUISpinnerFocusListenner(FocusListener focusListener) {
this.addFocusListener(focusListener);
this.textField.addFocusListener(focusListener);
this.preButton.addFocusListener(focusListener);
this.nextButton.addFocusListener(focusListener);
}
public double getValue() {
return value;
}
public void setGlobalName(String name) {
spinnerName = name;
}
public UINumberField getTextField() {
return textField;
}
public void setValue(double value) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(spinnerName);
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
return;
}
this.value = value;
textField.getDocument().removeDocumentListener(docListener);
textField.setValue(value);
textField.getDocument().addDocumentListener(docListener);
fireStateChanged();
}
public void setTextFieldValue(double value) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(spinnerName);
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
return;
}
this.value = value;
fireStateChanged();
}
public void setEnabled(boolean flag) {
super.setEnabled(flag);
this.textField.setEnabled(flag);
this.preButton.setEnabled(flag);
this.nextButton.setEnabled(flag);
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = SIZE;
return dim;
}
/**
* 增加 a <code>ChangeListener</code> to the listener list.
*
* @param l 监听事件
*/
public void addChangeListener(ChangeListener l) {
this.listenerList.add(ChangeListener.class, l);
}
/**
* 移除 a <code>ChangeListener</code> from the listener list.
*
* @param l 监听事件
*/
public void removeChangeListener(ChangeListener l) {
this.listenerList.remove(ChangeListener.class, l);
}
// august: Process the listeners last to first
protected void fireStateChanged() {
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
((ChangeListener) listeners[i + 1]).stateChanged(new ChangeEvent(this));
}
}
}
private void initComponents() {
textField = initNumberField();
textField.setMaxValue(maxValue);
textField.setMinValue(minValue);
setValue(value);
preButton = new UIButton(UIConstants.ARROW_UP_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
};
preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
};
nextButton.setRoundBorder(true, Constants.LEFT);
setLayout(new BorderLayout());
add(textField, BorderLayout.CENTER);
JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(new Dimension(LEN, SIZE));
arrowPane.setLayout(new GridLayout(2, 1));
preButton.setBounds(0, 1, 13, 10);
nextButton.setBounds(0, 10, 13, 10);
arrowPane.add(preButton);
arrowPane.add(nextButton);
add(arrowPane, BorderLayout.EAST);
nextButton.setRoundBorder(true, Constants.LEFT);
setLayout(new BorderLayout());
add(textField, BorderLayout.CENTER);
JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(new Dimension(LEN, SIZE));
arrowPane.setLayout(new GridLayout(2, 1));
preButton.setBounds(0, 1, WIDTH, HEIGHT);
nextButton.setBounds(0, HEIGHT, WIDTH, HEIGHT);
arrowPane.add(preButton);
arrowPane.add(nextButton);
add(arrowPane, BorderLayout.EAST);
componentInitListeners();
}
}
private void componentInitListeners(){
private void componentInitListeners() {
preButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -219,7 +217,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
}
});
textField.getDocument().removeDocumentListener(docListener);
textField.getDocument().removeDocumentListener(docListener);
textField.getDocument().addDocumentListener(docListener);
textField.addFocusListener(new FocusAdapter() {
@Override
@ -229,123 +227,85 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
});
}
protected UINumberField initNumberField() {
return new UINumberField(2) {
public boolean shouldResponseChangeListener() {
return false;
}
};
}
private DocumentListener docListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
@Override
public void insertUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
@Override
public void changedUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
};
/**
* 给组件登记一个观察者监听事件
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener;
}
protected UINumberField initNumberField() {
return new UINumberField(2) {
public boolean shouldResponseChangeListener() {
return false;
}
};
}
private DocumentListener docListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
@Override
public void insertUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
@Override
public void changedUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue());
}
};
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener;
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
public boolean shouldResponseChangeListener() {
return true;
}
/**
* 给组件登记一个全局名字观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
}
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseNameListener() {
return true;
}
private class SpinnerTextFieldUI extends UITextFieldUI {
public SpinnerTextFieldUI(UITextField textField) {
super(textField);
}
@Override
public void paintBorder(Graphics2D g2d, int width, int height,
boolean isRound, int rectDirection) {
// do nothing
}
protected void paintBackground(Graphics g) {
JTextComponent editor = getComponent();
int width = editor.getWidth();
int height = editor.getHeight();
Shape oldClip = g.getClip();
Shape roundShape = new RoundRectangle2D.Double(0, 0, width, height, UIConstants.ARC, UIConstants.ARC);
Graphics2D g2d = (Graphics2D) g;
g2d.clearRect(0, 0, width, height);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.clip(roundShape);
g2d.setColor(Color.WHITE);
g2d.fillRoundRect(1, 1, width - 2, height - 2, UIConstants.ARC, UIConstants.ARC);
if (isRollOver && isEnabled()) {
Shape shape = new RoundRectangle2D.Double(1, 1, width - 3, height - 3, UIConstants.ARC, UIConstants.ARC);
GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE);
} else {
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawRoundRect(1, 1, width - 2, height - 2, UIConstants.ARC, UIConstants.ARC);
g2d.clearRect(width - 2, 0, 2, height);
g2d.setClip(oldClip);
g2d.drawLine(width - 2, 1, width, 1);
g2d.drawLine(width - 2, height - 1, width, height - 1);
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
}
public boolean shouldResponseNameListener() {
return true;
}
/**
* 程序入口 测试
* @param args 参数
* 程序入口 测试
*
* @param args 参数
*/
public static void main(String... args) {
LayoutManager layoutManager = null;
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(layoutManager);
UISpinner bb = new UISpinner(0, 9, 1);
bb.setValue(4);
bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height);
content.add(bb);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
public static void main(String... args) {
// LayoutManager layoutManager = null;
// JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(layoutManager);
//
// UISpinner bb = new UISpinner(0, 9, 1);
// bb.setValue(4);
// bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height);
// content.add(bb);
// GUICoreUtils.centerWindow(jf);
// jf.setSize(400, 400);
// jf.setVisible(true);
}
}

22
designer_base/src/com/fr/design/gui/itextarea/UITextArea.java

@ -4,6 +4,7 @@ import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
@ -99,10 +100,9 @@ public class UITextArea extends JTextArea implements UIObserver {
@Override
protected void paintBorder(Graphics g) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL);
}
@Override
/**
*
@ -122,14 +122,14 @@ public class UITextArea extends JTextArea implements UIObserver {
* @param args
*/
public static void main(String... args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
UITextArea bb = new UITextArea("123455weoijweio reiwj kewl jfejkfljds kl jfldk jfk jdskfjkdsfklj dkl jfsdjf");
content.add(bb, BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
// JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(new BorderLayout());
// UITextArea bb = new UITextArea("123455weoijweio reiwj kewl jfejkfljds kl jfldk jfk jdskfjkdsfklj dkl jfsdjf");
// content.add(bb, BorderLayout.CENTER);
// GUICoreUtils.centerWindow(jf);
// jf.setSize(400, 400);
// jf.setVisible(true);
}
}

83
designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java

@ -1,56 +1,43 @@
package com.fr.design.gui.itextarea;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JComponent;
import javax.swing.plaf.basic.BasicTextAreaUI;
import javax.swing.text.JTextComponent;
import com.fr.design.constants.UIConstants;
import com.fr.design.utils.gui.GUIPaintUtils;
public class UITextAreaUI extends BasicTextAreaUI {
protected boolean isRollOver;
private JComponent textField;
public UITextAreaUI(final JComponent textField) {
super();
this.textField = textField;
this.textField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
isRollOver = true;
textField.repaint();
}
@Override
public void mouseExited(MouseEvent e) {
isRollOver = false;
textField.repaint();
}
});
}
import javax.swing.*;
import javax.swing.plaf.basic.BasicTextAreaUI;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@Override
protected void paintBackground(Graphics g) {
JTextComponent editor = getComponent();
int width = editor.getWidth();
int height = editor.getHeight();
Graphics2D g2d = (Graphics2D)g;
g2d.clearRect(0, 0, width, height);
if(isRollOver && textField.isEnabled() && ((UITextArea)textField).isEditable()) {
Shape shape = new RoundRectangle2D.Double(1, 1, width - 3, height - 3, UIConstants.ARC, UIConstants.ARC);
GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE);
} else {
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawRoundRect(1, 1, width - 2, height - 2, UIConstants.ARC, UIConstants.ARC);
}
}
public class UITextAreaUI extends BasicTextAreaUI {
protected boolean isRollOver;
private JComponent textField;
public UITextAreaUI(final JComponent textField) {
super();
this.textField = textField;
this.textField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
isRollOver = true;
textField.repaint();
}
@Override
public void mouseExited(MouseEvent e) {
isRollOver = false;
textField.repaint();
}
});
}
public void paintBorder(Graphics2D g2d, int width, int height, boolean isRound, int rectDirection) {
if (isRollOver && textField.isEnabled()) {
g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g2d.drawRect(0, 0, width - 1, height - 1);
} else {
GUIPaintUtils.drawBorder(g2d, 0, 0, width, height, isRound, rectDirection);
}
}
}

403
designer_base/src/com/fr/design/gui/itextfield/UINumberField.java

@ -16,92 +16,95 @@ import java.awt.*;
* Number Field.
*/
public class UINumberField extends UITextField {
public static final double ERROR_VALUE = Double.MAX_VALUE + 4.44; // peter:错误的值.
/**
* 整数部分的长度
*/
private int maxIntegerLength = 24;
/**
* 小数部分的长度
*/
public static final double ERROR_VALUE = Double.MAX_VALUE + 4.44; // peter:错误的值.
public static final int MAX_INTEGERLENGTH = 24;
public static final int MAX_INTEGERLENGTH_32 = 32;
public static final int MAX_DECIMALLENGTH = 16;
/**
* 整数部分的长度
*/
private int maxIntegerLength = MAX_INTEGERLENGTH;
/**
* 小数部分的长度
*/
private static final int DEFAULTMAXDECIMALLENTH = 16;
private static final int TESTMAXVALUE = 100;
private static final int TESTMINVALUE = -10;
private int maxDecimalLength = 16;
private double minValue = -Double.MAX_VALUE;
private double maxValue = Double.MAX_VALUE;
private boolean isContentChanged = false;
public UINumberField() {
this(32, 16);
}
public UINumberField(int columns) {
this();
setColumns(columns);
}
public UINumberField(int maxIntegerLength, int maxDecimalLength) {
this(maxIntegerLength, maxDecimalLength, -Double.MAX_VALUE, Double.MAX_VALUE);
}
public UINumberField(int maxIntegerLength, int maxDecimalLength, double minValue, double maxValue) {
this.maxIntegerLength = maxIntegerLength;
this.maxDecimalLength = maxDecimalLength;
this.minValue = minValue;
this.maxValue = maxValue;
setFieldDocument();
}
public void setFieldDocument(){
private static final int TESTMAXVALUE = 100;
private static final int TESTMINVALUE = -10;
private int maxDecimalLength = MAX_DECIMALLENGTH;
private double minValue = -Double.MAX_VALUE;
private double maxValue = Double.MAX_VALUE;
private boolean isContentChanged = false;
public UINumberField() {
this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH);
}
public UINumberField(int columns) {
this();
setColumns(columns);
}
public UINumberField(int maxIntegerLength, int maxDecimalLength) {
this(maxIntegerLength, maxDecimalLength, -Double.MAX_VALUE, Double.MAX_VALUE);
}
public UINumberField(int maxIntegerLength, int maxDecimalLength, double minValue, double maxValue) {
this.maxIntegerLength = maxIntegerLength;
this.maxDecimalLength = maxDecimalLength;
this.minValue = minValue;
this.maxValue = maxValue;
setFieldDocument();
}
public void setFieldDocument() {
setDocument(new NumberDocument());
initListener();
}
public int getMaxIntegerLength() {
return maxIntegerLength;
}
public void setMaxIntegerLength(int maxIntegerLength) {
this.maxIntegerLength = maxIntegerLength;
}
public int getMaxDecimalLength() {
return maxDecimalLength;
}
public void setMaxDecimalLength(int maxDecimalLength) {
this.maxDecimalLength = maxDecimalLength;
}
public double getMinValue() {
return minValue;
}
public void setMinValue(double minValue) {
this.minValue = minValue;
}
public double getMaxValue() {
return maxValue;
}
public void setMaxValue(double maxValue) {
this.maxValue = maxValue;
}
/**
* Set the value.
*/
public void setValue(double value) {
this.setText(Utils.doubleToString(value));
}
/**
* Return the value.
*/
public double getValue() throws NumberFormatException {
public int getMaxIntegerLength() {
return maxIntegerLength;
}
public void setMaxIntegerLength(int maxIntegerLength) {
this.maxIntegerLength = maxIntegerLength;
}
public int getMaxDecimalLength() {
return maxDecimalLength;
}
public void setMaxDecimalLength(int maxDecimalLength) {
this.maxDecimalLength = maxDecimalLength;
}
public double getMinValue() {
return minValue;
}
public void setMinValue(double minValue) {
this.minValue = minValue;
}
public double getMaxValue() {
return maxValue;
}
public void setMaxValue(double maxValue) {
this.maxValue = maxValue;
}
/**
* Set the value.
*/
public void setValue(double value) {
this.setText(Utils.doubleToString(value));
}
/**
* Return the value.
*/
public double getValue() throws NumberFormatException {
try {
if (this.getText().length() == 0) {
return 0;
@ -113,134 +116,132 @@ public class UINumberField extends UITextField {
}
}
/**
* Retusn text value.
*/
public String getTextValue() {
return this.getText();
}
/**
* Set property integer.
*
* @param integer
* New value of property integer.
*/
public void setInteger(boolean integer) {
if (integer) {
this.maxDecimalLength = 0;
} else {
this.maxDecimalLength = DEFAULTMAXDECIMALLENTH;
}
}
/**
* Check whether the content changed.
*/
public boolean isContentChanged() {
return isContentChanged;
}
public void setisContentChanged(boolean isContentChanged){
/**
* Retusn text value.
*/
public String getTextValue() {
return this.getText();
}
/**
* Set property integer.
*
* @param integer New value of property integer.
*/
public void setInteger(boolean integer) {
if (integer) {
this.maxDecimalLength = 0;
} else {
this.maxDecimalLength = DEFAULTMAXDECIMALLENTH;
}
}
/**
* Check whether the content changed.
*/
public boolean isContentChanged() {
return isContentChanged;
}
public void setisContentChanged(boolean isContentChanged) {
this.isContentChanged = isContentChanged;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
class NumberDocument extends PlainDocument {
public NumberDocument() {
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
class NumberDocument extends PlainDocument {
public boolean checkString(int offset, String s, String str) {
return (ComparatorUtils.equals(s,"F")
|| ComparatorUtils.equals(s,"f")
|| ComparatorUtils.equals(s,"D")
|| ComparatorUtils.equals(s,"d")
||(ComparatorUtils.equals(str.trim(),"0") && !ComparatorUtils.equals(s.substring(0, 1),".") && offset != 0)// 第一位是0时,第二位只能为小数点
||(ComparatorUtils.equals(s,".") && maxDecimalLength == 0));
return (ComparatorUtils.equals(s, "F")
|| ComparatorUtils.equals(s, "f")
|| ComparatorUtils.equals(s, "D")
|| ComparatorUtils.equals(s, "d")
|| (ComparatorUtils.equals(str.trim(), "0") && !ComparatorUtils.equals(s.substring(0, 1), ".") && offset != 0)// 第一位是0时,第二位只能为小数点
|| (ComparatorUtils.equals(s, ".") && maxDecimalLength == 0));
}
public void insertString(int offset, String s, AttributeSet a) throws BadLocationException {
String str = getText(0, getLength());
// 不能为f,F,d,D
if (checkString(offset,s, str) ) {
Toolkit.getDefaultToolkit().beep();
return;
}
String strNew = str.substring(0, offset) + s + str.substring(offset, getLength());
if(notChange(strNew)) {
return;
}
setisContentChanged(true);
super.insertString(offset, s, a);
}
// kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100.
// 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难..
private boolean notChange(String strNew) {
boolean noChange = false;
strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数
boolean isMinus = strNew.startsWith("-");
String strIntPart;
String strDecPart = StringUtils.EMPTY;
int decPos = strNew.indexOf(CoreConstants.DOT);
if (decPos > -1) {
strIntPart = strNew.substring(0, decPos);
strDecPart = strNew.substring(decPos + 1);
} else {
strIntPart = strNew;
}
if (isOverMaxOrMinValue(strIntPart, strDecPart, strNew)) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
}
try {
if (!ComparatorUtils.equals(strNew, StringUtils.EMPTY) && !ComparatorUtils.equals(strNew, "-")) {// 控制能输入负数
double d = Double.parseDouble(strNew) * (isMinus ? -1 : 1);
if (d < minValue || d > maxValue) {
throw new Exception();
}
}
} catch (Exception e) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
}
return noChange;
}
private boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) {
return strIntPart.length() > maxIntegerLength
|| strDecPart.length() > maxDecimalLength
|| (strNew.length() > 1 && ComparatorUtils.equals(strNew.substring(0, 1), "0") && !ComparatorUtils.equals(strNew.substring(1, 2),"."));
}
}
public void insertString(int offset, String s, AttributeSet a) throws BadLocationException {
String str = getText(0, getLength());
// 不能为f,F,d,D
if (checkString(offset, s, str)) {
Toolkit.getDefaultToolkit().beep();
return;
}
String strNew = str.substring(0, offset) + s + str.substring(offset, getLength());
if (notChange(strNew)) {
return;
}
setisContentChanged(true);
super.insertString(offset, s, a);
}
// kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100.
// 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难..
private boolean notChange(String strNew) {
boolean noChange = false;
strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数
boolean isMinus = strNew.startsWith("-");
String strIntPart;
String strDecPart = StringUtils.EMPTY;
int decPos = strNew.indexOf(CoreConstants.DOT);
if (decPos > -1) {
strIntPart = strNew.substring(0, decPos);
strDecPart = strNew.substring(decPos + 1);
} else {
strIntPart = strNew;
}
if (isOverMaxOrMinValue(strIntPart, strDecPart, strNew)) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
}
try {
if (!ComparatorUtils.equals(strNew, StringUtils.EMPTY) && !ComparatorUtils.equals(strNew, "-")) {// 控制能输入负数
double d = Double.parseDouble(strNew) * (isMinus ? -1 : 1);
if (d < minValue || d > maxValue) {
throw new Exception();
}
}
} catch (Exception e) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
}
return noChange;
}
private boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) {
boolean checkLength = strIntPart.length() > maxIntegerLength
|| strDecPart.length() > maxDecimalLength;
return checkLength || (strNew.length() > 1 && ComparatorUtils.equals(strNew.substring(0, 1), "0") && !ComparatorUtils.equals(strNew.substring(1, 2), "."));
}
}
/**
* 测试程序
*/
public static void main(String[] args) {
JFrame frame = new JFrame("");
frame.setSize(400, 320);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
UINumberField tt = new UINumberField();
tt.setMinValue(0.0);
tt.setMaxValue(100.0);
frame.getContentPane().setLayout(new GridLayout(10, 2));
frame.getContentPane().add(new UILabel("New JNumberField()"));
frame.getContentPane().add(tt);
frame.getContentPane().add(new UILabel("New JNumberField(2)"));
frame.getContentPane().add(new UILabel("New JNumberField(8,2)"));
frame.getContentPane().add(new UINumberField(8, 2));
frame.getContentPane().add(new UILabel("New JNumberField(5,2,-10,100)"));
frame.getContentPane().add(new UINumberField(5, 2, TESTMINVALUE, TESTMAXVALUE));
frame.setVisible(true);
}
public static void main(String[] args) {
// JFrame frame = new JFrame("");
// frame.setSize(400, 320);
// Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
// frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
// UINumberField tt = new UINumberField();
// tt.setMinValue(0.0);
// tt.setMaxValue(100.0);
// frame.getContentPane().setLayout(new GridLayout(10, 2));
// frame.getContentPane().add(new UILabel("New JNumberField()"));
// frame.getContentPane().add(tt);
// frame.getContentPane().add(new UILabel("New JNumberField(2)"));
// frame.getContentPane().add(new UILabel("New JNumberField(8,2)"));
// frame.getContentPane().add(new UINumberField(8, 2));
// frame.getContentPane().add(new UILabel("New JNumberField(5,2,-10,100)"));
// frame.getContentPane().add(new UINumberField(5, 2, TESTMINVALUE, TESTMAXVALUE));
// frame.setVisible(true);
}
}

9
designer_base/src/com/fr/design/locale/designer.properties

@ -2013,7 +2013,6 @@ FR-Designer_Parameter=
FR-Designer-Plugin_Plugin=Plugin
FR-Designer_Background=Background
Template=Template
FR-Designer_Parent_Marked_Field=Parent Marked Field
FR-Designer_Original_Marked_Filed=Original Marked Filed
FR-Designer_Build_Tree_Accord_Parent_Marked_Filed=Build Tree according parent's marked filed
@ -2135,4 +2134,10 @@ FR-Designer_Widgetname=Widget Name
FR-Designer_Insert_Cell_Element=Insert Cell Element
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name
FR-Designer_Label_Name=label name
FR-Designer_Widget_Visible=
FR-Designer_Widget_Enabled=
FR-Designer_Cell_Visible=
FR-Designer_Show=
FR-Designer_Float_Visible=
FR-Designer_Cell_Value=

17
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -659,7 +659,7 @@ FRFont-Subscript=Subscript
Background_Settings=Background Settings
FormulaD-Invalid_Formula=Invalid Formula
FR-Base_Margin=Margin
FR-Designer-Plugin_Shop_Installed=Plug-shop installed, whether to start immediately?
FR-Designer-Plugin_Shop_Installed=Plugin store is installed, please reopen the store.
M_Edit-Send_to_Back=Send to Bottom
Email-Can_Preview_Report_Content=Preview Report Content in the Body
FR-Designer-FRFont_Italic=Italic
@ -1134,7 +1134,6 @@ FRFont-bold=Bold
FR-Designer_Set_Submit_Condition=Submit Condition
Form-Change_Widget_Name=Change Control Name
ReportColumns-Report_Columns=Multi-columns/lines display
FR-Designer_Can_not_use_FormatBursh=Can't use format painter in multiple selections
CellElement-Property_Table=Cell Attribute Table
Dictionary-Dynamic_SQL=Dynamic SQL
FR-Designer_Form-CheckBoxGroup=CheckBoxGroup
@ -2015,7 +2014,6 @@ FR-Designer_Parameter=Parameter
FR-Designer-Plugin_Plugin=Plugin
FR-Designer_Background=BG
Template=Template
FR-Designer_Original_Marked_Filed=Original Tag Field
FR-Designer_Build_Tree_Accord_Marked_Filed_Length=Build tree according to tag field's length
FR-Designer_Can_not_use_FormatBursh=Can't use format painter in multiple selections
@ -2131,4 +2129,15 @@ FR-Designer_Widgetname=Widget Name
FR-Designer_Insert_Cell_Element=Insert Cell Element
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name
FR-Designer_Label_Name=label name
FR-Designer_Widget_Visible=
FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Cell_Value=
FR-Designer_Cell_Visible=
FR-Designer_Widget_Formula=
FR-Designer_Show=
FR-Designer_Widget_Position=
FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=

19
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -657,7 +657,7 @@ FRFont-Subscript=\u4E0B\u4ED8\u304D
Background_Settings=\u80CC\u666F\u8A2D\u5B9A
FormulaD-Invalid_Formula=\u7121\u52B9\u306A\u516C\u5F0F
FR-Base_Margin=\u30DE\u30FC\u30B8\u30F3
FR-Designer-Plugin_Shop_Installed=\u30D7\u30E9\u30B0\u30A4\u30F3\u30B7\u30E7\u30C3\u30D7\u304C\u3059\u3050\u306B\u958B\u59CB\u3059\u308B\u304B\u3069\u3046\u304B\u3001\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u3059\u304B\uFF1F
FR-Designer-Plugin_Shop_Installed=
M_Edit-Send_to_Back=\u6700\u80CC\u9762\u3078\u79FB\u52D5(K)
Email-Can_Preview_Report_Content=\u30C6\u30AD\u30B9\u30C8\u30D7\u30EC\u30D3\u30E5\u30FC\u30EC\u30DD\u30FC\u30C8\u306E\u5185\u5BB9
FR-Designer-FRFont_Italic=\u50BE\u659C
@ -1132,7 +1132,6 @@ FRFont-bold=\u592A\u5B57
FR-Designer_Set_Submit_Condition=\u63D0\u51FA\u6761\u4EF6\u3092\u8A2D\u5B9A
Form-Change_Widget_Name=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D\u5909\u66F4
ReportColumns-Report_Columns=\u5E33\u7968\u30B3\u30E9\u30E0
FR-Designer_Can_not_use_FormatBursh=\u8907\u6570\u9078\u629E\u3057\u305F\u30A8\u30EA\u30A2\u3067\u306F\u66F8\u5F0F\u30D6\u30E9\u30B7\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\!
CellElement-Property_Table=\u30BB\u30EB\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u00B7\u30B7\u30FC\u30C8
Dictionary-Dynamic_SQL=\u52D5\u614BSQL
FR-Designer_Form-CheckBoxGroup=\u30D5\u30EC\u30FC\u30E0\u30BB\u30C3\u30C8\u3092\u8907\u6570\u9078\u629E
@ -2127,4 +2126,18 @@ FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\u30E9\u30D9\u30EBa
FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D
FR-Designer_Insert_Cell_Element=
FR-Designer_Add_Condition=
FR-Designer_Add_Condition=
FR-Designer_Widget_Visible=
FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Cell_Value=
FR-Designer_Cell_Visible=
FR-Designer_Widget_Formula=
M-New_WorkBook=
FR-Designer_Show=
FR-Designer-AlphaFine_NO_Result=
FR-Designer_Widget_Position=
FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Add_Event=
FR-Designer_Widget_Enabled=

16
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -657,7 +657,7 @@ FRFont-Subscript=\uBC11\uC904
Background_Settings=\uBC30\uACBD\uC124\uC815
FormulaD-Invalid_Formula=\uC62C\uBC14\uB974\uC9C0\uC54A\uC740\uC218\uC2DD
FR-Base_Margin=\uC5EC\uBC31
FR-Designer-Plugin_Shop_Installed=\uD50C\uB7EC\uADF8\uC778 \uC0C1\uC810 \uC989\uC2DC \uC2DC\uC791\uD560\uC9C0 \uC5EC\uBD80\uB97C \uC124\uCE58?
FR-Designer-Plugin_Shop_Installed=
M_Edit-Send_to_Back=\uC81C\uC77C\uBC11\uC5D0\uB450\uAE30(K)
Email-Can_Preview_Report_Content=\uBCF8\uBB38\uBBF8\uB9AC\uBCF4\uAE30\uBB38\uC11C\uB0B4\uC6A9
FR-Designer-FRFont_Italic=\uAE30\uC6B8\uC784\uAF34
@ -2128,4 +2128,16 @@ FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\uB808\uC774\uBE14
FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984
FR-Designer_Insert_Cell_Element=
FR-Designer_Add_Condition=
FR-Designer_Add_Condition=
FR-Designer_Widget_Visible=
FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Cell_Value=
FR-Designer_Cell_Visible=
FR-Designer_Widget_Formula=
FR-Designer_Show=
FR-Designer-AlphaFine_NO_Result=
FR-Designer_Widget_Position=
FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=

8
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -660,7 +660,7 @@ FRFont-Subscript=\u4E0B\u6807
Background_Settings=\u80CC\u666F\u8BBE\u7F6E
FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F
FR-Base_Margin=\u8FB9\u8DDD
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u662F\u5426\u7ACB\u523B\u542F\u52A8?
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u8BF7\u91CD\u65B0\u6253\u5F00\u63D2\u4EF6\u5546\u5E97\u3002
M_Edit-Send_to_Back=\u7F6E\u4E8E\u5E95\u5C42(K)
Email-Can_Preview_Report_Content=\u6B63\u6587\u9884\u89C8\u62A5\u8868\u5185\u5BB9
FR-Designer-FRFont_Italic=\u503E\u659C
@ -2015,7 +2015,6 @@ FR-Designer_Parameter=\u53C2\u6570
FR-Designer-Plugin_Plugin=\u63D2\u4EF6
FR-Designer_Background=\u80CC\u666F
Template=\u6A21\u7248
FR-Designer_Original_Marked_Filed=\u539F\u59CB\u6807\u8BB0\u5B57\u6BB5
FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\u4F9D\u8D56\u6240\u9009\u6570\u636E\u96C6\u7684\u6807\u8BB0\u5B57\u6BB5\u7684\u957F\u5EA6\u6784\u5EFA\u6811
FR-Designer_Tree_Data_Field=\u6811\u6570\u636E\u5B57\u6BB5
@ -2025,7 +2024,6 @@ FR-Product_Demo=\u4EA7\u54C1\u6F14\u793A
FR-Designer_Data_Filter=\u6570\u636E\u7B5B\u9009
Default=\u9ED8\u8BA4
FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6
FR-Designer_Cell_Element=\u5355\u5143\u683C\u5143\u7D20
FR-Designer_Cell_Attributes=\u5355\u5143\u683C\u5C5E\u6027
FR-Designer_Float_Element=\u60AC\u6D6E\u5143\u7D20
@ -2140,4 +2138,6 @@ FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6807\u7B7E
FR-Designer_Widgetname=\u63A7\u4EF6\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer-Plugin_Has_Been_Actived=
FR-Designer-Plugin_Has_Been_Disabled=

18
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -659,7 +659,7 @@ FRFont-Subscript=\u4E0B\u6A19
Background_Settings=\u80CC\u666F\u8A2D\u5B9A
FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F
FR-Base_Margin=\u908A\u8DDD
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u662F\u5426\u7ACB\u523B\u555F\u52D5?
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u8ACB\u91CD\u65B0\u6253\u958B\u63D2\u4EF6\u5546\u5E97\u3002
M_Edit-Send_to_Back=\u7F6E\u65BC\u5E95\u5C64(K)
Email-Can_Preview_Report_Content=\u6B63\u6587\u9810\u89BD\u5831\u8868\u5167\u5BB9
FR-Designer-FRFont_Italic=\u659C\u9AD4
@ -1134,7 +1134,6 @@ FRFont-bold=\u7C97\u9AD4
FR-Designer_Set_Submit_Condition=\u8A2D\u5B9A\u63D0\u4EA4\u689D\u4EF6
Form-Change_Widget_Name=\u66F4\u6539\u63A7\u5236\u9805\u540D
ReportColumns-Report_Columns=\u5831\u8868\u5206\u6B04
FR-Designer_Can_not_use_FormatBursh=\u7121\u6CD5\u4F7F\u7528\u8907\u88FD\u683C\u5F0F
CellElement-Property_Table=\u5132\u5B58\u683C\u5C6C\u6027\u8868
Dictionary-Dynamic_SQL=\u52D5\u614BSQL
FR-Designer_Form-CheckBoxGroup=\u5FA9\u9078\u6846\u7D44
@ -2014,7 +2013,6 @@ FR-Designer_Parameter=\u53C3\u6578
FR-Designer-Plugin_Plugin=\u63D2\u4EF6
FR-Designer_Background=\u586B\u6EFF\u8272\u5F69
Template=\u7BC4\u672C
FR-Designer_Original_Marked_Filed=\u539F\u59CB\u6A19\u8A18\u6B04\u4F4D
FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\u4F9D\u8CF4\u6240\u9078\u8CC7\u6599\u96C6\u7684\u6A19\u8A18\u6B04\u4F4D\u7684\u9577\u5EA6\u69CB\u5EFA\u6A39\u72C0
FR-Designer_Can_not_use_FormatBursh=\u7121\u6CD5\u4F7F\u7528\u8907\u88FD\u683C\u5F0F
@ -2025,7 +2023,6 @@ FR-Product_Demo=\u529F\u80FD\u5C55\u793A
FR-Designer_Data_Filter=\u8CC7\u6599\u7BE9\u9078
Default=\u9810\u8A2D
FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848
FR-Designer_Cell_Element=\u5132\u5B58\u683C\u5143\u7D20
FR-Designer_Cell_Attributes=\u5132\u5B58\u683C\u5C6C\u6027
FR-Designer_Float_Element=\u61F8\u6D6E\u5143\u7D20
@ -2132,4 +2129,15 @@ FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6A19\u7C3D
FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer_Add_Condition=
FR-Designer_Add_Condition=
FR-Designer_Widget_Visible=
FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Cell_Value=
FR-Designer_Cell_Visible=
FR-Designer_Widget_Formula=
FR-Designer_Show=
FR-Designer_Widget_Position=
FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=

6
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.loghandler;
import com.fr.stable.fun.impl.AbstractLogProvider;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.LogRecordTimeProvider;
import java.util.ArrayList;
@ -43,4 +44,9 @@ public class DesignerLogImpl extends AbstractLogProvider{
public void record(LogRecordTimeProvider logRecordTime) {
records.add(logRecordTime);
}
@Override
public void record(LogRecordTimeProvider logRecordTime, SessionProvider sessionProvider) {
}
}

3
designer_base/src/com/fr/design/mainframe/loghandler/LogDetailPane.java

@ -7,6 +7,7 @@ import javax.swing.JPanel;
import com.fr.base.BaseUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
public class LogDetailPane extends JPanel{
public LogDetailPane() {
@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{
fr.setSize(600, 400);
GUICoreUtils.centerWindow(fr);
fr.setResizable(false);
fr.setTitle("日志");
fr.setTitle(Inter.getLocText("FR-Designer_Log"));
fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png"));
fr.getContentPane().setLayout(new BorderLayout());
fr.getContentPane().add(this, BorderLayout.CENTER);

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

@ -150,8 +150,10 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单
menuList.add(createHelpMenuDef());
// 添加社区菜单
addCommunityMenuDef(menuList);
if (FRContext.getLocale() == Locale.CHINA || FRContext.getLocale() == Locale.TAIWAN) {
// 添加社区菜单
addCommunityMenuDef(menuList);
}
// 添加全部UpdateAction到actionmanager中
addAllUpdateActionsToList(menuList);

4
designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java

@ -12,6 +12,7 @@ import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.design.file.HistoryTemplateListPane;
public class HorizontalRulerUI extends RulerUI {
@ -25,7 +26,8 @@ public class HorizontalRulerUI extends RulerUI {
for (int i = k; i < (pxToLength(size.getWidth() + extra) + 1) * ratio; i++) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) {
String text = Utils.convertNumberStringToString(i / showText);
double times = (double)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times));
Graphics2D gg = (Graphics2D) g.create((int) (toPX(i) / ratio) - extra + 1, 0, BaseRuler.NUMBER_100, size.height);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_100, BaseRuler.NUMBER_14, text, Style.getInstance().deriveHorizontalAlignment(
Style.LEFT_TO_RIGHT).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution());

4
designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java

@ -9,6 +9,7 @@ import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.design.file.HistoryTemplateListPane;
public class VerticalRulerUI extends RulerUI{
@ -22,8 +23,9 @@ public class VerticalRulerUI extends RulerUI{
for (int i = k; i < (pxToLength(size.height + extra) + 1) * ratio; i++) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) {
double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times));
GraphHelper.drawLine(g, size.width, toPX(i) / ratio - extra, 0, toPX(i) / ratio - extra);
String text = Utils.convertNumberStringToString(i / showText);
Graphics2D gg = (Graphics2D) g.create(0, (int) (toPX(i) / ratio - extra + 1), size.width, BaseRuler.NUMBER_99);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_11, BaseRuler.NUMBER_100, text, Style.getInstance().deriveVerticalAlignment(1).deriveRotation(
BaseRuler.NUMBER_90).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution());

191
designer_base/src/com/fr/design/web/CustomIconPane.java

@ -7,7 +7,9 @@ import com.fr.base.IconManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
@ -26,6 +28,7 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -44,14 +47,14 @@ public class CustomIconPane extends BasicPane {
private ListMap iconButtonMap = null;
private JPanel iconPane = null;
private ButtonGroup bg;
private JScrollPane jsPane;
private UIScrollPane jsPane;
// 老一次次去拿真麻烦
private IconManager iconManager = null;
private int width = 180;
private int horizontalCount = 6;
private int heightPer = 29;
private int gap = 10;
private static final int THE_WIDTH = 180;
private static final int HORIZONTAL_COUNT = 6;
private static final int HEIGHT_PER = 29;
private static final int GAP = 10;
public CustomIconPane() {
this.initComponents();
@ -69,7 +72,7 @@ public class CustomIconPane extends BasicPane {
// 开始加图标选择按钮
initIcons();
jsPane = new JScrollPane(iconPane);
jsPane = new UIScrollPane(iconPane);
refreshIconPane(false);
jsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
@ -131,14 +134,11 @@ public class CustomIconPane extends BasicPane {
if (iconManager.addIcon(icon, false)) {
IconButton iconButton = null;//初始化
addIcon(icon,iconButton);
addIcon(icon, iconButton);
}else {
// add failed
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message2"),
Inter.getLocText("FR-Designer_Tooltips"),
JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Custom_Icon_Message2"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.WARNING_MESSAGE);
}
}
}).setVisible(true);
@ -189,6 +189,7 @@ public class CustomIconPane extends BasicPane {
try {
oldIcon= iconManager.getIcon(selectedIconName);
} catch (CloneNotSupportedException e1) {
// do nothing
}
if (oldIcon == null) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
@ -209,16 +210,13 @@ public class CustomIconPane extends BasicPane {
iconPane.remove(iconButton);
bg.remove(iconButton);
addIcon(icon,iconButton);
addIcon(icon, iconButton);
} else {
// 失败了再弄回去
iconManager.addIcon(oldIcon, true);
// edit failed
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message2"),
Inter.getLocText("FR-Designer_Tooltips"),
JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Custom_Icon_Message2"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.WARNING_MESSAGE);
}
}
});
@ -272,8 +270,8 @@ public class CustomIconPane extends BasicPane {
// 不知道怎么动态布局,就这么傻傻的调一下大小
private void refreshIconPane(boolean down) {
iconPane.setPreferredSize(new Dimension(width, (iconButtonMap.size() / horizontalCount + 1) * heightPer + gap));
JScrollBar jsBar = jsPane.getVerticalScrollBar();
iconPane.setPreferredSize(new Dimension(THE_WIDTH, (iconButtonMap.size() / HORIZONTAL_COUNT + 1) * HEIGHT_PER + GAP));
UIScrollBar jsBar = jsPane.createVerticalScrollBar();
try {
if (down) {
// 将滚动条滚到最后
@ -282,29 +280,41 @@ public class CustomIconPane extends BasicPane {
jsBar.setValue(0);
}
} catch (RuntimeException re) {
return;
}
}
private class IconButton extends JToggleButton implements ActionListener{
private String iconName;
private Image iconImage = null;
private static final int ICON_BUTTON_SIZE = 24;
private static final int ICON_X = 4;
private static final int ICON_Y = 4;
public IconButton(String name) {
this.iconName = name;
this.addActionListener(this);
this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.setBorder(null);
this.iconImage = WidgetManager.getProviderInstance().getIconManager().getIconImage(name);
this.setToolTipText(iconName);
}
@Override
public void updateUI() {
setUI(new BasicButtonUI(){
public void paint(Graphics g, JComponent c) {
super.paint(g, c);
}
});
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
// carl:这里缩放显示 16 × 16
if (iconImage != null) {
g2d.drawImage(iconImage, 4, 4, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null);
g2d.drawImage(iconImage, ICON_X, ICON_Y, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null);
}
if (this.iconName != null && ComparatorUtils.equals(this.iconName, selectedIconName)) {
g2d.setPaint(Color.RED);
@ -317,7 +327,7 @@ public class CustomIconPane extends BasicPane {
@Override
public Dimension getPreferredSize() {
return new Dimension(24, 24);
return new Dimension(ICON_BUTTON_SIZE, ICON_BUTTON_SIZE);
}
public void actionPerformed(ActionEvent evt) {
@ -348,75 +358,80 @@ public class CustomIconPane extends BasicPane {
private String oldName = null;
protected EditIconDialog() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p, p};
UIButton browseButton = new UIButton(Inter.getLocText("FR-Designer_Custom_Icon_SelectIcon"));
browseButton.setPreferredSize(new java.awt.Dimension(80, 25));
browseButton.setToolTipText(Inter.getLocText("FR-Designer_Click_this_button"));
browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser jf = new JFileChooser();
// carl:不知道是否只要png格式,反正导出时全部都转成png了
FileNameExtensionFilter fileFilter = new FileNameExtensionFilter("Icon Image File", "jpg", "jpeg", "png", "gif");
jf.setFileFilter(fileFilter);
init();
}
if (JFileChooser.APPROVE_OPTION == jf.showOpenDialog(DesignerContext.getDesignerFrame())) {
String path = jf.getSelectedFile().getAbsolutePath();
// 将图片转化到16 × 16大小
Image image = BaseUtils.readImage(path);
BufferedImage bufferedImage = CoreGraphHelper.createBufferedImage(IconManager.DEFAULT_ICONWIDTH,
IconManager.DEFAULT_ICONHEIGHT, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bufferedImage.createGraphics();
g2d.drawImage(image, 0, 0, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null);
bufferedImage.flush();
g2d.dispose();
iconImage = bufferedImage;
if (iconImage != null) {
showImageLabel.setIcon(new ImageIcon(iconImage));
}
}
private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p, p};
UIButton browseButton = new UIButton(Inter.getLocText("FR-Designer_Custom_Icon_SelectIcon"));
browseButton.setPreferredSize(new Dimension(80, 25));
browseButton.setToolTipText(Inter.getLocText("FR-Designer_Click_this_button"));
nameTextField = new UITextField(20);
browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onBrowseButtonClicked();
}
});
nameTextField = new UITextField(20);
// 焦点丢失时看看名称是否已经存在
nameTextField.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) {
return;
}
if (WidgetManager.getProviderInstance().getIconManager().contains(nameTextField.getText())) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message3"),
Inter.getLocText("FR-Designer_Tooltips"),
JOptionPane.WARNING_MESSAGE);
}
}
});
JPanel imagePane = new JPanel();
imagePane.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 0));
showImageLabel = new UILabel();
showImageLabel.setPreferredSize(new Dimension(20,20));
imagePane.add(showImageLabel);
imagePane.add(browseButton);
Component[][] components = {
{new UILabel(Inter.getLocText("FR-Designer_Name") + ":"), nameTextField},
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), imagePane}
};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(centerPane,BorderLayout.CENTER);
}
@Override
// 焦点丢失时看看名称是否已经存在
nameTextField.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
// do nothing
}
public void focusLost(FocusEvent e) {
if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) {
return;
}
if (WidgetManager.getProviderInstance().getIconManager().contains(nameTextField.getText())) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("FR-Designer_Custom_Icon_Message3"),
Inter.getLocText("FR-Designer_Tooltips"),
JOptionPane.WARNING_MESSAGE);
}
}
});
JPanel imagePane = new JPanel();
imagePane.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 0));
showImageLabel = new UILabel();
showImageLabel.setPreferredSize(new Dimension(20,20));
imagePane.add(showImageLabel);
imagePane.add(browseButton);
Component[][] components = {{new UILabel(Inter.getLocText("FR-Designer_Name") + ":"), nameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), imagePane}};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(centerPane, BorderLayout.CENTER);
}
private void onBrowseButtonClicked() {
JFileChooser jf = new JFileChooser();
// carl:不知道是否只要png格式,反正导出时全部都转成png了
FileNameExtensionFilter fileFilter = new FileNameExtensionFilter("Icon Image File", "jpg", "jpeg", "png", "gif");
jf.setFileFilter(fileFilter);
if (JFileChooser.APPROVE_OPTION == jf.showOpenDialog(DesignerContext.getDesignerFrame())) {
String path = jf.getSelectedFile().getAbsolutePath();
// 将图片转化到16 × 16大小
Image image = BaseUtils.readImage(path);
BufferedImage bufferedImage = CoreGraphHelper.createBufferedImage(IconManager.DEFAULT_ICONWIDTH,
IconManager.DEFAULT_ICONHEIGHT, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bufferedImage.createGraphics();
g2d.drawImage(image, 0, 0, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null);
bufferedImage.flush();
g2d.dispose();
iconImage = bufferedImage;
if (iconImage != null) {
showImageLabel.setIcon(new ImageIcon(iconImage));
}
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Add", "Icon"});
}

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

@ -81,12 +81,12 @@ import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.solution.closeable.CloseableContainedMap;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*;
@ -115,7 +115,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
static {
readDefault();
readVanChart();
StableFactory.registerMarkedObject(XML_TAG, classManager);
PluginModule.registerAgent(PluginModule.ExtraChartDesign, classManager);
}
static {

13
designer_chart/src/com/fr/design/chart/ChartTypePane.java

@ -7,7 +7,11 @@ package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.*;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.ChartIcon;
import com.fr.chart.chartattr.MapPlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -150,7 +154,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID();
Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
if(chart.getPlot() != null){
if(chart.getPlot() instanceof MapPlot && !(VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.CHART_MAP.support())){
if(chart.getPlot() instanceof MapPlot && !supportMap()){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported"));
throw new RegistEditionException(VT4FR.CHART_MAP);
}
@ -165,6 +169,11 @@ public class ChartTypePane extends ChartCommonWizardPane {
}
}
private boolean supportMap() {
byte[] bytes = FRCoreContext.getBytes();
return VT4FR.isLicAvailable(bytes) && VT4FR.CHART_MAP.support();
}
public void update(ChartCollection cc) {
if (cc == null) {
return;

126
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

@ -62,7 +62,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
private UIButton addButton;
private JPopupMenu popupMenu;
private ArrayList<javax.swing.event.ChangeListener> changeListeners = new ArrayList<javax.swing.event.ChangeListener>();
private boolean hasPopulated = false;
private boolean hasPopulated = false;
@Override
protected String title4PopupWindow() {
@ -113,8 +113,8 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
groupExtensionPane.addDeleteListener(new ChangeListener() {
@Override
public void fireChanged(ChangeEvent event) {
//这么写有点问题
String oldName = Utils.objectToString(groupExtensionPane.getSelectedObject());
//这么写有点问题
String oldName = Utils.objectToString(groupExtensionPane.getSelectedObject());
saveMapInfo(oldName);
}
});
@ -205,7 +205,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
return;
}
MapSvgAttr attr = new MapSvgAttr();
attr.setFilePath(MapSvgXMLHelper.customMapPath() + CoreConstants.SEPARATOR + name + ".svg");
attr.setFilePath(MapSvgXMLHelper.customMapPath() + CoreConstants.SEPARATOR + name + ".svg");
MapSvgXMLHelper.getInstance().addNewSvgMaps(name,attr);
}
@ -216,23 +216,23 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
final MapCustomPane image = new MapCustomPane();
image.setImageSelectType(MapShapeValue.AREA);
image.populateBean(oldName);
image.setTypeNameAndMapName(groupExtensionPane.getSelectedType(), Utils.objectToString(groupExtensionPane.getSelectedObject()));
image.setTypeNameAndMapName(groupExtensionPane.getSelectedType(), Utils.objectToString(groupExtensionPane.getSelectedObject()));
mapCheckBeforeEdit(oldName);
final Image oldImage = getMapImage(oldName);
BasicDialog dialog = image.showMediumWindow(SwingUtilities.getWindowAncestor(MapGroupExtensionPane.this), new DialogActionAdapter() {
public void doOk() {
image.updateBean(); // 比较两个前后的名字是否相同, 是图片 如果图片不同, 则直接比较
Image newImage = getMapImage(oldName);
if(!ComparatorUtils.equals(oldImage, newImage)) {
fireStateChange();
}
//versionID递增
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
//versionID递增
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
saveMapInfo(oldName);
refresh();
@ -244,7 +244,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
return editFileItem;
}
//根据地图的名字返回地图的图片
//根据地图的名字返回地图的图片
private Image getMapImage(String mapName) {
if (MapSvgXMLHelper.getInstance().containsMapName(mapName)) {
MapSvgAttr mapAttr = MapSvgXMLHelper.getInstance().getMapAttr(mapName);
@ -253,7 +253,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
}
return mapAttr.getMapImage();
}
return null;
}
@ -269,17 +269,17 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
BasicDialog dialog = image.showMediumWindow(SwingUtilities.getWindowAncestor(image), new DialogActionAdapter() {
public void doOk() {
image.updateBean();
Image newImage = getMapImage(oldName);
if(!ComparatorUtils.equals(oldImage, newImage)) {
fireStateChange();
}
//versionID递增
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
//versionID递增
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
saveMapInfo(oldName);
refresh();
@ -302,10 +302,10 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
public void doOk() {
namedPane.updateBean();// 地图的名称 value对应情况
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
MapSvgAttr old = MapSvgXMLHelper.getInstance().getMapAttr(oldName);
if(old != null) {
old.addVersionID();
}
saveMapInfo(oldName);
}
@ -320,14 +320,14 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
private void showRenameWaring(String newName){
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), "\"" + newName + "\"" + Inter.getLocText("Utils-has_been_existed")
+ "!", Inter.getLocText("FR-Designer_Alert"), JOptionPane.WARNING_MESSAGE);
+ "!", Inter.getLocText("FR-Designer_Alert"), JOptionPane.WARNING_MESSAGE);
}
private JMenuItem createRenameItem() {
JMenuItem renameItem = new JMenuItem(Inter.getLocText("FR-Chart-Map_Rename"));
renameItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String newName = JOptionPane.showInputDialog(DesignerContext.getDesignerFrame().getContentPane(),
String newName = JOptionPane.showInputDialog(DesignerContext.getDesignerFrame().getContentPane(),
Inter.getLocText("FR-Chart-Map_Rename"), groupExtensionPane.getSelectedObject());
if (StringUtils.isNotBlank(newName)) {
String oldName = Utils.objectToString(groupExtensionPane.getSelectedObject());
@ -378,22 +378,22 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
private void refresh() {
this.validate();
this.repaint();
DesignerFrame frame = DesignerContext.getDesignerFrame();
if(frame != null) {
frame.repaint();//kunsnat: 图表属性没变, 只是读取时 内容变化.
}
}
//保存修改过的地图信息
//保存修改过的地图信息
private void saveMapInfo(final String mapName) {
SwingWorker worker = new SwingWorker<Integer, Void>() {
@Override
protected Integer doInBackground() throws Exception {
MapSvgAttr attr = MapSvgXMLHelper.getInstance().getMapAttr(mapName);// 只有在编辑地图时才需要储存相关数据 @kuns
if(attr != null){
attr.writeBack(mapName);
}
if(attr != null){
attr.writeBack(mapName);
}
return 0;
}
@ -413,39 +413,39 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
}
}
/**
* 更新地图属性
* @return 返回地图名称.
*/
/**
* 更新地图属性
* @return 返回地图名称.
*/
public String updateBean(MapPlot plot) {
if(!hasPopulated){
this.populateBean(plot);
hasPopulated = true;
}
MapHelper helper = plot.isSvgMap() ? MapSvgXMLHelper.getInstance() : MapXMLHelper.getInstance();
helper.clearCateNames();
for (String type : TYPE_NAMES) {
Object[] datas = groupExtensionPane.getData(type);
for (Object name : datas) {
helper.addCateNames(type, name);
}
}
return Utils.objectToString(groupExtensionPane.getSelectedObject());
if(!hasPopulated){
this.populateBean(plot);
hasPopulated = true;
}
MapHelper helper = plot.isSvgMap() ? MapSvgXMLHelper.getInstance() : MapXMLHelper.getInstance();
helper.clearCateNames();
for (String type : TYPE_NAMES) {
Object[] datas = groupExtensionPane.getData(type);
for (Object name : datas) {
helper.addCateNames(type, name);
}
}
return Utils.objectToString(groupExtensionPane.getSelectedObject());
}
/**
* 更新地图名称
* @param mapPlot 地图
*/
/**
* 更新地图名称
* @param mapPlot 地图
*/
public void populateBean(MapPlot mapPlot) {
hasPopulated = false;
hasPopulated = false;
groupExtensionPane.clearData();
for (String type : TYPE_NAMES) {
MapHelper helper = mapPlot.isSvgMap() ? MapSvgXMLHelper.getInstance() : MapXMLHelper.getInstance();
MapHelper helper = mapPlot.isSvgMap() ? MapSvgXMLHelper.getInstance() : MapXMLHelper.getInstance();
java.util.List list = helper.getNamesListWithCateName(type);
for (Object name : list) {
groupExtensionPane.addData(name, type);
@ -454,7 +454,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
groupExtensionPane.setSelectedObject(mapPlot.getMapName());
hasPopulated = true;
hasPopulated = true;
}
/**
@ -479,10 +479,10 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
return true;
}
public void setEnabled(boolean isEnabled){
super.setEnabled(isEnabled);
addButton.setEnabled(isEnabled);
popupMenu.setEnabled(isEnabled);
groupExtensionPane.setEnabled(isEnabled);
}
public void setEnabled(boolean isEnabled){
super.setEnabled(isEnabled);
addButton.setEnabled(isEnabled);
popupMenu.setEnabled(isEnabled);
groupExtensionPane.setEnabled(isEnabled);
}
}

45
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java

@ -1,34 +1,13 @@
package com.fr.design.chart.series.PlotSeries;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.util.*;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.base.*;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.chart.chartglyph.MapShapeValue;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -37,13 +16,23 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UISelectTable;
import com.fr.design.gui.itable.UITableNoOptionUI;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
/**
* 地图 图片编辑界面 选中图片 编辑. 支持鼠标选中等事件

29
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java

@ -96,7 +96,7 @@ public class DataLabelPane extends TooltipContentsPane {
}
delimiterBox.setPreferredSize(new Dimension(70, 20));
JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
boxPane.add(new UILabel(Inter.getLocText("Form-Delimiter") + ":"));
boxPane.add(new UILabel(Inter.getLocText("FR-Designer_Dismenber") + ":"));
boxPane.add(delimiterBox);
return boxPane;
}
@ -111,34 +111,9 @@ public class DataLabelPane extends TooltipContentsPane {
}
protected JPanel createJPanel4Position() {
// 标签位置:上下左右中.
bottomButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Bottom"));
leftButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Left"));
rigtButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Right"));
topButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Top"));
centerButton = new UIRadioButton(Inter.getLocText("Center"));
ButtonGroup bg = new ButtonGroup();
bg.add(bottomButton);
bg.add(leftButton);
bg.add(rigtButton);
bg.add(topButton);
bg.add(centerButton);
topButton.setSelected(true);
JPanel buttonPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPane.add(new UILabel(Inter.getLocText(new String[]{"Label", "Layout"}) + ":"));
buttonPane.add(bottomButton);
buttonPane.add(leftButton);
buttonPane.add(rigtButton);
buttonPane.add(topButton);
buttonPane.add(centerButton);
return buttonPane;
return null;
}
public void populate(AttrContents seriesAttrContents) {
super.populate(seriesAttrContents);
String dataLabel = seriesAttrContents.getSeriesLabel();

2
designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java

@ -30,7 +30,7 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{
return new Dimension(super.getPreferredSize().width, 18);
}
};
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
nameLabel.setHorizontalAlignment(SwingConstants.CENTER);
}

61
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -30,11 +31,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
public MiddleChartPropertyPane() {
initComponenet();
}
protected void initComponenet() {
this.setLayout(new BorderLayout());
this.setBorder(null);
createNameLabel();
this.add(createNorthComponent(), BorderLayout.NORTH);
chartEditPane = StableUtils.construct(ChartEditPane.class);
@ -47,11 +48,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
this.createMainPane();
setSureProperty();
}
protected abstract void createNameLabel();
protected abstract JComponent createNorthComponent();
protected abstract void createMainPane();
@ -64,10 +65,10 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener);
String tabname = chartEditPane.getSelectedTabName();
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : ""));
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : StringUtils.EMPTY));
resetChartEditPane();
}
protected void resetChartEditPane() {
remove(chartEditPane);
add(chartEditPane, BorderLayout.CENTER);
@ -75,20 +76,20 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
repaint();
revalidate();
}
protected TitleChangeListener titleListener = new TitleChangeListener() {
@Override
public void fireTitleChange(String addName) {
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName);
}
};
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) {
addChartEditPane(collection.getSelectedChart().getPlot().getPlotID());
setSupportCellData(true);
@ -96,11 +97,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.populate(collection);
}
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> ePane) {
if (collection instanceof ChartCollection) {
populateChartPropertyPane((ChartCollection)collection, ePane);
@ -127,18 +128,18 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
return BaseUtils.readIcon("/com/fr/design/images/m_report/qb.png");
}
/**
* 预定义定位
* @return 定位
*/
/**
* 预定义定位
* @return 定位
*/
public Location preferredLocation() {
return Location.WEST_BELOW;
}
/**
* 创建标题Panel
* @return 标题panel
*/
/**
* 创建标题Panel
* @return 标题panel
*/
public UITitlePanel createTitlePanel() {
return new UITitlePanel(this);
}
@ -148,14 +149,14 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
*/
public void refreshDockingView() {
// TODO Auto-generated method stub
}
/**
* 设置是否支持单元格数据.
*/
public void setSupportCellData(boolean supportCellData) {
if(chartEditPane != null) {
if (chartEditPane != null) {
chartEditPane.setSupportCellData(supportCellData);
}
}

56
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

@ -21,6 +21,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -30,7 +31,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider {
public class ChartEditPane extends BasicPane implements AttributeChange, Prepare4DataSourceChange, ChartEditPaneProvider {
private final static int CHANGE_MIN_TIME = 80;
@ -118,7 +119,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("error in clone ChartEditPane");
}
if(ComparatorUtils.equals(selectedPane.title4PopupWindow(),PaneTitleConstants.CHART_STYLE_TITLE)){
if (ComparatorUtils.equals(selectedPane.title4PopupWindow(), PaneTitleConstants.CHART_STYLE_TITLE)) {
dealWithStyleChange();
}
@ -129,10 +130,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/**
* 重新构造面板
*
* @param currentChart 图表
*/
public void reLayout(Chart currentChart){
if(currentChart != null){
public void reLayout(Chart currentChart) {
if (currentChart != null) {
int chartIndex = getSelectedChartIndex(currentChart);
this.removeAll();
this.setLayout(new BorderLayout());
@ -140,22 +142,22 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
addTypePane();
boolean isDefault = true;
String plotID = "";
if(currentChart.getPlot() != null){
String plotID = StringUtils.EMPTY;
if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID();
isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
}
if(isDefault){
if (isDefault) {
paneList.add(dataPane4SupportCell);
paneList.add(stylePane);
paneList.add(otherPane);
this.isDefaultPane = true;
}else{
} else {
ChartDataPane chartDataPane = createChartDataPane(plotID);
paneList.add(chartDataPane);
AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener);
for(int i = 0; i < otherPaneList.length; i++){
for (int i = 0; i < otherPaneList.length; i++) {
otherPaneList[i].addAttributeChangeListener(listener);
paneList.add(otherPaneList[i]);
}
@ -177,6 +179,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
protected void setSelectedTab() {
//doNothing
}
/**
@ -222,7 +225,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return;
}
if(checkNeedsReLayout(collection.getSelectedChart())){
if (isNeedsReLayout(collection.getSelectedChart())) {
reLayout(collection.getSelectedChart());
}
@ -249,12 +252,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
}
public int getSelectedChartIndex(Chart chart){
public int getSelectedChartIndex(Chart chart) {
int index = 0;
if(typePane != null){
if (typePane != null) {
FurtherBasicBeanPane[] paneList = typePane.getPaneList();
for(; index < paneList.length; index++){
if(paneList[index].accept(chart)){
for (; index < paneList.length; index++) {
if (paneList[index].accept(chart)) {
return index;
}
}
@ -263,12 +266,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
//populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart){
if(chart != null){
private boolean isNeedsReLayout(Chart chart) {
if (chart != null) {
int lastIndex = typePane.getSelectedIndex();
int currentIndex = getSelectedChartIndex(chart);
boolean currentPane = true;
if(chart.getPlot() != null){
if (chart.getPlot() != null) {
String plotID = chart.getPlot().getPlotID();
currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
}
@ -279,9 +282,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/**
* 当前界面是否是默认的界面
*
* @return 是否是默认的界面
*/
public boolean isDefaultPane(){
public boolean isDefaultPane() {
return this.isDefaultPane;
}
@ -313,16 +317,17 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
}
protected void dealWithStyleChange(){
protected void dealWithStyleChange() {
//doNothing
}
/**
*主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
* 主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
*
* @param isFromToolBar 是否来自工具栏
*/
public void styleChange(boolean isFromToolBar){
public void styleChange(boolean isFromToolBar) {
//doNothing
}
/**
@ -341,7 +346,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex());
attrPane.refreshChartDataPane(collection);
//不显示,没有处于编辑状态,没必要更新。
if (attrPane.isShowing()) {
attrPane.refreshChartDataPane(collection);
}
}
});
}

4
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -17,6 +17,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
@ -238,6 +239,9 @@ public class ChartTypePane extends AbstractChartAttrPane{
for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) {
GUICoreUtils.setEnabled(chartTypeComBox.getUIComboBox(), ob.isValidPlot());
pane.populateBean(ob);
Object item = pane.title4PopupWindow();
for (int j = 0; j < cardNames.length; j++) {

155
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -5,6 +5,7 @@ import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -21,6 +22,7 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -30,130 +32,138 @@ import java.util.ArrayList;
*/
public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotReportDataContentPane implements UIObserver{
private static final long serialVersionUID = -1122313353777460534L;
private JPanel boxPane;
private UIButton addButton;
private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>();
private UIObserverListener uiobListener = null;
public List<TinyFormulaPane> getFormualList() {
return formualList;
}
public CategoryPlotMoreCateReportDataContentPane() {
}
public CategoryPlotMoreCateReportDataContentPane(ChartDataPane parent) {
initEveryPane();
categoryName = initCategoryBox(Inter.getLocText("FR-Chart-Category_Name"));
JPanel catePane = new JPanel();
catePane.setLayout(new BorderLayout(2, 2));
catePane.add(categoryName);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, 20));
catePane.add(addButton, BorderLayout.EAST);
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane.setBackground(Color.red);
catePane.add(boxPane, BorderLayout.SOUTH);
initEveryPane();
categoryName = initCategoryBox(Inter.getLocText("FR-Chart-Category_Name"));
JPanel catePane = new JPanel();
catePane.setLayout(new BorderLayout(2, 2));
catePane.add(categoryName);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, 20));
catePane.add(addButton, BorderLayout.EAST);
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane.setBackground(Color.red);
catePane.add(boxPane, BorderLayout.SOUTH);
catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15));
this.add(catePane, "0,0,2,0");
this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() {
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
addNewCatePane();
}
});
}
/**
* 检查box 是否应该可用状态.
*/
public void checkBoxUse() {
super.checkBoxUse();
String text = categoryName.getUITextField().getText();
addButton.setEnabled(StringUtils.isNotEmpty(text));
}
/**
* 检查box 是否应该可用状态.
*/
public void checkBoxUse() {
super.checkBoxUse();
String text = categoryName.getUITextField().getText();
addButton.setEnabled(StringUtils.isNotEmpty(text));
}
private TinyFormulaPane addNewCatePane() {
final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY);
pane.setPreferredSize(new Dimension(106, 16));
pane.registerChangeListener(uiobListener);
formualList.add(pane);
final JPanel newButtonPane = new JPanel();
newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
newButtonPane.add(pane);
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
newButtonPane.add(delButton);
boxPane.add(newButtonPane);
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane);
formualList.remove(pane);
checkAddButton();
checkComponent();
relayoutPane();
}
});
delButton.registerChangeListener(uiobListener);
checkAddButton();
checkComponent();
relayoutPane();
return pane;
}
private void checkAddButton() {
int size = formualList.size();
addButton.setEnabled(size < 2);
}
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() {
this.revalidate();
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
uiobListener = listener;
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
formualList.clear();
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
@ -165,23 +175,28 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
}
}
}
checkAddButton();
}
public void updateBean(ChartCollection collection) {
super.updateBean(collection);
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
Plot plot = collection.getSelectedChart().getPlot();
if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate();
for(int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
}
updateMoreCate(reportDefinition, plot);
}
}
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) {
for (int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
}
}
}

47
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -41,7 +42,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private UIButton addButton;
private UIObserverListener uiobListener = null;
public List<UIComboBox> getBoxList() {
return boxList;
}
public CategoryPlotMoreCateTableDataContentPane() {
// do nothing
}
@ -89,8 +94,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
checkAddButton();
checkComponent();
}
});
}
@ -129,15 +134,15 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
buttonPane.add(delButton);
boxPane.add(buttonPane);
boxList.add(combox);
checkAddButton();
checkComponent();
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane);
boxList.remove(combox);
checkAddButton();
checkComponent();
relayoutPane();
}
});
@ -150,6 +155,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
int size = boxList.size();
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null);
}
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() {
this.revalidate();
@ -162,8 +171,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
checkAddButton();
checkComponent();
}
protected void refreshBoxListWithSelectTableData(List list) {
@ -221,17 +230,23 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/
public void updateBean(ChartCollection collection) {
super.updateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if(top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition)top;
Plot plot = collection.getSelectedChart().getPlot();
if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
normal.clearMoreCate();
for(int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i);
if(box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString());
}
updateMoreCate(normal, plot);
}
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
for (int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i);
if (box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString());
}
}
}
}

347
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -21,6 +21,7 @@ import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane;
@ -30,6 +31,8 @@ import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButton;
@ -76,9 +79,10 @@ import java.text.DecimalFormat;
import java.text.Format;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{
private static final long serialVersionUID = 3477409806918835992L;
private static final long serialVersionUID = 3477409806918835992L;
private static HashMap normalMap = new HashMap();
private static HashMap gisMap = new HashMap();
private static HashMap mapMap = new HashMap();
@ -92,16 +96,16 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private static final int TIME_SWITCH_GAP = 40;
private UICheckBox isChartAnimation;// 动态
private UICheckBox isChartAnimation;// 动态
private UICheckBox isSeriesDragEnable; //系列拖拽
private UICheckBox isAxisZoom;// 缩放
private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat;
private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat;
private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat;
private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat;
private UILabel tooltipStyleLabel;
private UIComboBox tooltipStyle;
@ -113,55 +117,55 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private UICheckBox isAddress;
private UICheckBox isAddressName;
private UICheckBox isAxisShowToolTip;// 坐标轴提示
private UICheckBox isAxisShowToolTip;// 坐标轴提示
protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime;
protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime;
private UICorrelationComboBoxPane superLink;// 超链
private UICorrelationComboBoxPane superLink;// 超链
private FormatPane valueFormatPane;
private FormatPane percentFormatPane;
private Format valueFormat;
private Format percentFormat;
private FormatPane valueFormatPane;
private FormatPane percentFormatPane;
private Format valueFormat;
private Format percentFormat;
private JPanel tooltipPane;
private JPanel axisShowPane;
private JPanel autoRefreshPane;
private JPanel superlinkPane;
private JPanel tooltipPane;
private JPanel axisShowPane;
private JPanel autoRefreshPane;
private JPanel superlinkPane;
private ChartOtherPane parent;
private ChartOtherPane parent;
private UICheckBox timeSwitch;
private JPanel timeSwitchContainer;
private TimeSwitchPane timeSwitchPane;
private static final int SIZEX = 258;
private static final int SIZEY = 209;
private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
}
private static final int SIZEX = 258;
private static final int SIZEY = 209;
private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
}
/**
* 界面标题.
/**
* 界面标题.
* @return 返回标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab");
}
@Override
protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab");
}
@Override
protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name"));
tooltipShowType = new UIComboBox(new String []{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")});
@ -171,13 +175,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address"));
isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name"));
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane();
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane();
isAutoRefresh.addActionListener(new ActionListener() {
isAutoRefresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkAutoRefresh();
@ -185,9 +189,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
});
timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch"));
timeSwitchPane = new TimeSwitchPane();
initFormatListener();
return initPaneWithListener();
}
initFormatListener();
return initPaneWithListener();
}
private void initFormatListener() {
@ -263,19 +267,19 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
});
}
private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
}
/**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return
*/
private JPanel initPaneWithListener() {
initDataPointToolTipPane();
initAxisShowPane();
initAutoRefreshPane();
initSuperlinkPane();
private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
}
/**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return
*/
private JPanel initPaneWithListener() {
initDataPointToolTipPane();
initAxisShowPane();
initAutoRefreshPane();
initSuperlinkPane();
initTimeSwitchPane();
@ -294,7 +298,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
};
//初始化界面时 加载事件
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
}
private void initTimeSwitchPane(){
timeSwitchContainer = new JPanel(new BorderLayout());
@ -306,11 +310,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
/**
* 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout.
*/
private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p};
private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
@ -321,7 +325,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipStyleLabel, tooltipStyle}
};
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
}
}
private void relayoutDataPointToolTipPane(Plot plot) {
double p = TableLayout.PREFERRED;
@ -356,8 +360,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else {
rowSize = new double[]{p, p, p};
components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
getTooltipStyleComponent()
};
}
@ -393,49 +397,49 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
}
private void initAxisShowPane() {
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip},
};
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
}
private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p};
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)},
private void initAxisShowPane() {
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip},
};
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
}
private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p};
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)},
new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null},
};
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize);
}
private void initSuperlinkPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{superLink, null},
};
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
}
private void relayoutWithPlot(Plot plot) {
this.removeAll();
double p = TableLayout.PREFERRED;
};
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize);
}
private void initSuperlinkPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{superLink, null},
};
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
}
private void relayoutWithPlot(Plot plot) {
this.removeAll();
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{TableLayout.FILL};
double[] rowSize = new double[]{p, p, p};
@ -450,7 +454,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
double[] row = new double[]{p, p, p, p, p, p};
reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize));
}
}
private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) {
@ -478,9 +482,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
if(timeSwitch.isSelected()){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] rowSize = new double[]{p};
double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{null, timeSwitchPane},
};
@ -546,15 +550,15 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[]{superlinkPane};
}
@Override
public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
@Override
public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
Plot plot = chart.getPlot();
Plot plot = chart.getPlot();
relayoutWithGis(chart, plot);
relayoutWithPlot(plot);
relayoutWithPlot(plot);
populateChartAnimate(chart, plot);
populateChartScale(plot);
@ -563,8 +567,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
populateAutoRefresh(chart);
populateHyperlink(plot);
checkAutoRefresh();
}
checkAutoRefresh();
}
private void relayoutWithGis(Chart chart, Plot plot) {
if(plot.isSupportAddress4Gis()) {
@ -602,7 +606,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
timeSwitch.setEnabled(false);
//只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换
if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){
return;
return;
}
if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){
@ -678,6 +682,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private void populateHyperlink(Plot plot) {
HashMap paneMap = renewMapWithPlot(plot);
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator();
paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
List<UIMenuNameableCreator> list = refreshList(paneMap);
superLink.refreshMenuAndAddMenuAction(list);
@ -695,13 +706,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.doLayout();
}
@Override
public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
@Override
public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
Plot plot = chart.getPlot();
Plot plot = chart.getPlot();
updateChartAnimate(chart, plot);
updateChartScale(plot);
@ -709,7 +720,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
updateAxisTip(plot);
updateAutoRefresh(plot);
updateHyperlink(plot);
}
}
private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) {
@ -841,7 +852,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){
return (Class<? extends BasicBeanPane>)map.get(key);
}
@ -855,33 +866,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
}
return null;
}
protected List<UIMenuNameableCreator> refreshList(HashMap map) {
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
}
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"),
protected List<UIMenuNameableCreator> refreshList(HashMap map) {
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"),
new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"),
new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class)));
list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class)));
list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"),
new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"),
new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"),
new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class)));
FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Form"),
hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list;
}
hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list;
}
private HashMap renewMapWithPlot(Plot plot) {
if(plot instanceof PiePlot) {
@ -1044,8 +1055,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private HashMap getNormalPlotHyperMap() {
if(normalMap.isEmpty()) {
FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART.class);
normalMap.put(EmailJavaScript.class, ChartEmailPane.class);
normalMap.put(WebHyperlink.class, WebHyperlinkPane.CHART.class);
@ -1064,27 +1075,27 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
return normalMap;
}
@Override
public Chart updateBean() {
return null;
}
@Override
public Chart updateBean() {
return null;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
timeSwitch.registerChangeListener(listener);
timeSwitchPane.registerChangeListener(listener);
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}

13
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -43,6 +43,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
protected List<ChartImagePane> styleList;
protected JPanel stylePane; //样式布局的面板
private JPanel typePane;
protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath();
@ -70,10 +71,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
checkDemosBackground();
JPanel typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
this.typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
for(int i = 0; i < typeDemo.size(); i++) {
ChartImagePane tmp = typeDemo.get(i);
typePane.add(tmp);
this.typePane.add(tmp);
tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()]));
}
@ -99,7 +100,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
stylePane.setVisible(false);
}
JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(typePane),rowSize,columnSize);
JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(this.typePane),rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
}
@ -133,7 +134,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
}
//子类覆盖
protected Plot getSelectedClonedPlot(){
protected <T extends Plot> T getSelectedClonedPlot(){
return null;
}
@ -586,6 +587,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
&& chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE;
}
protected JPanel getTypePane(){
return this.typePane;
}
public Chart getDefaultChart() {
return BarIndependentChart.barChartTypes[0];
}

42
designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java

@ -0,0 +1,42 @@
package com.fr.design.mainframe.chart.gui.type;
import com.fr.chart.chartattr.Chart;
/**
* Created by mengao on 2017/8/30.
* 不能删掉这个类echarts插件中用到
*/
public abstract class UserDefinedChartTypePane extends AbstractChartTypePane {
protected String[] getTypeLayoutPath() {
return new String[0];
}
protected String[] getTypeLayoutTipName(){
return new String[0];
}
protected String[] getTypeIconPath(){
return new String[]{"/com/fr/design/images/chart/default.png"};
}
protected String[] getTypeTipName() {
return new String[]{title4PopupWindow()};
}
public void updateBean(Chart chart) {
}
public void populateBean(Chart chart){
typeDemo.get(0).isPressing = true;
checkDemosBackground();
}
/**
* 弹出界面的标题
* @return 标题
*/
public String title4PopupWindow(){
return "";
}
}

1
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -20,6 +20,7 @@ import java.util.List;
/**
* Created by mengao on 2017/8/22.
* 自定义警戒线列表面板
*/
public class AlertLineListControlPane extends UIListControlPane {

1
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -21,6 +21,7 @@ import java.util.List;
/**
* Created by mengao on 2017/8/22.
* 自定义间隔背景列表面板
*/
public class BackgroundListControlPane extends UIListControlPane {

6
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -81,7 +81,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
protected JPanel createIntervalPane(double[] row, double[] col) {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Default_Interval"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100);
verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents();
@ -90,7 +90,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
centerPane.add(defaultPane, Inter.getLocText("Plugin-ChartF_IntervalBackground"));
centerPane.add(defaultPane, Inter.getLocText("Plugin-ChartF_Default_Interval"));
centerPane.add(customIntervalBackground, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
isDefaultIntervalBackground.addActionListener(new ActionListener() {
@Override
@ -117,7 +117,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void checkCardPane() {
if (isDefaultIntervalBackground.getSelectedIndex() == 0) {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground"));
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_Default_Interval"));
} else {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
}

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

@ -50,7 +50,7 @@ public class XCheckBoxGroup extends XFieldEditor {
new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class),
new CRPropertyDescriptor("chooseAll", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Provide", "Choose_All"})).putKeyValue(
Inter.getLocText("FR-Designer_Provide_Choose_All")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class)

4
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -389,8 +389,8 @@ public class XCardSwitchButton extends XButton {
return;
}
int tabLength = this.tagLayout.getComponentCount();
Map<Integer, Integer> cardWidth = new HashMap<>();
Map<Integer, Integer> cardHeight = new HashMap<>();
Map<Integer, Integer> cardWidth = new HashMap<Integer, Integer>();
Map<Integer, Integer> cardHeight = new HashMap<Integer, Integer>();
for (int i = 0; i < tabLength; i++) {
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton tempCard = (CardSwitchButton) temp.toData();

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

@ -60,7 +60,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
.setRendererClass(BooleanRender.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit"))
};
List<CRPropertyDescriptor> defaultList = new ArrayList<>();
List<CRPropertyDescriptor> defaultList = new ArrayList<CRPropertyDescriptor>();
for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) {
defaultList.add(propertyDescriptor);

2
designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

@ -54,7 +54,7 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
creator.resetCreatorName(value.toString());
}
if(ComparatorUtils.equals("visible", properties[row].getName())){
creator.resetVisible((boolean) value);
creator.resetVisible((Boolean) value);
}
properties[row].firePropertyChanged();
return true;

33
designer_form/src/com/fr/design/mainframe/FormArea.java

@ -35,6 +35,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private static final int ROTATIONS = 50;
private static final int SHOWVALMAX = 400;
private static final int SHOWVALMIN = 10;
private static final int RESIZE_PANE_GAP = 8;
private FormDesigner designer;
private int horizontalValue = 0;
private int verticalValue = 0;
@ -86,8 +87,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
}
this.setFocusTraversalKeysEnabled(false);
this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener);
this.setOpaque(true);
this.setBackground(Color.WHITE);
}
MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() {
@ -121,11 +120,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
slidePane = JFormSliderPane.getInstance();
slidePane.setPreferredSize(new Dimension(200, 20));
JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"),
heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane}},
rowSize, columnSize, 8);
JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{ tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"), heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane }}, rowSize, columnSize, RESIZE_PANE_GAP);
this.add(FormRulerLayout.BOTTOM, resizePane);
setWidgetsConfig();
// 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小
@ -441,17 +436,20 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
int id = evt.getID();
switch (id) {
case MouseEvent.MOUSE_WHEEL: {
int rotations = evt.getWheelRotation();
int value = this.verScrollBar.getValue() + rotations * ROTATIONS;
value = Math.min(value, verticalMax);
value = Math.max(0, value);
doLayout(); //加dolayout是因为每次滚动都要重置 Max的大小
this.verScrollBar.setValue(value);
onMouseWheelScroll(evt);
break;
}
default:
}
}
private void onMouseWheelScroll(MouseWheelEvent evt) {
int value = this.verScrollBar.getValue() + evt.getWheelRotation() * ROTATIONS;
value = Math.max(0, Math.min(value, verticalMax));
doLayout(); //加dolayout是因为每次滚动都要重置 Max的大小
this.verScrollBar.setValue(value);
}
/**
* 返回表单容器的中心designer
* getFormEditor.
@ -745,9 +743,12 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
}
private class FormRulerLayout extends RulerLayout {
private int DESIGNERWIDTH = 960;
private int DESIGNERHEIGHT = 540;
private int TOPGAP = 8;
private static final int DESIGNER_WIDTH = 960;
private static final int DESIGNER_HEIGHT = 540;
private static final int TOPGAP = 8;
private int DESIGNERWIDTH = DESIGNER_WIDTH;
private int DESIGNERHEIGHT = DESIGNER_HEIGHT;
public FormRulerLayout() {
super();

55
designer_form/src/com/fr/design/mainframe/JForm.java

@ -93,6 +93,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override
public void refreshEastPropertiesPane() {
// 暂时用不到,遇到的时候再加刷新右侧tab面板的代码
return;
}
@Override
@ -126,7 +128,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override
public void setJTemplateResolution(int resolution) {
return;
}
@Override
@ -220,7 +222,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
formDesign = new FormDesigner(this.getTarget(), new TabChangeAction(BaseJForm.ELEMENTCASE_TAB, this));
WidgetToolBarPane.getInstance(formDesign);
FormArea area = new FormArea(formDesign);
centerPane.add(area, BorderLayout.CENTER);
JPanel areaWrapper = new JPanel(new BorderLayout());
areaWrapper.add(area, BorderLayout.CENTER);
areaWrapper.setBackground(Color.white);
centerPane.add(areaWrapper, BorderLayout.CENTER);
tabCenterPane.add(centerPane, FORM_CARD, FORM_TAB);
this.add(tabCenterPane, BorderLayout.CENTER);
@ -267,14 +272,14 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
}
public void setSheetCovered(boolean isCovered) {
return;
}
/**
* 刷新容器
*/
public void refreshContainer() {
return;
}
/**
@ -286,6 +291,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override
public void setScale(int resolution) {
return;
}
@Override
@ -461,15 +467,9 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override
public ShortCut[] shortcut4TemplateMenu() {
if (this.index == FORM_TAB) {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{
new TemplateParameterAction(this),
new FormMobileAttrAction(this)
}, new ShortCut[0]);
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this)}, new ShortCut[0]);
} else {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{
new TemplateParameterAction(this),
new FormMobileAttrAction(this)
}, this.elementCaseDesign.shortcut4TemplateMenu());
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu());
}
}
@ -528,18 +528,21 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override
protected void applyUndoState(FormUndoState u) {
try {
//JForm的target重置
this.setTarget((Form) u.getForm().clone());
if (this.index == FORM_TAB) {
//JForm的target重置
this.setTarget((Form) u.getForm().clone());
JForm.this.refreshRoot();
this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue());
//撤销的时候要重新选择的body布局
this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(),
formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()}));
} else {
// 只在报表块里撤销是不需要修改外部form对象的, 因为编辑的是当前报表块.
// 修改了JForm的Target需要同步修改formDesign的Target.
Form undoForm = (Form) u.getForm().clone();
String widgetName = this.formDesign.getElementCaseContainerName();
//这儿太坑了,u.getForm() 与 getTarget内容不一样
FormElementCaseProvider dataTable = getTarget().getElementCaseByName(widgetName);
FormElementCaseProvider dataTable = undoForm.getElementCaseByName(widgetName);
this.reportComposite.setSelectedWidget(dataTable);
//下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC
formDesign.setElementCase(dataTable);
@ -677,16 +680,14 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return;
}
if (formDesign.isReportBlockEditing()) {
if (elementCaseDesign != null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT);
EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane());
EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane());
return;
}
if (formDesign.isReportBlockEditing() && elementCaseDesign != null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT);
EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane());
EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane());
return;
}
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
@ -696,6 +697,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
refreshWidgetLibPane();
}
private void refreshWidgetLibPane() {
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() {
public void run() {

Loading…
Cancel
Save