Package bibliothek.gui

Examples of bibliothek.gui.DockStation


      }
      return false;
    }
   
    public void action( Dockable dockable ) {
        DockStation station = dockable.asDockStation();
        if( station == null )
          throw new IllegalArgumentException( "dockable is not a station" );
       
        DockStation parent = dockable.getDockParent();
        if( parent != null ){
          if( station.getDockableCount() == 0 ){
              if( parent.canDrag( station.asDockable() ))
                  parent.drag( station.asDockable());
          }
          else{
              if( parent.canReplace( station.asDockable(), station.getDockable( 0 ) ) &&
                      parent.accept( station.getDockable( 0 )) &&
                      station.getDockable( 0 ).accept( parent ) &&
                      station.canDrag( station.getDockable( 0 ))){
                 
                  dockable = station.getDockable( 0 );
                 
                  station.drag( dockable );
                  parent.replace( station.asDockable(), dockable );
              }
          }
        }
    }
View Full Code Here


        }
    }
   
    @Override
    public void bound( Dockable dockable ) {
      DockStation station = dockable.asDockStation();
      if( station == null )
        throw new IllegalArgumentException( "dockable is not a station" );

      station.addDockStationListener( dockStationListener );
      super.bound( dockable );
    }
View Full Code Here

      station.addDockStationListener( dockStationListener );
      super.bound( dockable );
    }
    @Override
    public void unbound( Dockable dockable ) {
      DockStation station = dockable.asDockStation();
      if( station == null )
        throw new IllegalArgumentException( "dockable is not a station" );

      station.removeDockStationListener( dockStationListener );
        super.unbound( dockable );
    }
View Full Code Here

     * default-behaviour of this method is to remove the {@link Dockable}
     * from it's parent, if there is a parent.
     * @param dockable The {@link Dockable} to close
     */
    protected void close( Dockable dockable ){
        DockStation parent = dockable.getDockParent();
        if( parent != null )
            parent.drag( dockable );
    }
View Full Code Here

      return externalMode;
    }

    public void setMaximized( Dockable dockable, boolean maximized, Location history, AffectedSet set ){
      ScreenDockStation station = getStation();
      DockStation parent = dockable.getDockParent();
     
      if( maximized ){
        if( parent == station ){
          station.setFullscreen( dockable, true );
        }
        else{
          Dockable child = DockUtilities.getDirectChild( station, dockable );
          if( child == null ){
            throw new IllegalArgumentException( "dockable not a child of this station" );
          }
          if( !parent.canDrag( dockable )){
            throw new IllegalArgumentException( "cannot drag dockable from its parent" );
          }
          parent.drag( dockable );
          if( !station.drop( dockable, child ) ){
            throw new IllegalStateException( "cannot drop dockable on this station" );
          }
          station.setFullscreen( dockable, true );
        }
      }
      else{
        if( parent == station ){
          station.setFullscreen( dockable, false );
        }
        else{
          Dockable child = DockUtilities.getDirectChild( station, dockable );
          ScreenDockProperty location = station.getLocation( child, dockable );
         
          if( !parent.canDrag( dockable )){
            throw new IllegalArgumentException( "cannot drag dockable from its current parent" );
          }
          location.setFullscreen( false );
          if( !station.drop( dockable, location, true )){
            throw new IllegalStateException( "could not drop dockable on this station" );
View Full Code Here

  public CExternalizedModeArea asExternalized(){
    return external;
  }
 
  private CStation<?> getBaseStation(){
    DockStation parent = getStation().getDockParent();
    while( parent != null ){
      if( parent instanceof CommonDockStation<?, ?> ){
        return ((CommonDockStation<?, ?>)parent).getStation();
      }
    }
View Full Code Here

      remove( new ModeAreaListenerWrapper( this, listener ));
    }
   
    public CLocation getCLocation( Dockable dockable ){
      CStation<?> base = getBaseStation();
      DockStation baseStation = base.getStation();
      DockableProperty property = DockUtilities.getPropertyChain( baseStation, dockable );
      return base.getStationLocation().expandProperty( baseStation.getController(), property );
    }
View Full Code Here

              if( dockable instanceof CommonDockable ){
                  CExtendedModeAction.this.action( ((CommonDockable)dockable).getDockable() );
                  return;
              }
             
              DockStation station = dockable.asDockStation();
              if( station == null ){
                return;
              }
              else{
                dockable = station.getFrontDockable();
              }
          }
        }
View Full Code Here

     * @param element some element
     * @return the first {@link CStation} that occurs on the path from
     * <code>element</code> to the root and which is a working area
     */
    private CStation<?> searchArea( DockElement element ){
        DockStation station = element.asDockStation();
        Dockable dockable = element.asDockable();
       
        while( dockable != null || station != null ){
            if( station != null && station instanceof CommonDockStation<?, ?>){
              CStation<?> cstation = ((CommonDockStation<?,?>)station).getStation();
                if( cstation.isWorkingArea() )
                    return cstation;
            }
           
            dockable = station == null ? null : station.asDockable();
            station = dockable == null ? null : dockable.getDockParent();
        }
        return null;
    }
View Full Code Here

        if( dockable instanceof CommonDockable ){
            if( getWorkingArea( dockable ) != area )
                return false;
        }
       
        DockStation station = dockable.asDockStation();
        if( station != null ){
          if( dockable instanceof CommonDockable ){
            CStation<?> cstation = ((CommonDockable)dockable).getStation();
            if( cstation != null && cstation.isWorkingArea() ){
              return true;
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.