Browse Source

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

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
f86669c5a3
  1. 9
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  2. 21
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  3. 11
      designer-base/src/main/java/com/fr/design/mainframe/App.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  5. 10
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  6. 10
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  7. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  8. 24
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  9. 8
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

9
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -14,10 +14,10 @@ import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.Map;
import java.awt.Dimension;
@Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
dealScrollPane(selectedItemScrollPane);
propertyChangePane.add(selectedItemScrollPane);
}
protected void dealScrollPane(JScrollPane scrollPane){
}
public void updateBean(T ob) {

21
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private static final String HOST_NAME = "127.0.0.1";
private static final String LOCAL_HOTS_NAME = "localhost";
private static final String QUOTATION = ":";
private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
static {
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH);
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH);
initFilerSet(port);
}
private static void initFilerSet(String newPort) {
FILTER_SET.clear();
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
port = newPort;
}
private String name;
@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
@Override
public boolean checkValid() {
boolean result = false;
String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
if (!ComparatorUtils.equals(port, newPort)) {
// 使用过程中 更改了内置服务器端口 重新初始化下
initFilerSet(newPort);
}
if (FILTER_SET.contains(connection.getUrl())) {
FineLoggerFactory.getLogger().error("url is same with local designer");
return result;

11
designer-base/src/main/java/com/fr/design/mainframe/App.java

@ -41,4 +41,15 @@ public interface App<T extends BaseBook> extends Mutable, Aftermath {
* @return 报表
*/
T asIOFile(FILE tplFile);
/**
* 输出workbook等对象
* @param tplFile 文件
* @param needCheck 是否需要check
* @return
*/
default T asIOFile(FILE tplFile, boolean needCheck) {
return asIOFile(tplFile);
}
}

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -56,7 +56,7 @@ public final class JTemplateFactory {
String[] defaultAppExtensions = app.defaultExtensions();
for (String defaultAppExtension : defaultAppExtensions) {
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) {
BaseBook bb = app.asIOFile(file);
BaseBook bb = app.asIOFile(file, false);
if (bb != null) {
return (T) bb;
}

10
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -15,9 +15,10 @@ import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.util.Iterator;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Iterator;
/**
* Created by IntelliJ IDEA.
@ -27,6 +28,9 @@ import java.util.Iterator;
* Time : 上午9:16
*/
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
private static final int SCROLL_BAR_UNIT_INCREMENT = 16;
protected Plot plot;
public DataSeriesConditionPane(Plot plot) {
@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAt
this(null);
}
protected void dealScrollPane(JScrollPane scrollPane){
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_UNIT_INCREMENT);
}
private void initAvailableActionList() {
addBasicAction();
addAxisPositionAction();

10
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -2,6 +2,8 @@ package com.fr.extended.chart;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
import java.util.List;
@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox {
public UIComboBoxWithNone() {
super();
addDefaultItem();
setDefaultSelectedItem();
}
protected void setDefaultSelectedItem() {
setSelectedItem(StringUtils.EMPTY);
}
@Override
@ -43,7 +50,8 @@ public class UIComboBoxWithNone extends UIComboBox {
//找不到的都选中无。中文的无 英文下是none。
//改正:找不到的且anObject不是null的 全部选中无。
if (getSelectedIndex() == -1 && anObject != null) {
//改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。
if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) {
super.setSelectedItem(getDefaultLocaleString());
}
}

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -176,8 +176,10 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated);
this.bindListeners2Widgets();
this.addAttributeChangeListener(changeListener);
// 直接return时 也要处理下相应数据
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) {
fix(style);
return;
}
@ -199,8 +201,6 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
}
}
});
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
this.mobileCollapsedStyleEditor.setStyle(style);
fix(style);
this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork());

24
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -45,9 +45,9 @@ import java.util.List;
*/
public class RecentSearchManager implements AlphaFineSearchProvider {
private static final int MAX_SIZE = 100;
private static final RecentSearchManager INSTANCE = new RecentSearchManager();
private IndexReader indexReader = null;
//索引存储路径
private String path = ProductConstants.getEnvHome() + File.separator + "searchIndex";
@ -58,18 +58,18 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer);
private IndexWriter indexWriter = null;
private SearchResult recentModelList = new SearchResult();
public static RecentSearchManager getInstance() {
return INSTANCE;
}
@Override
public SearchResult getLessSearchResult(String[] searchText) {
this.recentModelList = new SearchResult();
SearchResult modelList = new SearchResult();
for (String aSearchText : searchText) {
recentModelList = getRecentModelList(aSearchText);
addToRecentModelList(aSearchText);
}
if (recentModelList != null && recentModelList.size() > 0) {
modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest")));
@ -86,9 +86,13 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
public SearchResult getMoreSearchResult(String searchText) {
return new SearchResult();
}
private synchronized SearchResult getRecentModelList(String searchText) {
return searchBySort(searchText);
/**
* 将单次遍历的关键词的搜索结果添加到结果集中
* @param searchText
*/
private synchronized void addToRecentModelList(String searchText) {
searchBySort(searchText);
}
public List<AlphaCellModel> getRecentModelList() {
@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
* 按序搜索
*/
private synchronized SearchResult searchBySort(String key) {
recentModelList = new SearchResult();
try {
initReader();
@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
Query query = new TermQuery(term);
TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey);
ScoreDoc[] scores = docs.scoreDocs;
this.recentModelList = new SearchResult();
//遍历结果
for (ScoreDoc scoreDoc : scores) {
Document document = searcher.doc(scoreDoc.doc);

8
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp {
@Override
public WorkBook asIOFile(FILE file) {
return asIOFile(file, true);
}
@Override
public WorkBook asIOFile(FILE file, boolean needCheck) {
if (XMLEncryptUtils.isCptEncoded() &&
!XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) {
if (!new DecodeDialog(file).isPwdRight()) {
@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp {
} catch (Exception exp) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp);
}
checkNameStyle(namestyle);
if (needCheck) {
checkNameStyle(namestyle);
}
return tpl;
}

Loading…
Cancel
Save