Package bibliothek.gui

Examples of bibliothek.gui.DockStation


      return new SingleGroupMovement( dockable, target );
    }
  }

  private boolean isGrouped( Dockable dockable, ExtendedMode target, LocationModeManager<?> manager ){
    DockStation parent = dockable.getDockParent();
    if( parent instanceof StackDockStation ) {
      for( int i = 0, n = parent.getDockableCount(); i < n; i++ ) {
        if( !manager.isModeAvailable( parent.getDockable( i ), target ) ) {
          return false;
        }
      }
      return true;
    }
View Full Code Here


    }
    return false;
  }
 
  public Dockable getGroupElement( LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode mode  ){
    DockStation parent = dockable.getDockParent();
   
    if( parent instanceof StackDockStation ){
      if( parent.asDockable().getDockParent() == null ){
        // cannot move around a dockable without location
        return dockable;
      }
     
      for( int i = 0, n = parent.getDockableCount(); i<n; i++ ){
        Dockable check = parent.getDockable( i );
        if( check != dockable ){
          if( !manager.isModeAvailable( check, mode ) ){
            return dockable;
          }
        }
View Full Code Here

      return null;
   
    if( !DockUtilities.isAncestor( old, dockable ) )
      return null;
   
    DockStation station = old.asDockStation();
    if( station == null )
      return old;
   
    if( station.getDockableCount() == 2 ){
      if( station.getDockable( 0 ) == dockable )
        return station.getDockable( 1 );
      if( station.getDockable( 1 ) == dockable )
        return station.getDockable( 0 );
    }
   
    return old;
  }
View Full Code Here

      if( currentDockable.getDockParent() != dockable.getDockParent() ){
        missing++;
      }
    }
   
    DockStation newParent = dockable.getDockParent();
    if( newParent instanceof StackDockStation ){
      newParent.setFrontDockable( dockable );
    }
   
    currentStation = null;
    currentDockable = null;
  }
View Full Code Here

        });
      }
    }
   
    private void checkAndReplace( Dockable dockable ){
      DockStation station = dockable.getDockParent();
      if( !(station instanceof ScreenDockStation) ) {
        return;
      }
     
      DockController controller = control.getController();
     
      try {
        controller.freezeLayout();
     
        ExternalizingCGridArea split = createGridArea();
        control.addDockable( split );
       
        station.replace( dockable, split.getStation() );
        split.getStation().drop( dockable );
      }
      finally {
        controller.meltLayout();
      }
View Full Code Here

        register.addDockRegisterListener( new DelayedAutoRemove() );
      }
      else{
        SplitDockStation station = getStation();
        if( station.getDockableCount() == 0 ){
          DockStation parent = station.getDockParent();
          if( parent != null ){
            parent.drag( station );
          }
          control.removeDockable( this );
          control.removeStation( this );
        }
      }
View Full Code Here

   * the first {@link CStation} which is a {@link CStation#isWorkingArea() working area}.
   * @param station the station on which to start the search
   * @return the first working area (closest to <code>station</code>)
   */
  public static CStation<?> getFirstWorkingArea( CStation<?> station ){
    DockStation parent = station.getStation();
    while( parent != null ){
      if( parent instanceof CommonDockStation<?, ?> ){
        CStation<?> cstation = ((CommonDockStation<?, ?>)parent).getStation();
        if( cstation.isWorkingArea() ){
          return cstation;
        }
      }
      Dockable child = parent.asDockable();
      parent = child == null ? null : child.getDockParent();
    }
    return null;
  }
View Full Code Here

     
      checkValidUniqueId( container.getUniqueId() );
     
      // check control?
     
      DockStation defaultStation = frontend.getDefaultStation();
      boolean noDefaultStation = defaultStation == null || defaultStation instanceof ScreenDockStation;
     
      register.addStationContainer( container );
     
        if( noDefaultStation ){
View Full Code Here

     * with the <code>root</code> flag set to <code>true</code>.
     * @param station the station whose root flag is asked
     * @return the value of the root flag or <code>false</code> if <code>station</code> is not registered at all
     */
    public boolean isRootStation( CStation<?> station ){
      DockStation root = frontend.getRoot( station.getUniqueId() );
      return root == station.getStation();
    }
View Full Code Here

        setController( controller );
    }
   
    @Override
    protected Boolean createGroupKey( Dockable dockable ){
      DockStation station = dockable.asDockStation();
      if( station == null )
        throw new IllegalArgumentException( "Only dockables which are also a DockStation can be used for a ReplaceAction" );
     
      DockStation parent = dockable.getDockParent();
      if( parent == null )
        return false;
     
      int count = station.getDockableCount();
      if( count == 0 )
        return parent.canDrag( dockable );
      if( count == 1 ){
        return parent.canReplace( dockable, station.getDockable( 0 ) ) &&
              parent.accept( station.getDockable( 0 )) &&
              station.getDockable( 0 ).accept( parent ) &&
              station.canDrag( station.getDockable( 0 ));
      }
      return false;
    }
View Full Code Here

TOP

Related Classes of bibliothek.gui.DockStation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.