Examples of Space


Examples of org.apache.fop.area.inline.Space

                iAdjust += (int) ((double) (spaceRange.opt
                                          - spaceRange.min) * dSpaceAdjust);
            }
            if (iAdjust != 0) {
                //getLogger().debug("Add leading space: " + iAdjust);
                Space ls = new Space();
                ls.setIPD(iAdjust);
                parentArea.addChildArea(ls);
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.area.inline.Space

                    SpaceArea space = new SpaceArea(txt.charAt(0), offset, adjustable);
                    AbstractTextArea text = getCurrentText();
                    space.setParentArea(text);
                    text.addChildArea(space);
                } else {
                    Space space = new Space();
                    setAreaAttributes(lastAttributes, space);
                    setTraits(lastAttributes, space, SUBSET_COMMON);
                    setTraits(lastAttributes, space, SUBSET_BOX);
                    setTraits(lastAttributes, space, SUBSET_COLOR);
                    space.setOffset(offset);
                    Area parent = (Area)areaStack.peek();
                    parent.addChildArea(space);
                }
            }           
View Full Code Here

Examples of org.apache.fop.area.inline.Space

                // Shrink by factor
                iAdjust += (int) (spaceRange.getShrink() * spaceAdjust);
            }
            if (iAdjust != 0) {
                //getLogger().debug("Add leading space: " + iAdjust);
                Space ls = new Space();
                ls.setIPD(iAdjust);
                parentArea.addChildArea(ls);
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.area.inline.Space

                // Shrink by factor
                iAdjust += (int) (spaceRange.getShrink() * spaceAdjust);
            }
            if (iAdjust != 0) {
                //getLogger().debug("Add leading space: " + iAdjust);
                Space ls = new Space();
                ls.setIPD(iAdjust);
                int level = parentArea.getBidiLevel();
                if ( level >= 0 ) {
                    ls.setBidiLevel ( level );
                }
                parentArea.addChildArea(ls);
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.area.inline.Space

                    SpaceArea space = new SpaceArea(offset, level, content.charAt(0), adjustable);
                    AbstractTextArea text = getCurrentText();
                    space.setParentArea(text);
                    text.addChildArea(space);
                } else {
                    Space space = new Space();
                    setAreaAttributes(lastAttributes, space);
                    setTraits(lastAttributes, space, SUBSET_COMMON);
                    setTraits(lastAttributes, space, SUBSET_BOX);
                    setTraits(lastAttributes, space, SUBSET_COLOR);
                    space.setBlockProgressionOffset(offset);
                    Area parent = (Area)areaStack.peek();
                    parent.addChildArea(space);
                }
            }
View Full Code Here

Examples of org.apache.fop.area.inline.Space

                    = new org.apache.fop.area.inline.Leader();
                leader.setRuleStyle(fobj.getRuleStyle());
                leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
                leaderArea = leader;
            } else {
                leaderArea = new Space();
                if ( level >= 0 ) {
                    leaderArea.setBidiLevel ( level );
                }
            }
            leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
            leaderArea.addTrait(Trait.COLOR, fobj.getColor());
            if ( level >= 0 ) {
                leaderArea.setBidiLevel ( level );
            }
        } else if (fobj.getLeaderPattern() == EN_SPACE) {
            leaderArea = new Space();
            leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
            if ( level >= 0 ) {
                leaderArea.setBidiLevel ( level );
            }
        } else if (fobj.getLeaderPattern() == EN_DOTS) {
            TextArea t = new TextArea();
            char dot = '.'; // userAgent.getLeaderDotCharacter();
            int width = font.getCharWidth(dot);
            int[] levels = ( level < 0 ) ? null : new int[] {level};
            t.addWord("" + dot, width, null, levels, null, 0);
            t.setIPD(width);
            t.setBPD(width);
            t.setBaselineOffset(width);
            TraitSetter.addFontTraits(t, font);
            t.addTrait(Trait.COLOR, fobj.getColor());
            Space spacer = null;
            int widthLeaderPattern = fobj.getLeaderPatternWidth().getValue(this);
            if (widthLeaderPattern > width) {
                spacer = new Space();
                spacer.setIPD(widthLeaderPattern - width);
                if ( level >= 0 ) {
                    spacer.setBidiLevel ( level );
                }
                width = widthLeaderPattern;
            }
            FilledArea fa = new FilledArea();
            fa.setUnitWidth(width);
            fa.addChildArea(t);
            if (spacer != null) {
                fa.addChildArea(spacer);
            }
            fa.setBPD(t.getBPD());
            leaderArea = fa;
        } else if (fobj.getLeaderPattern() == EN_USECONTENT) {
            if (fobj.getChildNodes() == null) {
                InlineLevelEventProducer eventProducer = InlineLevelEventProducer.Provider.get(
                        getFObj().getUserAgent().getEventBroadcaster());
                eventProducer.leaderWithoutContent(this, getFObj().getLocator());
                return null;
            }

            // child FOs are assigned to the InlineStackingLM
            fobjIter = null;

            // get breaks then add areas to FilledArea
            FilledArea fa = new FilledArea();

            clm = new ContentLayoutManager(fa, this);
            addChildLM(clm);

            InlineLayoutManager lm;
            lm = new InlineLayoutManager(fobj);
            clm.addChildLM(lm);
            lm.initialize();

            LayoutContext childContext = new LayoutContext(0);
            childContext.setAlignmentContext(context.getAlignmentContext());
            contentList = clm.getNextKnuthElements(childContext, 0);
            int width = clm.getStackingSize();
            if (width != 0) {
                Space spacer = null;
                if (fobj.getLeaderPatternWidth().getValue(this) > width) {
                    spacer = new Space();
                    spacer.setIPD(fobj.getLeaderPatternWidth().getValue(this) - width);
                    if ( level >= 0 ) {
                        spacer.setBidiLevel ( level );
                    }
                    width = fobj.getLeaderPatternWidth().getValue(this);
                }
                fa.setUnitWidth(width);
                if (spacer != null) {
                    fa.addChildArea(spacer);
                }
                leaderArea = fa;
            } else {
                //Content collapsed to nothing, so use a space
                leaderArea = new Space();
                leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
                leaderArea.setBidiLevel ( fobj.getBidiLevelRecursive() );
            }
        }
        TraitSetter.setProducerID(leaderArea, fobj.getId());
