Browse Source

无JIRA任务,合并冲突

master
plough 7 years ago
parent
commit
39107f97c6
  1. 73
      designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
  2. 4
      designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
  3. 53
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  4. 14
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  5. 1
      designer/src/com/fr/design/mainframe/JWorkBook.java
  6. 28
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  7. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  8. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  9. 9
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  10. 3
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  11. 1
      designer_base/src/com/fr/design/gui/UILookAndFeel.java
  12. 3
      designer_base/src/com/fr/design/gui/borders/UITextFieldBorder.java
  13. 61
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  14. 89
      designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java
  15. 47
      designer_base/src/com/fr/design/gui/ipasswordfield/UIPassWordField.java
  16. 114
      designer_base/src/com/fr/design/gui/ispinner/UISpinner.java
  17. 22
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  18. 35
      designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java
  19. 73
      designer_base/src/com/fr/design/gui/itextfield/UINumberField.java
  20. 10
      designer_base/src/com/fr/design/locale/designer.properties
  21. 10
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  22. 4
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  23. 10
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  24. 10
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  25. 1
      designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  26. 5
      designer_base/src/com/fr/start/StartServer.java
  27. 4
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

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();
}
}

53
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
@ -15,14 +14,12 @@ import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.webattr.ToolBarButton;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -39,12 +36,8 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray;
public AuthorityEditToolBarPane(List<ToolBarButton> buttonList) {
public AuthorityEditToolBarPane(List<ToolBarButton> buttonlists) {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.init(buttonList);
}
private void init(List<ToolBarButton> buttonList) {
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Permissions",
@ -60,7 +53,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
// this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new AuthorityEditPane(buttonList);
authorityEditPane = new AuthorityEditPane(buttonlists);
this.add(authorityEditPane, BorderLayout.CENTER);
}
@ -102,25 +95,27 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
initSelectedPathArray();
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole == null || selectedPathArray == null) {
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole ==
null || selectedPathArray == null) {
return;
}
ToolBarButton selectedButton = null;
//是否可见的checkbox
UICheckBox checkbox = (UICheckBox) e.getSource();
for (int t = 0; t < selectedPathArray.length; t++) {
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
selectedButton = buttonlists.get(i);
buttonlists.get(i).changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
}
}
if (selectedButton != null) {
for (int t = 0; t < selectedPathArray.length; t++) {
selectedButton.changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
authorityToolBarPane.setAuthorityWebAttr(selectedButton.getWidget(), checkbox.isSelected(), selectedPathArray[t]);
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
UICheckBox checkbox = (UICheckBox) e.getSource();
List<ToolBarButton> btns = AuthorityEditPane.this.buttonlists;
for (int j = 0; j < btns.size(); j++) {
if (btns.get(j).isSelected()) {
//由引擎实现保存进模板报表
authorityToolBarPane.setAuthorityWebAttr(btns.get(j).getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();//模版更新
RolesAlreadyEditedPane.getInstance().refreshDockingView();//已配置角色视图刷新
}
}
};
@ -210,29 +205,29 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() {
if (StringUtils.EMPTY.equals(name.getText())) {
type.setText(StringUtils.EMPTY);
if (name.getText() == "") {
type.setText("");
} else {
type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"}));
}
}
public void populateName() {
StringBuilder names = new StringBuilder();
String names = "";
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
names.append(",").append(buttonlists.get(i).getNameOption().optionName());
names += "," + buttonlists.get(i).getNameOption().optionName();
}
}
if (names.length() > 0) {
names.deleteCharAt(0);
if (names != "") {
names = names.substring(1);
}
name.setText(names.toString());
name.setText(names);
}
public void populateCheckPane() {
checkPane.removeAll();
if (StringUtils.EMPTY.equals(name.getText())) {
if (name.getText() == "") {
return;
}
double f = TableLayout.FILL;

14
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -218,24 +218,27 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
ReportWebAttr rw = wbTpl.getReportWebAttr();
ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
if (webAttr == null || rw == null || rw.getWebPage() == null) {
return;
}
//wbTpl.clear先清空
//再将所有的保存进去
//看是存在服务器还存在模板里面
if (choseComboBox.getSelectedIndex() == 0) {
//分页
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebPage(), widget, isSelected, selectedRole);
}
} else if (choseComboBox.getSelectedIndex() == 1) {
//填报
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
}
} else {
//view
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebView(), widget, isSelected, selectedRole);
}
}
}
private void dealWithWebContent(WebContent wc, Widget widget, boolean isSelected, String selectedRole) {
ToolBarManager[] managers = wc.getToolBarManagers();
@ -245,7 +248,9 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
for (int i = 0; i < managers.length; i++) {
ToolBar tb = managers[i].getToolBar();
for (int j = 0; j < tb.getWidgetSize(); j++) {
if (widget instanceof Button && tb.getWidget(j) instanceof Button && ComparatorUtils.equals(((Button) widget).getIconName(), ((Button) tb.getWidget(j)).getIconName())) {
if (widget instanceof Button && tb.getWidget(j) instanceof Button) {
if (ComparatorUtils.equals(((Button) widget).getIconName(),
((Button) tb.getWidget(j)).getIconName())) {
if (!isSelected) {
tb.getWidget(j).getWidgetPrivilegeControl().addInvisibleRole(selectedRole);
} else {
@ -254,6 +259,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
}
}
}
}
wc.setToolBarManagers(managers);
}

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

@ -399,7 +399,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution);
polyDezi.updateUI();
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
}
@Override

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_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() {

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);
}
}
}

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);
}

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);
}
}
}

