/** * Adds <code>dockable</code> with boundaries <code>bounds</code> to this perspective. * @param dockable the element to add * @param bounds the boundaries of <code>dockable</code> */ public void add( PerspectiveDockable dockable, Rectangle bounds ){ add( dockable, bounds, false ); }
/** * Adds <code>placeholder</code> to this station. * @param placeholder the placeholder to add * @param bounds the location and size of <code>placeholder</code> */ public void addPlaceholder( Path placeholder, Rectangle bounds ){ addPlaceholder( placeholder, bounds.x, bounds.y, bounds.width, bounds.height ); }
public String getConverterID(){ return super.getFactoryID(); } }
/** * Removes the child <code>dockable</code> from this station. * @param dockable the element to remove * @return <code>true</code> if <code>dockable</code> was removed, * <code>false</code> otherwise */ public boolean remove( PerspectiveDockable dockable ){ int index = indexOf( dockable ); if( index >= 0 ){ remove( index ); return true; } return false; }
public ScreenDockPerspective layoutPerspective( ScreenDockStationLayout layout, Map<Integer, PerspectiveDockable> children ){ ScreenDockPerspective result = new ScreenDockPerspective(); layoutPerspective( result, layout, children ); return result; }
public void setPlaceholders( PlaceholderMap placeholders ){ if( getDockableCount() > 0 ){ throw new IllegalStateException( "there are already children on this station" ); } dockables = new PerspectivePlaceholderList<ScreenPerspectiveWindow>( placeholders ); }
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() ); }
/** * Adds a placeholder for <code>dockable</code> and all its children to this * station. * @param dockable the element whose placeholder should be inserted * @param x the x-coordinate on the screen * @param y the y-coordinate on the screen * @param width the width of the window * @param height the height of the window */ public void addPlaceholder( PerspectiveDockable dockable, int x, int y, int width, int height ){ ScreenPerspectiveWindow child = new ScreenPerspectiveWindow( dockable ); child.setX( x ); child.setY( y ); child.setWidth( width ); child.setHeight( height ); child.setFullscreen( false ); dockables.dockables().add( child ); remove( dockable ); }
public void replace( PerspectiveDockable oldDockable, PerspectiveDockable newDockable ){ int index = indexOf( oldDockable ); if( index < 0 ){ throw new IllegalArgumentException( "oldDockable is not a child of this station" ); } DockUtilities.ensureTreeValidity( this, newDockable ); ScreenPerspectiveWindow window = dockables.dockables().get( index ); Path placeholder = oldDockable.getPlaceholder(); if( placeholder != null ){ dockables.put( placeholder, window ); } oldDockable.setParent( null ); newDockable.setParent( this ); window.dockable = newDockable; if( oldDockable.asStation() != null ){ int listIndex = dockables.levelToBase( index, Level.DOCKABLE ); PerspectivePlaceholderList<ScreenPerspectiveWindow>.Item item = dockables.list().get( listIndex ); item.setPlaceholderMap( oldDockable.asStation().getPlaceholders() ); } }
public ScreenDockStationLayout getPerspectiveLayout( ScreenDockPerspective element, Map<PerspectiveDockable, Integer> children ){ return new ScreenDockStationLayout( element.toMap( children ) ); }
public void layoutPerspective( ScreenDockPerspective perspective, ScreenDockStationLayout layout, Map<Integer, PerspectiveDockable> children ){ perspective.read( layout.getPlaceholders(), children ); }
/** * Removes the child <code>dockable</code> from this station. * @param dockable the element to remove * @return <code>true</code> if <code>dockable</code> was removed, * <code>false</code> otherwise */ public boolean remove( PerspectiveDockable dockable ){ int index = indexOf( dockable ); if( index >= 0 ){ remove( index ); return true; } return false; }
result = new ScreenDockPerspective();
public void setPlaceholders( PlaceholderMap placeholders ){ if( getDockableCount() > 0 ){ throw new IllegalStateException( "there are already children on this station" ); } dockables = new PerspectivePlaceholderList<ScreenPerspectiveWindow>( placeholders ); }
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() ); }
/** * Adds a placeholder for <code>dockable</code> and all its children to this * station. * @param dockable the element whose placeholder should be inserted * @param x the x-coordinate on the screen * @param y the y-coordinate on the screen * @param width the width of the window * @param height the height of the window */ public void addPlaceholder( PerspectiveDockable dockable, int x, int y, int width, int height ){ ScreenPerspectiveWindow child = new ScreenPerspectiveWindow( dockable ); child.setX( x ); child.setY( y ); child.setWidth( width ); child.setHeight( height ); child.setFullscreen( false ); dockables.dockables().add( child ); remove( dockable ); }
public void replace( PerspectiveDockable oldDockable, PerspectiveDockable newDockable ){ int index = indexOf( oldDockable ); if( index < 0 ){ throw new IllegalArgumentException( "oldDockable is not a child of this station" ); } DockUtilities.ensureTreeValidity( this, newDockable ); ScreenPerspectiveWindow window = dockables.dockables().get( index ); Path placeholder = oldDockable.getPlaceholder(); if( placeholder != null ){ dockables.put( placeholder, window ); } oldDockable.setParent( null ); newDockable.setParent( this ); window.dockable = newDockable; if( oldDockable.asStation() != null ){ int listIndex = dockables.levelToBase( index, Level.DOCKABLE ); PerspectivePlaceholderList<ScreenPerspectiveWindow>.Item item = dockables.list().get( listIndex ); item.setPlaceholderMap( oldDockable.asStation().getPlaceholders() ); } }
/** * Adds <code>dockable</code> with boundaries <code>bounds</code> to this perspective. * @param dockable the element to add * @param bounds the boundaries of <code>dockable</code> */ public void add( PerspectiveDockable dockable, Rectangle bounds ){ add( dockable, bounds, false ); }
/** * Adds a placeholder for <code>dockable</code> and all its children to this * station. * @param dockable the element whose placeholder should be inserted * @param bounds the location and size of <code>dockable</code> */ public void addPlaceholder( PerspectiveDockable dockable, Rectangle bounds ){ addPlaceholder( dockable, bounds.x, bounds.y, bounds.width, bounds.height ); }
result = new ScreenDockPerspective();