package com.fr.plugin.shdcmap.ui; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.extended.chart.ExtendedScrollPane; import com.fr.plugin.shdcmap.CustomChart; import javax.swing.*; import java.awt.*; /** * @author duan.jingliang */ public class CustomChartLinkPane extends ExtendedScrollPane { private ChartHyperLinkPane hyperLinkPane; @Override protected JPanel createContentPane() { return new ContentPane(); } @Override public void populateBean(CustomChart chart) { hyperLinkPane.populateHyperLink(chart); } @Override public void updateBean(CustomChart chart) { hyperLinkPane.updateHyperLink(chart); } @Override protected String title4PopupWindow() { return Toolkit.i18nText("Plugin-ShdcMap-linktitle"); } private class ContentPane extends JPanel { public ContentPane() { initComponents(); } private void initComponents() { this.setLayout(new BorderLayout()); // 链接 JPanel linkContentPane = createLinkContentPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; double[] rowSize = {p, p}; Component[][] acomponents = new Component[][]{ new Component[]{linkContentPane} } ; JPanel panel = TableLayoutHelper.createTableLayoutPane(acomponents,rowSize,columnSize); this.add(panel,BorderLayout.CENTER); this.setVisible(true); } } private JPanel createLinkContentPane(){ hyperLinkPane = new ChartHyperLinkPane(); Component[][] comps = new Component[][]{ new Component[]{null}, new Component[]{hyperLinkPane} }; double p = TableLayout.PREFERRED; double f = TableLayout.FILL; JPanel panel = TableLayoutHelper.createTableLayoutPane(comps, new double[]{p, p}, new double[]{f}); return panel; } }