Browse Source

Merge pull request #750 in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit 'a84074730377908b1ef6dd25bfb5154774649a49':
  代码质量
  代码质量
  CHART-2809 大屏自动播放 design
bugfix/10.0
zheng 6 years ago
parent
commit
bba204843c
  1. 34
      designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  2. 48
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  3. 45
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  4. 3
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java
  5. 54
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

34
designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java

@ -4,9 +4,15 @@ import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.js.JavaScript;
import com.fr.js.LinkAnimateType;
import javax.swing.JPanel;
import java.util.HashMap;
/**
@ -16,6 +22,7 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
private HashMap hyperLinkEditorMap;
private boolean needRenamePane = false;
protected ReportletParameterViewPane parameterViewPane;
private UIButtonGroup<LinkAnimateType> animateTypeUIButtonGroup;
public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
@ -41,6 +48,33 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
public void reset() {
}
protected JPanel createAnimateTypeUIButtonGroup() {
animateTypeUIButtonGroup = new UIButtonGroup<LinkAnimateType>(
new String[]{LinkAnimateType.RELOAD.toLocaleString(), LinkAnimateType.INCREMENT.toLocaleString()},
new LinkAnimateType[]{LinkAnimateType.RELOAD, LinkAnimateType.INCREMENT});
animateTypeUIButtonGroup.setSelectedIndex(0);
JPanel jp = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
jp.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Link_Animate_Type")));
jp.add(animateTypeUIButtonGroup);
return jp;
}
protected void populateAnimateType(LinkAnimateType animateType) {
if (animateTypeUIButtonGroup != null && animateType != LinkAnimateType.NONE) {
animateTypeUIButtonGroup.setSelectedItem(animateType);
}
}
protected LinkAnimateType updateAnimateType() {
if (animateTypeUIButtonGroup != null) {
return animateTypeUIButtonGroup.getSelectedItem();
}
return LinkAnimateType.NONE;
}
protected int getChartParaType() {
return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE;
}

48
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -8,12 +8,12 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ColumnRow;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.List;
@ -53,12 +53,18 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH);
addPaneInCenter(centerPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH);
}
protected void addPaneInCenter(JPanel centerPane) {
}
@Override
public void populateBean(ChartHyperRelateCellLink ob) {
if (ob == null) {
@ -117,9 +123,45 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
}
public static class ChartNoRename extends ChartHyperRelateCellLinkPane {
public ChartNoRename() {
super();
}
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
protected boolean needRenamePane() {
return false;
}
}
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType() {
super();
}
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
@Override
protected void addPaneInCenter(JPanel centerPane) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateCellLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateCellLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
}
}
}

45
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -11,14 +11,16 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -69,6 +71,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
centerPane.setBorder(border);
centerPane.add(pane, BorderLayout.NORTH);
addPaneInCenter(centerPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
@ -76,6 +79,9 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
this.add(parameterViewPane, BorderLayout.SOUTH);
}
protected void addPaneInCenter(JPanel centerPane) {
}
private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if (adapter != null) {
@ -148,8 +154,41 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
}
public static class ChartNoRename extends ChartHyperRelateFloatLinkPane {
public ChartNoRename() {
}
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
protected boolean needRenamePane() {
return false;
}
}
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType() {
}
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
@Override
protected void addPaneInCenter(JPanel centerPane) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateFloatLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateFloatLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
}
}
}

3
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java

@ -11,7 +11,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.bridge.StableFactory;
@ -51,7 +50,7 @@ public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider>
targetFrameComboBox = formHyperlinkEditors == null ? new UIComboBox() : new UIComboBox(getFormHyperlinkEditNames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer());
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] rowSize = {p, p};
double[] columnSize = {p, TableLayout.FILL};
Component[][] components;
if (!this.needRenamePane) {

54
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -7,13 +7,13 @@ import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.ParameterProvider;
import com.fr.stable.bridge.StableFactory;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.HashMap;
public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
@ -35,13 +35,18 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
northPane = new FormHyperlinkNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH);
addNorthPane(northPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null));
}
protected void addNorthPane(JPanel northPane) {
this.add(northPane, BorderLayout.NORTH);
}
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link");
@ -70,7 +75,6 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
formHyperlink.setType(getHyperlinkType());
updateBean(formHyperlink);
return formHyperlink;
}
@ -91,6 +95,13 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
}
public static class ChartNoRename extends FormHyperlinkPane {
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
public ChartNoRename() {
}
protected boolean needRenamePane() {
return false;
}
@ -99,4 +110,37 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
return ParameterTableModel.CHART_NORMAL_USE;
}
}
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
public ChartHasAnimateType() {
}
@Override
protected void addNorthPane(JPanel northPane) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(northPane, BorderLayout.NORTH);
JPanel animatePane = createAnimateTypeUIButtonGroup();
animatePane.setBorder(BorderFactory.createEmptyBorder(0, 8, 10, 10));
panel.add(animatePane, BorderLayout.CENTER);
this.add(panel, BorderLayout.NORTH);
}
@Override
public void populateBean(FormHyperlinkProvider formHyperlink) {
super.populateBean(formHyperlink);
populateAnimateType(formHyperlink.getAnimateType());
}
@Override
public void updateBean(FormHyperlinkProvider formHyperlink) {
super.updateBean(formHyperlink);
formHyperlink.setAnimateType(updateAnimateType());
}
}
}

Loading…
Cancel
Save