From 6ac2d498d2bc4cbc8c4a4793c655b80977a963bf Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 26 Aug 2019 15:54:17 +0800 Subject: [PATCH 1/9] =?UTF-8?q?ChartComponent=E7=94=A8ChartProvider.toIamg?= =?UTF-8?q?e=E6=8E=A5=E5=8F=A3=E6=B8=B2=E6=9F=93=E5=9B=BE=E8=A1=A8=20&&=20?= =?UTF-8?q?CHART-9062=20=E5=88=A0=E9=99=A4activeGlyph=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/gui/ActiveGlyphFactory.java | 97 ----------- .../fr/design/chart/gui/ChartComponent.java | 100 ++--------- .../design/chart/gui/active/ActiveGlyph.java | 161 ------------------ .../gui/active/AlertValueActiveGlyph.java | 38 ----- .../chart/gui/active/AxisActiveGlyph.java | 43 ----- .../gui/active/CategoryAxisActiveGlyph.java | 19 --- .../chart/gui/active/ChartActiveGlyph.java | 39 ----- .../gui/active/DataLabelActiveGlyph.java | 44 ----- .../gui/active/DataSeriesActiveGlyph.java | 53 ------ .../gui/active/DataSheetActiveGlyph.java | 30 ---- .../chart/gui/active/DateAxisActiveGlyph.java | 18 -- .../chart/gui/active/LegendActiveGlyph.java | 30 ---- .../chart/gui/active/PlotActiveGlyph.java | 34 ---- .../gui/active/RadarAxisActiveGlyph.java | 18 -- .../gui/active/RangeAxisActiveGlyph.java | 18 -- .../chart/gui/active/TextActiveGlyph.java | 35 ---- .../gui/active/TrendLineActiveGlyph.java | 43 ----- .../gui/active/ValueAxisActiveGlyph.java | 19 --- .../active/action/ChartComponentAction.java | 37 ---- .../action/SetAnalysisLineStyleAction.java | 27 --- .../gui/active/action/SetAxisStyleAction.java | 33 ---- .../active/action/SetChartStyleAciton.java | 31 ---- .../action/SetDataLabelStyleAction.java | 26 --- .../gui/active/action/SetDataSheetAction.java | 33 ---- .../active/action/SetLegendStyleAction.java | 32 ---- .../gui/active/action/SetPlotStyleAction.java | 32 ---- .../active/action/SetTitleStyleAction.java | 32 ---- 27 files changed, 11 insertions(+), 1111 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java deleted file mode 100644 index 3a2ec0fd33..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ActiveGlyphFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.fr.design.chart.gui; - -import java.util.HashMap; -import java.util.Map; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.CategoryAxisGlyph; -import com.fr.chart.chartglyph.ChartAlertValueGlyph; -import com.fr.chart.chartglyph.ChartGlyph; -import com.fr.chart.chartglyph.DataSeries; -import com.fr.chart.chartglyph.DataSheetGlyph; -import com.fr.chart.chartglyph.DateAxisGlyph; -import com.fr.chart.chartglyph.LegendGlyph; -import com.fr.chart.chartglyph.PlotGlyph; -import com.fr.chart.chartglyph.RadarAxisGlyph; -import com.fr.chart.chartglyph.RangeAxisGlyph; -import com.fr.chart.chartglyph.TextGlyph; -import com.fr.chart.chartglyph.TitleGlyph; -import com.fr.chart.chartglyph.TrendLineGlyph; -import com.fr.chart.chartglyph.ValueAxisGlyph; -import com.fr.design.chart.gui.active.ActiveGlyph; -import com.fr.design.chart.gui.active.AlertValueActiveGlyph; -import com.fr.design.chart.gui.active.CategoryAxisActiveGlyph; -import com.fr.design.chart.gui.active.ChartActiveGlyph; -import com.fr.design.chart.gui.active.DataLabelActiveGlyph; -import com.fr.design.chart.gui.active.DataSeriesActiveGlyph; -import com.fr.design.chart.gui.active.DataSheetActiveGlyph; -import com.fr.design.chart.gui.active.DateAxisActiveGlyph; -import com.fr.design.chart.gui.active.LegendActiveGlyph; -import com.fr.design.chart.gui.active.PlotActiveGlyph; -import com.fr.design.chart.gui.active.RadarAxisActiveGlyph; -import com.fr.design.chart.gui.active.RangeAxisActiveGlyph; -import com.fr.design.chart.gui.active.TextActiveGlyph; -import com.fr.design.chart.gui.active.TrendLineActiveGlyph; -import com.fr.design.chart.gui.active.ValueAxisActiveGlyph; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-23 - * Time : 上午9:08 - */ -public class ActiveGlyphFactory { - private static Map glyphMap = new HashMap(); - - static { - glyphMap.put(DataSeries.class.getName(), DataSeriesActiveGlyph.class); - glyphMap.put(RadarAxisGlyph.class.getName(), RadarAxisActiveGlyph.class); - glyphMap.put(RangeAxisGlyph.class.getName(), RangeAxisActiveGlyph.class); - glyphMap.put(TitleGlyph.class.getName(), TextActiveGlyph.class); - glyphMap.put(DateAxisGlyph.class.getName(), DateAxisActiveGlyph.class); - glyphMap.put(ValueAxisGlyph.class.getName(), ValueAxisActiveGlyph.class); - glyphMap.put(CategoryAxisGlyph.class.getName(), CategoryAxisActiveGlyph.class); - glyphMap.put(ChartGlyph.class.getName(), ChartActiveGlyph.class); - glyphMap.put(DataSheetGlyph.class.getName(), DataSheetActiveGlyph.class); - glyphMap.put(LegendGlyph.class.getName(), LegendActiveGlyph.class); - glyphMap.put(TextGlyph.class.getName(), DataLabelActiveGlyph.class); - glyphMap.put(TrendLineGlyph.class.getName(), TrendLineActiveGlyph.class); - glyphMap.put(ChartAlertValueGlyph.class.getName(), AlertValueActiveGlyph.class); - } - - private ActiveGlyphFactory() { - - } - - public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph) { - return createActiveGlyph(chartComponent, glyph, null); - } - - public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph, Glyph parentGlyph) { - if (glyph == null) { - return null; - } - String clsName = glyph.getClass().getName(); - Class cls = glyphMap.get(clsName); - Class parameterCls = glyph.getClass(); - if (cls == null) { - if (clsName.endsWith("PlotGlyph")) { - cls = PlotActiveGlyph.class; - parameterCls = PlotGlyph.class; - } else if (clsName.endsWith("DataSeries4Area")) { - cls = DataSeriesActiveGlyph.class; - parameterCls = DataSeries.class; - } else { - cls = ChartActiveGlyph.class; - parameterCls = ChartGlyph.class; - } - } - try { - Class[] argsClass = new Class[]{ChartComponent.class, parameterCls, Glyph.class}; - return (ActiveGlyph) cls.getConstructor(argsClass).newInstance(new Object[]{chartComponent, glyph, parentGlyph}); - } catch (Exception e) { - return null; - } - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index 31baca0715..d5d15af7c8 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -2,36 +2,26 @@ package com.fr.design.chart.gui; import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChartCollection; -import com.fr.base.chart.BaseChartGlyph; import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.chart.ChartWebPara; import com.fr.chart.base.ChartConstants; -import com.fr.chart.chartattr.Axis; -import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartglyph.AxisGlyph; import com.fr.chartx.attr.ChartProvider; -import com.fr.design.chart.gui.active.ActiveGlyph; -import com.fr.design.chart.gui.active.ChartActiveGlyph; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.log.FineLoggerFactory; -import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeListener; import java.awt.Color; -import java.awt.Cursor; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; -import java.awt.Point; import java.awt.RenderingHints; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.awt.geom.Rectangle2D; -import java.awt.geom.RoundRectangle2D; import java.util.ArrayList; import java.util.List; @@ -45,21 +35,11 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene private static final long serialVersionUID = 744164838619052097L; private final List listeners = new ArrayList(); private ChartCollection chartCollection4Design; - private Chart editingChart; - private BaseChartGlyph chartGlyph; + private ChartProvider editingChart; private int chartWidth = -1; private int chartHeight = -1; - private Point point; - private int resolution = ScreenResolution.getScreenResolution(); - private ActiveGlyph activeGlyph; - - private boolean supportEdit = true; - private final int[] resizeCursors = new int[]{ - Cursor.NW_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR, Cursor.NE_RESIZE_CURSOR, - Cursor.E_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR, - Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.SW_RESIZE_CURSOR - }; + private boolean supportEdit = true; public ChartComponent() { super(); @@ -112,15 +92,11 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene fireStopEditing(); this.editingChart = null; - this.chartGlyph = null; - this.activeGlyph = null; - this.point = null; this.chartHeight = this.chartWidth = -1; - this.editingChart = this.chartCollection4Design.getSelectedChart(); + this.editingChart = this.chartCollection4Design.getSelectedChartProvider(); refreshChartGlyph(); - this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph); repaint(); } @@ -166,9 +142,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene return editingChart; } - public BaseChartGlyph getChartGlyph() { - return chartGlyph; - } public void paintComponent(Graphics g) { // super.paintComponent(g); @@ -192,12 +165,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); //画图 - drawChartGlyph(g2d); - - ActiveGlyph ag = this.getActiveGlyph(); - if (ag != null) { - ag.paint4ActiveGlyph(g2d, chartGlyph); - } + drawChart(g2d); g2d.translate(-ChartConstants.PREGAP4BOUNDS/2, -ChartConstants.PREGAP4BOUNDS/2); if (lastHint == null) { @@ -212,24 +180,11 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene */ private void refreshChartGlyph() { Dimension d = getBounds().getSize(); - this.editingChart = this.chartCollection4Design.getSelectedChart();// kunsnat: 切换选中时 同步切换Plot - if (editingChart != null) { - this.chartGlyph = editingChart.createGlyph(editingChart.defaultChartData()); - this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph); - } + this.editingChart = this.chartCollection4Design.getSelectedChartProvider();// kunsnat: 切换选中时 同步切换Plot this.chartWidth = d.width - ChartConstants.PREGAP4BOUNDS; this.chartHeight = d.height - ChartConstants.PREGAP4BOUNDS; } - private ActiveGlyph getActiveGlyph() { - if (point == null) { - this.activeGlyph = new ChartActiveGlyph(this, chartGlyph); - } else { - this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y); - } - return this.activeGlyph; - } - /** * 鼠标点击 * @param event 鼠标事件 @@ -243,16 +198,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene * @param e 鼠标事件 */ public void mousePressed(MouseEvent e) { - point = new Point(e.getX(),e.getY()); - if (!ArrayUtils.contains(resizeCursors, this.getCursor().getType())) { - this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y); - } - if (this.activeGlyph == null) { - return; - } - - repaint(); } @@ -291,45 +237,21 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene * @param e 鼠标事件 */ public void mouseMoved(MouseEvent e) { - ActiveGlyph ag = this.getActiveGlyph(); - if (ag != null) { - ag.onMouseMove(e); - } - } - - public AxisGlyph getActiveAxisGlyph() { - return (AxisGlyph) activeGlyph.getGlyph(); - } - - public Axis getActiveAxis() { - AxisGlyph axisGlyph = getActiveAxisGlyph(); - if (editingChart.getPlot() != null) { - return editingChart.getPlot().getAxis(axisGlyph.getAxisType()); - } - return null; } private boolean needRefreshChartGlyph() { - return chartGlyph == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height; + return editingChart == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height; } - public void drawChartGlyph(Graphics2D g2d) { - if (chartGlyph != null) { - if (chartGlyph.isRoundBorder()) { - chartGlyph.setBounds(new RoundRectangle2D.Double(0, 0, chartWidth, chartHeight, 10, 10)); - } else { - chartGlyph.setBounds(new Rectangle2D.Double(0, 0, chartWidth, chartHeight)); - } + private void drawChart(Graphics2D g2d) { + if (editingChart != null) { - //不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单 - //其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边 - //处理画图事件 - resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); + int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); if (resolution == 0){ resolution = ScreenResolution.getScreenResolution(); } - Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,resolution, this, null); + Image chartImage = editingChart.toImage(chartWidth, chartHeight, resolution, new ChartWebPara()); g2d.drawImage(chartImage, 0, 0, null); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java deleted file mode 100644 index 7f1c637c6d..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ActiveGlyph.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.AlphaComposite; -import java.awt.Color; -import java.awt.Composite; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Shape; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; - -import com.fr.base.ScreenResolution; -import com.fr.base.chart.BaseChartGlyph; -import com.fr.base.chart.Glyph; -import com.fr.design.chart.gui.ActiveGlyphFactory; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:51 - * 选中的Glyph - */ -public abstract class ActiveGlyph { - protected Glyph parentGlyph; - protected ChartComponent chartComponent; - - public ActiveGlyph(ChartComponent chartComponent, Glyph parentGlyph) { - this.chartComponent = chartComponent; - this.parentGlyph = parentGlyph; - } - - public abstract Glyph getGlyph(); - - public void drawAllGlyph(Graphics2D g2d, int resolution){ - Point2D offset4Paint = offset4Paint(); - g2d.translate(offset4Paint.getX(), offset4Paint.getY()); - this.getGlyph().draw(g2d, resolution); - g2d.translate(-offset4Paint.getX(), -offset4Paint.getY()); - }; - - /** - * 属性表中, 通过点击 展开到对应的界面. - */ - public abstract void goRightPane(); - - /** - * 画的偏移的 - * @return 偏移的 - */ - public Point2D offset4Paint() { - return new Point2D.Double( - this.parentGlyph.getShape().getBounds().getX(), - this.parentGlyph.getShape().getBounds().getY() - ); - } - - public void paint4ActiveGlyph(Graphics2D g2d, BaseChartGlyph chartGlyph) { - if(this.parentGlyph == null) { - return; - } - - Paint oldPaint = g2d.getPaint(); - Composite oldComposite = g2d.getComposite(); - g2d.setPaint(Color.WHITE); - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); - - g2d.fill(chartGlyph.getShape()); - drawAllGlyph(g2d, ScreenResolution.getScreenResolution()); - - g2d.setPaint(oldPaint); - g2d.setComposite(oldComposite); - } - - protected void drawSelectedBounds4Active(Graphics2D g2d) { - if (this.getGlyph() != null) { - Shape shape = this.getGlyph().getShape(); - if (shape != null) { - g2d.draw(shape); - } - } - } - - - /** - *当前的ActiveGlyph是否包含坐标mouseX, mouseY - * @param mouseX 坐标X - * @param mouseY 坐标Y - * @return 包含则返回true - */ - public boolean contains(int mouseX, int mouseY) { - if (getGlyph() == null || getGlyph().getShape() == null){ - return false; - } - - Point2D offset = this.offset4Paint(); - - /* - * alex:因为Line2D.contains(x, y)必然返回false - * 所以用intersect一个区域,这个区域大小用4 * 4的,区域大一些,就灵敏一些 - */ - return getGlyph().getShape().intersects(mouseX - offset.getX() - 2, mouseY - offset.getY() - 2, 4, 4); - } - - /** - * 在当前选中的ActiveGlyph中,仅仅在其Children中找与mouseX, mouseY匹配的ActiveGlyph - * @param mouseX 坐标X - * @param mouseY 坐标Y - * @return 当前ativeGlyph - */ - public ActiveGlyph findActionGlyphFromChildren(int mouseX, int mouseY) { - Glyph currentGlyph = getGlyph(); - // 报错应对. - if (currentGlyph == null) { - return null; - } - java.util.Iterator selectableChildren = currentGlyph.selectableChildren(); - - ActiveGlyph resAG = null; - while (selectableChildren.hasNext() && resAG == null) { - ActiveGlyph childActiveGlyph = ActiveGlyphFactory.createActiveGlyph(chartComponent, selectableChildren.next(), currentGlyph); - - // 如果childActiveGlyph不为null,找一下其子辈有没有符合条件 - if (childActiveGlyph != null) { - resAG = childActiveGlyph.findActionGlyphFromChildren(mouseX, mouseY); - } - - // 如果childActiveGlyph的子辈没有符合条件的,就看一下这个childGlyph是否符合条件 - if (resAG == null && childActiveGlyph != null && childActiveGlyph.contains(mouseX, mouseY)) { - resAG = childActiveGlyph; - } - } - - // 如果当前ActiveGlyph的所有子辈都没有与mouseX, mouseY相匹配的,看一下它自己是否匹配 - if (resAG == null) { - if (this.contains(mouseX, mouseY)) { - resAG = this; - } - } - - return resAG; - } - - /** - * 拖拽 - * @param e 事件 - */ - public void onMouseDragged(MouseEvent e) { - - } - - /** - * 移动事件 - * @param e 事件 - */ - public void onMouseMove(MouseEvent e) { - - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java deleted file mode 100644 index c43eee17ff..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.ChartAlertValueGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction; - -public class AlertValueActiveGlyph extends ActiveGlyph{ - ChartAlertValueGlyph alertValueGlyph; - - public AlertValueActiveGlyph(ChartComponent chartComponent,ChartAlertValueGlyph alertLine, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.alertValueGlyph = alertLine; - } - - public Point2D offset4Paint() { - Rectangle2D valueAxisBoudns = this.alertValueGlyph.getValueAxisGlyph().getBounds(); - - return new Point2D.Double( - this.parentGlyph.getShape().getBounds().getX() + valueAxisBoudns.getX(), - this.parentGlyph.getShape().getBounds().getY() + valueAxisBoudns.getY() - ); - } - - @Override - public Glyph getGlyph() { - return this.alertValueGlyph; - } - - @Override - public void goRightPane() { - new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane(); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java deleted file mode 100644 index aba7f83632..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/AxisActiveGlyph.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.AxisGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetAxisStyleAction; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:00 - */ -public abstract class AxisActiveGlyph extends ActiveGlyph { - protected AxisGlyph axis; - - public AxisActiveGlyph(ChartComponent chartComponent, AxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.axis = axis; - } - - public void drawAllGlyph(Graphics2D g2d, int resolution){ - Point2D offset4Paint = offset4Paint(); - g2d.translate(offset4Paint.getX(), offset4Paint.getY()); - this.axis.drawWithOutAlert(g2d, resolution); - g2d.translate(-offset4Paint.getX(), -offset4Paint.getY()); - }; - - public void goRightPane() { - new SetAxisStyleAction(chartComponent).showAxisStylePane(); - } - - /** - * 返回 对应的属性Axis - */ - public Glyph getGlyph() { - return this.axis; - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java deleted file mode 100644 index ea73e829a6..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.CategoryAxisGlyph; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:01 - */ -public class CategoryAxisActiveGlyph extends AxisActiveGlyph { - - public CategoryAxisActiveGlyph(ChartComponent chartComponent, CategoryAxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, axis, parentGlyph); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java deleted file mode 100644 index f191e7b77d..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ChartActiveGlyph.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.geom.Point2D; - -import com.fr.base.chart.BaseChartGlyph; -import com.fr.base.chart.Glyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetChartStyleAciton; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:54 - */ -public class ChartActiveGlyph extends ActiveGlyph { - private BaseChartGlyph glyphChart; - - public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart) { - this(chartComponent, chart, null); - } - public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.glyphChart = chart; - } - - public Glyph getGlyph() { - return this.glyphChart; - } - - public Point2D offset4Paint() { - return new java.awt.Point(0, 0); - } - - public void goRightPane() { - new SetChartStyleAciton(chartComponent).showChartStylePane(); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java deleted file mode 100644 index 8f67b35b4f..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.PlotGlyph; -import com.fr.chart.chartglyph.TextGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetDataLabelStyleAction; - -public class DataLabelActiveGlyph extends ActiveGlyph{ - private TextGlyph dataLabel; - - public DataLabelActiveGlyph(ChartComponent chartComponent, TextGlyph dataLabel, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.dataLabel = dataLabel; - } - - public void drawAllGlyph(Graphics2D g2d, int resolution){ - Point2D offset4Paint = offset4Paint(); - g2d.translate(offset4Paint.getX(), offset4Paint.getY()); - - ArrayList allDataPointLableGlyph = new ArrayList(); - PlotGlyph plotGlyph = (PlotGlyph)(this.parentGlyph); - plotGlyph.getAllDataPointGlyph(allDataPointLableGlyph); - for(int index = 0; index < allDataPointLableGlyph.size(); index++){ - allDataPointLableGlyph.get(index).draw(g2d, resolution); - } - g2d.translate(-offset4Paint.getX(), -offset4Paint.getY()); - }; - - @Override - public Glyph getGlyph() { - return this.dataLabel; - } - - @Override - public void goRightPane() { - new SetDataLabelStyleAction(chartComponent).showDataLabelStylePane(); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java deleted file mode 100644 index 20b27221be..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.DataSeries; -import com.fr.chart.chartglyph.PlotGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:59 - */ -public class DataSeriesActiveGlyph extends ActiveGlyph { - private DataSeries series; - - public DataSeriesActiveGlyph(ChartComponent chartComponent, DataSeries series, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.series = series; - } - - public Glyph getGlyph() { - return this.series; - } - - /** - * 界面条状 - */ - public void goRightPane() { - if(chartComponent.getEditingChart() == null) { - return; - } - - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE); - } - - @Override - public void drawAllGlyph(Graphics2D g2d, int resolution) { - Point2D offset4Paint = offset4Paint(); - g2d.translate(offset4Paint.getX(), offset4Paint.getY()); - if(this.parentGlyph != null && this.parentGlyph instanceof PlotGlyph){ - PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph; - plotGlyph.drawShape4Series(g2d, resolution); - } - g2d.translate(-offset4Paint.getX(), -offset4Paint.getY()); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java deleted file mode 100644 index a5dd812e31..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.DataSheetGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetDataSheetAction; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:57 - */ -public class DataSheetActiveGlyph extends ActiveGlyph { - private DataSheetGlyph dataSheetGlyph; - - public DataSheetActiveGlyph(ChartComponent chartComponent, DataSheetGlyph dataSheetGlyph, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.dataSheetGlyph = dataSheetGlyph; - } - - public Glyph getGlyph() { - return this.dataSheetGlyph; - } - - public void goRightPane() { - new SetDataSheetAction(chartComponent).showDataSheetStylePane(); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java deleted file mode 100644 index 60a3277186..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.DateAxisGlyph; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:03 - */ -public class DateAxisActiveGlyph extends AxisActiveGlyph { - public DateAxisActiveGlyph(ChartComponent chartComponent, DateAxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, axis, parentGlyph); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java deleted file mode 100644 index 3236977137..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/LegendActiveGlyph.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.LegendGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetLegendStyleAction; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:58 - */ -public class LegendActiveGlyph extends ActiveGlyph { - private LegendGlyph legendGlyph; - - public LegendActiveGlyph(ChartComponent chartComponent, LegendGlyph legendGlyph, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.legendGlyph = legendGlyph; - } - - public Glyph getGlyph() { - return this.legendGlyph; - } - - public void goRightPane() { - new SetLegendStyleAction(chartComponent).showLegendStylePane(); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java deleted file mode 100644 index 1190ed59c1..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/PlotActiveGlyph.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.PlotGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetPlotStyleAction; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:55 - */ -public class PlotActiveGlyph extends ActiveGlyph { - private PlotGlyph plotGlyph; - - public PlotActiveGlyph(ChartComponent chartComponent, PlotGlyph plotGlyph, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.plotGlyph = plotGlyph; - } - - public Glyph getGlyph() { - return this.plotGlyph; - } - - public void goRightPane() { - new SetPlotStyleAction(chartComponent).showPlotPane(); - } - - public java.awt.Point offset4Paint() { - return new java.awt.Point(0, 0); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java deleted file mode 100644 index 2a88280cd4..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.RadarAxisGlyph; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:03 - */ -public class RadarAxisActiveGlyph extends AxisActiveGlyph { - public RadarAxisActiveGlyph(ChartComponent chartComponent, RadarAxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, axis, parentGlyph); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java deleted file mode 100644 index 7913eb8227..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.ValueAxisGlyph; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:02 - */ -public class RangeAxisActiveGlyph extends AxisActiveGlyph { - public RangeAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, axis, parentGlyph); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java deleted file mode 100644 index 250321e509..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/TextActiveGlyph.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.TitleGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetTitleStyleAction; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午3:57 - */ -public class TextActiveGlyph extends ActiveGlyph { - private TitleGlyph titleGlyph; - - public TextActiveGlyph(ChartComponent chartComponent, TitleGlyph titleGlyph, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.titleGlyph = titleGlyph; - } - - public Glyph getGlyph() { - return this.titleGlyph; - } - - public java.awt.Point offset4Paint() { - return new java.awt.Point(0, 0); - } - - public void goRightPane() { - new SetTitleStyleAction(chartComponent).showTitlePane(); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java deleted file mode 100644 index d991d6bb13..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fr.design.chart.gui.active; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.PlotGlyph; -import com.fr.chart.chartglyph.TrendLineGlyph; -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction; - -public class TrendLineActiveGlyph extends ActiveGlyph{ - private TrendLineGlyph trendLine; - public TrendLineActiveGlyph(ChartComponent chartComponent,TrendLineGlyph trendLine, Glyph parentGlyph) { - super(chartComponent, parentGlyph); - this.trendLine = trendLine; - } - - @Override - public Glyph getGlyph() { - return this.trendLine; - } - - public void drawAllGlyph(Graphics2D g2d, int resolution){ - Point2D offset4Paint = offset4Paint(); - g2d.translate(offset4Paint.getX(), offset4Paint.getY()); - PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph; - List list = new ArrayList(); - plotGlyph.getAllTrendLineGlyph(list); - for(int index = 0; index < list.size(); index++){ - list.get(index).draw(g2d, resolution); - } - g2d.translate(-offset4Paint.getX(), -offset4Paint.getY()); - }; - - @Override - public void goRightPane() { - new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane(); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java deleted file mode 100644 index 5270f0d911..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.design.chart.gui.active; - -import com.fr.base.chart.Glyph; -import com.fr.chart.chartglyph.ValueAxisGlyph; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:02 - */ -public class ValueAxisActiveGlyph extends AxisActiveGlyph { - - public ValueAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) { - super(chartComponent, axis, parentGlyph); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java deleted file mode 100644 index 83d471068d..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/ChartComponentAction.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartglyph.AxisGlyph; -import com.fr.design.actions.UpdateAction; -import com.fr.design.chart.gui.ChartComponent; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午5:05 - */ -public abstract class ChartComponentAction extends UpdateAction { - protected ChartComponent chartComponent; - - public ChartComponentAction(ChartComponent chartComponent) { - this.chartComponent = chartComponent; - } - - public void reset() { - chartComponent.reset(); - } - - public void repaint() { - chartComponent.repaint(); - } - - public ChartCollection getChartCollection() { - return chartComponent.getChartCollection(); - } - - public AxisGlyph getActiveAxisGlyph() { - return chartComponent.getActiveAxisGlyph(); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java deleted file mode 100644 index 23c44e530d..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -public class SetAnalysisLineStyleAction extends ChartComponentAction{ - - public SetAnalysisLineStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Analysis_Line")); - } - - @Override - public void actionPerformed(ActionEvent e) { - showAnalysisLineStylePane(); - } - - public void showAnalysisLineStylePane(){ - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LINE_TITLE); - } - - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java deleted file mode 100644 index a4920e883b..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - -import com.fr.stable.StringUtils; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午5:10 - */ -public class SetAxisStyleAction extends ChartComponentAction { - public SetAxisStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Axis_Format")); - } - - public void actionPerformed(ActionEvent e) { - showAxisStylePane(); - } - - public void showAxisStylePane() { - String axisType = getActiveAxisGlyph() == null ? StringUtils.EMPTY : getActiveAxisGlyph().getAxisType(); - - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AXIS_TITLE, axisType); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java deleted file mode 100644 index 188db90c28..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午5:00 - */ -public class SetChartStyleAciton extends ChartComponentAction { - - public SetChartStyleAciton(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Pattern")); - } - - public void actionPerformed(ActionEvent e) { - showChartStylePane(); - } - - public void showChartStylePane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java deleted file mode 100644 index 262016bfac..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -public class SetDataLabelStyleAction extends ChartComponentAction{ - - public SetDataLabelStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Data_Label")); - } - - @Override - public void actionPerformed(ActionEvent e) { - showDataLabelStylePane(); - } - - public void showDataLabelStylePane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LABEL_TITLE); - } - -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java deleted file mode 100644 index cb35fea8fb..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetDataSheetAction.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:49 - */ -public class SetDataSheetAction extends ChartComponentAction { - - private static final long serialVersionUID = -4763886493273213850L; - - public SetDataSheetAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Data_Sheet")); - } - - public void actionPerformed(ActionEvent e) { - showDataSheetStylePane(); - } - - public void showDataSheetStylePane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_DATA_TITLE); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java deleted file mode 100644 index abc137bd83..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:56 - */ -public class SetLegendStyleAction extends ChartComponentAction { - private static final long serialVersionUID = 3253190503195130478L; - - public SetLegendStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Legend_Sytle")); - } - - public void actionPerformed(ActionEvent e) { - showLegendStylePane(); - } - - public void showLegendStylePane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LEGNED_TITLE); - } -} diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java deleted file mode 100644 index 92b7530f1e..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:58 - */ -public class SetPlotStyleAction extends ChartComponentAction { - private static final long serialVersionUID = 2894127568015714372L; - - public SetPlotStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Plot")); - } - - public void actionPerformed(ActionEvent e) { - showPlotPane(); - } - - public void showPlotPane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java b/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java deleted file mode 100644 index b336475d4d..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.fr.design.chart.gui.active.action; - -import java.awt.event.ActionEvent; - -import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.module.DesignModuleFactory; - - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-22 - * Time : 下午4:52 - */ -public class SetTitleStyleAction extends ChartComponentAction { - private static final long serialVersionUID = -4763886493273213850L; - - public SetTitleStyleAction(ChartComponent chartComponent) { - super(chartComponent); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Set_Title_Style")); - } - - public void actionPerformed(ActionEvent e) { - showTitlePane(); - } - - public void showTitlePane() { - DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_TITLE_TITLE); - } -} \ No newline at end of file From 83dba9cc54638d0e4ff4a1201f20901a368a9183 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 3 Sep 2019 09:55:35 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20feature?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=BF=98=E6=98=AF=E8=B5=B0vanchart=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/column/ColumnIndependentVanChartInterface.java | 8 ++++---- .../multilayer/MultiPieIndependentVanChartInterface.java | 8 ++++---- .../designer/WordCloudIndependentVanChartInterface.java | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java index 5727678692..3d5d706618 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java @@ -37,8 +37,8 @@ public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVan return VanChartColumnPlotPane.TITLE; } - @Override - public ChartDataPane getChartDataPane(AttributeChangeListener listener) { - return new MultiCategoryChartDataPane(listener); - } +// @Override +// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { +// return new MultiCategoryChartDataPane(listener); +// } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java index 06f0b0f75f..091334193f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java @@ -26,10 +26,10 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan return "com/fr/design/images/form/toolbar/multiPie.png"; } - @Override - public ChartDataPane getChartDataPane(AttributeChangeListener listener) { - return new MultiPieChartDataPane(listener); - } +// @Override +// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { +// return new MultiPieChartDataPane(listener); +// } public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ return new VanChartMultiPieSeriesPane(parent, plot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java index 1b270b90b7..36ed07bedc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java @@ -91,8 +91,8 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa return VanChartWordCloudTypePane.TITLE; } - @Override - public ChartDataPane getChartDataPane(AttributeChangeListener listener) { - return new WordCloudChartDataPane(listener); - } +// @Override +// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { +// return new WordCloudChartDataPane(listener); +// } } From 183f227096600b2de2db777a249dc76c2d6a8545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 3 Sep 2019 16:59:12 +0800 Subject: [PATCH 3/9] =?UTF-8?q?CHART-10465=20=E6=A1=86=E6=9E=B6=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=E9=85=8D=E7=BD=AE=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chartx/StructureChartDataPane.java | 23 +++++ .../diff/StructureCellDataFieldsPane.java | 86 ++++++++++++++++++ .../diff/StructureDataSetFieldsPane.java | 91 +++++++++++++++++++ .../diff/WordCloudCellDataFieldsPane.java | 2 +- ...StructureIndependentVanChartInterface.java | 7 +- 5 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java new file mode 100644 index 0000000000..31737559cb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java @@ -0,0 +1,23 @@ +package com.fr.design.chartx; + +import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureChartDataPane extends MultiCategoryChartDataPane { + + public StructureChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane()); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java new file mode 100644 index 0000000000..87ff4d3954 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java @@ -0,0 +1,86 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.StructureColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; + +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane { + + private TinyFormulaPane nodeName; + private TinyFormulaPane nodeId; + private TinyFormulaPane parentId; + private UITextField seriesName; + private TinyFormulaPane nodeValue; + + @Override + protected void initComponents() { + seriesName = new UITextField(); + nodeName = new TinyFormulaPane(); + nodeId = new TinyFormulaPane(); + parentId = new TinyFormulaPane(); + nodeValue = new TinyFormulaPane(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + "id", + Toolkit.i18nText("Fine-Design_Chart_Parent_ID"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Value"), + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[]{ + nodeName, + nodeId, + parentId, + nodeValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + nodeName, + nodeId, + parentId, + nodeValue, + nodeValue, + }; + } + + @Override + public void populateBean(StructureColumnFieldCollection ob) { + seriesName.setText(ob.getSeriesName()); + populateField(nodeName, ob.getNodeName()); + populateField(nodeId, ob.getNodeId()); + populateField(parentId, ob.getParentId()); + populateField(nodeValue, ob.getNodeValue()); + } + + @Override + public StructureColumnFieldCollection updateBean() { + StructureColumnFieldCollection result = new StructureColumnFieldCollection(); + result.setSeriesName(seriesName.getText()); + updateField(nodeName, result.getNodeName()); + updateField(nodeId, result.getNodeId()); + updateField(parentId, result.getParentId()); + updateField(nodeValue, result.getNodeValue()); + return result; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java new file mode 100644 index 0000000000..049c76fd75 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java @@ -0,0 +1,91 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.StructureColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; + +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane { + + private UIComboBox nodeName; + private UIComboBox nodeId; + private UIComboBox parentId; + private UITextField seriesName; + private UIComboBox nodeValue; + private CalculateComboBox calculateCombox; + + @Override + protected void initComponents() { + nodeName = new UIComboBox(); + nodeId = new UIComboBox(); + parentId = new UIComboBox(); + seriesName = new UITextField(); + nodeValue = new UIComboBox(); + calculateCombox = new CalculateComboBox(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + "id", + Toolkit.i18nText("Fine-Design_Chart_Parent_ID"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Value"), + Toolkit.i18nText("Fine-Design_Chart_Summary_Method") + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + nodeName, + nodeId, + parentId, + nodeValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + nodeName, + nodeId, + parentId, + nodeValue, + nodeValue, + calculateCombox + }; + } + + @Override + public void populateBean(StructureColumnFieldCollection ob) { + seriesName.setText(ob.getSeriesName()); + populateField(nodeName, ob.getNodeName()); + populateField(nodeId, ob.getNodeId()); + populateField(parentId, ob.getParentId()); + populateFunctionField(nodeValue, calculateCombox, ob.getNodeValue()); + } + + @Override + public StructureColumnFieldCollection updateBean() { + StructureColumnFieldCollection result = new StructureColumnFieldCollection(); + result.setSeriesName(seriesName.getText()); + updateField(nodeName, result.getNodeName()); + updateField(nodeId, result.getNodeId()); + updateField(parentId, result.getParentId()); + updateFunctionField(nodeValue, calculateCombox, result.getNodeValue()); + return result; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java index 46af0112ce..fc90c87c36 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java @@ -64,7 +64,7 @@ public class WordCloudCellDataFieldsPane extends AbstractCellDataFieldsPane Date: Wed, 4 Sep 2019 09:29:51 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-20318=20sonar=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/layout/TableLayout.java | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/layout/TableLayout.java b/designer-base/src/main/java/com/fr/design/layout/TableLayout.java index b812263c6b..5cb1b79cba 100644 --- a/designer-base/src/main/java/com/fr/design/layout/TableLayout.java +++ b/designer-base/src/main/java/com/fr/design/layout/TableLayout.java @@ -1,6 +1,9 @@ package com.fr.design.layout; +import com.fr.general.GeneralUtils; +import com.fr.stable.CommonUtils; + import java.awt.Component; import java.awt.ComponentOrientation; import java.awt.Container; @@ -12,8 +15,6 @@ import java.lang.reflect.Method; import java.util.LinkedList; import java.util.ListIterator; -import com.fr.general.GeneralUtils; - /** *

TableLayout is a layout manager that is more powerful than GridBagLayout @@ -853,9 +854,9 @@ public class TableLayout implements LayoutManager2, Serializable { // Make sure row size is valid if ((size < 0.0) && - (size != FILL) && - (size != PREFERRED) && - (size != MINIMUM)) { + (!CommonUtils.equals(size, FILL)) && + (!CommonUtils.equals(size, PREFERRED)) && + (!CommonUtils.equals(size, MINIMUM))) { size = 0.0; } @@ -1177,7 +1178,7 @@ public class TableLayout implements LayoutManager2, Serializable { int numCr = crSpec[z].length; for (int counter = 0; counter < numCr; counter++) - if ((crSpec[z][counter] >= 1.0) || (crSpec[z][counter] == 0.0)) { + if ((crSpec[z][counter] >= 1.0) || CommonUtils.equals(crSpec[z][counter], 0.0)) { crSize[z][counter] = (int) (crSpec[z][counter] + 0.5); availableSize -= crSize[z][counter]; } @@ -1229,7 +1230,7 @@ public class TableLayout implements LayoutManager2, Serializable { int numCr = crSpec[z].length; for (int counter = 0; counter < numCr; counter++) - if (crSpec[z][counter] == FILL) + if (CommonUtils.equals(crSpec[z][counter], FILL)) numFillSize++; // If numFillSize is zero, the if statement below will always evaluate to @@ -1241,7 +1242,7 @@ public class TableLayout implements LayoutManager2, Serializable { // Assign "fill" cells equal amounts of the remaining space for (int counter = 0; counter < numCr; counter++) - if (crSpec[z][counter] == FILL) { + if (CommonUtils.equals(crSpec[z][counter], FILL)) { crSize[z][counter] = availableSize / numFillSize; slackSize -= crSize[z][counter]; } @@ -1249,7 +1250,7 @@ public class TableLayout implements LayoutManager2, Serializable { // Assign one pixel of slack to each FILL cr, starting at the last one, // until all slack has been consumed for (int counter = numCr - 1; (counter >= 0) && (slackSize > 0); counter--) { - if (crSpec[z][counter] == FILL) { + if (CommonUtils.equals(crSpec[z][counter], FILL)) { crSize[z][counter]++; slackSize--; } @@ -1299,7 +1300,7 @@ public class TableLayout implements LayoutManager2, Serializable { // Address every cr for (int counter = 0; counter < numCr; counter++) // Is the current cr a preferred/minimum (based on typeOfSize) size - if (crSpec[z][counter] == typeOfSize) { + if (CommonUtils.equals(crSpec[z][counter], typeOfSize)) { // Assume a maximum width of zero int maxSize = 0; @@ -1319,7 +1320,7 @@ public class TableLayout implements LayoutManager2, Serializable { // the current component occupies if ((entry.cr1[z] <= counter) && (entry.cr2[z] >= counter)) { // Setup size and number of adjustable crs - Dimension p = (typeOfSize == PREFERRED) ? + Dimension p = CommonUtils.equals(typeOfSize, PREFERRED) ? entry.component.getPreferredSize() : entry.component.getMinimumSize(); @@ -1328,23 +1329,23 @@ public class TableLayout implements LayoutManager2, Serializable { int numAdjustable = 0; // Calculate for preferred size - if (typeOfSize == PREFERRED) + if (CommonUtils.equals(typeOfSize, PREFERRED)) // Consider all crs this component occupies for (int entryCr = entry.cr1[z]; entryCr <= entry.cr2[z]; entryCr++) { // Subtract absolute, relative, and minumum cr // sizes, which have already been calculated if ((crSpec[z][entryCr] >= 0.0) || - (crSpec[z][entryCr] == MINIMUM)) { + CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) { size -= crSize[z][entryCr]; } // Count preferred/min width columns - else if (crSpec[z][entryCr] == PREFERRED) + else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED)) numAdjustable++; - // Skip any component that occupies a fill cr - // because the fill should fulfill the size - // requirements - else if (crSpec[z][entryCr] == FILL) + // Skip any component that occupies a fill cr + // because the fill should fulfill the size + // requirements + else if (CommonUtils.equals(crSpec[z][entryCr], FILL)) continue nextComponent; } // Calculate for minimum size @@ -1357,14 +1358,14 @@ public class TableLayout implements LayoutManager2, Serializable { if (crSpec[z][entryCr] >= 0.0) size -= crSize[z][entryCr]; // Count preferred/min width columns - else if ((crSpec[z][entryCr] == PREFERRED) || - (crSpec[z][entryCr] == MINIMUM)) { + else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED) || + CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) { numAdjustable++; } // Skip any component that occupies a fill cr // because the fill should fulfill the size // requirements - else if (crSpec[z][entryCr] == FILL) + else if (CommonUtils.equals(crSpec[z][entryCr], FILL)) continue nextComponent; } @@ -1692,7 +1693,7 @@ public class TableLayout implements LayoutManager2, Serializable { Dimension prefMinSize[] = new Dimension[numEntry]; for (int i = 0; i < numEntry; i++) - prefMinSize[i] = (typeOfSize == PREFERRED) ? + prefMinSize[i] = CommonUtils.equals(typeOfSize, PREFERRED) ? entryList[i].component.getPreferredSize() : entryList[i].component.getMinimumSize(); From 4bc8bf542a377741bf6252ac35eb92d23a1c4fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Sep 2019 11:49:24 +0800 Subject: [PATCH 5/9] =?UTF-8?q?CHART-10465=20=E6=9A=82=E6=97=B6=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=8E=89=E6=96=B0=E7=9A=84=E6=95=B0=E6=8D=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../desinger/StructureIndependentVanChartInterface.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java index 4d52672a19..020278f95e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java @@ -3,7 +3,6 @@ package com.fr.van.chart.structure.desinger; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.chartx.StructureChartDataPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -82,8 +81,8 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa return new VanChartStructureConditionPane(plot); } - @Override + /* @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new StructureChartDataPane(listener); - } + }*/ } From 7ea83ebbe914f427fd7c02d82e6feaf3a2bbe89d Mon Sep 17 00:00:00 2001 From: Maksim Date: Thu, 5 Sep 2019 10:09:29 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-20323=20sonar=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormCreatorDropTarget.java | 2 +- .../src/main/java/com/fr/design/mainframe/FormDesigner.java | 1 + .../src/main/java/com/fr/design/mainframe/FormToolBar.java | 2 +- .../main/java/com/fr/design/mainframe/FormToolBarPane.java | 2 +- .../src/main/java/com/fr/design/mainframe/JForm.java | 1 + .../java/com/fr/design/mainframe/widget/UITreeComboBox.java | 6 +++++- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 0e8e77ed78..05d33cccb3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -252,7 +252,7 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dtde 事件 */ - public void drop(DropTargetDropEvent dtde) { + public synchronized void drop(DropTargetDropEvent dtde) { Point loc = dtde.getLocation(); this.adding(loc.x, loc.y); //针对在表单中拖入一个控件直接ctrl+s无反应 diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 99883fff38..fbf52d021f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1368,6 +1368,7 @@ public class FormDesigner extends TargetComponent

implements TreeSelection Thread.sleep(1500); } catch (InterruptedException e) { FRLogger.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } pane.setLayout(new BorderLayout()); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java b/designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java index 860144dc85..71a93e9bce 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java @@ -20,7 +20,7 @@ public class FormToolBar { } public void setButtonlist(List buttonlist) { - if (buttonlist == null || buttonlist.size() < 0) { + if (buttonlist == null) { this.buttonlist = new ArrayList(); } else { this.buttonlist = buttonlist; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java index e64259b27c..17d620829b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java @@ -118,7 +118,7 @@ public class FormToolBarPane extends BasicBeanPane { } private void setToolBar(List list) { - if (list == null || list.size() < 0) { + if (list == null) { return; } this.removeAll(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index bcf761fac5..6b8cbbe5d5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -765,6 +765,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 5 Sep 2019 17:28:31 +0800 Subject: [PATCH 7/9] =?UTF-8?q?sonar=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/ibutton/UIBasicButtonUI.java | 6 +++--- .../src/main/java/com/fr/design/gui/ibutton/UIButton.java | 2 +- .../main/java/com/fr/design/gui/ibutton/UISliderButton.java | 2 +- .../java/com/fr/design/gui/ibutton/UISliderButtonUI.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java index 185e4c18fc..64db1e91da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java @@ -321,9 +321,9 @@ public class UIBasicButtonUI extends MetalButtonUI { //harry: 画带有高光的按钮。 private void drawHighLightButton(Graphics2D g2, Color color1, Color color2, int w, int h) { - GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1, color2); - GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.2f)); - GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.4f)); + GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1f, color2); + GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.2f)); + GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.4f)); g2.setPaint(buttonPaint); g2.fillRoundRect(0, 0, w - 1, h - 1, 3, 3); g2.setPaint(buttonHighLightLinePaint);//按钮内侧高光线(内发光,0%阻塞) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java index 078bf692b9..32f20ad563 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java @@ -251,7 +251,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { protected void paintOtherBorder(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setStroke(borderStroke); - Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); + Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC); g2d.setColor(borderColor); g2d.draw(shape); } diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java index 21c5ee4b98..cc8aa9f63a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java @@ -232,7 +232,7 @@ public class UISliderButton extends JButton implements UIObserver { protected void paintOtherBorder(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setStroke(borderStroke); - Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); + Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC); g2d.setColor(borderColor); g2d.draw(shape); } diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java index 6da878d8d7..6a92f5057b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java @@ -176,7 +176,7 @@ public class UISliderButtonUI extends BasicButtonUI { private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { GradientPaint gp; if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) { - gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE); + gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE); } else if (isPressedPainted) { gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB); }else{ From 8798fe8da4ec7a2d4c8b82fb774e35165f5aed23 Mon Sep 17 00:00:00 2001 From: author Date: Fri, 6 Sep 2019 11:05:37 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8Cson?= =?UTF-8?q?ar=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormCreatorDropTarget.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 05d33cccb3..3ed29d0475 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -148,6 +148,9 @@ public class FormCreatorDropTarget extends DropTarget { // 取消前一个焦点容器的提示渲染器 designer.setPainter(null); } + if (container == null) { + throw new IllegalArgumentException("container can not be null!"); + } //获取painter的时候要考虑布局之间嵌套的问题 XLayoutContainer xLayoutContainer = container.getTopLayout(); if (xLayoutContainer != null && xLayoutContainer.getParent() != null @@ -215,7 +218,8 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dtde 事件 */ - public void dragEnter(DropTargetDragEvent dtde) { + @Override + public synchronized void dragEnter(DropTargetDragEvent dtde) { Point loc = dtde.getLocation(); this.entering(loc.x, loc.y); } @@ -225,7 +229,8 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dtde 事件 */ - public void dragOver(DropTargetDragEvent dtde) { + @Override + public synchronized void dragOver(DropTargetDragEvent dtde) { Point loc = dtde.getLocation(); hovering(loc.x, loc.y); } @@ -235,7 +240,8 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dtde 事件 */ - public void dropActionChanged(DropTargetDragEvent dtde) { + @Override + public synchronized void dropActionChanged(DropTargetDragEvent dtde) { } /** @@ -243,7 +249,8 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dte 事件 */ - public void dragExit(DropTargetEvent dte) { + @Override + public synchronized void dragExit(DropTargetEvent dte) { this.exiting(); } @@ -252,6 +259,7 @@ public class FormCreatorDropTarget extends DropTarget { * * @param dtde 事件 */ + @Override public synchronized void drop(DropTargetDropEvent dtde) { Point loc = dtde.getLocation(); this.adding(loc.x, loc.y); From 1bb196feb5738685bf42521aad1db19f8d715a73 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 6 Sep 2019 17:28:54 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20sonar?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/icon/BorderIcon.java | 9 ++++--- .../java/com/fr/design/icon/LockIcon.java | 2 +- .../java/com/fr/design/icon/WarningIcon.java | 2 +- .../fr/design/layout/FRGUIPaneFactory.java | 5 ++-- .../com/fr/design/layout/TableLayout.java | 25 ++++++++++--------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/icon/BorderIcon.java b/designer-base/src/main/java/com/fr/design/icon/BorderIcon.java index 9d5e713051..3afc423be1 100644 --- a/designer-base/src/main/java/com/fr/design/icon/BorderIcon.java +++ b/designer-base/src/main/java/com/fr/design/icon/BorderIcon.java @@ -1,5 +1,6 @@ package com.fr.design.icon; +import com.fr.stable.AssistUtils; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; @@ -43,13 +44,13 @@ public class BorderIcon implements Icon { if (lineStyle == Constants.LINE_MEDIUM || lineStyle == Constants.LINE_THICK) { lineStyle = Constants.LINE_MEDIUM; - if (x1 == x2) { - if (x1 == y1) { + if (AssistUtils.equals(x1, x2)) { + if (AssistUtils.equals(x1, y1)) { GraphHelper.drawLine(g, x1, y1 - 1, x2, y2 + 1, lineStyle); } else { GraphHelper.drawLine(g, x1, y1, x2, y2 + 1, lineStyle); } - } else if (y1 == y2) { + } else if (AssistUtils.equals(y1, y2)) { GraphHelper.drawLine(g, x1, y1, x2 + 1, y2, lineStyle); } } else if (lineStyle == Constants.LINE_THIN @@ -57,7 +58,7 @@ public class BorderIcon implements Icon { GraphHelper.drawLine(g, x1, y1, x2, y2, lineStyle); } else { lineStyle = Constants.LINE_DOT; - if (y1 == x2 && x2 == y2) { + if (AssistUtils.equals(y1, x2) && AssistUtils.equals(x2, y2)) { GraphHelper.drawLine(g, x1, y1, x2 + 1, y2, lineStyle); } else { GraphHelper.drawLine(g, x1, y1, x2, y2, lineStyle); diff --git a/designer-base/src/main/java/com/fr/design/icon/LockIcon.java b/designer-base/src/main/java/com/fr/design/icon/LockIcon.java index ee54b6ea86..7ebffbdb79 100644 --- a/designer-base/src/main/java/com/fr/design/icon/LockIcon.java +++ b/designer-base/src/main/java/com/fr/design/icon/LockIcon.java @@ -35,7 +35,7 @@ public class LockIcon extends ImageIcon { } @Override - public void paintIcon(Component c, Graphics g, int x, int y) { + public synchronized void paintIcon(Component c, Graphics g, int x, int y) { if (mainImage != null) { g.drawImage(mainImage, x, y, c); } diff --git a/designer-base/src/main/java/com/fr/design/icon/WarningIcon.java b/designer-base/src/main/java/com/fr/design/icon/WarningIcon.java index d70d62225d..50b70cceca 100644 --- a/designer-base/src/main/java/com/fr/design/icon/WarningIcon.java +++ b/designer-base/src/main/java/com/fr/design/icon/WarningIcon.java @@ -37,7 +37,7 @@ public class WarningIcon extends ImageIcon { } @Override - public void paintIcon(Component c, Graphics g, int x, int y) { + public synchronized void paintIcon(Component c, Graphics g, int x, int y) { if (mainImage != null) { g.drawImage(mainImage, x, y, c); } diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 38097c2d91..90a5bc9586 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -3,6 +3,7 @@ package com.fr.design.layout; import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ilable.UILabel; +import com.fr.stable.AssistUtils; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.Icon; @@ -562,9 +563,9 @@ public class FRGUIPaneFactory { float i = Math.abs((((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m); float j = Math.abs((((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n); float x = i > j ? i : j; - if (x == i) { + if (AssistUtils.equals(x, i)) { w = Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M; - } else if (x == j) { + } else if (AssistUtils.equals(x, j)) { w = Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N; } return w; diff --git a/designer-base/src/main/java/com/fr/design/layout/TableLayout.java b/designer-base/src/main/java/com/fr/design/layout/TableLayout.java index b812263c6b..3982e00bd2 100644 --- a/designer-base/src/main/java/com/fr/design/layout/TableLayout.java +++ b/designer-base/src/main/java/com/fr/design/layout/TableLayout.java @@ -1,6 +1,7 @@ package com.fr.design.layout; +import com.fr.stable.AssistUtils; import java.awt.Component; import java.awt.ComponentOrientation; import java.awt.Container; @@ -399,17 +400,17 @@ public class TableLayout implements LayoutManager2, Serializable { // Make sure rows and columns are valid for (int counter = 0; counter < crSpec[C].length; counter++) if ((crSpec[C][counter] < 0.0) && - (crSpec[C][counter] != FILL) && - (crSpec[C][counter] != PREFERRED) && - (crSpec[C][counter] != MINIMUM)) { + !AssistUtils.equals(crSpec[C][counter], FILL) && + !AssistUtils.equals(crSpec[C][counter], PREFERRED) && + !AssistUtils.equals(crSpec[C][counter], MINIMUM)) { crSpec[C][counter] = 0.0; } for (int counter = 0; counter < crSpec[R].length; counter++) if ((crSpec[R][counter] < 0.0) && - (crSpec[R][counter] != FILL) && - (crSpec[R][counter] != PREFERRED) && - (crSpec[R][counter] != MINIMUM)) { + !AssistUtils.equals(crSpec[R][counter], FILL) && + !AssistUtils.equals(crSpec[R][counter], PREFERRED) && + !AssistUtils.equals(crSpec[R][counter], MINIMUM)) { crSpec[R][counter] = 0.0; } @@ -556,9 +557,9 @@ public class TableLayout implements LayoutManager2, Serializable { // Make sure rows are valid for (int counter = 0; counter < crSpec[z].length; counter++) if ((crSpec[z][counter] < 0.0) && - (crSpec[z][counter] != FILL) && - (crSpec[z][counter] != PREFERRED) && - (crSpec[z][counter] != MINIMUM)) { + !AssistUtils.equals(crSpec[z][counter], FILL) && + !AssistUtils.equals(crSpec[z][counter], PREFERRED) && + !AssistUtils.equals(crSpec[z][counter], MINIMUM)) { crSpec[z][counter] = 0.0; } @@ -641,9 +642,9 @@ public class TableLayout implements LayoutManager2, Serializable { protected void setCr(int z, int i, double size) { // Make sure size is valid if ((size < 0.0) && - (size != FILL) && - (size != PREFERRED) && - (size != MINIMUM)) { + !AssistUtils.equals(size, FILL) && + !AssistUtils.equals(size, PREFERRED) && + !AssistUtils.equals(size, MINIMUM)) { size = 0.0; }