Package org.apache.jetspeed.layout

Examples of org.apache.jetspeed.layout.Coordinate


        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


    }
   
    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

                            throw new WebApplicationException(new IllegalArgumentException("Layout fragment not found for the fragment: " + fragmentId));
                        }
                    }
                   
                    PortletPlacementContext ppc = new PortletPlacementContextImpl(contentPage, portletRegistry, layoutFragment);
                    Coordinate coordinate = new CoordinateImpl(0, 0, col, row);
                    ppc.moveAbsolute(contentFragment, coordinate);
                   
                    if (posHeight != -1.0f)
                    {
                        pageLayoutComponent.updatePosition(contentFragment, -1.0f, -1.0f, -1.0f, -1.0f, posHeight, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                    }
                   
                    // synchronize back to the page layout root fragment
                    contentPage = ppc.syncPageFragments(PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                    if (attach)
                      pageLayoutComponent.updateStateMode(contentFragment, JetspeedActions.NORMAL, null, PageLayoutComponent.USER_PROPERTY_SCOPE, null);                   
                }
                catch (Exception e)
                {
                    throw new WebApplicationException(e);
                }
            }
            else if (!StringUtils.isBlank(layoutFragmentId) && layoutFragmentId.equals("attach"))
            {
                pageLayoutComponent.updateStateMode(contentFragment, JetspeedActions.NORMAL, null, PageLayoutComponent.USER_PROPERTY_SCOPE, null);                   
            }           
        }
        else
        {
            float posX = NumberUtils.toFloat(posXParam, -1.0f);
            float posY = NumberUtils.toFloat(posYParam, -1.0f);
            float posZ = NumberUtils.toFloat(posZParam, -1.0f);
            float posWidth = NumberUtils.toFloat(posWidthParam, -1.0f);
            float posHeight = NumberUtils.toFloat(posHeightParam, -1.0f);
           
            try
            {
                pageLayoutComponent.updatePosition(contentFragment, posX, posY, posZ, posWidth, posHeight, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                pageLayoutComponent.updateStateMode(contentFragment, JetspeedActions.DETACH, null, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                if (layoutFragmentId != null && layoutFragmentId.equals("detach"))
                {
                    // first time detach, reallocate column and move it to the back
                    ContentFragment layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), fragmentId);                   
                    if (layoutFragment == null)
                    {
                        throw new WebApplicationException(new IllegalArgumentException("Layout fragment not found for the fragment: " + fragmentId));
                    }                   
                    PortletPlacementContext ppc = new PortletPlacementContextImpl(contentPage, portletRegistry, layoutFragment);
                    int col = contentFragment.getLayoutColumn();
                    int row = ppc.getNumberRows((col <= 0) ? 0 : col - 1);
                    Coordinate coordinate = new CoordinateImpl(col, contentFragment.getLayoutRow(), col, row);
                    ppc.moveAbsolute(contentFragment, coordinate);
                    contentPage = ppc.syncPageFragments(PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                }
            }
            catch (Exception e)
View Full Code Here

              ArrayList column = this.columnsList[colIndex];
              int colRowCount = column.size();
            for ( int rowIndex= 0; rowIndex < colRowCount; rowIndex++ )
            {
              ContentFragment fragment = (ContentFragment)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.updateRowColumn(rowIndex, colIndex, scope, scopeValue);
View Full Code Here

    }
   
    public int getFragmentRow( ContentFragment 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( ContentFragment 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

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.