Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~kerry/design into release/9.0

master
kerry 7 years ago
parent
commit
111a688899
  1. 1
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 13
      designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  3. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java
  4. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  5. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  6. 72
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  7. 7
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  8. 7
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  9. 1
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  10. 29
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  11. 2
      designer/src/com/fr/start/Designer.java
  12. 42
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  13. 13
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  14. 5
      designer_base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java
  15. 13
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  16. 2
      designer_base/src/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java
  17. 10
      designer_base/src/com/fr/design/designer/TargetComponent.java
  18. 59
      designer_base/src/com/fr/design/gui/HyperlinkFilterHelper.java
  19. 21
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java
  20. 25
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  21. 61
      designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  22. 6
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  23. 291
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  24. 167
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  25. 12
      designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java
  26. 27
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java
  27. 10
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  28. 20
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  29. 3
      designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java
  30. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  31. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  32. 12
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  33. 22
      designer_chart/src/com/fr/plugin/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java
  34. 24
      designer_form/src/com/fr/design/mainframe/JForm.java

1
designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -19,7 +19,6 @@ import java.util.List;
* Created by XiaXiang on 2017/5/8.
*/
public class AlphaFineHelper {
public static final NoResultModel NO_RESULT_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_AlphaFine_NoResult"));
public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_ConnectionFailed"));
private static AlphaFineDialog alphaFineDialog;

13
designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java

@ -1,25 +1,24 @@
package com.fr.design.mainframe.alphafine.cell.model;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.general.FRLogger;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import javax.swing.*;
/**
* Created by XiaXiang on 2017/4/20.
*/
public class ActionModel extends AlphaCellModel {
private Action action;
private UpdateAction action;
public ActionModel(String name, String description, Action action, int searchCount) {
public ActionModel(String name, String description, UpdateAction action, int searchCount) {
this(name, description, action);
setSearchCount(searchCount);
}
public ActionModel(String name, String description, Action action) {
public ActionModel(String name, String description, UpdateAction action) {
super(name, null, CellType.ACTION);
this.action = action;
this.setDescription(description);
@ -43,11 +42,11 @@ public class ActionModel extends AlphaCellModel {
return action != null ? action.hashCode() : 0;
}
public Action getAction() {
public UpdateAction getAction() {
return action;
}
public void setAction(Action action) {
public void setAction(UpdateAction action) {
this.action = action;
}

1
designer/src/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java

@ -68,6 +68,7 @@ public abstract class AlphaCellModel implements Comparable {
public boolean isNeedToSendToServer() {
return true;
}
/**
* model转json
*

1
designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -5,7 +5,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;

1
designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.*;

72
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -367,7 +367,6 @@ public class AlphaFineDialog extends UIDialog {
* 停止加载状态
*/
private void fireStopLoading() {
searchListModel.resetState();
if (searchResultPane != null) {
removeLeftPane();
}
@ -665,25 +664,18 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
searchResultList.requestFocus();
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
}
}
@Override
public void keyReleased(KeyEvent e) {
int keyCode = e.getKeyCode();
if (keyCode == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false);
} else {
searchTextField.setText(null);
removeSearchResult();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (searchResultList.getModel().getSize() > 1) {
dealWithSearchResult(searchResultList.getSelectedValue());
}
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
if (searchResultList.getSelectedIndex() == searchResultList.getModel().getSize() - 1) {
searchResultList.setSelectedIndex(0);
}
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1);
} else escAlphaFine(e);
}
});
@ -754,8 +746,10 @@ public class AlphaFineDialog extends UIDialog {
private void doNavigate() {
AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue();
if (model != null) {
model.doAction();
}
}
/**
* 保存结果到本地本地常用
@ -888,6 +882,21 @@ public class AlphaFineDialog extends UIDialog {
this.splitLabel = splitLabel;
}
/**
* 键盘退出AlphaFine
*
* @param e
*/
private void escAlphaFine(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false);
} else {
searchTextField.setText(null);
removeSearchResult();
}
}
}
/**
* +-------------------------------------+
@ -907,7 +916,9 @@ public class AlphaFineDialog extends UIDialog {
*/
@Override
public void setSelectedIndex(int index) {
if (index > 0 && checkSelectedIndex(index)) {
if (index == 0 && getModel().getSize() > 1) {
super.setSelectedIndex(1);
} else if (index > 0 && checkSelectedIndex(index)) {
int previousIndex = getSelectedIndex();
super.setSelectedIndex(index);
AlphaCellModel cellModel = getSelectedValue();
@ -930,21 +941,6 @@ public class AlphaFineDialog extends UIDialog {
}
private void initListListener() {
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
dealWithSearchResult(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) {
searchTextField.requestFocus();
}
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
searchTextField.requestFocus();
}
}
});
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -968,6 +964,14 @@ public class AlphaFineDialog extends UIDialog {
}
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
escAlphaFine(e);
}
});
}
}

