Browse Source

Merge pull request #1347 in BA/design from ~PLOUGH/design:release/9.0 to release/9.0

* commit '7fac4b5495efd98bcdaeea5ead4edcaf2efaa1cf':
  REPORT-4887 @plough:9.0设计器交互验收问题=>表单=》组件库按钮样式调整
  REPORT-4887 @plough:9.0设计器交互验收问题=>聚合表=》聚合块按钮颜色调整
master
neil 7 years ago
parent
commit
795951b0e3
  1. 33
      designer/src/com/fr/poly/creator/BlockEditor.java
  2. 1
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  3. 2
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  4. 16
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

33
designer/src/com/fr/poly/creator/BlockEditor.java

@ -3,17 +3,16 @@
*/
package com.fr.poly.creator;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.*;
import javax.swing.JComponent;
import javax.swing.plaf.ButtonUI;
import com.fr.base.ScreenResolution;
import com.fr.design.beans.location.Absorptionline;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyConstants;
@ -65,15 +64,15 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
editComponent = createEffective();
this.add(BlockEditorLayout.CENTER, editComponent);
this.addHeightTool = new UIButton();
this.addHeightTool = new BlockControlButton();
this.add(BlockEditorLayout.LEFTBOTTOM, this.addHeightTool);
this.addHeightTool.setPreferredSize(getAddHeigthPreferredSize());
this.addWidthTool = new UIButton();
this.addWidthTool = new BlockControlButton();
this.add(BlockEditorLayout.RIGHTTOP, this.addWidthTool);
this.addWidthTool.setPreferredSize(getAddWidthPreferredSize());
this.moveTool = new UIButton();
this.moveTool = new BlockControlButton();
this.add(BlockEditorLayout.BOTTOMCORNER, this.moveTool);
this.forbiddenWindow = new BlockForbiddenWindow();
@ -204,5 +203,21 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
return new Dimension();
}
private class BlockControlButton extends UIButton {
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
// 调换 normal 和 rollover 状态的填充色
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));
} else if (isRollOver(b)) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
};
}
}
}

1
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -79,6 +79,7 @@ public class UIButton extends JButton implements UIObserver {
setPressedIcon(pressed);
setExtraPainted(false);
setBackground(null);
setForeground(UIConstants.FONT_COLOR);
setOpaque(false);
initListener();
}

2
designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java

@ -80,7 +80,7 @@ public class UIButtonUI extends BasicButtonUI {
FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
int mnemonicIndex = b.getDisplayedMnemonicIndex();
if (b.isEnabled()) {
g.setColor(UIConstants.FONT_COLOR);
g.setColor(b.getForeground());
} else {
g.setColor(UIConstants.LINE_COLOR);
}

16
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -2,17 +2,12 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo;
import com.fr.general.FRLogger;
@ -196,10 +191,8 @@ public class FormWidgetDetailPane extends FormDockView{
resetPanel = new JPanel();
resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset"));
resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
resetButton.set4ToolbarButton();
resetButton.setOpaque(true);
resetButton.setBackground(new Color(184, 220, 242));
resetButton.setForeground(Color.WHITE);
resetButton.setBackground(Color.white);
resetButton.setForeground(new Color(0x333334));
resetButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -210,9 +203,8 @@ public class FormWidgetDetailPane extends FormDockView{
});
deleteButton = new UIButton(Inter.getLocText("FR-Designer_Remove_Item"));
deleteButton.set4ToolbarButton();
deleteButton.setOpaque(true);
deleteButton.setBackground(Color.red);
deleteButton.setBackground(Color.white);
deleteButton.setForeground(new Color(0xeb1d1f));
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

Loading…
Cancel
Save