View Full Code Here

Examples of org.apache.fop.datatypes.Space

    protected Property convertProperty(Property p, PropertyList propertyList,
               FObj fo) {
      Length val = p.getLength();
      if (val != null)
  return new SpaceProperty(new Space(val));
      return convertPropertyDatatype(p, propertyList, fo);
    }
View Full Code Here

Examples of org.apache.jetspeed.spaces.Space

    else
    {
      spaceName = request.getParameter("delete");
      if (spaceName != null)
      {
        Space space = spacesService.lookupSpace(spaceName);
       
        if (space != null)
        {
          try
          {
View Full Code Here

Examples of org.apache.jetspeed.spaces.Space

    @SuppressWarnings("unchecked")
    public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException
    {
      Space space = null;
      SpaceBean spaceBean = null;
        String current = (String)PortletMessaging.receive(request, SpacesManager.MSG_TOPIC_SPACE_LIST, SpacesManager.MSG_SPACE_CHANGE);               
        if (current != null)
        {
            // FIXME: lookupSpace() can find system spaces only, not user space.
View Full Code Here

Examples of org.apache.jetspeed.spaces.Space

       
        if (isCanceled)
        {
            try
            {
                Space space = null;
               
                if (!"".equals(name))
                {
                    space = spacesService.lookupSpace(name);
                   
                    if (space == null)
                    {
                        space = spacesService.lookupUserSpace(name);
                    }
                }
               
                String path = admin.getPortalURL(actionRequest, actionResponse, (space != null ? space.getPath() : "/"));
                actionResponse.sendRedirect(path);
                return;
            }
            catch (Exception e)
            {
                log.error("Failed to retrieve space.", e);
            }
        }
       
        if ("".equals(name))
        {
            return;
        }
       
        try
        {
            if (isNew)
          {
            // TODO: better validation
            String spaceName = name.replace(' ', '_');               
                String templateFolderPath = actionRequest.getPreferences().getValue(SPACE_TEMPLATE, DEFAULT_SPACE_TEMPLATE);              
                if (!pageManager.folderExists(templateFolderPath))
                {
                    throw new PortletException("Space template folder does not exist: " + templateFolderPath);
                }
               
                Folder templateFolder = pageManager.getFolder(templateFolderPath);
                String owner = actionRequest.getUserPrincipal().getName();
                try
                {
                    userManager.getUser(owner);
                }
                catch (SecurityException notFoundEx)
                {
                    throw new PortletException("Space owner is not found: " + owner);
                }
               
                Space space = spacesService.createSpace(spaceName, owner, templateFolder, title, title, description, theme, constraint);
                // redirect
                String path = admin.getPortalURL(actionRequest, actionResponse, space.getPath());
                actionResponse.sendRedirect(path);
          }
          else
          {
                String owner = scrapeParameter(actionRequest, "spaceOwner");
                // FIXME: lookupSpace() can find system spaces only, not user space.
                //        So, what if a system space name is as same as a user space name?
                Space space = spacesService.lookupSpace(name);
               
                if (space == null)
                {
                    space = spacesService.lookupUserSpace(name);
                }
               
                if (space != null)
                {
                space.setDescription(description);
                space.setTitle(title);
                space.setShortTitle(title);
                  space.setTheme(theme);
                 
                  if (constraint.equals(""))
                  {
                    String old = space.getSecurityConstraint();
                    if (old != null)
                    {
                      if (!"".equals(old))
                        space.setSecurityConstraint(constraint);                       
                    }
                     
                  }
                  else
                  {
                    space.setSecurityConstraint(constraint);
                  }
                 
                  if (owner != null && !owner.equals(space.getOwner()))
                  {
                        try
                        {
                            userManager.getUser(owner);
                        }
                        catch (SecurityException notFoundEx)
                        {
                            throw new PortletException("Space owner is not found: " + owner);
                        }
                        space.setOwner(owner);
                  }
                 
                  spacesService.storeSpace(space);
                }
               
                // redirect
                String path = admin.getPortalURL(actionRequest, actionResponse, space.getPath());
                actionResponse.sendRedirect(path);
          }
           
            PortletMessaging.publish(actionRequest, SpacesManager.MSG_TOPIC_SPACE_LIST, SpacesManager.MSG_SPACE_CHANGE, name);               
            PortletMessaging.publish(actionRequest, SpacesManager.MSG_TOPIC_SPACE_NAV, SpacesManager.MSG_SPACE_CHANGE, name);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.