Browse Source

format

master
hzzz 7 years ago
parent
commit
6e91f1cd5d
  1. 58
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

58
designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

@ -1,42 +1,6 @@
package com.fr.design.file; package com.fr.design.file;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Arc2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D;
import java.io.File;
import java.util.logging.Level;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.plaf.basic.BasicMenuItemUI;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -55,6 +19,14 @@ import com.fr.stable.Constants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import javax.swing.plaf.basic.BasicMenuItemUI;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.File;
import java.util.logging.Level;
/** /**
* Author : daisy * Author : daisy
* Date: 13-8-5 * Date: 13-8-5
@ -159,7 +131,6 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
* 关闭掉当前已打开文件列表中指定的文件 * 关闭掉当前已打开文件列表中指定的文件
* *
* @param file 指定的文件 * @param file 指定的文件
*
*/ */
public void closeFileTemplate(FILE file) { public void closeFileTemplate(FILE file) {
for (JTemplate<?, ?> temp : openedTemplate) { for (JTemplate<?, ?> temp : openedTemplate) {
@ -274,6 +245,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 刷新打开模板 * 刷新打开模板
*
* @param history 模板 * @param history 模板
*/ */
public void refreshOpenedTemplate(java.util.List<JTemplate<?, ?>> history) { public void refreshOpenedTemplate(java.util.List<JTemplate<?, ?>> history) {
@ -396,6 +368,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
g2d.draw(new Line2D.Double((float) templateStartX, getHeight() - 1, (float) maxWidth + LIST_BUTTON_WIDTH, getHeight() - 1)); g2d.draw(new Line2D.Double((float) templateStartX, getHeight() - 1, (float) maxWidth + LIST_BUTTON_WIDTH, getHeight() - 1));
} }
} }
private void paintDefaultBackground(Graphics2D g2d) { private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景 //画默认背景
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1, UIConstants.SHADOW_GREY)); g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1, UIConstants.SHADOW_GREY));
@ -646,6 +619,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 点击 * 点击
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
@ -653,6 +627,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 按下 * 按下
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -711,6 +686,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 关闭模板 * 关闭模板
*
* @param specifiedTemplate 模板 * @param specifiedTemplate 模板
*/ */
public void closeSpecifiedTemplate(JTemplate<?, ?> specifiedTemplate) { public void closeSpecifiedTemplate(JTemplate<?, ?> specifiedTemplate) {
@ -752,6 +728,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 关闭模板 * 关闭模板
*
* @param closedTemplate 模板 * @param closedTemplate 模板
*/ */
public void closeFormat(JTemplate closedTemplate) { public void closeFormat(JTemplate closedTemplate) {
@ -806,6 +783,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 鼠标释放 * 鼠标释放
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
@ -813,6 +791,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 鼠标进入 * 鼠标进入
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
@ -852,6 +831,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 鼠标离开 * 鼠标离开
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
@ -863,6 +843,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 鼠标拖拽 * 鼠标拖拽
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
@ -870,6 +851,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 鼠标移动 * 鼠标移动
*
* @param e 鼠标事件 * @param e 鼠标事件
*/ */
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
@ -903,6 +885,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 加入值 * 加入值
*
* @param key * @param key
* @param value * @param value
*/ */
@ -911,6 +894,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
/** /**
* 动作 * 动作
*
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

Loading…
Cancel
Save