Package org.apache.jetspeed.layout

Examples of org.apache.jetspeed.layout.Coordinate


            fragmentProperties.put( DESKTOP_EXTENDED, posExtended );
        }
               
        // add fragment
        PortletPlacementContext placement = new PortletPlacementContextImpl( requestContext, placeInLayoutFragment, 1 );
        Coordinate returnCoordinate = placement.add( placeFragment, getCoordinateFromParams( requestContext ) );
        Page page = placement.syncPageFragments();

        placeInLayoutFragment.getFragments().add( placeFragment );
        if ( pageManager != null && ! batch )
        {
            pageManager.updatePage( page );
        }

        // Need to determine what the old col and row were
        resultMap.put( OLDCOL, String.valueOf( returnCoordinate.getOldCol() ) );
        resultMap.put( OLDROW, String.valueOf( returnCoordinate.getOldRow() ) );
        // Need to determine what the new col and row were
        resultMap.put( NEWCOL, String.valueOf( returnCoordinate.getNewCol() ) );
        resultMap.put( NEWROW, String.valueOf( returnCoordinate.getNewRow() ) );

        return success;
    }
View Full Code Here


        if ( a_sRow != null )
        {
            a_iRow = Integer.parseInt( a_sRow );
        }

        Coordinate a_oCoordinate = new CoordinateImpl( 0, 0, a_iCol, a_iRow );
        return a_oCoordinate;
    }
View Full Code Here

    {
      boolean success = true;

      String moveFragmentId = fragment.getId();
      boolean addFragment = (placeInLayoutFragment != null);
        Coordinate returnCoordinate = null;
        float oldX = 0f, oldY = 0f, oldZ = 0f, oldWidth = 0f, oldHeight = 0f;
        float x = -1f, y = -1f, z = -1f, width = -1f, height = -1f;
        boolean absHeightChanged = false;

        // desktop extended
        String posExtended = getActionParameter( requestContext, DESKTOP_EXTENDED );
        if ( posExtended != null )
        {
            Map fragmentProperties = fragment.getProperties();
            if ( fragmentProperties == null )
            {
                success = false;
                resultMap.put(REASON, "Failed to acquire fragment properties map for portlet id: " + moveFragmentId );
                return success;
            }
            String oldDeskExt = (String)fragmentProperties.get( DESKTOP_EXTENDED );
            resultMap.put( OLD_DESKTOP_EXTENDED, ( (oldDeskExt != null) ? oldDeskExt : "" ) );
            fragmentProperties.put( DESKTOP_EXTENDED, posExtended );
        }
               
        // only required for moveabs
        if ( iMoveType == ABS )
        {
            Coordinate newCoordinate = getCoordinateFromParams( requestContext );
            returnCoordinate = placement.moveAbsolute( fragment, newCoordinate, addFragment );
            String sHeight = getActionParameter( requestContext, HEIGHT );
            if ( sHeight != null && sHeight.length() > 0 )
            {
                oldHeight = fragment.getLayoutHeight();
View Full Code Here

        if ( a_sRow != null )
        {
            a_iRow = Integer.parseInt( a_sRow );
        }

        Coordinate a_oCoordinate = new CoordinateImpl( 0, 0, a_iCol, a_iRow );
        return a_oCoordinate;
    }
View Full Code Here

              ArrayList column = this.columnsList[colIndex];
              int colRowCount = column.size();
            for ( int rowIndex= 0; rowIndex < colRowCount; rowIndex++ )
            {
              Fragment fragment = (Fragment)column.get( rowIndex );
                  Coordinate coordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
                  boolean needsReplacementCoordinate = false;
                 
                  if ( getLatestColumn( coordinate ) != colIndex || getLatestRow( coordinate ) != rowIndex )
                    needsReplacementCoordinate = true;

                  if ( needsReplacementCoordinate )
              {
                Coordinate replacementCoordinate = new CoordinateImpl( coordinate.getOldCol(), coordinate.getOldRow(), colIndex, rowIndex );
                this.fragmentCoordinateMap.put( fragment.getId(), replacementCoordinate );
              }
              if ( updateFragmentObjects )
                  {
                    fragment.setLayoutColumn( colIndex );
View Full Code Here

    }
   
    public int getFragmentRow( Fragment fragment )
    {
      if ( fragment == null ) return -1;
    Coordinate coordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
     
    if ( coordinate == null )
      return -1;
    if ( coordinate.getNewRow() >= )
      return coordinate.getNewRow();
    return coordinate.getOldRow();
    }
View Full Code Here

    }
   
    public int getFragmentCol( Fragment fragment )
    {
      if ( fragment == null ) return -1;
    Coordinate coordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
     
    if ( coordinate == null )
      return -1;
    if ( coordinate.getNewCol() >= )
      return coordinate.getNewCol();
    return coordinate.getOldCol();
    }
View Full Code Here

        throws PortletPlacementException
    {
    if ( fragment == null )
        throw new NullPointerException( "PortletPlacementContext moveAbsolute() cannot accept a null Fragment argument" );

    Coordinate currentCoordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
    int currentCol = getLatestColumn( currentCoordinate );
    int currentRow = getLatestRow( currentCoordinate );
   
    int newCol = normalizeColumnIndex( getLatestColumn( newCoordinate ), this.columnsList, currentCol );
    int newRow = getLatestRow( newCoordinate );
View Full Code Here

    if ( fragment == null )
        throw new NullPointerException( "PortletPlacementContext moveDirection() cannot accept a null Fragment argument" );

    if ( deltaCol != 0 || deltaRow != 0 )
    {
      Coordinate currentCoordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
      if ( currentCoordinate == null )
        throw new NullPointerException( "PortletPlacementContext moveDirection() cannot locate target fragment (" + fragment.getId() + ")" );
 
      int currentCol = getLatestColumn( currentCoordinate );
      int currentRow = getLatestRow( currentCoordinate );
View Full Code Here

  public Coordinate remove( Fragment fragment ) throws PortletPlacementException
    {
    if ( fragment == null )
        throw new NullPointerException( "PortletPlacementContext remove() cannot accept a null Fragment argument" );
   
    Coordinate currentCoordinate = (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
    if ( currentCoordinate == null )
      throw new NullPointerException( "PortletPlacementContext remove() cannot locate target fragment (" + fragment.getId() + ")" );

    int currentCol = getLatestColumn( currentCoordinate );
    int currentRow = getLatestRow( currentCoordinate );
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.layout.Coordinate

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.