114
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,24 +7,32 @@ 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 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 = "";
private String spinnerName = StringUtils.EMPTY;
private UIObserverListener uiObserverListener;
private GlobalNameListener globalNameListener = null;
@ -70,6 +66,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/**
* 给组件分别加上FocusListener
*
* @param focusListener 监听事件
*/
public void addUISpinnerFocusListenner(FocusListener focusListener) {
@ -139,7 +136,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
/**
*增加 a <code>ChangeListener</code> to the listener list.
* 增加 a <code>ChangeListener</code> to the listener list.
*
* @param l 监听事件
*/
public void addChangeListener(ChangeListener l) {
@ -147,7 +145,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
/**
*移除 a <code>ChangeListener</code> from the listener list.
* 移除 a <code>ChangeListener</code> from the listener list.
*
* @param l 监听事件
*/
public void removeChangeListener(ChangeListener l) {
@ -171,8 +170,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
textField.setMaxValue(maxValue);
textField.setMinValue(minValue);
setValue(value);
textField.setUI(new SpinnerTextFieldUI(textField));
preButton = new UIButton(UIConstants.ARROW_UP_ICON){
preButton = new UIButton(UIConstants.ARROW_UP_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
@ -189,15 +187,15 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
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);
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) {
@ -256,6 +254,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
@ -289,63 +288,24 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
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);
}
}
/**
* 程序入口 测试
*
* @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);
// 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);
}
}

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

@ -1,20 +1,14 @@
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;
import javax.swing.*;
import javax.swing.plaf.basic.BasicTextAreaUI;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class UITextAreaUI extends BasicTextAreaUI {
protected boolean isRollOver;
private JComponent textField;
@ -37,19 +31,12 @@ public class UITextAreaUI extends BasicTextAreaUI {
});
}
@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);
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 {
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawRoundRect(1, 1, width - 2, height - 2, UIConstants.ARC, UIConstants.ARC);
GUIPaintUtils.drawBorder(g2d, 0, 0, width, height, isRound, rectDirection);
}
}

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

@ -17,24 +17,27 @@ import java.awt.*;
*/
public class UINumberField extends UITextField {
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 = 24;
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 int maxDecimalLength = MAX_DECIMALLENGTH;
private double minValue = -Double.MAX_VALUE;
private double maxValue = Double.MAX_VALUE;
private boolean isContentChanged = false;
public UINumberField() {
this(32, 16);
this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH);
}
public UINumberField(int columns) {
@ -54,7 +57,7 @@ public class UINumberField extends UITextField {
setFieldDocument();
}
public void setFieldDocument(){
public void setFieldDocument() {
setDocument(new NumberDocument());
initListener();
}
@ -123,8 +126,7 @@ public class UINumberField extends UITextField {
/**
* Set property integer.
*
* @param integer
* New value of property integer.
* @param integer New value of property integer.
*/
public void setInteger(boolean integer) {
if (integer) {
@ -141,7 +143,7 @@ public class UINumberField extends UITextField {
return isContentChanged;
}
public void setisContentChanged(boolean isContentChanged){
public void setisContentChanged(boolean isContentChanged) {
this.isContentChanged = isContentChanged;
}
@ -151,15 +153,14 @@ public class UINumberField extends UITextField {
}
class NumberDocument extends PlainDocument {
public NumberDocument() {
}
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));
}
@ -167,13 +168,13 @@ public class UINumberField extends UITextField {
String str = getText(0, getLength());
// 不能为f,F,d,D
if (checkString(offset,s, str) ) {
if (checkString(offset, s, str)) {
Toolkit.getDefaultToolkit().beep();
return;
}
String strNew = str.substring(0, offset) + s + str.substring(offset, getLength());
if(notChange(strNew)) {
if (notChange(strNew)) {
return;
}
setisContentChanged(true);
@ -216,9 +217,9 @@ public class UINumberField extends UITextField {
}
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),"."));
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), "."));
}
}
@ -226,21 +227,21 @@ public class UINumberField extends UITextField {
* 测试程序
*/
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);
// 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);
}
}

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

