Browse Source

merge

master
fr_shine 7 years ago
parent
commit
ec6494552b
  1. 7
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  2. 8
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  3. 120
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  4. 1
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  5. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  6. 16
      designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java
  7. 14
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  8. 3
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  9. 10
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  10. 17
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  11. 17
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  12. 8
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  13. 14
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  14. 7
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

7
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -79,7 +79,7 @@ public class CellElementPropertyPane extends DockingView {
@Override @Override
public void fireTitleChange(String addName) { public void fireTitleChange(String addName) {
title.setText(Inter.getLocText("CellElement-Property_Table") + '-' + addName); title.setText(Inter.getLocText("FR-Designer_CellElement_Property_Table") + '-' + addName);
} }
}; };
@ -134,8 +134,7 @@ public class CellElementPropertyPane extends DockingView {
} }
public void reInit(ElementCasePane ePane) { public void reInit(ElementCasePane ePane) {
if (titlePane.getParent() == null) { // 如果处于隐藏状态,则让其显示 if (cellElementEditPane.getParent() == null) { // 如果处于隐藏状态,则让其显示
// this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER); this.add(cellElementEditPane, BorderLayout.CENTER);
} }
cellElementEditPane.populate(ePane); cellElementEditPane.populate(ePane);
@ -151,7 +150,7 @@ public class CellElementPropertyPane extends DockingView {
@Override @Override
public String getViewTitle() { public String getViewTitle() {
return Inter.getLocText("CellElement-Property_Table"); return Inter.getLocText("FR-Designer_CellElement_Property_Table");
} }
@Override @Override

8
designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java

@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer<Object> {
showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
panel.add(showMoreLabel, BorderLayout.EAST); panel.add(showMoreLabel, BorderLayout.EAST);
} }
if (moreModel.isLoading()) {
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
//设置cell的加载动画
imageIcon.setImageObserver(list);
UILabel loadingLabel = new UILabel(imageIcon);
loadingLabel.setBorder(BorderFactory.createEmptyBorder(LOAD_OFFSET,0,0,0));
panel.add(loadingLabel, 0);
}
panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT)); panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT));
return panel; return panel;
} }

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

