|
|
@ -33,7 +33,10 @@ import javax.swing.plaf.ComponentUI; |
|
|
|
import javax.swing.plaf.UIResource; |
|
|
|
import javax.swing.plaf.UIResource; |
|
|
|
|
|
|
|
|
|
|
|
import com.github.weisj.darklaf.components.border.MutableLineBorder; |
|
|
|
import com.github.weisj.darklaf.components.border.MutableLineBorder; |
|
|
|
import com.github.weisj.darklaf.components.tabframe.*; |
|
|
|
import com.github.weisj.darklaf.components.tabframe.JTabFrame; |
|
|
|
|
|
|
|
import com.github.weisj.darklaf.components.tabframe.PanelPopup; |
|
|
|
|
|
|
|
import com.github.weisj.darklaf.components.tabframe.TabFramePopup; |
|
|
|
|
|
|
|
import com.github.weisj.darklaf.components.tabframe.TabFramePopupUI; |
|
|
|
import com.github.weisj.darklaf.components.uiresource.JLabelUIResource; |
|
|
|
import com.github.weisj.darklaf.components.uiresource.JLabelUIResource; |
|
|
|
import com.github.weisj.darklaf.ui.button.DarkButtonUI; |
|
|
|
import com.github.weisj.darklaf.ui.button.DarkButtonUI; |
|
|
|
import com.github.weisj.darklaf.ui.panel.DarkPanelUI; |
|
|
|
import com.github.weisj.darklaf.ui.panel.DarkPanelUI; |
|
|
@ -54,7 +57,7 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe |
|
|
|
protected Color headerBackground; |
|
|
|
protected Color headerBackground; |
|
|
|
protected Color headerButtonHoverBackground; |
|
|
|
protected Color headerButtonHoverBackground; |
|
|
|
protected Color headerButtonClickBackground; |
|
|
|
protected Color headerButtonClickBackground; |
|
|
|
protected String accelerator; |
|
|
|
protected KeyStroke closeAccelerator; |
|
|
|
private PanelPopup popupComponent; |
|
|
|
private PanelPopup popupComponent; |
|
|
|
private JPanel header; |
|
|
|
private JPanel header; |
|
|
|
private MutableLineBorder headerBorder; |
|
|
|
private MutableLineBorder headerBorder; |
|
|
@ -82,10 +85,9 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe |
|
|
|
headerFocusBackground = UIManager.getColor("TabFramePopup.headerFocusBackground"); |
|
|
|
headerFocusBackground = UIManager.getColor("TabFramePopup.headerFocusBackground"); |
|
|
|
headerButtonFocusHoverBackground = UIManager.getColor("TabFramePopup.headerButtonFocusHoverBackground"); |
|
|
|
headerButtonFocusHoverBackground = UIManager.getColor("TabFramePopup.headerButtonFocusHoverBackground"); |
|
|
|
headerButtonFocusClickBackground = UIManager.getColor("TabFramePopup.headerButtonFocusClickBackground"); |
|
|
|
headerButtonFocusClickBackground = UIManager.getColor("TabFramePopup.headerButtonFocusClickBackground"); |
|
|
|
accelerator = UIManager.getString("TabFramePopup.closeAccelerator"); |
|
|
|
closeAccelerator = KeyStroke.getKeyStroke(UIManager.getString("TabFramePopup.closeAccelerator")); |
|
|
|
popupComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) |
|
|
|
popupComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(closeAccelerator, "close"); |
|
|
|
.put(KeyStroke.getKeyStroke(accelerator), accelerator); |
|
|
|
popupComponent.getActionMap().put("close", closeAction); |
|
|
|
popupComponent.getActionMap().put(accelerator, closeAction); |
|
|
|
|
|
|
|
popupComponent.setLayout(new BorderLayout()); |
|
|
|
popupComponent.setLayout(new BorderLayout()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -173,9 +175,8 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe |
|
|
|
uninstallComponents(); |
|
|
|
uninstallComponents(); |
|
|
|
uninstallListeners(); |
|
|
|
uninstallListeners(); |
|
|
|
popupComponent.removeAll(); |
|
|
|
popupComponent.removeAll(); |
|
|
|
popupComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) |
|
|
|
popupComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).remove(closeAccelerator); |
|
|
|
.remove(KeyStroke.getKeyStroke(accelerator)); |
|
|
|
popupComponent.getActionMap().remove("close"); |
|
|
|
popupComponent.getActionMap().remove(accelerator); |
|
|
|
|
|
|
|
popupComponent = null; |
|
|
|
popupComponent = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|