if( last != null && secondLast != null ){
if( normalModeIdentifier().equals( secondLast.getUniqueIdentifier() ) &&
MaximizedMode.IDENTIFIER.equals( last.getUniqueIdentifier() )){
MaximizedModeArea area = maximizedMode.get( location.getRoot() );
if( area == this ){
area.setMaximized( dockable, false, null, event.getAffected() );
event.done(true);
return null;
}
}
}
}
}
}
// if the element is about to become a child of this station, ensure
// this station does not show a maximized element
if( location != null && getMaximized() != null ){
Map<ExtendedMode, DockStation> roots = manager.getRepresentations( location.getRoot() );
for( DockStation station : roots.values() ){
if( DockUtilities.isAncestor( getStation(), station )){
maximizedMode.unmaximize( this, event.getAffected() );
break;
}
}
}
// if this station currently shows dockable as maximized element, ensure it is no longer maximized
if( maximizedMode != null && event.getMode().getUniqueIdentifier().equals( normalModeIdentifier() )){
MaximizedModeArea area = maximizedMode.getMaximizeArea( dockable );
if( area == this ){
maximizedMode.unmaximize( dockable, event.getAffected() );
}
}