|
|
@ -1,8 +1,11 @@ |
|
|
|
package com.fr.design.gui.controlpane; |
|
|
|
package com.fr.design.gui.controlpane; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.light.ui.FineRoundBorder; |
|
|
|
import com.fine.theme.light.ui.FineRoundBorder; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
@ -11,6 +14,7 @@ import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
import com.fr.design.gui.ilist.UIList; |
|
|
|
import com.fr.design.gui.ilist.UIList; |
|
|
|
import com.fr.design.gui.ilist.UINameEdList; |
|
|
|
import com.fr.design.gui.ilist.UINameEdList; |
|
|
|
|
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.widget.EventCreator; |
|
|
|
import com.fr.design.widget.EventCreator; |
|
|
|
import com.fr.form.event.Listener; |
|
|
|
import com.fr.form.event.Listener; |
|
|
@ -21,6 +25,7 @@ import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.Nameable; |
|
|
|
import com.fr.stable.Nameable; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.DefaultListModel; |
|
|
|
import javax.swing.DefaultListModel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.ListModel; |
|
|
|
import javax.swing.ListModel; |
|
|
@ -78,6 +83,13 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li |
|
|
|
return isPopulating; |
|
|
|
return isPopulating; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected JPanel getLeftTopPane(UIToolbar topToolBar) { |
|
|
|
|
|
|
|
UIToolbar toolbar = getTopToolBar(); |
|
|
|
|
|
|
|
toolbar.setPreferredSize(FineUIScale.scale(new Dimension(160, 24))); |
|
|
|
|
|
|
|
return super.getLeftTopPane(topToolBar); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void initLeftPane(JPanel leftPane) { |
|
|
|
protected void initLeftPane(JPanel leftPane) { |
|
|
|
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); |
|
|
|
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); |
|
|
@ -200,6 +212,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li |
|
|
|
|
|
|
|
|
|
|
|
nameEdList.setCellRenderer(new UINameableListCellRenderer(true, this.creators)); |
|
|
|
nameEdList.setCellRenderer(new UINameableListCellRenderer(true, this.creators)); |
|
|
|
nameEdList.setName(text); |
|
|
|
nameEdList.setName(text); |
|
|
|
|
|
|
|
nameEdList.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); |
|
|
|
nameEdList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS); |
|
|
|
nameEdList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS); |
|
|
|
nameEdList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); |
|
|
|
nameEdList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); |
|
|
|
nameEdList.addMouseListener(new MouseAdapter() { |
|
|
|
nameEdList.addMouseListener(new MouseAdapter() { |
|
|
@ -537,18 +550,18 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li |
|
|
|
|
|
|
|
|
|
|
|
public ListWrapperPane(String labelText, UINameEdList nameEdList) { |
|
|
|
public ListWrapperPane(String labelText, UINameEdList nameEdList) { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
UILabel label = new UILabel(labelText + getWrapperLabelText()) { |
|
|
|
UILabel label = new UILabel(" " + labelText + getWrapperLabelText()) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void paint(Graphics g) { |
|
|
|
public void paint(Graphics g) { |
|
|
|
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); |
|
|
|
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); |
|
|
|
super.paint(g); |
|
|
|
super.paint(g); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
label.setBorder(new ScaledEmptyBorder(0, 8, 0, 0)); |
|
|
|
label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); |
|
|
|
label.setOpaque(true); |
|
|
|
label.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); |
|
|
|
label.setBackground(Color.WHITE); |
|
|
|
|
|
|
|
label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); |
|
|
|
label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); |
|
|
|
label.setFont(label.getFont().deriveFont(11F)); |
|
|
|
label.setFont(label.getFont().deriveFont(11F)); |
|
|
|
|
|
|
|
label.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(24))); |
|
|
|
this.nameEdList = nameEdList; |
|
|
|
this.nameEdList = nameEdList; |
|
|
|
this.add(label, BorderLayout.NORTH); |
|
|
|
this.add(label, BorderLayout.NORTH); |
|
|
|
this.add(this.nameEdList, BorderLayout.CENTER); |
|
|
|
this.add(this.nameEdList, BorderLayout.CENTER); |
|
|
|