|
|
@ -1,12 +1,10 @@ |
|
|
|
package com.fr.design.expand; |
|
|
|
package com.fr.design.expand; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.event.GlobalNameListener; |
|
|
|
import com.fr.design.event.GlobalNameListener; |
|
|
|
import com.fr.design.event.GlobalNameObserver; |
|
|
|
import com.fr.design.event.GlobalNameObserver; |
|
|
|
import com.fr.design.gui.columnrow.ColumnRowPane; |
|
|
|
import com.fr.design.gui.columnrow.ColumnRowPane; |
|
|
|
import com.fr.design.gui.core.ReactiveCardPane; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
@ -18,12 +16,13 @@ import com.fr.grid.selection.Selection; |
|
|
|
import com.fr.report.cell.cellattr.CellExpandAttr; |
|
|
|
import com.fr.report.cell.cellattr.CellExpandAttr; |
|
|
|
import com.fr.stable.ColumnRow; |
|
|
|
import com.fr.stable.ColumnRow; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
|
|
|
|
public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver { |
|
|
|
public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver { |
|
|
|
|
|
|
|
|
|
|
@ -35,7 +34,6 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser |
|
|
|
private String expandFatherName = ""; |
|
|
|
private String expandFatherName = ""; |
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
private boolean isAlreadyAddListener = false; |
|
|
|
private boolean isAlreadyAddListener = false; |
|
|
|
private ReactiveCardPane cardPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ExpandFatherPane() { |
|
|
|
public ExpandFatherPane() { |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
@ -55,20 +53,12 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser |
|
|
|
JPanel cc = new JPanel(new BorderLayout(LayoutConstants.HGAP_SMALL, 0)); |
|
|
|
JPanel cc = new JPanel(new BorderLayout(LayoutConstants.HGAP_SMALL, 0)); |
|
|
|
cc.add(customParentColumnRowPane, BorderLayout.CENTER); |
|
|
|
cc.add(customParentColumnRowPane, BorderLayout.CENTER); |
|
|
|
cc.add(imageButton, BorderLayout.EAST); |
|
|
|
cc.add(imageButton, BorderLayout.EAST); |
|
|
|
cardPane = ReactiveCardPane.create() |
|
|
|
this.add(column(LayoutConstants.VERTICAL_GAP, |
|
|
|
.addSupplier("content", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
|
|
|
cell(comboBox), |
|
|
|
cell(comboBox), |
|
|
|
cell(cc)).getComponent()) |
|
|
|
cell(cc) |
|
|
|
.addSupplier("none", () -> Layouts.cell(comboBox).getComponent()); |
|
|
|
).getComponent()); |
|
|
|
cardPane.select("none").populate(); |
|
|
|
|
|
|
|
this.add(cardPane); |
|
|
|
|
|
|
|
comboBox.addItemListener(e -> { |
|
|
|
comboBox.addItemListener(e -> { |
|
|
|
if (comboBox.getSelectedIndex() == 2) { |
|
|
|
cc.setVisible(comboBox.getSelectedIndex() == 2); |
|
|
|
cardPane.select("content").populate(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cardPane.select("none").populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
globalNameListener.setGlobalName(expandFatherName); |
|
|
|
globalNameListener.setGlobalName(expandFatherName); |
|
|
|
} |
|
|
|
} |
|
|
|