Browse Source

Merge pull request #1334 in BA/design from ~HZZZ/design:release/9.0 to release/9.0

* commit '4a86a23c7a60ec345294a26aea23eff26d027ede':
  属性标题栏点击变色效果
  tmp
  图标替换
  tab上边的线 数据集图标去掉 数据集和文件树的字颜色 左侧拉动条图标和颜色 表格部分滚动条两侧箭头图标 表格部分左上角图标
master
superman 7 years ago
parent
commit
559758074d
  1. 41
      designer/src/com/fr/design/cell/bar/DynamicScrollButton.java
  2. 54
      designer/src/com/fr/grid/GridCorner.java
  3. 7
      designer_base/src/com/fr/design/constants/UIConstants.java
  4. 2
      designer_base/src/com/fr/design/data/datapane/TableDataTree.java
  5. 4
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  6. 2
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java
  7. 8
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  8. 17
      designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java
  9. 8
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  10. 5
      designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java
  11. BIN
      designer_base/src/com/fr/design/images/control/bar-light.png
  12. BIN
      designer_base/src/com/fr/design/images/control/dot-line.png
  13. BIN
      designer_base/src/com/fr/design/images/control/dotv.png
  14. BIN
      designer_base/src/com/fr/design/images/control/down_arrow.png
  15. BIN
      designer_base/src/com/fr/design/images/control/east_arrow.png
  16. BIN
      designer_base/src/com/fr/design/images/control/up_arrow.png
  17. BIN
      designer_base/src/com/fr/design/images/control/west_arrow.png

41
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;
}
}

54
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);
}
}
}
}

7
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");

2
designer_base/src/com/fr/design/data/datapane/TableDataTree.java

@ -75,7 +75,7 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
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;
}

4
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()]);

2
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作为经过的两个点的坐标

8
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));

17
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();
}
}

8
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;

5
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;
}

BIN
designer_base/src/com/fr/design/images/control/bar-light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

BIN
designer_base/src/com/fr/design/images/control/dot-line.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

BIN
designer_base/src/com/fr/design/images/control/dotv.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 100 B

BIN
designer_base/src/com/fr/design/images/control/down_arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

BIN
designer_base/src/com/fr/design/images/control/east_arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

BIN
designer_base/src/com/fr/design/images/control/up_arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

BIN
designer_base/src/com/fr/design/images/control/west_arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Loading…
Cancel
Save