Browse Source

Merge branch 'feature/9.0' of http://cloud.finedevelop.com:2015/scm/~plough/design into feature/9.0

master
plough 7 years ago
parent
commit
942cf83140
  1. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  2. 3
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  3. 10
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java
  4. 4
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  5. 32
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  6. 1
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  7. 8
      designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java
  8. BIN
      designer_base/src/com/fr/design/images/control/icon_thumb_normal.png
  9. BIN
      designer_base/src/com/fr/design/images/m_format/highlight.png
  10. BIN
      designer_base/src/com/fr/design/images/m_format/modified.png
  11. 25
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  12. 17
      designer_base/src/com/fr/design/mainframe/SiteCenterToken.java
  13. 4
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  14. 5
      designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType;
@ -43,7 +44,9 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {
String result;
HttpClient httpClient = new HttpClient(AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText));
String url = AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText);
url = String.format("%s?token=%s", url, SiteCenterToken.generateToken());
HttpClient httpClient = new HttpClient(url);
httpClient.asGet();
if (!httpClient.isServerAlive()) {
return getNoConnectList();

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

@ -4,6 +4,7 @@ import com.fr.base.CellBorderStyle;
import com.fr.base.NameStyle;
import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.style.*;
@ -12,6 +13,7 @@ import com.fr.design.style.BorderUtils;
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;
@ -38,6 +40,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
super();
tabPane.setOneLineTab(true);
tabPane.setDrawLine(false);
tabPane.setBorder(BorderFactory.createLineBorder(UIConstants.SHADOW_GREY));
tabPane.setLayout(new GridLayout(1, 3, 0, 0));
}

