@ -18,14 +18,13 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.TemplateSavingChecker ;
import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager ;
import com.fr.design.utils.DesignUtils ;
import com.fr.design.utils.TemplateUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.design.utils.gui.GUIPaintUtils ;
import com.fr.design.worker.WorkerManager ;
import com.fr.design.utils.TemplateUtils ;
import com.fr.design.worker.save.CallbackSaveWorker ;
import com.fr.file.FILE ;
import com.fr.general.ComparatorUtils ;
import com.fr.general.GeneralContext ;
import com.fr.general.IOUtils ;
import com.fr.log.FineLoggerFactory ;
import com.fr.stable.Constants ;
@ -69,7 +68,6 @@ import java.awt.geom.Line2D;
import java.awt.geom.Path2D ;
import java.awt.geom.RoundRectangle2D ;
import java.util.List ;
import java.util.Locale ;
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog ;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION ;
@ -77,11 +75,14 @@ import static javax.swing.JOptionPane.OK_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE ;
/ * *
* Author : daisy
* Date : 13 - 8 - 5
* Time : 下午6 : 12
* /
public class MutilTempalteTabPane extends JComponent {
* 改个名字 , 一个拼写 n 个错误
*
* @author daisy
* @version 11 . 0
* < p >
* created by daisy on 2013 / 08 / 05
* * /
public class MultiTemplateTabPane extends JComponent {
private static Icon LIST_DOWN = BaseUtils . readIcon ( "/com/fr/design/images/buttonicon/list_normal.png" ) ;
private static Icon MOUSE_OVER_LIST_DOWN = BaseUtils . readIcon ( "/com/fr/design/images/buttonicon/list_pressed.png" ) ;
@ -110,7 +111,7 @@ public class MutilTempalteTabPane extends JComponent {
private static final int MINWIDTH = 100 ;
private static Mutil Tempa lteTabPane THIS ;
private static Mul tiTempla teTabPane THIS ;
//用于存放工作簿
private java . util . List < JTemplate < ? , ? > > openedTemplate ;
//选中的Tab项
@ -144,9 +145,9 @@ public class MutilTempalteTabPane extends JComponent {
private JTemplate < ? , ? > temTemplate = null ;
public static Mutil Tempa lteTabPane getInstance ( ) {
public static Mul tiTempla teTabPane getInstance ( ) {
if ( THIS = = null ) {
THIS = new Mutil Tempa lteTabPane ( ) ;
THIS = new Mul tiTempla teTabPane ( ) ;
}
return THIS ;
}
@ -155,7 +156,7 @@ public class MutilTempalteTabPane extends JComponent {
/ * *
* 多工作簿面板
* /
public Mutil Tempa lteTabPane ( ) {
public Mul tiTempla teTabPane ( ) {
this . setLayout ( new BorderLayout ( 0 , 0 ) ) ;
this . addMouseListener ( new MultiTemplateTabMouseListener ( ) ) ;
this . addMouseMotionListener ( new MultiTemplateTabMouseMotionListener ( ) ) ;
@ -169,7 +170,7 @@ public class MutilTempalteTabPane extends JComponent {
public void eventDispatched ( AWTEvent event ) {
if ( event instanceof MouseEvent ) {
MouseEvent mv = ( MouseEvent ) event ;
if ( mv . getClickCount ( ) > 0 & & ! ComparatorUtils . equals ( mv . getSource ( ) , Mutil Tempa lteTabPane . this ) ) {
if ( mv . getClickCount ( ) > 0 & & ! ComparatorUtils . equals ( mv . getSource ( ) , Mul tiTempla teTabPane . this ) ) {
isShowList = false ;
}
}
@ -203,7 +204,7 @@ public class MutilTempalteTabPane extends JComponent {
//根据当前i18n语言环境,动态调整popupMenu的宽度
menu . setPreferredSize ( new Dimension ( ( int ) DesignSizeI18nManager . getInstance ( ) .
i18nDimension ( "com.fr.design.file.MultiTemplateTabPane.popUpMenu" ) . getWidth ( ) , height ) ) ;
GUICoreUtils . showPopupMenu ( menu , Mutil Tempa lteTabPane . getInstance ( ) , e . getX ( ) , Mutil Tempa lteTabPane . getInstance ( ) . getY ( ) - 1 + Mutil Tempa lteTabPane . getInstance ( ) . getHeight ( ) ) ;
GUICoreUtils . showPopupMenu ( menu , Mul tiTempla teTabPane . getInstance ( ) , e . getX ( ) , Mul tiTempla teTabPane . getInstance ( ) . getY ( ) - 1 + Mul tiTempla teTabPane . getInstance ( ) . getHeight ( ) ) ;
}
}
}
@ -335,7 +336,7 @@ public class MutilTempalteTabPane extends JComponent {
DesignerContext . getDesignerFrame ( ) . activateJTemplate ( currentTemplate ) ;
}
Mutil Tempa lteTabPane . getInstance ( ) . repaint ( ) ;
Mul tiTempla teTabPane . getInstance ( ) . repaint ( ) ;
}
}
@ -349,7 +350,7 @@ public class MutilTempalteTabPane extends JComponent {
//判断关闭的模板是不是格式刷的被参照的模板
openedTemplate . remove ( jTemplate ) ;
if ( jTemplate ! = currentTemplate ) {
Mutil Tempa lteTabPane . getInstance ( ) . closeFormat ( jTemplate ) ;
Mul tiTempla teTabPane . getInstance ( ) . closeFormat ( jTemplate ) ;
HistoryTemplateListCache . getInstance ( ) . closeSelectedReport ( jTemplate ) ;
closeAndFreeLock ( jTemplate ) ;
}
@ -530,7 +531,7 @@ public class MutilTempalteTabPane extends JComponent {
for ( int i = 0 ; i < items . length ; i + + ) {
menu . add ( items [ i ] ) ;
}
GUICoreUtils . showPopupMenu ( menu , Mutil Tempa lteTabPane . getInstance ( ) , Mutil Tempa lteTabPane . getInstance ( ) . getWidth ( ) - menu . getPreferredSize ( ) . width , getY ( ) - 1 + getHeight ( ) ) ;
GUICoreUtils . showPopupMenu ( menu , Mul tiTempla teTabPane . getInstance ( ) , Mul tiTempla teTabPane . getInstance ( ) . getWidth ( ) - menu . getPreferredSize ( ) . width , getY ( ) - 1 + getHeight ( ) ) ;
}
@ -1106,7 +1107,7 @@ public class MutilTempalteTabPane extends JComponent {
listDownMode = LIST_DOWN ;
closeIconIndex = - 1 ;
mouseOveredIndex = - 1 ;
Mutil Tempa lteTabPane . this . repaint ( ) ;
Mul tiTempla teTabPane . this . repaint ( ) ;
}
/ * *
@ -1185,7 +1186,7 @@ public class MutilTempalteTabPane extends JComponent {
DesignerContext . getDesignerFrame ( ) . addAndActivateJTemplate ( openedTemplate . get ( tempSelectedIndex ) ) ;
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) , Toolkit . i18nText ( "Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported" )
+ "!" , Toolkit . i18nText ( "Fine-Design_Basic_Alert" ) , JOptionPane . WARNING_MESSAGE ) ;
Mutil Tempa lteTabPane . this . repaint ( ) ;
Mul tiTempla teTabPane . this . repaint ( ) ;
return ;
}
JTemplate evtXTemplate = openedTemplate . get ( getTemplateIndex ( evtX ) ) ;
@ -1193,7 +1194,7 @@ public class MutilTempalteTabPane extends JComponent {
}
isShowList = false ;
}
Mutil Tempa lteTabPane . this . repaint ( ) ;
Mul tiTempla teTabPane . this . repaint ( ) ;
}
@ -1234,7 +1235,7 @@ public class MutilTempalteTabPane extends JComponent {
boolean isOverCloseIcon = isOverCloseIcon ( evtX ) ;
clodeMode = isOverCloseIcon ? MOUSE_OVER_CLOSE : CLOSE ;
closeIconIndex = isOverCloseIcon ? mouseOveredIndex : - 1 ;
Mutil Tempa lteTabPane . this . repaint ( ) ;
Mul tiTempla teTabPane . this . repaint ( ) ;
}
}