Browse Source

Merge pull request #2052 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '5983883ee134e6180b86aee920eb13f03e4dd6f5':
  REPORT-37097 远程设计-设计器打开的两个模板数据集显示混乱
  CHART-15034 && CHART-14688 && CHART-15019	bugfix
  REPORT-36612 && REPORT-37010 && REPORT-37062 缩放验收bug修复
  REPORT-36778 【配合平台】版本号规范FR适配任务
  REPORT-36778 【配合平台】版本号规范FR适配任务
  REPORT-36778 【配合平台】版本号规范FR适配任务
  REPORT-36778 【配合平台】版本号规范FR适配任务
  REPORT-36778 【配合平台】版本号规范FR适配任务
  CHART-15003 交互界面增加收缩于抽屉内
  CHART-14960 结果数据的系列和中位数增加无
  CHART-14925 分类默认选中无
  REPORT-32317 cpt滚动条缩放问题 在更改了界面的比例方法中,增加更新滚动条的宽度的逻辑
  update
  REPORT-37014 插件卸载后数据集面板图标还在的问题
  REPORT-36200 【name63/user63】在控件右下方多次复制,并不会不断向右下复制
research/11.0
superman 4 years ago
parent
commit
33fb1dd8e1
  1. 5
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  2. 9
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  3. 8
      designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java
  5. 27
      designer-base/src/main/java/com/fr/design/update/push/DesignerUpdateInfo.java
  6. 6
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  7. 8
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  8. 11
      designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java
  9. 14
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java
  10. 1
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java
  11. 4
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/UIComboBoxWithEditLabel.java
  12. 159
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java
  13. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  14. 19
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  15. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  16. 16
      designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java
  17. 17
      designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java
  18. 9
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  19. 2
      designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java
  20. 2
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

