diff --git a/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java b/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java index d4a3db8a73..680244f895 100644 --- a/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java +++ b/designer/src/com/fr/design/cell/bar/DynamicScrollButton.java @@ -1,5 +1,6 @@ package com.fr.design.cell.bar; +import com.fr.design.constants.UIConstants; import com.fr.general.ComparatorUtils; import javax.swing.*; @@ -63,48 +64,16 @@ public class DynamicScrollButton extends BasicArrowButton { private void paintArrow(Graphics g, Dimension size) { switch (direction) { case SwingConstants.NORTH: - g.drawLine(8, 5, 8, 5); - g.drawLine(7, 6, 9, 6); - g.drawLine(6, 7, 10, 7); - g.drawLine(5, 8, 7, 8); - g.drawLine(9, 8, 11, 8); - g.drawLine(4, 9, 6, 9); - g.drawLine(10, 9, 12, 9); - g.drawLine(5, 10, 5, 10); - g.drawLine(11, 10, 11, 10); + g.drawImage(UIConstants.ARROW_NORTH, 0, 0, this); break; case SwingConstants.SOUTH: - g.drawLine(5, 6, 5, 6); - g.drawLine(11, 6, 11, 6); - g.drawLine(4, 7, 6, 7); - g.drawLine(10, 7, 12, 7); - g.drawLine(5, 8, 7, 8); - g.drawLine(9, 8, 11, 8); - g.drawLine(6, 9, 10, 9); - g.drawLine(7, 10, 9, 10); - g.drawLine(8, 11, 8, 11); + g.drawImage(UIConstants.ARROW_SOUTH, 0, 0, this); break; case SwingConstants.EAST: - g.drawLine(6, 5, 6, 5); - g.drawLine(6, 11, 6, 11); - g.drawLine(7, 4, 7, 6); - g.drawLine(7, 10, 7, 12); - g.drawLine(8, 5, 8, 7); - g.drawLine(8, 9, 8, 11); - g.drawLine(9, 6, 9, 10); - g.drawLine(10, 7, 10, 9); - g.drawLine(11, 8, 11, 8); + g.drawImage(UIConstants.ARROW_EAST, 0, 0, this); break; case SwingConstants.WEST: - g.drawLine(4, 8, 4, 8); - g.drawLine(5, 7, 5, 9); - g.drawLine(6, 6, 6, 10); - g.drawLine(7, 5, 7, 7); - g.drawLine(7, 9, 7, 11); - g.drawLine(8, 4, 8, 6); - g.drawLine(8, 10, 8, 12); - g.drawLine(9, 5, 9, 5); - g.drawLine(9, 11, 9, 11); + g.drawImage(UIConstants.ARROW_WEST, 0, 0, this); break; } } diff --git a/designer/src/com/fr/grid/GridCorner.java b/designer/src/com/fr/grid/GridCorner.java index 91891fd44d..8cb236d2d9 100644 --- a/designer/src/com/fr/grid/GridCorner.java +++ b/designer/src/com/fr/grid/GridCorner.java @@ -3,18 +3,15 @@ */ package com.fr.grid; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.geom.Rectangle2D; - -import javax.swing.event.MouseInputListener; - import com.fr.base.GraphHelper; import com.fr.base.ScreenResolution; +import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.ElementCasePane; +import javax.swing.event.MouseInputListener; +import java.awt.*; +import java.awt.geom.Rectangle2D; + /** * GridCorner used to paint and edit grid cornor. */ @@ -29,16 +26,16 @@ public class GridCorner extends BaseGridComponent { this.addMouseListener(l); this.addMouseMotionListener(l); } - + /** * Paints component */ @Override - public void paintComponent(Graphics g) { + public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; ElementCasePane reportPane = this.getElementCasePane(); - float time = (float)reportPane.getResolution()/ ScreenResolution.getScreenResolution(); + float time = (float) reportPane.getResolution() / ScreenResolution.getScreenResolution(); //size Dimension size = this.getSize(); Rectangle2D rect2D = new Rectangle2D.Double(0, 0, size.getWidth(), size.getHeight()); @@ -50,9 +47,9 @@ public class GridCorner extends BaseGridComponent { g2d.setPaint(reportPane.getBackground()); GraphHelper.fill(g2d, rect2D); } - + paintArc(g2d, size, time); - + //画左边的边框线. g2d.setColor(reportPane.getGridColumn().getSeparatorLineColor()); GraphHelper.drawLine(g2d, 0, 0, 0, size.getHeight()); @@ -66,7 +63,7 @@ public class GridCorner extends BaseGridComponent { * Gets the preferred size. */ @Override - public Dimension getPreferredSize() { + public Dimension getPreferredSize() { ElementCasePane reportPane = this.getElementCasePane(); if (!reportPane.isColumnHeaderVisible() || !reportPane.isRowHeaderVisible()) { @@ -74,28 +71,31 @@ public class GridCorner extends BaseGridComponent { } return new Dimension(reportPane.getGridRow().getPreferredSize().width, - reportPane.getGridColumn().getPreferredSize().height); + reportPane.getGridColumn().getPreferredSize().height); } /** * Gets corner background. */ @Override - public Color getBackground() { + public Color getBackground() { return super.getBackground(); } - + private void paintArc(Graphics2D g2d, Dimension size, float time) { - g2d.setColor(Color.gray); - int width = (int) (size.width - (16 * time)); - int avgWidth = width / 3; - int height = (int) (size.height - (8 * time)); - int avgHeight = height / 3; - for (int i = 0; i < 3; i ++) { - for (int j = 0; j < 3; j ++) { - GraphHelper.fillArc(g2d, (8 * time) + (i * avgWidth), (4 * time) + (j * avgHeight), 3, 3, 0, 360); - } - } + g2d.setColor(UIConstants.LINE_COLOR); + float height = 2 * time; + float width = 2 * time; + float hgap = 4 * time; + float vgap = 3 * time; + + int x = (int) ((size.width - (hgap * 2 + width * 3)) / 2); + int y = (int) (size.height - (vgap * 2 + height * 3)); + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + GraphHelper.fillRect(g2d, x + (i * hgap), y + (j * vgap), width, height); + } + } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index 5552b09bc7..fde81e8859 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -120,6 +120,12 @@ public interface UIConstants { public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); + public static final BufferedImage DRAG_BAR_LIGHT = BaseUtils.readImage("com/fr/design/images/control/bar-light.png"); + public static final BufferedImage ARROW_NORTH = BaseUtils.readImage("com/fr/design/images/control/up_arrow.png"); + public static final BufferedImage ARROW_SOUTH = BaseUtils.readImage("com/fr/design/images/control/down_arrow.png"); + public static final BufferedImage ARROW_EAST = BaseUtils.readImage("com/fr/design/images/control/east_arrow.png"); + public static final BufferedImage ARROW_WEST = BaseUtils.readImage("com/fr/design/images/control/west_arrow.png"); + public static final BufferedImage DRAG_BAR_RIGHT = BaseUtils.readImage("com/fr/design/images/control/barm.png"); public static final BufferedImage DRAG_BAR_LEFT = BaseUtils.readImage("com/fr/design/images/control/barl.png"); public static final BufferedImage DRAG_UP_NORMAL = BaseUtils.readImage("com/fr/design/images/control/upnor.png"); @@ -131,6 +137,7 @@ public interface UIConstants { public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png"); public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png"); public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png"); + public static final BufferedImage DRAG_LINE = BaseUtils.readImage("com/fr/design/images/control/dot-line.png"); public static final BufferedImage ACCESSIBLE_EDITOR_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png"); public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png"); public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png"); diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTree.java b/designer_base/src/com/fr/design/data/datapane/TableDataTree.java index 8082d8c1ea..2d3b5e4bec 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTree.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTree.java @@ -75,7 +75,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.setSize(dim); this.setPreferredSize(dim); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); - this.setForeground(UIConstants.FONT_COLOR); + this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 7a4cf52042..3a3e877eb6 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -159,10 +159,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { } protected void initbuttonGroup() { - Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/data/datasource.png"), BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png")}; +// Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/data/datasource.png"), BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png")}; final Integer[] modeArray = {TEMPLATE_TABLE_DATA, SERVER_TABLE_DATA}; String[] textArray = {Inter.getLocText(new String[]{"Template", "DS-TableData"}), Inter.getLocText("DS-Server_TableData")}; - buttonGroup = new UIHeadGroup(iconArray, textArray) { + buttonGroup = new UIHeadGroup(textArray) { public void tabChanged(int index) { if (op != null) { op.setDataMode(modeArray[buttonGroup.getSelectedIndex()]); diff --git a/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java b/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java index 44307b018e..4c4dc8236d 100644 --- a/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer_base/src/com/fr/design/file/MutilTempalteTabPane.java @@ -496,7 +496,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M */ private int paintSelectedTab(Graphics2D g2d, Icon sheeticon, double templateStartX, String sheetName, Icon closeIcon) { double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX}; - double[] y = {-1, getHeight(), getHeight(), -1, -1}; + double[] y = {1, getHeight() + 1, getHeight() + 1, 1, 1}; RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(templateStartX, 1, this.getWidth(), this.getHeight(), 7, 7); g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, getHeight() - 1, UIConstants.SELECT_TAB)); //选了30度和60度的特殊角度的x,y作为经过的两个点的坐标 diff --git a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java index 8e99896bc1..31cc290324 100644 --- a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java +++ b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java @@ -22,10 +22,15 @@ public class HeaderPane extends JPanel { private int headHeight; private Color bgColor; private boolean isShow; + private boolean isPressed = false; private String title; private Image image; private int fontSize; + public void setPressed(boolean pressed) { + this.isPressed = pressed; + } + public void setShow(boolean isShow) { this.isShow = isShow; } @@ -60,7 +65,8 @@ public class HeaderPane extends JPanel { private BufferedImage createPanelImage() { BufferedImage panelImage = new BufferedImage(getWidth(), headHeight, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = panelImage.createGraphics(); - g2d.setColor(UIConstants.COMPONENT_BACKGROUND_COLOR); + + g2d.setColor(isPressed ? UIConstants.POPUP_TITLE_BACKGROUND : UIConstants.COMPONENT_BACKGROUND_COLOR); headWidth = this.getWidth(); g2d.fillRect(0, 0, headWidth, headHeight); g2d.setFont(new Font("SimSun", 0, fontSize)); diff --git a/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java b/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java index 924415aea3..9ed2d9757b 100644 --- a/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java +++ b/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java @@ -58,7 +58,8 @@ public class UIExpandablePane extends JPanel { } class PanelAction extends MouseAdapter { - public void mousePressed(MouseEvent e) { + @Override + public void mouseClicked(MouseEvent e) { HeaderPane hp = (HeaderPane) e.getSource(); if (contentPanel.isShowing()) { contentPanel.setVisible(false); @@ -67,9 +68,23 @@ public class UIExpandablePane extends JPanel { contentPanel.setVisible(true); hp.setShow(true); } + hp.setPressed(false); hp.getParent().validate(); hp.getParent().repaint(); } + + public void mousePressed(MouseEvent e) { + HeaderPane hp = (HeaderPane) e.getSource(); + hp.setPressed(true); + hp.getParent().repaint(); + } + + @Override + public void mouseExited(MouseEvent e) { + HeaderPane hp = (HeaderPane) e.getSource(); + hp.setPressed(false); + hp.getParent().repaint(); + } } diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java index 5d35bf02e0..5f28fadde0 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -397,8 +397,8 @@ public class UIResizableContainer extends JPanel { Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS); Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS); - g.drawImage(UIConstants.DRAG_BAR, 0, 0, getWidth(), getHeight(), null); - g.drawImage(UIConstants.DRAG_DOT, (getWidth() - toolPaneHeight) / 2, 3, toolPaneHeight, 5, null); + g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null); + g.drawImage(UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, toolPaneHeight, 5, null); g.drawImage(upButton, ARROW_MARGIN, 3, toolPaneHeight, 5, null); g.drawImage(downButton, getWidth() - toolPaneHeight - ARROW_MARGIN, 3, toolPaneHeight, 5, null); } @@ -488,7 +488,7 @@ public class UIResizableContainer extends JPanel { public void paint(Graphics g) { Image button; if (direction == Constants.RIGHT) { - g.drawImage(UIConstants.DRAG_BAR, 0, 0, toolPaneHeight, getHeight(), null); + g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null); if (containerWidth == toolPaneHeight) { if (model == UIConstants.MODEL_NORMAL) { button = UIConstants.DRAG_RIGHT_NORMAL; @@ -504,7 +504,7 @@ public class UIResizableContainer extends JPanel { } g.drawImage(button, 3, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); } else { - g.drawImage(UIConstants.DRAG_BAR, 0, 0, toolPaneHeight, getHeight(), null); + g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null); if (containerWidth == toolPaneHeight) { if (model == UIConstants.MODEL_NORMAL) { button = UIConstants.DRAG_LEFT_NORMAL; diff --git a/designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java index 8cfde735db..7aa9dd2c48 100644 --- a/designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -1,7 +1,6 @@ package com.fr.design.gui.itree.filetree; -import java.awt.Component; -import java.awt.Dimension; +import java.awt.*; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -107,7 +106,7 @@ public class EnvFileTree extends RefreshableJTree { dim.height += 2; this.setPreferredSize(dim); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); - this.setForeground(UIConstants.FONT_COLOR); + this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } diff --git a/designer_base/src/com/fr/design/images/control/bar-light.png b/designer_base/src/com/fr/design/images/control/bar-light.png new file mode 100644 index 0000000000..f929f48048 Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/bar-light.png differ diff --git a/designer_base/src/com/fr/design/images/control/dot-line.png b/designer_base/src/com/fr/design/images/control/dot-line.png new file mode 100644 index 0000000000..874408025b Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/dot-line.png differ diff --git a/designer_base/src/com/fr/design/images/control/dotv.png b/designer_base/src/com/fr/design/images/control/dotv.png index a9a1b9048c..a806ba2eaa 100644 Binary files a/designer_base/src/com/fr/design/images/control/dotv.png and b/designer_base/src/com/fr/design/images/control/dotv.png differ diff --git a/designer_base/src/com/fr/design/images/control/down_arrow.png b/designer_base/src/com/fr/design/images/control/down_arrow.png new file mode 100644 index 0000000000..26a780d5e2 Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/down_arrow.png differ diff --git a/designer_base/src/com/fr/design/images/control/east_arrow.png b/designer_base/src/com/fr/design/images/control/east_arrow.png new file mode 100644 index 0000000000..918d75a9f9 Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/east_arrow.png differ diff --git a/designer_base/src/com/fr/design/images/control/up_arrow.png b/designer_base/src/com/fr/design/images/control/up_arrow.png new file mode 100644 index 0000000000..3d79ee07bd Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/up_arrow.png differ diff --git a/designer_base/src/com/fr/design/images/control/west_arrow.png b/designer_base/src/com/fr/design/images/control/west_arrow.png new file mode 100644 index 0000000000..5693190f96 Binary files /dev/null and b/designer_base/src/com/fr/design/images/control/west_arrow.png differ