@Override public DockableProperty findProperty( DockableProperty successor ) { if( successor == null ){ return new ScreenDockProperty( 20, 20, 400, 400 ); } return successor; }
@Override public DockableProperty findProperty( DockableProperty successor ) { if( successor == null ){ return new ScreenDockProperty( 20, 20, 400, 400 ); } return successor; }
public DockableProperty createProperty() { return new ScreenDockProperty(); } }
public ScreenDockProperty copy() { ScreenDockProperty copy = new ScreenDockProperty( x, y, width, height, placeholder, fullscreen ); copy( copy ); return copy; }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( x, y, width, height ); screen.setSuccessor( successor ); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( x, y, width, height ); screen.setSuccessor( successor ); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
private void drop() { if( combine != null ){ combine( dropInfo, combiner, null ); } else{ Dimension size = dropSizeStrategy.getValue().getDropSize( ScreenDockStation.this, dockable ); ScreenDockProperty property = new ScreenDockProperty( titleX, titleY, size.width, size.height ); ScreenDockStation.this.drop( dockable, property, false ); } } }
public void drop( Dockable dockable ) { Window owner = getOwner(); int x = 30; int y = 30; if( owner != null ){ x += owner.getX(); y += owner.getY(); } Dimension preferred = dropSizeStrategy.getValue().getAddSize( this, dockable ); int width = Math.max( preferred.width, 100 ); int height = Math.max( preferred.height, 100 ); if( !drop( dockable, new ScreenDockProperty( x, y, width, height ) ) ){ addDockable( dockable, new Rectangle( x, y, width, height ) ); } }
return new ScreenDockProperty( corner.x, corner.y, size.width, size.height, null, false );
return new ScreenDockProperty( corner.x, corner.y, size.width, size.height, null, false );
DockLayoutInfo info = children.getChild( retro.id( i )); if( info != null ){ ScreenDockProperty property = new ScreenDockProperty( retro.x( i ), retro.y( i ), retro.width( i ), retro.height( i ), null ); info.setLocation( property ); ScreenDockProperty property = new ScreenDockProperty( x, y, width, height, placeholder, fullscreen ); children.getChild( id ).setLocation( property ); info.setLocation( new ScreenDockProperty( x, y, width, height, info.getPlaceholder(), fullscreen ) );
public DockableProperty getDockableProperty( PerspectiveDockable child, PerspectiveDockable target ){ ScreenPerspectiveWindow window = getWindow( child ); if( window == null ){ throw new IllegalArgumentException( "child is not a child of this station" ); } Path placeholder = null; if( target != null ){ placeholder = target.getPlaceholder(); } else{ placeholder = child.getPlaceholder(); } return new ScreenDockProperty( window.getX(), window.getY(), window.getWidth(), window.getHeight(), placeholder, window.isFullscreen() ); }
public DockableProperty getDockableProperty( PerspectiveDockable child, PerspectiveDockable target ){ ScreenPerspectiveWindow window = getWindow( child ); if( window == null ){ throw new IllegalArgumentException( "child is not a child of this station" ); } Path placeholder = null; if( target != null ){ placeholder = target.getPlaceholder(); } else{ placeholder = child.getPlaceholder(); } return new ScreenDockProperty( window.getX(), window.getY(), window.getWidth(), window.getHeight(), placeholder, window.isFullscreen() ); }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( getX(), getY(), getWidth(), getHeight(), null, true ); screen.setSuccessor( successor ); CLocation parent = getParent(); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
@Override public DockableProperty findProperty( DockableProperty successor ){ ScreenDockProperty screen = new ScreenDockProperty( getX(), getY(), getWidth(), getHeight(), null, true ); screen.setSuccessor( successor ); CLocation parent = getParent(); if( parent != null ){ return parent.findProperty( screen ); } return screen; }
return new ScreenDockProperty( bounds.x, bounds.y, bounds.width, bounds.height, placeholder, fullscreen );
@Override public PlaceholderListItem<Dockable> convert( ConvertedPlaceholderListItem item ) { int id = item.getInt( "id" ); int x = item.getInt( "x" ); int y = item.getInt( "y" ); int width = item.getInt( "width" ); int height = item.getInt( "height" ); boolean fullscreen = item.getBoolean( "fullscreen" ); Path placeholder = null; if( item.contains( "placeholder" )){ placeholder = new Path( item.getString( "placeholder" ) ); } ScreenDockProperty property = new ScreenDockProperty( x, y, width, height, placeholder, fullscreen ); children.getChild( id ).setLocation( property ); for( int i = 0, n = children.getSubChildCount( id ); i<n; i++ ){ DockLayoutInfo info = children.getSubChild( id, i ); info.setLocation( new ScreenDockProperty( x, y, width, height, info.getPlaceholder(), fullscreen ) ); } return null; } });
public DockableProperty getLocationAt( Path placeholder ) { DockablePlaceholderList<ScreenDockWindowHandle>.Item item = dockables.getItem( placeholder ); if( item == null ){ return null; } ScreenDockWindowHandle handle = item.getDockable(); if( handle != null ){ Dockable dockable = handle.asDockable(); ScreenDockProperty property = getLocation( dockable, dockable ); property.setPlaceholder( placeholder ); return property; } else if( item.contains( "x", "y", "width", "height" )){ int x = item.getInt( "x" ); int y = item.getInt( "y" ); int width = item.getInt( "width" ); int height = item.getInt( "height" ); return new ScreenDockProperty( x, y, width, height, placeholder ); } else{ return null; } } };
/** * Called if the toolbar item defined by <code>source</code> has to be put * onto the {@link ScreenDockStation} defined by <code>source</code>. * * @param source * all the information about the operation * @param orientation * the preferred orientation of the new window, might be * <code>null</code> */ protected void execute( InserterSource source, Orientation orientation ){ final ToolbarStrategy strategy = getStrategy(); Dockable child = source.getItem().getDockable(); final Dockable item = strategy.ensureToolbarLayer( source.getParent(), child ); if( item != child ){ item.setController( controller ); item.asDockStation().drop( child ); item.setController( null ); } if( (orientation != null) && (item.asDockStation() instanceof OrientedDockStation) ) { ((OrientedDockStation) item).setOrientation( orientation ); } final ScreenDockStation station = (ScreenDockStation) source.getParent(); item.getComponent().validate(); final Dimension size = item.getComponent().getPreferredSize(); final ScreenDockProperty location = new ScreenDockProperty( source.getItem().getTitleX(), source.getItem().getTitleY(), size.width, size.height ); station.drop( item, location, false ); }
height = meta.getInt( "height" ); ScreenDockProperty replacement = new ScreenDockProperty( x, y, width, height, placeholder, property.isFullscreen() ); replacement.setSuccessor( property.getSuccessor() ); args.setProperty( replacement );