7
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.component;
import com.bulenkov.iconloader.IconLoader;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineContext;
import com.fr.design.actions.help.alphafine.AlphaFineListener;
@ -7,10 +8,8 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.utils.ThemeUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -22,12 +21,12 @@ public class AlphaFinePane extends BasicPane {
private static AlphaFinePane alphaFinePane;
public AlphaFinePane() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 14));
setLayout(new BorderLayout());
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK);
}
UIButton refreshButton = new UIButton();
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setIcon(IconLoader.getIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine"));
refreshButton.set4ToolbarButton();
refreshButton.setRolloverEnabled(false);

7
designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java

@ -19,7 +19,12 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

1
designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

@ -103,6 +103,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
if (jsonArray != null) {
SearchResult searchResult = new SearchResult();
for (int i = 0; i < jsonArray.length(); i++) {
AlphaFineHelper.checkCancel();
PluginModel cellModel = getPluginModel(jsonArray.optJSONObject(i), false);
if (!AlphaFineHelper.getFilterResult().contains(cellModel)) {
searchResult.add(cellModel);

29
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -10,6 +10,7 @@ import com.fr.design.mainframe.alphafine.cell.model.ActionModel;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.toolbar.UpdateActionManager;
import com.fr.file.XMLFileManager;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
@ -26,8 +27,17 @@ import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader;
import java.io.*;
import java.util.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* Created by XiaXiang on 2017/5/15.
@ -220,21 +230,24 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
recentModelList = recentKVModelMap.get(searchText);
SearchResult resultModelList = recentModelList;
Iterator<AlphaCellModel> modelIterator = resultModelList.iterator();
SearchResult searchResult = new SearchResult();
while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !((ActionModel) model).getAction().isEnabled()) {
modelIterator.remove();
if (model.getType() == CellType.ACTION && !UpdateActionManager.getUpdateActionManager().isEnable(((ActionModel) model).getAction())) {
continue;
} else {
searchResult.add(model);
}
}
Collections.sort(resultModelList);
int size = resultModelList.size();
Collections.sort(searchResult);
int size = searchResult.size();
if (size > MAX_SIZE) {
SearchResult result = new SearchResult();
result.addAll(resultModelList.subList(0, MAX_SIZE));
result.addAll(searchResult.subList(0, MAX_SIZE));
return result;
}
return resultModelList;
return searchResult;
}
}
return recentModelList;

2
designer/src/com/fr/start/Designer.java

@ -350,7 +350,7 @@ public class Designer extends BaseDesigner {
*
* @return 面板组件
*/
public Component createAlphafinePane() {
public Component createAlphaFinePane() {
return AlphaFinePane.getAlphaFinePane();
}

42
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.general.VT4FR;
import com.fr.stable.OperatingSystem;
@ -15,79 +16,68 @@ import javax.swing.*;
*/
public class AlphaFineConfigManager implements XMLable {
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager();
/**
* 是否开启alphafine
*/
private boolean isEnabled = true;
/**
* 是否联网搜索
*/
private boolean isSearchOnLine = true;
/**
* 快捷键设置
* 搜索范围
*/
private String shortcuts;
/**
* 搜索范围
* 快捷键设置
*/
private String shortcuts;
/**
* 猜您需要
*/
private boolean isContainRecommend = true;
/**
* 设置
*/
private boolean isContainAction = true;
/**
* 帮助文档
*/
private boolean isContainDocument = true;
/**
* 模板
*/
private boolean isContainTemplate = true;
/**
* 模板内容
*/
private boolean isContainFileContent;
/**
* 应用中心
*/
private boolean isContainPlugin = true;
/**
* 快捷键
*/
private KeyStroke shortCutKeyStore;
/**
* 是否提醒
*/
private boolean isNeedRemind = true;
/**
* 直接操作菜单次数
*/
private int operateCount;
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager();
public static AlphaFineConfigManager getInstance() {
return alphaFineConfigManager;
}
public static boolean isALPHALicAvailable() {
return FRContext.getCurrentEnv() != null && VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support();
}
@Override
public Object clone() throws CloneNotSupportedException {
AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone();
@ -130,8 +120,6 @@ public class AlphaFineConfigManager implements XMLable {
writer.end();
}
public boolean isSearchOnLine() {
return isSearchOnLine;
}
@ -147,20 +135,20 @@ public class AlphaFineConfigManager implements XMLable {
return shortcuts;
}
public void setShortcuts(String shortcuts) {
this.shortcuts = shortcuts;
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts);
}
/**
* 返回默认快捷键
*
* @return
*/
private String getDefaultShortCuts() {
return OperatingSystem.isMacOS() ? "meta + D" : "ctrl + D";
}
public void setShortcuts(String shortcuts) {
this.shortcuts = shortcuts;
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts);
}
public boolean isContainAction() {
return isContainAction;
}

13
designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.db.TableProcedure;
import com.fr.design.border.UIRoundedBorder;
@ -20,6 +22,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
/**
* 数据集编辑面板左边的部分
@ -39,6 +42,12 @@ public class ConnectionTableProcedurePane extends BasicPane {
public ConnectionTableProcedurePane() {
this.setLayout(new BorderLayout(4, 4));
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) {
@Override
protected void filterConnection(Connection connection, String conName, List<String> nameList) {
filter(connection, conName, nameList);
}
protected void refreshItems() {
super.refreshItems();
if (tableViewList != null) {
@ -83,6 +92,10 @@ public class ConnectionTableProcedurePane extends BasicPane {
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
}
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
protected JPanel createCheckBoxgroupPane() {
JPanel checkBoxgroupPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

5
designer_base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -6,6 +6,7 @@ package com.fr.design.data.datapane.preview;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.storeproc.ProcedureDataModel;
@ -13,6 +14,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.AutoProgressBar;
@ -362,7 +364,8 @@ public class PreviewTablePane extends BasicPane {
}
}
connectionBar.close();
previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(tableData, (int) maxPreviewNumberField.getValue(), true);
TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget();
previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true);
// parameterInputDialog
// update之后的parameters,转成一个parameterMap,用于预览TableData
PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue());

13
designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -5,7 +5,11 @@ import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -37,6 +41,7 @@ import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import org.sqlite.JDBC;
import javax.swing.*;
import javax.swing.text.BadLocationException;
@ -102,7 +107,12 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
sqlSplitPane.add(box, BorderLayout.CENTER);
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
connectionTableProcedurePane = new ConnectionTableProcedurePane();
connectionTableProcedurePane = new ConnectionTableProcedurePane() {
@Override
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{JDBCDatabaseConnection.class, JNDIDatabaseConnection.class});
}
};
connectionTableProcedurePane.addDoubleClickListener(new DoubleClickSelectedNodeOnTreeListener() {
@Override
@ -138,6 +148,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
this.add(mainSplitPane, BorderLayout.CENTER);
}
private boolean isPreviewOrRefreshButton (FocusEvent e) {
if (e.getOppositeComponent() != null) {
String name = e.getOppositeComponent().getName();

2
designer_base/src/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java

@ -58,7 +58,7 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
EmbeddedTableData embeddedTableData = null;
try {
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tabledata, TableData.RESULT_NOT_NEED, false);
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false);
} catch (Exception e) {
if (e.getMessage()!=null) {
DesignUtils.errorMessage(e.getMessage());

10
designer_base/src/com/fr/design/designer/TargetComponent.java

@ -1,16 +1,16 @@
package com.fr.design.designer;
import javax.swing.*;
import com.fr.design.DesignState;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.DesignState;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.stable.StringUtils;
import com.fr.design.mainframe.*;
import javax.swing.*;
/**
* 模板设计界面
@ -31,7 +31,7 @@ public abstract class TargetComponent<T> extends JComponent {
public abstract void stopEditing();
public final T getTarget() {
public T getTarget() {
return target;
}

59
designer_base/src/com/fr/design/gui/HyperlinkFilterHelper.java

@ -0,0 +1,59 @@
package com.fr.design.gui;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
/**
* Created by mengao on 2017/9/22.
* 单元格超链图表超链在不同类型模版中下拉选项不同
*/
public class HyperlinkFilterHelper {
public static boolean whetherAddHyperlink4cell(String itemName) {
JTemplate jTemplate = getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
return whetherAddFormLink(jTemplate, itemName);
}
public static boolean whetherAddHyperlink4Chart(String itemName) {
JTemplate jTemplate = getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float"), Inter.getLocText("FR-Hyperlink_Chart_Cell")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
if (jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])) {
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
return false;
} else if (jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) {
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
return false;
}
}
}
return whetherAddFormLink(jTemplate, itemName);
}
private static JTemplate getCurrentEditingTemplate() {
return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
}
private static boolean whetherAddFormLink(JTemplate jTemplate, String itemName) {
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
}

