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. 20
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java
  4. 2
      designer_base/src/com/fr/design/DesignModelAdapter.java
  5. 4
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  6. 32
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  7. 1
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  8. 8
      designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java
  9. BIN
      designer_base/src/com/fr/design/images/control/icon_thumb_normal.png
  10. BIN
      designer_base/src/com/fr/design/images/m_format/highlight.png
  11. BIN
      designer_base/src/com/fr/design/images/m_format/modified.png
  12. 25
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  13. 17
      designer_base/src/com/fr/design/mainframe/SiteCenterToken.java
  14. 4
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  15. 63
      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; package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.CellType;
@ -43,7 +44,9 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
this.recommendModelList = new SearchResult(); this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {
String result; 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(); httpClient.asGet();
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
return getNoConnectList(); 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.NameStyle;
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.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.style.*; import com.fr.design.gui.style.*;
@ -12,6 +13,7 @@ import com.fr.design.style.BorderUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -38,6 +40,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
super(); super();
tabPane.setOneLineTab(true); tabPane.setOneLineTab(true);
tabPane.setDrawLine(false); tabPane.setDrawLine(false);
tabPane.setBorder(BorderFactory.createLineBorder(UIConstants.SHADOW_GREY));
tabPane.setLayout(new GridLayout(1, 3, 0, 0)); tabPane.setLayout(new GridLayout(1, 3, 0, 0));
} }

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.errorinfo; package com.fr.design.mainframe.errorinfo;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -11,8 +12,6 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.license.function.VT4FR; import com.fr.license.function.VT4FR;
import com.fr.log.LogHandler; import com.fr.log.LogHandler;
import com.fr.regist.FRCoreContext;
import com.fr.regist.LicenseListener;
import com.fr.stable.CodeUtils; import com.fr.stable.CodeUtils;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
@ -71,7 +70,7 @@ public class ErrorInfoUploader {
} }
// 从云中心更新最新的解决方案文件 // 从云中心更新最新的解决方案文件
private void checkUpdateSolution(){ private void checkUpdateSolution() {
if (!VT4FR.AlphaFine.support()) { if (!VT4FR.AlphaFine.support()) {
return; return;
@ -94,6 +93,7 @@ public class ErrorInfoUploader {
private void downloadSolution(File localCacheZip) { private void downloadSolution(File localCacheZip) {
try { try {
String downloadURL = SiteCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution"); 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); HttpClient hc = new HttpClient(downloadURL);
hc.asGet(); hc.asGet();
InputStream in = hc.getResponseStream(); InputStream in = hc.getResponseStream();
@ -110,13 +110,14 @@ public class ErrorInfoUploader {
} }
private boolean needUpdate(File localCacheZip){ private boolean needUpdate(File localCacheZip) {
if (localCacheZip.exists()) { 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); HttpClient client = new HttpClient(checkURL);
client.asGet(); client.asGet();
if (client.isServerAlive()){ if (client.isServerAlive()) {
try { try {
JSONObject res = new JSONObject(client.getResponseText()); JSONObject res = new JSONObject(client.getResponseText());
// 简单粗暴, 直接判断文件大小. // 简单粗暴, 直接判断文件大小.
@ -129,7 +130,7 @@ public class ErrorInfoUploader {
return true; return true;
} }
public void sendErrorInfo(){ public void sendErrorInfo() {
// 判断更新解决方案缓存. // 判断更新解决方案缓存.
checkUpdateSolution(); checkUpdateSolution();
@ -171,8 +172,7 @@ public class ErrorInfoUploader {
private boolean sendErroInfo(String url, String content) { private boolean sendErroInfo(String url, String content) {
HashMap<String, String> para = new HashMap<>(); HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", SiteCenterToken.generateToken());
para.put("token", CodeUtils.md5Encode(date, "", "MD5"));
para.put("content", content); para.put("content", content);
HttpClient httpClient = new HttpClient(url, para, true); HttpClient httpClient = new HttpClient(url, para, true);
httpClient.asGet(); httpClient.asGet();
@ -181,7 +181,7 @@ public class ErrorInfoUploader {
return false; return false;
} }
String res = httpClient.getResponseText(); String res = httpClient.getResponseText();
boolean success; boolean success;
try { try {
success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");

2
designer_base/src/com/fr/design/DesignModelAdapter.java

@ -26,7 +26,7 @@ public abstract class DesignModelAdapter<T extends IOFile, S extends JTemplatePr
public DesignModelAdapter(S jTemplate) { public DesignModelAdapter(S jTemplate) {
this.jTemplate = jTemplate; this.jTemplate = jTemplate;
setCurrentModelAdapter(this); setCurrentModelAdapter(this);
} }
public S getjTemplate() { public S getjTemplate() {

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.JDialog;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Desktop; import java.awt.*;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URI; import java.net.URI;
import java.net.URLEncoder; import java.net.URLEncoder;
@ -57,6 +57,7 @@ public class LoginWebBridge {
private static final int TIME_OUT = 10000; private static final int TIME_OUT = 10000;
private static final String LOGIN_SUCCESS = "ok"; private static final String LOGIN_SUCCESS = "ok";
private static final String LOGIN_FAILED = "failed"; private static final String LOGIN_FAILED = "failed";
private static final Color LOGIN_BACKGROUND = new Color(184, 220, 242);
private static LoginWebBridge helper; private static LoginWebBridge helper;
private UIDialog uiDialog; private UIDialog uiDialog;
@ -250,6 +251,7 @@ public class LoginWebBridge {
private void loginSuccess(String username) { private void loginSuccess(String username) {
closeWindow(); closeWindow();
uiLabel.setText(username); 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() { protected Border getGroupBorder() {
return BorderFactory.createEmptyBorder(0, 0, 0, 0); return BorderFactory.createEmptyBorder(1, 1, 1, 1);
} }
protected LayoutManager getGridLayout(int number) { protected LayoutManager getGridLayout(int number) {
@ -233,7 +233,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
public void paintComponents(Graphics g) { public void paintComponents(Graphics g) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
Shape oldClip = g2d.getClip(); 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); super.paintComponents(g);
g2d.setClip(oldClip); g2d.setClip(oldClip);
} }
@ -394,6 +394,34 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
fireStateChanged(); 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 * 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) { public UIToggleButton(Icon[] icons, boolean needRelease) {
super(icons[0], null, icons[1]); super(icons[0], null, icons[1]);
setBorderPainted(true);
setSelectedIcon(icons[1]); setSelectedIcon(icons[1]);
setExtraPainted(true); setExtraPainted(true);
if (!needRelease) { if (!needRelease) {

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

@ -5,7 +5,6 @@ import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
public class UIToolbar extends JToolBar { public class UIToolbar extends JToolBar {
private static final int TOOLBAR_HEIGNT = 26;
public UIToolbar() { public UIToolbar() {
this(FlowLayout.LEFT); this(FlowLayout.LEFT);
@ -24,13 +23,6 @@ public class UIToolbar extends JToolBar {
this(align, new UIToolBarUI()); 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) { public void checkComponentsByNames(boolean flag, ArrayList<String> names) {
for (int i = 0; i < getComponentCount(); i++) { for (int i = 0; i < getComponentCount(); i++) {
Component component = getComponents()[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.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.BadLocationException;
import javax.swing.text.DefaultFormatterFactory; import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter; import javax.swing.text.NumberFormatter;
import java.awt.*; 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; import java.math.BigDecimal;
/** /**
@ -31,6 +34,7 @@ import java.math.BigDecimal;
*/ */
public class JSliderPane extends JPanel { 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 double ONEPOINTEIGHT = 1.8;
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
@ -433,8 +437,8 @@ public class JSliderPane extends JPanel {
class JSliderPaneUI extends BasicSliderUI { class JSliderPaneUI extends BasicSliderUI {
private static final Color BACK_COLOR = new Color(245, 245, 247); private static final Color BACK_COLOR = new Color(245, 245, 247);
private static final int VERTICAL_WIDTH = 11; private static final int THUMB_XOFFSET = 8;
private static final int VERTICAL_HEIGHT = 16; private static final int THUMB_YOFFSET = 3;
private static final int FOUR = 4; private static final int FOUR = 4;
private static final int FIVE = 5; private static final int FIVE = 5;
private static final int SIX = 6; private static final int SIX = 6;
@ -451,13 +455,9 @@ class JSliderPaneUI extends BasicSliderUI {
public void paintThumb(Graphics g) { public void paintThumb(Graphics g) {
Rectangle knobBounds = thumbRect; Rectangle knobBounds = thumbRect;
int w = knobBounds.width;
int h = knobBounds.height;
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.drawImage(JSliderPane.APPFIT_V0, knobBounds.x - THUMB_XOFFSET, knobBounds.y + THUMB_YOFFSET, null);
g2d.translate(knobBounds.x, knobBounds.y); g2d.dispose();
g2d.setColor(new Color(51, 51, 52));
g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2);
} }
/** */ /** */
@ -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 { 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.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.general.*; import com.fr.general.*;
import com.fr.general.http.HttpClient; 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) { private boolean sendSingleTemplateInfo(String url, String content) {
HashMap<String, String> para = new HashMap<>(); HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", SiteCenterToken.generateToken());
para.put("token", CodeUtils.md5Encode(date, "", "MD5"));
para.put("content", content); para.put("content", content);
HttpClient httpClient = new HttpClient(url, para, true); HttpClient httpClient = new HttpClient(url, para, true);
httpClient.setTimeout(5000); httpClient.setTimeout(5000);

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

@ -40,6 +40,7 @@ import java.util.List;
public class FormParaWidgetPane extends JPanel { public class FormParaWidgetPane extends JPanel {
private static FormParaWidgetPane THIS; private static FormParaWidgetPane THIS;
private final static int BORDER = 5; private final static int BORDER = 5;
private final static int WIDGET_WIDTHGAP = 4;
private List<WidgetOption> predifinedwidgeList = new ArrayList<WidgetOption>(); private List<WidgetOption> predifinedwidgeList = new ArrayList<WidgetOption>();
@ -123,39 +124,37 @@ public class FormParaWidgetPane extends JPanel {
} }
private void initWidgetTypePopUp() { private void initWidgetTypePopUp() {
if (widgetTypePopupMenu == null) { JPanel widgetPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
JPanel widgetPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); loadPredefinedWidget();
loadPredefinedWidget(); int rowNum = calculateWidgetWindowRowNum();
int rowNum = calculateWidgetWindowRowNum(); JPanel westPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel westPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); for (WidgetOption o : loadWidgetOptions()) {
for (WidgetOption o : loadWidgetOptions()) { westPanel.add(new ToolBarButton(o));
westPanel.add(new ToolBarButton(o)); }
} int x = commonWidgetNum * (widgetButtonWidth + smallGAP) - smallGAP;
int x = commonWidgetNum * (widgetButtonWidth + smallGAP) - smallGAP; westPanel.setPreferredSize(new Dimension(x, (int) (rowNum * westPanel.getPreferredSize().getHeight())));
westPanel.setPreferredSize(new Dimension(x, (int) (rowNum * westPanel.getPreferredSize().getHeight()))); JPanel eastPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel eastPane = new JPanel(new FlowLayout(FlowLayout.LEFT)); for (WidgetOption no : predifinedwidgeList) {
for (WidgetOption no : predifinedwidgeList) { eastPane.add(new ToolBarButton(no));
eastPane.add(new ToolBarButton(no));
}
int maxWidth = preWidgetShowMaxNum * (widgetButtonWidth + smallGAP) - smallGAP;
int width = predifinedwidgeList.size() >= preWidgetShowMaxNum ? maxWidth : (int) eastPane.getPreferredSize().getWidth();
eastPane.setPreferredSize(new Dimension(width, (int) (rowNum * eastPane.getPreferredSize().getHeight())));
UIScrollPane eastScrollPane = new UIScrollPane(eastPane);
eastScrollPane.setBorder(null);
int maxHeight = preWidgetShowMaxRow * (widgetButtonHeight + smallGAP) - smallGAP;
int height = predifinedwidgeList.size() >= preWidgetShowMaxNum * preWidgetShowMaxRow ? maxHeight : (int) eastPane.getPreferredSize().getHeight();
width = predifinedwidgeList.size() >= preWidgetShowMaxNum * preWidgetShowMaxRow ? (int) eastPane.getPreferredSize().getWidth() + smallGAP + jsparatorWidth : (int) eastPane.getPreferredSize().getWidth();
eastScrollPane.setPreferredSize(new Dimension(width, height));
widgetPane.add(westPanel);
widgetPane.add(createJSeparator(height));
widgetPane.add(eastScrollPane);
widgetTypePopupMenu = new UIPopupMenu();
widgetTypePopupMenu.setBackground(UIConstants.SELECT_TAB);
widgetTypePopupMenu.add(widgetPane);
} }
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())));
UIScrollPane eastScrollPane = new UIScrollPane(eastPane);
eastScrollPane.setBorder(null);
int maxHeight = preWidgetShowMaxRow * (widgetButtonHeight + smallGAP) - smallGAP;
int height = predifinedwidgeList.size() >= preWidgetShowMaxNum * preWidgetShowMaxRow ? maxHeight : (int) eastPane.getPreferredSize().getHeight();
width = predifinedwidgeList.size() >= preWidgetShowMaxNum * preWidgetShowMaxRow ? (int) eastPane.getPreferredSize().getWidth() + smallGAP + jsparatorWidth : (int) eastPane.getPreferredSize().getWidth();
eastScrollPane.setPreferredSize(new Dimension(width, height));
widgetPane.add(westPanel);
widgetPane.add(createJSeparator(height));
widgetPane.add(eastScrollPane);
widgetTypePopupMenu = new UIPopupMenu();
widgetTypePopupMenu.setBackground(UIConstants.SELECT_TAB);
widgetTypePopupMenu.add(widgetPane);
} }
private void initChartTypePopUp() { private void initChartTypePopUp() {

Loading…
Cancel
Save