5
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -55,8 +55,9 @@ public class AboutPane extends JPanel {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
centerPane.add(contentPane, BorderLayout.NORTH);
contentPane.add(new BoxCenterAligmentPane(getBuildTitle()));
BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane(
getBuildTitle(),
StringUtils.EMPTY,
getVersionBuildNO(),
new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO"),
@ -204,7 +205,7 @@ public class AboutPane extends JPanel {
private String getBuildTitle() {
return append(ProductConstants.APP_NAME, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About_Version"),
StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX);
StringUtils.BLANK, ProductConstants.VERSION, BUILD_PREFIX);
}
private JPanel getEmailActionPane(final String desc, final String mailTo) {

9
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -370,6 +370,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/
public void load() {
FineLoggerFactory.getLogger().info("Env Change Template Loading...");
JTemplate currentTemplate = null;
if (stashFILEMap != null && stashFILEMap.size() != 0) {
int size = historyList.size();
for (int i = 0; i < size; i++) {
@ -385,20 +386,24 @@ public class HistoryTemplateListCache implements CallbackEvent {
historyList.set(i, template);
// 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件
if (isCurrentEditingFile(template.getPath())) {
loadCurrentTemplate(template);
currentTemplate = template;
}
} else {
// 当模板为空时 说明是一个新建的未保存模板 但是内存中保存了该模板 可以从中获取
JTemplate jt = historyList.get(i);
// 另外如果该模板是正在编辑的模板,需要要激活
if (jt != null && isCurrentEditingFile(jt.getPath())) {
loadCurrentTemplate(jt);
currentTemplate = jt;
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
// 最后加载当前正在编辑的模板 以保证数据集刷新正常
if (currentTemplate != null) {
loadCurrentTemplate(currentTemplate);
}
stashFILEMap.clear();
MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList);
MutilTempalteTabPane.getInstance().repaint();

8
designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java

@ -39,8 +39,12 @@ public class WestRegionContainerPane extends UIResizableContainer {
@Override
public void on(PluginEvent event) {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
if (getDownPane() != null) {
replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
} else {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
}
}
}, new PluginFilter() {

2
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java

@ -79,7 +79,7 @@ class DesignerPushUpdateDialog extends UIDialog {
private Model createModel(DesignerUpdateInfo updateInfo) {
Model model = new Model();
model.setVersion(updateInfo.getLatestVersion());
model.setVersion(updateInfo.getLatestFullVersion());
model.setContent(updateInfo.getPushContent());
model.setMoreInfoUrl(updateInfo.getMoreInfoUrl());
model.setBackgroundUrl(updateInfo.getBackgroundUrl());

27
designer-base/src/main/java/com/fr/design/update/push/DesignerUpdateInfo.java

@ -1,7 +1,12 @@
package com.fr.design.update.push;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSON;
import com.fr.json.JSONFactory;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.security.InvalidParameterException;
@ -14,6 +19,8 @@ class DesignerUpdateInfo {
private static final String KEY_CONTENT = "content";
private static final String KEY_BACKGROUND_URL = "background";
private static final String KEY_MORE_INFO_URL = "more";
private static final String SPLIT_CHAR = "-";
private final String currentVersion; // 当前版本
private final String latestVersion; // 最新版本
@ -58,6 +65,26 @@ class DesignerUpdateInfo {
return latestVersion;
}
String getLatestFullVersion() {
try {
String url = CloudCenter.getInstance().acquireUrlByKind("jar10.new.update");
if (StringUtils.isBlank(url)) {
return StringUtils.EMPTY;
}
String res = HttpToolbox.get(url);
if (StringUtils.isBlank(res)) {
return StringUtils.EMPTY;
}
JSONObject jsonObject = JSONFactory.createJSON(JSON.OBJECT, res);
String version = jsonObject.getString("version");
String build = jsonObject.getString("build");
return version + SPLIT_CHAR + build;
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return StringUtils.EMPTY;
}
String getLastIgnoredVersion() {
return lastIgnoredVersion;
}

6
designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java

@ -3,8 +3,8 @@ package com.fr.design.chart;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.script.Calculator;
@ -57,8 +57,8 @@ public class ChartIcon implements Icon, XMLable {
}
private void initChartName() {
Chart chart = chartCollection.getSelectedChart(Chart.class);
String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(chart.getPlot().getPlotID());
ChartProvider chart = chartCollection.getSelectedChartProvider(ChartProvider.class);
String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(chart.getID());
chartName = subName[0];
}

8
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -7,9 +7,9 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
@ -21,12 +21,12 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.util.ArrayList;
import java.util.List;
/**
* 图表数据 分类 系列 过滤界面.
@ -37,7 +37,7 @@ import java.util.List;
public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
private static final long serialVersionUID = 3650522989381790194L;
private static final int PAN_WIDTH = 246;
private static final int FIL_HEIGHT = 150;
private static final int FIL_HEIGHT = 200;
private CategoryFilterPane categoryPane;
private SeriesFilterPane seriesPane;

11
designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java

@ -6,7 +6,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -76,10 +75,7 @@ public class BoxIndependentVanChartInterface extends AbstractIndependentVanChart
return new VanChartInteractivePane() {
protected Component[][] createToolBarComponents() {
return new Component[][]{
new Component[]{null, exportImages},
new Component[]{null, fullScreenDisplay}
};
return createToolBarComponentsWithOutSort();
}
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
@ -87,11 +83,6 @@ public class BoxIndependentVanChartInterface extends AbstractIndependentVanChart
return new AutoRefreshPaneWithoutTooltip(chart, isLargeModel);
}
protected double[] getToolBarRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p, p};
}
protected ZoomPane createZoomPane() {
return new ZoomPane();
}

14
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java

@ -56,6 +56,11 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
median = createUIComboBoxWithEditLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Median"));
q1 = createUIComboBoxWithEditLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Q1"));
min = createUIComboBoxWithEditLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Min"));
addNoneItem();
seriesName.setSelectedItem(null);
median.populateComboBox(null);
}
private JPanel createUIComboBoxPane(UIComboBox comboBox, String title) {
@ -134,6 +139,8 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
refreshBoxItems(median.getComboBox(), list);
refreshBoxItems(q1.getComboBox(), list);
refreshBoxItems(min.getComboBox(), list);
addNoneItem();
}
public void clearAllBoxList() {
@ -145,6 +152,13 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
clearBoxItems(median.getComboBox());
clearBoxItems(q1.getComboBox());
clearBoxItems(min.getComboBox());
addNoneItem();
}
private void addNoneItem() {
seriesName.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
median.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
public void populateBean(ChartCollection collection) {

1
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java

@ -71,6 +71,7 @@ public class BoxPlotTableSeriesTypeUsePane extends UIComboBoxPane<ChartCollectio
categoryCombox = new UIComboBox();
categoryCombox.setPreferredSize(new Dimension(100, 20));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryCombox.setSelectedItem(null);
north.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, null, null, label, null}));
north.setPreferredSize(new Dimension(246, 30));

4
designer-chart/src/main/java/com/fr/van/chart/box/data/table/UIComboBoxWithEditLabel.java

@ -45,6 +45,10 @@ public abstract class UIComboBoxWithEditLabel extends JPanel implements UIObserv
this.comboBox = comboBox;
}
public void addItem(String value) {
comboBox.addItem(value);
}
protected void addItemListener(ItemListener aListener) {
comboBox.addItemListener(aListener);
}

159
designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java

@ -7,7 +7,6 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.background.gradient.SelectColorPointBtn;
import com.fr.design.style.color.ColorCell;
import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.style.color.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable;
@ -18,6 +17,9 @@ import com.fr.stable.AssistUtils;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
@ -27,9 +29,6 @@ import java.awt.LinearGradientPaint;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class LegendGradientBar extends JComponent implements ColorSelectable, UIObserver {
@ -75,11 +74,11 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private List<ChangeListener> changeListenerList = new ArrayList<ChangeListener>();
public LegendGradientBar(){
public LegendGradientBar() {
startPos = 4;
endPos = max;
setSubColor(new Color(36,167,255));
setSubColor(new Color(36, 167, 255));
setColorSelectionBtnNum(2 + 1);
@ -117,10 +116,10 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private float[] initDist(int colorSelectionBtnNum) {
float[] dist = new float[colorSelectionBtnNum];
dist[0] = 0f;
for (int i = 0; i < colorSelectionBtnNum-2; i++) {
dist[i+1] = (float) ((selectColorPointBtnList.get(i).getX() - 4) / (max - 4));
for (int i = 0; i < colorSelectionBtnNum - 2; i++) {
dist[i + 1] = (float) ((selectColorPointBtnList.get(i).getX() - 4) / (max - 4));
}
dist[colorSelectionBtnNum-1] = 1f;
dist[colorSelectionBtnNum - 1] = 1f;
return dist;
}
@ -141,8 +140,8 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private Color[] initColors(Color subColor, int colorSelectionBtnNum) {
Color[] converseColors = getColorArray(subColor, colorSelectionBtnNum);
Color[] colors = new Color[colorSelectionBtnNum];
for (int i = 0; i < colorSelectionBtnNum; i++){
colors[i] = converseColors[colorSelectionBtnNum-1 - i];
for (int i = 0; i < colorSelectionBtnNum; i++) {
colors[i] = converseColors[colorSelectionBtnNum - 1 - i];
}
return colors;
}
@ -150,30 +149,32 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private void initColorSelectBtn(Color[] colors, int colorSelectionBtnNum) {
//获取按钮颜色数组
Color startSlotColor = colors[0];
Color endSlotColor = colors[colorSelectionBtnNum-1];
Color endSlotColor = colors[colorSelectionBtnNum - 1];
Color[] pColors = new Color[colorSelectionBtnNum - 2];
for (int i = 0; i < pColors.length; i++){
for (int i = 0; i < pColors.length; i++) {
pColors[i] = colors[i + 1];
}
selectColorSlotBtnStart = new SelectColorPointBtn(startPos, REC_HEIGHT, startSlotColor, new Color(138,138,138));
selectColorSlotBtnEnd = new SelectColorPointBtn(endPos, REC_HEIGHT, endSlotColor, new Color(138,138,138));
selectColorSlotBtnStart = new SelectColorPointBtn(startPos, REC_HEIGHT, startSlotColor, new Color(138, 138, 138));
selectColorSlotBtnEnd = new SelectColorPointBtn(endPos, REC_HEIGHT, endSlotColor, new Color(138, 138, 138));
//初始化list
selectColorPointBtnList = new ArrayList<SelectColorPointBtn>();
//加入可滑动颜色选择器
for (int i = 0; i < pColors.length; i++){
SelectColorPointBtn pi = new SelectColorPointBtn(((startPos+endPos)/(pColors.length+1))*(i+1), REC_HEIGHT, pColors[i]);
for (int i = 0; i < pColors.length; i++) {
SelectColorPointBtn pi = new SelectColorPointBtn(((startPos + endPos) / (pColors.length + 1)) * (i + 1), REC_HEIGHT, pColors[i]);
selectColorPointBtnList.add(pi);
}
refreshColorsAndDist(selectColorPointBtnList);
this.repaint();
}
/**
* 添加事件
*
* @param changeListener 事件
*/
public void addChangeListener(ChangeListener changeListener) {
@ -216,7 +217,7 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
//如果该位置已经有滑块占领,则做跨越偏移
selectColorPointBtnList.get(index).setX(LegendGradientBar.this.setOffset(e.getX(), index, OFFSETSTEP));
}
refreshColorsAndDist(selectColorPointBtnList);
LegendGradientBar.this.repaint();
}
});
@ -224,25 +225,23 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
//防止位置重复,设置偏移
private int setOffset(int x, int index, int offset) {
for (int i = 0; i < selectColorPointBtnList.size(); i++){
for (int i = 0; i < selectColorPointBtnList.size(); i++) {
if (i != index && AssistUtils.equals(x, selectColorPointBtnList.get(i).getX())) {
if (x >= (min+max)/2) {
if (x >= (min + max) / 2) {
x -= offset;
x = setOffset(x, index, offset+OFFSETSTEP);
}
else{
x = setOffset(x, index, offset + OFFSETSTEP);
} else {
x += offset;
x = setOffset(x, index, offset+OFFSETSTEP);
x = setOffset(x, index, offset + OFFSETSTEP);
}
}
}
//边界情况
if (x <= min){
x = min + (index+1)*OFFSETSTEP;
}
else if (x >= max){
x = max - (index+1)*OFFSETSTEP;
if (x <= min) {
x = min + (index + 1) * OFFSETSTEP;
} else if (x >= max) {
x = max - (index + 1) * OFFSETSTEP;
}
return x;
}
@ -259,50 +258,33 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
break;
}
}
if (select >= 0) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, LegendGradientBar.this);
Color color = LegendGradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
selectColorPointBtnList.get(select).setColorInner(color);
LegendGradientBar.this.repaint();
}
}
//是否选中颜色编辑槽
else if (selectColorSlotBtnStart.contains(e.getX(), e.getY())) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, LegendGradientBar.this);
Color color = LegendGradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
selectColorSlotBtnStart.setColorInner(color);
//stateChanged();
LegendGradientBar.this.repaint();
}
dealClick(selectColorPointBtnList.get(select));
} else if (selectColorSlotBtnStart.contains(e.getX(), e.getY())) {
dealClick(selectColorSlotBtnStart);
} else if (selectColorSlotBtnEnd.contains(e.getX(), e.getY())) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, LegendGradientBar.this);
Color color = LegendGradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
selectColorSlotBtnEnd.setColorInner(color);
//stateChanged();
LegendGradientBar.this.repaint();
}
dealClick(selectColorSlotBtnEnd);
}
LegendGradientBar.this.repaint();
}
}
});
}
private void addMouseReleasedListener(){
private void dealClick(SelectColorPointBtn selectColorPointBtn) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
this.setColor(selectColorPointBtn.getColorInner());
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, LegendGradientBar.this);
Color color = this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
selectColorPointBtn.setColorInner(color);
refreshColorsAndDist(selectColorPointBtnList);
LegendGradientBar.this.repaint();
}
}
private void addMouseReleasedListener() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
@ -318,14 +300,11 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
Point2D start = new Point2D.Float(4, 0);
Point2D end = new Point2D.Float(max, 0);
//获取排序后的颜色数组和位置数组
refreshColorsAndDist(selectColorPointBtnList);
LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, colors);
g2.setPaint(paint);
g2.fillRect(4, 0, max - 4, 30);
g2.setColor(new Color(138,138,138));
g2.setColor(new Color(138, 138, 138));
g2.drawRect(4, 0, max - 4, 30);
//开始和结束位置颜色选择槽位
@ -343,22 +322,22 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
Collections.sort(select);
colors[0] = selectColorSlotBtnStart.getColorInner();
for (int i = 0; i < colorSelectionBtnNum-2; i++) {
colors[i+1] = select.get(i).getColorInner();
for (int i = 0; i < colorSelectionBtnNum - 2; i++) {
colors[i + 1] = select.get(i).getColorInner();
}
colors[colorSelectionBtnNum-1] = selectColorSlotBtnEnd.getColorInner();
colors[colorSelectionBtnNum - 1] = selectColorSlotBtnEnd.getColorInner();
dist = new float[colorSelectionBtnNum];
dist[0] = 0f;
for (int i = 0; i < colorSelectionBtnNum-2; i++) {
dist[i+1] = (float) ((select.get(i).getX() - 4) / (max - 4));
for (int i = 0; i < colorSelectionBtnNum - 2; i++) {
dist[i + 1] = (float) ((select.get(i).getX() - 4) / (max - 4));
}
dist[colorSelectionBtnNum-1] = 1f;
dist[colorSelectionBtnNum - 1] = 1f;
fireColorAndDistChangeListener();
}
public void refreshSubColor(Color subColor){
public void refreshSubColor(Color subColor) {
//设置主题色
setSubColor(subColor);
@ -370,9 +349,9 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
}
public void refreshColorSelectionBtnNum(int num){
public void refreshColorSelectionBtnNum(int num) {
//设置主题色
colorSelectionBtnNum = num+1;
colorSelectionBtnNum = num + 1;
//计算colors数组
colors = initColors(subColor, colorSelectionBtnNum);
@ -418,14 +397,14 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
}
public void populate(GradualIntervalConfig intervalConfig){
if(intervalConfig == null) {
public void populate(GradualIntervalConfig intervalConfig) {
if (intervalConfig == null) {
return;
}
setSubColor(intervalConfig.getSubColor());
setColorSelectionBtnNum((int)(intervalConfig.getDivStage() + 1));
setColorSelectionBtnNum((int) (intervalConfig.getDivStage() + 1));
populateColorAndDist(intervalConfig.getGradualColorDistList());
@ -436,15 +415,15 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
int num = gradualColorDistList.size();
this.colors = new Color[num];
this.dist = new float[num];
for (int i = 0; i < num; i++){
for (int i = 0; i < num; i++) {
this.colors[i] = gradualColorDistList.get(i).getColor();
this.dist[i] = gradualColorDistList.get(i).getPosition();
}
}
public void update(GradualIntervalConfig intervalConfig){
public void update(GradualIntervalConfig intervalConfig) {
ArrayList<GradualColorDist> colorDistList = new ArrayList<GradualColorDist>();
for (int i = 0; i < getColorSelectionBtnNum(); i++){
for (int i = 0; i < getColorSelectionBtnNum(); i++) {
colorDistList.add(new GradualColorDist(this.dist[i], this.colors[i]));
}
intervalConfig.setGradualColorDistList(colorDistList);
@ -453,26 +432,26 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private void refreshColorSelectBtn(Color[] colors, float[] dist) {
//获取按钮颜色数组
Color startSlotColor = colors[0];
Color endSlotColor = colors[colors.length-1];
Color endSlotColor = colors[colors.length - 1];
Color[] pColors = new Color[colors.length - 2];
for (int i = 0; i < pColors.length; i++){
for (int i = 0; i < pColors.length; i++) {
pColors[i] = colors[i + 1];
}
float[] position = new float[dist.length - 2];
for (int i = 0; i < position.length; i++){
position[i] = dist[i+1]*(max-4) + 4;
for (int i = 0; i < position.length; i++) {
position[i] = dist[i + 1] * (max - 4) + 4;
}
selectColorSlotBtnStart = new SelectColorPointBtn(startPos, REC_HEIGHT, startSlotColor, new Color(138,138,138));
selectColorSlotBtnEnd = new SelectColorPointBtn(endPos, REC_HEIGHT, endSlotColor, new Color(138,138,138));
selectColorSlotBtnStart = new SelectColorPointBtn(startPos, REC_HEIGHT, startSlotColor, new Color(138, 138, 138));
selectColorSlotBtnEnd = new SelectColorPointBtn(endPos, REC_HEIGHT, endSlotColor, new Color(138, 138, 138));
//刷新可移动按钮的位置
selectColorPointBtnList = new ArrayList<SelectColorPointBtn>();
//加入可滑动颜色选择器
for (int i = 0; i < pColors.length; i++){
for (int i = 0; i < pColors.length; i++) {
SelectColorPointBtn pi = new SelectColorPointBtn(position[i], REC_HEIGHT, pColors[i]);
selectColorPointBtnList.add(pi);
}

2
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -117,7 +117,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
addFormRuler();
}
this.setFocusTraversalKeysEnabled(false);
this.addMouseWheelListener(showValSpinnerMouseWheelListener);
this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener);
registerShortCutKey();
}

19
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -83,10 +83,12 @@ import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
@ -993,7 +995,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
@Nullable
public XCreator getComponentAt(int x, int y, XCreator[] except) {
XLayoutContainer container = y + this.getPaintY() < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent;
XLayoutContainer container = y < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent;
if (container == null) {
container = rootComponent;
}
@ -1281,6 +1283,21 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
this.formArea = formArea;
}
public void paint(Graphics g){
//重新设置下绘制的起点和缩放幅度
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
super.paint(g);
}
/**
* 绘制组件根节点
*

7
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -68,13 +68,6 @@ public class FormDesignerUI extends ComponentUI {
public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution();
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(designer.getPaintX(), designer.getPaintY());
at.scale(designer.getScale(), designer.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
if (rootComponent != null) {
// 设计自适应界面
repaintFit(g, rootComponent, c);

16
designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java

@ -10,7 +10,6 @@ import com.fr.grid.Grid;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.SwingUtilities;
import java.awt.Component;
@ -52,20 +51,7 @@ public class ChartCellEditor extends AbstractCellEditor implements DialogActionL
public Component getCellEditorComponent(final Grid grid, TemplateCellElement cellElement, int resolution) {
Object valueCell = cellElement.getValue();
if (valueCell instanceof BaseChartCollection) {
if (glyphComponent == null) {
glyphComponent = DesignModuleFactory.getChartComponent((BaseChartCollection)valueCell);
glyphComponent.addStopEditingListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
stopCellEditing();
grid.requestFocus();// kunsnat: 补充, 编辑图表reset之后, Grid也算停止编辑 重获焦点 bug20443SS
}
});
} else {
glyphComponent.populate((BaseChartCollection) valueCell);
}
this.chartCellEditorDialog = null;
return glyphComponent;
return null;
}
this.chartCellEditorDialog = getMiddleChartDialog(SwingUtilities.getWindowAncestor(grid));
this.chartCellEditorDialog.addDialogActionListener(this);

17
designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java

@ -9,7 +9,6 @@ import com.fr.grid.Grid;
import com.fr.report.cell.FloatElement;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.SwingUtilities;
import java.awt.Component;
@ -49,21 +48,7 @@ public class ChartFloatEditor extends AbstractFloatEditor implements DialogActio
public Component getFloatEditorComponent(final Grid grid, FloatElement floatElement, int resolution) {
Object valueCell = floatElement.getValue();
if (valueCell instanceof BaseChartCollection) {
this.chartFloatEditorDialog = null;
if (glyphComponent == null) {
glyphComponent = DesignModuleFactory.getChartComponent((BaseChartCollection)valueCell);
glyphComponent.addStopEditingListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
stopFloatEditing();
grid.requestFocus();// kunsnat: 补充, 编辑图表reset之后, Grid也算停止编辑 重获焦点 bug20443
}
});
} else {
glyphComponent.populate((BaseChartCollection) valueCell);
}
return glyphComponent;
return null;
}
this.chartFloatEditorDialog = getMiddleChartDialog(SwingUtilities.getWindowAncestor(grid));
this.chartFloatEditorDialog.addDialogActionListener(this);

9
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -456,12 +456,17 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution));
elementCasePane.getGrid().updateUI();
//更新Column和Row
((DynamicScrollBar) elementCasePane.getVerticalScrollBar()).setDpi(resolution);
((DynamicScrollBar) elementCasePane.getHorizontalScrollBar()).setDpi(resolution);
DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar();
DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar();
verticalScrollBar.setDpi(resolution);
horizontalScrollBar.setDpi(resolution);
elementCasePane.getGridColumn().setResolution(resolution);
elementCasePane.getGridColumn().updateUI();
elementCasePane.getGridRow().setResolution(resolution);
elementCasePane.getGridRow().updateUI();
//Yvan:更新滚动条值(主要是为了重置滚动条里的BoundedRangeModel的extent值),使之随着界面缩放
verticalScrollBar.setValue(verticalScrollBar.getValue());
horizontalScrollBar.setValue(horizontalScrollBar.getValue());
}
if (polyDezi != null) {
polyDezi.setResolution(resolution);

2
designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java

@ -35,7 +35,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen
private static final int MAX = 400;
private static final int HUND = 100;
private static final int MIN = 10;
private static final int DIR = 15;
private static final int DIR = 10;
private JWorkBook parent;
private UIModeControlContainer parentContainer = null;

2
designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -35,7 +35,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
private static final int MAX = 400;
private static final int HUND = 100;
private static final int MIN = 10;
private static final int DIR = 15;
private static final int DIR = 10;
private static final double MIN_TIME = 0.4;
public FormElementCaseDesigner elementCaseDesigner;
private BaseJForm jForm;

Loading…
Cancel
Save