21
designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

@ -8,13 +8,12 @@ import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
@ -384,7 +383,7 @@ public abstract class JListControlPane extends JControlPane {
private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) {
if (!whetherAdd(creator.menuName())) {
if (!HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName())) {
continue;
}
boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) ||
@ -414,22 +413,6 @@ public abstract class JListControlPane extends JControlPane {
});
}
}
private boolean whetherAdd(String itemName) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
}
/*

25
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -11,7 +11,7 @@ import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.ListModelElement;
@ -19,7 +19,6 @@ import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
@ -162,11 +161,15 @@ public abstract class UIListControlPane extends UIControlPane {
if (creators.length == 1) {
addItemShortCut = new AddItemUpdateAction(creators);
} else {
addItemShortCut = new AddItemMenuDef(creators);
addItemShortCut = getAddItemMenuDef(creators);
}
return new AbsoluteEnableShortCut(addItemShortCut);
}
protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) {
return new AddItemMenuDef(creators);
}
@Override
protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction());
@ -557,20 +560,8 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
private boolean whetherAdd(String itemName) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float")};
for (String name : names) {
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) {
return false;
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
protected boolean whetherAdd(String itemName){
return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName);
}
}

61
designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -1,28 +1,14 @@
package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -30,11 +16,7 @@ import com.fr.design.gui.imenutable.UIMenuTable;
import com.fr.design.hyperlink.ReportletHyperlinkPane;
import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.javascript.EmailPane;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.js.AbstractJavaScript;
@ -43,7 +25,15 @@ import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
private static final Dimension DIALOG_SIZE = new Dimension(500, 500);
@ -98,7 +88,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
if (values.size() > 1) {
for (UIMenuNameableCreator value : values) {
final String itemName = value.getName();
if(!whetherAdd(itemName)){
if(!HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName)){
continue;
}
UIMenuItem item = new UIMenuItem(itemName);
@ -135,25 +125,6 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
initAddButtonListener();
}
private boolean whetherAdd(String itemName){
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float"), Inter.getLocText("FR-Hyperlink_Chart_Cell")};
for (String name : names){
if(!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName,name)){
if(jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])){
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
return false;
} else if(jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) {
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
return false;
}
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
private String createUnrepeatedName(String prefix) {
List<UIMenuNameableCreator> all = tablePane.updateBean();
// richer:生成的名字从1开始. kunsnat: 添加属性从0开始.

6
designer_base/src/com/fr/design/gui/style/NumberDragBar.java

@ -53,6 +53,8 @@ public class NumberDragBar extends JComponent {
@Override
protected void paintComponent(Graphics g) {
int width = this.getWidth();
//x值在这里计算,setValue时,有时会因为组件还没画,获取到的是0
x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
Graphics2D g2 = (Graphics2D)g;
RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
qualityHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
@ -118,8 +120,8 @@ public class NumberDragBar extends JComponent {
if(getWidth() <= 0) {
Thread.sleep(500);
}
int width = getWidth();
x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
// int width = getWidth();
// x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
validate();
repaint();
revalidate();

291
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -10,12 +10,17 @@ import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.*;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.TitlePlaceProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight;
@ -54,8 +59,20 @@ import javax.swing.border.MatteBorder;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.*;
import java.awt.event.*;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@ -65,15 +82,13 @@ import java.util.List;
import java.util.logging.Level;
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener {
public static final String DESIGNER_FRAME_NAME = "designer_frame";
public static final Dimension MIN_SIZE = new Dimension(100, 100);
private static final long serialVersionUID = -8732559571067484460L;
private static final int LEFT_ALIGN_GAP = -5;
private static final int MENU_HEIGHT = 26;
private static final Integer SECOND_LAYER = new Integer(100);
private static final Integer TOP_LAYER = new Integer((200));
public static final String DESIGNER_FRAME_NAME = "designer_frame";
public static final Dimension MIN_SIZE = new Dimension(100, 100);
private static java.util.List<App<?>> appList = new java.util.ArrayList<App<?>>();
private ToolBarMenuDock ad;
@ -139,82 +154,45 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
closeMode.paintIcon(this, g, 0, 0);
}
};
/**
* 注册app.
*
* @param app
* 注册app.
*/
public static void registApp(App<?> app) {
if (app != null) {
appList.add(app);
}
}
public static void removeApp(App<?> app) {
if (app != null) {
appList.remove(app);
}
}
protected DesktopCardPane getCenterTemplateCardPane() {
return centerTemplateCardPane;
private MouseListener closeMouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent e) {
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
/**
* 初始menuPane的方法 方便OEM时修改该组件
*/
protected void initMenuPane(){
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
public void mouseExited(MouseEvent e) {
closeMode = UIConstants.CLOSE_OF_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv());
public void mouseMoved(MouseEvent e) {
closeMode = UIConstants.CLOSE_OVER_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
public void mouseReleased(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();
refreshDottedLine();
fireAuthorityStateToNomal();
}
});
refreshNorthEastPane(northEastPane, ad);
return northEastPane;
}
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) {
northEastPane.removeAll();
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER);
}
public void mouseEntered(MouseEvent e) {
closeMode = UIConstants.CLOSE_OVER_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
};
public DesignerFrame(ToolBarMenuDock ad) {
@ -269,7 +247,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
modWindowBounds();
// p:检查所有按钮的可见性和是否可以编辑性.
checkToolbarMenuEnable();
@ -292,6 +269,82 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
initMenuPane();
}
/**
* 注册app.
*
* @param app 注册app.
*/
public static void registApp(App<?> app) {
if (app != null) {
appList.add(app);
}
}
public static void removeApp(App<?> app) {
if (app != null) {
appList.remove(app);
}
}
protected DesktopCardPane getCenterTemplateCardPane() {
return centerTemplateCardPane;
}
/**
* 初始menuPane的方法 方便OEM时修改该组件
*/
protected void initMenuPane() {
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
refreshNorthEastPane(northEastPane, ad);
return northEastPane;
}
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) {
northEastPane.removeAll();
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
if (AlphaFineConfigManager.isALPHALicAvailable() && DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
northEastPane.add(ad.createAlphaFinePane(), BorderLayout.CENTER);
}
}
public void initTitleIcon() {
try {
@SuppressWarnings("unchecked")
@ -316,7 +369,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
return arrayList;
}
protected void laoyoutWestPane() {
basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST);
}
@ -402,46 +454,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
addDottedLine();
}
private MouseListener closeMouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent e) {
closeMode = UIConstants.CLOSE_PRESS_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
public void mouseExited(MouseEvent e) {
closeMode = UIConstants.CLOSE_OF_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
public void mouseMoved(MouseEvent e) {
closeMode = UIConstants.CLOSE_OVER_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
public void mouseReleased(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();
refreshDottedLine();
fireAuthorityStateToNomal();
}
}
public void mouseEntered(MouseEvent e) {
closeMode = UIConstants.CLOSE_OVER_AUTHORITY;
closeButton.setBackground(UIConstants.NORMAL_BACKGROUND);
closeButton.repaint();
}
};
/**
* 刷新CloseButton
*/
@ -531,10 +543,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 检查
*
* @param flag
* 组件是否可见
* @param al
* 组件名称
* @param flag 组件是否可见
* @param al 组件名称
*/
public void checkCombineUp(boolean flag, ArrayList<String> al) {
combineUp.checkComponentsByNames(flag, al);
@ -551,8 +561,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 重置相关的工具条.
*
* @param plus
* 工具条中相关信息
* @param plus 工具条中相关信息
*/
public void resetToolkitByPlus(ToolBarMenuDockPlus plus) {
if (plus == null) {
@ -741,8 +750,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 添加 模板, 并激活.
*
* @param jt
* 添加的模板.
* @param jt 添加的模板.
*/
public void addAndActivateJTemplate(JTemplate<?, ?> jt) {
if (jt == null || jt.getEditingFILE() == null) {
@ -758,8 +766,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 激活已经存在的模板
*
* @param jt
* 模板
* @param jt 模板
*/
public void activateJTemplate(JTemplate<?, ?> jt) {
if (jt == null || jt.getEditingFILE() == null) {
@ -773,8 +780,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 对象侦听
*
* @param e
* 事件
* @param e 事件
*/
public void targetModified(TargetModifiedEvent e) {
this.checkToolbarMenuEnable();
@ -783,8 +789,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 模板关闭时 处理.
*
* @param jt
* 模板
* @param jt 模板
*/
public void templateClosed(JTemplate<?, ?> jt) {
}
@ -792,8 +797,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 模板打开时 处理.
*
* @param jt
* 模板
* @param jt 模板
*/
public void templateOpened(JTemplate<?, ?> jt) {
}
@ -801,8 +805,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 模板保存时 处理.
*
* @param jt
* 模板
* @param jt 模板
*/
public void templateSaved(JTemplate<?, ?> jt) {
this.checkToolbarMenuEnable();
@ -811,8 +814,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 打开模板文件,如果是已经打开的就激活此模板所对应的JInternalFrame
*
* @param tplFile
* 文件
* @param tplFile 文件
*/
public void openTemplate(FILE tplFile) {
// 测试连接,如果连接失败,则提示
@ -849,12 +851,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 是否不合版本的设计器
*
* @param jt
* 当前模板
*
* @param jt 当前模板
* @return 是否不合版本
*
*
* @date 2014-10-14-下午6:30:37
*/
private boolean inValidDesigner(JTemplate jt) {
@ -864,10 +862,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 打开指定的文件
*
* @param tplFile
* 指定的文件
*
*
* @param tplFile 指定的文件
* @date 2014-10-14-下午6:31:05
*/
private void openFile(FILE tplFile) {
@ -913,12 +908,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/**
* 激活指定的模板
*
* @param tplFile
* 模板文件
* @param jt
* 当前报表
*
*
* @param tplFile 模板文件
* @param jt 当前报表
* @date 2014-10-14-下午6:31:23
*/
private void activeTemplate(FILE tplFile, JTemplate jt) {

167
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -5,17 +5,33 @@ package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.*;
import com.fr.design.actions.file.*;
import com.fr.design.actions.community.BBSAction;
import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.UpAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
import com.fr.design.actions.file.OpenTemplateAction;
import com.fr.design.actions.file.PreferenceAction;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.help.alphafine.AlphaFineAction;
import com.fr.design.actions.server.*;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.actions.server.FunctionManagerAction;
import com.fr.design.actions.server.GlobalParameterAction;
import com.fr.design.actions.server.GlobalTableDataAction;
import com.fr.design.actions.server.PlatformManagerAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.TableDataPaneProcessor;
@ -35,7 +51,6 @@ import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.VT4FR;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime;
import com.fr.plugin.manage.PluginFilter;
@ -48,8 +63,11 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Set;
/**
* @author richer
@ -61,12 +79,63 @@ import java.util.List;
* 还有docking的状态的保存,下次打开设计器,也应该是这样的
*/
public abstract class ToolBarMenuDock {
public static final int PANLE_HEIGNT = 26;
public static final ToolBarMenuDockPlus NULLAVOID = new ToolBarMenuDockPlus() {
@Override
public ToolBarDef[] toolbars4Target() {
return new ToolBarDef[0];
}
@Override
public ShortCut[] shortcut4FileMenu() {
return new ShortCut[0];
}
@Override
public MenuDef[] menus4Target() {
return new MenuDef[0];
}
@Override
public JPanel[] toolbarPanes4Form() {
return new JPanel[0];
}
public JComponent[] toolBarButton4Form() {
return new JComponent[0];
}
public JComponent toolBar4Authority() {
return new JPanel();
}
@Override
public int getMenuState() {
return DesignState.WORK_SHEET;
}
public int getToolBarHeight() {
return PANLE_HEIGNT;
}
/**
* 导出菜单的子菜单 目前用于图表设计器
*
* @return 子菜单
*/
public ShortCut[] shortcut4ExportMenu() {
return new ShortCut[0];
}
};
private static final String FINEREPORT = "FineReport";
private static final int MENUBAR_HEIGHT = 22;
public static final int PANLE_HEIGNT = 26;
private MenuDef[] menus;
private ToolBarDef toolBarDef;
private List<UpdateActionModel> shortCutsList;
/**
* 更新菜单
*/
@ -118,6 +187,10 @@ public abstract class ToolBarMenuDock {
return jMenuBar;
}
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////menu below/////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
/**
* 生成报表设计和表单设计的编辑区域
*
@ -127,10 +200,6 @@ public abstract class ToolBarMenuDock {
return null;
}
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////menu below/////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
public MenuDef[] menus(final ToolBarMenuDockPlus plus) {
java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
// 添加文件菜单
@ -164,6 +233,7 @@ public abstract class ToolBarMenuDock {
/**
* 获取所有actionmodel
*
* @param menuList
*/
private void addAllUpdateActionsToList(List<MenuDef> menuList) {
@ -175,6 +245,7 @@ public abstract class ToolBarMenuDock {
/**
* 递归获取所有UpdateAction
*
* @param menuDef
*/
private void addUpdateActionToList(MenuDef menuDef, int level) {
@ -308,17 +379,15 @@ public abstract class ToolBarMenuDock {
* 创建论坛登录面板, chart那边不需要
*
* @return 面板组件
*
*/
public Component createBBSLoginPane() {
return new UILabel();
}
public Component createAlphafinePane(){
public Component createAlphaFinePane() {
return new UILabel();
}
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Server"), 'S');
@ -361,6 +430,7 @@ public abstract class ToolBarMenuDock {
/**
* 创建帮助子菜单
*
* @return 帮组菜单的子菜单
*/
public ShortCut[] createHelpShortCuts() {
@ -372,25 +442,22 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new TutorialAction());
}
shortCuts.add(SeparatorDef.DEFAULT);
//shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT);
if (ComparatorUtils.equals(ProductConstants.APP_NAME, FINEREPORT)) {
// mod by anchore 16/11/17 去掉反馈
//shortCuts.add(new FeedBackAction());
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(SeparatorDef.DEFAULT);
// shortCuts.add(new ForumAction());
}
shortCuts.add(SeparatorDef.DEFAULT);
if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}
/**
* 创建社区子菜单
*
* @return 社区菜单的子菜单
*/
public ShortCut[] createCommunityShortCuts() {
@ -405,6 +472,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new SignAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}
public MenuDef createHelpMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H');
ShortCut[] otherHelpShortCuts = createHelpShortCuts();
@ -414,6 +482,7 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.HELP);
return menuDef;
}
public MenuDef createCommunityMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_COMMUNITY"), 'C');
ShortCut[] otherCommunityShortCuts = createCommunityShortCuts();
@ -423,6 +492,7 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.BBS);
return menuDef;
}
/**
* 生成工具栏
*
@ -460,7 +530,6 @@ public abstract class ToolBarMenuDock {
}
}
protected JPanel polyToolBar(String text) {
JPanel panel = new JPanel(new BorderLayout()) {
public Dimension getPreferredSize() {
@ -477,7 +546,6 @@ public abstract class ToolBarMenuDock {
return panel;
}
/**
* 重置上面的工具栏
*
@ -488,7 +556,6 @@ public abstract class ToolBarMenuDock {
return plus.toolBarButton4Form();
}
/**
* 创建大的工具按钮
*
@ -507,61 +574,10 @@ public abstract class ToolBarMenuDock {
return new UIButton[0];
}
protected void refreshLargeToolbarState() {
}
public static final ToolBarMenuDockPlus NULLAVOID = new ToolBarMenuDockPlus() {
@Override
public ToolBarDef[] toolbars4Target() {
return new ToolBarDef[0];
}
@Override
public ShortCut[] shortcut4FileMenu() {
return new ShortCut[0];
}
@Override
public MenuDef[] menus4Target() {
return new MenuDef[0];
}
@Override
public JPanel[] toolbarPanes4Form() {
return new JPanel[0];
}
public JComponent[] toolBarButton4Form() {
return new JComponent[0];
}
public JComponent toolBar4Authority() {
return new JPanel();
}
@Override
public int getMenuState() {
return DesignState.WORK_SHEET;
}
public int getToolBarHeight(){
return PANLE_HEIGNT;
}
/**
* 导出菜单的子菜单 目前用于图表设计器
*
* @return 子菜单
*/
public ShortCut[] shortcut4ExportMenu(){
return new ShortCut[0];
}
};
public NewTemplatePane getNewTemplatePane() {
return new NewTemplatePane() {
@Override
@ -688,7 +704,6 @@ public abstract class ToolBarMenuDock {
/**
* 设计器退出时, 做的一些操作.
*
*/
public void shutDown() {

12
designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java

@ -1,5 +1,8 @@
package com.fr.design.mainframe.toolbar;
import com.fr.design.actions.UpdateAction;
import com.fr.general.ComparatorUtils;
import java.util.List;
/**
@ -23,4 +26,13 @@ public class UpdateActionManager {
public void setUpdateActions(List<UpdateActionModel> updateActions) {
this.updateActions = updateActions;
}
public boolean isEnable(UpdateAction updateAction) {
for (UpdateActionModel action : updateActions) {
if (ComparatorUtils.equals(updateAction.getName(), action.getActionName()) && action.getAction().isEnabled()) {
return true;
}
}
return false;
}
}

27
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java

@ -4,20 +4,26 @@ import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.style.AlphaPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* @author richie
* @date 2015-03-26
* @since 8.0
*/
public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesCondition> {
private static final int ALPHASIZE = 100;
private static final double ALPHASIZE = 100.0;
private static final int PANEL_WIDTH = 200;
private static final int PANEL_HIGHT = 20;
private UILabel nameLabel;
private AlphaPane alphaPane;
private UINumberDragPane alphaPane;
private AttrAlpha attrAlpha = new AttrAlpha();
@ -25,10 +31,17 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesC
super(conditionAttributesPane, true);
nameLabel = new UILabel(Inter.getLocText("ChartF-Alpha"));
alphaPane = new AlphaPane();
UILabel label = new UILabel(Inter.getLocText("ChartF-Alpha") + ":");
alphaPane = new UINumberDragPane(0, ALPHASIZE);
JPanel panel = new JPanel(new BorderLayout());
panel.add(label, BorderLayout.WEST);
panel.add(alphaPane, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HIGHT));
this.add(nameLabel);
this.add(alphaPane);
this.add(panel);
}
@Override
@ -44,12 +57,12 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesC
public void populate(DataSeriesCondition condition) {
if (condition instanceof AttrAlpha) {
attrAlpha = (AttrAlpha) condition;
alphaPane.populate((int) (attrAlpha.getAlpha() * ALPHASIZE));
alphaPane.populateBean(attrAlpha.getAlpha() * ALPHASIZE);
}
}
public DataSeriesCondition update() {
attrAlpha.setAlpha(this.alphaPane.update());
attrAlpha.setAlpha((float) (this.alphaPane.updateBean() / ALPHASIZE));
return attrAlpha;
}

10
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -23,7 +23,13 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
@ -150,7 +156,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
UIMenuNameableCreator ui = configCreator.clone();
final BasicBeanPane pane = ui.getPane();
pane.populateBean(editingCollection);
UIDialog dialog = pane.showUnsizedWindow(SwingUtilities.getWindowAncestor(new JPanel()), new DialogActionListener() {
UIDialog dialog = pane.showUnsizedWindow(SwingUtilities.getWindowAncestor(parent), new DialogActionListener() {
@Override
public void doOk() {
pane.updateBean(editingCollection);

20
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -8,6 +8,7 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -75,6 +76,11 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
return Inter.getLocText("FR-Designer_Add_Hyperlink");
}
@Override
protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) {
return new AddVanChartItemMenuDef(creators);
}
public void populate(NameJavaScriptGroup nameHyperlink_array) {
java.util.List<NameObject> list = new ArrayList<NameObject>();
if (nameHyperlink_array != null) {
@ -218,4 +224,18 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
}
return null;
}
protected class AddVanChartItemMenuDef extends AddItemMenuDef {
public AddVanChartItemMenuDef(NameableCreator[] creators) {
super(creators);
}
@Override
protected boolean whetherAdd(String itemName) {
return HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName);
}
}
}

3
designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java

@ -126,7 +126,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
final VanChartPlotTooltipPane pane = PlotFactory.createPlotRefreshTooltipPane(chart.getPlot());
pane.populate(chart.getRefreshMoreLabel().getAttrTooltip());
UIDialog dialog = pane.showUnsizedWindow(SwingUtilities.getWindowAncestor(new JPanel()), new DialogActionListener() {
UIDialog dialog = pane.showUnsizedWindow(SwingUtilities.getWindowAncestor(contentPane), new DialogActionListener() {
@Override
public void doOk() {
@ -138,6 +138,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
}
});
dialog.setModal(true);
dialog.setVisible(true);
}
});

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -1,6 +1,7 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.general.ComparatorUtils;
@ -52,7 +53,7 @@ public class AlertLineListControlPane extends VanChartUIListControlPane {
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(getAlertAxisName(axisNames), Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, getAlertPaneClass())};
refreshNameableCreator(creators);
@ -111,4 +112,12 @@ public class AlertLineListControlPane extends VanChartUIListControlPane {
axis.setAlertValues(axisAlerts);
}
}
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartAlertValuePane.class;
}
protected String[] getAlertAxisName(String[] axisNames) {
return axisNames;
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -1,6 +1,7 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.general.ComparatorUtils;
@ -54,7 +55,7 @@ public class BackgroundListControlPane extends VanChartUIListControlPane {
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)};
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(getCustomIntervalBackgroundAxisName(axisNames), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, getIntervalPaneClass())};
refreshNameableCreator(creators);
@ -123,4 +124,12 @@ public class BackgroundListControlPane extends VanChartUIListControlPane {
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartCustomIntervalBackgroundPane.class;
}
protected String[] getCustomIntervalBackgroundAxisName(String[] axisNames) {
return axisNames;
}
}

12
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -75,12 +75,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
protected JPanel createAlertLinePane() {
alertLine = new AlertLineListControlPane();
alertLine = getAlertLinePane();
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel;
}
protected AlertLineListControlPane getAlertLinePane () {
return new AlertLineListControlPane();
}
protected JPanel createIntervalPane(double[] row, double[] col) {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Default_Interval"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100);
@ -88,7 +92,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
defaultPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
customIntervalBackground = new BackgroundListControlPane();
customIntervalBackground = getBackgroundListControlPane();
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
@ -109,6 +113,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
return panel;
}
protected BackgroundListControlPane getBackgroundListControlPane() {
return new BackgroundListControlPane();
}
protected Component[][] getIntervalPaneComponents() {
return new Component[][]{
new Component[]{null, null},

22
designer_chart/src/com/fr/plugin/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java

@ -3,8 +3,8 @@ package com.fr.plugin.chart.designer.style.background.radar;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.Inter;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.style.background.AlertLineListControlPane;
import com.fr.plugin.chart.designer.style.background.BackgroundListControlPane;
import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane;
import java.awt.*;
@ -30,19 +30,29 @@ public class VanChartRadarAxisAreaPane extends VanChartAxisAreaPane {
};
}
@Override
protected AlertLineListControlPane getAlertLinePane() {
return new AlertLineListControlPane(){
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartRadarAlertValuePane.class;
}
protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) {
demo.setAxisName(axisNames[axisNames.length - 1]);//默认y轴,居左居右
protected String[] getAlertAxisName(String[] axisNames) {
return new String[]{axisNames[axisNames.length - 1]};//默认y轴,居左居右
}
};
}
@Override
protected BackgroundListControlPane getBackgroundListControlPane() {
return new BackgroundListControlPane(){
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartRadarCustomIntervalBackgroundPane.class;
}
protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) {
demo.setAxisName(axisNames[axisNames.length - 1]);
protected String[] getCustomIntervalBackgroundAxisName(String[] axisNames) {
return new String[]{axisNames[axisNames.length - 1]};
}
};
}
}

24
designer_form/src/com/fr/design/mainframe/JForm.java

@ -13,7 +13,11 @@ import com.fr.design.designer.beans.actions.FormDeleteAction;
import com.fr.design.designer.beans.actions.PasteAction;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.XComponent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
@ -552,6 +556,24 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
}
@Override
public void setTarget(Form form) {
if (this.formDesign == null) {
super.setTarget(form);
return;
}
this.formDesign.setTarget(form);
}
@Override
public Form getTarget() {
if (this.formDesign == null) {
return super.getTarget();
}
return this.formDesign.getTarget();
}
@Override
protected FormModelAdapter createDesignModel() {
return new FormModelAdapter(this);

Loading…
Cancel
Save