Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Yvan 4 years ago
parent
commit
4ef03597a5
  1. 94
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 10
      designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java
  4. 15
      designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java
  5. 9
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java
  6. 38
      designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java
  7. 38
      designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java
  8. 39
      designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java
  9. 15
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java
  10. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java
  11. 2
      designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java
  12. 1
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java
  13. 23
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  14. 35
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  15. 12
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  16. 7
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

94
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -1,8 +1,11 @@
package com.fr.design;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.base.TableData;
import com.fr.base.io.BaseBook;
import com.fr.data.TableDataSource;
import com.fr.data.operator.DataOperator;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate;
@ -11,9 +14,14 @@ import com.fr.form.ui.DataControl;
import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Filter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -40,7 +48,7 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
/**
* 全部的参数包括全局参数模板参数和数据集参数
*/
private Parameter[] parameters;
protected Parameter[] parameters;
/**
* 数据集参数
@ -52,6 +60,12 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
*/
private Parameter[] templateParameters;
/**
* 数据集参数缓存 更新时刷新
*/
protected Map<String, ParameterProvider[]> tableDataParametersMap = new HashMap<>();
public DesignModelAdapter(S jTemplate) {
this.jTemplate = jTemplate;
@ -241,6 +255,79 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
}
protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) {
Iterator<String> it = this.getBook().getTableDataNameIterator();
try {
// 清空下缓存
tableDataParametersMap.clear();
while (it.hasNext()) {
String name = it.next();
TableData tableData = this.getBook().getTableData(name);
ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData);
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
tableDataParametersMap.put(name, parameterProviders);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
protected void updateTableDataParameters(String oldName,
String tdName,
TableData tableData,
Map<String, ParameterProvider> map,
Filter<ParameterProvider> filter) {
ParameterProvider[] providers = null;
if (!ComparatorUtils.equals(oldName, tdName)) {
// 更新下缓存名称 替换下数据集名称
providers = tableDataParametersMap.remove(oldName);
if (providers != null) {
tableDataParametersMap.put(tdName, providers);
}
}
try {
for (Map.Entry<String, ParameterProvider[]> entry : tableDataParametersMap.entrySet()) {
ParameterProvider[] parameterProviders;
if (ComparatorUtils.equals(entry.getKey(), tdName)) {
parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData);
// 用来更新缓存
providers = parameterProviders;
} else {
parameterProviders = entry.getValue();
}
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (providers != null) {
// 更新缓存
tableDataParametersMap.put(tdName, providers);
}
}
protected void addGlobalParameters(Map<String, ParameterProvider> map) {
// 添加全局参数
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters();
ParameterApplyHelper.addPara2Map(map, glbParas);
}
/**
* 环境改变.
*/
@ -251,6 +338,11 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
*/
public abstract void parameterChanged();
/**
* 数据集参数改变
*/
public abstract void tableDataParametersChanged(String oldName, String tdName, TableData tableData);
/**
* 控件配置改变.
*/

4
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -228,7 +228,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
}
fireDSChanged(map);
tc.fireTargetModified();
tc.parameterChanged();
tc.tableDataParametersChanged(oldName, tdName, td);
int[] rows = dataTree.getSelectionRows();
dataTree.refreshChildByName(tdName);
dataTree.setSelectionRows(rows);
@ -366,7 +366,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
}
fireDSChanged(map);
tc.fireTargetModified();
tc.parameterChanged();
tc.tableDataParametersChanged(oldName, tdName, td);
int[] rows = dataTree.getSelectionRows();
dataTree.refreshChildByName(tdName);
dataTree.setSelectionRows(rows);

10
designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java

@ -6,8 +6,12 @@ import com.fr.config.MarketConfig;
import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.exe.PluginLoginExecutor;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javafx.concurrent.Task;
@ -118,7 +122,8 @@ public class LoginWebBridge {
*/
public void registerHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register")));
LocaleMark<String> registerMark = LocaleCenter.getMark(BbsRegisterMark.class);
Desktop.getDesktop().browse(new URI(registerMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -129,7 +134,8 @@ public class LoginWebBridge {
*/
public void forgetHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")));
LocaleMark<String> resetMark = LocaleCenter.getMark(BbsResetMark.class);
Desktop.getDesktop().browse(new URI(resetMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

15
designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java

@ -13,8 +13,13 @@ import com.fr.design.extra.exe.PluginLoginExecutor;
import com.fr.design.extra.exe.ReadUpdateOnlineExecutor;
import com.fr.design.extra.exe.SearchOnlineExecutor;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark;
import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.general.CloudCenter;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -434,8 +439,8 @@ public class PluginWebBridge {
*/
public void getPriviteMessage() {
try {
String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl));
LocaleMark<String> spaceMark = LocaleCenter.getMark(BbsSpaceMark.class);
Desktop.getDesktop().browse(new URI(spaceMark.getValue()));
} catch (Exception exp) {
FineLoggerFactory.getLogger().info(exp.getMessage());
}
@ -497,7 +502,8 @@ public class PluginWebBridge {
*/
public void registerHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register")));
LocaleMark<String> registerMark = LocaleCenter.getMark(BbsRegisterMark.class);
Desktop.getDesktop().browse(new URI(registerMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}
@ -511,7 +517,8 @@ public class PluginWebBridge {
*/
public void forgetHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")));
LocaleMark<String> resetMark = LocaleCenter.getMark(BbsResetMark.class);
Desktop.getDesktop().browse(new URI(resetMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}

9
designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java

@ -167,6 +167,9 @@ public class UIModeControlContainer extends JLayeredPane {
// 拖动的距离,为正值表示往下拖动,为负值表示往上拖动
int deltaY = e.getY();
toolPaneY += deltaY;
if (toolPaneY < 0) {
toolPaneY = 0;
}
onResize(toolPaneY);
refreshContainer();
}
@ -241,7 +244,7 @@ public class UIModeControlContainer extends JLayeredPane {
};
protected void onModeChanged() {
//do nothing here
//do nothing here
}
/**
@ -312,7 +315,7 @@ public class UIModeControlContainer extends JLayeredPane {
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// do nothing
// do nothing
}
});
}
@ -337,7 +340,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void layoutContainer(Container parent) {
// do nothing
// do nothing
}
@Override

38
designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java

@ -0,0 +1,38 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/1/29
*/
public class BbsRegisterMark implements LocaleMark<String> {
private final Map<Locale, String> map = new HashMap<>();
private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register");
private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register");
private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US");
private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US");
private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US");
public BbsRegisterMark() {
map.put(Locale.CHINA, BBS_REGISTER_CN);
map.put(Locale.KOREA, BBS_REGISTER_KR);
map.put(Locale.JAPAN, BBS_REGISTER_JP);
map.put(Locale.US, BBS_REGISTER_EN);
map.put(Locale.TAIWAN, BBS_REGISTER_TW);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? BBS_REGISTER_EN : result;
}
}

38
designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java

@ -0,0 +1,38 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/1/29
*/
public class BbsResetMark implements LocaleMark<String> {
private final Map<Locale, String> map = new HashMap<>();
private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset");
private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset");
private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US");
private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US");
private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US");
public BbsResetMark() {
map.put(Locale.CHINA, BBS_RESET_CN);
map.put(Locale.KOREA, BBS_RESET_KR);
map.put(Locale.JAPAN, BBS_RESET_JP);
map.put(Locale.US, BBS_RESET_EN);
map.put(Locale.TAIWAN, BBS_RESET_TW);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? BBS_RESET_EN : result;
}
}

39
designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java

@ -0,0 +1,39 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/1/29
*/
public class BbsSpaceMark implements LocaleMark<String> {
private final Map<Locale, String> map = new HashMap<>();
private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default");
private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default");
private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US");
private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US");
private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US");
public BbsSpaceMark() {
map.put(Locale.CHINA, BBS_SPACE_CN);
map.put(Locale.KOREA, BBS_SPACE_KR);
map.put(Locale.JAPAN, BBS_SPACE_JP);
map.put(Locale.US, BBS_SPACE_EN);
map.put(Locale.TAIWAN, BBS_SPACE_TW);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? BBS_SPACE_EN : result;
}
}

15
designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

@ -16,6 +16,9 @@ import com.fr.design.extra.exe.PluginLoginExecutor;
import com.fr.design.extra.exe.ReadUpdateOnlineExecutor;
import com.fr.design.extra.exe.SearchOnlineExecutor;
import com.fr.design.i18n.Toolkit;
import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark;
import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.upm.event.CertificateEvent;
import com.fr.design.upm.event.DownloadEvent;
import com.fr.design.upm.exec.UpmBrowserExecutor;
@ -23,6 +26,8 @@ import com.fr.design.upm.task.UpmTaskWorker;
import com.fr.event.EventDispatcher;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -424,8 +429,8 @@ public class UpmBridge {
@JSBridge
public void getPriviteMessage() {
try {
String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl));
LocaleMark<String> spaceMark = LocaleCenter.getMark(BbsSpaceMark.class);
Desktop.getDesktop().browse(new URI(spaceMark.getValue()));
} catch (Exception exp) {
FineLoggerFactory.getLogger().info(exp.getMessage());
}
@ -437,7 +442,8 @@ public class UpmBridge {
@JSBridge
public void forgetHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")));
LocaleMark<String> resetMark = LocaleCenter.getMark(BbsResetMark.class);
Desktop.getDesktop().browse(new URI(resetMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}
@ -449,7 +455,8 @@ public class UpmBridge {
@JSBridge
public void registerHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register")));
LocaleMark<String> registerMark = LocaleCenter.getMark(BbsRegisterMark.class);
Desktop.getDesktop().browse(new URI(registerMark.getValue()));
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java

@ -21,7 +21,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane<VanChartAttrMarke
private UISpinner anchorSize;
public VanChartMapAnchorMarkerPane() {
anchorSize = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 28);
anchorSize = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 22);
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Height")), anchorSize}

2
designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java

@ -54,7 +54,7 @@ public interface LayoutAdapter {
* @return 是否添加成功成功返回true否则false
*/
boolean addBean(XCreator creator, int x, int y, boolean accept);
/**
* 返回该布局管理适配器的Painter为容器提供放置位置的标识
*/

1
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java

@ -102,6 +102,7 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter {
return true;
}
/**
* 删除组件
*

23
designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java

@ -11,11 +11,15 @@ import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.script.Calculator;
import com.fr.stable.EmbParaFilter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>> {
@ -42,6 +46,16 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
jTemplate.populateParameter();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
parameters = map.values().toArray(new Parameter[0]);
jTemplate.populateParameter();
}
/**
* 控件配置改变.
*/
@ -135,6 +149,13 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
return map.values().toArray(new Parameter[0]);
}
}

35
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -18,9 +18,12 @@ import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author zhou
@ -72,6 +75,18 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
jTemplate.populateReportParameterAttr();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, null);
addReportParameters(map);
parameters = map.values().toArray(new Parameter[0]);
jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr();
}
/**
* 控件改变.
*/
@ -107,9 +122,27 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, null);
addReportParameters(map);
return map.values().toArray(new Parameter[0]);
}
private void addReportParameters(Map<String, ParameterProvider> map) {
// 添加模板参数
ReportParameterAttr parameterAttr = this.getBook().getReportParameterAttr();
if (parameterAttr != null) {
ParameterApplyHelper.addPara2Map(map, parameterAttr.getParameters());
}
}
/**
* 返回控件的名字
*

12
designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -8,11 +8,15 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
@ -65,6 +69,8 @@ public class BBSLoginDialog extends UIDialog {
private UILabel tipLabel;
private BoxCenterAligmentPane passwordReset;
private BoxCenterAligmentPane registerLabel;
private LocaleMark<String> resetMark = LocaleCenter.getMark(BbsResetMark.class);
private LocaleMark<String> registerMark = LocaleCenter.getMark(BbsRegisterMark.class);
private KeyListener keyListener = new KeyAdapter() {
public void keyPressed(KeyEvent e) {
@ -113,8 +119,8 @@ public class BBSLoginDialog extends UIDialog {
nameField = new UITextField();
passField = new UIPassWordField();
loginButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Login"));
passwordReset = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"));
registerLabel = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.register"));
passwordReset = getURLActionLabel(resetMark.getValue());
registerLabel = getURLActionLabel(registerMark.getValue());
loginButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
@ -311,7 +317,7 @@ public class BBSLoginDialog extends UIDialog {
private BoxCenterAligmentPane getURLActionLabel(final String url) {
ActionLabel actionLabel = new ActionLabel(url);
if (ComparatorUtils.equals(url, CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))) {
if (ComparatorUtils.equals(url, resetMark.getValue())) {
actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Forgot-Password"));
} else {
actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Register_Account"));

7
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -15,6 +15,7 @@ import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.upm.event.CertificateEvent;
@ -27,6 +28,8 @@ import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils;
import com.fr.general.http.HttpClient;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
@ -96,8 +99,8 @@ public class UserInfoLabel extends UILabel {
public void mousePressed(MouseEvent e) {
if (StringUtils.isNotEmpty(userName)) {
try {
String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl));
LocaleMark<String> spaceMark = LocaleCenter.getMark(BbsSpaceMark.class);
Desktop.getDesktop().browse(new URI(spaceMark.getValue()));
} catch (Exception exp) {
FineLoggerFactory.getLogger().info(exp.getMessage());
}

Loading…
Cancel
Save