/** * Creates a new operation. * @param window the window that is reshaped */ public Operation( ScreenDockWindow window ){ this.window = window; for( ScreenDockWindow check : getWindows() ){ initialBoundaries.put( check, check.getWindowBounds() ); } }
@Override public Rectangle checkSize( ScreenDockWindow window ){ Point center = window.getTitleCenter(); if( center == null ){ Rectangle target = window.getWindowBounds(); center = new Point( target.width/2, target.height/2 ); } return validate( window, window.getWindowBounds(), center, center ); }
private Rectangle validate( ScreenDockWindow window, Rectangle target ){ Dimension max = getMaximumSize( window ); if( target == null ){ target = window.getWindowBounds(); } return new Rectangle( target.x, target.y, Math.min( max.width, target.width ), Math.min( max.height, target.height ) ); }
/** * Creates a new operation. * @param window the window that is reshaped */ public Operation( ScreenDockWindow window ){ this.window = window; for( ScreenDockWindow check : getWindows() ){ initialBoundaries.put( check, check.getWindowBounds() ); } }
private Rectangle validate( ScreenDockWindow window, Rectangle target ){ Dimension max = getMaximumSize( window ); if( target == null ){ target = window.getWindowBounds(); } return new Rectangle( target.x, target.y, Math.min( max.width, target.width ), Math.min( max.height, target.height ) ); }
@Override public Rectangle checkSize( ScreenDockWindow window ){ Point center = window.getTitleCenter(); if( center == null ){ Rectangle target = window.getWindowBounds(); center = new Point( target.width/2, target.height/2 ); } return validate( window, window.getWindowBounds(), center, center ); }
@Override protected Rectangle checkSize( ScreenDockWindow window ){ return checkSize( window, window.getWindowBounds() ); }
@Override protected Rectangle checkSize( ScreenDockWindow window ){ return checkSize( window, window.getWindowBounds() ); }
@Override public void layoutContainer( Container parent ){ Rectangle bounds = window.getWindowBounds(); Dimension size = windowComponent.getPreferredSize(); if( bounds.width != size.width || bounds.height != size.height ){ window.setWindowBounds( new Rectangle( bounds.getLocation(), size ) ); } super.layoutContainer( parent ); } }
@Override public void layoutContainer( Container parent ){ Rectangle bounds = window.getWindowBounds(); Dimension size = windowComponent.getPreferredSize(); if( bounds.width != size.width || bounds.height != size.height ){ window.setWindowBounds( new Rectangle( bounds.getLocation(), size ) ); } super.layoutContainer( parent ); } }
public boolean isFullscreen( ScreenDockWindow window ){ Rectangle bounds = window.getWindowBounds(); return bounds.x <= 0 && bounds.y <= 0 && bounds.width + bounds.x >= desktop.getWidth() && bounds.height + bounds.y >= desktop.getHeight(); }
public boolean isFullscreen( ScreenDockWindow window ){ Rectangle bounds = window.getWindowBounds(); return bounds.x <= 0 && bounds.y <= 0 && bounds.width + bounds.x >= desktop.getWidth() && bounds.height + bounds.y >= desktop.getHeight(); }
public Rectangle check( ScreenDockWindow window ){ return validate( window.getWindowBounds(), window.getTitleCenter() ); }
public Rectangle check( ScreenDockWindow window ){ return validate( window.getWindowBounds(), window.getTitleCenter() ); }
private void move() { DockUtilities.checkLayoutLocked(); if( combine != null ){ combine( dropInfo, combiner, null ); } else{ ScreenDockWindow window = getWindow( dockable ); Point zero = window.getOffsetMove(); if( zero == null ) zero = new Point( 0, 0 ); Rectangle bounds = window.getWindowBounds(); bounds = new Rectangle( titleX - zero.x, titleY - zero.y, bounds.width, bounds.height ); window.setWindowBounds( bounds ); } }
public void run() { ScreenDockWindow window = station.getWindow( parent ); if( window != null ){ window.validate(); Dimension newSize = dockable.getComponent().getSize(); int dw = oldSize.width - newSize.width; int dh = oldSize.height - newSize.height; Rectangle bounds = window.getWindowBounds(); bounds.width += dw; bounds.height += dh; window.setWindowBounds( bounds ); } } } );
public void run() { ScreenDockWindow window = station.getWindow( parent ); if( window != null ){ window.validate(); Dimension newSize = dockable.getComponent().getSize(); int dw = oldSize.width - newSize.width; int dh = oldSize.height - newSize.height; Rectangle bounds = window.getWindowBounds(); bounds.width += dw; bounds.height += dh; window.setWindowBounds( bounds ); } } } );
public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){ if( fullscreen ){ window.setNormalBounds( window.getWindowBounds() ); window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) ); } else{ Rectangle bounds = window.getNormalBounds(); if( bounds != null ){ window.setWindowBounds( bounds ); window.setNormalBounds( null ); } } } }
public void setFullscreen( ScreenDockWindow window, boolean fullscreen ){ if( fullscreen ){ window.setNormalBounds( window.getWindowBounds() ); window.setWindowBounds( new Rectangle( 0, 0, desktop.getWidth(), desktop.getHeight() ) ); } else{ Rectangle bounds = window.getNormalBounds(); if( bounds != null ){ window.setWindowBounds( bounds ); window.setNormalBounds( null ); } } } }
private void saveLocation( int index ){ ScreenDockWindow window = dockables.dockables().get( index ).getWindow(); PlaceholderMetaMap map = dockables.dockables().getMetaMap( index ); Rectangle bounds = null; if( window.isFullscreen() ){ bounds = window.getNormalBounds(); } if( bounds == null ){ bounds = window.getWindowBounds(); } map.putInt( "x", bounds.x ); map.putInt( "y", bounds.y ); map.putInt( "width", bounds.width ); map.putInt( "height", bounds.height ); }