From a68219588db6f599c2bf1378793fe0beed67ac79 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 1 Nov 2017 17:09:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-5284=20=E5=85=AC=E6=B5=8B=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=8F=8D=E9=A6=88=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E5=92=8C=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=3D>=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=85=8D=E8=89=B2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFinePane.java | 3 ++- .../fr/design/mainframe/bbs/UserInfoPane.java | 3 ++- designer/src/com/fr/grid/GridColumnUI.java | 2 +- designer/src/com/fr/grid/GridRowUI.java | 2 +- designer/src/com/fr/start/Designer.java | 5 ++-- .../com/fr/design/constants/UIConstants.java | 8 ++++++- .../fr/design/file/MutilTempalteTabPane.java | 4 ++-- .../com/fr/design/file/NewTemplatePane.java | 2 +- .../icontainer/UIEastResizableContainer.java | 2 -- .../com/fr/design/gui/imenu/UIMenuBarUI.java | 2 +- .../src/com/fr/design/gui/imenu/UIMenuUI.java | 2 +- .../fr/design/gui/itoolbar/UIToolBarUI.java | 3 ++- .../mainframe/EastRegionContainerPane.java | 24 ++++++++++++------- .../mainframe/loghandler/LogMessageBar.java | 6 ++--- 14 files changed, 40 insertions(+), 28 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index 5c1cb67e48..86ddc8b40c 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.alphafine.component; import com.bulenkov.iconloader.IconLoader; import com.fr.design.actions.help.alphafine.AlphaFineContext; import com.fr.design.actions.help.alphafine.AlphaFineListener; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.alphafine.AlphaFineHelper; @@ -32,7 +33,7 @@ public class AlphaFinePane extends BasicPane { refreshButton.set4ToolbarButton(); refreshButton.setRolloverEnabled(false); this.add(refreshButton); - this.setBackground(ThemeUtils.WHITE_BORDER_COLOR); + this.setBackground(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); refreshButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java index cb28c05357..4491fef8e5 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -6,6 +6,7 @@ package com.fr.design.mainframe.bbs; import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; @@ -32,7 +33,7 @@ import java.util.Date; public class UserInfoPane extends BasicPane{ //默认未登录颜色 - private static final Color UN_LOGIN_BACKGROUND = new Color(210, 210, 210); + private static final Color UN_LOGIN_BACKGROUND = UIConstants.TEMPLATE_TAB_PANE_BACKGROUND; private static final Color LOGIN_BACKGROUND = new Color(184, 220, 242); private static final int WIDTH = 104; private static final int HEIGHT = 24; diff --git a/designer/src/com/fr/grid/GridColumnUI.java b/designer/src/com/fr/grid/GridColumnUI.java index ab32e6ce86..e700137e13 100644 --- a/designer/src/com/fr/grid/GridColumnUI.java +++ b/designer/src/com/fr/grid/GridColumnUI.java @@ -27,7 +27,7 @@ import com.fr.report.elementcase.ElementCase; * @since 2012-3-22下午5:51:10 */ public class GridColumnUI extends ComponentUI { - protected Color withoutDetailsBackground = new Color(0xf0f0f3); + protected Color withoutDetailsBackground = UIConstants.GRID_COLUMN_DETAILS_BACKGROUND; private int resolution ; public GridColumnUI(int resolution){ diff --git a/designer/src/com/fr/grid/GridRowUI.java b/designer/src/com/fr/grid/GridRowUI.java index 2f97914bbc..818b81700d 100644 --- a/designer/src/com/fr/grid/GridRowUI.java +++ b/designer/src/com/fr/grid/GridRowUI.java @@ -26,7 +26,7 @@ import com.fr.report.elementcase.ElementCase; * @since 2012-3-22下午5:54:21 */ public class GridRowUI extends ComponentUI { - private Color detailsBackground = new Color(0xf0f0f3); + private Color detailsBackground = UIConstants.GRID_ROW_DETAILS_BACKGROUND; private int resolution ; GridRowUI(int resolution){ diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index 35ace6e6a5..7f1a7b8cb6 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -139,7 +139,6 @@ public class Designer extends BaseDesigner { largeToolbar.add(generateEmptyGap(1)); createRunButton(largeToolbar); largeToolbar.add(run); - run.setBackground(Color.WHITE); largeToolbar.add(generateEmptyGap(GAP)); largeToolbar.addSeparator(new Dimension(2, 42)); largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR)); @@ -154,7 +153,8 @@ public class Designer extends BaseDesigner { return dim; } }; - panel.setBackground(Color.WHITE); + panel.setBackground(null); + panel.setOpaque(false); return panel; } @@ -266,7 +266,6 @@ public class Designer extends BaseDesigner { run.set4Toolbar(); run.getUpButton().setToolTipText(Inter.getLocText("FR-Designer_Preview")); run.getDownButton().setToolTipText(Inter.getLocText("FR-Designer_Dropdown-More-Preview")); - run.setBackground(Color.WHITE); } @Override diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index fde81e8859..aa27ea2ecf 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -97,6 +97,7 @@ public interface UIConstants { public static final Color NORMAL_BLUE = new Color(0x419BF9); public static final Color ATTRIBUTE_NORMAL = Color.WHITE; public static final Color ATTRIBUTE_HOVER = new Color(0xF5F5F7); + public static final Color UI_TOOLBAR_COLOR = new Color(0xF5F5F7); public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0); public static final Color TEXT_FILED_BORDER_SELECTED = new Color(0x3384f0); public static final Color SHEET_NORMAL = new Color(0xc8c8ca); @@ -105,9 +106,14 @@ public interface UIConstants { public static final Color DEFAULT_BG_RULER = new Color(0xffffff); public static final Color RULER_LINE_COLOR = new Color(0xD9DADD); public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); - public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd); + public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xe8e8e9); public static final Color SPLIT_LINE = new Color(201, 198, 184); public static final Color TITLED_BORDER_COLOR = new Color(0xe8e8e9); + public static final Color GRID_ROW_DETAILS_BACKGROUND = new Color(0xe8e8e9); + public static final Color GRID_COLUMN_DETAILS_BACKGROUND = GRID_ROW_DETAILS_BACKGROUND; + public static final Color TEMPLATE_TAB_PANE_BACKGROUND = new Color(0xe0e0e3); + public static final Color LOG_MESSAGE_BAR_BACKGROUND = TEMPLATE_TAB_PANE_BACKGROUND; + public static final Color UI_MENU_BACKGOURND = TEMPLATE_TAB_PANE_BACKGROUND; public static final Color POP_DIALOG_BORDER = new Color(218, 218, 221); public static final Color PROPERTY_DIALOG_BORDER = new Color(0xc9c9cd); public static final Color TAB_BUTTON_HOVER = new Color(231, 230, 235); diff --git a/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java b/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java index 4c4dc8236d..a08fabc1cf 100644 --- a/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java @@ -372,7 +372,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M private void paintDefaultBackground(Graphics2D g2d) { //画默认背景 - g2d.setPaint(new GradientPaint(1, 1, new Color(217, 218, 221), 1, getHeight() - 1, new Color(217, 218, 221))); + g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, getHeight() - 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND)); g2d.fillRect(0, 0, getWidth(), getHeight()); } @@ -562,7 +562,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M unSelectedClosedPath(generalPath, isLeft, x, y); g2d.fill(generalPath); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.setPaint(new Color(200, 201, 205)); + g2d.setPaint(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); //TODO hzzz delete // if (isLeft) { // g2d.draw(new Arc2D.Double(x[0], y[0], CORNOR_RADIUS * 2, CORNOR_RADIUS * 2, 90, 90, 0)); diff --git a/designer_base/src/com/fr/design/file/NewTemplatePane.java b/designer_base/src/com/fr/design/file/NewTemplatePane.java index 1900cda0d4..fbb6ec8f9d 100644 --- a/designer_base/src/com/fr/design/file/NewTemplatePane.java +++ b/designer_base/src/com/fr/design/file/NewTemplatePane.java @@ -46,7 +46,7 @@ public abstract class NewTemplatePane extends JComponent implements MouseListene public void paintComponent(Graphics g) { super.paintComponent(g); g2d = (Graphics2D) g; - g2d.setColor(UIConstants.COMBOBOX_BTN_NORMAL); + g2d.setColor(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); g2d.fill(new Rectangle2D.Double(0, 0, getWidth(),getHeight())); int sheetIconY = (getHeight() - newWorkBookIconMode.getIconHeight()) / 2; newWorkBookIconMode.paintIcon(this, g2d, newIconStartX, sheetIconY); diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 0a996c6d78..f5d7f23f55 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -293,7 +293,6 @@ public class UIEastResizableContainer extends JPanel { public void paint(Graphics g) { Image button; - g.drawImage(UIConstants.DRAG_BAR, 0, 0, containerWidth, topToolPaneHeight, null); if (containerWidth == leftPaneWidth) { if (model == UIConstants.MODEL_NORMAL) { button = UIConstants.DRAG_LEFT_NORMAL; @@ -307,7 +306,6 @@ public class UIEastResizableContainer extends JPanel { button = UIConstants.DRAG_RIGHT_PRESS; } } -// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); g.drawImage(button, 18, 7, 5, 10, null); } } diff --git a/designer_base/src/com/fr/design/gui/imenu/UIMenuBarUI.java b/designer_base/src/com/fr/design/gui/imenu/UIMenuBarUI.java index 015d1c3e10..04d5d3b0b1 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIMenuBarUI.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIMenuBarUI.java @@ -24,7 +24,7 @@ public class UIMenuBarUI extends BasicMenuBarUI { return; } Color oldColor = g.getColor(); - g.setColor(UIConstants.NORMAL_BACKGROUND); + g.setColor(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); g.fillRect(0, 0, c.getWidth(), c.getHeight()); g.setColor(oldColor); } diff --git a/designer_base/src/com/fr/design/gui/imenu/UIMenuUI.java b/designer_base/src/com/fr/design/gui/imenu/UIMenuUI.java index e4b56da28d..fdda1a6120 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIMenuUI.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIMenuUI.java @@ -46,7 +46,7 @@ public class UIMenuUI extends BasicMenuUI { protected void paintRollOver(Graphics g, int w, int h) { Graphics2D g2d = (Graphics2D) g; - g2d.setColor(UIConstants.NORMAL_BACKGROUND); + g2d.setColor(UIConstants.UI_MENU_BACKGOURND); g2d.fillRect(0, 0, w, h); } diff --git a/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java b/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java index 431a5508bd..bea52c2fb5 100644 --- a/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java +++ b/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java @@ -1,6 +1,7 @@ package com.fr.design.gui.itoolbar; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIToolButtonBorder; import com.fr.design.gui.icheckbox.UICheckBox; @@ -76,7 +77,7 @@ public class UIToolBarUI extends MetalToolBarUI { */ public void paint(Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D) g; - g2.setColor(Color.WHITE); + g2.setColor(UIConstants.UI_TOOLBAR_COLOR); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); } diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index 04f13ff7c2..5c37e53202 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -40,7 +40,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final int TAB_BUTTON_WIDTH = 32; private static final int TAB_BUTTON_HEIGHT = 28; private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; - private static final int POPUP_TOOLPANE_HEIGHT = 25; + private static final int POPUP_TOOLPANE_HEIGHT = 27; private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; // 弹出对话框高度 private static final int POPUP_MIN_HEIGHT = 145; @@ -826,6 +826,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private String buttonType; private JDialog parentDialog; // 如果不在对话框中,值为null private Color originColor; // 初始背景 + private JPanel contentPane; private boolean isMovable = false; private Point mouseDownCompCoords; // 存储按下左键的位置,移动对话框时会用到 @@ -842,7 +843,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void mouseExited(MouseEvent e) { setCursor(Cursor.getDefaultCursor()); if (mouseDownCompCoords == null) { - setBackground(originColor); + contentPane.setBackground(originColor); } repaint(); } @@ -856,7 +857,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void mouseReleased(MouseEvent e) { mouseDownCompCoords = null; if (!getBounds().contains(e.getPoint())) { - setBackground(originColor); + contentPane.setBackground(originColor); } } @Override @@ -874,7 +875,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } else if (isMovable) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); - setBackground(UIConstants.POPUP_TITLE_BACKGROUND); + contentPane.setBackground(UIConstants.POPUP_TITLE_BACKGROUND); } else { setCursor(Cursor.getDefaultCursor()); } @@ -916,13 +917,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { super(); this.propertyItem = propertyItem; this.title = propertyItem.getTitle(); - originColor = Color.WHITE; - setBackground(originColor); - setLayout(new BorderLayout()); + originColor = UIConstants.UI_TOOLBAR_COLOR; + + contentPane = new JPanel(); + contentPane.setBackground(originColor); + contentPane.setLayout(new BorderLayout()); UILabel label = new UILabel(title); - add(label, BorderLayout.WEST); - setBorder(new EmptyBorder(5, 10, 5, 0)); + contentPane.add(label, BorderLayout.WEST); + contentPane.setBorder(new EmptyBorder(5, 10, 5, 0)); + setLayout(new BorderLayout()); + add(contentPane, BorderLayout.CENTER); + setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); initToolButton(buttonType); } diff --git a/designer_base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer_base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java index defbb1322d..adc3662ac4 100644 --- a/designer_base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer_base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -6,13 +6,13 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; + +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.general.Inter; import javax.swing.JPanel; -import static com.fr.design.constants.UIConstants.NORMAL_BACKGROUND; - public class LogMessageBar extends JPanel { private UILabel messageLabel; private int width = 600; @@ -36,7 +36,7 @@ public class LogMessageBar extends JPanel { messageLabel = new UILabel(); setLayout(new BorderLayout()); add(messageLabel, BorderLayout.CENTER); - setBackground(NORMAL_BACKGROUND); + setBackground(UIConstants.LOG_MESSAGE_BAR_BACKGROUND); addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) {