@ -17,7 +17,10 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.preview.*; import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane;
import com.fr.design.mainframe.alphafine.preview.FilePreviewPane;
import com.fr.design.mainframe.alphafine.preview.NoResultPane;
import com.fr.design.mainframe.alphafine.preview.PluginPreviewPane;
import com.fr.design.mainframe.alphafine.search.manager.*; import com.fr.design.mainframe.alphafine.search.manager.*;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.FormIO; import com.fr.form.main.FormIO;
@ -72,9 +75,11 @@ public class AlphaFineDialog extends UIDialog {
private AlphaFineTextField searchTextField; private AlphaFineTextField searchTextField;
private UIButton closeButton; private UIButton closeButton;
private JPanel searchResultPane; private JPanel searchResultPane;
private Point pressedPoint;
private UIScrollPane leftSearchResultPane; private UIScrollPane leftSearchResultPane;
private JPanel defaultPane; private JPanel defaultPane;
//分割线
private UILabel splitLabel;
private JPanel rightSearchResultPane; private JPanel rightSearchResultPane;
private AlphaFineList searchResultList; private AlphaFineList searchResultList;
private SearchListModel searchListModel; private SearchListModel searchListModel;
@ -302,7 +307,7 @@ public class AlphaFineDialog extends UIDialog {
rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT)); rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT));
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST);
UILabel splitLabel = new UILabel(); splitLabel = new UILabel();
splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1));
searchResultPane.add(splitLabel, BorderLayout.NORTH); searchResultPane.add(splitLabel, BorderLayout.NORTH);
add(searchResultPane, BorderLayout.SOUTH); add(searchResultPane, BorderLayout.SOUTH);
@ -320,6 +325,8 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() { this.searchWorker = new SwingWorker() {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
resumeLeftPane();
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase()); rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@ -327,6 +334,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
protected void done() { protected void done() {
if (!isCancelled()) { if (!isCancelled()) {
splitLabel.setIcon(null);
fireStopLoading(); fireStopLoading();
} }
} }
@ -334,12 +342,39 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker.execute(); this.searchWorker.execute();
} }
/**
* 恢复左侧列表面板
*/
private void resumeLeftPane() {
if (searchResultPane != null && defaultPane != null) {
rightSearchResultPane.removeAll();
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
}
}
/**
* 移除左侧列表面板
*/
private void removeLeftPane() {
if (searchListModel.isEmpty() && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
refreshContainer();
}
}
/** /**
* 停止加载状态 * 停止加载状态
*/ */
private void fireStopLoading() { private void fireStopLoading() {
searchListModel.resetState(); searchListModel.resetState();
replaceLeftPane(); if (searchResultPane != null) {
removeLeftPane();
}
} }
/** /**
@ -351,22 +386,6 @@ public class AlphaFineDialog extends UIDialog {
revalidate(); revalidate();
} }
/**
* 重置结果面板
*/
private void replaceLeftPane() {
if (searchListModel.getSize() == 0 && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
} else if (searchListModel.getSize() > 0 && defaultPane != null) {
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
}
refreshContainer();
}
/** /**
* 重新构建搜索结果列表 * 重新构建搜索结果列表
* 先根据输入判断是不是隐藏的搜索功能 * 先根据输入判断是不是隐藏的搜索功能
@ -409,8 +428,7 @@ public class AlphaFineDialog extends UIDialog {
searchListModel.removeAllElements(); searchListModel.removeAllElements();
searchListModel.resetSelectedState(); searchListModel.resetSelectedState();
rightSearchResultPane.removeAll(); rightSearchResultPane.removeAll();
validate(); refreshContainer();
repaint();
} }
/** /**
@ -605,7 +623,7 @@ public class AlphaFineDialog extends UIDialog {
this.showWorker.execute(); this.showWorker.execute();
break; break;
default: default:
return; rightSearchResultPane.removeAll();
} }
@ -680,45 +698,6 @@ public class AlphaFineDialog extends UIDialog {
} }
/**
* 窗口拖拽
*/
private void initMouseListener() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
doMouseDragged(e);
}
});
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
doMousePressed(e);
}
});
}
private void doMousePressed(MouseEvent e) {
pressedPoint = e.getPoint();
}
private void doMouseDragged(MouseEvent e) {
Point point = e.getPoint();// 获取当前坐标
Point locationPoint = getLocation();// 获取窗体坐标
int x = locationPoint.x + point.x - pressedPoint.x;// 计算移动后的新坐标
int y = locationPoint.y + point.y - pressedPoint.y;
setLocation(x, y);// 改变窗体位置
}
/** /**
* 当鼠标在搜索界面边界外点击时触发 * 当鼠标在搜索界面边界外点击时触发
*/ */
@ -792,7 +771,7 @@ public class AlphaFineDialog extends UIDialog {
} }
final HashMap<String, String> para = new HashMap<>(); final HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, "", "MD5")); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));
para.put("content", object.toString()); para.put("content", object.toString());
HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true);
httpClient.asGet(); httpClient.asGet();
@ -880,6 +859,14 @@ public class AlphaFineDialog extends UIDialog {
this.storeText = storeText; this.storeText = storeText;
} }
public UILabel getSplitLabel() {
return splitLabel;
}
public void setSplitLabel(UILabel splitLabel) {
this.splitLabel = splitLabel;
}
/** /**
* +-------------------------------------+ * +-------------------------------------+
@ -1047,8 +1034,13 @@ public class AlphaFineDialog extends UIDialog {
isValidSelected = selected; isValidSelected = selected;
} }
@Override
public boolean isEmpty() {
return myDelegate.isEmpty();
}
public void resetState() { public void resetState() {
for (int i = 0; i< getSize(); i++) { for (int i = 0; i < getSize(); i++) {
getElementAt(i).resetState(); getElementAt(i).resetState();
} }
} }

1
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -30,6 +30,7 @@ public class AlphaFinePane extends BasicPane {
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine"));
refreshButton.set4ToolbarButton(); refreshButton.set4ToolbarButton();
refreshButton.setRolloverEnabled(false);
this.add(refreshButton); this.add(refreshButton);
this.setBackground(ThemeUtils.WHITE_BORDER_COLOR); this.setBackground(ThemeUtils.WHITE_BORDER_COLOR);
refreshButton.addActionListener(new ActionListener() { refreshButton.addActionListener(new ActionListener() {

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

16
designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java

@ -18,7 +18,9 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -45,6 +47,7 @@ public class UserInfoPane extends BasicPane{
private UserInfoLabel userInfoLabel; private UserInfoLabel userInfoLabel;
public UserInfoLabel getUserInfoLabel() { public UserInfoLabel getUserInfoLabel() {
return userInfoLabel; return userInfoLabel;
} }
@ -64,18 +67,15 @@ public class UserInfoPane extends BasicPane{
this.userInfoLabel = new UserInfoLabel(this); this.userInfoLabel = new UserInfoLabel(this);
this.markUnSignIn(); this.markUnSignIn();
autoLogin(); addEnvChangedListener();
autoPushLoginDialog(); autoPushLoginDialog();
this.add(userInfoLabel, BorderLayout.CENTER); this.add(userInfoLabel, BorderLayout.CENTER);
} }
// 后台自动登录
private void autoLogin(){
Thread bbsAutoLoginThread = new Thread(new Runnable() {
@Override private void addEnvChangedListener(){
public void run() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ConfigManager.getProviderInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){ if (StringUtils.isEmpty(username)){
markUnSignIn(); markUnSignIn();
@ -84,8 +84,8 @@ public class UserInfoPane extends BasicPane{
} }
} }
}); });
bbsAutoLoginThread.start();
} }
// 计算xml保存的上次弹框时间和当前时间的时间差 // 计算xml保存的上次弹框时间和当前时间的时间差
private int getDiffFromLastLogin(){ private int getDiffFromLastLogin(){

14
designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -48,9 +48,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIComboBox showContent; private UIComboBox showContent;
private UIPropertyTextField tooltipTextField; private UITextField tooltipTextField;
private UIPropertyTextField fileNameTextField; private UITextField fileNameTextField;
// 分页 // 分页
private UICheckBox pageBeforeRowCheckBox; private UICheckBox pageBeforeRowCheckBox;
@ -229,8 +229,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
final JPanel fileNamePane = new JPanel(fileNameLayout); final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UIPropertyTextField(); fileNameTextField = new UITextField();
tooltipTextField = new UIPropertyTextField(); tooltipTextField = new UITextField();
tooltipTextField.getUI(); tooltipTextField.getUI();
fileNamePane.add(new JPanel(), "none"); fileNamePane.add(new JPanel(), "none");
fileNamePane.add(fileNameCCPane, "content"); fileNamePane.add(fileNameCCPane, "content");
@ -452,10 +452,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) {
cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected()); cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Can_Break_On_Paginate"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate"))) {
cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected()); cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Repeat_Content_When_Paging"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging"))) {
cellPageAttr.setRepeat(this.repeatCheckBox.isSelected()); cellPageAttr.setRepeat(this.repeatCheckBox.isSelected());
} }

3
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -78,7 +78,8 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
private String readLogID(String log) { private String readLogID(String log) {
String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix"); String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix");
String[] matchs = log.split(errorCode + ".*?:"); // 报错信息国际化不规范, 有些是中文分号, 有些是英文
String[] matchs = log.split(errorCode + ".*?[:,:]");
if (matchs.length <= 1) { if (matchs.length <= 1) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }

10
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -1,5 +1,7 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fr.base.FRCoreContext;
import com.fr.general.VT4FR;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
@ -88,7 +90,8 @@ public class AlphaFineConfigManager implements XMLable {
@Override @Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone();
return manager;
} }
@Override @Override
@ -199,7 +202,10 @@ public class AlphaFineConfigManager implements XMLable {
} }
public boolean isEnabled() { public boolean isEnabled() {
return isEnabled; if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
return isEnabled;
}
return false;
} }
public void setEnabled(boolean isEnabled) { public void setEnabled(boolean isEnabled) {

17
designer_base/src/com/fr/design/mainframe/JFormSliderPane.java

@ -16,6 +16,8 @@ import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -75,6 +77,15 @@ public class JFormSliderPane extends JPanel {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initSlider(); initSlider();
initShowValSpinner(); initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton(); initDownUpButton();
initShowValButton(); initShowValButton();
initUIRadioButton(); initUIRadioButton();
@ -111,7 +122,7 @@ public class JFormSliderPane extends JPanel {
} }
private void initShowValSpinner() { private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){ showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)){
public Point getToolTipLocation(MouseEvent event){ public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
@ -325,7 +336,7 @@ public class JFormSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue(); showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true; isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) { if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN; int newDownVal = showValue - TEN;
if (newDownVal >= TEN) { if (newDownVal >= TEN) {
showValue = newDownVal; showValue = newDownVal;
@ -335,7 +346,7 @@ public class JFormSliderPane extends JPanel {
showValSpinner.setValue(TEN); showValSpinner.setValue(TEN);
} }
} }
if (e.getActionCommand().equals("more")) { if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN; int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) { if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal; showValue = newUpVal;

17
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -17,6 +17,8 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI; import javax.swing.plaf.basic.BasicSliderUI;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -77,6 +79,15 @@ public class JSliderPane extends JPanel {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initSlider(); initSlider();
initShowValSpinner(); initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton(); initDownUpButton();
initShowValButton(); initShowValButton();
initUIRadioButton(); initUIRadioButton();
@ -114,7 +125,7 @@ public class JSliderPane extends JPanel {
} }
private void initShowValSpinner() { private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)) { showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) {
public Point getToolTipLocation(MouseEvent event) { public Point getToolTipLocation(MouseEvent event) {
return new Point(event.getX(), event.getY() - TOOLTIP_Y); return new Point(event.getX(), event.getY() - TOOLTIP_Y);
} }
@ -331,7 +342,7 @@ public class JSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue(); showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true; isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) { if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN; int newDownVal = showValue - TEN;
if (newDownVal >= TEN) { if (newDownVal >= TEN) {
showValue = newDownVal; showValue = newDownVal;
@ -341,7 +352,7 @@ public class JSliderPane extends JPanel {
showValSpinner.setValue(TEN); showValSpinner.setValue(TEN);
} }
} }
if (e.getActionCommand().equals("more")) { if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN; int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) { if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal; showValue = newUpVal;

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

@ -5,6 +5,7 @@ package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -34,6 +35,7 @@ import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.VT4FR;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime; import com.fr.plugin.context.PluginRuntime;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
@ -379,8 +381,10 @@ public abstract class ToolBarMenuDock {
// shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AlphaFineAction()); if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }

14
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -49,6 +49,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private CardLayout cardLayout; // 卡片布局,选中参数面板时显示mobileWidgetTable,选中body时显示mobileBodyWidgetTable private CardLayout cardLayout; // 卡片布局,选中参数面板时显示mobileWidgetTable,选中body时显示mobileBodyWidgetTable
private JTableHeader header;//把表头单独get出来作为一个组件 private JTableHeader header;//把表头单独get出来作为一个组件
private UIHeadGroup tabsHeaderIconPane; private UIHeadGroup tabsHeaderIconPane;
private XComponent lastAffectedCreator;
public static WidgetPropertyPane getInstance() { public static WidgetPropertyPane getInstance() {
@ -132,9 +133,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
*/ */
private void createPropertyTable() { private void createPropertyTable() {
formWidgetCardPane = new FormWidgetCardPane(designer); formWidgetCardPane = new FormWidgetCardPane(designer);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane)); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
psp = new UIScrollPane(formWidgetCardPane); // 用来装载属性表table psp = new UIScrollPane(formWidgetCardPane); // 用来装载属性表table
psp.setBorder(null); psp.setBorder(null);
} }
@ -318,6 +317,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private class WidgetPropertyDesignerAdapter implements DesignerEditListener { private class WidgetPropertyDesignerAdapter implements DesignerEditListener {
FormWidgetCardPane formWidgetCardPane; FormWidgetCardPane formWidgetCardPane;
WidgetPropertyDesignerAdapter(FormWidgetCardPane formWidgetCardPane) { WidgetPropertyDesignerAdapter(FormWidgetCardPane formWidgetCardPane) {
this.formWidgetCardPane = formWidgetCardPane; this.formWidgetCardPane = formWidgetCardPane;
} }
@ -329,14 +329,19 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) {
formWidgetCardPane.populate(); formWidgetCardPane.populate();
}else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ }else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){
formWidgetCardPane = new FormWidgetCardPane(designer); // 防止多次触发
if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) {
return;
}
lastAffectedCreator = evt.getAffectedCreator();
refreshDockingView();
formWidgetCardPane.populate(); formWidgetCardPane.populate();
} }
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
return o instanceof WidgetPropertyDesignerAdapter && ((WidgetPropertyDesignerAdapter) o).formWidgetCardPane == this.formWidgetCardPane; return o instanceof WidgetPropertyDesignerAdapter;
} }
} }
@ -345,7 +350,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
*/ */
private class EventPropertyDesignerAdapter implements DesignerEditListener { private class EventPropertyDesignerAdapter implements DesignerEditListener {
EventPropertyTable propertyTable; EventPropertyTable propertyTable;
private XComponent lastAffectedCreator;
EventPropertyDesignerAdapter(EventPropertyTable eventTable) { EventPropertyDesignerAdapter(EventPropertyTable eventTable) {
this.propertyTable = eventTable; this.propertyTable = eventTable;

7
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -27,7 +27,7 @@ import java.awt.*;
* Created by ibm on 2017/7/25. * Created by ibm on 2017/7/25.
*/ */
public class FormWidgetCardPane extends AbstractAttrNoScrollPane { public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private AttributeChangeListener listener2; private AttributeChangeListener listener;
private FormDesigner designer; private FormDesigner designer;
//当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<Widget> currentEditorDefinePane; private DataModify<Widget> currentEditorDefinePane;
@ -81,7 +81,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} else { } else {
return null; return null;
} }
} }
/** /**
@ -138,7 +137,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
jPanel.add(attriCardPane, BorderLayout.CENTER); jPanel.add(attriCardPane, BorderLayout.CENTER);
this.listener2 = new AttributeChangeListener() { this.listener = new AttributeChangeListener() {
@Override @Override
public void attributeChange() { public void attributeChange() {
updateCreator(); updateCreator();
@ -196,7 +195,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
reinitAllListeners(); reinitAllListeners();
this.addAttributeChangeListener(listener2); this.addAttributeChangeListener(listener);
} }

Loading…
Cancel
Save