@ -1344,8 +1344,6 @@ Remove_All_Button=Remove_All_Button
FR-Designer_Component_Interval=Components Interval
ReportColumns-Columns_vertically=Columns vertically
ReportGUI-Print_Background=Print Background
FR-Designer_Print_Background=Print Background
FR-Designer_Export_Background=Export Background
Export-CSV=CSV
M_Edit-Paste=Paste
FR-Designer-Basic_Restart_Designer=Restart designer
@ -2023,9 +2021,6 @@ FR-Product_Demo=Demo
FR-Designer_Tree_Data_Field=Tree Data Field
FR-Designer_Data_Filter=Data Filter
Default=Default
FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load resource file
FR-Designer_Cell_Element=Cell Element
FR-Designer_Cell_Attributes=Cell Attributes
@ -2146,3 +2141,8 @@ FR-Designer_Cell_Visible=
FR-Designer_Show=
FR-Designer_Float_Visible=
FR-Designer_Cell_Value=
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=

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

@ -1346,8 +1346,6 @@ Remove_All_Button=Remove all buttons
FR-Designer_Component_Interval=Component Interval
ReportColumns-Columns_vertically=Fixed columns per line
ReportGUI-Print_Background=Print/export background
FR-Designer_Print_Background=Print Background
FR-Designer_Export_Background=Export Background
Export-CSV=CSV
M_Edit-Paste=Paste
FR-Designer-Basic_Restart_Designer=Restart designer
@ -2025,9 +2023,6 @@ FR-Designer_Build_Tree_Accord_Parent_Marked_Filed=Build Tree according to the pa
FR-Product_Demo=Demo
FR-Designer_Data_Filter=Data Filter
Default=Default
FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load Configuration File
FR-Designer_Cell_Element=Cell Element
FR-Designer_Cell_Attributes=Cell Attributes
@ -2146,3 +2141,8 @@ FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=

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

