daniel 7 years ago
parent
commit
a1d1927888
  1. 34
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  2. 2
      designer_base/build.release.gradle
  3. 38
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  4. 1200
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  5. 11
      designer_base/src/com/fr/design/module/DesignModuleFactory.java
  6. 2
      designer_chart/build.release.gradle
  7. 3
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  8. 18
      designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java
  9. 2
      designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java
  10. 2
      designer_form/build.release.gradle
  11. 28
      designer_form/src/com/fr/design/designer/creator/ErrorCreator.java
  12. 6
      designer_form/src/com/fr/design/designer/creator/NullCreator.java
  13. 3
      designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java
  14. 19
      designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java

34
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -30,7 +30,6 @@ import java.net.URI;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
* @author neil
@ -191,44 +190,11 @@ public class UserInfoLabel extends UILabel {
return;
}
if (StringUtils.isEmpty(this.userName)) {
updateMessageCount();
}
//往designerenvmanger里写一下
DesignerEnvManager.getEnvManager().setBBSName(userName);
this.userName = userName;
}
private void updateMessageCount() {
//启动获取消息更新的线程
//登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数.
Thread updateMessageThread = new Thread(new Runnable() {
@Override
public void run() {
sleep(CHECK_MESSAGE_TIME);
//从env中获取username, 因为如果注销的话, env的里username会被清空.
while (StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())) {
HashMap<String, String> para = new HashMap<String, String>();
para.put("username", encode(encode(userName)));
HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet();
if (getMessage.isServerAlive()) {
try {
String res = getMessage.getResponseText();
if (StringUtils.isNotEmpty(res)) {
setMessageCount(Integer.parseInt(res));
}
} catch (Exception e) {
}
}
sleep(CHECK_MESSAGE_TIME);
}
}
});
updateMessageThread.start();
}
private String encode(String str) {
try {
return URLEncoder.encode(str, EncodeConstants.ENCODING_UTF_8);

2
designer_base/build.release.gradle

@ -53,7 +53,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar')
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'

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

@ -6,10 +6,8 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.ucenter.Client;
import com.fr.design.extra.ucenter.XMLHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import javafx.scene.web.WebEngine;
@ -19,7 +17,6 @@ import java.awt.*;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.LinkedList;
public class LoginWebBridge {
@ -122,41 +119,6 @@ public class LoginWebBridge {
return client.isServerAlive();
}
/**
* 定时取后台论坛消息
*/
public void updateMessageCount() {
//启动获取消息更新的线程
//登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数.
Thread updateMessageThread = new Thread(new Runnable() {
@Override
public void run() {
sleep(CHECK_MESSAGE_TIME);
while (StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())) {
HashMap<String, String> para = new HashMap<>();
int uid = DesignerEnvManager.getEnvManager().getBbsUid();
para.put("uid", String.valueOf(uid));
HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet();
if (getMessage.isServerAlive()) {
try {
String res = getMessage.getResponseText();
if (!ComparatorUtils.equals(res, FAILED_MESSAGE_STATUS)) {
JSONObject jo = new JSONObject(res);
if (SUCCESS_MESSAGE_STATUS.equals(jo.optString("status"))) {
setMessageCount(Integer.parseInt(jo.getString("message")));
}
}
} catch (Exception ignore) {
}
}
sleep(CHECK_MESSAGE_TIME);
}
}
});
updateMessageThread.start();
}
/**
* 设置获取的消息长度并设置显示
*

1200
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

File diff suppressed because it is too large Load Diff

11
designer_base/src/com/fr/design/module/DesignModuleFactory.java

@ -2,7 +2,6 @@ package com.fr.design.module;
import com.fr.base.FRContext;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.gui.chart.MiddleChartDialog;
@ -32,16 +31,6 @@ import java.util.ArrayList;
public class DesignModuleFactory {
private static DesignModuleFactory instance = new DesignModuleFactory();
private static ChartCollection chartCollection;
public static ChartCollection getChartCollection() {
return chartCollection;
}
public static void setChartCollection(ChartCollection chartCollection) {
DesignModuleFactory.chartCollection = chartCollection;
}
private DesignModuleFactory() {
}

2
designer_chart/build.release.gradle

@ -48,7 +48,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar')
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'

3
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -15,6 +15,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import javax.swing.*;
import java.awt.*;
@ -36,6 +37,8 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
createNameLabel();
this.add(createNorthComponent(), BorderLayout.NORTH);
chartEditPane = StableUtils.construct(ChartEditPane.class);
chartEditPane.setSupportCellData(true);
}
public void addChartEditPane(String plotID){

18
designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java

@ -1,27 +1,39 @@
package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Charts;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import javax.swing.*;
/**
* Created by mengao on 2017/5/16.
*/
public class ChartsConfigPane extends AbstractChartAttrPane {
public abstract class ChartsConfigPane <T extends Charts> extends AbstractChartAttrPane {
public final static String CHART_STYLE_TITLE = Inter.getLocText("Chart-Style_Name");
public abstract Class<? extends Charts> accptType();
@Override
public void populate(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),accptType())) {
populate(collection, (T)collection.getSelectedChart());
}
}
protected abstract void populate(ChartCollection collection, T selectedChart);
@Override
public void update(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),accptType())) {
update(collection, (T)collection.getSelectedChart());
}
}
protected abstract void update(ChartCollection collection, T selectedChart);
@Override
protected JPanel createContentPane() {
return new JPanel();

2
designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java

@ -20,10 +20,8 @@ public class ChartsEditPane extends ChartEditPane {
dataPane4SupportCell = new ChartDataPane(listener);
dataPane4SupportCell.setSupportCellData(true);
chartsConfigPane = new ChartsConfigPane();
paneList.add(dataPane4SupportCell);
paneList.add(chartsConfigPane);
createTabsPane();
}

2
designer_form/build.release.gradle

@ -49,7 +49,7 @@ buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar')
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'

28
designer_form/src/com/fr/design/designer/creator/ErrorCreator.java

@ -0,0 +1,28 @@
package com.fr.design.designer.creator;
import com.fr.form.ui.ErrorMarker;
import com.fr.form.ui.Widget;
import com.fr.stable.StringUtils;
import java.awt.*;
/**
* Created by richie on 2017/6/28.
*/
public class ErrorCreator extends NullCreator {
public ErrorCreator(Widget widget, Dimension initSize) {
super(widget, initSize);
}
@Override
protected String showText() {
ErrorMarker marker = (ErrorMarker)toData();
String text = marker.getWidgetValue().getDisplayValue();
if (StringUtils.isEmpty(text)) {
return super.showText();
}
return text;
}
}

6
designer_form/src/com/fr/design/designer/creator/NullCreator.java

@ -23,11 +23,15 @@ public class NullCreator extends XWidgetCreator {
@Override
protected JComponent initEditor() {
UILabel l = new UILabel("UNEXPECTED WIDGET");
UILabel l = new UILabel(showText());
l.setForeground(Color.red);
l.setVerticalAlignment(SwingConstants.CENTER);
l.setHorizontalAlignment(SwingConstants.CENTER);
setBorder(DEFALUTBORDER);
return editor = l;
}
protected String showText() {
return "UNEXPECTED WIDGET";
}
}

3
designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java

@ -73,6 +73,9 @@ public class XCreatorUtils {
objectMap.put(NameWidget.class, XNameWidget.class);
objectMap.put(CardSwitchButton.class, XCardSwitchButton.class);
objectMap.put(CardAddButton.class, XCardAddButton.class);
objectMap.put(ErrorMarker.class, ErrorCreator.class);
putExtraEditor();
xLayoutMap.put(WAbsoluteLayout.class, XWAbsoluteLayout.class);

19
designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java

@ -27,7 +27,6 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
private FormDesigner designer;
private static final int LEFT_COLUMN_WIDTH = 97; // "属性名"列的宽度
private static final int RIGHT_COLUMN_WIDTH = 138; // "属性值"列的宽度
public WidgetPropertyTable(FormDesigner designer) {
super();
@ -86,16 +85,21 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
}
TableModel model = new BeanTableModel();
setModel(model);
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
TableColumn tc = this.getColumn(this.getColumnName(0));
tc.setMinWidth(LEFT_COLUMN_WIDTH);
tc.setMaxWidth(LEFT_COLUMN_WIDTH);
TableColumn tcRight = this.getColumn(this.getColumnName(1));
tcRight.setMinWidth(RIGHT_COLUMN_WIDTH);
tcRight.setMaxWidth(RIGHT_COLUMN_WIDTH);
this.repaint();
}
private void setRightColumnWidth(boolean automode) {
int rightColumnWidth = this.getWidth() - LEFT_COLUMN_WIDTH;
TableColumn tcRight = this.getColumn(this.getColumnName(1));
tcRight.setMinWidth(automode ? 0 : rightColumnWidth);
tcRight.setMaxWidth(automode ? this.getWidth() : rightColumnWidth);
}
private void setDesigner(FormDesigner designer) {
this.designer = designer;
}
@ -117,6 +121,13 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
return null;
}
@Override
public void columnMarginChanged(javax.swing.event.ChangeEvent e) {
setRightColumnWidth(false);
super.columnMarginChanged(e);
setRightColumnWidth(true);
}
/**
* 待说明
*/

Loading…
Cancel
Save