diff --git a/designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java b/designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java index 040a24fed..61189db24 100644 --- a/designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java +++ b/designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java @@ -1,9 +1,5 @@ package com.fr.design.chart.javascript; -import javax.swing.JComponent; -import javax.swing.JScrollPane; -import javax.swing.SwingConstants; - import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; @@ -14,6 +10,9 @@ import com.fr.design.mainframe.JTemplate; import com.fr.general.Inter; import com.fr.js.EmailJavaScript; +import javax.swing.*; +import java.awt.*; + /** * * @author jim @@ -30,11 +29,11 @@ public class ChartEmailPane extends EmailPane{ JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); // 是否支持导出控制图表的超链邮件是否显示showTplContent boolean supportExport = jTemplate.isJWorkBook(); + JPanel contentPane; if (supportExport) { - double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred, preferred}; + double[] rSizes = { preferred, preferred, preferred, preferred, preferred, fill, preferred, preferred}; showTplContent = new UICheckBox(Inter.getLocText("Email-Can_Preview_Report_Content")); - centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ - {new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField}, + contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ {new UILabel(), tipsPane1}, createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()), createLinePane(Inter.getLocText("HJS-CC_to"), ccEditor = new UITextField()), @@ -44,8 +43,8 @@ public class ChartEmailPane extends EmailPane{ {new UILabel(), showTplContent}, {new UILabel(), tipsPane2}},rSizes, columnSize, 6); } else { - double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred}; - centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ + double[] rSizes = { preferred, preferred, preferred, preferred, preferred, fill, preferred}; + contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ {new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField}, {new UILabel(), tipsPane1}, createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()), @@ -55,6 +54,17 @@ public class ChartEmailPane extends EmailPane{ {mainTextLabel, scrollPane}, {new UILabel(), tipsPane2}},rSizes, columnSize, 8); } + centerPane = new JPanel(new BorderLayout()); + if (needRenamePane()) { + JPanel namePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},}, + new double[] {preferred}, columnSize, 6); + centerPane.add(namePane, BorderLayout.NORTH); + } + centerPane.add(contentPane, BorderLayout.CENTER); + } + + protected boolean needRenamePane() { + return true; } protected void checkEmailConfig(boolean valid) { diff --git a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java index 3eaf5509e..7a4732807 100644 --- a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java +++ b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java @@ -56,7 +56,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver { private static final int STATE = 2; private static final int USER = 3; private static final int OFFSET_X = 800; - private static final int OFFSET_Y = 280; + private static final int OFFSET_Y = 250; private UIGroupExtensionPane groupExtensionPane; private UIButton addButton; diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java index 92b7149cb..caa1ab85d 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java @@ -147,7 +147,7 @@ public class ChartHyperPopAttrPane extends AbstractChartAttrPane { * @return 标题 */ public String title4PopupWindow() { - return Inter.getLocText("FR-Hyperlink_ChartHyperlink"); + return Inter.getLocText("Plugin-ChartF_Hyperlink"); } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 1a68ad5e5..cd449d0db 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -45,7 +45,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { ChartCollection cc = createChartCollection(); chartComponent = new ChartComponent(); - chartComponent.setPreferredSize(new Dimension(200, 170));// 在单元格弹出时 需要调整保证属性表的大小. + chartComponent.setPreferredSize(new Dimension(300, 170));// 在单元格弹出时 需要调整保证属性表的大小. chartComponent.setSupportEdit(false); chartComponent.populate(cc); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java index c7c3c51c7..8351f2738 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java @@ -16,7 +16,11 @@ import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.*; -import java.awt.event.*; +import java.awt.event.AWTEventListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * Created by IntelliJ IDEA. @@ -126,7 +130,7 @@ public class UIEditLabel extends JPanel implements UIObserver{ */ public void mouseExited(MouseEvent e) { showLabel.setToolTipText(getTooltip()); - UIEditLabel.this.setBackground(UIConstants.NORMAL_BACKGROUND); + UIEditLabel.this.setBackground(UIConstants.SELECT_TAB); } }); @@ -149,7 +153,7 @@ public class UIEditLabel extends JPanel implements UIObserver{ * 设置成正常的背景 */ public void resetNomalrBackground(){ - UIEditLabel.this.setBackground(UIConstants.NORMAL_BACKGROUND); + UIEditLabel.this.setBackground(UIConstants.SELECT_TAB); } private String getTooltip(){ 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 f8b002bcf..a56468c73 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 @@ -6,7 +6,16 @@ import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.AttrContents; import com.fr.chart.base.ChartConstants; import com.fr.chart.base.TimeSwitchAttr; -import com.fr.chart.chartattr.*; +import com.fr.chart.chartattr.BubblePlot; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.GanttPlot; +import com.fr.chart.chartattr.GisMapPlot; +import com.fr.chart.chartattr.MapPlot; +import com.fr.chart.chartattr.MeterPlot; +import com.fr.chart.chartattr.PiePlot; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartattr.StockPlot; +import com.fr.chart.chartattr.XYScatterPlot; import com.fr.chart.chartdata.GisMapReportDefinition; import com.fr.chart.chartdata.GisMapTableDefinition; import com.fr.chart.web.ChartHyperPoplink; @@ -39,7 +48,16 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.js.*; +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.format.FormatPaneWithOutFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; @@ -48,7 +66,12 @@ import com.fr.third.org.hsqldb.lib.Iterator; import javax.swing.*; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.text.DecimalFormat; import java.text.Format; import java.util.ArrayList; @@ -215,7 +238,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb @Override public void mouseClicked(MouseEvent e) { if (percentFormatPane == null) { - percentFormatPane = new FormatPane(); + percentFormatPane = new FormatPaneWithOutFont(); } DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%"); 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 6afc7b7d7..1b9c89e02 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 @@ -9,6 +9,7 @@ import com.fr.chart.base.ChartConstants; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Plot; import com.fr.design.constants.LayoutConstants; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -18,15 +19,20 @@ import com.fr.design.gui.style.FormatPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.dialog.BasicPane; 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 javax.swing.*; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.text.DecimalFormat; import java.text.Format; import java.util.HashMap; @@ -226,7 +232,7 @@ public class ChartDatapointLabelPane extends BasicPane{ } if(valueFormatPane == null) { - valueFormatPane = new FormatPane(); + valueFormatPane = new FormatPaneWithOutFont(); } Point comPoint = valueFormatButton.getLocationOnScreen(); Point arrowPoint = new Point(comPoint.x + valueFormatButton.getWidth(), comPoint.y + valueFormatButton.getHeight()); @@ -255,7 +261,7 @@ public class ChartDatapointLabelPane extends BasicPane{ } if(percentFormatPane == null) { - percentFormatPane = new FormatPane(); + percentFormatPane = new FormatPaneWithOutFont(); } Point comPoint = valuePercentFormatButton.getLocationOnScreen(); Point arrowPoint = new Point(comPoint.x + valuePercentFormatButton.getWidth(), comPoint.y + valuePercentFormatButton.getHeight()); @@ -429,7 +435,7 @@ public class ChartDatapointLabelPane extends BasicPane{ protected void updatePercentFormatpane(){ if(isValuePercent!= null && isValuePercent.isSelected()){ if(this.percentFormatPane == null){ - this.percentFormatPane = new FormatPane(); + this.percentFormatPane = new FormatPaneWithOutFont(); } if(this.percentFormat == null){ DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%"); diff --git a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java index d590de46c..bbb30b888 100644 --- a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java @@ -40,11 +40,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{ return contentPane; } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(createStylePane(), BorderLayout.CENTER); - } - protected Class getStackAndAxisPaneClass() { return VanChartCustomStackAndAxisConditionPane.class; } 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 index 10fef883d..277c212de 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -6,18 +6,12 @@ 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.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.UIListControlPane; -import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.module.DesignModuleFactory; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.js.EmailJavaScript; @@ -29,16 +23,12 @@ 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.attr.plot.VanChartPlot; +import com.fr.plugin.chart.designer.component.VanChartUIListControlPane; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.stable.ListMap; import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -47,7 +37,7 @@ import java.util.Set; /** * Created by Fangjie on 2016/4/28. */ -public class VanChartHyperLinkPane extends UIListControlPane { +public class VanChartHyperLinkPane extends VanChartUIListControlPane { public VanChartHyperLinkPane() { super(); @@ -115,19 +105,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { return new NameJavaScriptGroup(res_array); } - @Override - public void saveSettings() { - if (isPopulating) { - return; - } - update((VanChartPlot) plot); - } - public void populate(Plot plot) { - //特殊处理,使用instanceof判断,处理连续弹窗问题 - if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) { - popupEditDialog = new HyperDialog(cardPane); - } this.plot = plot; HashMap paneMap = getHyperlinkMap(plot); @@ -207,7 +185,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { 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(), ChartEmailPane.class)); + list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), HyperlinkMapFactory.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"), @@ -240,87 +218,4 @@ public class VanChartHyperLinkPane extends UIListControlPane { } return null; } - - - 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/custom/style/VanChartCustomSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java index 3af0a3642..cc1007002 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java @@ -6,10 +6,8 @@ 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.general.Inter; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.VanChartBeautyPane; import com.fr.plugin.chart.designer.component.VanChartFillStylePane; @@ -81,9 +79,8 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane { }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"),panel); panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); - return colorPane; + return panel; } /** diff --git a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java index f05028672..d96250799 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java @@ -27,6 +27,7 @@ public abstract class AbstractVanChartScrollPane extends BasicScrollPane { } else { leftcontentPane.setBounds(0, 0, width, height); + leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original)); } } public void reloaPane(JPanel pane){ 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 new file mode 100644 index 000000000..5da2a0461 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java @@ -0,0 +1,133 @@ +package com.fr.plugin.chart.designer.component; + +import com.fr.base.chart.BasePlot; +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; +import com.fr.stable.Nameable; + +import javax.swing.*; +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 { + + public VanChartUIListControlPane() { + super(); + } + + public VanChartUIListControlPane(BasePlot plot) { + super(plot); + } + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((Plot) plot); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + 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/format/VanChartFormatPaneWithCheckBox.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java index 2319956f1..1ac6a7a27 100644 --- 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 @@ -92,7 +92,7 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{ formatPane = createFormatPane(); } Point comPoint = formatButton.getLocationOnScreen(); - Point arrowPoint = new Point(comPoint.x + formatButton.getWidth(), comPoint.y + formatButton.getHeight()); + Point arrowPoint = new Point(comPoint.x, comPoint.y + formatButton.getHeight()); UIBubbleFloatPane