Browse Source

REPORT-8355 9.0之前开发的功能与bug patch到10.0(部分)

master
plough 7 years ago
parent
commit
c002925ca8
  1. 53
      designer-base/src/com/fr/design/actions/help/AboutPane.java
  2. 203
      designer-base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java
  3. 20
      designer-base/src/com/fr/design/gui/ispinner/UISpinner.java
  4. 15
      designer-base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java
  5. 12
      designer-base/src/com/fr/design/widget/EventCreator.java
  6. 13
      designer-form/src/com/fr/design/designer/beans/models/SelectionModel.java
  7. 52
      designer-form/src/com/fr/design/designer/creator/XMultiFileUploader.java
  8. 15
      designer-form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  9. 33
      designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  10. 5
      designer-form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java
  11. 36
      designer-form/src/com/fr/design/designer/properties/mobile/MultiFileUploaderPropertyUI.java
  12. 75
      designer-form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java
  13. 8
      designer-realize/src/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  14. 8
      designer-realize/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  15. 78
      designer-realize/src/com/fr/design/present/ConditionAttributesGroupPane.java
  16. 62
      designer-realize/src/com/fr/design/report/UnitFieldPane.java
  17. 8
      designer-realize/src/com/fr/design/webattr/EventPane.java
  18. 2
      designer-realize/src/com/fr/design/webattr/WriteWebSettingPane.java

53
designer-base/src/com/fr/design/actions/help/AboutPane.java

