|
|
@ -2,6 +2,8 @@ package com.fr.design.sort.common; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
|
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
@ -29,7 +31,7 @@ public class SortUIExpandablePane extends JPanel { |
|
|
|
this.sortGroupPane = sortGroupPane; |
|
|
|
this.sortGroupPane = sortGroupPane; |
|
|
|
this.contentPane = contentPane; |
|
|
|
this.contentPane = contentPane; |
|
|
|
initComponents(); |
|
|
|
initComponents(); |
|
|
|
wrapPane.setBorder(BorderFactory.createLineBorder(Color.gray, 1)); |
|
|
|
wrapPane.setBorder(BorderFactory.createLineBorder(new Color(217, 218, 221), 1)); |
|
|
|
wrapPane.setBackground(Color.WHITE); |
|
|
|
wrapPane.setBackground(Color.WHITE); |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 5)); |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 5)); |
|
|
|
} |
|
|
|
} |
|
|
@ -45,7 +47,7 @@ public class SortUIExpandablePane extends JPanel { |
|
|
|
setContentPanelShow(!contentPane.isVisible()); |
|
|
|
setContentPanelShow(!contentPane.isVisible()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
headerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.gray)); |
|
|
|
headerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(217, 218, 221))); |
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); |
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); |
|
|
|
wrapPane.add(headerPane, BorderLayout.NORTH); |
|
|
|
wrapPane.add(headerPane, BorderLayout.NORTH); |
|
|
|
wrapPane.add(contentPane, BorderLayout.CENTER); |
|
|
|
wrapPane.add(contentPane, BorderLayout.CENTER); |
|
|
@ -59,14 +61,15 @@ public class SortUIExpandablePane extends JPanel { |
|
|
|
headerPane.setShow(show); |
|
|
|
headerPane.setShow(show); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class HeaderPane extends JPanel { |
|
|
|
class HeaderPane extends JPanel implements UIObserver { |
|
|
|
UILabel iconUiLabel; |
|
|
|
UILabel iconUiLabel; |
|
|
|
UILabel closeButton; |
|
|
|
UILabel closeButton; |
|
|
|
AbstractSortGroupPane sortGroupPane; |
|
|
|
AbstractSortGroupPane sortGroupPane; |
|
|
|
|
|
|
|
UIObserverListener uiObserverListener; |
|
|
|
|
|
|
|
|
|
|
|
HeaderPane(AbstractSortGroupPane sortGroupPane) { |
|
|
|
HeaderPane(AbstractSortGroupPane sortGroupPane) { |
|
|
|
this.sortGroupPane = sortGroupPane; |
|
|
|
this.sortGroupPane = sortGroupPane; |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 3)); |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0)); |
|
|
|
initComponents(); |
|
|
|
initComponents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -75,14 +78,18 @@ public class SortUIExpandablePane extends JPanel { |
|
|
|
this.add(iconUiLabel); |
|
|
|
this.add(iconUiLabel); |
|
|
|
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort")); |
|
|
|
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort")); |
|
|
|
this.add(uiLabel); |
|
|
|
this.add(uiLabel); |
|
|
|
this.add(AbstractSortPane.createIntervalUILabel(114)); |
|
|
|
this.add(AbstractSortPane.createIntervalUILabel(108)); |
|
|
|
|
|
|
|
|
|
|
|
closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png")); |
|
|
|
closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png")); |
|
|
|
|
|
|
|
closeButton.setPreferredSize(new Dimension(16, 20)); |
|
|
|
this.add(closeButton); |
|
|
|
this.add(closeButton); |
|
|
|
closeButton.addMouseListener(new MouseAdapter() { |
|
|
|
closeButton.addMouseListener(new MouseAdapter() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
sortGroupPane.removeSortItem(1); |
|
|
|
sortGroupPane.removeSortItem(1); |
|
|
|
|
|
|
|
if (uiObserverListener != null) { |
|
|
|
|
|
|
|
uiObserverListener.doChange(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.setPreferredSize(new Dimension(contentPane.sortItemPaneWidth + 7, AbstractSortPane.PANE_COMPONENT_HEIGHT)); |
|
|
|
this.setPreferredSize(new Dimension(contentPane.sortItemPaneWidth + 7, AbstractSortPane.PANE_COMPONENT_HEIGHT)); |
|
|
@ -96,6 +103,15 @@ public class SortUIExpandablePane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void registerChangeListener(UIObserverListener uiObserverListener) { |
|
|
|
|
|
|
|
this.uiObserverListener = uiObserverListener; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean shouldResponseChangeListener() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |