public void contentChanged(){ int count = getDockableCount(); for( int i = 0; i < count; i++ ){ updateContent( i ); } }
public void move( Dockable dockable, DockableProperty property ) { if( property instanceof StackDockProperty ){ DockUtilities.checkLayoutLocked(); int index = indexOf( dockable ); if( index < 0 ) throw new IllegalArgumentException( "dockable not child of this station" ); int destination = ((StackDockProperty)property).getIndex(); destination = Math.min( destination, getDockableCount()-1 ); destination = Math.max( 0, destination ); move( index, destination ); } }
private void merge( StackDockStation parent, StackDockStation child ){ StackDockStation.Insert insert = parent.getInsert(); int index = parent.getDockableCount(); if( insert != null ){ index = insert.getTab(); if( insert.isRight() ){ index++; } } for( int i = child.getDockableCount()-1; i >= 0; i-- ){ Dockable dockable = child.getDockable( i ); child.remove( i ); parent.add( dockable, index ); } } }
private int getMaxSize( Dockable dockable, boolean horizontal ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); Dimension size = cdock.getMinimizedSize(); if( horizontal ) return size.height; else return size.width; } if( dockable instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable; int size = -1; for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ size = Math.max( size, getMaxSize( station.getDockable( i ), horizontal )); } return size; } return -1; }
private int getMaxSize( Dockable dockable, boolean horizontal ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); Dimension size = cdock.getMinimizedSize(); if( horizontal ) return size.height; else return size.width; } if( dockable instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable; int size = -1; for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ size = Math.max( size, getMaxSize( station.getDockable( i ), horizontal )); } return size; } return -1; }
public void setPlaceholders( PlaceholderMap placeholders ){ if( getDockableCount() > 0 ){ throw new IllegalStateException( "there are children on this station" ); } try{ DockablePlaceholderList<StationChildHandle> next = new DockablePlaceholderList<StationChildHandle>( placeholders ); if( getController() != null ){ dockables.setStrategy( null ); dockables.unbind(); dockables = next; dockables.bind(); dockables.setStrategy( getPlaceholderStrategy() ); } else{ dockables = next; } } catch( IllegalArgumentException ex ){ // ignore } }
/** * Checks whether <code>dockable</code>s height is locked. * @param dockable the element to test * @return <code>true</code> if the height is locked */ private boolean isLockedVertically( Dockable dockable ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); return cdock.isResizeLockedVertically(); } if( dockable != null && dockable.asDockStation() instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable.asDockStation(); for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ if( isLockedVertically( station.getDockable( i ) )) return true; } } return false; }
/** * Checks whether <code>dockable</code>s height is locked. * @param dockable the element to test * @return <code>true</code> if the height is locked */ private boolean isLockedVertically( Dockable dockable ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); return cdock.isResizeLockedVertically(); } if( dockable != null && dockable.asDockStation() instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable.asDockStation(); for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ if( isLockedVertically( station.getDockable( i ) )) return true; } } return false; }
/** * Checks whether <code>dockable</code>s width is locked. * @param dockable the element to test * @return <code>true</code> if the width is locked */ private boolean isLockedHorizontally( Dockable dockable ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); return cdock.isResizeLockedHorizontally(); } if( dockable != null && dockable.asDockStation() instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable.asDockStation(); for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ if( isLockedHorizontally( station.getDockable( i ) )) return true; } } return false; } }
/** * Checks whether <code>dockable</code>s width is locked. * @param dockable the element to test * @return <code>true</code> if the width is locked */ private boolean isLockedHorizontally( Dockable dockable ){ if( dockable instanceof CommonDockable ){ CDockable cdock = ((CommonDockable)dockable).getDockable(); return cdock.isResizeLockedHorizontally(); } if( dockable != null && dockable.asDockStation() instanceof StackDockStation ){ StackDockStation station = (StackDockStation)dockable.asDockStation(); for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ if( isLockedHorizontally( station.getDockable( i ) )) return true; } } return false; } }
public void setLayout( StackDockStation station, StackDockStationLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ){ DockController controller = station.getController(); try { if (controller != null) controller.freezeLayout(); for (int i = station.getDockableCount() - 1; i >= 0; i--) station.remove( i ); if( layout instanceof RetroStackDockStationLayout ){ RetroStackDockStationLayout retroLayout = (RetroStackDockStationLayout)layout; for (int id : retroLayout.getChildren()) { Dockable dockable = children.get( id ); if (dockable != null) { station.drop( dockable ); } } } else{ station.setPlaceholders( layout.getPlaceholders().filter( placeholders ), children ); } Dockable selected = children.get( layout.getSelected() ); if (selected != null) { station.setFrontDockable( selected ); } } finally { if (controller != null) controller.meltLayout(); } }
public void setLayout( StackDockStation station, StackDockStationLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ){ DockController controller = station.getController(); try { if (controller != null) controller.freezeLayout(); for (int i = station.getDockableCount() - 1; i >= 0; i--) station.remove( i ); if( layout instanceof RetroStackDockStationLayout ){ RetroStackDockStationLayout retroLayout = (RetroStackDockStationLayout)layout; for (int id : retroLayout.getChildren()) { Dockable dockable = children.get( id ); if (dockable != null) { station.drop( dockable ); } } } else{ station.setPlaceholders( layout.getPlaceholders().filter( placeholders ), children ); } Dockable selected = children.get( layout.getSelected() ); if (selected != null) { station.setFrontDockable( selected ); } } finally { if (controller != null) controller.meltLayout(); } }
Rectangle bounds = new Rectangle( 0, 0, getWidth(), getHeight() ); Rectangle frontBounds = null; if( getDockableCount() < 2 ) frontBounds = bounds; else{
StackDockStation station = (StackDockStation)dockable; for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ RequestDimension check = getAndClearResizeRequest( station.getDockable( i ) ); if( check != null ){
StackDockStation station = (StackDockStation)dockable; for( int i = 0, n = station.getDockableCount(); i<n; i++ ){ RequestDimension check = getAndClearResizeRequest( station.getDockable( i ) ); if( check != null ){
public void merge( StationDropOperation operation, DockStation parent, DockStation child ){ DisplayerCombinerTarget target = operation.getDisplayerCombination(); if( target instanceof TabDisplayerCombinerTarget ){ TabDisplayerCombinerTarget tab = (TabDisplayerCombinerTarget)target; StackDockStation station = (StackDockStation)operation.getItem(); if( station.getDockParent() != null ){ station.getDockParent().drag( station ); } Dockable dockable = tab.getTarget(); parent.replace( dockable, station ); Dockable selected = station.getFrontDockable(); if( tab.getIndex() == 0 ){ station.add( dockable, station.getDockableCount() ); } else{ station.add( dockable, 0 ); } DockController controller = station.getController(); if( controller != null ){ controller.setFocusedDockable( selected, false ); } } } }
public void merge( StationDropOperation operation, DockStation parent, DockStation child ){ DisplayerCombinerTarget target = operation.getDisplayerCombination(); if( target instanceof TabDisplayerCombinerTarget ){ TabDisplayerCombinerTarget tab = (TabDisplayerCombinerTarget)target; StackDockStation station = (StackDockStation)operation.getItem(); if( station.getDockParent() != null ){ station.getDockParent().drag( station ); } Dockable dockable = tab.getTarget(); parent.replace( dockable, station ); Dockable selected = station.getFrontDockable(); if( tab.getIndex() == 0 ){ station.add( dockable, station.getDockableCount() ); } else{ station.add( dockable, 0 ); } DockController controller = station.getController(); if( controller != null ){ controller.setFocusedDockable( selected, false ); } } } }
private void updateContent( int index ){ if( index >= 0 && (getDockableCount() > 1 || singleTabStackDockComponent()) ){ Dockable dockable = getDockable( index ); TabContentFilter filter = getTabContentFilter(); TabContent content = new TabContent( dockable.getTitleIcon(), dockable.getTitleText(), dockable.getTitleToolTip() ); if( filter != null ){ content = filter.filter( content, this, dockable ); } if( content == null ){ stackComponent.setTitleAt( index, null ); stackComponent.setIconAt( index, null ); stackComponent.setTooltipAt( index, null ); } else{ stackComponent.setTitleAt( index, content.getTitle() ); stackComponent.setIconAt( index, content.getIcon() ); stackComponent.setTooltipAt( index, content.getTooltip() ); } } }
public void apply( CGroupBehaviorCallback callback ){ Dockable[] children = new Dockable[ dockParent.getDockableCount() ]; for( int i = 0; i < children.length; i++ ){ children[i] = dockParent.getDockable( i );
public void apply( CGroupBehaviorCallback callback ){ Dockable[] children = new Dockable[ dockParent.getDockableCount() ]; for( int i = 0; i < children.length; i++ ){ children[i] = dockParent.getDockable( i );