@ -1345,8 +1345,6 @@ Remove_All_Button=\uBAA8\uB4E0\uD0A4\uD074\uB9AC\uC5B4
FR-Designer_Component_Interval=\uC5B4\uC148\uBE14\uB9AC\uAC04\uACA9
ReportColumns-Columns_vertically=\uC5F4\uC140\uB098\uB204\uAE30
ReportGUI-Print_Background=\uC778\uC1C4/\uB0B4\uBCF4\uB0B4\uAE30\uBB38\uC11C\uBC30\uACBD
FR-Designer_Print_Background=\uC778\uC1C4\uBB38\uC11C\uBC30\uACBD
FR-Designer_Export_Background=\uB0B4\uBCF4\uB0B4\uAE30\uBB38\uC11C\uBC30\uACBD
Export-CSV=CSV\uC11C\uC2DD(\uC27C\uD45C\uAD6C\uBD84)
M_Edit-Paste=\uBD99\uC5EC\uB123\uAE30(P)
FR-Designer-Basic_Restart_Designer=\uC7AC\uBD80\uD305\uC124\uACC4\uAE30
@ -2146,3 +2144,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD
FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9:
FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C
FR-Designer_Export_Background=
FR-Designer_Print_Background=

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

@ -1347,8 +1347,6 @@ Remove_All_Button=\u6E05\u9664\u6240\u6709\u6309\u94AE
FR-Designer_Component_Interval=\u7EC4\u4EF6\u95F4\u9694
ReportColumns-Columns_vertically=\u5217\u5206\u680F
ReportGUI-Print_Background=\u6253\u5370/\u5BFC\u51FA\u62A5\u8868\u80CC\u666F
FR-Designer_Print_Background=\u6253\u5370\u62A5\u8868\u80CC\u666F
FR-Designer_Export_Background=\u5BFC\u51FA\u62A5\u8868\u80CC\u666F
Export-CSV=CSV\u683C\u5F0F(\u9017\u53F7\u5206\u9694)
M_Edit-Paste=\u7C98\u8D34(P)
FR-Designer-Basic_Restart_Designer=\u91CD\u542F\u8BBE\u8BA1\u5668
@ -2025,9 +2023,6 @@ FR-Designer_Build_Tree_Accord_Parent_Marked_Filed=\u4F9D\u8D56\u6240\u9009\u6570
FR-Product_Demo=\u4EA7\u54C1\u6F14\u793A
FR-Designer_Data_Filter=\u6570\u636E\u7B5B\u9009
Default=\u9ED8\u8BA4
FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793A\u4F4D\u7F6E\uFF1A
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009
FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A
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
@ -2146,3 +2141,8 @@ FR-Designer_Widgetname=\u63A7\u4EF6\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer-Plugin_Has_Been_Actived=
FR-Designer-Plugin_Has_Been_Disabled=
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=

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

@ -1346,8 +1346,6 @@ Remove_All_Button=\u6E05\u9664\u6240\u6709\u6309\u9215
FR-Designer_Component_Interval=\u5143\u4EF6\u9593\u9694
ReportColumns-Columns_vertically=\u6B04\u5206\u6B04
ReportGUI-Print_Background=\u5217\u5370/\u532F\u51FA\u5831\u8868\u80CC\u666F
FR-Designer_Print_Background=\u5217\u5370\u5831\u8868\u80CC\u666F
FR-Designer_Export_Background=\u532F\u51FA\u5831\u8868\u80CC\u666F
Export-CSV=CSV\u683C\u5F0F(\u9017\u865F\u5206\u9694)
M_Edit-Paste=\u8CBC\u4E0A(P)
FR-Designer-Basic_Restart_Designer=Restart designer
@ -2024,9 +2022,6 @@ FR-Designer_Build_Tree_Accord_Parent_Marked_Filed=\u4F9D\u8CF4\u6240\u9078\u8CC7
FR-Product_Demo=\u529F\u80FD\u5C55\u793A
FR-Designer_Data_Filter=\u8CC7\u6599\u7BE9\u9078
Default=\u9810\u8A2D
FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793A\u4F4D\u7F6E\uFF1A
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078
FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A
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
@ -2146,3 +2141,8 @@ FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=

1
designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -548,5 +548,4 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
tree.collapsePath(parent);
}
}
}

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

@ -14,7 +14,10 @@ import com.fr.env.SignIn;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.*;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.start.server.JettyHost;

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 {

Loading…
Cancel
Save