@ -68,28 +68,36 @@ public class AboutPane extends JPanel {
Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK") Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK")
})); }));
if (shouldShowPhoneAndQQ()) { addPhoneAndQQPane(contentPane);
if (ComparatorUtils.equals(ProductConstants.APP_NAME, FINEREPORT)) {
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE); // 官网
contentPane.add(boxCenterAlignmentPane); JPanel urlActionPane = getURLActionPane(Inter.getLocText("FR-Designer_Official_Website"), SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
}
BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL)); // 支持邮箱
BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL)); String defaultEmail = SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL);
JPanel emailPane = getEmailActionPane(Inter.getLocText("FR-Designer_Support_Email"),SiteCenter.getInstance().acquireUrlByKind("support.email." + FRContext.getLocale(), defaultEmail));
contentPane.add(actionLabel); contentPane.add(urlActionPane);
contentPane.add(emailLabel); contentPane.add(emailPane);
if (shouldShowThanks()) { if (shouldShowThanks()) {
addThankPane(contentPane); addThankPane(contentPane);
} }
} }
// 是否显示服务电话和 qq private void addPhoneAndQQPane(JPanel contentPane) {
private boolean shouldShowPhoneAndQQ() { BoxCenterAligmentPane boxCenterAlignmentPane;
return !FRContext.getLocale().equals(Locale.US); // 英文版不显示服务电话和QQ
if (FRContext.getLocale().equals(Locale.US)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + SiteCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), ProductConstants.COMPARE_TELEPHONE));
contentPane.add(boxCenterAlignmentPane);
// 繁体版不显示QQ
if (FRContext.getLocale().equals(Locale.TAIWAN)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
} }
// 是否显示鸣谢面板 // 是否显示鸣谢面板
@ -133,7 +141,7 @@ public class AboutPane extends JPanel {
StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX); StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX);
} }
private BoxCenterAligmentPane getEmailActionLabel(final String mailTo) { private JPanel getEmailActionPane(final String desc, final String mailTo){
ActionLabel emailLabel = new ActionLabel(mailTo); ActionLabel emailLabel = new ActionLabel(mailTo);
emailLabel.addActionListener(new ActionListener() { emailLabel.addActionListener(new ActionListener() {
@ -147,10 +155,13 @@ public class AboutPane extends JPanel {
} }
}); });
return new BoxCenterAligmentPane(emailLabel); JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
panel.add(new UILabel(desc));
panel.add(emailLabel);
return panel;
} }
private BoxCenterAligmentPane getURLActionLabel(final String url) { private JPanel getURLActionPane(final String desc, final String url){
ActionLabel actionLabel = new ActionLabel(url); ActionLabel actionLabel = new ActionLabel(url);
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
@ -163,7 +174,11 @@ public class AboutPane extends JPanel {
} }
}); });
return new BoxCenterAligmentPane(actionLabel); JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
panel.add(new UILabel(desc));
panel.add(actionLabel);
return panel;
} }
class UserLabel extends BoldFontTextLabel { class UserLabel extends BoldFontTextLabel {

203
designer-base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -50,13 +50,14 @@ import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
public class FRTreeComboBox extends UIComboBox { public class FRTreeComboBox extends UIComboBox {
private static final int PAGE_DIFF = 5; private static final int PAGE_DIFF = 5;
private static final int DEFAULT_HEIGHT = 120; private static final int DEFAULT_HEIGHT = 120;
// richer:下拉展示用的tree // richer:下拉展示用的tree
protected JTree tree; protected JTree tree;
private boolean onlyLeafSelectable = true; private boolean onlyLeafSelectable = true;
private Object selectedObject = null;
public FRTreeComboBox() { public FRTreeComboBox() {
this(new JTree()); this(new JTree());
@ -148,7 +149,7 @@ public class FRTreeComboBox extends UIComboBox {
for (Enumeration e2 = pathnode.children(); e2.hasMoreElements(); ) { for (Enumeration e2 = pathnode.children(); e2.hasMoreElements(); ) {
TreeNode n2 = (TreeNode) e2.nextElement(); TreeNode n2 = (TreeNode) e2.nextElement();
TreePath path2 = path.pathByAddingChild(n2); TreePath path2 = path.pathByAddingChild(n2);
if (pathToString(path2).toUpperCase().startsWith(textField.getText().toUpperCase())) { if (pathToString(path2).toUpperCase().contains(textField.getText().toUpperCase())) {
tree.scrollPathToVisible(path2); tree.scrollPathToVisible(path2);
tree.setSelectionPath(path2); tree.setSelectionPath(path2);
isBreak = true; isBreak = true;
@ -162,6 +163,7 @@ public class FRTreeComboBox extends UIComboBox {
} }
public void setSelectedItem(Object o) { public void setSelectedItem(Object o) {
selectedObject = o;
if (o instanceof String) { if (o instanceof String) {
this.setSelectedItemString((String) o); this.setSelectedItemString((String) o);
return; return;
@ -173,9 +175,13 @@ public class FRTreeComboBox extends UIComboBox {
this.getModel().setSelectedItem(o); this.getModel().setSelectedItem(o);
} }
} }
public Object getSelectedItemObject() {
return selectedObject;
}
private boolean validTreePath(String treePath){ private boolean validTreePath(String treePath){
return StringUtils.isNotEmpty(treePath) && treePath.charAt(0) == '[' && treePath.endsWith("]"); return StringUtils.isNotEmpty(treePath) && treePath.charAt(0) == '[' && treePath.endsWith("]");
} }
protected String pathToString(TreePath path) { protected String pathToString(TreePath path) {
@ -183,12 +189,7 @@ public class FRTreeComboBox extends UIComboBox {
if (validTreePath(temp)) { if (validTreePath(temp)) {
temp = temp.substring(2, temp.length() - 1); temp = temp.substring(2, temp.length() - 1);
String[] selectedtable = temp.split(","); String[] selectedtable = temp.split(",");
String table = selectedtable[selectedtable.length - 1].trim(); return selectedtable[selectedtable.length - 1].trim();
if (table.contains(".")) {
String[] temp2 = table.split("\\.");
table = temp2[temp2.length - 1].trim();
}
return table;
} }
return ""; return "";
} }
@ -198,7 +199,7 @@ public class FRTreeComboBox extends UIComboBox {
*/ */
public void setSelectedItemString(String _name) { public void setSelectedItemString(String _name) {
if (StringUtils.isBlank(_name)) { if (StringUtils.isBlank(_name)) {
this.setSelectedIndex(-1); this.setSelectedIndex(-1);
return; return;
} }
DefaultTreeModel model = (DefaultTreeModel) this.tree.getModel(); DefaultTreeModel model = (DefaultTreeModel) this.tree.getModel();
@ -237,26 +238,26 @@ public class FRTreeComboBox extends UIComboBox {
} }
} }
public void setPopSize(int width, int height) { public void setPopSize(int width, int height) {
treePopup.setPopSize(width, height); treePopup.setPopSize(width, height);
} }
private static TreePopup treePopup; private static TreePopup treePopup;
private static class FRTreeComboBoxUI extends BasicComboBoxUI implements MouseListener{ private static class FRTreeComboBoxUI extends BasicComboBoxUI implements MouseListener{
private boolean isRollover = false; private boolean isRollover = false;
public FRTreeComboBoxUI() { public FRTreeComboBoxUI() {
super(); super();
} }
protected ComboPopup createPopup() { protected ComboPopup createPopup() {
treePopup = new TreePopup(comboBox); treePopup = new TreePopup(comboBox);
return treePopup; return treePopup;
} }
@Override @Override
protected UIButton createArrowButton() { protected UIButton createArrowButton() {
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON){ arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON){
/** /**
* 组件是否需要响应添加的观察者事件 * 组件是否需要响应添加的观察者事件
* *
@ -267,77 +268,77 @@ public class FRTreeComboBox extends UIComboBox {
return false; return false;
} }
}; };
((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT); ((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT);
arrowButton.addMouseListener(this); arrowButton.addMouseListener(this);
comboBox.addMouseListener(this); comboBox.addMouseListener(this);
return (UIButton) arrowButton; return (UIButton) arrowButton;
} }
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
super.paint(g, c); super.paint(g, c);
Graphics2D g2d = (Graphics2D)g; Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Color linecolor = null; Color linecolor = null;
if (comboBox.isPopupVisible()) { if (comboBox.isPopupVisible()) {
linecolor = UIConstants.LINE_COLOR; linecolor = UIConstants.LINE_COLOR;
arrowButton.setSelected(true); arrowButton.setSelected(true);
} else if (isRollover) { } else if (isRollover) {
linecolor = UIConstants.LIGHT_BLUE; linecolor = UIConstants.LIGHT_BLUE;
} else { } else {
linecolor = UIConstants.LINE_COLOR; linecolor = UIConstants.LINE_COLOR;
arrowButton.setSelected(false); arrowButton.setSelected(false);
} }
g2d.setColor(linecolor); g2d.setColor(linecolor);
if (!comboBox.isPopupVisible()) { if (!comboBox.isPopupVisible()) {
g2d.drawRoundRect(0, 0, c.getWidth() - arrowButton.getWidth() + 3, c.getHeight() - 1, UIConstants.LARGEARC, UIConstants.LARGEARC); g2d.drawRoundRect(0, 0, c.getWidth() - arrowButton.getWidth() + 3, c.getHeight() - 1, UIConstants.LARGEARC, UIConstants.LARGEARC);
} else { } else {
g2d.drawRoundRect(0, 0, c.getWidth() , c.getHeight() + 3, UIConstants.LARGEARC, UIConstants.LARGEARC ); g2d.drawRoundRect(0, 0, c.getWidth() , c.getHeight() + 3, UIConstants.LARGEARC, UIConstants.LARGEARC );
g2d.drawLine(0, c.getHeight()-1, c.getWidth(), c.getHeight()-1); g2d.drawLine(0, c.getHeight()-1, c.getWidth(), c.getHeight()-1);
} }
} }
private void setRollover(boolean isRollover) { private void setRollover(boolean isRollover) {
if (this.isRollover != isRollover) { if (this.isRollover != isRollover) {
this.isRollover = isRollover; this.isRollover = isRollover;
comboBox.repaint(); comboBox.repaint();
} }
} }
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
setRollover(true); setRollover(true);
} }
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
setRollover(false); setRollover(false);
} }
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
} }
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
} }
@Override @Override
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
} }
} }
/** /**
* 添加弹出菜单监听 * 添加弹出菜单监听
* *
* @param l 监听事件 * @param l 监听事件
* *
* @date 2015-1-22-下午5:04:00 * @date 2015-1-22-下午5:04:00
* *
*/ */
public void addPopupMenuListener(PopupMenuListener l) { public void addPopupMenuListener(PopupMenuListener l) {
treePopup.addPopupMenuListener(l); treePopup.addPopupMenuListener(l);
} }
@ -367,8 +368,8 @@ public class FRTreeComboBox extends UIComboBox {
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private int defaultWidth = 0; private int defaultWidth = 0;
private int defaultHeight = 0; private int defaultHeight = 0;
protected FRTreeComboBox comboBox; protected FRTreeComboBox comboBox;
protected JScrollPane scrollPane; protected JScrollPane scrollPane;
protected JTree tree; protected JTree tree;
@ -492,8 +493,8 @@ public class FRTreeComboBox extends UIComboBox {
} }
protected void updatePopup() { protected void updatePopup() {
int width = defaultWidth == 0 ? this.comboBox.getSize().width : defaultWidth; int width = defaultWidth == 0 ? this.comboBox.getSize().width : defaultWidth;
int height = defaultHeight == 0 ? DEFAULT_HEIGHT : defaultHeight; int height = defaultHeight == 0 ? DEFAULT_HEIGHT : defaultHeight;
this.setPreferredSize(new Dimension(width, height)); this.setPreferredSize(new Dimension(width, height));
Object selectedObj = this.comboBox.getSelectedItem(); Object selectedObj = this.comboBox.getSelectedItem();
if (selectedObj instanceof TreePath) { if (selectedObj instanceof TreePath) {
@ -502,10 +503,10 @@ public class FRTreeComboBox extends UIComboBox {
} }
} }
public void setPopSize(int width, int height) { public void setPopSize(int width, int height) {
this.defaultWidth = width; this.defaultWidth = width;
this.defaultHeight = height; this.defaultHeight = height;
} }
protected class InvocationMouseHandler extends MouseAdapter { protected class InvocationMouseHandler extends MouseAdapter {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -533,7 +534,7 @@ public class FRTreeComboBox extends UIComboBox {
private Object item; private Object item;
public FrTreeSearchComboBoxEditor(FRTreeComboBox comboBox) { public FrTreeSearchComboBoxEditor(FRTreeComboBox comboBox) {
super(); super();
this.comboBox = comboBox; this.comboBox = comboBox;
textField.getDocument().addDocumentListener(this); textField.getDocument().addDocumentListener(this);
textField.addKeyListener(this.treeKeyListener); textField.addKeyListener(this.treeKeyListener);
@ -582,7 +583,7 @@ public class FRTreeComboBox extends UIComboBox {
public void setItem(Object item) { public void setItem(Object item) {
this.item = item; this.item = item;
this.setting = true; this.setting = true;
textField.setText((item == null) ? "" : item.toString()); textField.setText((item == null) ? "" : item.toString());
this.setting = false; this.setting = false;

20
designer-base/src/com/fr/design/gui/ispinner/UISpinner.java

@ -12,28 +12,14 @@ import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.ButtonModel; import javax.swing.*;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.plaf.ButtonUI; import javax.swing.plaf.ButtonUI;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Color; import java.awt.event.*;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver { public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver {

15
designer-base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java

@ -20,7 +20,7 @@ public interface FormECDesignerProvider {
* 选中目标的 对应Menu * 选中目标的 对应Menu
* @return 返回MenuDef数组. * @return 返回MenuDef数组.
*/ */
MenuDef[] menus4Target(); MenuDef[] menus4Target();
/** /**
* 获取焦点 * 获取焦点
@ -31,7 +31,7 @@ public interface FormECDesignerProvider {
* 工具栏菜单字体字号等 * 工具栏菜单字体字号等
* @return 工具栏菜单数组 * @return 工具栏菜单数组
*/ */
ToolBarDef[] toolbars4Target(); ToolBarDef[] toolbars4Target();
/** /**
* 表单的报表块的工具按钮复制剪切那行 * 表单的报表块的工具按钮复制剪切那行
@ -43,25 +43,25 @@ public interface FormECDesignerProvider {
* 模板菜单 * 模板菜单
* @return 返回菜单 * @return 返回菜单
*/ */
ShortCut[] shortcut4TemplateMenu(); ShortCut[] shortcut4TemplateMenu();
/** /**
*当前正在编辑的elementcase *当前正在编辑的elementcase
* @return 当前正在编辑的elementcase * @return 当前正在编辑的elementcase
*/ */
FormElementCaseProvider getEditingElementCase(); FormElementCaseProvider getEditingElementCase();
/** /**
* 右上角属性表 * 右上角属性表
* @return 属性面板 * @return 属性面板
*/ */
JComponent getEastDownPane(); JComponent getEastDownPane();
/** /**
* 右下角控件树或者扩展属性 * 右下角控件树或者扩展属性
* @return 属性面板 * @return 属性面板
*/ */
JComponent getEastUpPane(); JComponent getEastUpPane();
/** /**
* 条件属性面板 * 条件属性面板
@ -87,6 +87,7 @@ public interface FormECDesignerProvider {
* @param elementCaseContainerSize 缩略图的大小 * @param elementCaseContainerSize 缩略图的大小
* @return * @return
*/ */
BufferedImage getElementCaseImage(Dimension elementCaseContainerSize); BufferedImage getElementCaseImage(Dimension elementCaseContainerSize);
void refreshPropertyPane();
} }

12
designer-base/src/com/fr/design/widget/EventCreator.java

@ -26,21 +26,21 @@ public class EventCreator extends NameableSelfCreator {
} }
public static EventCreator[] createEventCreator(String[] supportedEvents, Class<? extends BasicBeanPane> updatePane) { public static EventCreator[] createEventCreator(String[] supportedEvents, Class<? extends BasicBeanPane> updatePane) {
EventCreator[] creators = new EventCreator[supportedEvents.length]; EventCreator[] creators = new EventCreator[supportedEvents.length];
for (int i = 0; i < supportedEvents.length; i++) { for (int i = 0; i < supportedEvents.length; i++) {
creators[i] = new EventCreator(supportedEvents[i], updatePane); creators[i] = new EventCreator(supportedEvents[i], updatePane);
} }
return creators; return creators;
} }
/* /*
* richer:国际化事件名称所有需要国际化的事件都应按格式Event-eventName来进行国际化 * richer:国际化事件名称所有需要国际化的事件都应按格式FR-Engine_Event_eventName来进行国际化
*/ */
public static final String switchLang(String eventName) { public static final String switchLang(String eventName) {
try { try {
return Inter.getLocText("Event-" + eventName); return Inter.getLocText("FR-Engine_Event_" + eventName);
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
return eventName; return eventName;

13
designer-form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -65,6 +65,19 @@ public class SelectionModel {
if (e.getButton() == MouseEvent.BUTTON3 || (!InputEventBaseOnOS.isControlDown(e) && !e.isShiftDown())) { if (e.getButton() == MouseEvent.BUTTON3 || (!InputEventBaseOnOS.isControlDown(e) && !e.isShiftDown())) {
// 如果Ctrl或者Shift键盘没有按下,则清除已经选择的组件 // 如果Ctrl或者Shift键盘没有按下,则清除已经选择的组件
selection.reset(); selection.reset();
} else {
//按下Ctrl或者shift键时鼠标可以进行多选,两次点击同一控件就取消选中
XCreator comp = designer.getComponentAt(e);
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout();
if (topLayout != null && !topLayout.isEditable()) {
comp = topLayout;
}
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(comp);
for (XCreator selected : selection.getSelectedCreators()) {
if (selected == comp || XCreatorUtils.getParentXLayoutContainer(selected) != container) {
selection.removeCreator(selected);
}
}
} }
// 获取e所在的组件 // 获取e所在的组件
XCreator comp = designer.getComponentAt(e); XCreator comp = designer.getComponentAt(e);

52
designer-form/src/com/fr/design/designer/creator/XMultiFileUploader.java

@ -3,23 +3,24 @@
*/ */
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.beans.IntrospectionException;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.designer.properties.mobile.MultiFileUploaderPropertyUI;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.MultiFileEditor;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.beans.IntrospectionException;
/** /**
* @author richer * @author richer
* @since 6.5.3 * @since 6.5.3
@ -29,22 +30,22 @@ public class XMultiFileUploader extends XFieldEditor {
public XMultiFileUploader(MultiFileEditor widget, Dimension initSize) { public XMultiFileUploader(MultiFileEditor widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
} }
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll( return (CRPropertyDescriptor[]) ArrayUtils.addAll(
super.supportedDescriptor(), super.supportedDescriptor(),
new CRPropertyDescriptor[]{ new CRPropertyDescriptor[]{
new CRPropertyDescriptor("singleFile", this.data.getClass()) new CRPropertyDescriptor("singleFile", this.data.getClass())
.setI18NName(Inter.getLocText("SINGLE_FILE_UPLOAD")) .setI18NName(Inter.getLocText("SINGLE_FILE_UPLOAD"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("accept", this.data.getClass()) new CRPropertyDescriptor("accept", this.data.getClass())
.setI18NName(Inter.getLocText("File-Allow_Upload_Files")) .setI18NName(Inter.getLocText("File-Allow_Upload_Files"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("maxSize", this.data.getClass()) new CRPropertyDescriptor("maxSize", this.data.getClass())
.setI18NName(Inter.getLocText("File-File_Size_Limit")) .setI18NName(Inter.getLocText("File-File_Size_Limit"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
}); });
} }
@Override @Override
@ -93,4 +94,9 @@ public class XMultiFileUploader extends XFieldEditor {
protected String getIconName() { protected String getIconName() {
return "files_up.png"; return "files_up.png";
} }
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{ new MultiFileUploaderPropertyUI(this)};
}
} }

15
designer-form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java

@ -5,17 +5,13 @@ import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter;
import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI; import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import java.awt.*; import java.awt.Component;
import java.awt.Dimension;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
/** /**
@ -127,4 +123,11 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
return false; return false;
} }
/**
* 是否支持共享-body不支持共享
* @return
*/
public boolean isSupportShared() {
return false;
}
} }

33
designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -4,6 +4,8 @@
package com.fr.design.designer.creator.cardlayout; package com.fr.design.designer.creator.cardlayout;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.iofileattr.SharableAttrMark;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
@ -16,8 +18,10 @@ import com.fr.design.designer.creator.XWBorderLayout;
import com.fr.design.designer.creator.XWidgetCreator; import com.fr.design.designer.creator.XWidgetCreator;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetHelpDialog;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
@ -33,8 +37,10 @@ import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.share.ShareConstants;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.Icon;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
@ -44,6 +50,7 @@ import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.ArrayList;
@ -58,6 +65,7 @@ import java.util.List;
*/ */
public class XWCardMainBorderLayout extends XWBorderLayout { public class XWCardMainBorderLayout extends XWBorderLayout {
private Icon controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH);
private static final int CENTER = 1; private static final int CENTER = 1;
private static final int NORTH = 0; private static final int NORTH = 0;
private static final int TITLE_STYLE = 2; private static final int TITLE_STYLE = 2;
@ -358,9 +366,21 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
); );
g2d.setColor(Color.WHITE); g2d.setColor(Color.WHITE);
//画编辑文字 //画编辑文字
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5); g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5);
g.setColor(XCreatorConstants.FORM_BORDER_COLOR); g.setColor(XCreatorConstants.FORM_BORDER_COLOR);
GraphHelper.draw(g, new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - BORDER_WIDTH * 2, getHeight() - BORDER_WIDTH * 2), Constants.LINE_MEDIUM); GraphHelper.draw(g, new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - BORDER_WIDTH * 2, getHeight() - BORDER_WIDTH * 2), Constants.LINE_MEDIUM);
paintExtro(g);
}
}
public void paintExtro(Graphics g) {
if (this.toData().getWidgetAttrMark(SharableAttrMark.XML_TAG) != null) {
int width = getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW;
g.setColor(UIConstants.NORMAL_BACKGROUND);
g.fillArc(width, 0, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW,
0, 360);
controlMode.paintIcon(this, g, width, 0);
} }
} }
@ -379,6 +399,11 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
*/ */
@Override @Override
public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){ public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){
//帮助弹窗
if (this.isHelpBtnOnFocus()) {
new WidgetHelpDialog(DesignerContext.getDesignerFrame(), this.toData().getDescription()).showWindow(e);
return;
}
FormDesigner designer = editingMouseListener.getDesigner(); FormDesigner designer = editingMouseListener.getDesigner();
SelectionModel selectionModel = editingMouseListener.getSelectionModel(); SelectionModel selectionModel = editingMouseListener.getSelectionModel();
boolean isEditing = e.getButton() == MouseEvent.BUTTON1 && boolean isEditing = e.getButton() == MouseEvent.BUTTON1 &&
@ -455,4 +480,12 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
return new FRCardMainBorderLayoutAdapter(this); return new FRCardMainBorderLayoutAdapter(this);
} }
/**
* 是否支持共享-现只支持报表块图表tab块绝对布局
* @return
*/
public boolean isSupportShared() {
return true;
}
} }

5
designer-form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java

@ -6,6 +6,7 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.BodyMobileDefinePane;
import com.fr.general.Inter; import com.fr.general.Inter;
/** /**
@ -25,12 +26,12 @@ public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
@Override @Override
public AbstractPropertyTable createWidgetAttrTable() { public AbstractPropertyTable createWidgetAttrTable() {
return new BodyAppRelayoutTable(xCreator); return null;
} }
@Override @Override
public BasicPane createWidgetAttrPane() { public BasicPane createWidgetAttrPane() {
return null; return new BodyMobileDefinePane(xCreator);
} }
@Override @Override

36
designer-form/src/com/fr/design/designer/properties/mobile/MultiFileUploaderPropertyUI.java

@ -0,0 +1,36 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XMultiFileUploader;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.MultiFileUploaderDefinePane;
import com.fr.general.Inter;
/**
* Created by plough on 2018/4/19.
*/
public class MultiFileUploaderPropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public MultiFileUploaderPropertyUI(XMultiFileUploader xMultiFileUploader) {
this.xCreator = xMultiFileUploader;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new MultiFileUploaderDefinePane(xCreator);
}
@Override
public String tableTitle() {
return Inter.getLocText("FR-Designer_Mobile-Attr");
}
}

75
designer-form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java

@ -1,75 +0,0 @@
package com.fr.design.mainframe;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* @author zack
* @date 2016-10-14
* @since 8.0
*/
public class ElementCaseHelpDialog extends UIDialog {
private static final int OUTER_WIDTH = 190;
private static final int OUTER_HEIGHT = 280;
private String helpMsg;
private UIScrollPane helpArea;
public ElementCaseHelpDialog(Frame parent, String helpMsg) {
super(parent);
this.helpMsg = helpMsg;
initHelpArea();
JPanel panel = (JPanel) getContentPane();
initComponents(panel);
setSize(new Dimension(OUTER_WIDTH, OUTER_HEIGHT));
}
private void initHelpArea() {
UITextArea textArea = new UITextArea(helpMsg);
textArea.setEditable(false);
textArea.setBorder(null);
helpArea = new UIScrollPane(textArea);
helpArea.setBounds(0, 0, OUTER_WIDTH, OUTER_HEIGHT);
helpArea.setBorder(null);
}
private void initComponents(JPanel contentPane) {
contentPane.setLayout(new BorderLayout());
add(helpArea, BorderLayout.CENTER);
this.applyClosingAction();
this.setTitle(Inter.getLocText("FR-Designer_Help"));
}
/**
* 打开帮助框
*/
public void showWindow() {
this.setResizable(false);
setVisible(true);
}
/**
*
*/
@Override
public void checkValid() throws Exception {
}
public void setLocationRelativeTo(JFrame c, int x, int y) {
int dx = 0, dy = 0;
Point compLocation = c.getLocationOnScreen();//获取设计器Jframe坐标作为相对位置原点
setLocation(dx + x, dy + y);
dx = compLocation.x;
dy = compLocation.y + c.getRootPane().getY();//加上底层容器的y坐标(其实就是设计器最上方图标栏的高度)
setLocation(dx + x, dy + y);
}
}

8
designer-realize/src/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
@ -84,7 +85,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
frFont = frFont.applyUnderline(Constants.LINE_NONE); frFont = frFont.applyUnderline(Constants.LINE_NONE);
} }
editCellElement.setStyle(elementStyle.deriveFRFont(frFont)); editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
editCellElement.setNameHyperlinkGroup(updateNameHyperlinks); try {
editCellElement.setNameHyperlinkGroup((NameJavaScriptGroup) updateNameHyperlinks.clone());
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since NameJavaScriptGroup are FCloneable
FRContext.getLogger().error("InternalError: " + e.getMessage());
}
} }
}); });
} }

8
designer-realize/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -138,6 +138,14 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
return image; return image;
} }
/**
* 刷新右侧属性面板
*/
@Override
public void refreshPropertyPane() {
this.elementCasePane.fireSelectionChangeListener();
}
/** /**
* 创建正在编辑的状态. * 创建正在编辑的状态.
* *

78
designer-realize/src/com/fr/design/present/ConditionAttributesGroupPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -27,20 +28,21 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
public class ConditionAttributesGroupPane extends UIListControlPane { public class ConditionAttributesGroupPane extends UIListControlPane {
private static ConditionAttributesGroupPane singleton; private static ConditionAttributesGroupPane singleton;
private TemplateCellElement editCellElement; // 当前单元格对象 private TemplateCellElement editCellElement; // 当前单元格对象
private Selection editSelection; // 当前编辑对象
private ElementCasePane ePane; private ElementCasePane ePane;
private ConditionAttributesGroupPane() { private ConditionAttributesGroupPane() {
super(); super();
} }
public static ConditionAttributesGroupPane getInstance() { public static ConditionAttributesGroupPane getInstance() {
if (singleton == null) { if (singleton == null) {
singleton = new ConditionAttributesGroupPane(); singleton = new ConditionAttributesGroupPane();
} }
return singleton; return singleton;
} }
@Override @Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
@ -49,18 +51,21 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
@Override @Override
public void saveSettings() { public void saveSettings() {
if (isPopulating) { if (isPopulating) {
return; return;
} }
final CellSelection finalCS = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); final TemplateElementCase tplEC = ePane.getEditingElementCase();
final HighlightGroup highlightGroup = updateHighlightGroup();
ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() { ReportActionUtils.actionIterateWithCellSelection((CellSelection) editSelection, tplEC, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) { public void dealWith(CellElement editCellElement) {
((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup()); try {
} ((TemplateCellElement)editCellElement).setHighlightGroup((HighlightGroup) highlightGroup.clone());
}); } catch (CloneNotSupportedException e) {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); FRContext.getLogger().error("InternalError: " + e.getMessage());
}
}
});
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
@Override @Override
@ -68,24 +73,25 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
return Inter.getLocText("Condition_Attributes"); return Inter.getLocText("Condition_Attributes");
} }
@Override @Override
public String getAddItemText() { public String getAddItemText() {
return Inter.getLocText("FR-Designer_Add_Condition"); return Inter.getLocText("FR-Designer_Add_Condition");
} }
public void populate(ElementCasePane ePane) { public void populate(ElementCasePane ePane) {
this.ePane = ePane; this.ePane = ePane;
CellSelection cs = (CellSelection) ePane.getSelection(); this.editSelection = ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); CellSelection cs = (CellSelection) ePane.getSelection();
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); final TemplateElementCase tplEC = ePane.getEditingElementCase();
if (editCellElement == null) { editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) {
} editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
}
SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里
populate(editCellElement.getHighlightGroup()); populate(editCellElement.getHighlightGroup());
} }
/** /**
* Populate * Populate
@ -93,7 +99,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
public void populate(HighlightGroup highlightGroup) { public void populate(HighlightGroup highlightGroup) {
// marks这个必须放在前面,不论是否有高亮分组都可以操作 // marks这个必须放在前面,不论是否有高亮分组都可以操作
if (highlightGroup == null || highlightGroup.size() <= 0) { if (highlightGroup == null || highlightGroup.size() <= 0) {
this.populate(new NameObject[0]); this.populate(new NameObject[0]);
return; return;
} }
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();

62
designer-realize/src/com/fr/design/report/UnitFieldPane.java

@ -17,6 +17,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.unit.CM; import com.fr.stable.unit.CM;
import com.fr.stable.unit.INCH; import com.fr.stable.unit.INCH;
import com.fr.stable.unit.MM; import com.fr.stable.unit.MM;
@ -26,23 +27,26 @@ import com.fr.stable.unit.UNIT;
* UnitFieldPane * UnitFieldPane
*/ */
public class UnitFieldPane extends JPanel { public class UnitFieldPane extends JPanel {
private static final int TEXT_FIELD_COLUMNS = 4;
private static final int TEXT_FIELD_COLUMNS_WINDOWS = 6;
private UIBasicSpinner valueSpinner; private UIBasicSpinner valueSpinner;
private JFormattedTextField textField; private JFormattedTextField textField;
private UnitLabel unitLable; private UnitLabel unitLable;
private int unitType = Constants.UNIT_MM; private int unitType = Constants.UNIT_MM;
public static class UnitLabel extends UILabel { public static class UnitLabel extends UILabel {
private int preferredHeight; private int preferredHeight;
public UnitLabel(int unitType, int preferredHeight) { public UnitLabel(int unitType, int preferredHeight) {
super(); super();
this.preferredHeight = preferredHeight; this.preferredHeight = preferredHeight;
setUnitType(unitType); setUnitType(unitType);
} }
public void setUnitType(int unitType) { public void setUnitType(int unitType) {
if (unitType == Constants.UNIT_CM) { if (unitType == Constants.UNIT_CM) {
this.setText(Inter.getLocText("FR-Designer_Unit_CM")); this.setText(Inter.getLocText("FR-Designer_Unit_CM"));
} else if (unitType == Constants.UNIT_INCH) { } else if (unitType == Constants.UNIT_INCH) {
@ -53,41 +57,41 @@ public class UnitFieldPane extends JPanel {
//ajust the heigt of unitLabel. //ajust the heigt of unitLabel.
Dimension unitDimension = new Dimension(this.getPreferredSize().width, Dimension unitDimension = new Dimension(this.getPreferredSize().width,
preferredHeight); preferredHeight);
this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension);
this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension);
this.setSize(unitDimension); this.setSize(unitDimension);
this.setPreferredSize(unitDimension); this.setPreferredSize(unitDimension);
} }
} }
public UnitFieldPane(int unitType) { public UnitFieldPane(int unitType) {
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.unitType = unitType; this.unitType = unitType;
valueSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); valueSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField(); textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField();
textField.setColumns(4); textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS);
InputEventBaseOnOS.addBasicEditInputMap(textField); InputEventBaseOnOS.addBasicEditInputMap(textField);
this.add(valueSpinner); this.add(valueSpinner);
unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height); unitLable = new UnitLabel(unitType, valueSpinner.getPreferredSize().height);
this.add(unitLable); this.add(unitLable);
} }
public JFormattedTextField getTextField() { public JFormattedTextField getTextField() {
return textField; return textField;
} }
public void setUnitType(int unitType) { public void setUnitType(int unitType) {
unitLable.setUnitType(unitType); unitLable.setUnitType(unitType);
this.unitType = unitType; this.unitType = unitType;
} }
public UNIT getUnitValue() { public UNIT getUnitValue() {
if (unitType == Constants.UNIT_CM) { if (unitType == Constants.UNIT_CM) {
return new CM(((Number) valueSpinner.getValue()).floatValue()); return new CM(((Number) valueSpinner.getValue()).floatValue());
} else if (unitType == Constants.UNIT_INCH) { } else if (unitType == Constants.UNIT_INCH) {
return new INCH(((Number) valueSpinner.getValue()).floatValue()); return new INCH(((Number) valueSpinner.getValue()).floatValue());
} else { } else {
return new MM(((Number) valueSpinner.getValue()).floatValue()); return new MM(((Number) valueSpinner.getValue()).floatValue());
@ -95,12 +99,12 @@ public class UnitFieldPane extends JPanel {
} }
public void setUnitValue(UNIT value) { public void setUnitValue(UNIT value) {
if (unitType == Constants.UNIT_CM) { if (unitType == Constants.UNIT_CM) {
valueSpinner.setValue(new Float(value.toCMValue4Scale2())); valueSpinner.setValue(new Float(value.toCMValue4Scale2()));
} else if (unitType == Constants.UNIT_INCH) { } else if (unitType == Constants.UNIT_INCH) {
valueSpinner.setValue(new Float(value.toINCHValue4Scale3())); valueSpinner.setValue(new Float(value.toINCHValue4Scale3()));
} else { } else {
valueSpinner.setValue(new Float(value.toMMValue4Scale2())); valueSpinner.setValue(new Float(value.toMMValue4Scale2()));
} }
} }
} }

8
designer-realize/src/com/fr/design/webattr/EventPane.java

@ -29,7 +29,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
* richer:调用该类并且对事件名字国际化时需要严格按照"Event-事件名"来进行命名 * richer:调用该类并且对事件名字国际化时需要严格按照"FR-Engine_Event_事件名"来进行命名
*/ */
public class EventPane extends BasicPane { public class EventPane extends BasicPane {
private DefaultListModel listModel; private DefaultListModel listModel;
@ -74,7 +74,7 @@ public class EventPane extends BasicPane {
super.setEnabled(enabled); super.setEnabled(enabled);
this.eventList.setEnabled(enabled); this.eventList.setEnabled(enabled);
this.addAction.setEnabled(enabled); // TODO ALEX_SEP this.addAction.setEnabled(enabled); // TODO ALEX_SEP
// 似乎UpdateAction.enable属性还是有用的... // 似乎UpdateAction.enable属性还是有用的...
this.editAction.setEnabled(enabled); this.editAction.setEnabled(enabled);
this.removeAction.setEnabled(enabled); this.removeAction.setEnabled(enabled);
@ -83,9 +83,9 @@ public class EventPane extends BasicPane {
private void checkEnableState() { private void checkEnableState() {
if (this.listModel.size() == 0 || eventList.getSelectedIndex() < 0) { if (this.listModel.size() == 0 || eventList.getSelectedIndex() < 0) {
setEditEnabled(false); setEditEnabled(false);
} else { } else {
setEditEnabled(true); setEditEnabled(true);
} }
} }

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

@ -76,7 +76,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check")); unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check"));
unloadCheck.setSelected(true); unloadCheck.setSelected(true);
showWidgets = new UICheckBox(Inter.getLocText(new String[]{"Event-showWidgets"})); showWidgets = new UICheckBox(Inter.getLocText(new String[]{"FR-Engine_Event_showWidgets"}));
showWidgets.setSelected(false); showWidgets.setSelected(false);
isAutoStash = new UICheckBox(Inter.getLocText("FR-Designer-Write_Auto_Stash")); isAutoStash = new UICheckBox(Inter.getLocText("FR-Designer-Write_Auto_Stash"));
isAutoStash.setSelected(false); isAutoStash.setSelected(false);

Loading…
Cancel
Save