DesktopPane: made private methods/fields protected to allow overriding

This commit is contained in:
Karl Tauber
2021-04-10 13:36:44 +02:00
parent d9c240d729
commit a331760321

View File

@@ -47,7 +47,7 @@ public class FlatDesktopPaneUI
private ComponentListener componentListener; private ComponentListener componentListener;
// list of iconified internal frames, which define the order of icons in dock // list of iconified internal frames, which define the order of icons in dock
private List<JInternalFrame> iconifiedFrames; protected List<JInternalFrame> iconifiedFrames;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
return new FlatDesktopPaneUI(); return new FlatDesktopPaneUI();
@@ -67,7 +67,7 @@ public class FlatDesktopPaneUI
componentListener = new ComponentAdapter() { componentListener = new ComponentAdapter() {
@Override @Override
public void componentResized( ComponentEvent e ) { public void componentResized( ComponentEvent e ) {
layoutDesktopIcons(); layoutDock();
} }
}; };
desktop.addComponentListener( componentListener ); desktop.addComponentListener( componentListener );
@@ -106,7 +106,7 @@ public class FlatDesktopPaneUI
super.uninstallDesktopManager(); super.uninstallDesktopManager();
} }
private void layoutDesktopIcons() { protected void layoutDock() {
if( iconifiedFrames == null || iconifiedFrames.isEmpty() ) if( iconifiedFrames == null || iconifiedFrames.isEmpty() )
return; return;
@@ -133,23 +133,23 @@ public class FlatDesktopPaneUI
} }
} }
private void addToDock( JInternalFrame f ) { protected void addToDock( JInternalFrame f ) {
if( iconifiedFrames == null ) if( iconifiedFrames == null )
iconifiedFrames = new ArrayList<>(); iconifiedFrames = new ArrayList<>();
if( !iconifiedFrames.contains( f ) ) if( !iconifiedFrames.contains( f ) )
iconifiedFrames.add( f ); iconifiedFrames.add( f );
layoutDesktopIcons(); layoutDock();
((FlatDesktopIconUI)f.getDesktopIcon().getUI()).updateDockIcon(); ((FlatDesktopIconUI)f.getDesktopIcon().getUI()).updateDockIcon();
} }
private void removeFromDock( JInternalFrame f ) { protected void removeFromDock( JInternalFrame f ) {
if( iconifiedFrames == null ) if( iconifiedFrames == null )
return; return;
iconifiedFrames.remove( f ); iconifiedFrames.remove( f );
layoutDesktopIcons(); layoutDock();
} }
//---- class FlatDesktopManager ------------------------------------------- //---- class FlatDesktopManager -------------------------------------------