Browse Source

Merging in latest from upstream (CHART/design:refs/heads/release/9.0)

* commit 'fead07d5cde92273936c55a0aaf60e020c79fae7':
  无JIRA任务 合并丢失,build failed
  bugfix:window下字体模糊问题
  REPORT-4617 弹出单元格元素,批量选中单元格,单元格元素可设置
  不直接用UIButton
master
Mango 7 years ago
parent
commit
3d39d05b3a
  1. 26
      designer/src/com/fr/start/ReportSplashPane.java
  2. 8
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  3. 51
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  4. 5
      designer_base/src/com/fr/design/gui/ilable/UILabel.java
  5. 19
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

26
designer/src/com/fr/start/ReportSplashPane.java

@ -9,6 +9,7 @@ import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ModuleContext; import com.fr.general.ModuleContext;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.module.ModuleAdapter; import com.fr.stable.module.ModuleAdapter;
@ -36,9 +37,12 @@ public class ReportSplashPane extends SplashPane {
private static final int MODULE_INFO_X = uiScale(54); private static final int MODULE_INFO_X = uiScale(54);
private static final int MODULE_INFO_Y = uiScale(340); private static final int MODULE_INFO_Y = uiScale(340);
private static final Color THANK_COLOR = new Color(255, 255, 255, (int) (0.4 * 255 + 0.5)); private static final Color THANK_COLOR = new Color(255, 255, 255, (int) (0.6 * 255 + 0.5));
private static final int THANK_INFO_Y = uiScale(382); private static final int THANK_INFO_Y = uiScale(382);
private static final String ARIAL_FONT_NAME = "Arial";
private static final String YAHEI_FONT_NAME = "Microsoft YaHei";
private static final String GUEST = getRandomUser(); private static final String GUEST = getRandomUser();
private String showText = ""; private String showText = "";
@ -87,6 +91,7 @@ public class ReportSplashPane extends SplashPane {
Icon icon = IconLoader.getIcon(StableUtils.pathJoin(OEM_PATH, getImageName())); Icon icon = IconLoader.getIcon(StableUtils.pathJoin(OEM_PATH, getImageName()));
icon.paintIcon(null, g, 0, 0); icon.paintIcon(null, g, 0, 0);
paintShowText((Graphics2D) g); paintShowText((Graphics2D) g);
g.dispose();
} }
public void setShowText(String text) { public void setShowText(String text) {
@ -102,7 +107,16 @@ public class ReportSplashPane extends SplashPane {
GraphHelper.applyRenderingHints(splashG2d); GraphHelper.applyRenderingHints(splashG2d);
splashG2d.setPaint(MODULE_COLOR); splashG2d.setPaint(MODULE_COLOR);
splashG2d.setFont(new Font("Dialog", Font.PLAIN, 12));
Font font = null;
if (OperatingSystem.isWindows()) {
font = new Font(YAHEI_FONT_NAME, Font.PLAIN, uiScale(12));
}
if (font == null || isDialogFont(font)) {
font = createFont(ARIAL_FONT_NAME);
}
splashG2d.setFont(font);
//加载模块信息 //加载模块信息
GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, MODULE_INFO_Y); GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, MODULE_INFO_Y);
@ -115,6 +129,14 @@ public class ReportSplashPane extends SplashPane {
} }
} }
private boolean isDialogFont(Font font) {
return Font.DIALOG.equals(font.getFamily(Locale.US));
}
private Font createFont(String fontName) {
return new Font(fontName, Font.PLAIN, uiScale(12));
}
// 是否显示鸣谢文字 // 是否显示鸣谢文字
private boolean shouldShowThanks() { private boolean shouldShowThanks() {
Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN}; Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN};

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

@ -40,11 +40,11 @@ public class UIButtonUI extends BasicButtonUI {
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) { if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.COMBOBOX_BTN_PRESS); GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles));
} else if (isRollOver(b)) { } else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER); GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
} else if (b.isNormalPainted()) { } else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL); GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
} }
} }
@ -55,7 +55,7 @@ public class UIButtonUI extends BasicButtonUI {
protected boolean isPressed(AbstractButton b) { protected boolean isPressed(AbstractButton b) {
ButtonModel model = b.getModel(); ButtonModel model = b.getModel();
return model.isArmed() && model.isPressed(); return (model.isArmed() && model.isPressed()) || b.isSelected();
} }
private void paintContent(Graphics g, AbstractButton b, String text) { private void paintContent(Graphics g, AbstractButton b, String text) {

51
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -1,29 +1,23 @@
package com.fr.design.gui.icombobox; package com.fr.design.gui.icombobox;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import sun.swing.DefaultLookup;
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.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import sun.swing.DefaultLookup;
import javax.swing.*;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
@ -46,6 +40,27 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; return false;
} }
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
@Override
protected boolean isPressed(AbstractButton b) {
return model.isArmed() && model.isPressed();
}
@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.COMBOBOX_BTN_PRESS);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL);
}
}
};
}
}; };
((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT); ((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT);
arrowButton.addMouseListener(this); arrowButton.addMouseListener(this);

5
designer_base/src/com/fr/design/gui/ilable/UILabel.java

@ -29,6 +29,11 @@ public class UILabel extends JLabel {
super(text); super(text);
} }
public UILabel(String text, boolean enable) {
super(text);
this.setEnabled(enable);
}
public UILabel(Icon image, int horizontalAlignment) { public UILabel(Icon image, int horizontalAlignment) {
super(image, horizontalAlignment); super(image, horizontalAlignment);
} }

19
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -155,21 +155,28 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
public void updateCellElementState(boolean isSelectedOneCell) { public void updateCellElementState(boolean isSelectedOneCell) {
PropertyItem cellElement = propertyItemMap.get(KEY_CELL_ELEMENT);
if (isSelectedOneCell) { if (isSelectedOneCell) {
enableCellElementPane(); enableCellElementPane(cellElement);
} else { // 如果选中多个单元格,禁用单元格元素 tab } else { // 如果选中多个单元格,禁用单元格元素 tab
disableCellElementPane(); disableCellElementPane(cellElement);
refreshRightPane(); refreshRightPane();
} }
} }
// 禁用单元格元素tab // 禁用单元格元素tab
private void disableCellElementPane() { private void disableCellElementPane(PropertyItem cellElement) {
propertyItemMap.get(KEY_CELL_ELEMENT).setEnabled(false); cellElement.setEnabled(false);
if (cellElement.isPoppedOut()) {
cellElement.popupDialog.showDefaultPane();
}
} }
// 禁用单元格元素tab // 禁用单元格元素tab
private void enableCellElementPane() { private void enableCellElementPane(PropertyItem cellElement) {
propertyItemMap.get(KEY_CELL_ELEMENT).setEnabled(true); cellElement.setEnabled(true);
if (cellElement.isPoppedOut()) {
cellElement.popupDialog.replaceContentPane(cellElement);
}
} }
private void initContentPane() { private void initContentPane() {

Loading…
Cancel
Save