Browse Source

Merge pull request #1203 in BA/design from ~HZZZ/design:REPORT-3410 to release/9.0

* commit 'd150a5c5dded9e5b15d227d0094aab5d95168da4':
  menu分割线 & tab选中状态
  tmp
  menu分割线 & tab选中状态
master
superman 8 years ago
parent
commit
6cf939405f
  1. 31
      designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java
  2. 8
      designer_base/src/com/fr/design/gui/imenu/UIPopupMenuSeparatorUI.java

31
designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java

@ -9,7 +9,9 @@ import javax.swing.*;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTabbedPaneUI; import javax.swing.plaf.basic.BasicTabbedPaneUI;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
/** /**
* Coder: Sean * Coder: Sean
@ -30,10 +32,11 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
private int addY = -1; private int addY = -1;
private int rollover = -1; private int rollover = -1;
private Color tabBorderColor = new Color(143, 160, 183); private Color tabBorderColor = new Color(143, 160, 183);
private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, new Color(187, 142, 33), new Color(214, 191, 137)}; private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE};
/** /**
* 创建UI对象 * 创建UI对象
*
* @param c 容器 * @param c 容器
* @return 返回UI对象 * @return 返回UI对象
*/ */
@ -49,6 +52,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
tabPane.addMouseMotionListener( tabPane.addMouseMotionListener(
(MouseMotionListener) mouseListener); (MouseMotionListener) mouseListener);
} }
protected MouseListener createMouseListener() { protected MouseListener createMouseListener() {
return new UIMouseHandler(); return new UIMouseHandler();
} }
@ -56,6 +60,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
public class UIMouseHandler implements MouseListener, MouseMotionListener { public class UIMouseHandler implements MouseListener, MouseMotionListener {
/** /**
* 鼠标按下 * 鼠标按下
*
* @param e 事件 * @param e 事件
*/ */
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -81,12 +86,15 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 鼠标进入 * 鼠标进入
*
* @param e 事件 * @param e 事件
*/ */
public void mouseEntered(MouseEvent e) {} public void mouseEntered(MouseEvent e) {
}
/** /**
* 鼠标离开 * 鼠标离开
*
* @param e 事件 * @param e 事件
*/ */
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
@ -101,12 +109,15 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 鼠标点击 * 鼠标点击
*
* @param e 事件 * @param e 事件
*/ */
public void mouseClicked(MouseEvent e) {} public void mouseClicked(MouseEvent e) {
}
/** /**
* 鼠标释放 * 鼠标释放
*
* @param e 事件 * @param e 事件
*/ */
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
@ -125,12 +136,15 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 鼠标拖拽 * 鼠标拖拽
*
* @param e 事件 * @param e 事件
*/ */
public void mouseDragged(MouseEvent e) {} public void mouseDragged(MouseEvent e) {
}
/** /**
* 鼠标移动 * 鼠标移动
*
* @param e 事件 * @param e 事件
*/ */
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
@ -154,6 +168,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 判断鼠标是否在添加按钮上 * 判断鼠标是否在添加按钮上
*
* @param x 鼠标坐标x * @param x 鼠标坐标x
* @param y 鼠标坐标y * @param y 鼠标坐标y
* @return 返回鼠标是否在添加按钮上 * @return 返回鼠标是否在添加按钮上
@ -165,6 +180,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 判断鼠标是否在关闭按钮上 * 判断鼠标是否在关闭按钮上
*
* @param x 鼠标坐标x * @param x 鼠标坐标x
* @param y 鼠标坐标y * @param y 鼠标坐标y
* @return 返回鼠标是否在关闭按钮上 * @return 返回鼠标是否在关闭按钮上
@ -176,6 +192,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 如果tab只剩下最后一个则不画删除按钮 * 如果tab只剩下最后一个则不画删除按钮
*
* @return 返回当前tab还可否关闭 * @return 返回当前tab还可否关闭
*/ */
private boolean canClose() { private boolean canClose() {
@ -258,6 +275,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
/** /**
* 更新界面 * 更新界面
*
* @param g * @param g
* @param c * @param c
*/ */
@ -427,5 +445,6 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
} }
} }
protected class UITabbedPaneLayout extends TabbedPaneLayout {} protected class UITabbedPaneLayout extends TabbedPaneLayout {
}
} }

8
designer_base/src/com/fr/design/gui/imenu/UIPopupMenuSeparatorUI.java

@ -1,8 +1,9 @@
package com.fr.design.gui.imenu; package com.fr.design.gui.imenu;
import com.fr.design.constants.UIConstants;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.metal.MetalSeparatorUI; import javax.swing.plaf.metal.MetalSeparatorUI;
import java.awt.*; import java.awt.*;
@ -22,10 +23,7 @@ public class UIPopupMenuSeparatorUI extends MetalSeparatorUI {
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
Dimension s = c.getSize(); Dimension s = c.getSize();
g.setColor(new ColorUIResource(255, 255, 255)); g.setColor(UIConstants.FONT_COLOR);
g.fillRect(0, 0, s.width, s.height);
g.setColor(new ColorUIResource(173, 170, 153));
g.drawLine(2, 1, s.width - 3, 1); g.drawLine(2, 1, s.width - 3, 1);
} }
} }
Loading…
Cancel
Save