@ -34,6 +34,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils ;
import com.fr.stable.Constants ;
import java.util.LinkedList ;
import javax.swing.BorderFactory ;
import javax.swing.JComponent ;
import javax.swing.JPopupMenu ;
@ -613,6 +614,7 @@ public class EditingMouseListener extends MouseInputAdapter {
int oldX = e . getX ( ) ;
int oldY = e . getY ( ) ;
offsetEventPoint ( e ) ;
selectionModel . getSelection ( ) . getTabList ( ) . clear ( ) ;
XCreator creator = designer . getComponentAt ( e ) ;
boolean isValidButton = e . getButton ( ) = = MouseEvent . BUTTON1 | | e . getButton ( ) = = MouseEvent . BUTTON3 ;
@ -661,13 +663,36 @@ public class EditingMouseListener extends MouseInputAdapter {
}
private boolean responseTabLayout ( XCreator creator , MouseEvent e ) {
if ( creator . acceptType ( XWCardMainBorderLayout . class ) ) {
creator . respondClick ( this , e ) ;
LinkedList < XCreator > list = selectionModel . getSelection ( ) . getTabList ( ) ;
if ( creator . acceptType ( XWCardMainBorderLayout . class ) ) {
list . add ( creator ) ;
}
while ( creator . getParent ( ) instanceof XCreator ) {
creator = ( XCreator ) creator . getParent ( ) ;
if ( creator . acceptType ( XWCardMainBorderLayout . class ) ) {
list . add ( creator ) ;
}
}
// 至少存在一层以上tab块的嵌套
if ( list . size ( ) > 1 ) {
XWCardMainBorderLayout firstCreator = ( XWCardMainBorderLayout ) list . getFirst ( ) ;
XWCardMainBorderLayout lastCreator = ( XWCardMainBorderLayout ) list . getLast ( ) ;
// 内层tab响应事件
firstCreator . respondClick ( this , e ) ;
setCoverPaneNotDisplay ( firstCreator , e , false ) ;
final XCreator xCreator = selectionModel . getSelection ( ) . getSelectedCreator ( ) ;
SwingUtilities . invokeLater ( new Runnable ( ) {
@Override
public void run ( ) {
xCreator . setSelected ( true ) ;
// 外层tab展示阴影边框效果
lastCreator . setShowOuterShadowBorder ( true ) ;
}
} ) ;
return true ;
} else if ( creator . getParent ( ) instanceof XCreator ) {
return responseTabLayout ( ( XCreator ) creator . getParent ( ) , e ) ;
} else {
return false ;
}
return false ;
}