10
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.errorinfo;
import com.fr.base.FRContext;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
@ -11,8 +12,6 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.license.function.VT4FR;
import com.fr.log.LogHandler;
import com.fr.regist.FRCoreContext;
import com.fr.regist.LicenseListener;
import com.fr.stable.CodeUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants;
@ -94,6 +93,7 @@ public class ErrorInfoUploader {
private void downloadSolution(File localCacheZip) {
try {
String downloadURL = SiteCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution");
downloadURL = String.format("%s?token=%s", downloadURL, SiteCenterToken.generateToken());
HttpClient hc = new HttpClient(downloadURL);
hc.asGet();
InputStream in = hc.getResponseStream();
@ -113,7 +113,8 @@ public class ErrorInfoUploader {
private boolean needUpdate(File localCacheZip) {
if (localCacheZip.exists()) {
// 判断本地文件大小.
String checkURL = SiteCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/checkUpdate");
String checkURL = SiteCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/solution/cache/check");
checkURL = String.format("%s?token=%s", checkURL, SiteCenterToken.generateToken());
HttpClient client = new HttpClient(checkURL);
client.asGet();
if (client.isServerAlive()) {
@ -171,8 +172,7 @@ public class ErrorInfoUploader {
private boolean sendErroInfo(String url, String content) {
HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, "", "MD5"));
para.put("token", SiteCenterToken.generateToken());
para.put("content", content);
HttpClient httpClient = new HttpClient(url, para, true);
httpClient.asGet();

4
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -20,7 +20,7 @@ import netscape.javascript.JSObject;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import java.awt.Desktop;
import java.awt.*;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
@ -57,6 +57,7 @@ public class LoginWebBridge {
private static final int TIME_OUT = 10000;
private static final String LOGIN_SUCCESS = "ok";
private static final String LOGIN_FAILED = "failed";
private static final Color LOGIN_BACKGROUND = new Color(184, 220, 242);
private static LoginWebBridge helper;
private UIDialog uiDialog;
@ -250,6 +251,7 @@ public class LoginWebBridge {
private void loginSuccess(String username) {
closeWindow();
uiLabel.setText(username);
uiLabel.setBackground(LOGIN_BACKGROUND);
}
/**

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

@ -218,7 +218,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
}
protected Border getGroupBorder() {
return BorderFactory.createEmptyBorder(0, 0, 0, 0);
return BorderFactory.createEmptyBorder(1, 1, 1, 1);
}
protected LayoutManager getGridLayout(int number) {
@ -233,7 +233,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
public void paintComponents(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
Shape oldClip = g2d.getClip();
g2d.clip(new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), UIConstants.ARC, UIConstants.ARC));
g2d.clip(new RoundRectangle2D.Double(1, 1, getWidth(), getHeight(), UIConstants.ARC, UIConstants.ARC));
super.paintComponents(g);
g2d.setClip(oldClip);
}
@ -394,6 +394,34 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
fireStateChanged();
}
/**
* 重载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);
}
/**
* main
*

1
designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java

@ -74,6 +74,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
*/
public UIToggleButton(Icon[] icons, boolean needRelease) {
super(icons[0], null, icons[1]);
setBorderPainted(true);
setSelectedIcon(icons[1]);
setExtraPainted(true);
if (!needRelease) {

8
designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java

@ -5,7 +5,6 @@ import java.awt.*;
import java.util.ArrayList;
public class UIToolbar extends JToolBar {
private static final int TOOLBAR_HEIGNT = 26;
public UIToolbar() {
this(FlowLayout.LEFT);
@ -24,13 +23,6 @@ public class UIToolbar extends JToolBar {
this(align, new UIToolBarUI());
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = TOOLBAR_HEIGNT;
return dim;
}
public void checkComponentsByNames(boolean flag, ArrayList<String> names) {
for (int i = 0; i < getComponentCount(); i++) {
Component component = getComponents()[i];

BIN
designer_base/src/com/fr/design/images/control/icon_thumb_normal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
designer_base/src/com/fr/design/images/m_format/highlight.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 256 B

BIN
designer_base/src/com/fr/design/images/m_format/modified.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 273 B

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

@ -19,11 +19,14 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.math.BigDecimal;
/**
@ -31,6 +34,7 @@ import java.math.BigDecimal;
*/
public class JSliderPane extends JPanel {
public static final Image APPFIT_V0 = BaseUtils.readImage("com/fr/design/images/control/icon_thumb_normal.png");
private static final double ONEPOINTEIGHT = 1.8;
private static final int SIX = 6;
private static final int TEN = 10;
@ -433,8 +437,8 @@ public class JSliderPane extends JPanel {
class JSliderPaneUI extends BasicSliderUI {
private static final Color BACK_COLOR = new Color(245, 245, 247);
private static final int VERTICAL_WIDTH = 11;
private static final int VERTICAL_HEIGHT = 16;
private static final int THUMB_XOFFSET = 8;
private static final int THUMB_YOFFSET = 3;
private static final int FOUR = 4;
private static final int FIVE = 5;
private static final int SIX = 6;
@ -451,13 +455,9 @@ class JSliderPaneUI extends BasicSliderUI {
public void paintThumb(Graphics g) {
Rectangle knobBounds = thumbRect;
int w = knobBounds.width;
int h = knobBounds.height;
Graphics2D g2d = (Graphics2D) g;
g2d.translate(knobBounds.x, knobBounds.y);
g2d.setColor(new Color(51, 51, 52));
g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2);
g2d.drawImage(JSliderPane.APPFIT_V0, knobBounds.x - THUMB_XOFFSET, knobBounds.y + THUMB_YOFFSET, null);
g2d.dispose();
}
/** */
@ -481,6 +481,11 @@ class JSliderPaneUI extends BasicSliderUI {
}
}
public void setThumbLocation(int x, int y) {
super.setThumbLocation(x, y);
slider.repaint();
}
}
class PopupPane extends JPopupMenu {

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

@ -0,0 +1,17 @@
package com.fr.design.mainframe;
import com.fr.stable.CodeUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* Created by hzzz on 2017/12/4.
*/
public class SiteCenterToken {
public static String generateToken() {
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
return CodeUtils.md5Encode(date, "", "MD5");
}
}

4
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -6,6 +6,7 @@ import com.fr.base.io.IOFile;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.env.RemoteEnv;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
@ -292,8 +293,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable, XM
private boolean sendSingleTemplateInfo(String url, String content) {
HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, "", "MD5"));
para.put("token", SiteCenterToken.generateToken());
para.put("content", content);
HttpClient httpClient = new HttpClient(url, para, true);
httpClient.setTimeout(5000);

5
designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java

@ -40,6 +40,7 @@ import java.util.List;
public class FormParaWidgetPane extends JPanel {
private static FormParaWidgetPane THIS;
private final static int BORDER = 5;
private final static int WIDGET_WIDTHGAP = 4;
private List<WidgetOption> predifinedwidgeList = new ArrayList<WidgetOption>();
@ -123,7 +124,6 @@ public class FormParaWidgetPane extends JPanel {
}
private void initWidgetTypePopUp() {
if (widgetTypePopupMenu == null) {
JPanel widgetPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
loadPredefinedWidget();
int rowNum = calculateWidgetWindowRowNum();
@ -137,7 +137,7 @@ public class FormParaWidgetPane extends JPanel {
for (WidgetOption no : predifinedwidgeList) {
eastPane.add(new ToolBarButton(no));
}
int maxWidth = preWidgetShowMaxNum * (widgetButtonWidth + smallGAP) - smallGAP;
int maxWidth = preWidgetShowMaxNum * (widgetButtonWidth + smallGAP) - smallGAP + WIDGET_WIDTHGAP;
int width = predifinedwidgeList.size() >= preWidgetShowMaxNum ? maxWidth : (int) eastPane.getPreferredSize().getWidth();
eastPane.setPreferredSize(new Dimension(width, (int) (rowNum * eastPane.getPreferredSize().getHeight())));
@ -156,7 +156,6 @@ public class FormParaWidgetPane extends JPanel {
widgetTypePopupMenu.setBackground(UIConstants.SELECT_TAB);
widgetTypePopupMenu.add(widgetPane);
}
}
private void initChartTypePopUp() {
if (chartTypePopupMenu == null){

Loading…
Cancel
Save