diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index af113ff36d..55eba57f36 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -43,45 +43,25 @@ import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.DownloadOnlineSourcesHelper; import com.fr.plugin.chart.PiePlot4VanChart; -import com.fr.plugin.chart.area.AreaIndependentVanChartInterface; import com.fr.plugin.chart.area.VanChartAreaPlot; -import com.fr.plugin.chart.bar.BarIndependentVanChartInterface; -import com.fr.plugin.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.column.ColumnIndependentVanChartInterface; import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.custom.CustomIndependentVanChartInterface; import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChartInterface; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.funnel.VanChartFunnelPlot; -import com.fr.plugin.chart.funnel.designer.FunnelIndependentVanChartInterface; import com.fr.plugin.chart.gantt.VanChartGanttPlot; -import com.fr.plugin.chart.gantt.designer.GanttIndependentVanChartInterface; -import com.fr.plugin.chart.gauge.GaugeIndependentVanChartInterface; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; -import com.fr.plugin.chart.heatmap.designer.HeatMapIndependentVanChartInterface; -import com.fr.plugin.chart.line.LineIndependentVanChartInterface; import com.fr.plugin.chart.line.VanChartLinePlot; -import com.fr.plugin.chart.map.MapIndependentVanChartInterface; import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChartInterface; import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; -import com.fr.plugin.chart.pie.PieIndependentVanChartInterface; -import com.fr.plugin.chart.radar.RadarIndependentVanChartInterface; import com.fr.plugin.chart.radar.VanChartRadarPlot; -import com.fr.plugin.chart.scatter.ScatterIndependentVanChartInterface; import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.structure.VanChartStructurePlot; -import com.fr.plugin.chart.structure.desinger.StructureIndependentVanChartInterface; -import com.fr.plugin.chart.treemap.TreeMapIndependentVanChartInterface; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; -import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; import com.fr.plugin.solution.closeable.CloseableContainedMap; @@ -89,6 +69,26 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.van.chart.DownloadOnlineSourcesHelper; +import com.fr.van.chart.area.AreaIndependentVanChartInterface; +import com.fr.van.chart.bar.BarIndependentVanChartInterface; +import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; +import com.fr.van.chart.column.ColumnIndependentVanChartInterface; +import com.fr.van.chart.custom.CustomIndependentVanChartInterface; +import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface; +import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface; +import com.fr.van.chart.gantt.designer.GanttIndependentVanChartInterface; +import com.fr.van.chart.gauge.GaugeIndependentVanChartInterface; +import com.fr.van.chart.heatmap.designer.HeatMapIndependentVanChartInterface; +import com.fr.van.chart.line.LineIndependentVanChartInterface; +import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.multilayer.MultiPieIndependentVanChartInterface; +import com.fr.van.chart.pie.PieIndependentVanChartInterface; +import com.fr.van.chart.radar.RadarIndependentVanChartInterface; +import com.fr.van.chart.scatter.ScatterIndependentVanChartInterface; +import com.fr.van.chart.structure.desinger.StructureIndependentVanChartInterface; +import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface; +import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; import javax.swing.Icon; import java.util.ArrayList; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index 16fb67beee..cf1664b173 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -15,10 +15,15 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index a30f28c3e7..1d0dfa8e69 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -14,13 +14,17 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 829bf13b3e..eedf5ea40d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -9,10 +9,13 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; +import com.fr.van.chart.designer.AbstractVanChartScrollPane; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.util.ArrayList; import java.util.List; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java index f6881a6f30..3b4ce46296 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java @@ -8,9 +8,9 @@ import com.fr.chart.chartdata.BubbleSeriesValue; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; +import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java index 90bb3af827..6aaebb144e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java @@ -14,11 +14,16 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java index 0433ad922a..9248599a60 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java @@ -11,13 +11,15 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.util.List; public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane { diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java index 6f2b91bbfc..37f31fa9bd 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java @@ -11,10 +11,12 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; /** * 仪表盘 属性表 单元格数据界面 diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java index 58d04a667a..21c755b1d7 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java @@ -13,12 +13,15 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.util.List; public class BubblePlotTableDataContentPane extends AbstractTableDataContentPane { diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java index a220804e14..18dd9a1eac 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java @@ -11,10 +11,12 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; import java.util.List; /** diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java index b32690e1bc..bd33d805f0 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java @@ -11,8 +11,8 @@ import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.general.Inter; import com.fr.js.JavaScriptImpl; import com.fr.js.WebHyperlink; -import com.fr.plugin.chart.designer.component.ChartUIMenuNameableCreator; import com.fr.third.org.hsqldb.lib.HashMap; +import com.fr.van.chart.designer.component.ChartUIMenuNameableCreator; import java.util.ArrayList; import java.util.List; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java index f6b7d20238..fafb53e0eb 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java @@ -53,16 +53,19 @@ import com.fr.js.NameJavaScriptGroup; import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; -import com.fr.plugin.chart.designer.component.ChartUIMenuNameableCreator; -import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.third.org.hsqldb.lib.HashMap; import com.fr.third.org.hsqldb.lib.Iterator; - -import javax.swing.*; -import java.awt.*; +import com.fr.van.chart.designer.component.ChartUIMenuNameableCreator; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; + +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java index 1b9c89e02c..9a46d77f8a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java @@ -21,12 +21,14 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.general.FRFont; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index e3068e347b..ab4dccc644 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -14,10 +14,14 @@ import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Font; public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java index afb1b20689..804d9f355d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java @@ -15,11 +15,14 @@ import com.fr.design.mainframe.chart.gui.style.ChartAxisTitlePane; import com.fr.design.mainframe.chart.gui.style.ChartAxisValueTypePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.stable.Constants; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Component; public class ChartCategoryPane extends ChartAxisUsePane{ diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 602e7ddcad..7a68694b3b 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -25,12 +25,16 @@ import com.fr.design.mainframe.chart.gui.style.ChartAxisTitleNoFormulaPane; import com.fr.design.mainframe.chart.gui.style.ChartAxisTitlePane; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/datasheet/ChartDatasheetPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/datasheet/ChartDatasheetPane.java index 43b4361db1..f6ccf45dae 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/datasheet/ChartDatasheetPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/datasheet/ChartDatasheetPane.java @@ -17,10 +17,12 @@ import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.component.format.FormatPaneWithNormalType; +import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java index c9f54fc339..e792ad5e15 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java @@ -5,10 +5,10 @@ import com.fr.chart.chartattr.Chart; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; +import com.fr.van.chart.designer.AbstractVanChartScrollPane; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; /** * 属性表, 图表样式 -- 系列 界面. 通过initDiffer 加载不同Plot 不同的Pane. diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index c0d9e501b2..dd96c779ec 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -19,8 +19,8 @@ import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JComponent; import javax.swing.JFrame; diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index 586910774a..ca32f6abcf 100644 --- a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java @@ -15,12 +15,12 @@ import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.IOUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.map.server.ChartMapEditorAction; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.van.chart.map.server.ChartMapEditorAction; -import javax.swing.*; +import javax.swing.Icon; /** * Created by IntelliJ IDEA. diff --git a/designer_chart/src/com/fr/extended/chart/ExtendedChartHyperLinkPane.java b/designer_chart/src/com/fr/extended/chart/ExtendedChartHyperLinkPane.java index ff587e5c47..ffa887fe8e 100644 --- a/designer_chart/src/com/fr/extended/chart/ExtendedChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/extended/chart/ExtendedChartHyperLinkPane.java @@ -3,7 +3,7 @@ package com.fr.extended.chart; import com.fr.base.BaseFormula; import com.fr.chart.chartattr.Plot; import com.fr.js.NameJavaScriptGroup; -import com.fr.plugin.chart.custom.component.VanChartHyperLinkPane; +import com.fr.van.chart.custom.component.VanChartHyperLinkPane; import java.util.Map; diff --git a/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java b/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java index dd6a5a40e4..1edf25e047 100644 --- a/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java @@ -10,7 +10,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; diff --git a/designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java b/designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java index 061f8dc13e..f30c707abf 100644 --- a/designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java +++ b/designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java @@ -1,6 +1,6 @@ package com.fr.extended.chart; -import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; +import com.fr.van.chart.designer.AbstractVanChartScrollPane; /** * Created by shine on 2018/3/24. diff --git a/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java b/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java deleted file mode 100644 index 19218d4802..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.fr.plugin.chart; - -import com.fr.base.FRContext; -import com.fr.design.RestartHelper; -import com.fr.design.extra.PluginConstants; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.IOUtils; -import com.fr.general.Inter; -import com.fr.general.SiteCenter; -import com.fr.general.http.HttpClient; -import com.fr.stable.StableUtils; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by shine on 2017/8/21. - */ -public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { - // 定义加载窗口大小 - private static final int LOAD_WIDTH = 455; - private static final int INCIDENT_HEIGHT = 15; - private static final int LOAD_HEIGHT = 295; - private static final int PERCENT = 100; - - //进度显示界面 - private JDialog dialog; - //进度条 - private JProgressBar progressbar; - - private List list = new ArrayList<>(); - //安装结果 - private boolean result = true; - //链接服务器的客户端 - private HttpClient httpClient; - - //总共字节数 - private double totalBytes = 0; - - - private static final double PHANTOM_MB = 96.1 * 1024 * 1024; - - public void addPhantomSiteInfo() { - this.addSiteInfo("plugin.phantomjs", "/assist/phantomjs", PHANTOM_MB); - } - - private static final double MAP_JSON_MB = 3.8 * 1024 * 1024; - - public void addMapJSONSiteInfo() { - this.addSiteInfo("map.json", "/assets/map", MAP_JSON_MB); - } - - public void addSiteInfo(String siteKind, String localDir, double megaBits) { - if (new File(FRContext.getCurrentEnv().getPath() + localDir).exists()) { - //本地有这个资源,不下载 - return; - } - httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteKind)); - if (httpClient.getResponseCode() != HttpURLConnection.HTTP_OK) { - //服务器连不上,不下载 - return; - } - totalBytes += megaBits; - list.add(new SiteInfo(siteKind, localDir)); - } - - public void installOnline() { - - int choose = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer-Download_Online_Sources"), null, JOptionPane.YES_NO_OPTION); - - if (choose == JOptionPane.OK_OPTION) { - initDialog(); - - dialog.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - //取消下载 - result = false; - exitDialog(); - } - - public void windowOpened(WindowEvent e) { - downloadAndInstallPluginDependenceFile(); - exitDialog(); - } - - }); - - dialog.setVisible(true); - } - } - - /** - * 下载和安装不分开是因为,本地如果只安装好了一个依赖,下次就不需要重复下载了 - * 如果下载依赖后不安装,则后面的插件会把前面的插件覆盖,故而下载好了一个安装一个 - * - * @return - * @throws Exception - */ - private void downloadAndInstallPluginDependenceFile() { - try { - double currentBytesRead = 0; - - for (int i = 0; i < list.size(); i++) { - SiteInfo siteInfo = list.get(i); - - httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteInfo.siteKind)); - if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { - InputStream reader = httpClient.getResponseStream(); - String temp = StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE); - File file = new File(temp); - StableUtils.makesureFileExist(file); - FileOutputStream writer = new FileOutputStream(temp); - byte[] buffer = new byte[PluginConstants.BYTES_NUM]; - int bytesRead; - while ((bytesRead = reader.read(buffer)) > 0 && result) { - writer.write(buffer, 0, bytesRead); - buffer = new byte[PluginConstants.BYTES_NUM]; - - currentBytesRead += bytesRead; - setProgress(currentBytesRead); - } - reader.close(); - writer.flush(); - writer.close(); - - - if (result) { - //安装文件 - IOUtils.unZipFilesGBK(temp, FRContext.getCurrentEnv().getPath() + siteInfo.localDir); - } - } else { - result = false; - } - } - } catch (Exception e) { - result = false; - } - } - - - private void initDialog() { - - // 创建标签,并在标签上放置一张图片 - BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png"); - ImageIcon imageIcon = new ImageIcon(image); - UILabel label = new UILabel(imageIcon); - label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT); - - progressbar = new JProgressBar(); - // 显示当前进度值信息 - progressbar.setStringPainted(true); - // 设置进度条边框不显示 - progressbar.setBorderPainted(false); - // 设置进度条的前景色 - progressbar.setForeground(new Color(0x38aef5)); - // 设置进度条的背景色 - progressbar.setBackground(new Color(188, 190, 194)); - progressbar.setBounds(0, LOAD_HEIGHT, LOAD_WIDTH, INCIDENT_HEIGHT); - progressbar.setMinimum(0); - progressbar.setMaximum((int) totalBytes); - setProgress(0); - - dialog = new JDialog(); - dialog.setTitle(Inter.getLocText("FR-Designer-Dependence_Install_Online")); - - JPanel contentPane = new JPanel(new BorderLayout()); - contentPane.add(label, BorderLayout.CENTER); - contentPane.add(progressbar, BorderLayout.SOUTH); - dialog.getContentPane().add(contentPane); - - - dialog.setModal(true); - dialog.setResizable(true); - dialog.setSize(LOAD_WIDTH, LOAD_HEIGHT + INCIDENT_HEIGHT); - dialog.setResizable(false); - GUICoreUtils.centerWindow(dialog); - - dialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - } - - private void setProgress(double current) { - progressbar.setValue((int) current); - progressbar.setString((int) (current / totalBytes * PERCENT) + "%"); - progressbar.paintImmediately(new Rectangle(0, 0, LOAD_WIDTH, INCIDENT_HEIGHT * 2)); - } - - - private void exitDialog() { - dialog.dispose(); - - if (result) { - int choose = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer_Work_After_Restart_Designer"), null, JOptionPane.YES_NO_OPTION); - - if (choose == JOptionPane.OK_OPTION) { - RestartHelper.restart(); - } - } else { - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Dependence_Install_Failed")); - } - } - - @Override - public void downloadSources() { - this.addMapJSONSiteInfo(); - this.addPhantomSiteInfo(); - this.installOnline(); - } - - private class SiteInfo { - String siteKind; - String localDir; - - SiteInfo(String siteKind, String localDir) { - this.siteKind = siteKind; - this.localDir = localDir; - } - } - -} - - diff --git a/designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java b/designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java deleted file mode 100644 index 0f23b79429..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.fr.plugin.chart.area; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI; - -/** - * Created by Mitisky on 15/11/18. - */ -public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { - @Override - public String getIconPath() { - return "com/fr/design/images/form/toolbar/area.png"; - } - - @Override - public AbstractChartTypePane getPlotTypePane() { - return new VanChartAreaPlotPane(); - } - - public ConditionAttributesPane getPlotConditionPane(Plot plot){ - return new VanChartAreaConditionPane(plot); - } - - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ - return new VanChartAreaSeriesPane(parent, plot); - } - - /** - * plot面板的标题 - * 插件兼容 - */ - public String getPlotTypeTitle4PopupWindow(){ - return VanChartAreaPlotPane.TITLE; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java deleted file mode 100644 index 3d452a358e..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.fr.plugin.chart.area; - -import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.ChartConstants; -import com.fr.chart.chartattr.Plot; -import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; -import com.fr.plugin.chart.attr.EffectHelper; -import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; -import com.fr.plugin.chart.base.AttrDataSheet; -import com.fr.plugin.chart.base.AttrEffect; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.base.VanChartAttrLine; -import com.fr.plugin.chart.base.VanChartAttrMarker; -import com.fr.plugin.chart.base.VanChartAttrTrendLine; -import com.fr.plugin.chart.designer.PlotFactory; -import com.fr.plugin.chart.designer.other.condition.item.VanChartAreaFillColorConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartLineTypeConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartMarkerConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane; -import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint; -import com.fr.plugin.chart.scatter.large.VanChartLargeModelMarkerConditionPane; - -import java.awt.*; - -/** - * Created by Mitisky on 15/11/18. - */ -public class VanChartAreaConditionPane extends DataSeriesConditionPane { - private static final long serialVersionUID = -7180705321732069806L; - - public VanChartAreaConditionPane(Plot plot) { - super(plot); - } - - protected void initComponents() { - super.initComponents(); - //添加全部条件属性后被遮挡 - liteConditionPane.setPreferredSize(new Dimension(300, 400)); - } - - @Override - protected void addBasicAction() { - classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); - classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); - classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot)); - classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this)); - classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); - //是否使用数据表 - if (plot.getDataSheet().isVisible()) { - classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot)); - } - if(PlotFactory.largeDataModel(plot)){ - classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this)); - } else { - classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this)); - classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getAreaPlotDefaultEffect())); - classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); - } - } - - protected void addStyleAction() { - - } - - @Override - protected ChartConditionPane createListConditionPane() { - return new ChartConditionPane(){ - @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE, - VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, - }; - } - }; - } - - /** - * 返回图表class对象 - * @return class对象 - */ - public Class class4Correspond() { - return VanChartAreaPlot.class; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java deleted file mode 100644 index 26f20ffb07..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.plugin.chart.area; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; - -/** - * Created by Mitisky on 15/11/18. - */ -public class VanChartAreaPlotPane extends AbstractVanChartTypePane { - public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewArea"); - private static final long serialVersionUID = -8161581682558781651L; - - @Override - protected String[] getTypeIconPath() { - - return new String[]{"/com/fr/plugin/chart/area/images/area.png", - "/com/fr/plugin/chart/area/images/stack.png", - "/com/fr/plugin/chart/area/images/percentStack.png", - "/com/fr/plugin/chart/area/images/custom.png", - }; - } - - @Override - protected String[] getTypeTipName() { - String area = Inter.getLocText("FR-Chart-Type_Area"); - String stack = Inter.getLocText("FR-Chart-Type_Stacked"); - String percent = Inter.getLocText("FR-Chart-Use_Percent"); - return new String[]{ - area, - stack + area, - percent + stack + area, - Inter.getLocText("FR-Chart-Mode_Custom") - }; - } - - /** - * 返回界面标题 - * - * @return 界面标题 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_NewArea"); - } - - - - /** - * 获取各图表类型界面ID, 本质是plotID - * - * @return 图表类型界面ID - */ - @Override - protected String getPlotTypeID() { - return VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID; - } - - protected Plot getSelectedClonedPlot() { - VanChartAreaPlot newPlot = null; - Chart[] areaChart = AreaIndependentVanChart.AreaVanChartTypes; - for (int i = 0, len = areaChart.length; i < len; i++) { - if (typeDemo.get(i).isPressing) { - newPlot = (VanChartAreaPlot) areaChart[i].getPlot(); - } - } - Plot cloned = null; - try { - cloned = (Plot) newPlot.clone(); - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In AreaChart"); - } - return cloned; - } - - public Chart getDefaultChart() { - return AreaIndependentVanChart.AreaVanChartTypes[0]; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java deleted file mode 100644 index bbb30b8888..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.fr.plugin.chart.area; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.plugin.chart.column.VanChartCustomStackAndAxisConditionPane; -import com.fr.plugin.chart.line.VanChartLineSeriesPane; - -import javax.swing.*; -import java.awt.*; - -public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{ - - private static final long serialVersionUID = 5497989595104913025L; - - public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){ - super(parent, plot); - } - - protected JPanel getContentInPlotType(){ - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p,p,p}; - double[] col = {f}; - - Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, - new Component[]{createLineTypePane()}, - new Component[]{createMarkerPane()}, - new Component[]{createAreaFillColorPane()}, - new Component[]{createStackedAndAxisPane()}, - new Component[]{createLargeDataModelPane()}, - new Component[]{createTrendLinePane()}, - }; - - contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - return contentPane; - } - - protected Class getStackAndAxisPaneClass() { - return VanChartCustomStackAndAxisConditionPane.class; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java b/designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java deleted file mode 100644 index 1e0917d966..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.fr.plugin.chart.bar; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.AbstractChartAttrPane; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.column.VanChartColumnConditionPane; -import com.fr.plugin.chart.column.VanChartColumnSeriesPane; -import com.fr.plugin.chart.designer.other.VanChartOtherPane; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI; - -/** - * Created by Mitisky on 15/10/20. - */ -public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { - @Override - public String getIconPath() { - return "com/fr/design/images/form/toolbar/bar.png"; - } - - @Override - public AbstractChartTypePane getPlotTypePane() { - return new VanChartBarPlotPane(); - } - - public ConditionAttributesPane getPlotConditionPane(Plot plot){ - return new VanChartColumnConditionPane(plot); - } - - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ - return new VanChartColumnSeriesPane(parent, plot); - } - - /** - * 图表的属性界面数组 - * @return 属性界面 - */ - public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ - VanChartStylePane stylePane = new VanChartBarStylePane(listener); - VanChartOtherPane otherPane = new VanChartOtherPane(); - return new AbstractChartAttrPane[]{stylePane, otherPane}; - } - - /** - * plot面板的标题 - * 插件兼容 - */ - public String getPlotTypeTitle4PopupWindow(){ - return VanChartBarPlotPane.TITLE; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java b/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java deleted file mode 100644 index 7d27a2736d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.plugin.chart.bar; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; - -/** - * Created by Mitisky on 15/10/20. - */ -public class VanChartBarPlotPane extends AbstractVanChartTypePane { - public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBar"); - - private static final long serialVersionUID = 2879689884048643002L; - - @Override - protected String[] getTypeIconPath() { - return new String[]{"/com/fr/plugin/chart/bar/images/bar.png", - "/com/fr/plugin/chart/bar/images/stack.png", - "/com/fr/plugin/chart/bar/images/percentstack.png", - "/com/fr/plugin/chart/bar/images/custom.png", - }; - } - - @Override - protected String[] getTypeTipName() { - String bar = Inter.getLocText("FR-Chart-Type_Bar"); - String stack = Inter.getLocText("FR-Chart-Type_Stacked"); - String percent = Inter.getLocText("FR-Chart-Use_Percent"); - return new String[]{ - bar, - stack + bar, - percent + stack + bar, - Inter.getLocText("FR-Chart-Mode_Custom") - }; - } - - /** - * 返回界面标题 - * @return 界面标题 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_NewBar"); - } - - - /** - * 获取各图表类型界面ID, 本质是plotID - * - * @return 图表类型界面ID - */ - @Override - protected String getPlotTypeID() { - return VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID; - } - - protected Plot getSelectedClonedPlot(){ - VanChartColumnPlot newPlot = null; - Chart[] barChart = BarIndependentVanChart.BarVanChartTypes; - for(int i = 0, len = barChart.length; i < len; i++){ - if(typeDemo.get(i).isPressing){ - newPlot = (VanChartColumnPlot)barChart[i].getPlot(); - } - } - - Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); - } - return cloned; - } - - public Chart getDefaultChart() { - return BarIndependentVanChart.BarVanChartTypes[0]; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java b/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java deleted file mode 100644 index 91b36e90b5..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.bar; - -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.axis.bar.VanChartBarAxisPane; - -import java.util.List; - -/** - * Created by Mitisky on 16/6/8. - */ -public class VanChartBarStylePane extends VanChartStylePane { - public VanChartBarStylePane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected void createVanChartAxisPane(List paneList, VanChartAxisPlot plot) { - paneList.add(new VanChartBarAxisPane(plot, VanChartBarStylePane.this)); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java b/designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java deleted file mode 100644 index bd9f0695e2..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.AbstractChartAttrPane; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; -import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContentPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane; -import com.fr.plugin.chart.designer.other.VanChartOtherPane; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI; - -/** - * Created by Mitisky on 16/3/31. - */ -public class BubbleIndependentVanChartInterface extends AbstractIndependentVanChartUI { - /** - * 图表的类型定义界面类型,就是属性表的第一个界面 - * - * @return 图表的类型定义界面类型 - */ - @Override - public AbstractChartTypePane getPlotTypePane() { - return new VanChartBubblePlotPane(); - } - - /** - * 图标路径 - * - * @return 图标路径 - */ - @Override - public String getIconPath() { - return "com/fr/design/images/form/toolbar/bubble.png"; - } - @Override - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ - return new VanChartBubbleSeriesPane(parent, plot); - } - - @Override - public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ - if(((VanChartBubblePlot) plot).isForceBubble()){ - return super.getTableDataSourcePane(plot, parent); - } - return new VanChartBubblePlotTableDataContentPane(parent); - } - - @Override - public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ - if(((VanChartBubblePlot) plot).isForceBubble()){ - return super.getReportDataSourcePane(plot, parent); - } - return new BubblePlotReportDataContentPane(parent); - } - - /** - * 图表的属性界面数组 - * @return 属性界面 - */ - public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ - VanChartStylePane stylePane = new VanChartBubbleStylePane(listener); - VanChartOtherPane otherPane = new VanChartOtherPane(){ - protected BasicBeanPane createInteractivePane() { - return new VanChartBubbleInteractivePane(); - } - }; - return new AbstractChartAttrPane[]{stylePane, otherPane}; - } - - public ConditionAttributesPane getPlotConditionPane(Plot plot){ - return new VanChartBubbleConditionPane(plot); - } - - public String getPlotTypeTitle4PopupWindow(){ - return VanChartBubblePlotPane.TITLE; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java deleted file mode 100644 index 3623c24789..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.base.AttrAlpha; -import com.fr.chart.base.AttrBackground; -import com.fr.chart.chartattr.Plot; -import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; -import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; -import com.fr.plugin.chart.attr.EffectHelper; -import com.fr.plugin.chart.base.AttrEffect; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; -import com.fr.plugin.chart.designer.PlotFactory; -import com.fr.plugin.chart.designer.other.condition.item.VanChartBubbleSetConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane; -import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; -import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; -import com.fr.plugin.chart.scatter.component.label.VanChartScatterLabelConditionPane; -import com.fr.plugin.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; - -import java.awt.*; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubbleConditionPane extends DataSeriesConditionPane { - private static final long serialVersionUID = -7180705321732069806L; - - public VanChartBubbleConditionPane(Plot plot) { - super(plot); - } - - protected void initComponents() { - super.initComponents(); - //添加全部条件属性后被遮挡 - liteConditionPane.setPreferredSize(new Dimension(300, 400)); - } - - private boolean forceBubble() { - return plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble(); - } - - @Override - protected ChartConditionPane createListConditionPane() { - return forceBubble() ? new ChartConditionPane() : new VanChartBubbleConditionSelectionPane(); - } - - @Override - protected void addBasicAction() { - classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); - classPaneMap.put(VanChartAttrBubble.class, new VanChartBubbleSetConditionPane(this)); - classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); - - if(forceBubble()){ - addForceAction(); - } else if(PlotFactory.largeDataModel(plot)){ - addLargeAction(); - } else { - addNormalAction(); - } - } - - private void addNormalAction() { - classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); - classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot)); - classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect())); - } - - private void addForceAction() { - classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); - classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); - classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect())); - } - - private void addLargeAction() { - classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot)); - } - - - protected void addStyleAction() { - } - - /** - * 返回图表class对象 - * @return class对象 - */ - public Class class4Correspond() { - return VanChartBubblePlot.class; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java deleted file mode 100644 index 0ea9262e6a..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.base.ChartConstants; -import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.plugin.chart.scatter.VanChartScatterDataPoint; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubbleConditionSelectionPane extends ChartConditionPane { - - - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - VanChartScatterDataPoint.X, - VanChartScatterDataPoint.Y, - ChartConstants.VALUE - }; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java deleted file mode 100644 index 706c0f3b05..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.chartattr.Plot; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartConstants; -import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithOutSort; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort { - protected String[] getNameArray() { - Plot plot = chart.getPlot(); - if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) { - return new String[]{Inter.getLocText("Plugin-ChartF_XYAxis"), Inter.getLocText("Chart-Use_None")}; - } - return super.getNameArray(); - } - - protected String[] getValueArray() { - Plot plot = chart.getPlot(); - if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) { - return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE}; - } - return super.getValueArray(); - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java deleted file mode 100644 index 4b28af6606..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.base.AttrAlpha; -import com.fr.chart.base.DataSeriesCondition; -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.chart.chartglyph.ConditionCollection; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartTools; -import com.fr.plugin.chart.base.VanChartZoom; -import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; -import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; -import com.fr.plugin.chart.vanchart.VanChart; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubblePlotPane extends AbstractVanChartTypePane { - public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBubble");; - - private static final long serialVersionUID = -3481633368542654247L; - - private static final float FORCE_ALPHA = 1.0f; - - private static final float ALPHA = 0.7f; - - @Override - protected String[] getTypeIconPath() { - return new String[]{"/com/fr/plugin/chart/bubble/images/bubble.png", - "/com/fr/plugin/chart/bubble/images/force.png" - }; - } - - @Override - protected String[] getTypeTipName() { - return new String[]{ - Inter.getLocText("FR-Chart-Chart_BubbleChart"), - Inter.getLocText("Plugin-ChartF_NewForceBubble") - }; - } - - /** - * 返回界面标题 - * @return 界面标题 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_NewBubble"); - } - - - private void removeDefaultAttr(ConditionAttr conditionAttr, Class targetClass) { - DataSeriesCondition attr = conditionAttr.getExisted(targetClass); - if (attr != null){ - conditionAttr.remove(targetClass); - } - } - - /** - * 获取各图表类型界面ID, 本质是plotID - * - * @return 图表类型界面ID - */ - @Override - protected String getPlotTypeID() { - return VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID; - } - - protected Plot getSelectedClonedPlot(){ - VanChartBubblePlot newPlot = null; - Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes; - for(int i = 0, len = bubbleChart.length; i < len; i++){ - if(typeDemo.get(i).isPressing){ - newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot(); - } - } - - Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In BubbleChart"); - } - return cloned; - } - - public Chart getDefaultChart() { - return BubbleIndependentVanChart.BubbleVanChartTypes[0]; - } - - @Override - /** - * 力學氣泡圖切換到其他氣泡圖時,刪除條件屬性 - * 并且将bubbleAttr属性重置 - */ - protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ - cloneOldDefaultAttrConditionCollection(oldPlot, newPlot); - } - - @Override - protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ - if (oldPlot.getConditionCollection() != null) { - ConditionCollection newCondition = new ConditionCollection(); - newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone()); - newPlot.setConditionCollection(newCondition); - - ConditionAttr attrList = newCondition.getDefaultAttr(); - - //根据气泡图类型,重设透明度属性 - removeDefaultAttr(attrList, AttrAlpha.class); - - //删除标签属性(防止切换到大数据气泡图标签属性会拷贝过去) - removeDefaultAttr(attrList, ScatterAttrLabel.class); - - AttrAlpha attrAlpha = new AttrAlpha(); - attrAlpha.setAlpha(((VanChartBubblePlot)newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA); - - attrList.addDataSeriesCondition(attrAlpha); - } - } - - @Override - protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException { - if(oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot){ - if(((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()){ - super.cloneHotHyperLink(oldPlot, newPlot); - } - } - } - - @Override - protected VanChartTools createVanChartTools() { - VanChartTools tools = new VanChartTools(); - tools.setSort(false); - return tools; - } - - /** - * 气泡图相同图表类型之间切换的时候,chart的部分属性也需要重置 - * @param chart - */ - @Override - protected void resetChartAttr4SamePlot(Chart chart){ - VanChartZoom vanChartZoom = new VanChartZoom(); - ((VanChart)chart).setVanChartZoom(vanChartZoom); - //重置监控刷新选项 - resetRefreshMoreLabelAttr((VanChart)chart); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java deleted file mode 100644 index d66ea04c5b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.general.Inter; -import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; -import com.fr.plugin.chart.bubble.component.VanChartBubblePane; -import com.fr.plugin.chart.custom.component.VanChartCustomAxisConditionPane; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; -import com.fr.plugin.chart.designer.style.series.VanChartStackedAndAxisListControlPane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane { - private static final long serialVersionUID = 5595016643808487932L; - private VanChartBubblePane bubblePane; - - public VanChartBubbleSeriesPane(ChartStylePane parent, Plot plot) { - super(parent, plot); - } - - protected JPanel getContentInPlotType() { - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p, p, p, p, p, p}; - double[] col = {f}; - - Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, - new Component[]{createBubblePane()}, - new Component[]{createStackedAndAxisPane()}, - new Component[]{null} - }; - - if (!((VanChartBubblePlot)plot).isForceBubble()) { - components[3] = new Component[]{createLargeDataModelPane()}; - } - - contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - return contentPane; - } - - //设置色彩面板内容 - @Override - protected void setColorPaneContent (JPanel panel) { - panel.add(createAlphaPane(), BorderLayout.CENTER); - } - - @Override - //堆积和坐标轴设置(自定义柱形图等用到) - protected JPanel createStackedAndAxisPane() { - stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(){ - @Override - protected Class getStackAndAxisPaneClass() { - return VanChartCustomAxisConditionPane.class; - } - - @Override - public String getPaneTitle(){ - return Inter.getLocText("Plugin-ChartF_Custom_Axis"); - } - }; - stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); - return stackAndAxisEditExpandablePane; - } - - private JPanel createBubblePane() { - bubblePane = new VanChartBubblePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Bubble"), bubblePane); - } - - protected void populateCondition(ConditionAttr defaultAttr){ - super.populateCondition(defaultAttr); - if(bubblePane != null) { - VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); - bubblePane.populateBean(attrBubble); - } - } - - protected void updateCondition(ConditionAttr defaultAttr){ - super.updateCondition(defaultAttr); - if(bubblePane != null){ - VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); - if (attrBubble != null) { - defaultAttr.remove(attrBubble); - } - defaultAttr.addDataSeriesCondition(bubblePane.updateBean()); - } - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java deleted file mode 100644 index e3e76be69b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.fr.plugin.chart.bubble; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; -import com.fr.plugin.chart.bubble.force.VanChartForceBubbleAreaPane; -import com.fr.plugin.chart.bubble.force.VanChartForceBubbleLabelPane; -import com.fr.plugin.chart.bubble.force.VanChartForceBubbleTooltipPane; -import com.fr.plugin.chart.designer.style.background.VanChartAreaPane; -import com.fr.plugin.chart.scatter.component.VanChartScatterStylePane; - -import java.util.List; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartBubbleStylePane extends VanChartScatterStylePane { - - public VanChartBubbleStylePane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected void createVanChartLabelPane(List paneList) { - Plot plot = getChart().getPlot(); - - if(((VanChartBubblePlot) plot).isForceBubble()){ - paneList.add(new VanChartForceBubbleLabelPane(VanChartBubbleStylePane.this)); - } else { - super.createVanChartLabelPane(paneList); - } - } - - protected void addVanChartTooltipPane(List paneList){ - Plot plot = getChart().getPlot(); - if(((VanChartBubblePlot) plot).isForceBubble()){ - paneList.add(new VanChartForceBubbleTooltipPane(VanChartBubbleStylePane.this)); - } else { - super.addVanChartTooltipPane(paneList); - } - } - - @Override - protected void addVanChartAreaPane(List paneList) { - if (((VanChartBubblePlot)getChart().getPlot()).isForceBubble()){ - paneList.add(new VanChartForceBubbleAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this)); - }else { - paneList.add(new VanChartAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this)); - } - } - - @Override - protected ChartSeriesPane createChartSeriesPane() { - return new ChartSeriesPane(VanChartBubbleStylePane.this); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java b/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java deleted file mode 100644 index 8d6d50d29b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.fr.plugin.chart.bubble.component; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 16/3/31. - * 气泡大小等设置界面 - */ -public class VanChartBubblePane extends BasicBeanPane { - private UISpinner minDiameter; - private UISpinner maxDiameter; - private UIButtonGroup shadow; - private UIButtonGroup displayNegative; - - public VanChartBubblePane(){ - minDiameter = new UISpinner(0,Double.MAX_VALUE,1,0); - maxDiameter = new UISpinner(0,Double.MAX_VALUE,1,0); - shadow = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), - Inter.getLocText("Plugin-ChartF_Close")}); - displayNegative = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), - Inter.getLocText("Plugin-ChartF_Close")}); - - - - this.setLayout(new BorderLayout()); - this.add(getContentPane(), BorderLayout.CENTER); - } - - protected JPanel getContentPane () { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p, p, p, p, p}; - double[] col = {p, f}; - - return TableLayoutHelper.createTableLayoutPane(getComponent(), row, col); - } - - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MinDiameter")), minDiameter}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MaxDiameter")), maxDiameter}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DisplayNegative")), displayNegative}, - - }; - } - - public void populateBean(VanChartAttrBubble bubble) { - if(bubble == null){ - bubble = new VanChartAttrBubble(); - } - minDiameter.setValue(bubble.getMinDiameter()); - maxDiameter.setValue(bubble.getMaxDiameter()); - shadow.setSelectedIndex(bubble.isShadow() ? 0 : 1); - displayNegative.setSelectedIndex(bubble.isDisplayNegative() ? 0 : 1); - } - - public VanChartAttrBubble updateBean() { - VanChartAttrBubble bubble = new VanChartAttrBubble(); - bubble.setMinDiameter(minDiameter.getValue()); - bubble.setMaxDiameter(maxDiameter.getValue()); - bubble.setShadow(shadow.getSelectedIndex() == 0); - bubble.setDisplayNegative(displayNegative.getSelectedIndex() == 0); - return bubble; - } - - @Override - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_Bubble"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java deleted file mode 100644 index 8c2607a02e..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.fr.plugin.chart.bubble.data; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.base.ChartConstants; -import com.fr.chart.chartattr.BubblePlot; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartdata.BubbleTableDefinition; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.general.ComparatorUtils; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; -import java.util.List; - -public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane { - - private static final Dimension PREFERRED_SIZE = new Dimension(100, 20); - protected UIComboBox seriesName; - protected UIComboBox xCombox; - protected UIComboBox yCombox; - protected UIComboBox bubbleSize; - - private ChartDataFilterPane dataScreeningPane; - - public VanChartBubblePlotTableDataContentPane(ChartDataPane parent) { - seriesName = new UIComboBox(); - xCombox = new UIComboBox(); - yCombox = new UIComboBox(); - - dataScreeningPane = new ChartDataFilterPane(new BubblePlot(), parent); - - seriesName.setPreferredSize(PREFERRED_SIZE); - xCombox.setPreferredSize(PREFERRED_SIZE); - yCombox.setPreferredSize(PREFERRED_SIZE); - - seriesName.addItem(Inter.getLocText("Chart-Use_None")); - - initBubbleSize(); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double[] columnSize_north = {f, COMPONENT_WIDTH}; - double[] rowSize_north = {p, p, p, p}; - - Component[][] components_north = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesName}, - new Component[]{new UILabel("x" ), xCombox}, - new Component[]{new UILabel("y"), yCombox}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, - }; - - JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north); - north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); - JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); - filterPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); - - - this.setLayout(new BorderLayout()); - this.add(getJSeparator(), BorderLayout.NORTH); - this.add(north, BorderLayout.CENTER); - this.add(filterPane, BorderLayout.SOUTH); - - seriesName.addItemListener(tooltipListener); - xCombox.addItemListener(tooltipListener); - yCombox.addItemListener(tooltipListener); - bubbleSize.addItemListener(tooltipListener); - } - - protected void initBubbleSize() { - bubbleSize = new UIComboBox(); - bubbleSize.setPreferredSize(new Dimension(100, 20)); - } - - /** - * 检查box是否使用, donothing - * @param hasUse 是否使用. - */ - public void checkBoxUse(boolean hasUse) { - - } - - protected void refreshBoxListWithSelectTableData(List list) { - refreshBoxItems(seriesName, list); - seriesName.addItem(Inter.getLocText("Chart-Use_None")); - refreshBoxItems(xCombox, list); - refreshBoxItems(yCombox, list); - refreshBoxItems(bubbleSize, list); - } - - /** - * 清空所有的box设置 - */ - public void clearAllBoxList(){ - clearBoxItems(seriesName); - seriesName.addItem(Inter.getLocText("Chart-Use_None")); - clearBoxItems(xCombox); - clearBoxItems(yCombox); - clearBoxItems(bubbleSize); - } - - @Override - public void populateBean(ChartCollection collection) { - super.populateBean(collection); - TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); - if (!(top instanceof BubbleTableDefinition)) { - return; - } - BubbleTableDefinition definition = (BubbleTableDefinition) top; - - if(definition.getSeriesName() == null || ComparatorUtils.equals(StringUtils.EMPTY, definition.getSeriesName())) { - seriesName.setSelectedItem(Inter.getLocText("Chart-Use_None")); - } else { - combineCustomEditValue(seriesName, definition.getSeriesName()); - } - - combineCustomEditValue(xCombox, definition.getBubbleX()); - combineCustomEditValue(yCombox, definition.getBubbleY()); - //气泡图不配置“无” - populateBubbleSize(definition); - - dataScreeningPane.populateBean(collection); - } - - protected void populateBubbleSize(BubbleTableDefinition definition) { - if (ComparatorUtils.equals(definition.getBubbleSize(), Inter.getLocText("Chart-Use_None"))){ - combineCustomEditValue(bubbleSize, StringUtils.EMPTY); - }else { - combineCustomEditValue(bubbleSize, definition.getBubbleSize()); - } - } - - @Override - public void updateBean(ChartCollection collection) { - BubbleTableDefinition definition = new BubbleTableDefinition(); - collection.getSelectedChart().setFilterDefinition(definition); - - Object resultName = seriesName.getSelectedItem(); - Object resultX = xCombox.getSelectedItem(); - Object resultY = yCombox.getSelectedItem(); - Object resultSize = bubbleSize.getSelectedItem(); - - if(resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) { - definition.setSeriesName(StringUtils.EMPTY); - } else { - definition.setSeriesName(resultName.toString()); - } - - if (resultX != null) { - definition.setBubbleX(resultX.toString()); - } - if (resultY != null) { - definition.setBubbleY(resultY.toString()); - } - if (resultSize != null) { - definition.setBubbleSize(resultSize.toString()); - } - - dataScreeningPane.updateBean(collection); - } - - /** - * 重新布局 - */ - public void redoLayoutPane(){ - dataScreeningPane.relayoutPane(this.isNeedSummaryCaculateMethod()); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java deleted file mode 100644 index 5db33768ce..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.plugin.chart.bubble.force; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane; -import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; -import com.fr.plugin.chart.scatter.VanChartScatterRefreshTooltipContentPane; - -/** - * Created by mengao on 2017/6/12. - */ -public class VanChartBubbleRefreshTooltipPane extends VanChartPlotRefreshTooltipPane { - - public VanChartBubbleRefreshTooltipPane(Plot plot) { - super(plot); - } - - @Override - protected VanChartTooltipContentPane getTooltipContentPane(Plot plot){ - if (((VanChartBubblePlot)plot).isForceBubble()) { - return new VanChartRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this); - } else { - return new VanChartScatterRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this); - } - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java deleted file mode 100644 index 39e0b57deb..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.bubble.force; - -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.plugin.chart.designer.style.background.VanChartAreaBackgroundPane; - -import java.awt.*; - -//图表区|绘图区 边框和背景 -public class VanChartForceBubbleAreaBackgroundPane extends VanChartAreaBackgroundPane { - - - public VanChartForceBubbleAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) { - super(isPlot, parent); - } - - @Override - protected Component[][] initComponents() { - return new Component[][]{ - new Component[]{chartBorderPane}, - new Component[]{chartBackgroundPane}, - }; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java deleted file mode 100644 index 1e5c780f7e..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.plugin.chart.bubble.force; - -import com.fr.chart.chartattr.Plot; - -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; - - -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import com.fr.plugin.chart.designer.style.background.VanChartAreaPane; - - -/** - * 属性表, 图表样式-背景界面. - */ -public class VanChartForceBubbleAreaPane extends VanChartAreaPane { - - public VanChartForceBubbleAreaPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - @Override - protected void initPlotPane(boolean b, AbstractAttrNoScrollPane parent) { - plotPane = new VanChartForceBubbleAreaBackgroundPane(true, parent); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java deleted file mode 100644 index 4886c9f1dd..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.plugin.chart.bubble.force; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.label.VanChartLabelPane; -import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartForceBubbleLabelPane extends VanChartLabelPane { - public VanChartForceBubbleLabelPane(VanChartStylePane parent) { - super(parent); - } - - protected VanChartPlotLabelPane getLabelPane(Plot plot) { - return new VanChartPlotLabelPane(plot, parent); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java deleted file mode 100644 index 67f1412aa6..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.plugin.chart.bubble.force; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartTooltipPane; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartForceBubbleTooltipPane extends VanChartTooltipPane { - public VanChartForceBubbleTooltipPane(VanChartStylePane parent) { - super(parent); - } - protected VanChartPlotTooltipPane getTooltipPane(Plot plot) { - return new VanChartPlotTooltipPane(plot, parent); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java b/designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java deleted file mode 100644 index a955618fba..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.design.chart.comp.BorderAttriPane; -import com.fr.design.gui.icombobox.LineComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.style.color.ColorSelectBox; -import com.fr.general.Inter; -import com.fr.stable.Constants; -import com.fr.stable.CoreConstants; - -import java.awt.*; - -/** - * Created by hufan on 2016/8/11. - */ -public class ColumnBorderAttriPane extends BorderAttriPane { - private UISpinner radius; - - public ColumnBorderAttriPane() { - this(Inter.getLocText("plugin-ChartF_Radius")); - } - - public ColumnBorderAttriPane(String radiusString) { - this.add(new UILabel(radiusString + ":")); - radius = new UISpinner(0,1000,1,0); - this.add(radius); - radius.setPreferredSize(new Dimension(60, 18)); - } - - public void setRadius(int value) { - this.radius.setValue(value); - } - - public double getRadius() { - return this.radius.getValue(); - } - - @Override - protected String title4PopupWindow() { - return "Border"; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java b/designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java deleted file mode 100644 index 04aaa070f4..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI; - -/** - * Created by Mitisky on 15/9/24. - */ -public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { - @Override - public String getIconPath() { - return "com/fr/design/images/form/toolbar/column.png"; - } - - @Override - public AbstractChartTypePane getPlotTypePane() { - return new VanChartColumnPlotPane(); - } - - - public ConditionAttributesPane getPlotConditionPane(Plot plot){ - return new VanChartColumnConditionPane(plot); - } - - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ - return new VanChartColumnSeriesPane(parent, plot); - } - - public String getPlotTypeTitle4PopupWindow(){ - return VanChartColumnPlotPane.TITLE; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java deleted file mode 100644 index 86421dd6b0..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.chart.base.AttrAlpha; -import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.AttrBorder; -import com.fr.chart.base.ChartConstants; -import com.fr.chart.chartattr.Plot; -import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; -import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; -import com.fr.plugin.chart.attr.EffectHelper; -import com.fr.plugin.chart.base.AttrDataSheet; -import com.fr.plugin.chart.base.AttrEffect; -import com.fr.plugin.chart.base.AttrFloatColor; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.plugin.chart.base.AttrSeriesImageBackground; -import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.base.VanChartAttrTrendLine; -import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartFloatColorConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesImageBackgroundConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane; -import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane; -import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint; - -import java.awt.*; - -/** - * Created by Mitisky on 15/9/28. - */ -public class VanChartColumnConditionPane extends DataSeriesConditionPane{ - private static final long serialVersionUID = -7180705321732069806L; - - public VanChartColumnConditionPane(Plot plot) { - super(plot); - } - - protected void initComponents() { - super.initComponents(); - //添加全部条件属性后被遮挡 - liteConditionPane.setPreferredSize(new Dimension(300, 400)); - } - - @Override - protected void addBasicAction() { - classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); - classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); - classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this)); - classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); - classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); - classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); - classPaneMap.put(AttrSeriesImageBackground.class, new VanChartSeriesImageBackgroundConditionPane(this)); - classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getColumnPlotDefaultEffect())); - classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); - //是否使用数据表 - //自定义柱形图设置多X坐标轴时,不支持数据表 - if (plot.getDataSheet().isVisible() && ((VanChartColumnPlot) plot).getXAxisList().size() == 1) { - classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot)); - } - } - - protected void addStyleAction() { - - } - - @Override - protected ChartConditionPane createListConditionPane() { - return new ChartConditionPane(){ - @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE, - VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, - }; - } - }; - } - - /** - * 返回图表class对象 - * @return class对象 - */ - public Class class4Correspond() { - return VanChartColumnPlot.class; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java deleted file mode 100644 index 6dc0f3ccd1..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.fr.plugin.chart.column; -import com.fr.chart.base.AttrBorder; -import com.fr.chart.base.DataSeriesCondition; -import com.fr.design.chart.comp.BorderAttriPane; -import com.fr.design.chart.series.SeriesCondition.LabelBorderPane; -import com.fr.design.condition.ConditionAttributesPane; - -/** - * Created by hufan on 2016/8/11. - */ -public class VanChartColumnLabelBorderPane extends LabelBorderPane { - public VanChartColumnLabelBorderPane(ConditionAttributesPane conditionAttributesPane) { - super(conditionAttributesPane); - } - - @Override - protected BorderAttriPane initBorderAttrPane(){ - return new ColumnBorderAttriPane(); - } - - public void populate(DataSeriesCondition condition) { - super.populate(condition); - if (condition instanceof AttrBorder) { - ((ColumnBorderAttriPane)linePane).setRadius(attrBorder.getRoundRadius()); - } - } - - public DataSeriesCondition update() { - super.update(); - attrBorder.setRoundRadius((int) ((ColumnBorderAttriPane)linePane).getRadius()); - attrBorder.setRoundBorder(true); - return attrBorder; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java deleted file mode 100644 index 8568d67a55..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; - -/** - * Created by Mitisky on 15/9/24. - */ -public class VanChartColumnPlotPane extends AbstractVanChartTypePane { - public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewColumn"); - - private static final long serialVersionUID = 5950923001789733745L; - - - @Override - protected String[] getTypeIconPath() { - return new String[]{"/com/fr/plugin/chart/column/images/column.png", - "/com/fr/plugin/chart/column/images/stack.png", - "/com/fr/plugin/chart/column/images/percentstack.png", - "/com/fr/plugin/chart/column/images/custom.png", - }; - } - - @Override - protected String[] getTypeTipName() { - String column = Inter.getLocText("FR-Chart-Type_Column"); - String stack = Inter.getLocText("FR-Chart-Type_Stacked"); - String percent = Inter.getLocText("FR-Chart-Use_Percent"); - return new String[]{ - column, - stack + column, - percent + stack + column, - Inter.getLocText("FR-Chart-Mode_Custom") - }; - } - - /** - * 返回界面标题 - * @return 界面标题 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_NewColumn"); - } - - - /** - * 获取各图表类型界面ID, 本质是plotID - * - * @return 图表类型界面ID - */ - @Override - protected String getPlotTypeID() { - return VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID; - } - - protected Plot getSelectedClonedPlot(){ - VanChartColumnPlot newPlot = null; - Chart[] columnChart = ColumnIndependentVanChart.ColumnVanChartTypes; - for(int i = 0, len = columnChart.length; i < len; i++){ - if(typeDemo.get(i).isPressing){ - newPlot = (VanChartColumnPlot)columnChart[i].getPlot(); - } - } - - Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); - } - return cloned; - } - - public Chart getDefaultChart() { - return ColumnIndependentVanChart.ColumnVanChartTypes[0]; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java deleted file mode 100644 index c04711274f..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.base.background.ImageBackground; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.gui.frpane.UINumberDragPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.AttrSeriesImageBackground; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.border.VanChartBorderPane; -import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane; -import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; -import com.fr.stable.Constants; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * 新条形图系列界面 - */ -public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { - - private static final long serialVersionUID = -8875943419420081420L; - private UIButtonGroup isFixedWidth;//是否固定宽度 - private UISpinner columnWidth;//宽度 - - private UINumberDragPane categoryGap;//分类间隔 - private UINumberDragPane seriesGap;//系列间隔 - private UIButtonGroup isFillWithImage;//是否使用图片填充 - private ImageBackgroundQuickPane imagePane;//填充图片选择界面 - - public VanChartColumnSeriesPane(ChartStylePane parent, Plot plot) { - super(parent, plot); - } - - protected JPanel getContentInPlotType() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; - Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, - new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{f,e})}, - new Component[]{createBorderPane()}, - new Component[]{createStackedAndAxisPane()}, - new Component[]{createTrendLinePane()}, - }; - - contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - - return contentPane; - } - - //边框(有圆角) - protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderWithRadiusPane(); - } - - private JPanel createSeriesStylePane(double[] row, double[] col) { - isFixedWidth = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")}); - columnWidth = new UISpinner(0,1000,1,0); - columnWidth.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); - seriesGap = new UINumberDragPane(-100, 100); - categoryGap = new UINumberDragPane(0, 100); - isFillWithImage = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")}); - imagePane = new ImageBackgroundQuickPane(false); - imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); - - JPanel panel1 = new JPanel(new BorderLayout()); - JPanel isFixedWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Fixed_Column_Width"),isFixedWidth); - isFixedWidthPane.setBorder(BorderFactory.createEmptyBorder(0,0,6,0)); - panel1.add(isFixedWidthPane, BorderLayout.NORTH); - panel1.add(columnWidth, BorderLayout.CENTER); - - Component[][] components2 = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Series")),seriesGap}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Category")),categoryGap}, - }; - JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, row, col); - - Component[][] components3 = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Filled_With_Image")),isFillWithImage}, - }; - JPanel panel3 = TableLayout4VanChartHelper.createGapTableLayoutPane(components3, row, col); - - JPanel panel = new JPanel(new BorderLayout(0, 4)); - panel.add(panel1, BorderLayout.NORTH); - panel.add(panel2, BorderLayout.CENTER); - panel.add(panel3, BorderLayout.SOUTH); - - JPanel borderPane = new JPanel(new BorderLayout()); - borderPane.add(panel, BorderLayout.NORTH); - borderPane.add(imagePane, BorderLayout.CENTER); - isFixedWidth.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkColumnWidth(); - } - }); - isFillWithImage.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkImagePane(); - } - }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), borderPane); - } - - private void checkAll() { - checkColumnWidth(); - checkImagePane(); - } - - private void checkColumnWidth() { - boolean b = isFixedWidth.getSelectedIndex() == 0; - columnWidth.setVisible(b); - seriesGap.setEnabled(!b); - } - - private void checkImagePane() { - imagePane.setVisible(isFillWithImage.getSelectedIndex() == 0); - } - - public void populateBean(Plot plot) { - if(plot == null) { - return; - } - super.populateBean(plot); - - if(plot instanceof VanChartColumnPlot){ - VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot; - - isFixedWidth.setSelectedIndex(columnPlot4VanChart.isFixedWidth() ? 0 : 1); - columnWidth.setValue(columnPlot4VanChart.getColumnWidth()); - categoryGap.populateBean(columnPlot4VanChart.getCategoryIntervalPercent()); - seriesGap.populateBean(columnPlot4VanChart.getSeriesOverlapPercent()); - isFillWithImage.setSelectedIndex(columnPlot4VanChart.isFilledWithImage() ? 0 : 1); - ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); - - if(columnPlot4VanChart.isFilledWithImage()){ - AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class); - if(attrSeriesImageBackground != null){ - imagePane.populateBean(attrSeriesImageBackground.getSeriesBackground()); - } - } - } - checkAll(); - } - - public void updateBean(Plot plot) { - if(plot == null) { - return; - } - super.updateBean(plot); - - if(plot instanceof VanChartColumnPlot){ - VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot; - - columnPlot4VanChart.setFixedWidth(isFixedWidth.getSelectedIndex() == 0); - columnPlot4VanChart.setColumnWidth((int)columnWidth.getValue()); - columnPlot4VanChart.setCategoryIntervalPercent(categoryGap.updateBean()); - columnPlot4VanChart.setSeriesOverlapPercent(seriesGap.updateBean()); - columnPlot4VanChart.setFilledWithImage(isFillWithImage.getSelectedIndex() == 0); - ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); - if(isFillWithImage.getSelectedIndex() == 0){ - AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class); - if(attrSeriesImageBackground == null){ - attrSeriesImageBackground = new AttrSeriesImageBackground(); - defaultAttr.addDataSeriesCondition(attrSeriesImageBackground); - } - attrSeriesImageBackground.setSeriesBackground(imagePane.updateBean()); - //设置背景图片平铺方式 - ImageBackground imageBackground = (ImageBackground) attrSeriesImageBackground.getSeriesBackground(); - if (imageBackground != null){ - imageBackground.setLayout(Constants.IMAGE_TILED); - } - - } else { - AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class); - if(attrSeriesImageBackground != null){ - defaultAttr.remove(attrSeriesImageBackground); - } - } - } - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java deleted file mode 100644 index 708d4f4a33..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.fr.plugin.chart.column; - -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.data.condition.AbstractCondition; -import com.fr.data.condition.ListCondition; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.LiteConditionPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; -import com.fr.plugin.chart.designer.style.series.VanChartSeriesConditionPane; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * 堆积和坐标轴设置 - */ -public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane { - private static final long serialVersionUID = 2713124322060048526L; - - protected UIButtonGroup XAxis; - protected UIButtonGroup YAxis; - protected UIButtonGroup isStacked; - protected UIButtonGroup isPercentStacked; - - private LiteConditionPane liteConditionPane; - - public VanChartCustomStackAndAxisConditionPane() { - - } - - private void doLayoutPane() { - this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - this.removeAll(); - - //配置界面 - JPanel deployPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - this.add(deployPane); - - deployPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_Deploy") + ":", null)); - deployPane.add(createDeployPane()); - - //条件界面 - JPanel conditionPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - this.add(conditionPane); - conditionPane.setBorder(BorderFactory.createEmptyBorder()); - - conditionPane.add(liteConditionPane = new VanChartSeriesConditionPane()); - liteConditionPane.setPreferredSize(new Dimension(300, 300)); - } - - private JPanel createDeployPane() { - isStacked = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")}); - isPercentStacked = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")}); - double p = TableLayout.PREFERRED; - double[] columnSize = {p, p}; - double[] rowSize = {p, p, p, p}; - - return TableLayoutHelper.createTableLayoutPane(getDeployComponents(), rowSize, columnSize); - } - - protected Component[][] getDeployComponents() { - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("ChartF-X_Axis")), XAxis}, - new Component[]{new UILabel(Inter.getLocText("ChartF-Y_Axis")), YAxis}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Type_Stacked")), isStacked}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_PercentStacked")), isPercentStacked}, - }; - - isStacked.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkBox(); - } - }); - return components; - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_StackAndSeries"); - } - - private void checkBox() { - isPercentStacked.setEnabled(isStacked.getSelectedIndex() == 0); - } - - public void populateBean(ConditionAttr conditionAttr) { - AttrSeriesStackAndAxis seriesStackAndAxis = (AttrSeriesStackAndAxis) conditionAttr.getExisted(AttrSeriesStackAndAxis.class); - XAxis = new UIButtonGroup(seriesStackAndAxis.getXAxisNamesArray()); - YAxis = new UIButtonGroup(seriesStackAndAxis.getYAxisNameArray()); - - doLayoutPane(); - XAxis.setSelectedIndex(seriesStackAndAxis.getXAxisIndex()); - YAxis.setSelectedIndex(seriesStackAndAxis.getYAxisIndex()); - isStacked.setSelectedIndex(seriesStackAndAxis.isStacked() ? 0 : 1); - isPercentStacked.setSelectedIndex(seriesStackAndAxis.isPercentStacked() ? 0 : 1); - - if (conditionAttr.getCondition() == null) { - this.liteConditionPane.populateBean(new ListCondition()); - } else { - this.liteConditionPane.populateBean(conditionAttr.getCondition()); - } - - checkBox(); - } - - protected void updateStackAndPercent(AttrSeriesStackAndAxis seriesStackAndAxis) { - seriesStackAndAxis.setStacked(isStacked.getSelectedIndex() == 0); - if (seriesStackAndAxis.isStacked()) { - seriesStackAndAxis.setPercentStacked(isPercentStacked.getSelectedIndex() == 0); - } else { - seriesStackAndAxis.setPercentStacked(false); - } - } - - public ConditionAttr updateBean() { - ConditionAttr conditionAttr = new ConditionAttr(); - AttrSeriesStackAndAxis seriesStackAndAxis = new AttrSeriesStackAndAxis(); - seriesStackAndAxis.setXAxisIndex(XAxis.getSelectedIndex()); - seriesStackAndAxis.setYAxisIndex(YAxis.getSelectedIndex()); - - updateStackAndPercent(seriesStackAndAxis); - conditionAttr.addDataSeriesCondition(seriesStackAndAxis); - - AbstractCondition con = (AbstractCondition) this.liteConditionPane.updateBean(); - conditionAttr.setCondition(con); - return conditionAttr; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java b/designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java deleted file mode 100644 index 473cdbce92..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.fr.plugin.chart.custom; - -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.AbstractChartAttrPane; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.custom.other.VanChartCustomOtherPane; -import com.fr.plugin.chart.custom.style.VanChartCustomStylePane; -import com.fr.plugin.chart.designer.other.VanChartOtherPane; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI; - -/** - * Created by Mitisky on 16/2/16. - */ -public class CustomIndependentVanChartInterface extends AbstractIndependentVanChartUI { - /** - * 图表的类型定义界面类型,就是属性表的第一个界面 - * - * @return 图表的类型定义界面类型 - */ - @Override - public AbstractChartTypePane getPlotTypePane() { - return new VanChartCustomPlotPane(); - } - - /** - * 图标路径 - * - * @return 图标路径 - */ - @Override - public String getIconPath() { - return "com/fr/design/images/form/toolbar/custom.png"; - } - - - @Override - /** - * 图表的属性界面数组 - * @return 属性界面 - */ - public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ - VanChartStylePane stylePane = new VanChartCustomStylePane(listener); - VanChartOtherPane otherPane = new VanChartCustomOtherPane(); - return new AbstractChartAttrPane[]{stylePane, otherPane}; - } - - public ChartDataPane getChartDataPane(AttributeChangeListener listener){ - return new VanChartCustomDataPane(listener); - } - - public String getPlotTypeTitle4PopupWindow(){ - return VanChartCustomPlotPane.TITLE; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java b/designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java deleted file mode 100644 index 341149b4e4..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.fr.plugin.chart.custom; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane; -import com.fr.general.FRLogger; -import com.fr.plugin.chart.PiePlot4VanChart; -import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane; -import com.fr.plugin.chart.custom.component.CustomPlotLocationPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane; -import com.fr.plugin.chart.designer.style.axis.gauge.VanChartGaugeAxisPane; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; -import com.fr.plugin.chart.radar.VanChartRadarPlot; -import com.fr.plugin.chart.scatter.VanChartScatterPlot; -import com.fr.plugin.chart.scatter.data.VanChartScatterPlotTableDataContentPane; - -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by Mitisky on 16/6/23. - */ -public class CustomPlotDesignerPaneFactory { - - //图表类型对应数据配置界面 - private static Map, Class> plotTableDataContentPaneMap = new HashMap, Class>(); - - - - - //图表类型对应的位置面板 - private static Map, Class>> plotPositionMap = new HashMap, Class>>(); - - static { - plotPositionMap.put(PiePlot4VanChart.class, CustomPlotLocationPane.class); - plotPositionMap.put(VanChartRadarPlot.class, CustomPlotLocationPane.class); - plotPositionMap.put(VanChartGaugePlot.class, CustomPlotLocationPane.class); - } - - /** - * 根据图表类型创建位置面板 - * @param plot 图表 - * @return 位置面板 - */ - public static BasicBeanPane createCustomPlotPositionPane(Plot plot) { - Class key = plot.getClass(); - if(plotPositionMap.containsKey(key)){ - try{ - Class> cl = plotPositionMap.get(key); - Constructor > constructor = cl.getConstructor(); - return constructor.newInstance(); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return null; - } - - - /** - * 每种类型对应的数据配置界面 - * @return - */ - static { - plotTableDataContentPaneMap.put(VanChartScatterPlot.class, VanChartScatterPlotTableDataContentPane.class); - plotTableDataContentPaneMap.put(VanChartBubblePlot.class, VanChartBubblePlotTableDataContentPane.class); - } - - /** - * 根据图表类型创建数据配置 - * @param plot 图表 - * @param parent - * @return 数据配置界面 - */ - public static AbstractTableDataContentPane createCustomPlotTableDataContentPane(Plot plot, ChartDataPane parent) { - Class key = plot.getClass(); - if(plotTableDataContentPaneMap.containsKey(key)){ - try{ - Class cl = plotTableDataContentPaneMap.get(key); - Constructor constructor = cl.getConstructor(ChartDataPane.class); - return constructor.newInstance(parent); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new CategoryPlotTableDataContentPane(parent); - } - - - /** - * plotType是否需要建立新的坐标系面板 - */ - private static Map> diffAxisMap = new HashMap>(); - static { - diffAxisMap.put(CustomPlotType.POINTER_360, VanChartGaugeAxisPane.class); - diffAxisMap.put(CustomPlotType.POINTER_180, VanChartGaugeAxisPane.class); - diffAxisMap.put(CustomPlotType.RING, VanChartGaugeAxisPane.class); - diffAxisMap.put(CustomPlotType.SLOT, VanChartGaugeAxisPane.class); - diffAxisMap.put(CustomPlotType.CUVETTE, VanChartGaugeAxisPane.class); - diffAxisMap.put(CustomPlotType.RADAR, null);//默认的为null,直接new,不用反射 - diffAxisMap.put(CustomPlotType.STACK_RADAR, null); - } - - public static Boolean isUseDiffAxisPane(VanChartPlot plot){ - CustomPlotType customPlotType = CustomPlotFactory.getCustomType(plot); - return diffAxisMap.containsKey(customPlotType); - } - - public static VanChartAxisPane createAxisPane(VanChartAxisPlot plot, VanChartStylePane parent) { - CustomPlotType key = CustomPlotFactory.getCustomType((VanChartPlot)plot); - if(diffAxisMap.containsKey(key)){ - try{ - Class cl = diffAxisMap.get(key); - if(cl != null) { - Constructor constructor = cl.getConstructor(VanChartAxisPlot.class, VanChartStylePane.class); - return constructor.newInstance(plot, parent); - } - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartAxisPane(plot,parent); - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomDataPane.java b/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomDataPane.java deleted file mode 100644 index 73a95537a3..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomDataPane.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.fr.plugin.chart.custom; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/29. - */ -public class VanChartCustomDataPane extends ChartDataPane { - private VanChartCustomPlotDataContentsTabPane contentsTabPane; - private Chart chart; - public VanChartCustomDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected JPanel createContentPane() { - JPanel content = new JPanel(new BorderLayout()); - if (chart == null) { - return content; - } - - contentsTabPane = new VanChartCustomPlotDataContentsTabPane((VanChartCustomPlot)chart.getPlot(), VanChartCustomDataPane.this, listener); - - content.add(contentsTabPane, BorderLayout.CENTER); - return content; - - - } - - public void populate(ChartCollection collection) { - this.chart = collection.getSelectedChart(); - this.remove(leftContentPane); - initContentPane(); - this.removeAttributeChangeListener(); - contentsTabPane.populateBean(collection); - this.addAttributeChangeListener(listener); - this.initAllListeners(); - - } - - @Override - /** - * 返回绑定的属性事件. - * @param listener 增加监听 - */ - public void addAttributeChangeListener(AttributeChangeListener listener) { - super.addAttributeChangeListener(listener); - contentsTabPane.addAttributeChangeListener(listener); - } - - @Override - /** - * 保存 数据界面内容 - */ - public void update(ChartCollection collection){ - if(contentsTabPane != null) { - contentsTabPane.updateBean(collection); - } - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotDataContentsTabPane.java deleted file mode 100644 index f3c91a3a71..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.fr.plugin.chart.custom; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.component.VanChartDataPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by Fangjie on 2016/4/29. - */ -public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) { - super(plot, parent, listener); - } - - @Override - protected void initTabTitle() { - - if (plot == null){ - return; - } - - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(i); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - } - } - - @Override - protected List initPaneList() { - - if (plot == null){ - return null; - } - - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plot创建不同的数据配置界面 - ChartDataPane contentPane = new VanChartDataPane(listener); - paneList.add(contentPane); - } - - return paneList; - } - - @Override - public void populateBean(ChartCollection chartCollection){ - - plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot(); - - if (paneList == null){ - paneList = initPaneList(); - } - - if (paneList != null){ - - try { - - List customPlotList = plot.getCustomPlotList(); - - - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) { - //將plot包裝起来,主要是为了获取dataDefinition - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - - //设置collection的plot - cloneCollection.getSelectedChart().setPlot(customPlotList.get(i)); - - //获取definitionMap中的dataDefinition - TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); - TopDefinitionProvider dataDefinition = null; - if (definition != null && definition instanceof CustomDefinition) { - Map definitionProviderMap = ((CustomDefinition)definition).getDefinitionProviderMap(); - dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); - } - cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); - - ((ChartDataPane) paneList.get(i)).populate(cloneCollection); - } - }catch (Exception e){ - return; - } - } - } - - @Override - public ChartCollection updateBean() { - return null; - } - - @Override - public void updateBean(ChartCollection collection){ - if (paneList == null || plot == null){ - return; - } - try { - - Map definitionMap = new HashMap(); - - //已经有的数据配置不允许重置 - - for (int i = 0; i < paneList.size() && i < plot.getCustomPlotList().size(); i++) { - //将plot包裝起来,主要是为了获取dataDefinition - ChartCollection cloneCollection = (ChartCollection) collection.clone(); - - //设置Collection的plot - cloneCollection.getSelectedChart().setPlot(plot.getCustomPlotList().get(i)); - - //重置 - cloneCollection.getSelectedChart().setFilterDefinition(null); - - //更新 - ((ChartDataPane) paneList.get(i)).update(cloneCollection); - - CustomPlotFactory.setCustomCategoryAttr(plot); - - //将处理好的dataDefinition剥离出来并存储 - definitionMap.put(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)), cloneCollection.getSelectedChart().getFilterDefinition()); - - } - - CustomDefinition customDefinition = new CustomDefinition(); - customDefinition.setDefinitionProviderMap(definitionMap); - collection.getSelectedChart().setFilterDefinition(customDefinition); - - }catch (Exception e){ - return; - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } - - /** - * 返回绑定的属性事件. - * @param listener 增加监听 - */ - public void addAttributeChangeListener(AttributeChangeListener listener) { - for (int i = 0; i < paneList.size(); i++){ - ((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener); - } - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java b/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java deleted file mode 100644 index 7b3ede54e5..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java +++ /dev/null @@ -1,294 +0,0 @@ -package com.fr.plugin.chart.custom; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.base.DataSeriesCondition; -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.chart.chartglyph.ConditionCollection; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.type.ChartImagePane; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartAttrLine; -import com.fr.plugin.chart.base.VanChartTools; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotSelectPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.custom.type.CustomStyle; -import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; -import com.fr.plugin.chart.vanchart.VanChart; - -import javax.swing.*; -import java.awt.*; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by Mitisky on 16/2/16. - */ -public class VanChartCustomPlotPane extends AbstractVanChartTypePane { - public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewCustom"); - - //是否选择自定义 - private boolean isCustom = false; - - private static final long serialVersionUID = -3481633368542654247L; - - //切换到自定义组合图时,显示的版面 - private JPanel customPane; - private VanChartCustomPlotSelectPane customSelectPane; - - private JPanel autoPane; - - //自定义和自动版面的容器,cardLayOut布局 - private JPanel contentPane; - - protected Component[][] getPaneComponents(JPanel typePane) { - - initContent(); - - return new Component[][]{ - new Component[]{typePane}, - new Component[]{stylePane}, - new Component[]{contentPane} - }; - } - - - private void initContent() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - autoPane = new JPanel(); - - customSelectPane = new VanChartCustomPlotSelectPane(); - - Component[][] components = new Component[][]{ - new Component[]{new JSeparator()}, - new Component[]{customSelectPane} - }; - - double[] columnSize = {p, f}; - double[] rowSize = {p, p}; - customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - - contentPane = new JPanel(new CardLayout()) { - @Override - public Dimension getPreferredSize() { - if (isCustom) { - return customPane.getPreferredSize(); - } else { - return new Dimension(autoPane.getWidth(), 0); - } - } - }; - contentPane.add(autoPane, "auto"); - contentPane.add(customPane, "custom"); - } - - private void checkCardPane() { - CardLayout cardLayout = (CardLayout) contentPane.getLayout(); - if (isCustom) { - cardLayout.show(contentPane, "custom"); - } else { - cardLayout.show(contentPane, "auto"); - } - } - - - @Override - protected String[] getTypeIconPath() { - return new String[]{"/com/fr/plugin/chart/custom/images/column_line.png", - "/com/fr/plugin/chart/custom/images/column_area.png", - "/com/fr/plugin/chart/custom/images/stack_column_line.png", - "/com/fr/plugin/chart/custom/images/custom.png", - - }; - } - - @Override - protected String[] getTypeTipName() { - return new String[]{ - Inter.getLocText("Plugin-ChartF_NewCustom_ColumnLine"), - Inter.getLocText("Plugin-ChartF_NewCustom_ColumnArea"), - Inter.getLocText("Plugin-ChartF_NewCustom_StackColumnLine"), - Inter.getLocText("Plugin-ChartF_NewCustom_Custom") - }; - } - - @Override - /** - * 返回界面标题 - * @return 界面标题 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_NewCustom"); - } - - - @Override - public void updateBean(Chart chart) { - - //保存上次选中的值,其会在super中更新 - int lastState = chart.getPlot().getDetailType(); - - super.updateBean(chart); - - //如果上次的状态和这次的装填不在同一个页面,说明同一个图表內切换了,需要情況数据配置 - if (lastState != chart.getPlot().getDetailType()) { - chart.setFilterDefinition(null); - } - - Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes; - for (int i = 0, len = customChart.length; i < len; i++) { - if (typeDemo.get(i).isPressing) { - if (i == customChart.length - 1) { - isCustom = true; - - //先重置自定义组合面板,如果不重置,无法获取选择顺序 - if (lastState == customChart.length - 1 && samePlot) { - //更新数据配置,刪除已经不在的图表数据 - dealCustomDefinition(chart); - - customSelectPane.updateBean(chart); - } else if (samePlot) {//如果是同一个图表切换过来,则重置面板 - customSelectPane.populateBean(chart); - } - } - } else { - isCustom = false; - } - } - - checkCardPane(); - - } - - private void dealCustomDefinition(Chart chart) { - CustomDefinition definition = (CustomDefinition) chart.getFilterDefinition(); - - if (definition == null) { - return; - } - - Map definitionMap = definition.getDefinitionProviderMap(); - - if (definitionMap == null) { - return; - } - - Map newDefinitionMap = new HashMap(); - - VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot(); - for (int i = 0; i < customPlot.getCustomPlotList().size(); i++) { - CustomPlotType plotType = CustomPlotFactory.getCustomType(customPlot.getCustomPlotList().get(i)); - TopDefinitionProvider definitionProvider = definitionMap.get(plotType); - - newDefinitionMap.put(plotType, definitionProvider); - } - - definition.setDefinitionProviderMap(newDefinitionMap); - } - - /** - * 不同图表切換,重置chart屬性 - * - * @param chart - * @param newPlot - */ - @Override - protected void resetChartAttr(Chart chart, Plot newPlot) { - super.resetChartAttr(chart, newPlot); - //切换图表清空数据配置 - chart.setFilterDefinition(null); - //设置默认不排序 - VanChartTools tools = ((VanChart) chart).getVanChartTools(); - if (tools != null) { - tools.setSort(false); - } - } - - /** - * 更新界面内容 - */ - public void populateBean(Chart chart) { - for (ChartImagePane imagePane : typeDemo) { - imagePane.isPressing = false; - } - - //获取上次选中的图标 - VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot(); - typeDemo.get(customPlot.getDetailType()).isPressing = true; - - isCustom = customPlot.getCustomStyle() == CustomStyle.CUSTOM; - - //自定义选择时,更新自定义面板 - if (isCustom) { - customSelectPane.populateBean(chart); - } - - checkCardPane(); - - checkDemosBackground(); - - } - - /** - * 获取各图表类型界面ID, 本质是plotID - * - * @return 图表类型界面ID - */ - @Override - protected String getPlotTypeID() { - return VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID; - } - - protected Plot getSelectedClonedPlot() { - VanChartCustomPlot newPlot = null; - Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes; - for (int i = 0, len = customChart.length; i < len; i++) { - if (typeDemo.get(i).isPressing) { - newPlot = (VanChartCustomPlot) customChart[i].getPlot(); - } - } - Plot cloned = null; - try { - cloned = (Plot) newPlot.clone(); - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ScatterChart"); - } - return cloned; - } - - public Chart getDefaultChart() { - return CustomIndependentVanChart.CustomVanChartTypes[0]; - } - - @Override - /** - *删除配置的条件属性 - */ - protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException { - cloneOldDefaultAttrConditionCollection(oldPlot, newPlot); - } - - @Override - /** - * 删除线型配置 - */ - protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException { - if (oldPlot.getConditionCollection() != null) { - ConditionCollection newCondition = new ConditionCollection(); - newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone()); - newPlot.setConditionCollection(newCondition); - - //删除线型设置 - ConditionAttr attrList = newCondition.getDefaultAttr(); - DataSeriesCondition attr = attrList.getExisted(VanChartAttrLine.class); - if (attr != null) { - attrList.remove(VanChartAttrLine.class); - } - } - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/CategoryCustomPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/CategoryCustomPlotTableDataContentPane.java deleted file mode 100644 index ac1b055386..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/CategoryCustomPlotTableDataContentPane.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane; - -/** - * Created by Fangjie on 2016/5/18. - */ -public class CategoryCustomPlotTableDataContentPane extends CategoryPlotTableDataContentPane { - public CategoryCustomPlotTableDataContentPane() { - super(); - } - - public CategoryCustomPlotTableDataContentPane(ChartDataPane parent) { - super(parent); - } - - /** - * 检查 某些Box是否可用 - * 分类不可用 - * @param hasUse 是否使用 - */ - public void checkBoxUse(boolean hasUse) { - categoryCombox.setEnabled(false); - checkSeriseUse(hasUse); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/ChartImageCheckOutPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/ChartImageCheckOutPane.java deleted file mode 100644 index fc36decc9d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/ChartImageCheckOutPane.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.constants.UIConstants; -import com.fr.design.dialog.BasicPane; -import com.fr.design.event.UIObserver; -import com.fr.design.event.UIObserverListener; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.type.CustomPlotType; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.util.ArrayList; - -/** - * Created by Fangjie on 2016/4/19. - */ -public class ChartImageCheckOutPane extends BasicPane implements UIObserver { - - private JCheckBox checkBox; - private CustomPlotType customPlotType; - private ArrayList changeListeners = new ArrayList(); - - public ChartImageCheckOutPane(CustomPlotType type){ - this(type, false); - } - - public ChartImageCheckOutPane( CustomPlotType type, boolean isSelected){ - this.customPlotType = type; - - initCheckBox(isSelected); - - this.add(checkBox, BorderLayout.CENTER); - } - - public CustomPlotType getCustomPlotType() { - return customPlotType; - } - - private void initCheckBox(boolean isSelected) { - this.checkBox = new JCheckBox(); - this.checkBox.setSelected(isSelected); - //设置提示 - this.checkBox.setToolTipText(CustomPlotFactory.getTooltipText(this.customPlotType)); - //背景 - checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType,isSelected)))); - - this.setLayout(new BorderLayout()); - } - - private String getIconPath(CustomPlotType customPlotType, boolean isSelected) { - return isSelected ? CustomPlotFactory.getTypeIconPath(customPlotType)[0] : CustomPlotFactory.getTypeIconPath(customPlotType)[1]; - } - - - public JCheckBox getCheckBox() { - return checkBox; - } - - public void checkIconImage(){ - checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType, checkBox.isSelected())))); - } - - public void setPaneBorder(boolean isRightLine, boolean isBottomLine){ - this.setBorder(BorderFactory.createMatteBorder(1, 1, isBottomLine ? 1 : 0, isRightLine ? 1 : 0, UIConstants.LINE_COLOR)); - } - - public void setSelected(boolean isSelected){ - checkBox.setSelected(isSelected); - } - - public boolean isSelected(){ - return checkBox.isSelected(); - } - - - - @Override - protected String title4PopupWindow() { - return null; - } - - public void fireStateChange() { - for (int i = 0; i < changeListeners.size(); i++) { - changeListeners.get(i).stateChanged(new ChangeEvent(this)); - } - } - - @Override - public void registerChangeListener(final UIObserverListener listener) { - changeListeners.add(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - } - - @Override - public boolean shouldResponseChangeListener() { - return false; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/CustomPlotLocationPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/CustomPlotLocationPane.java deleted file mode 100644 index b3bd29de89..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/CustomPlotLocationPane.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.plugin.chart.PiePlot4VanChart; -import com.fr.plugin.chart.attr.plot.VanChartPositionPlot; -import com.fr.plugin.chart.base.Position; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/26. - */ -public class CustomPlotLocationPane extends BasicBeanPane{ - private UISpinner radius; - private UISpinner xDirection; - private UISpinner yDirection; - private static final double MIN_ANGLE = PiePlot4VanChart.START_ANGLE; - private static final double MAX_ANGLE = PiePlot4VanChart.END_ANGLE; - - public CustomPlotLocationPane(){ - init(); - } - - private void init() { - radius = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 50); - - xDirection = new UISpinner(0, 100, 1, 20); - yDirection = new UISpinner(0, 100, 1, 20); - - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Position") + "(%): " + Inter.getLocText("Plugin-ChartF_X_Direction"), SwingConstants.LEFT),xDirection}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Y_Direction"), SwingConstants.RIGHT),yDirection}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius") + "(px): ",SwingConstants.LEFT),radius} - - }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, new double[]{-2, -2, -2}, new double[]{-2, -1}); - - this.setLayout(new BorderLayout(0,0)); - - this.add(TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Location"), panel), BorderLayout.CENTER); - } - - @Override - public void populateBean(Plot plot) { - if (plot instanceof VanChartPositionPlot) { - Position position = ((VanChartPositionPlot) plot).getPosition(); - - if (position != null) { - radius.setValue(position.getRadius()); - xDirection.setValue(position.getX()); - yDirection.setValue(position.getY()); - } - } - } - - @Override - public void updateBean(Plot plot) { - if (plot instanceof VanChartPositionPlot) { - Position position = new Position(); - position.setRadius(radius.getValue()); - position.setX(xDirection.getValue()); - position.setY(yDirection.getValue()); - - ((VanChartPositionPlot) plot).setPosition(position); - } - } - - @Override - public Plot updateBean() { - return null; - } - - @Override - protected String title4PopupWindow() { - return null; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotReportDataContentPane.java deleted file mode 100644 index ec45eaf2ab..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotReportDataContentPane.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.chart.chartdata.MeterReportDefinition; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.report.MeterPlotReportDataContentPane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/5/23. - */ -public class MeterCustomPlotReportDataContentPane extends MeterPlotReportDataContentPane{ - private UITextField singCateText; - public MeterCustomPlotReportDataContentPane(ChartDataPane parent) { - super(parent); - } - - @Override - protected Component getSingCatePane() { - return singCateText = new UITextField(); - } - - @Override - protected void populateSingCatePane(String name) { - singCateText.setText(name); - } - - @Override - protected void updateSingCatePane(MeterReportDefinition meterDefinition) { - - meterDefinition.setName(singCateText.getText()); - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotTableDataContentPane.java deleted file mode 100644 index efece3b851..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/MeterCustomPlotTableDataContentPane.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.base.Utils; -import com.fr.chart.chartdata.MeterTableDefinition; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane; -import com.fr.plugin.chart.data.VanChartMeterCustomTableDefinition; - -import java.awt.*; - -/** - * Created by Fangjie on 2016/5/18. - */ -public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataContentPane { - private static final int TEXT_HT = 20; - private static final int TEXT_WD = 80; - private UITextField nameField; - public MeterCustomPlotTableDataContentPane(ChartDataPane parent) { - super(parent); - } - - @Override - protected Component getNameComponent() { - nameField = new UITextField(); - nameField.setPreferredSize(new Dimension(TEXT_WD, TEXT_HT)); - return nameField; - } - - @Override - protected void populateNameComponent(MeterTableDefinition meter) { - nameField.setText(meter.getName()); - } - - @Override - protected void updateNameComponent(MeterTableDefinition meter) { - meter.setName(Utils.objectToString(nameField.getText())); - } - - @Override - protected MeterTableDefinition getMeterTableDefinition(){ - return new VanChartMeterCustomTableDefinition(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAreaBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAreaBackgroundPane.java deleted file mode 100644 index 65241fc0b7..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAreaBackgroundPane.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.plugin.chart.custom.style.VanChartCustomAxisAreaPane; -import com.fr.plugin.chart.designer.style.background.VanChartAreaBackgroundPane; -import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane; - -/** - * Created by Fangjie on 2016/5/19. - */ -public class VanChartCustomAreaBackgroundPane extends VanChartAreaBackgroundPane { - public VanChartCustomAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) { - super(isPlot, parent); - } - - protected VanChartAxisAreaPane initAxisAreaPane() { - return new VanChartCustomAxisAreaPane(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAxisConditionPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAxisConditionPane.java deleted file mode 100644 index daa479a2ac..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomAxisConditionPane.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.gui.ilable.UILabel; - -import com.fr.general.Inter; - -import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; -import com.fr.plugin.chart.column.VanChartCustomStackAndAxisConditionPane; - -import java.awt.*; -/** - * 自定义坐标轴设置 - * 散点图和气泡图用到 - * 堆积和百分比属性为false - */ -public class VanChartCustomAxisConditionPane extends VanChartCustomStackAndAxisConditionPane { - - public VanChartCustomAxisConditionPane(){ - - } - - protected Component[][] getDeployComponents() { - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("ChartF-X_Axis")),XAxis}, - new Component[]{new UILabel(Inter.getLocText("ChartF-Y_Axis")),YAxis}, - }; - - return components; - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_Custom_Axis"); - } - - - @Override - protected void updateStackAndPercent(AttrSeriesStackAndAxis seriesStackAndAxis) { - seriesStackAndAxis.setStacked(false); - seriesStackAndAxis.setPercentStacked(false); - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotAxisPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotAxisPane.java deleted file mode 100644 index 4b274e56e1..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotAxisPane.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.chart.chartglyph.ConditionCollection; -import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; -import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; -import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane; - -import java.util.List; - -/** - * Created by Fangjie on 2016/5/12. - */ -public class VanChartCustomPlotAxisPane extends VanChartAxisPane { - - public VanChartCustomPlotAxisPane(VanChartAxisPlot plot, VanChartStylePane parent) { - super(plot, parent); - } - - //删除此坐标轴相关堆积属性的设置 - protected void removeOthers(int axisIndex, boolean isXAxis){ - //堆积和坐标轴 - - VanChartCustomPlot customPlot = (VanChartCustomPlot)editingPlot; - List plotList = customPlot.getCustomPlotList(); - for (int k = 0; k < plotList.size(); k++) { - if (customPlot.getStandardAxisOrder().contains(k)){ - VanChartRectanglePlot vanChartPlot = (VanChartRectanglePlot) plotList.get(k); - if (vanChartPlot.isHaveAxis() && !CustomPlotDesignerPaneFactory.isUseDiffAxisPane(vanChartPlot)){ - remove(axisIndex, isXAxis, vanChartPlot); - } - } - } - } - - private void remove(int axisIndex, boolean isXAxis, VanChartRectanglePlot vanChartPlot){ - ConditionCollection stackAndAxisCondition = vanChartPlot.getStackAndAxisCondition(); - if (stackAndAxisCondition == null) { - return; - } - for (int i = 0, len = stackAndAxisCondition.getConditionAttrSize(); i < len; i++) { - ConditionAttr conditionAttr = stackAndAxisCondition.getConditionAttr(i); - AttrSeriesStackAndAxis stackAndAxis = (AttrSeriesStackAndAxis) conditionAttr.getExisted(AttrSeriesStackAndAxis.class); - int index = isXAxis ? stackAndAxis.getXAxisIndex() : stackAndAxis.getYAxisIndex(); - if (index == axisIndex) { - stackAndAxisCondition.removeConditionAttr(conditionAttr); - } - } - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotSelectPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotSelectPane.java deleted file mode 100644 index 30024e2cdb..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotSelectPane.java +++ /dev/null @@ -1,396 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; -import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.custom.type.CustomStyle; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/19. - */ -public class VanChartCustomPlotSelectPane extends BasicBeanPane { - - private static final int NO_DIRTY = -1; - private static final int NOT_LAST = -1; - private static final int REC_WIDTH = 58; - private static final int REC_HEIGHT = 50; - private static final int CUSTOM_TYPE_NUM = 4; - - - public static final String MASSAGE = Inter.getLocText("Plugin-ChartF_At_Least_One_Chart"); - - private List customTypeList = new ArrayList(); - - //该列表记录上次每个checkout的状态 - private List oldSelectedList; - - //保存点击的checkout顺序 - private List selectedPlotTypeList = new ArrayList(); - - //将所有面板排布后的面板 - private JPanel content; - - - public VanChartCustomPlotSelectPane(){ - initCustomType(); - } - - private void initCustomType() { - - initAllCheckOutPane(); - - initContentPane(); - - updateOldSelectedList(); - - addCheckBoxListener(); - - checkoutSelected(); - } - - private void updateOldSelectedList() { - oldSelectedList = new ArrayList(); - for (int i = 0; i < customTypeList.size(); i++){ - oldSelectedList.add(customTypeList.get(i).getCheckBox().isSelected()); - } - } - - private void checkoutSelected() { - for (int i = 0; i < customTypeList.size(); i++){ - //根据是否选中重置背景 - customTypeList.get(i).checkIconImage(); - } - } - - private void initContentPane() { - - content = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(CUSTOM_TYPE_NUM, 0, 0); - for (int i = 0; i < customTypeList.size(); i++){ - customTypeList.get(i).setPreferredSize(new Dimension(REC_WIDTH,REC_HEIGHT)); - - //是否画右边线 - boolean isRightLine = (i == customTypeList.size() - 1) ? true : ((i + 1)%CUSTOM_TYPE_NUM == 0) ? true : false; - //是否画下边线 - int row = i / CUSTOM_TYPE_NUM; - int column = i % CUSTOM_TYPE_NUM; - boolean isBottomLine = ((row+1)*CUSTOM_TYPE_NUM + column < customTypeList.size()) ? false : true; - - customTypeList.get(i).setPaneBorder(isRightLine, isBottomLine); - - content.add(customTypeList.get(i)); - } - - this.setLayout(new BorderLayout()); - this.add(content, BorderLayout.CENTER); - } - - private void addCheckBoxListener() { - for (int i = 0; i < customTypeList.size(); i++){ - - //初始化每个customType的listener - - customTypeList.get(i).getCheckBox().addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent evt) { - int index = isLastSelected(); - if (index != NOT_LAST) {//如果是最后一个 - customTypeList.get(index).getCheckBox().setSelected(true); - - //彈出警告框 - JOptionPane.showMessageDialog(new JPanel(), MASSAGE,"", JOptionPane.WARNING_MESSAGE); - } - - //点击后更新已选顺序 - checkoutSelectedPlotTypeList(); - - //点击后,更新背景 - checkoutSelected(); - - //响应观察者事件,以便更新chart - fireDirty(); - } - }); - } - } - - - /** - * 根据选择更新顺序 - */ - private void checkoutSelectedPlotTypeList() { - int index = getDirtySelectedIndex(oldSelectedList); - - if (index == NO_DIRTY){ - return; - } - - boolean isAdd = getDirtyState(index); - - //获取选中的自定义图表类型 - CustomPlotType plotType = customTypeList.get(index).getCustomPlotType(); - - //根据类型处理增加或者删除 - dealSelectedPlotTypeList(isAdd, plotType, selectedPlotTypeList); - } - - private void fireDirty() { - int index = getDirtySelectedIndex(oldSelectedList); - if (index != NO_DIRTY) { - customTypeList.get(index).fireStateChange(); - } - } - - @Override - public void populateBean(Chart chart) { - - VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot(); - - populateCustomTypeList(customPlot); - - populateSelectedPlotTypeList(customPlot); - - checkoutSelected(); - } - - private void populateSelectedPlotTypeList(VanChartCustomPlot customPlot) { - - selectedPlotTypeList = new ArrayList(); - - List customPlotList = customPlot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - selectedPlotTypeList.add(CustomPlotFactory.getCustomType(customPlotList.get(i))); - } - } - - private void populateCustomTypeList(VanChartCustomPlot customPlot) { - if (customPlot.getCustomStyle() != CustomStyle.CUSTOM){ - return; - } - - List customPlotList = customPlot.getCustomPlotList(); - - oldSelectedList = new ArrayList(); - - for (int i = 0; i < customTypeList.size(); i++){ - boolean isSelected = false; - CustomPlotType customPlotType = customTypeList.get(i).getCustomPlotType(); - //更新选中项 - if (customPlotTypeContained(customPlotType, customPlotList)) { - isSelected = true; - } - - customTypeList.get(i).setSelected(isSelected); - - //同时设置oldList - oldSelectedList.add(isSelected); - } - - } - - private boolean customPlotTypeContained(CustomPlotType customPlotType, List customPlotList) { - boolean contained = false; - - for (int i = 0; i < customPlotList.size(); i++){ - if (ComparatorUtils.equals(customPlotType, CustomPlotFactory.getCustomType(customPlotList.get(i)))){ - contained = true; - break; - } - } - - return contained; - } - - @Override - public Chart updateBean() { - return null; - } - - @Override - public void updateBean(Chart chart) { - VanChartCustomPlot customPlot = (VanChartCustomPlot)chart.getPlot(); - - //根据选择的组合图更新,根据保存的顺序更新组合图 - updateCustomPlotList(customPlot); - - //响应完毕后,更新状态 - updateOldSelectedList(); - } - - private void updateCustomPlotList(VanChartCustomPlot customPlot) { - //根据selectedPlotTypeList更新customPlotList - //切换之后,给与全新构建的plotList,这回导致其他面板上的设置无效,也是合理的 - List newCustomPlotList = new ArrayList(); - List oldCustomPlotList = customPlot.getCustomPlotList(); - - //复制已经设置的plot - try { - for (int i = 0; i < oldCustomPlotList.size(); i++){ - VanChartPlot vanChartPlot = oldCustomPlotList.get(i); - if (selectedPlotTypeList.contains(CustomPlotFactory.getCustomType(vanChartPlot))){ - newCustomPlotList.add((VanChartPlot) vanChartPlot.clone()); - } - } - } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage()); - } - - - //没有复制到的plot重创 - for (int i = 0; i < selectedPlotTypeList.size(); i++){ - CustomPlotType customPlotType = selectedPlotTypeList.get(i); - if (!CustomPlotFactory.customPlotContains(newCustomPlotList, customPlotType)){ - VanChartPlot vanChartPlot = CustomPlotFactory.getCustomPlot(customPlotType); - vanChartPlot.setCustomType(CustomStyle.CUSTOM.toString()); - //设置公共属性 - setCommonAttr(vanChartPlot, customPlot); - - newCustomPlotList.add(vanChartPlot); - } - } - - customPlot.setCustomPlotList(newCustomPlotList); - } - - private void setCommonAttr(VanChartPlot vanChartPlot, VanChartCustomPlot customPlot) { - //坐标轴公共属性 - dealAxisAttr(vanChartPlot, customPlot); - } - - private void dealAxisAttr(VanChartPlot vanChartPlot, VanChartCustomPlot customPlot) { - if (vanChartPlot.isHaveAxis() && !CustomPlotDesignerPaneFactory.isUseDiffAxisPane(vanChartPlot) && customPlot.isHaveStandardAxis()){ - VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)vanChartPlot; - - //指针指向同一个标准坐标轴 - rectanglePlot.setXAxisList(customPlot.getXAxisList()); - rectanglePlot.setYAxisList(customPlot.getYAxisList()); - } - } - - private void dealSelectedPlotTypeList(boolean isAdd, CustomPlotType plotType, List customPlotTypeList) { - - //根据isAdd删除或者增加 - if (isAdd){ - customPlotTypeList.add(plotType); - }else { - //定位选中的是那个plot - int index = -1; - - for (int i = 0; i < customPlotTypeList.size(); i++){ - if (ComparatorUtils.equals(plotType, customPlotTypeList.get(i))){ - index = i; - break; - } - } - - if (index == -1){ - return; - } - - customPlotTypeList.remove(index); - } - - } - - /** - * 获取id为index的图表是选中还是删除 - * 增加则返回true - * 删除返回false - * @param index - * @return - */ - private boolean getDirtyState(int index) { - boolean isAdd = true; - - boolean newState = customTypeList.get(index).getCheckBox().isSelected(); - boolean oldState = oldSelectedList.get(index); - - //true->false为删除;false->true为增加 - if (oldState == true && newState == false){ - isAdd = false; - }else if (oldState == false && newState == true){ - isAdd = true; - } - - return isAdd; - } - - @Override - protected String title4PopupWindow() { - return null; - } - - /** - * 如果是最后一个,则返回最后一个checkout的index - * 否则返回-1 - * @return - */ - private int isLastSelected() { - int count = 0; - int index = NOT_LAST; - for (int i = 0; i < customTypeList.size(); i++){ - if (customTypeList.get(i).getCheckBox().isSelected()){ - count++; - } - } - if (count == 0){ - //查找是哪一个变化了 - index = getDirtySelectedIndex(oldSelectedList); - } - return index; - } - - /** - * 获取改变状态的index - * 如果有两个都改变了,改函数获取的是排在前面的index - * 如果没找到 - * @param oldSelectedList - * @return - */ - private int getDirtySelectedIndex(List oldSelectedList) { - for (int i = 0; i < oldSelectedList.size(); i++){ - if ((oldSelectedList.get(i)) != customTypeList.get(i).getCheckBox().isSelected()){ - return i; - } - } - return NO_DIRTY; - } - - /** - * 构建所有可用的组合图面板 - */ - private void initAllCheckOutPane() { - //将所有工厂中的图表都加入到可选面板中 - - CustomPlotType[] customPlotTypes = CustomPlotType.getTypes(); - for(int i = 0; i < customPlotTypes.length; i++){ - boolean isSelected = false; - CustomPlotType customPlotType = customPlotTypes[i]; - //前两个默认选中 - if (i == 0 || i == 1) { - isSelected = true; - selectedPlotTypeList.add(customPlotType); - } - ChartImageCheckOutPane checkOutPane = new ChartImageCheckOutPane(customPlotType, isSelected); - - customTypeList.add(checkOutPane); - } - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotTabPane.java deleted file mode 100644 index 755441d94b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotTabPane.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; -import com.fr.general.ComparatorUtils; -import com.fr.plugin.chart.designer.component.VanChartPlotMultiTabPane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/22. - */ -public abstract class VanChartCustomPlotTabPane extends VanChartPlotMultiTabPane { - private static final long serialVersionUID = 8633385688766835241L; - - public VanChartCustomPlotTabPane(E plot, BasicPane parent) { - this(plot, parent, null); - } - - public VanChartCustomPlotTabPane(E plot, BasicPane parent, AttributeChangeListener listener) { - super(plot, parent, listener); - } - - protected abstract void initTabTitle(); - - @Override - protected void initLayout() { - JPanel tabPanel = new JPanel(new BorderLayout()); - tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, getBackground())); - tabPanel.add(tabPane, BorderLayout.CENTER); - this.setLayout(new BorderLayout(0, 6)); - this.add(tabPanel, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - } - - /** - * 设置选中的界面id - */ - public void setSelectedByIds(int level, String... id) { - tabPane.setSelectedIndex(-1); - for (int i = 0; i < paneList.size(); i++) { - if (ComparatorUtils.equals(id[level], NameArray[i])) { - tabPane.setSelectedIndex(i); - tabPane.tabChanged(i); - if (id.length >= level + 2) { - ((AutoSelectedPane)paneList.get(i)).setSelectedIndex(id[level + 1]); - } - break; - } - } - } - - @Override - public void relayoutWhenListChange() { - centerPane = new JPanel(cardLayout) { - @Override - public Dimension getPreferredSize() { - if (tabPane.getSelectedIndex() == -1) { - return super.getPreferredSize(); - } else { - return paneList.get(tabPane.getSelectedIndex()).getPreferredSize(); - } - } - }; - - //获取tab的标题 - initTabTitle(); - - tabPane = new VanChartCustomPlotUITabGroup(NameArray) { - @Override - public void tabChanged(int index) { - dealWithTabChanged(index); - } - }; - tabPane.setSelectedIndex(0); - tabPane.tabChanged(0); - initLayout(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotUITabGroup.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotUITabGroup.java deleted file mode 100644 index 3819b76b25..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartCustomPlotUITabGroup.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ibutton.UITabGroup; -import com.fr.design.gui.ibutton.UIToggleButton; - -import javax.swing.*; -import javax.swing.border.Border; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/21. - */ -public class VanChartCustomPlotUITabGroup extends UITabGroup{ - - private static final int WIDTH = 198; - private static final int BUTTON_HEIGHT = 30; - private int listNum = 0; - - public VanChartCustomPlotUITabGroup(Icon[] iconArray) { - super(iconArray); - } - - public VanChartCustomPlotUITabGroup(String[] textArray) { - super(textArray); - } - - @Override - protected LayoutManager getGridLayout(int number) { - //这个地方可以顺便获取list个数 - listNum = number; - return new GridBagLayout(); - } - - @Override - protected void paintBorder(Graphics g) { - Border border = getBorder(); - if (border != null) { - border.paintBorder(this, g, 0, 0, getWidth(), getHeight()); - } - } - - @Override - protected Border getGroupBorder() { - return BorderFactory.createEmptyBorder(1, 1, 1, 1); - } - - @Override - protected void initButton(UIToggleButton labelButton) { - - int ButtonWidth = WIDTH / 3; - if (listNum <= 1){ - return; - }else if (listNum == 2){ - ButtonWidth = WIDTH / 2; - } - - //将button加入到pane中,以便可以对边框进行控制 - labelButton.setRoundBorder(false); - labelButton.setBorderPainted(false); - - - - labelButtonList.add(labelButton); - - int index = labelButtonList.size() - 1; - - JPanel panel = getButtonPanel(labelButton, index); - - GridBagConstraints constraints=new GridBagConstraints(); - - int end = listNum % 3; - - if (end == 1 && index == 0){ - constraints.gridy = 0; - constraints.gridx = 0; - constraints.gridheight = 1; - constraints.gridwidth = 6; - ButtonWidth = WIDTH + 2; - }else if (end == 2 && (index == 0 || index == 1) && listNum != 2){ - constraints.gridy = 0; - constraints.gridx = index == 1 ? 4 : 0; - constraints.gridheight = 1; - constraints.gridwidth = index == 0 ? 4 : 2; - ButtonWidth = index == 0 ? ButtonWidth * 2 + 1 : ButtonWidth; - }else { - int l = ((index + ((end == 0) ? end : (3 - end))) / 3); - constraints.gridy = l; - constraints.gridx = ((index - (l * 3 - (end == 0 ? end : 3 - end))))*2; - constraints.gridheight = 1; - constraints.gridwidth = 2; - } - labelButton.setPreferredSize(new Dimension(ButtonWidth, BUTTON_HEIGHT)); - - this.add(panel, constraints); - } - - private JPanel getButtonPanel(UIToggleButton labelButton, int index) { - JPanel panel = new JPanel(); - panel.setLayout(new BorderLayout()); - panel.add(labelButton,BorderLayout.CENTER); - - setPanelBorder(panel, index); - - return panel; - } - - public void setPanelBorder(JPanel panel, int index) { - int end = listNum % 3; - int num = listNum; - - //调整index - if (end == 1 && index != 0){ - index += 2; - num += 2; - }else if (end == 2 && index != 0 && index != 1){ - index += 1; - num += 1; - } - boolean isRightLine = (index+1) % 3 == 0 ? true : false; - isRightLine = (end == 2 && index == 1) ? true : isRightLine; - isRightLine = (end == 1 && index == 0) ? true : isRightLine; - //是否画下边线 - int row = index / 3; - int column = index % 3; - boolean isBottomLine = ((row+1)*3 + column < num) ? false : true; - - panel.setBorder(BorderFactory.createMatteBorder(1, 1, isBottomLine ? 1 : 0, isRightLine ? 1 : 0, UIConstants.LINE_COLOR)); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartDataPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartDataPane.java deleted file mode 100644 index cd0c729380..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartDataPane.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; - -import javax.swing.*; - -/** - * Created by Fangjie on 2016/5/18. - */ -public class VanChartDataPane extends ChartDataPane { - - public VanChartDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected JPanel createContentPane() { - contentsPane = new NormalChartDataPane(listener, VanChartDataPane.this); - return contentsPane; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java deleted file mode 100644 index dbba351133..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ /dev/null @@ -1,296 +0,0 @@ -package com.fr.plugin.chart.custom.component; - -import com.fr.base.BaseFormula; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.web.ChartHyperPoplink; -import com.fr.chart.web.ChartHyperRelateCellLink; -import com.fr.chart.web.ChartHyperRelateFloatLink; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.chart.javascript.ChartEmailPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; -import com.fr.design.designer.TargetComponent; -import com.fr.design.fun.HyperlinkProvider; -import com.fr.design.gui.HyperlinkFilterHelper; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.design.hyperlink.ReportletHyperlinkPane; -import com.fr.design.hyperlink.WebHyperlinkPane; -import com.fr.design.javascript.JavaScriptImplPane; -import com.fr.design.javascript.ParameterJavaScriptPane; -import com.fr.design.module.DesignModuleFactory; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.js.EmailJavaScript; -import com.fr.js.FormHyperlinkProvider; -import com.fr.js.JavaScript; -import com.fr.js.JavaScriptImpl; -import com.fr.js.NameJavaScript; -import com.fr.js.NameJavaScriptGroup; -import com.fr.js.ParameterJavaScript; -import com.fr.js.ReportletHyperlink; -import com.fr.js.WebHyperlink; -import com.fr.plugin.chart.designer.component.VanChartUIListControlPane; -import com.fr.stable.ListMap; -import com.fr.stable.Nameable; -import com.fr.stable.bridge.StableFactory; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartHyperLinkPane extends VanChartUIListControlPane { - - public VanChartHyperLinkPane() { - super(); - } - - @Override - public NameableCreator[] createNameableCreators() { - - //面板初始化,需要在populate的时候更新 - Map nameCreators = new ListMap<>(); - NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); - for (NameableCreator creator : creators) { - nameCreators.put(creator.menuName(), creator); - } - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); - for (HyperlinkProvider provider : providers) { - NameableCreator nc = provider.createHyperlinkCreator(); - nameCreators.put(nc.menuName(), nc); - } - return nameCreators.values().toArray(new NameableCreator[nameCreators.size()]); - } - - - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { - Constructor constructor = null; - try { - constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); - return constructor.newInstance(getHyperLinkEditorMap(), false); - - } catch (InstantiationException e) { - FRLogger.getLogger().error(e.getMessage(), e); - } catch (IllegalAccessException e) { - FRLogger.getLogger().error(e.getMessage(), e); - } catch (NoSuchMethodException e) { - return super.createPaneByCreators(creator); - } catch (InvocationTargetException e) { - FRLogger.getLogger().error(e.getMessage(), e); - } - return null; - } - - protected Map getHyperLinkEditorMap() { - return plot.getHyperLinkEditorMap(); - } - - /** - * 弹出列表的标题. - * - * @return 返回标题字符串. - */ - public String title4PopupWindow() { - return Inter.getLocText("FR-Designer_Hyperlink"); - } - - @Override - protected String getAddItemText() { - return Inter.getLocText("FR-Designer_Add_Hyperlink"); - } - - @Override - protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) { - return new AddVanChartItemMenuDef(creators); - } - - public void populate(NameJavaScriptGroup nameHyperlink_array) { - java.util.List list = new ArrayList(); - if (nameHyperlink_array != null) { - for (int i = 0; i < nameHyperlink_array.size(); i++) { - list.add(new NameObject(nameHyperlink_array.getNameHyperlink(i).getName(), nameHyperlink_array.getNameHyperlink(i).getJavaScript())); - } - } - - this.populate(list.toArray(new NameObject[list.size()])); - } - - public void populate(TargetComponent elementCasePane) { - //populate - } - - /** - * updateJs的Group - * - * @return 返回NameJavaScriptGroup - */ - public NameJavaScriptGroup updateJSGroup() { - Nameable[] res = this.update(); - NameJavaScript[] res_array = new NameJavaScript[res.length]; - for (int i = 0; i < res.length; i++) { - NameObject no = (NameObject) res[i]; - res_array[i] = new NameJavaScript(no.getName(), (JavaScript) no.getObject()); - } - - return new NameJavaScriptGroup(res_array); - } - - public void populate(Plot plot) { - this.plot = plot; - HashMap paneMap = getHyperlinkMap(plot); - - //安装平台内打开插件时,添加相应按钮 - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); - for (HyperlinkProvider provider : providers) { - NameableCreator nc = provider.createHyperlinkCreator(); - paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); - } - - java.util.List list = refreshList(paneMap); - NameObjectCreator[] creators = new NameObjectCreator[list.size()]; - for (int i = 0; list != null && i < list.size(); i++) { - UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); - - } - - refreshNameableCreator(creators); - - java.util.List nameObjects = new ArrayList(); - - NameJavaScriptGroup nameGroup = populateHotHyperLink(plot); - for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) { - NameJavaScript javaScript = nameGroup.getNameHyperlink(i); - if (javaScript != null && javaScript.getJavaScript() != null) { - JavaScript script = javaScript.getJavaScript(); - UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); - nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj())); - - } - } - - this.populate(nameObjects.toArray(new NameObject[nameObjects.size()])); - doLayout(); - } - - protected NameJavaScriptGroup populateHotHyperLink(Plot plot) { - return plot.getHotHyperLink(); - } - - protected HashMap getHyperlinkMap(Plot plot) { - HashMap map = new HashMap(); - - map.put(ReportletHyperlink.class, ReportletHyperlinkPane.class); - map.put(EmailJavaScript.class, ChartEmailPane.class); - map.put(WebHyperlink.class, WebHyperlinkPane.class); - map.put(ParameterJavaScript.class, ParameterJavaScriptPane.class); - - map.put(JavaScriptImpl.class, JavaScriptImplPane.class); - map.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.class); - map.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.class); - map.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.class); - - map.put(FormHyperlinkProvider.class, FormHyperlinkPane.class); - return map; - } - - public void update(Plot plot) { - - NameJavaScriptGroup nameGroup = updateNameGroup(); - - updateHotHyperLink(plot, nameGroup); - } - - protected void updateHotHyperLink(Plot plot, NameJavaScriptGroup nameGroup) { - plot.setHotHyperLink(nameGroup); - } - - private NameJavaScriptGroup updateNameGroup() { - Nameable[] nameables = update(); - - NameJavaScriptGroup nameGroup = new NameJavaScriptGroup(); - nameGroup.clear(); - - for (int i = 0; i < nameables.length; i++) { - JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject(); - String name = nameables[i].getName(); - NameJavaScript nameJava = new NameJavaScript(name, javaScript); - nameGroup.addNameHyperlink(nameJava); - } - - return nameGroup; - } - - - protected java.util.List refreshList(HashMap map) { - java.util.List list = new ArrayList(); - - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"), - new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), VanChartEmailPane.class)); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"), - new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"), - new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); - list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"), - new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"), - new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"), - new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); - - FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Form"), - hyperlink, getUseMap(map, FormHyperlinkProvider.class))); - - return list; - } - - protected Class getUseMap(HashMap map, Object key) { - if (map.get(key) != null) { - return (Class) map.get(key); - } - //引擎在这边放了个provider,当前表单对象 - for (Object tempKey : map.keySet()) { - if (((Class) tempKey).isAssignableFrom((Class) key)) { - return (Class) map.get(tempKey); - } - } - return null; - } - - protected class AddVanChartItemMenuDef extends AddItemMenuDef { - - public AddVanChartItemMenuDef(NameableCreator[] creators) { - super(creators); - } - - @Override - protected boolean whetherAdd(String itemName) { - return HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName); - } - } - - //邮箱 - public static class VanChartEmailPane extends ChartEmailPane { - @Override - protected boolean needRenamePane() { - return false; - } - } - - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomConditionAttrPane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomConditionAttrPane.java deleted file mode 100644 index abbc5133da..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomConditionAttrPane.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.dialog.BasicScrollPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.custom.VanChartCustomPlot; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomConditionAttrPane extends BasicScrollPane { - private VanChartCustomPlotConditionAttrTabPane conditionAttrPane; - private Chart chart; - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initConditionAttrPane((VanChartCustomPlot) chart.getPlot()); - if(conditionAttrPane != null) { - contentPane.add(conditionAttrPane, BorderLayout.CENTER); - } - return contentPane; - } - - private void initConditionAttrPane(VanChartCustomPlot plot) { - conditionAttrPane = new VanChartCustomPlotConditionAttrTabPane(plot, null); - } - - @Override - public void populateBean(Chart chart) { - this.chart = chart; - if(conditionAttrPane == null) { - this.remove(leftcontentPane); - layoutContentPane(); - } - if(conditionAttrPane != null) { - conditionAttrPane.populateBean((VanChartCustomPlot)chart.getPlot()); - } - } - - @Override - public void updateBean(Chart chart) { - - if (chart == null){ - return; - } - - if (conditionAttrPane != null) { - conditionAttrPane.updateBean((VanChartCustomPlot) chart.getPlot()); - } - } - - /** - * 是否显示滚动条 - * @return - */ - @Override - protected boolean isShowScrollBar() { - return false; - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Chart-Condition_Display"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java deleted file mode 100644 index 0802d8196c..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.chart.chartattr.Plot; -import com.fr.general.Inter; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.type.CustomStyle; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.other.AutoRefreshPane; -import com.fr.plugin.chart.designer.other.AutoRefreshPaneWithoutTooltip; -import com.fr.plugin.chart.designer.other.VanChartInteractivePane; -import com.fr.plugin.chart.vanchart.VanChart; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomInteractivePane extends VanChartInteractivePane { - - private VanChartCustomPlotHyperlinkPane hyperlinkPane; - - /** - * 组合图无排序按钮 - * @return - */ - @Override - protected Component[][] createToolBarComponents() { - return createToolBarComponentsWithOutSort(); - } - - protected JPanel createHyperlinkPane() { - hyperlinkPane = new VanChartCustomPlotHyperlinkPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), hyperlinkPane); - } - - @Override - protected void populateHyperlink(Plot plot) { - hyperlinkPane.populateBean(chart); - } - - @Override - protected void updateHyperlink(Plot plot){ - hyperlinkPane.updateBean(chart); - } - - protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { - boolean isLargeModel = largeModel(plot); - //自定义组合图不支持自动数据点提示 - if (((VanChartCustomPlot)plot).getCustomStyle().equals(CustomStyle.CUSTOM)) { - return new AutoRefreshPaneWithoutTooltip((VanChart) chart, isLargeModel); - } - return new AutoRefreshPane((VanChart) chart, isLargeModel); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomOtherPane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomOtherPane.java deleted file mode 100644 index 7538690586..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomOtherPane.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.beans.BasicBeanPane; -import com.fr.plugin.chart.designer.other.VanChartOtherPane; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomOtherPane extends VanChartOtherPane { - protected BasicBeanPane createInteractivePane() { - return new VanChartCustomInteractivePane(); - } - - @Override - protected BasicBeanPane createConditionAttrPane() { - return new VanChartCustomConditionAttrPane(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java deleted file mode 100644 index 18285dfd16..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.design.dialog.BasicPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.other.VanChartConditionAttrPane; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotConditionAttrTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected void initTabTitle() { - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[paneList.size()]; - for (int i = 0, j = 0 ; i < paneList.size() && j < customPlotList.size(); i++, j++) { - if (customPlotList.get(j).isSupportDataSeriesCondition()) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(j); - - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - }else { - //如果不支持,则i不动 - i -- ; - } - } - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - if (customPlotList.get(i).isSupportDataSeriesCondition()) { - //根据不同的plot创建不同的数据配置界面 - VanChartConditionAttrPane contentPane = new VanChartConditionAttrPane(); - - paneList.add(contentPane); - } - } - - return paneList; - } - - @Override - public void populateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0, j = 0 ; i < paneList.size() && j < customPlotList.size(); i++, j++){ - if (customPlotList.get(j).isSupportDataSeriesCondition()) { - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(j); - - ((VanChartConditionAttrPane) paneList.get(i)).populateBean(vanChartPlot); - }else { - i -- ; - } - } - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0, j = 0; i < paneList.size() && j < customPlotList.size(); i++, j++){ - if (customPlotList.get(j).isSupportDataSeriesCondition()) { - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(j); - - VanChartConditionAttrPane conditionPane = (VanChartConditionAttrPane) paneList.get(i); - - conditionPane.updateBean(vanChartPlot); - }else { - i --; - } - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkPane.java deleted file mode 100644 index 56f5bff185..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkPane.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.dialog.BasicScrollPane; -import com.fr.plugin.chart.custom.VanChartCustomPlot; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomPlotHyperlinkPane extends BasicScrollPane { - private VanChartCustomPlotHyperlinkTabPane linkPane; - protected Chart chart; - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initLinkPane((VanChartCustomPlot) chart.getPlot()); - if(linkPane != null) { - contentPane.add(linkPane, BorderLayout.CENTER); - } - return contentPane; - } - - private void initLinkPane(VanChartCustomPlot plot) { - linkPane = new VanChartCustomPlotHyperlinkTabPane(plot, null); - } - - @Override - public void populateBean(Chart chart) { - this.chart = chart; - if(linkPane == null) { - this.remove(leftcontentPane); - layoutContentPane(); - } - if(linkPane != null) { - linkPane.populateBean((VanChartCustomPlot)chart.getPlot()); - } - } - - @Override - public void updateBean(Chart chart) { - this.chart = chart; - - if(linkPane != null) { - linkPane.updateBean((VanChartCustomPlot) chart.getPlot()); - } - } - - @Override - protected void layoutContentPane() { - leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); - this.setLayout(new BorderLayout()); - this.add(leftcontentPane, BorderLayout.CENTER); - } - - @Override - protected String title4PopupWindow() { - return null; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkTabPane.java deleted file mode 100644 index 073a845207..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomPlotHyperlinkTabPane.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.fr.plugin.chart.custom.other; - -import com.fr.design.dialog.BasicPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.component.VanChartHyperLinkPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/28. - */ -public class VanChartCustomPlotHyperlinkTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotHyperlinkTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected void initTabTitle() { - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(i); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - String name = CustomPlotFactory.getTitle(plotType); - NameArray[i] = name.length() > 3 ? name.substring(0, 3) : name; - centerPane.add(pane, NameArray[i]); - } - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plot创建不同的数据配置界面 - VanChartHyperLinkPane contentPane = new VanChartHyperLinkPane(); - - paneList.add(contentPane); - } - - return paneList; - } - - @Override - public void populateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - ((VanChartHyperLinkPane)paneList.get(i)).populate(vanChartPlot); - } - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - ((VanChartHyperLinkPane)paneList.get(i)).update(vanChartPlot); - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAreaPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAreaPane.java deleted file mode 100644 index 61c99cd406..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAreaPane.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.plugin.chart.custom.component.VanChartCustomAreaBackgroundPane; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.background.VanChartAreaPane; - -/** - * Created by Fangjie on 2016/5/19. - */ -public class VanChartCustomAreaPane extends VanChartAreaPane { - public VanChartCustomAreaPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - @Override - protected void initPlotPane(boolean b, AbstractAttrNoScrollPane parent) { - plotPane = new VanChartCustomAreaBackgroundPane(true, parent); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisAreaPane.java deleted file mode 100644 index 916452aabe..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisAreaPane.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane; - -import java.util.List; - - -/** - * Created by Fangjie on 2016/5/19. - */ -public class VanChartCustomAxisAreaPane extends VanChartAxisAreaPane { - - - @Override - public void updateBean(Plot plot){ - VanChartCustomPlot customPlot = (VanChartCustomPlot)plot; - - super.updateBean(customPlot); - - List vanChartPlotList = customPlot.getCustomPlotList(); - - //更新后同步坐标轴 - CustomPlotFactory.axisSynchronization(customPlot); - - //使用其他坐标轴的图形 - for (int i = 0; i < vanChartPlotList.size(); i++){ - if (vanChartPlotList.get(i).isSupportPlotBackground() && CustomPlotDesignerPaneFactory.isUseDiffAxisPane(vanChartPlotList.get(i))){ - super.updateBean(vanChartPlotList.get(i)); - } - } - } - - - public void populateBean(Plot plot){ - VanChartCustomPlot customPlot = (VanChartCustomPlot)plot; - - if (customPlot.isHaveStandardAxis()){ - super.populateBean(customPlot); - } else { - List vanChartPlotList = customPlot.getCustomPlotList(); - //使用其他坐標軸的圖形 - for (int i = 0; i < vanChartPlotList.size(); i++) { - if (vanChartPlotList.get(i).isSupportPlotBackground() && CustomPlotDesignerPaneFactory.isUseDiffAxisPane(vanChartPlotList.get(i))) { - super.populateBean(vanChartPlotList.get(i)); - } - } - } - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisPane.java deleted file mode 100644 index b7e226d629..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisPane.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.dialog.BasicScrollPane; -import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.vanchart.VanChart; - -import javax.swing.*; -import java.awt.*; - - -/** - * Created by Fangjie on 2016/4/27. - */ -public class VanChartCustomAxisPane extends BasicScrollPane { - private static final long serialVersionUID = -2974722365840564105L; - private VanChartCustomAxisTabPane axisPane; - private Chart chart; - protected VanChartStylePane parent; - - public VanChartCustomAxisPane(VanChartStylePane parent) { - super(); - this.parent = parent; - } - - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initAxisPane((VanChartCustomPlot) chart.getPlot()); - contentPane.add(axisPane, BorderLayout.CENTER); - return contentPane; - } - - private void initAxisPane(VanChartCustomPlot plot) { - axisPane = new VanChartCustomAxisTabPane(plot, parent); - } - - @Override - public void populateBean(Chart chart) { - this.chart = chart; - - if(axisPane == null){ - this.remove(leftcontentPane); - layoutContentPane(); - parent.initAllListeners(); - } - - if(axisPane != null) { - axisPane.populateBean((VanChartCustomPlot) chart.getPlot()); - } - } - - @Override - public void updateBean(Chart chart){ - if(chart == null){ - return; - } - VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot(); - axisPane.updateBean(plot); - } - - @Override - protected void layoutContentPane() { - leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder()); - this.setLayout(new BorderLayout()); - this.add(leftcontentPane, BorderLayout.CENTER); - } - - @Override - public VanChart updateBean() { - return null; - } - - @Override - protected String title4PopupWindow() { - return PaneTitleConstants.CHART_STYLE_AXIS_TITLE; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisTabPane.java deleted file mode 100644 index 8fc7a774c1..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomAxisTabPane.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.design.dialog.BasicPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotAxisPane; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane; -import com.fr.plugin.chart.vanchart.VanChart; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/27. - */ -public class VanChartCustomAxisTabPane extends VanChartCustomPlotTabPane { - - public VanChartCustomAxisTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - VanChartCustomPlot customPlot = plot; - - List customPlotList = customPlot.getCustomPlotList(); - - /** - * 判断是否有使用标准坐标轴的点 - */ - ArrayList plotOrder = customPlot.getDiffAxisOrder(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plotOrder创建不同的数据配置界面 - if (plotOrder.contains(i)) { - VanChartAxisPane contentPane = CustomPlotDesignerPaneFactory.createAxisPane((VanChartAxisPlot) customPlotList.get(i), (VanChartStylePane) parent); - paneList.add(contentPane); - } - } - - //判断是否使用标准坐标轴系,标准坐标系即使用customPlot的坐标轴属性,如果有,放在最后 - if (customPlot.isHaveStandardAxis()){ - VanChartAxisPane contentPane = new VanChartCustomPlotAxisPane(customPlot, (VanChartStylePane) parent); - paneList.add(contentPane); - } - - return paneList; - } - - @Override - protected void initTabTitle(){ - VanChartCustomPlot customPlot = plot; - List customPlotList = customPlot.getCustomPlotList(); - ArrayList plotOrder = customPlot.getDiffAxisOrder(); - - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - - - for (int i = 0;i < paneList.size() && i < plotOrder.size(); i++) { - JPanel pane = paneList.get(i); - - VanChartPlot vanChartPlot = customPlotList.get(plotOrder.get(i)); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - } - - //如果有标准坐标系,则放在最后一个tab按钮上 - if (customPlot.isHaveStandardAxis()){ - JPanel pane = paneList.get(paneList.size() - 1); - - //获取点的tooltip作为标题 - NameArray[paneList.size() - 1] = Inter.getLocText("Plugin-ChartF_Rectangular_Coordinate_System"); - centerPane.add(pane, NameArray[paneList.size() - 1]); - } - } - - @Override - /** - * 标准坐标轴属性存在最外层的customPlot的坐标轴变量中 - * 不使用标准坐标轴的坐标轴属性存在相应的plot中的坐标轴变量中 - */ - public void populateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - - ArrayList plotOrder = plot.getDiffAxisOrder(); - - for (int i = 0; i < paneList.size() && i < plotOrder.size(); i++){ - //先更新标准坐标轴界面 - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(plotOrder.get(i)); - ((VanChartAxisPane)paneList.get(i)).populateBean(vanChartPlot); - } - - if (plot.isHaveStandardAxis()){ - ((VanChartAxisPane)paneList.get(paneList.size() - 1)).populateBean(plot); - - } - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - VanChartCustomPlot customPlot = plot; - List customPlotList = customPlot.getCustomPlotList(); - - ArrayList plotOrder = customPlot.getDiffAxisOrder(); - - for (int i = 0; i < paneList.size() && i < plotOrder.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(plotOrder.get(i)); - ((VanChartAxisPane)paneList.get(i)).updateBean(vanChartPlot); - } - - if (customPlot.isHaveStandardAxis()){ - //用VanChart包裝plot - VanChart chart = new VanChart(); - chart.setPlot(customPlot); - ((VanChartAxisPane)paneList.get(paneList.size() - 1)).updateBean(chart); - - } - - //将标准坐标轴属性存入使用标准坐标轴的点的坐标轴变量中 - CustomPlotFactory.axisSynchronization(plot); - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomLabelPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomLabelPane.java deleted file mode 100644 index 1fc0affd55..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomLabelPane.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.fr.plugin.chart.custom.style; - - -import com.fr.chart.chartattr.Chart; -import com.fr.design.dialog.BasicScrollPane; -import com.fr.design.mainframe.chart.PaneTitleConstants; - -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomLabelPane extends BasicScrollPane { - private VanChartCustomPlotLabelTabPane labelPane; - private Chart chart; - protected VanChartStylePane parent; - private static final long serialVersionUID = -5449293740965811991L; - - public VanChartCustomLabelPane(VanChartStylePane parent) { - super(); - this.parent = parent; - } - - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initLabelPane((VanChartCustomPlot) chart.getPlot()); - - contentPane.add(labelPane, BorderLayout.NORTH); - return contentPane; - } - - private void initLabelPane(VanChartCustomPlot plot) { - labelPane = new VanChartCustomPlotLabelTabPane(plot, parent); - } - - @Override - public void populateBean(Chart chart) { - this.chart = chart; - - if(labelPane == null){ - this.remove(leftcontentPane); - layoutContentPane(); - parent.initAllListeners(); - } - - if(labelPane != null) { - labelPane.populateBean((VanChartCustomPlot)chart.getPlot()); - } - } - - - @Override - public void updateBean(Chart chart) { - if(chart == null) { - return; - } - - labelPane.updateBean((VanChartCustomPlot)chart.getPlot()); - } - - @Override - protected String title4PopupWindow() { - return PaneTitleConstants.CHART_STYLE_LABEL_TITLE; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotLabelTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotLabelTabPane.java deleted file mode 100644 index 944f4719d7..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotLabelTabPane.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.base.DataSeriesCondition; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.dialog.BasicPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.PlotFactory; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomPlotLabelTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotLabelTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected void initTabTitle() { - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(i); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - } - } - - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plot创建不同的数据配置界面 - VanChartPlotLabelPane contentPane = PlotFactory.createPlotLabelPane(customPlotList.get(i), (VanChartStylePane) parent); - - paneList.add(contentPane); - } - - return paneList; - } - - @Override - public void populateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - DataSeriesCondition attr = vanChartPlot.getAttrLabelFromConditionCollection(); - ((VanChartPlotLabelPane)paneList.get(i)).populate((AttrLabel) attr); - } - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - - if (plot == null){ - return; - } - - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) { - ConditionAttr attrList = customPlotList.get(i).getConditionCollection().getDefaultAttr(); - DataSeriesCondition attr = customPlotList.get(i).getAttrLabelFromConditionCollection(); - if (attr != null) { - attrList.remove(attr); - } - - VanChartPlotLabelPane labelPane = (VanChartPlotLabelPane) paneList.get(i); - AttrLabel attrLabel = labelPane.update(); - - if (attrLabel != null) { - attrList.addDataSeriesCondition(attrLabel); - } - - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesPane.java deleted file mode 100644 index c6276c4db3..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesPane.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; - -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/26. - */ -public class VanChartCustomPlotSeriesPane extends BasicBeanPane { - private static final int WIDTH = 236; - private static final int DELTA_HEIGHT = 300; - private BasicBeanPane axisPane; - private AbstractPlotSeriesPane seriesPane; - public VanChartCustomPlotSeriesPane(BasicBeanPane axisPane, AbstractPlotSeriesPane seriesPane) { - this.axisPane = axisPane; - this.seriesPane = seriesPane; - - initContentPane(); - } - - private void initContentPane() { - - seriesPane.setPreferredSize(new Dimension(WIDTH, (int) (seriesPane.getPreferredSize().getHeight() + DELTA_HEIGHT))); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double[] columnSize = {f}; - double[] rowSize = {p, p, p}; - - if (axisPane == null) { - this.add(seriesPane); - }else { - Component[][] components = new Component[][]{ - new Component[]{axisPane}, - new Component[]{seriesPane} - }; - this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize)); - } - - } - - - @Override - protected String title4PopupWindow() { - return null; - } - - @Override - public void populateBean(Plot plot) { - //获取位置信息 - if (axisPane != null) { - axisPane.populateBean(plot); - } - //获取界面信息 - seriesPane.populateBean(plot); - } - - @Override - public void updateBean(Plot plot) { - if(plot == null) { - return; - } - if(seriesPane != null) { - seriesPane.updateBean(plot); - } - if (axisPane != null){ - axisPane.updateBean(plot); - } - } - - @Override - public Plot updateBean() { - return null; - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesTabPane.java deleted file mode 100644 index 5171f0be2c..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotSeriesTabPane.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.dialog.BasicPane; -import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.CustomPlotDesignerPaneFactory; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomPlotSeriesTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotSeriesTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected void initTabTitle() { - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(i); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - } - } - - @Override - protected List initPaneList() { - /** - * 獲取不同plot的系列面板 - */ - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plot创建不同的数据配置界面 - AbstractPlotSeriesPane seriesPane = (AbstractPlotSeriesPane) ChartTypeInterfaceManager.getInstance().getPlotSeriesPane((VanChartStylePane)parent, customPlotList.get(i)); - //根据不同的plot获取不同的控制控制位置界面,从Factory中获取 - BasicBeanPane plotPositionPane = CustomPlotDesignerPaneFactory.createCustomPlotPositionPane(customPlotList.get(i)); - - VanChartCustomPlotSeriesPane contentPane = new VanChartCustomPlotSeriesPane(plotPositionPane, seriesPane); - - paneList.add(contentPane); - } - - return paneList; - } - - @Override - public void populateBean(VanChartCustomPlot plot) { - /** - * 更新各个点的系列界面 - */ - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - - ((VanChartCustomPlotSeriesPane)paneList.get(i)).populateBean(vanChartPlot); - } - - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - /** - * 更新每个图表的数据 - */ - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - - VanChartCustomPlotSeriesPane plotSeriesPane = (VanChartCustomPlotSeriesPane) paneList.get(i); - - plotSeriesPane.updateBean(vanChartPlot); - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotTooltipTabPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotTooltipTabPane.java deleted file mode 100644 index 09bdddb9fd..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomPlotTooltipTabPane.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.base.DataSeriesCondition; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.dialog.BasicPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane; -import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.plugin.chart.designer.PlotFactory; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; - -import javax.swing.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomPlotTooltipTabPane extends VanChartCustomPlotTabPane { - public VanChartCustomPlotTooltipTabPane(VanChartCustomPlot plot, BasicPane parent) { - super(plot, parent); - } - - @Override - protected void initTabTitle() { - List customPlotList = plot.getCustomPlotList(); - NameArray = new String[Math.min(customPlotList.size(), paneList.size())]; - for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) { - JPanel pane = paneList.get(i); - //获取点的tooltip作为标题 - VanChartPlot vanChartPlot = customPlotList.get(i); - CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); - - NameArray[i] = CustomPlotFactory.getTitle(plotType); - centerPane.add(pane, NameArray[i]); - } - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - List customPlotList = plot.getCustomPlotList(); - - for (int i = 0; i < customPlotList.size(); i++){ - //根据不同的plot创建不同的数据配置界面 - VanChartPlotTooltipPane contentPane = PlotFactory.createPlotTooltipPane(customPlotList.get(i), (VanChartStylePane) parent); - paneList.add(contentPane); - } - - return paneList; - } - - @Override - public void populateBean(VanChartCustomPlot plot) { - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - DataSeriesCondition attr = vanChartPlot.getAttrTooltipFromConditionCollection(); - ((VanChartPlotTooltipPane)paneList.get(i)).populate((AttrTooltip) attr); - } - } - - @Override - public VanChartCustomPlot updateBean() { - return null; - } - - @Override - public void updateBean(VanChartCustomPlot plot) { - if(plot == null) { - return; - } - - List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++){ - //获取相应点的属性,并更新界面 - VanChartPlot vanChartPlot = customPlotList.get(i); - - ConditionAttr attrList = vanChartPlot.getConditionCollection().getDefaultAttr(); - - //移除所有数据点提示相关属性 - if(attrList.getExisted(AttrTooltip.class) != null){ - attrList.remove(AttrTooltip.class); - }else if (attrList.getExisted(ScatterAttrTooltip.class) != null){ - attrList.remove(ScatterAttrTooltip.class); - } - - VanChartPlotTooltipPane tooltipPane = (VanChartPlotTooltipPane) paneList.get(i); - - AttrTooltip attrTooltip = tooltipPane.update(); - if (attrTooltip != null) { - attrList.addDataSeriesCondition(attrTooltip); - } - } - } - - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public String title4PopupWindow() { - return null; - } - - @Override - public void reset() { - - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java deleted file mode 100644 index cc10070022..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; -import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; -import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.component.VanChartBeautyPane; -import com.fr.plugin.chart.designer.component.VanChartFillStylePane; - -import javax.swing.*; -import java.awt.*; - - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomSeriesPane extends ChartSeriesPane { - - private JPanel seriesPane; - protected VanChartCustomPlotSeriesTabPane plotSeriesPane; - private ChartFillStylePane fillStylePane;//配色 - private VanChartBeautyPane stylePane;//风格 - - - - public VanChartCustomSeriesPane(ChartStylePane parent) { - super(parent); - } - - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initSeriesPane((VanChartCustomPlot) chart.getPlot()); - - plotSeriesPane.setBorder(BorderFactory.createEmptyBorder()); - - //公共使用的部分 - seriesPane.add(plotSeriesPane, BorderLayout.CENTER); - - //每种不同的图表单独的设置部分 - if(seriesPane != null) { - contentPane.add(seriesPane, BorderLayout.CENTER); - } - return contentPane; - } - - /** - * 创建組合图系列界面 - */ - private void initSeriesPane(VanChartCustomPlot plot) { - - seriesPane = new JPanel(new BorderLayout(0, 10)); - //获取公共的属性面板 - seriesPane.add(initCommonPane(), BorderLayout.NORTH); - - plotSeriesPane = new VanChartCustomPlotSeriesTabPane(plot, parent); - } - - private JPanel initCommonPane() { - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p}; - double[] col = {f}; - - fillStylePane = new VanChartFillStylePane(); - - stylePane = new VanChartBeautyPane(); - - Component[][] components = new Component[][]{ - new Component[]{fillStylePane}, //配色 - new Component[]{stylePane},//风格 - }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); - return panel; - } - - /** - * 保存界面属性 - */ - @Override - public void updateBean(Chart chart) { - - if(chart == null) { - return; - } - - VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot(); - - if (fillStylePane != null){ - plot.setPlotFillStyle(fillStylePane.updateBean()); - } - if(stylePane != null) { - plot.setPlotStyle(stylePane.updateBean()); - - //风格属性传递 - for (int i = 0; i < plot.getCustomPlotList().size(); i++){ - VanChartPlot vanChartPlot = plot.getCustomPlotList().get(i); - vanChartPlot.setPlotStyle(plot.getPlotStyle()); - } - - } - if (seriesPane != null){ - plotSeriesPane.updateBean(plot); - } - } - - /** - * 更新界面 - */ - @Override - public void populateBean(Chart chart) { - this.chart = chart; - if(seriesPane == null) { - this.remove(leftcontentPane); - layoutContentPane(); - parent.initAllListeners(); - } - if(seriesPane != null) { - //更新渐变色和风格 - VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot(); - if(plot == null) { - return; - } - - - if(fillStylePane != null) {//配色 - fillStylePane.populateBean(plot.getPlotFillStyle()); - } - if(stylePane != null){//风格 - stylePane.populateBean(plot.getPlotStyle()); - } - - //更新不同点的系列界面 - plotSeriesPane.populateBean(plot); - } - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomStylePane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomStylePane.java deleted file mode 100644 index 9ce02be6a6..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomStylePane.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; -import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; -import com.fr.plugin.chart.custom.CustomPlotFactory; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import java.util.List; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomStylePane extends VanChartStylePane { - public VanChartCustomStylePane(AttributeChangeListener listener) { - super(listener); - } - - /** - * 根据不同的plot类型创建不同的标签界面 - * @param paneList - */ - @Override - protected void createVanChartLabelPane(List paneList) { - paneList.add(new VanChartCustomLabelPane(VanChartCustomStylePane.this)); - } - - /** - * 根据不同的plot类型创建不同的数据点提示界面 - * @param paneList - */ - @Override - protected void addVanChartTooltipPane(List paneList){ - paneList.add(new VanChartCustomTooltipPane(VanChartCustomStylePane.this)); - } - - /** - * 组合图以外的新图表类型都是使用ChartSeriesPane然后通过接口创建不同的seriesStyleContentPane - * 组合图类型不走那个接口,因为需要的系列界面完全是新的,需要像标签界面那样处理 - * @return - */ - @Override - protected ChartSeriesPane createChartSeriesPane() { - return new VanChartCustomSeriesPane(VanChartCustomStylePane.this); - } - - /** - * 当所有图表都不支持坐标轴时,则无坐标轴选项,否则创建和自定义柱形图一样的坐标轴 - * @param paneList - */ - @Override - protected void createVanChartAxisPane(List paneList, VanChartAxisPlot plot) { - paneList.add(new VanChartCustomAxisPane(VanChartCustomStylePane.this)); - } - - - @Override - protected void addVanChartAreaPane(List paneList) { - paneList.add(new VanChartCustomAreaPane(getChart().getPlot(), VanChartCustomStylePane.this)); - } - - @Override - public void update(ChartCollection collection) { - super.update(collection); - CustomPlotFactory.dataSheetSynchronization((VanChartCustomPlot) collection.getSelectedChart().getPlot()); - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomTooltipPane.java deleted file mode 100644 index 5a2ec5bbfc..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomTooltipPane.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.fr.plugin.chart.custom.style; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.dialog.BasicScrollPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Fangjie on 2016/4/22. - */ -public class VanChartCustomTooltipPane extends BasicScrollPane { - - private static final long serialVersionUID = -2974722365840564105L; - private VanChartCustomPlotTooltipTabPane tooltipPane; - private Chart chart; - protected VanChartStylePane parent; - - - public VanChartCustomTooltipPane(VanChartStylePane parent){ - super(); - this.parent = parent; - } - - @Override - protected JPanel createContentPane() { - JPanel contentPane = new JPanel(new BorderLayout()); - if(chart == null) { - return contentPane; - } - initTooltipPane((VanChartCustomPlot) chart.getPlot()); - contentPane.add(tooltipPane, BorderLayout.NORTH); - return contentPane; - } - - private void initTooltipPane(VanChartCustomPlot plot) { - tooltipPane = new VanChartCustomPlotTooltipTabPane(plot, parent); - } - - - @Override - public void populateBean(Chart chart) { - this.chart = chart; - - if(tooltipPane == null){ - this.remove(leftcontentPane); - layoutContentPane(); - parent.initAllListeners(); - } - - if(tooltipPane != null) { - tooltipPane.populateBean((VanChartCustomPlot) chart.getPlot()); - } - } - - @Override - public void updateBean(Chart chart) { - if(chart == null) { - return; - } - - tooltipPane.updateBean((VanChartCustomPlot)chart.getPlot()); - - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Plugin-Chart_Tooltip"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java deleted file mode 100644 index 6ddb55372f..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.plugin.chart.designer; - -import com.fr.design.dialog.BasicScrollPane; -import com.fr.design.gui.iscrollbar.UIScrollBar; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by mengao on 2017/8/11. - */ -public abstract class AbstractVanChartScrollPane extends BasicScrollPane { - - protected void layoutContentPane() { - leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original)); - this.add(leftcontentPane); - } - - protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { - int width = parent.getWidth(); - int height = parent.getHeight(); - if (leftcontentPane.getPreferredSize().height > maxheight) { - scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, 6, height); - leftcontentPane.setBounds(0, -beginY, width - 6, height + beginY); - leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 4, 0, 4, original)); - - } else { - leftcontentPane.setBounds(0, 0, width, height); - leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 4, 0, 10, original)); - } - } - public void reloaPane(JPanel pane){ - super.reloaPane(pane); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder()); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java b/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java deleted file mode 100644 index 0601b5e45b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java +++ /dev/null @@ -1,369 +0,0 @@ -package com.fr.plugin.chart.designer; - -import com.fr.base.chart.chartdata.model.LargeDataModel; -import com.fr.chart.chartattr.Plot; -import com.fr.data.core.FormatField; -import com.fr.design.gui.icombobox.UIComboBoxRenderer; -import com.fr.design.gui.style.FormatPane; -import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; -import com.fr.general.Inter; -import com.fr.plugin.chart.area.VanChartAreaPlot; -import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.bubble.force.VanChartBubbleRefreshTooltipPane; -import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.designer.component.VanChartLabelContentPane; -import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane; -import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane; -import com.fr.plugin.chart.designer.style.HeatMapRangeLegendPane; -import com.fr.plugin.chart.designer.style.VanChartPlotLegendPane; -import com.fr.plugin.chart.designer.style.VanChartRangeLegendPane; -import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.plugin.chart.designer.style.VanLegendPaneWidthOutHighlight; -import com.fr.plugin.chart.designer.style.label.VanChartGaugePlotLabelPane; -import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; -import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.funnel.VanChartFunnelPlot; -import com.fr.plugin.chart.funnel.designer.style.VanChartFunnelLabelContentPane; -import com.fr.plugin.chart.funnel.designer.style.VanChartFunnelRefreshTooltipContentPane; -import com.fr.plugin.chart.funnel.designer.style.VanChartFunnelTooltipContentPane; -import com.fr.plugin.chart.gantt.VanChartGanttPlot; -import com.fr.plugin.chart.gantt.designer.style.VanChartGanttLabelContentPane; -import com.fr.plugin.chart.gantt.designer.style.tooltip.VanChartGanttPlotTooltipPane; -import com.fr.plugin.chart.gantt.designer.style.tooltip.VanChartGanttTooltipContentPane; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; -import com.fr.plugin.chart.gauge.VanChartGaugePlotRefreshTooltipPane; -import com.fr.plugin.chart.gauge.VanChartGaugePlotTooltipPane; -import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; -import com.fr.plugin.chart.line.VanChartLinePlot; -import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.map.designer.style.label.VanChartMapLabelContentPane; -import com.fr.plugin.chart.map.designer.style.tooltip.VanChartMapRefreshTooltipContentPane; -import com.fr.plugin.chart.map.designer.style.tooltip.VanChartMapTooltipContentPane; -import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; -import com.fr.plugin.chart.multilayer.style.VanChartMultiPieLabelContentPane; -import com.fr.plugin.chart.multilayer.style.VanChartMultiPiePlotTooltipPane; -import com.fr.plugin.chart.multilayer.style.VanChartMultiPieTooltipContentPane; -import com.fr.plugin.chart.multilayer.style.VanChartMutiPieRefreshTooltipContentPane; -import com.fr.plugin.chart.scatter.VanChartScatterPlot; -import com.fr.plugin.chart.scatter.VanChartScatterPlotTooltipPane; -import com.fr.plugin.chart.scatter.VanChartScatterRefreshTooltipContentPane; -import com.fr.plugin.chart.scatter.component.label.VanChartScatterPlotLabelPane; -import com.fr.plugin.chart.structure.VanChartStructurePlot; -import com.fr.plugin.chart.structure.desinger.style.VanChartStructureLabelContentPane; -import com.fr.plugin.chart.structure.desinger.style.VanChartStructureRefreshTooltipContentPane; -import com.fr.plugin.chart.structure.desinger.style.VanChartStructureTooltipContentPane; -import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; -import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; -import com.fr.plugin.chart.wordcloud.designer.style.VanChartWordCloudRefreshTootipContentPane; -import com.fr.plugin.chart.wordcloud.designer.style.VanChartWordCloudTooltipContentPane; - -import javax.swing.*; -import java.awt.*; -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * Created by Mitisky on 16/3/1. - * 图表配置界面的工厂 - */ -public class PlotFactory { - - private static Set> autoAdjustLabelPlots = new HashSet>(); - - static { - autoAdjustLabelPlots.add(VanChartColumnPlot.class); - autoAdjustLabelPlots.add(VanChartLinePlot.class); - autoAdjustLabelPlots.add(VanChartAreaPlot.class); - autoAdjustLabelPlots.add(VanChartStructurePlot.class); - } - - public static boolean plotAutoAdjustLabelPosition(Plot plot){ - return autoAdjustLabelPlots.contains(plot.getClass()); - } - /** - * - * 标签Map - */ - private static Map, Class> labelMap = new HashMap, Class>(); - static { - labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); - labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); - labelMap.put(VanChartBubblePlot.class, VanChartScatterPlotLabelPane.class); - } - - /** - * 图例Map - */ - private static Map, Class> legendMap = new HashMap, Class>(); - static { - legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class); - legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class); - legendMap.put(VanChartScatterPlot.class, VanChartRangeLegendPane.class); - legendMap.put(VanChartBubblePlot.class, VanChartRangeLegendPane.class); - legendMap.put(VanChartMapPlot.class, VanChartRangeLegendPane.class); - legendMap.put(VanChartDrillMapPlot.class, VanChartRangeLegendPane.class); - legendMap.put(VanChartHeatMapPlot.class, HeatMapRangeLegendPane.class); - legendMap.put(VanChartWordCloudPlot.class, VanChartRangeLegendPane.class); - } - - /** - * 数据点提示Map - */ - private static Map, Class> toolTipMap = new HashMap, Class>(); - static { - toolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotTooltipPane.class); - toolTipMap.put(VanChartScatterPlot.class, VanChartScatterPlotTooltipPane.class); - toolTipMap.put(VanChartBubblePlot.class, VanChartScatterPlotTooltipPane.class); - toolTipMap.put(VanChartMultiPiePlot.class, VanChartMultiPiePlotTooltipPane.class); - toolTipMap.put(VanChartTreeMapPlot.class, VanChartMultiPiePlotTooltipPane.class); - toolTipMap.put(VanChartGanttPlot.class, VanChartGanttPlotTooltipPane.class); - } - - private static Map, Class> labelContentMap = new HashMap, Class>(); - - static { - labelContentMap.put(VanChartMapPlot.class, VanChartMapLabelContentPane.class); - labelContentMap.put(VanChartDrillMapPlot.class, VanChartMapLabelContentPane.class); - labelContentMap.put(VanChartMultiPiePlot.class, VanChartMultiPieLabelContentPane.class); - labelContentMap.put(VanChartTreeMapPlot.class, VanChartMultiPieLabelContentPane.class); - labelContentMap.put(VanChartFunnelPlot.class, VanChartFunnelLabelContentPane.class); - labelContentMap.put(VanChartHeatMapPlot.class, VanChartMapLabelContentPane.class); - labelContentMap.put(VanChartGanttPlot.class, VanChartGanttLabelContentPane.class); - labelContentMap.put(VanChartStructurePlot.class, VanChartStructureLabelContentPane.class); - } - - private static Map, Class> tooltipContentMap = new HashMap, Class>(); - - static { - tooltipContentMap.put(VanChartMapPlot.class, VanChartMapTooltipContentPane.class); - tooltipContentMap.put(VanChartDrillMapPlot.class, VanChartMapTooltipContentPane.class); - tooltipContentMap.put(VanChartMultiPiePlot.class, VanChartMultiPieTooltipContentPane.class); - tooltipContentMap.put(VanChartTreeMapPlot.class, VanChartMultiPieTooltipContentPane.class); - tooltipContentMap.put(VanChartFunnelPlot.class, VanChartFunnelTooltipContentPane.class); - tooltipContentMap.put(VanChartHeatMapPlot.class, VanChartMapTooltipContentPane.class); - tooltipContentMap.put(VanChartWordCloudPlot.class, VanChartWordCloudTooltipContentPane.class); - tooltipContentMap.put(VanChartGanttPlot.class, VanChartGanttTooltipContentPane.class); - tooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureTooltipContentPane.class); - } - - - - /** - * 监控刷新 自动数据点提示Map - */ - - - private static Map, Class> refreshToolTipMap = new HashMap, Class>(); - static { - refreshToolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotRefreshTooltipPane.class); - refreshToolTipMap.put(VanChartBubblePlot.class, VanChartBubbleRefreshTooltipPane.class); - - } - private static Map, Class> refreshTooltipContentMap = new HashMap, Class>(); - - static { - refreshTooltipContentMap.put(VanChartMapPlot.class, VanChartMapRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartHeatMapPlot.class, VanChartMapRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartDrillMapPlot.class, VanChartMapRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartScatterPlot.class, VanChartScatterRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartBubblePlot.class, VanChartScatterRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartMultiPiePlot.class, VanChartMutiPieRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartTreeMapPlot.class, VanChartMutiPieRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartFunnelPlot.class, VanChartFunnelRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartWordCloudPlot.class, VanChartWordCloudRefreshTootipContentPane.class); - refreshTooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureRefreshTooltipContentPane.class); - - } - - /** - * 根据图表类型创建标签界面 - * @param plot 图表 - * @param stylePane 样式界面 - * @return 标签界面 - */ - public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) { - Class key = plot.getClass(); - if(labelMap.containsKey(key)){ - try{ - Class cl = labelMap.get(key); - Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); - return constructor.newInstance(plot, stylePane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartPlotLabelPane(plot, stylePane); - } - - /** - * 根据图表类型创建图例界面 - * @param plot 图表 - * @param stylePane 样式界面 - * @return 图例界面 - */ - public static VanChartPlotLegendPane createPlotLegendPane(Plot plot, VanChartStylePane stylePane) { - Class key = plot.getClass(); - if(legendMap.containsKey(key)){ - try{ - Class cl = legendMap.get(key); - Constructor constructor = cl.getConstructor(VanChartStylePane.class); - return constructor.newInstance(stylePane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartPlotLegendPane(stylePane); - } - - /** - * 根据图表类型创建数据点提示界面 - * @param plot 图表 - * @param stylePane 样式界面 - * @return 数据点提示界面 - */ - public static VanChartPlotTooltipPane createPlotTooltipPane(Plot plot, VanChartStylePane stylePane) { - Class key = plot.getClass(); - if(toolTipMap.containsKey(key)){ - try{ - Class cl = toolTipMap.get(key); - Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); - return constructor.newInstance(plot, stylePane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartPlotTooltipPane(plot, stylePane); - } - - /** - * 根据图表类型创建标签的具体内容界面.分类名系列名等 - * @param plot 图表 - * @param parent 样式界面 - * @param showOnPane formatpane用到 - * @return 标签的具体内容界面 - */ - public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ - Class key = plot.getClass(); - if(labelContentMap.containsKey(key)){ - try{ - Class cl = labelContentMap.get(key); - Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); - return constructor.newInstance(parent, showOnPane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartLabelContentPane(parent, showOnPane); - } - - /** - * 根据图表类型创建数据点提示的具体内容界面.分类名系列名等 - * @param plot 图表 - * @param parent 样式界面 - * @param showOnPane formatpane用到 - * @return 数据点提示的具体内容界面 - */ - public static VanChartTooltipContentPane createPlotTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ - Class key = plot.getClass(); - if(tooltipContentMap.containsKey(key)){ - try{ - Class cl = tooltipContentMap.get(key); - Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); - return constructor.newInstance(parent, showOnPane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartTooltipContentPane(parent, showOnPane); - } - - - - /** - * 根据图表类型创建数据点提示界面 - * @param plot 图表 - * @return 数据点提示界面 - */ - public static VanChartPlotTooltipPane createPlotRefreshTooltipPane(Plot plot) { - Class key = plot.getClass(); - if(refreshToolTipMap.containsKey(key)){ - try{ - Class cl = refreshToolTipMap.get(key); - Constructor constructor = cl.getConstructor(Plot.class); - return constructor.newInstance(plot); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartPlotRefreshTooltipPane(plot); - } - /** - * 根据图表类型创建监控刷新中数据点提示的具体内容界面.分类名系列名等 - * @param plot 图表 - * @param parent 交互属性界面 - * @param showOnPane formatpane用到 - * @return 数据点提示的具体内容界面 - */ - public static VanChartTooltipContentPane createPlotRefreshTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ - Class key = plot.getClass(); - if(refreshTooltipContentMap.containsKey(key)){ - try{ - Class cl = refreshTooltipContentMap.get(key); - Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); - return constructor.newInstance(parent, showOnPane); - } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); - } - } - return new VanChartRefreshTooltipContentPane(parent, showOnPane); - } - - public static FormatPane createAutoFormatPane(){ - FormatPane formatPane = new FormatPane(){ - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { - typePane.setBorder(BorderFactory.createEmptyBorder()); - return new Component[][]{ - new Component[]{typePane,null}, - new Component[]{centerPane, null}, - }; - } - protected UIComboBoxRenderer createComBoxRender(){ - return new UIComboBoxRenderer() { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof Integer) { - String text = ComparatorUtils.equals(value, FormatField.FormatContents.NULL) - ? Inter.getLocText("Plugin-ChartF_Auto") - : FormatField.getInstance().getName((Integer) value); - label.setText(" " + text); - } - return label; - } - }; - } - }; - - formatPane.setComboBoxModel(true); - - return formatPane; - } - - /** - * 判断是否为大数据模式 - */ - public static boolean largeDataModel(Plot plot){ - return plot != null && plot.getDataProcessor().getMark() == LargeDataModel.MARK; - } - - public static boolean lineMapLargeModel(Plot plot){ - return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getLineMapDataProcessor().getMark() == LargeDataModel.MARK; - } -} - diff --git a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java deleted file mode 100644 index 125a738ae8..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.fr.plugin.chart.designer; - -import com.fr.design.constants.LayoutConstants; -import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import javax.swing.border.Border; -import java.awt.Component; -import java.util.Arrays; - -/** - * 布局 标题+组件 - */ -public class TableLayout4VanChartHelper { - - private static final int SMALL_GAP = 20; - public static final int EXPANDABLE_PANE_WIDTH =290; - public static final int EXPANDABLE_PANE_HIGHT =24; - public static final double DESCRIPTION_AREA_WIDTH =60; - public static final double EDIT_AREA_WIDTH =155; - public static final double SECOND_EDIT_AREA_WIDTH =143; - public static final int COMPONENT_INTERVAL =12; - public static final Border SECOND_EDIT_AREA_BORDER = BorderFactory.createEmptyBorder(0,12,0,0); - - public static JPanel createExpandablePaneWithTitleTopGap(String title, JPanel panel) { - return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, panel) { - protected void setcontentPanelontentPanelBorder() { - getContentPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 0)); - } - }; - } - - public static JPanel createExpandablePaneWithTitle(String title, Component[][] components) { - JPanel panel = createGapTableLayoutPane(components); - return createExpandablePaneWithTitle(title, panel); - } - - public static JPanel createExpandablePaneWithTitle(String title, JPanel panel) { - return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, panel){ - protected void setcontentPanelontentPanelBorder (){ - getContentPanel().setBorder(BorderFactory.createEmptyBorder(0 ,5, 0, 0)); - } - }; - } - - public static JPanel createGapTableLayoutPane(String title, Component component) { - return createGapTableLayoutPane(title, component, EDIT_AREA_WIDTH); - } - - public static JPanel createGapTableLayoutPane(String title, Component component, double componentWidth) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, componentWidth}; - double[] rowSize = {p, p}; - UILabel label = new UILabel(title); - label.setVerticalAlignment(SwingConstants.TOP); - Component[][] components = new Component[][]{ - new Component[]{null, null}, - new Component[]{label, component}, - }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); - } - - public static JPanel createGapTableLayoutPane(Component[][] components) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, EDIT_AREA_WIDTH}; - double[] rowSize = new double[components.length]; - Arrays.fill(rowSize, p); - - return createGapTableLayoutPane(components, rowSize, columnSize); - } - - public static JPanel createGapTableLayoutPane(Component[][] components, - double[] rowSize, double[] columnSize) { - - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); - } - - public static JPanel createGapTableLayoutPane(Component[][] components, - double[] rowSize, double[] columnSize, int[][] rowCount) { - - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, - COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); - } - - /** - * 标题布局(二级菜单距左边框46) - * @param title 标题 - * @param component 组件 - * @return 布局好的组件 - */ - public static JPanel createTableLayoutPaneWithTitle(String title, Component component){ - return TableLayout4VanChartHelper.createTitlePane(title, component, LayoutConstants.CHART_ATTR_TOMARGIN); - } - - /** - * 标题布局(二级菜单距左边框46) - * @param label 标题label - * @param component 组件 - * @return 布局好的组件 - */ - public static JPanel createTableLayoutPaneWithUILabel(UILabel label, Component component){ - return TableLayout4VanChartHelper.createTitlePaneWithUILabel(label, component, LayoutConstants.CHART_ATTR_TOMARGIN); - } - - /** - * 标题布局(三级菜单距二级左侧20) - * @param title 标题 - * @param component 组件 - * @return 布局好的组件 - */ - public static JPanel createTableLayoutPaneWithSmallTitle(String title, Component component){ - return TableLayout4VanChartHelper.createTitlePane(title, component, TableLayout4VanChartHelper.SMALL_GAP); - } - - /** - * 标题布局(指定gap) - * @param title 标题 - * @param component 组件 - * @param gap 距左侧距离 - * @return 布局好的组件 - */ - public static JPanel createTitlePane(String title, Component component, int gap){ - return createTitlePaneWithUILabel(new UILabel(title), component, gap); - } - - /** - * 标题布局(指定gap) - * @param label 标题label - * @param component 组件 - * @param gap 距左侧距离 - * @return 布局好的组件 - */ - public static JPanel createTitlePaneWithUILabel(UILabel label, Component component, int gap){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {gap, f}; - double[] rowSize = {p, p}; - Component[][] components = new Component[][]{ - new Component[]{label,null}, - new Component[]{null,component}, - }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - - public static JPanel createTableLayoutPane(Component[][] components) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = new double[components.length]; - Arrays.fill(rowSize, p); - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java deleted file mode 100644 index f6f159c57e..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.FRLogger; - -import java.lang.reflect.Constructor; -import java.util.HashMap; - -/** - * Created by hufan on 2016/11/15. - */ -public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { - private HashMap hyperLinkEditorMap; - - public ChartUIMenuNameableCreator(HashMap hyperLinkEditorMap, String name, Object obj, Class paneClazz) { - super(name, obj, paneClazz); - this.hyperLinkEditorMap = hyperLinkEditorMap; - } - - public UIMenuNameableCreator clone() { - Object cloneObj = null; - try { - cloneObj = obj.getClass().newInstance(); - } catch (InstantiationException e) { - FRLogger.getLogger().error("UIMenuNameableCreator InstantiationException"); - } catch (IllegalAccessException e) { - FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); - } - return new ChartUIMenuNameableCreator(hyperLinkEditorMap, name, cloneObj, (Class) this.paneClazz); - - } - - public BasicBeanPane getPane() { - try { - if (hyperLinkEditorMap != null) { - Constructor constructor = paneClazz.getConstructor(HashMap.class, boolean.class); - return constructor.newInstance(hyperLinkEditorMap, true); - } - } catch (Exception e) { - return super.getPane(); - } - return null; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java deleted file mode 100644 index 5606e7defd..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.UINumberDragPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.general.Inter; -import com.fr.plugin.chart.VanChartAttrHelper; -import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.background.VanChartMarkerBackgroundPane; - -import javax.swing.*; -import java.awt.*; - -/** - * 面积图填充色设置界面 - */ -public class VanChartAreaSeriesFillColorPane extends BasicPane { - private static final long serialVersionUID = 9166866984438854779L; - private VanChartMarkerBackgroundPane fillColorPane; - private UINumberDragPane transparent; - - public VanChartAreaSeriesFillColorPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p}; - double[] col = {f}; - fillColorPane = new VanChartMarkerBackgroundPane(){ - protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_FillColor")), typeComboBox}, - new Component[]{null, centerPane}, - }; - } - }; - transparent = new UINumberDragPane(0, 100); - - JPanel transparentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Alpha"), transparent); - - this.setLayout(new BorderLayout()); - this.add(fillColorPane, BorderLayout.NORTH); - this.add(transparentPane, BorderLayout.CENTER); - } - - protected String title4PopupWindow(){ - return Inter.getLocText("Plugin-ChartF_FillColor"); - } - - public void populate(AttrAreaSeriesFillColorBackground fillColorBackground) { - if(fillColorBackground == null){ - fillColorBackground = new AttrAreaSeriesFillColorBackground(); - } - fillColorPane.populate(fillColorBackground.getColorBackground()); - transparent.populateBean(fillColorBackground.getAlpha() * VanChartAttrHelper.PERCENT); - } - - public AttrAreaSeriesFillColorBackground update() { - AttrAreaSeriesFillColorBackground fillColorBackground = new AttrAreaSeriesFillColorBackground(); - fillColorBackground.setColorBackground(fillColorPane.update()); - fillColorBackground.setAlpha(transparent.updateBean()/VanChartAttrHelper.PERCENT); - return fillColorBackground; - } - - /** - * 检查透明的设置是否有效 - * @param enable - */ - public void checkoutAlpha(boolean enable) { - transparent.setEnabled(enable); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java deleted file mode 100644 index c1683df4e2..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.chart.base.ChartConstants; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 15/9/8. - */ -//系列-风格 -public class VanChartBeautyPane extends BasicBeanPane { - private UIButtonGroup styleBox; - - public VanChartBeautyPane() { - styleBox = new UIButtonGroup(getNameArray()); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Style")), styleBox}, - } ; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); - } - - protected String[] getNameArray(){ - return new String[]{Inter.getLocText("Chart-Default_Name"), - Inter.getLocText("Plugin-Chart_TopDownShade") - }; - } - @Override - public void populateBean(Integer ob) { - int finalIndex; - switch (ob){ - case ChartConstants.STYLE_NONE: finalIndex = 0; break; - case ChartConstants.STYLE_SHADE: finalIndex = 1; break; - default: finalIndex = 0; - } - styleBox.setSelectedIndex(finalIndex); - } - - @Override - public Integer updateBean() { - int index = styleBox.getSelectedIndex(); - int style; - switch (index){ - case 0: style = ChartConstants.STYLE_NONE; break; - case 1: style = ChartConstants.STYLE_SHADE; break; - default: style = ChartConstants.STYLE_NONE; - } - return style; - } - - @Override - protected String title4PopupWindow() { - return ""; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane.java deleted file mode 100644 index b544ca1d5a..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by mengao on 2017/8/17. - */ -public class VanChartFillStylePane extends ChartFillStylePane { - - @Override - protected JPanel getContentPane () { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("ColorMatch")),styleSelectBox}, - new Component[]{null,customPane}, - - }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); - panel.setBorder(BorderFactory.createEmptyBorder(5,5,0,0)); - return panel; - } - @Override - public Dimension getPreferredSize() { - if(styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { - return new Dimension(styleSelectBox.getPreferredSize().width, 30); - } - return super.getPreferredSize(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane4Condition.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane4Condition.java deleted file mode 100644 index ee431e1c8f..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFillStylePane4Condition.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; - -import javax.swing.*; -import java.awt.*; - -/** - * 配色 只有下拉框控件无配色title。 条件属性 配色中用到 - */ -public class VanChartFillStylePane4Condition extends ChartFillStylePane { - private static final long serialVersionUID = 2470094484790112401L; - - @Override - protected void initLayout() { - customPane.setPreferredSize(new Dimension(200, 130)); - colorGradient.setPreferredSize(new Dimension(120, 30)); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = { f }; - double[] rowSize = { p, p}; - Component[][] components = new Component[][]{ - new Component[]{styleSelectBox}, - new Component[]{customPane} - } ; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); - } - - @Override - public Dimension getPreferredSize() { - if(styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { - return new Dimension(styleSelectBox.getPreferredSize().width, 20); - } - return super.getPreferredSize(); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFloatPositionPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFloatPositionPane.java deleted file mode 100644 index 753bcd389f..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartFloatPositionPane.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.chart.chartattr.Chart; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; - -/** - * 悬浮位置 标题和图例用到 - */ -public class VanChartFloatPositionPane extends BasicBeanPane { - private static final long serialVersionUID = -4773313488161065678L; - private UISpinner floatPosition_x; - private UISpinner floatPosition_y; - - public VanChartFloatPositionPane(){ - - this.setLayout(new BorderLayout()); - - this.add(new UILabel(Inter.getLocText("plugin-ChartF_XYFromTheUpLeft")), BorderLayout.CENTER); - - this.add(createCustomFloatPositionPane(), BorderLayout.SOUTH); - } - - private JPanel createCustomFloatPositionPane(){ - floatPosition_x = new UISpinner(0,100,1,0); - floatPosition_y = new UISpinner(0,100,1,0); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p,p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_positionX")+": "),floatPosition_x}, - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_positionY")+": "),floatPosition_y} - }; - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - - public void setFloatPosition_x(double floatPosition_x) { - this.floatPosition_x.setValue(floatPosition_x); - } - - public void setFloatPosition_y(double floatPosition_y) { - this.floatPosition_y.setValue(floatPosition_y); - } - - public double getFloatPosition_x() { - return floatPosition_x.getValue(); - } - - public double getFloatPosition_y() { - return floatPosition_y.getValue(); - } - - - /** - * 弹出框标题 - * @return 标题 - */ - public String title4PopupWindow() { - return StringUtils.EMPTY; - } - - @Override - public Chart updateBean() { - return null; - } - - @Override - public void populateBean(Chart ob) { - - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java deleted file mode 100644 index 107ec5b667..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.DesignerEnvManager; -import com.fr.design.constants.KeyWords; -import com.fr.design.gui.autocomplete.AutoCompletion; -import com.fr.design.gui.autocomplete.BasicCompletion; -import com.fr.design.gui.autocomplete.DefaultCompletionProvider; -import com.fr.design.gui.ibutton.UIToggleButton; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartHtmlLabel; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * Created by Mitisky on 16/2/19. - */ -public class VanChartHtmlLabelPane extends JPanel{ - - private static final long serialVersionUID = -5512128966013558611L; - private static final int JS_HEIGHT = 100; - - private RSyntaxTextArea contentTextArea; - private UIToggleButton useHtml; - - private UICheckBox isCustomWidth; - private UITextField customWidth; - private UICheckBox isCustomHeight; - private UITextField customHeight; - - private VanChartStylePane parent; - - public void setCustomFormatterText(String text){ - contentTextArea.setText(text); - } - - public void setParent(VanChartStylePane parent) { - this.parent = parent; - } - - public VanChartHtmlLabelPane() { - useHtml = new UIToggleButton(Inter.getLocText("Plugin-ChartF_Html")); - JPanel widthAndHeightPane = createWidthAndHeightPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f}; - double[] rowSize = {p, p, p}; - - Component[][] components = new Component[][]{ - new Component[]{createJSContentPane()}, - new Component[]{useHtml}, - new Component[]{widthAndHeightPane} - }; - - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - - this.setLayout(new BorderLayout()); - this.add(contentPane, BorderLayout.CENTER); - } - - private JComponent createJSContentPane() { - contentTextArea = new RSyntaxTextArea(); - contentTextArea.setCloseCurlyBraces(true); - contentTextArea.setLineWrap(true); - contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); - contentTextArea.setCodeFoldingEnabled(true); - contentTextArea.setAntiAliasingEnabled(true); - contentTextArea.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - fireJSChange(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - fireJSChange(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - fireJSChange(); - } - }); - - DefaultCompletionProvider provider = new DefaultCompletionProvider(); - - for (String key : KeyWords.JAVASCRIPT) { - provider.addCompletion(new BasicCompletion(provider, key)); - } - - AutoCompletion ac = new AutoCompletion(provider); - String shortCuts = DesignerEnvManager.getEnvManager().getAutoCompleteShortcuts(); - - ac.setTriggerKey(KeyStroke.getKeyStroke(shortCuts.replace("+", "pressed"))); - ac.install(contentTextArea); - - return new UIScrollPane(contentTextArea){ - @Override - public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, JS_HEIGHT); - } - }; - } - - private void fireJSChange() { - if(parent != null){ - parent.attributeChanged(); - } - } - - protected JPanel createWidthAndHeightPane() { - isCustomWidth = new UICheckBox(Inter.getLocText("Plugin-ChartF_Custom_Width")); - customWidth = new UITextField(6); - isCustomHeight = new UICheckBox(Inter.getLocText("Plugin-ChartF_Custom_Height")); - customHeight = new UITextField(6); - - isCustomWidth.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - checkWidth(); - } - }); - isCustomHeight.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkHeight(); - } - }); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = { p, f }; - double[] rowSize = { p, p}; - - Component[][] components = new Component[][]{ - new Component[]{isCustomWidth, customWidth}, - new Component[]{isCustomHeight, customHeight}, - }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - - private void checkWidth() { - customWidth.setEnabled(isCustomWidth.isSelected()); - } - - private void checkHeight() { - customHeight.setEnabled(isCustomHeight.isSelected()); - } - - private void checkBoxUse() { - checkHeight(); - checkWidth(); - } - - public void populate(VanChartHtmlLabel htmlLabel){ - if(htmlLabel == null){ - return; - } - setCustomFormatterText(htmlLabel.getCustomText()); - useHtml.setSelected(htmlLabel.isUseHtml()); - populateWidthAndHeight(htmlLabel); - } - - protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) { - isCustomWidth.setSelected(htmlLabel.isCustomWidth()); - customWidth.setText(htmlLabel.getWidth()); - isCustomHeight.setSelected(htmlLabel.isCustomHeight()); - customHeight.setText(htmlLabel.getHeight()); - checkBoxUse(); - } - - public void update(VanChartHtmlLabel htmlLabel) { - if(htmlLabel == null){ - return; - } - htmlLabel.setCustomText(contentTextArea.getText()); - htmlLabel.setUseHtml(useHtml.isSelected()); - updateWidthAndHeight(htmlLabel); - } - - protected void updateWidthAndHeight(VanChartHtmlLabel htmlLabel) { - htmlLabel.setCustomWidth(isCustomWidth.isSelected()); - htmlLabel.setWidth(customWidth.getText()); - htmlLabel.setCustomHeight(isCustomHeight.isSelected()); - htmlLabel.setHeight(customHeight.getText()); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java deleted file mode 100644 index 3204cec2ab..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.plugin.chart.base.VanChartHtmlLabel; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/2/19. - * 不能设置宽高 - */ -public class VanChartHtmlLabelPaneWithOutWidthAndHeight extends VanChartHtmlLabelPane { - private static final long serialVersionUID = -9213286452724939880L; - - protected JPanel createWidthAndHeightPane() { - return new JPanel(); - } - - protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) { - } - protected void updateWidthAndHeight(VanChartHtmlLabel htmlLabel) { - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLabelContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLabelContentPane.java deleted file mode 100644 index 182adca90f..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLabelContentPane.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -public class VanChartLabelContentPane extends VanChartTooltipContentPane { - - private static final long serialVersionUID = 5630276526789839288L; - - public VanChartLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - protected VanChartHtmlLabelPane createHtmlLabelPane() { - return new VanChartHtmlLabelPane(); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineTypePane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineTypePane.java deleted file mode 100644 index 50693b474d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineTypePane.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icombobox.LineComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartAttrLine; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.type.LineStyle; -import com.fr.stable.Constants; -import com.fr.stable.CoreConstants; - -import javax.swing.*; -import java.awt.*; - -/** - * line相关设置 - */ -public class VanChartLineTypePane extends BasicPane { - - private static final long serialVersionUID = -6581862503009962973L; - protected LineComboBox lineWidth;//线型 - protected UIButtonGroup lineStyle;//形态 - protected UIButtonGroup nullValueBreak;//空值断开 - - public VanChartLineTypePane() { - lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); - - createLineStyle(); - - nullValueBreak = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); - - this.setLayout(new BorderLayout()); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - this.add(createContentPane(p, f), BorderLayout.CENTER); - } - - protected void createLineStyle() { - String[] textArray = new String[]{Inter.getLocText("Plugin-ChartF_NormalLine"), - Inter.getLocText("Plugin-ChartF_StepLine"), Inter.getLocText("Plugin-ChartF_CurveLine")}; - lineStyle = new UIButtonGroup(textArray, LineStyle.values()); - } - - protected JPanel createContentPane(double p, double f) { - double[] row = {p, p, p, p}; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] col = {f, e}; - - Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),lineWidth}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Style_Present")),lineStyle}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Null_Value_Break")),nullValueBreak}, - }; - - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - } - - public void checkLarge(boolean large){ - if(large){ - lineWidth.setSelectedLineStyle(Constants.LINE_NONE); - } - lineWidth.setEnabled(!large); - lineStyle.setEnabled(!large); - } - - protected String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_Line"); - } - - public void populate(VanChartAttrLine line) { - if (line == null) { - line = initVanChartAttrLine(); - } - lineWidth.setSelectedLineStyle(line.getLineWidth()); - lineStyle.setSelectedItem(line.getLineStyle()); - nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1); - } - - protected VanChartAttrLine initVanChartAttrLine() { - return new VanChartAttrLine(); - } - - public VanChartAttrLine update() { - VanChartAttrLine line = new VanChartAttrLine(); - line.setLineWidth(lineWidth.getSelectedLineStyle()); - line.setLineStyle(lineStyle.getSelectedItem()); - line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0); - return line; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineWidthPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineWidthPane.java deleted file mode 100644 index 900bf72575..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartLineWidthPane.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * 线-线型 - */ -public class VanChartLineWidthPane extends VanChartLineTypePane { - private static final long serialVersionUID = 4537158946119294689L; - - protected JPanel createContentPane(double p, double f) { - double[] row = {p, p, p}; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] col = {f, e}; - - Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")), lineWidth}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Null_Value_Break")), nullValueBreak}, - }; - - return TableLayoutHelper.createTableLayoutPane(components, row, col); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java deleted file mode 100644 index a6d0abf1a1..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.VanChartAttrMarker; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.marker.VanChartCommonMarkerPane; -import com.fr.plugin.chart.designer.component.marker.VanChartImageMarkerPane; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; - -/** - * 标记点设置界面 - */ -public class VanChartMarkerPane extends BasicPane { - private static final long serialVersionUID = 7206339620703021514L; - private UIButtonGroup commonORCustom; - private JPanel centerPane; - private CardLayout cardLayout; - - private BasicBeanPane commonMarkerPane; - - private BasicBeanPane imageMarkerPane; - - public VanChartMarkerPane() { - this.setLayout(new BorderLayout(0, 4)); - - String[] array = new String[]{Inter.getLocText("Plugin-ChartF_Rule"), Inter.getLocText("Plugin-ChartF_Custom")}; - commonORCustom = new UIButtonGroup(array, array); - - commonORCustom.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - checkCenterPane(); - } - }); - - commonMarkerPane = createCommonMarkerPane(); - imageMarkerPane = createImageMarkerPane(); - - cardLayout = new CardLayout(); - centerPane = new JPanel(cardLayout) { - - @Override - public Dimension getPreferredSize() { - if(commonORCustom.getSelectedIndex() == 0){ - return commonMarkerPane.getPreferredSize(); - } else { - return imageMarkerPane.getPreferredSize(); - } - } - }; - centerPane.add(commonMarkerPane, Inter.getLocText("Plugin-ChartF_Rule")); - centerPane.add(imageMarkerPane, Inter.getLocText("Plugin-ChartF_Custom")); - - layoutComponents(); - } - - public void checkLargePlot(boolean large){ - if(large){ - commonORCustom.setSelectedIndex(0); - checkCenterPane(); - } - commonORCustom.setEnabled(!large); - } - - protected BasicBeanPane createImageMarkerPane() { - return new VanChartImageMarkerPane(); - } - - protected BasicBeanPane createCommonMarkerPane() { - return new VanChartCommonMarkerPane(){ - protected double[] getcolumnSize () { - double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - return new double[] {d, s}; - } - }; - } - - protected void layoutComponents() { - this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Point_Style"), commonORCustom), BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - } - - protected void layoutComponentsWithOutNorth() { - this.add(centerPane, BorderLayout.CENTER); - } - - private void checkCenterPane() { - cardLayout.show(centerPane, commonORCustom.getSelectedItem()); - } - - protected String title4PopupWindow(){ - return Inter.getLocText("Plugin-ChartF_Marker"); - } - - public void populate(VanChartAttrMarker marker) { - if(marker == null){ - marker = new VanChartAttrMarker(); - } - commonORCustom.setSelectedIndex(marker.isCommon() ? 0 : 1); - if(marker.isCommon()){ - commonMarkerPane.populateBean(marker); - } else { - imageMarkerPane.populateBean(marker); - } - - checkCenterPane(); - } - - public VanChartAttrMarker update() { - VanChartAttrMarker marker = new VanChartAttrMarker(); - if(commonORCustom.getSelectedIndex() == 0){ - commonMarkerPane.updateBean(marker); - } else { - imageMarkerPane.updateBean(marker); - } - return marker; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartPlotMultiTabPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartPlotMultiTabPane.java deleted file mode 100644 index 3e1fa02f78..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartPlotMultiTabPane.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.fr.plugin.chart.designer.component; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Dimension; -import java.util.List; - -import javax.swing.JPanel; - -import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.gui.ibutton.UITabGroup; - -/** - * - * 标准的多层Tab切换类型. - * @author kunsnat E-mail:kunsnat@gmail.com - * @version 创建时间:2013-4-22 上午10:31:03 - */ -public abstract class VanChartPlotMultiTabPane extends FurtherBasicBeanPane{ - private static final long serialVersionUID = 2298609199400393886L; - protected UITabGroup tabPane; - protected String[] NameArray; - protected JPanel centerPane; - protected CardLayout cardLayout; - protected List paneList; - - //提供一个可以根据plot信息创建paneList的类 - protected E plot; - //承载该容器的父类容器 - protected BasicPane parent; - - //屬性變化的監聽器,在構造數據配置面板時用到 - protected AttributeChangeListener listener = null; - - protected abstract List initPaneList(); - - public abstract void populateBean(T ob); - public abstract void updateBean(T ob); - - public VanChartPlotMultiTabPane(E plot, BasicPane parent) { - this(plot, parent, null); - } - - public VanChartPlotMultiTabPane(E plot, BasicPane parent, AttributeChangeListener listener) { - this.plot = plot; - this.parent = parent; - this.listener = listener; - cardLayout = new CardLayout(); - paneList = initPaneList(); - relayoutWhenListChange(); - } - - public int getSelectedIndex() { - return tabPane.getSelectedIndex(); - } - - /** - * 当List中的界面变化时, 重新布局 - */ - public void relayoutWhenListChange() { - centerPane = new JPanel(cardLayout) { - @Override - public Dimension getPreferredSize() { - if (tabPane.getSelectedIndex() == -1) { - return super.getPreferredSize(); - } else { - return paneList.get(tabPane.getSelectedIndex()).getPreferredSize(); - } - } - }; - NameArray = new String[paneList.size()]; - for (int i = 0; i < paneList.size(); i++) { - BasicPane pane = (BasicPane) paneList.get(i); - NameArray[i] = pane.getTitle(); - centerPane.add(pane, NameArray[i]); - } - - tabPane = new UITabGroup(NameArray) { - @Override - public void tabChanged(int index) { - dealWithTabChanged(index); - } - }; - tabPane.setSelectedIndex(0); - tabPane.tabChanged(0); - initLayout(); - } - - protected void dealWithTabChanged(int index) { - cardLayout.show(centerPane, NameArray[index]); - tabChanged(); - } - - protected void tabChanged() { - - } - - protected void initLayout() { - this.setLayout(new BorderLayout(0, 4)); - this.add(tabPane, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartRefreshTooltipContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartRefreshTooltipContentPane.java deleted file mode 100644 index 8bd8fc4e16..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartRefreshTooltipContentPane.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.plugin.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by mengao on 2017/6/5. - */ -public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPane { - - public VanChartRefreshTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(null, showOnPane); - } - - protected double[] getRowSize(double p){ - return new double[]{p,p,p,p,p,p}; - } - - @Override - protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initFormatPane(parent, showOnPane); - - changedValueFormatPane = new ChangedValueFormatPaneWithCheckBox(parent, showOnPane); - changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); - } - - protected Component[][] getPaneComponents(){ - return new Component[][]{ - new Component[]{categoryNameFormatPane,null}, - new Component[]{seriesNameFormatPane,null}, - new Component[]{valueFormatPane,null}, - new Component[]{changedValueFormatPane,null}, - new Component[]{percentFormatPane,null}, - new Component[]{changedPercentFormatPane,null}, - }; - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java deleted file mode 100644 index a42ad2469a..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java +++ /dev/null @@ -1,260 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.PercentFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.component.format.ValueFormatPaneWithCheckBox; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * 内容界面 。数据点提示 - */ -public class VanChartTooltipContentPane extends BasicBeanPane { - - private static final long serialVersionUID = 8825929000117843641L; - - protected UIButtonGroup content; - protected ValueFormatPaneWithCheckBox valueFormatPane; - protected PercentFormatPaneWithCheckBox percentFormatPane; - protected CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; - protected SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; - - //监控刷新时,自动数据点提示使用 - protected ChangedValueFormatPaneWithCheckBox changedValueFormatPane; - protected ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; - - private JPanel centerPane; - private VanChartHtmlLabelPane htmlLabelPane; - - private VanChartStylePane parent; - private JPanel showOnPane; - - public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){ - this.parent = parent; - this.showOnPane = showOnPane; - - this.setLayout(new BorderLayout()); - this.add(createLabelContentPane(),BorderLayout.CENTER); - } - - private JPanel createLabelContentPane() { - content = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Common"), - Inter.getLocText("Plugin-ChartF_Custom")}); - - initFormatPane(parent, showOnPane); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, p}; - double[] rowSize = getRowSize(p); - - final JPanel commonPanel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); - - htmlLabelPane = createHtmlLabelPane(); - htmlLabelPane.setParent(parent); - - centerPane = new JPanel(new CardLayout()){ - @Override - public Dimension getPreferredSize() { - if(content.getSelectedIndex() == 0){ - return commonPanel.getPreferredSize(); - } else { - return new Dimension(commonPanel.getPreferredSize().width,htmlLabelPane.getPreferredSize().height); - } - } - }; - centerPane.add(htmlLabelPane, Inter.getLocText("Plugin-ChartF_Custom")); - centerPane.add(commonPanel,Inter.getLocText("Plugin-ChartF_Common")); - - double[] column = {f, e}; - double[] row = {p,p,p}; - Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(getLabelContentTitle()),content}, - new Component[]{null,centerPane}, - }; - initContentListener(); - JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); - return getLabelContentPane(contentPane); - } - - protected String getLabelContentTitle () { - return Inter.getLocText("FR-Designer_Text"); - } - - protected JPanel getLabelContentPane(JPanel contentPane) { - return createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Content"), contentPane); - } - - protected VanChartHtmlLabelPane createHtmlLabelPane() { - return new VanChartHtmlLabelPaneWithOutWidthAndHeight(); - } - - protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){ - categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); - seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); - valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); - percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); - } - - protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); - } - - protected double[] getRowSize(double p){ - return new double[]{p,p,p,p}; - } - - protected Component[][] getPaneComponents(){ - return new Component[][]{ - new Component[]{categoryNameFormatPane,null}, - new Component[]{seriesNameFormatPane,null}, - new Component[]{valueFormatPane,null}, - new Component[]{percentFormatPane,null}, - }; - } - - private void initContentListener() { - content.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkCardPane(); - } - }); - } - - - private void checkCardPane() { - CardLayout cardLayout = (CardLayout) centerPane.getLayout(); - if (content.getSelectedIndex() == 1) { - cardLayout.show(centerPane,Inter.getLocText("Plugin-ChartF_Custom")); - if(isDirty()){ - setCustomFormatterText(); - setDirty(false); - } - } else { - cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_Common")); - } - } - - protected void setCustomFormatterText() { - htmlLabelPane.setCustomFormatterText(updateBean().getFormatterTextFromCommon()); - } - - public boolean isDirty() { - return categoryNameFormatPane.isDirty() || seriesNameFormatPane.isDirty() || valueFormatPane.isDirty() || percentFormatPane.isDirty() - || (changedValueFormatPane != null && changedValueFormatPane.isDirty()) || (changedValueFormatPane != null && changedPercentFormatPane.isDirty()); - } - - public void setDirty(boolean isDirty) { - categoryNameFormatPane.setDirty(isDirty); - seriesNameFormatPane.setDirty(isDirty); - valueFormatPane.setDirty(isDirty); - percentFormatPane.setDirty(isDirty); - - if (changedValueFormatPane != null) { - changedValueFormatPane.setDirty(isDirty); - } - if (changedPercentFormatPane != null) { - changedPercentFormatPane.setDirty(isDirty); - } - } - - @Override - protected String title4PopupWindow() { - return ""; - } - - - @Override - public void populateBean(AttrTooltipContent attrTooltipContent){ - if(attrTooltipContent == null){ - return; - } - - content.setSelectedIndex(attrTooltipContent.isCommon() ? 0 : 1); - - populateFormatPane(attrTooltipContent); - - htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); - if(!attrTooltipContent.isCommon()){ - setDirty(false); - } - checkCardPane(); - } - - protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { - categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); - seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); - valueFormatPane.populate(attrTooltipContent.getValueFormat()); - percentFormatPane.populate(attrTooltipContent.getPercentFormat()); - - if (changedValueFormatPane != null) { - changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat()); - } - if (changedPercentFormatPane != null) { - changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat()); - } - } - - public AttrTooltipContent updateBean() { - AttrTooltipContent attrTooltipContent = createAttrTooltip(); - - attrTooltipContent.setCommon(content.getSelectedIndex() == 0); - - updateFormatPane(attrTooltipContent); - - updateFormatsWithPaneWidth(attrTooltipContent); - - htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); - - return attrTooltipContent; - } - - protected AttrTooltipContent createAttrTooltip() { - return new AttrTooltipContent(); - } - - protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { - categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); - seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); - valueFormatPane.update(attrTooltipContent.getValueFormat()); - percentFormatPane.update(attrTooltipContent.getPercentFormat()); - - if (changedValueFormatPane != null) { - changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat()); - } - if (changedPercentFormatPane != null) { - changedPercentFormatPane.update(attrTooltipContent.getChangedPercentFormat()); - } - } - - /** - * CHART-1295 - * 通过格式的面板宽度来判断在自定义js代码中是否显示this.seriesName字符串。 - * 图表对于其他的格式有要求也可以在这里继续添加。 - * @param attrTooltipContent - */ - private void updateFormatsWithPaneWidth (AttrTooltipContent attrTooltipContent) { - int paneWidth = seriesNameFormatPane.getWidth(); - if (paneWidth == 0) { - attrTooltipContent.getSeriesFormat().setEnable(false); - } - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTrendLinePane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTrendLinePane.java deleted file mode 100644 index 789cd601d3..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTrendLinePane.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.chart.base.AttrColor; -import com.fr.chart.base.AttrLineStyle; -import com.fr.chart.base.LineStyleInfo; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.icombobox.LineComboBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.style.color.ColorSelectBox; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.TrendLineType; -import com.fr.plugin.chart.base.VanChartAttrTrendLine; -import com.fr.plugin.chart.base.VanChartConstants; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 15/10/19. - */ -public class VanChartTrendLinePane extends BasicPane{ - private static final TrendLineType[] TYPES = new TrendLineType[] {TrendLineType.EXP, TrendLineType.LINE, TrendLineType.LOG, TrendLineType.POLY}; - - private UITextField trendLineName; - private ColorSelectBox trendLineColor; - private LineComboBox trendLineStyle;//线型 - - private UIComboBox trendLineType;//趋势线函数类型 - private UISpinner prePeriod; - private UISpinner afterPeriod; - - public VanChartTrendLinePane() { - this.setLayout(new BorderLayout()); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p,p}; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] col = {f, e}; - trendLineName = new UITextField(); - trendLineColor = new ColorSelectBox(100); - trendLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE); - - trendLineType = new UIComboBox(TYPES); - prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); - afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); - double[] r = {p, p}; - double[] c = {f, p, f, p}; - Component[][] periodComps = new Component[][]{ - new Component[]{prePeriod, new UILabel(Inter.getLocText("Plugin-ChartF_Cycle")), afterPeriod, new UILabel(Inter.getLocText("Plugin-ChartF_Cycle"))}, - new Component[]{new UILabel(Inter.getLocText("Chart_TrendLine_Forward")), null, new UILabel(Inter.getLocText("Plugin-ChartF_After_Period")), null}, - }; - JPanel periodPane = TableLayoutHelper.createTableLayoutPane(periodComps, r, c); - - UILabel label = new UILabel(Inter.getLocText("Plugin-ChartF_Period")); - label.setVerticalAlignment(SwingConstants.TOP); - - Component[][] components = new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Name")), trendLineName}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")), trendLineStyle}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")), trendLineColor}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")), trendLineType}, - new Component[]{label, periodPane} - }; - - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - this.add(panel, BorderLayout.CENTER); - } - protected String title4PopupWindow(){ - return Inter.getLocText("Chart-Trend_Line"); - } - - public void populate(VanChartAttrTrendLine trendLine) { - if(trendLine != null){ - trendLineName.setText(trendLine.getTrendLineName()); - LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); - trendLineColor.setSelectObject(lineStyleInfo.getAttrLineColor().getSeriesColor()); - trendLineStyle.setSelectedLineStyle(lineStyleInfo.getAttrLineStyle().getLineStyle()); - trendLineType.setSelectedItem(trendLine.getTrendLineType()); - prePeriod.setValue(trendLine.getPrePeriod()); - afterPeriod.setValue(trendLine.getAfterPeriod()); - } - } - - public VanChartAttrTrendLine update() { - VanChartAttrTrendLine trendLine = new VanChartAttrTrendLine(); - trendLine.setTrendLineName(trendLineName.getText()); - - LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); - lineStyleInfo.setAttrLineStyle(new AttrLineStyle(trendLineStyle.getSelectedLineStyle())); - lineStyleInfo.setAttrLineColor(new AttrColor(trendLineColor.getSelectObject())); - - trendLine.setTrendLineType((TrendLineType) trendLineType.getSelectedItem()); - trendLine.setPrePeriod((int) prePeriod.getValue()); - trendLine.setAfterPeriod((int) afterPeriod.getValue()); - - return trendLine; - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java deleted file mode 100644 index 00bd52a381..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.base.chart.BasePlot; -import com.fr.chart.chartattr.Plot; -import com.fr.design.event.UIObserver; -import com.fr.design.event.UIObserverListener; -import com.fr.design.gui.controlpane.UIListControlPane; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itoolbar.UIToolbar; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.stable.Nameable; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * Created by mengao on 2017/9/8. - * 新图表UIListControlPane,基础面板。 - */ -public abstract class VanChartUIListControlPane extends UIListControlPane implements UIObserver { - private UIObserverListener uiObserverListener; - - - public VanChartUIListControlPane() { - super(); - this.setBorder(null); - iniListener(); - } - - public VanChartUIListControlPane(BasePlot plot) { - super(plot); - this.setBorder(null); - iniListener(); - } - - /** - * 注册观察者监听事件 - * @param listener 观察者监听事件 - */ - @Override - public void registerChangeListener(UIObserverListener listener) { - uiObserverListener = listener; - } - - @Override - public boolean shouldResponseChangeListener() { - return true; - } - - private void iniListener() { - if (shouldResponseChangeListener()) { - this.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - if (uiObserverListener == null) { - return; - } - uiObserverListener.doChange(); - } - }); - } - } - - protected void fireChanged() { - Object[] listeners = listenerList.getListenerList(); - - for (int i = listeners.length - 2; i >= 0; i -= 2) { - if (listeners[i] == ChangeListener.class) { - ((ChangeListener) listeners[i + 1]).stateChanged(new ChangeEvent(this)); - } - } - - } - - /** - * 增加监听事件 - * @param l 监听的对象 - */ - public void addChangeListener(ChangeListener l) { - this.listenerList.add(ChangeListener.class, l); - } - - @Override - protected JPanel getLeftTopPane(UIToolbar topToolBar) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(getAddItemText()), topToolBar}, - }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - - @Override - public void saveSettings() { - if (isPopulating) { - return; - } - update((Plot) plot); - fireChanged();//图表属性改变,响应事件 - } - - protected abstract void update(Plot plot); - - - //-------------------连续弹窗问题 start-------------------// - - public void populate(Nameable[] nameableArray) { - //特殊处理,使用instanceof判断,弹出不同的面板 - if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) { - popupEditDialog = new HyperDialog(cardPane); - } - super.populate(nameableArray); - } - - protected void popupEditDialog(Point mousePos) { - //特殊处理,处理连续弹窗情况,弹出面板定为方式不同 - if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) { - GUICoreUtils.centerWindow(popupEditDialog); - popupEditDialog.setVisible(true); - return; - } - super.popupEditDialog(mousePos); - } - - // 点击"编辑"按钮,弹出面板(这个面板是弹窗里面的弹窗) - protected class HyperDialog extends JDialog { - private JComponent editPane; - private static final int WIDTH = 570; - private static final int HEIGHT = 490; - - private UIButton okButton, cancelButton; - - - HyperDialog(JComponent pane) { - super(DesignerContext.getDesignerFrame(), true); - pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); - this.editPane = pane; - JPanel editPaneWrapper = new JPanel(new BorderLayout()); - editPaneWrapper.add(editPane, BorderLayout.CENTER); - this.getContentPane().add(editPaneWrapper, BorderLayout.CENTER); - this.getContentPane().add(createControlButtonPane(), BorderLayout.SOUTH); - setSize(WIDTH, HEIGHT); - this.setVisible(false); - } - - private JPanel createControlButtonPane() { - JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0)); - controlPane.add(buttonsPane, BorderLayout.EAST); - - //确定 - addOkButton(buttonsPane); - //取消 - addCancelButton(buttonsPane); - - controlPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - - return controlPane; - } - - private void addCancelButton(JPanel buttonsPane) { - cancelButton = new UIButton(Inter.getLocText("Cancel")); - buttonsPane.add(cancelButton); - cancelButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent evt) { - doCancel(); - } - }); - } - - private void addOkButton(JPanel buttonsPane) { - okButton = new UIButton(Inter.getLocText("OK")); - buttonsPane.add(okButton); - okButton.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent evt) { - doOK(); - } - }); - } - - public void doOK() { - saveSettings(); - setVisible(false); - } - - public void doCancel() { - setVisible(false); - } - } - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIMenuNameableCreator.java deleted file mode 100644 index 3f41920d98..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIMenuNameableCreator.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.plugin.chart.designer.component; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.FRLogger; -import com.fr.stable.FCloneable; - -/** - * 新的obj是clone出来的,非new - */ -public class VanChartUIMenuNameableCreator extends UIMenuNameableCreator { - public VanChartUIMenuNameableCreator(String name, FCloneable obj, Class paneClazz) { - super(name, obj, paneClazz); - } - /** - * 覆盖的clone方法 - */ - public UIMenuNameableCreator clone() { - Object cloneObj = null; - try { - cloneObj = ((FCloneable)obj).clone(); - } catch (CloneNotSupportedException e){ - FRLogger.getLogger().error("VanChartUIMenuNameableCreator CloneNotSupportedException"); - } - return new UIMenuNameableCreator(name, cloneObj, this.paneClazz); - - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java deleted file mode 100644 index 1c1cb8211d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.base.background.ImageBackground; -import com.fr.chart.chartglyph.GeneralInfo; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.frpane.UINumberDragPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.general.Background; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.stable.Constants; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; - -/** - * 图表 属性表.背景设置 界面.(包括 无, 颜色, 图片, 渐变)+开启阴影 - * 图片背景没有布局方式,默认为拉伸。 - */ -public class VanChartBackgroundPane extends BasicPane { - private static final long serialVersionUID = 6955952013135176051L; - private static final double ALPHA_V = 100.0; - protected List paneList; - - protected UIComboBox typeComboBox; - protected UINumberDragPane transparent; - protected UIButtonGroup shadow; - - protected JPanel centerPane; - - public VanChartBackgroundPane() { - initComponents(); - JPanel panel = initContentPanel(); - this.setLayout(new BorderLayout()); - this.add(panel, BorderLayout.CENTER); - } - - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - - double[] rowSize = {p, p, p, p, p}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize); - } - - protected void initComponents() { - typeComboBox = new UIComboBox(); - final CardLayout cardlayout = new CardLayout(); - paneList = new ArrayList(); - - initList(); - - centerPane = new JPanel(cardlayout) { - - @Override - public Dimension getPreferredSize() {// AUGUST:使用当前面板的的高度 - int index = typeComboBox.getSelectedIndex(); - return new Dimension(super.getPreferredSize().width, paneList.get(index).getPreferredSize().height); - } - }; - for (int i = 0; i < paneList.size(); i++) { - BackgroundQuickPane pane = paneList.get(i); - typeComboBox.addItem(pane.title4PopupWindow()); - centerPane.add(pane, pane.title4PopupWindow()); - } - - typeComboBox.addItemListener(new ItemListener() { - - @Override - public void itemStateChanged(ItemEvent e) { - cardlayout.show(centerPane, (String)typeComboBox.getSelectedItem()); - fireStateChanged(); - } - }); - - transparent = new UINumberDragPane(0, 100); - } - - protected Component[][] getPaneComponents() { - shadow = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); - - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, - new Component[]{null, centerPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow}, - }; - } - - protected void initList() { - paneList.add(new NullBackgroundQuickPane()); - paneList.add(new ColorBackgroundQuickPane()); - paneList.add(new ImageBackgroundQuickPane(false)); - paneList.add(new VanChartGradientPane()); - } - - - private void fireStateChanged() { - Object[] listeners = listenerList.getListenerList(); - ChangeEvent e = null; - - for (int i = listeners.length - 2; i >= 0; i -= 2) { - if (listeners[i] == ChangeListener.class) { - if (e == null) { - e = new ChangeEvent(this); - } - ((ChangeListener)listeners[i + 1]).stateChanged(e); - } - } - } - - /** - * 返回标题 - * @return 标题 - */ - public String title4PopupWindow() { - return ""; - } - - public void populate(GeneralInfo attr) { - if(attr == null) { - return; - } - Background background = attr.getBackground(); - double alpha = attr.getAlpha() * ALPHA_V; - transparent.populateBean(alpha); - if(shadow != null){ - shadow.setSelectedIndex(attr.isShadow() == true ? 0 : 1); - } - for (int i = 0; i < paneList.size(); i++) { - BackgroundQuickPane pane = paneList.get(i); - if (pane.accept(background)) { - pane.populateBean(background); - typeComboBox.setSelectedIndex(i); - return; - } - } - } - - public void update(GeneralInfo attr) { - if (attr == null) { - attr = new GeneralInfo(); - } - attr.setBackground(paneList.get(typeComboBox.getSelectedIndex()).updateBean()); - if(attr.getBackground() instanceof ImageBackground){ - ((ImageBackground) attr.getBackground()).setLayout(Constants.IMAGE_EXTEND); - } - attr.setAlpha((float) (transparent.updateBean() / ALPHA_V)); - if(shadow != null){ - attr.setShadow(shadow.getSelectedIndex() == 0); - } - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java deleted file mode 100644 index 14765d058d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 16/6/29. - * 默认+颜色.+透明度 - */ -public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgroundPane { - - @Override - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double[] columnSize = {p, f}; - double[] rowSize = { p,p,p}; - - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(),rowSize,columnSize); - } - - @Override - protected void initList() { - paneList.add(new NullBackgroundQuickPane() { - /** - * 名称 - * - * @return 名称 - */ - @Override - public String title4PopupWindow() { - return Inter.getLocText("Chart-Default_Name"); - } - }); - paneList.add(new ColorBackgroundQuickPane()); - } - - - @Override - protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, - }; - } - -} - diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java deleted file mode 100644 index b39aa918a9..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; - -/** - * 图表 属性表.背景设置 界面.(包括 无, 颜色, 渐变)+开启阴影 - */ - -public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane { - private static final long serialVersionUID = 1322979785605013853L; - - public VanChartBackgroundWithOutImagePane() { - super(); - } - - protected void initList() { - paneList.add(new NullBackgroundQuickPane()); - paneList.add(new ColorBackgroundQuickPane()); - paneList.add(new VanChartGradientPane()); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java deleted file mode 100644 index 96dfca8be3..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.chart.chartglyph.GeneralInfo; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.general.Inter; - -import java.awt.*; - -/** - * 图表 属性表.背景设置 界面.(包括 无, 颜色, 渐变) + 圆角半径 - */ -public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackgroundWithOutImagePane { - private static final long serialVersionUID = -3387661350545592763L; - - private UISpinner radius; - - public VanChartBackgroundWithOutShadowWithRadiusPane(){ - super(); - } - - protected Component[][] getPaneComponents() { - radius = new UISpinner(0,1000,1,0); - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, - new Component[]{null, centerPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")),radius} - }; - } - - public void populate(GeneralInfo attr) { - if(attr == null) { - return; - } - super.populate(attr); - radius.setValue(attr.getRoundRadius()); - - } - - public void update(GeneralInfo attr) { - super.update(attr); - if (attr == null) { - attr = new GeneralInfo(); - } - attr.setRoundRadius((int)radius.getValue()); - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java deleted file mode 100644 index e3052d8910..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.base.background.GradientBackground; -import com.fr.design.event.UIObserverListener; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane; -import com.fr.design.style.background.gradient.FixedGradientBar; -import com.fr.general.Background; -import com.fr.general.Inter; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; - -/** - * 渐变色设置界面,bar无法拖拽 - */ -public class VanChartGradientPane extends GradientBackgroundQuickPane { - protected static final int CHART_GRADIENT_WIDTH = 150; - private static final long serialVersionUID = 256594362341221087L; - - private FixedGradientBar gradientBar; - private UIButtonGroup directionPane; - - public VanChartGradientPane() { - constructPane(); - } - - protected void constructPane(){ - String[] textArray = {Inter.getLocText("Utils-Left_to_Right"), Inter.getLocText("Utils-Top_to_Bottom")}; - Integer[] valueArray = {GradientBackground.LEFT2RIGHT, GradientBackground.TOP2BOTTOM}; - directionPane = new UIButtonGroup(textArray, valueArray); - directionPane.setSelectedIndex(0); - gradientBar = new FixedGradientBar(4, CHART_GRADIENT_WIDTH); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; - - Component[][] components = new Component[][]{ - new Component[]{gradientBar, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Gradient_Direction")),directionPane}, - }; - JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(Gradient, BorderLayout.CENTER); - } - - public void populateBean(Background background) { - GradientBackground bg = (GradientBackground) background; - this.gradientBar.getSelectColorPointBtnP1().setColorInner(bg.getStartColor()); - this.gradientBar.getSelectColorPointBtnP2().setColorInner(bg.getEndColor()); - directionPane.setSelectedItem(bg.getDirection()); - this.gradientBar.repaint(); - } - - public GradientBackground updateBean() { - GradientBackground gb = new GradientBackground(gradientBar.getSelectColorPointBtnP1().getColorInner(), gradientBar.getSelectColorPointBtnP2().getColorInner()); - gb.setDirection(directionPane.getSelectedItem()); - - return gb; - } - - /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ - public void registerChangeListener(final UIObserverListener listener) { - gradientBar.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - directionPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - } - - /** - * 是否接受 - * @param background 背景 - * @return 是则返回true - */ - public boolean accept(Background background) { - return background instanceof GradientBackground; - } - - /** - * 名称 - * @return 名称 - */ - public String title4PopupWindow() { - return Inter.getLocText("Plugin-Chart_Gradient_Color"); - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java deleted file mode 100644 index 300d9d8f5d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.fr.plugin.chart.designer.component.background; - -import com.fr.base.background.ColorBackground; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * 系列色(无背景颜色)、颜色面板 - */ -public class VanChartMarkerBackgroundPane extends VanChartBackgroundPane { - private static final long serialVersionUID = -1032221277140976934L; - - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); - } - - protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, - new Component[]{null, centerPane}, - }; - } - - protected void initList() { - paneList.add(new NullBackgroundQuickPane(){ - @Override - public String title4PopupWindow() { - return Inter.getLocText("Plugin-ChartF_SeriesColor"); - } - - }); - paneList.add(new ColorBackgroundQuickPane()); - } - - public void populate(ColorBackground colorBackground) { - if(colorBackground == null) { - return; - } - - for (int i = 0; i < paneList.size(); i++) { - BackgroundQuickPane pane = paneList.get(i); - if (pane.accept(colorBackground)) { - pane.populateBean(colorBackground); - typeComboBox.setSelectedIndex(i); - return; - } - } - } - - public ColorBackground update() { - return (ColorBackground)paneList.get(typeComboBox.getSelectedIndex()).updateBean(); - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java deleted file mode 100644 index 241bf85f89..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.fr.plugin.chart.designer.component.border; - - -import com.fr.chart.base.AttrBorder; -import com.fr.chart.chartglyph.GeneralInfo; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.icombobox.LineComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.style.color.ColorSelectBox; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.stable.CoreConstants; - -import javax.swing.*; -import java.awt.*; - -//线型 + 颜色 -public class VanChartBorderPane extends BasicPane { - private static final long serialVersionUID = -7770029552989609464L; - protected LineComboBox currentLineCombo; - protected ColorSelectBox currentLineColorPane; - - public VanChartBorderPane() { - initComponents(); - } - - protected void initComponents() { - currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); - currentLineColorPane = new ColorSelectBox(100); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p}; - Component[][] components = getUseComponent(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); - } - - protected Component[][] getUseComponent() { - return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),currentLineCombo}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),currentLineColorPane}, - }; - } - - /** - * 标题 - * @return 标题 - */ - public String title4PopupWindow() { - return null; - } - - public void populate(GeneralInfo attr) { - if(attr == null) { - return; - } - currentLineCombo.setSelectedLineStyle(attr.getBorderStyle()); - currentLineColorPane.setSelectObject(attr.getBorderColor()); - - } - - public void update(GeneralInfo attr) { - if(attr == null) { - attr = new GeneralInfo(); - } - attr.setBorderStyle(currentLineCombo.getSelectedLineStyle()); - attr.setBorderColor(currentLineColorPane.getSelectObject()); - - } - - public void update(AttrBorder attrBorder){ - if(attrBorder == null){ - return; - } - attrBorder.setBorderStyle(currentLineCombo.getSelectedLineStyle()); - attrBorder.setBorderColor(currentLineColorPane.getSelectObject()); - } - - public void populate(AttrBorder attr) { - if(attr == null) { - return; - } - currentLineCombo.setSelectedLineStyle(attr.getBorderStyle()); - currentLineColorPane.setSelectObject(attr.getBorderColor()); - } - - public AttrBorder update() { - AttrBorder attr = new AttrBorder(); - - attr.setBorderStyle(currentLineCombo.getSelectedLineStyle()); - attr.setBorderColor(currentLineColorPane.getSelectObject()); - - return attr; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithAlphaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithAlphaPane.java deleted file mode 100644 index 6b196d6f8b..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithAlphaPane.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.fr.plugin.chart.designer.component.border; - -import com.fr.design.gui.frpane.UINumberDragPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.general.Inter; -import com.fr.plugin.chart.VanChartAttrHelper; -import com.fr.plugin.chart.base.AttrBorderWithAlpha; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by Mitisky on 16/5/19. - * 边框,线型/颜色/不透明度 - */ -public class VanChartBorderWithAlphaPane extends VanChartBorderPane{ - private UINumberDragPane transparent; - - @Override - protected void initComponents() { - transparent = new UINumberDragPane(0,100); - this.add(new JSeparator(), BorderLayout.SOUTH); - - super.initComponents(); - } - - @Override - protected Component[][] getUseComponent() { - return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),currentLineCombo}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),currentLineColorPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent} - }; - } - - public void populate(AttrBorderWithAlpha attr) { - if(attr == null){ - return; - } - super.populate(attr); - transparent.populateBean(attr.getAlpha() * VanChartAttrHelper.PERCENT); - } - - @Override - public AttrBorderWithAlpha update() { - AttrBorderWithAlpha attrBorderWithAlpha = new AttrBorderWithAlpha(); - super.update(attrBorderWithAlpha); - attrBorderWithAlpha.setAlpha(transparent.updateBean()/ VanChartAttrHelper.PERCENT); - return attrBorderWithAlpha; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java deleted file mode 100644 index f7c330be24..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.fr.plugin.chart.designer.component.border; - -import com.fr.chart.base.AttrBorder; -import com.fr.chart.chartglyph.GeneralInfo; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; - -/** - * 线型 + 颜色 + 圆角半径 - */ -public class VanChartBorderWithRadiusPane extends VanChartBorderPane { - private static final long serialVersionUID = -3937853702118283803L; - private UISpinner radius; - - @Override - protected void initComponents() { - radius = new UISpinner(0,1000,1,0); - this.add(new JSeparator(), BorderLayout.SOUTH); - super.initComponents(); - } - - @Override - protected Component[][] getUseComponent() { - return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),currentLineCombo}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),currentLineColorPane}, - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")),radius} - } ; - } - - public void populate(GeneralInfo attr) { - super.populate(attr); - if(attr == null) { - return; - } - radius.setValue(attr.getRoundRadius()); - } - - public void update(GeneralInfo attr) { - super.update(attr); - attr.setRoundRadius((int)radius.getValue()); - } - - public void update(AttrBorder attrBorder) { - super.update(attrBorder); - attrBorder.setRoundRadius((int)radius.getValue()); - } - - public void populate(AttrBorder attr) { - super.populate(attr); - if(attr == null) { - return; - } - radius.setValue(attr.getRoundRadius()); - } - - public AttrBorder update() { - AttrBorder attr = super.update(); - attr.setRoundRadius((int)radius.getValue()); - return attr; - } -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java deleted file mode 100644 index c96f64d491..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/2/23. - */ -public class CategoryNameFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - - private static final long serialVersionUID = -782523079199004032L; - - public CategoryNameFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Chart-Category_Name"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedPercentFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedPercentFormatPaneWithCheckBox.java deleted file mode 100644 index 2f510e4653..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedPercentFormatPaneWithCheckBox.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by mengao on 2017/6/5. - */ -public class ChangedPercentFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - - public ChangedPercentFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Plugin-ChartF_Change_Percent"); - } - - protected boolean isPercent() { - return true; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedValueFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedValueFormatPaneWithCheckBox.java deleted file mode 100644 index 2c58324936..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ChangedValueFormatPaneWithCheckBox.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by mengao on 2017/6/9. - */ -public class ChangedValueFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox{ - - public ChangedValueFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Plugin-ChartF_Change_Value"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithNormalType.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithNormalType.java deleted file mode 100644 index a5caec453d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithNormalType.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by mengao on 2017/8/14. - * 没有字体设置 - * 类型下拉框中只有常规、数字、百分比、货币、科学计数选项,没有时间型、日期型、文本型选项。 - */ -public class FormatPaneWithNormalType extends FormatPaneWithOutFont { - - public FormatPaneWithNormalType() { - super(); - setForDataSheet(); - } - - protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) { - return new Component[][]{ - new Component[]{null, centerPane}, - }; - } - - protected void setTypeComboBoxPane(UIComboBox typeComboBox) { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getTypeComboBoxComponent(typeComboBox), rowSize, columnSize); - this.add(panel, BorderLayout.NORTH); - } - - protected Component[][] getTypeComboBoxComponent (UIComboBox typeComboBox) { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DataType"), SwingConstants.LEFT), typeComboBox}, - - }; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java deleted file mode 100644 index 54ce517108..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.style.FormatPane; -import com.fr.design.layout.TableLayout; -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by mengao on 2017/8/28. - * 只有文本格式设置,没有字体设置 - */ -public class FormatPaneWithOutFont extends FormatPane { - private static final int HEIGHT = 30; - - protected JPanel createContentPane(Component[][] components) { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] rowSize = {p, p, p}; - double[] columnSize = {f, e}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - } - - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { - typePane.setBorder(BorderFactory.createEmptyBorder()); - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane}, - new Component[]{null, centerPane}, - }; - } - - public Dimension getPreferredSize() { - //todo @mango - if (getTypeComboBox().getSelectedIndex() == 0) { - return new Dimension((int)getTypeComboBox().getPreferredSize().getWidth(), HEIGHT); - } - return new Dimension((int)super.getPreferredSize().getWidth(), (int)super.getPreferredSize().getHeight()); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/MapAreaNameFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/MapAreaNameFormatPaneWithCheckBox.java deleted file mode 100644 index 01fdaade9e..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/MapAreaNameFormatPaneWithCheckBox.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/5/20. - * 地图的标签区域名只是改了之前的分类名的名字,读写什么的都一样 - */ -public class MapAreaNameFormatPaneWithCheckBox extends CategoryNameFormatPaneWithCheckBox { - public MapAreaNameFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("FR-Chart-Area_Name"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/PercentFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/PercentFormatPaneWithCheckBox.java deleted file mode 100644 index 1324456a35..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/PercentFormatPaneWithCheckBox.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/2/23. - */ -public class PercentFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - - private static final long serialVersionUID = 566737138492111631L; - - public PercentFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Chart-Use_Percent"); - } - - protected boolean isPercent() { - return true; - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/SeriesNameFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/SeriesNameFormatPaneWithCheckBox.java deleted file mode 100644 index b2ad7bb6e0..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/SeriesNameFormatPaneWithCheckBox.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/2/23. - */ -public class SeriesNameFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - - private static final long serialVersionUID = 6456517419221601327L; - - public SeriesNameFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Chart-Series_Name"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ValueFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/ValueFormatPaneWithCheckBox.java deleted file mode 100644 index f076cd9d33..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/ValueFormatPaneWithCheckBox.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.general.Inter; -import com.fr.plugin.chart.designer.style.VanChartStylePane; - -import javax.swing.*; - -/** - * Created by Mitisky on 16/2/23. - */ -public class ValueFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - - private static final long serialVersionUID = -8793617093976412625L; - - public ValueFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected String getCheckBoxText() { - return Inter.getLocText("Chart-Use_Value"); - } -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java deleted file mode 100644 index d9fc65847d..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.fr.plugin.chart.designer.component.format; - -import com.fr.base.Style; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.design.gui.frpane.UIBubbleFloatPane; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.style.FormatPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.base.format.AttrTooltipFormat; -import com.fr.stable.Constants; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Point; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.text.Format; - -/** - * Created by Mitisky on 16/2/23. - */ -public abstract class VanChartFormatPaneWithCheckBox extends JPanel{ - private static final long serialVersionUID = -6563172546340480058L; - - private UICheckBox isSelectedBox; - private UIButton formatButton; - private FormatPane formatPane; - private Format format; - - private AbstractAttrNoScrollPane parent; - private JPanel showOnPane; - - private boolean isDirty; - - public VanChartFormatPaneWithCheckBox(AbstractAttrNoScrollPane parent, JPanel showOnPane) { - this.parent = parent; - this.showOnPane = showOnPane; - this.isDirty = true; - - this.setLayout(new BorderLayout()); - isSelectedBox = new UICheckBox(getCheckBoxText()); - formatButton = new UIButton(Inter.getLocText("Chart-Use_Format")); - this.add(isSelectedBox, BorderLayout.CENTER); - this.add(formatButton, BorderLayout.EAST); - - initFormatListener(); - isSelectedBox.addMouseListener(new MouseListener() { - @Override - public void mouseClicked(MouseEvent e) { - isDirty = true; - } - - @Override - public void mousePressed(MouseEvent e) { - - } - - @Override - public void mouseReleased(MouseEvent e) { - - } - - @Override - public void mouseEntered(MouseEvent e) { - - } - - @Override - public void mouseExited(MouseEvent e) { - - } - }); - } - - protected abstract String getCheckBoxText(); - - protected boolean isPercent() { - return false; - } - - private void initFormatListener() { - if(formatButton != null) { - formatButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseReleased(MouseEvent e) { - if (!formatButton.isEnabled()) { - return; - } - - if(formatPane == null) { - formatPane = createFormatPane(); - } - Point comPoint = formatButton.getLocationOnScreen(); - Point arrowPoint = new Point(comPoint.x +formatButton.getWidth() - 25, comPoint.y + formatButton.getHeight()); - UIBubbleFloatPane