Browse Source

CHART-2809 大屏自动播放 design

bugfix/10.0
zheng 6 years ago
parent
commit
a4a8d4eb17
  1. 38
      designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  2. 36
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  3. 35
      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. 40
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

38
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,37 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
public void reset() {
}
protected boolean needAnimatePane() {
return false;
}
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;
}

36
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,6 +53,10 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH);
if (needAnimatePane()) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
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));
@ -74,6 +78,8 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane.populate(ColumnRow.valueOf("A1"));
}
populateAnimateType(ob.getAnimateType());
List parameterList = this.parameterViewPane.update();
parameterList.clear();
@ -88,6 +94,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
chartLink.setAnimateType(updateAnimateType());
return chartLink;
}
@ -117,9 +124,32 @@ 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);
}
protected boolean needAnimatePane() {
return true;
}
}
}

35
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,9 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
centerPane.setBorder(border);
centerPane.add(pane, BorderLayout.NORTH);
if (needAnimatePane()) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
@ -105,6 +110,8 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
floatNameBox.setSelectedItem(ob.getRelateCCName());
}
populateAnimateType(ob.getAnimateType());
List parameterList = this.parameterViewPane.update();
parameterList.clear();
@ -119,6 +126,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
chartLink.setAnimateType(updateAnimateType());
return chartLink;
}
@ -148,8 +156,29 @@ 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 boolean needAnimatePane() {
return true;
}
}
}

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) {

40
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,7 +35,15 @@ 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);
JPanel panel = new JPanel(new BorderLayout());
panel.add(northPane, BorderLayout.NORTH);
if (needAnimatePane()) {
JPanel animatePane = createAnimateTypeUIButtonGroup();
animatePane.setBorder(BorderFactory.createEmptyBorder(0, 8, 10, 10));
panel.add(animatePane, BorderLayout.CENTER);
}
this.add(panel, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER);
@ -63,6 +71,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
ParameterProvider[] parameters = formHyperlink.getParameters();
parameterViewPane.populate(parameters);
populateAnimateType(formHyperlink.getAnimateType());
}
@Override
@ -71,6 +80,8 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
formHyperlink.setType(getHyperlinkType());
updateBean(formHyperlink);
formHyperlink.setAnimateType(updateAnimateType());
return formHyperlink;
}
@ -91,6 +102,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 +117,18 @@ 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 boolean needAnimatePane() {
return true;
}
}
}

Loading…
Cancel
Save