Browse Source

REPORT-4604 设计器视觉修改

左右选择的icon和鼠标响应视觉
master
momeak 7 years ago
parent
commit
e4de0db47c
  1. 34
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  2. BIN
      designer_base/src/com/fr/design/images/sheet/left_hover@1x.png
  3. BIN
      designer_base/src/com/fr/design/images/sheet/left_normal@1x.png
  4. BIN
      designer_base/src/com/fr/design/images/sheet/right_hover@1x.png
  5. BIN
      designer_base/src/com/fr/design/images/sheet/right_normal@1x.png

34
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -25,11 +25,13 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
@ -54,10 +56,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
private static final Icon WORK_SHEET_ICON = BaseUtils.readIcon("com/fr/base/images/oem/worksheet.png"); private static final Icon WORK_SHEET_ICON = BaseUtils.readIcon("com/fr/base/images/oem/worksheet.png");
private static final Icon POLY_SHEET_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/polysheet.png"); private static final Icon POLY_SHEET_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/polysheet.png");
private static final Image DESIGN_IMAGE = BaseUtils.readImage("com/fr/design/images/sheet/left_right_btn.png"); private static final Image DESIGN_IMAGE = BaseUtils.readImage("com/fr/design/images/sheet/left_right_btn.png");
private static final Icon DISABLED_LEFT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/left_normal@1x.png"); private static final Icon LEFT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/left_normal@1x.png");
private static final Icon DISABLED_RIGHT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/right_normal@1x.png"); private static final Icon RIGHT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/right_normal@1x.png");
private static final Icon LEFT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/left_hover@1x.png"); private static final Icon DISABLED_LEFT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/left_hover@1x.png");
private static final Icon RIGHT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/right_hover@1x.png"); private static final Icon DISABLED_RIGHT_ICON = BaseUtils.readIcon("com/fr/design/images/sheet/right_hover@1x.png");
private static final int ICON_SEP_DISTANCE = 8; private static final int ICON_SEP_DISTANCE = 8;
private static final int TOOLBAR_HEIGHT = 16; private static final int TOOLBAR_HEIGHT = 16;
@ -145,6 +147,18 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT);
} }
}; };
leftButton.setUI(new UIButtonUI() {
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.PROPERTY_PANE_BACKGROUND);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.PROPERTY_PANE_BACKGROUND);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
});
leftButton.set4ToolbarButton(); leftButton.set4ToolbarButton();
leftButton.setDisabledIcon(DISABLED_LEFT_ICON); leftButton.setDisabledIcon(DISABLED_LEFT_ICON);
rightButton = new UIButton(RIGHT_ICON) { rightButton = new UIButton(RIGHT_ICON) {
@ -152,6 +166,18 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT);
} }
}; };
rightButton.setUI(new UIButtonUI() {
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.PROPERTY_PANE_BACKGROUND);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.PROPERTY_PANE_BACKGROUND);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
});
rightButton.set4ToolbarButton(); rightButton.set4ToolbarButton();
rightButton.setDisabledIcon(DISABLED_RIGHT_ICON); rightButton.setDisabledIcon(DISABLED_RIGHT_ICON);
buttonPane = new JPanel(new BorderLayout(3, 0)); buttonPane = new JPanel(new BorderLayout(3, 0));

BIN
designer_base/src/com/fr/design/images/sheet/left_hover@1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 157 B

BIN
designer_base/src/com/fr/design/images/sheet/left_normal@1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 157 B

BIN
designer_base/src/com/fr/design/images/sheet/right_hover@1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 154 B

BIN
designer_base/src/com/fr/design/images/sheet/right_normal@1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 170 B

Loading…
Cancel
Save