|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.light.ui.PropertiesItemUI; |
|
|
|
|
import com.formdev.flatlaf.FlatDarkLaf; |
|
|
|
|
import com.formdev.flatlaf.ui.FlatLineBorder; |
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
@ -80,9 +81,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
private static final int CONTAINER_WIDTH = containerWidth(); |
|
|
|
|
private static final int TAB_WIDTH = 42; |
|
|
|
|
private static final int TAB_BUTTON_WIDTH = 40; |
|
|
|
|
private static final int TAB_BUTTON_HEIGHT = 34; |
|
|
|
|
private static final int TAB_BUTTON_HEIGHT = 40; |
|
|
|
|
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; |
|
|
|
|
private static final int POPUP_TOOLPANE_HEIGHT = 27; |
|
|
|
|
private static final int POPUP_TOOLPANE_HEIGHT = 40; |
|
|
|
|
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; |
|
|
|
|
// 弹出对话框高度
|
|
|
|
|
private static final int POPUP_MIN_HEIGHT = 145; |
|
|
|
@ -416,7 +417,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
// 左侧按钮面板
|
|
|
|
|
private void initLeftPane() { |
|
|
|
|
leftPane = new JPanel(); |
|
|
|
|
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 4)); |
|
|
|
|
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 0)); |
|
|
|
|
for (PropertyItem item : propertyItemMap.values()) { |
|
|
|
|
if (item.isPoppedOut() || !item.isVisible()) { |
|
|
|
|
continue; |
|
|
|
@ -767,16 +768,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
|
|
|
|
|
// 完整icon路径为 ICON_BASE_DIR + btnIconName + iconSuffix
|
|
|
|
|
private static final String ICON_BASE_DIR = "/com/fr/design/standard/propertiestab/"; |
|
|
|
|
private static final String ICON_SUFFIX_NORMAL = "_normal.svg"; |
|
|
|
|
private static final String ICON_SUFFIX_DISABLED = "_disabled.svg"; |
|
|
|
|
private static final String ICON_SUFFIX_SELECTED = "_selected.svg"; |
|
|
|
|
private static final String ICON_SUFFIX_NORMAL = StringUtils.EMPTY; |
|
|
|
|
private static final String ICON_SUFFIX_DISABLED = "_disabled"; |
|
|
|
|
private static final String ICON_SUFFIX_SELECTED = "_selected"; |
|
|
|
|
private static final int ICON_WIDTH = 18; |
|
|
|
|
private static final int ICON_HEIGHT = 18; |
|
|
|
|
private String btnIconName; |
|
|
|
|
private String iconBaseDir; |
|
|
|
|
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
|
|
|
|
|
private final Color selectedBtnBackground = new Color(0xF5F5F7); |
|
|
|
|
private Color originBtnBackground; |
|
|
|
|
private final Color selectedBtnBackground = UIManager.getColor("East.TabSelectedColor"); |
|
|
|
|
private ActionListener actionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -967,15 +967,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getBtnIconUrl() { |
|
|
|
|
|
|
|
|
|
return getIconBaseDir() + btnIconName + iconSuffix; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getBtnIconId() { |
|
|
|
|
return btnIconName + iconSuffix; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void resetButtonIcon() { |
|
|
|
|
button.setBackground(null); |
|
|
|
|
if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { |
|
|
|
|
iconSuffix = ICON_SUFFIX_NORMAL; |
|
|
|
|
button.setIcon(IconUtils.readIcon(getBtnIconUrl())); |
|
|
|
|
// button.setBackground(originBtnBackground);
|
|
|
|
|
button.setIcon(new LazyIcon(getBtnIconId())); |
|
|
|
|
button.setOpaque(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -983,8 +986,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
public void setTabButtonSelected() { |
|
|
|
|
resetPropertyIcons(); |
|
|
|
|
iconSuffix = ICON_SUFFIX_SELECTED; |
|
|
|
|
button.setIcon(IconUtils.readIcon(getBtnIconUrl())); |
|
|
|
|
// button.setBackground(selectedBtnBackground);
|
|
|
|
|
button.setIcon(new LazyIcon(getBtnIconId())); |
|
|
|
|
button.setBackground(selectedBtnBackground); |
|
|
|
|
button.setOpaque(true); |
|
|
|
|
selectedItem = this; |
|
|
|
|
} |
|
|
|
@ -994,28 +997,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initButton() { |
|
|
|
|
button = new UIButton(IconUtils.readIcon(getBtnIconUrl())) { |
|
|
|
|
button = new UIButton(new LazyIcon(getBtnIconId())) { |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); |
|
|
|
|
button.setDisabledIcon(new LazyIcon(btnIconName + ICON_SUFFIX_DISABLED)); |
|
|
|
|
button.set4LargeToolbarButton(); |
|
|
|
|
// button.setUI(new UIButtonUI() {
|
|
|
|
|
// @Override
|
|
|
|
|
// protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
|
|
|
|
|
// if (isPressed(b) && b.isPressedPainted()) {
|
|
|
|
|
// Color pressColor = isTabButtonSelected() ? UIConstants.TAB_BUTTON_PRESS_SELECTED : UIConstants.TAB_BUTTON_PRESS;
|
|
|
|
|
// GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), pressColor);
|
|
|
|
|
// } else if (isRollOver(b)) {
|
|
|
|
|
// Color hoverColor = isTabButtonSelected() ? UIConstants.TAB_BUTTON_HOVER_SELECTED : UIConstants.TAB_BUTTON_HOVER;
|
|
|
|
|
// GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), hoverColor);
|
|
|
|
|
// } else if (b.isNormalPainted()) {
|
|
|
|
|
// GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
originBtnBackground = button.getBackground(); |
|
|
|
|
button.setUI(new PropertiesItemUI(false)); |
|
|
|
|
button.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
@ -1284,9 +1273,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
this.propertyItem = propertyItem; |
|
|
|
|
this.title = propertyItem.getTitle(); |
|
|
|
|
originColor = UIConstants.UI_TOOLBAR_COLOR; |
|
|
|
|
this.setForeground(UIManager.getColor("DarkenedFontColor")); |
|
|
|
|
|
|
|
|
|
contentPane = new JPanel(); |
|
|
|
|
// contentPane.setBackground(originColor);
|
|
|
|
|
contentPane.setLayout(new BorderLayout()); |
|
|
|
|
UILabel label = new UILabel(title); |
|
|
|
|
contentPane.add(label, BorderLayout.WEST); |
|
|
|
@ -1294,7 +1283,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
|
|
|
|
|
|
|
|
|
|
setLayout(new BorderLayout()); |
|
|
|
|
add(contentPane, BorderLayout.CENTER); |
|
|
|
|
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); |
|
|
|
|
setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, UIManager.getColor("East.border"))); |
|
|
|
|
initToolButton(buttonType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|