Browse Source

Merge pull request #1 in ~ZHENG/c-design from release/10.0 to 10.0

* commit 'fe8fed4baf87eaf5f5ecd003e9c891e355d10527':
  CHART-3122 流向地球不支持超链
master
zheng 6 years ago
parent
commit
90cfd45434
  1. 32
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java

32
designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java

@ -16,22 +16,24 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.util.Arrays;
/** /**
* Created by shine on 2018/3/12. * Created by shine on 2018/3/12.
*/ */
public class ExtendedOtherPane extends AbstractChartAttrPane { public class ExtendedOtherPane<T extends AbstractChart> extends AbstractChartAttrPane {
private ExtendedChartHyperLinkPane hyperLinkPane; private ExtendedChartHyperLinkPane hyperLinkPane;
private UIButtonGroup refreshEnabled; private UIButtonGroup refreshEnabled;
private UISpinner autoRefreshTime; private UISpinner autoRefreshTime;
private JPanel contentPane; private JPanel contentPane;
protected AbstractChart getAbstractChart(Chart chart) { private T chart;
if (chart != null && chart instanceof AbstractChart) {
return (AbstractChart) chart; protected void setChart(Chart chart) {
if (chart instanceof AbstractChart) {
this.chart = (T) chart;
} }
return null;
} }
@Override @Override
@ -40,7 +42,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
return; return;
} }
AbstractChart chart = getAbstractChart(collection.getSelectedChart()); setChart(collection.getSelectedChart());
if (chart != null) { if (chart != null) {
hyperLinkPane.populateBean(chart); hyperLinkPane.populateBean(chart);
@ -57,7 +59,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
return; return;
} }
AbstractChart chart = getAbstractChart(collection.getSelectedChart()); setChart(collection.getSelectedChart());
if (chart != null) { if (chart != null) {
hyperLinkPane.updateBean(chart); hyperLinkPane.updateBean(chart);
@ -77,16 +79,20 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p}; Component[][] components = getComponents(createRefreshPane(), createHyperlinkPane());
double[] rowSize = new double[components.length];
Component[][] components = new Component[][]{ Arrays.fill(rowSize, p);
new Component[]{createRefreshPane(), null},
new Component[]{createHyperlinkPane(), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
protected Component[][] getComponents(JPanel refresh, JPanel hyperlink) {
return new Component[][]{
new Component[]{refresh, null},
new Component[]{hyperlink, null}
};
}
@Override @Override
public String getIconPath() { public String getIconPath() {
return null; return null;

Loading…
Cancel
Save