Package org.jfree.layouting.input.style.values

Examples of org.jfree.layouting.input.style.values.CSSValue


  public void appyStyle(final LayoutContext context, final OutputProcessorMetaData metaData)
  {
    this.layoutProperties.setAlignmentBaseline
        (context.getValue(LineStyleKeys.ALIGNMENT_BASELINE));
    final CSSValue alignmentAdjust = context.getValue(LineStyleKeys.ALIGNMENT_ADJUST);
    this.layoutProperties.setAlignmentAdjust(alignmentAdjust);
    if (alignmentAdjust instanceof CSSNumericValue)
    {
      this.layoutProperties.setAlignmentAdjustResolved
          (RenderLength.convertToInternal (alignmentAdjust, context, metaData));
    }
    final CSSValue baselineShift = context.getValue(LineStyleKeys.BASELINE_SHIFT);
    this.layoutProperties.setBaselineShift(baselineShift);
    if (baselineShift instanceof CSSNumericValue)
    {
      this.layoutProperties.setBaselineShiftResolved(
          RenderLength.convertToInternal(baselineShift, context, metaData));
View Full Code Here


      final ComputedToken parent = stringToken.getParent();
      if (parent instanceof VariableToken)
      {
        final VariableToken vt = (VariableToken) parent;
        final String variable = vt.getVariable();
        final CSSValue stringPolicy = documentContext.getStringPolicy(variable);
        return pageContext.getString(variable, stringPolicy);
      }
    }
    else if (resolvedToken instanceof ResolvedCounterToken)
    {
      final ResolvedCounterToken ct = (ResolvedCounterToken) resolvedToken;
      final CounterToken parent = ct.getParent();
      final String name = parent.getName();
      final CounterStyle style = parent.getStyle();
      final CSSValue counterPolicy = documentContext.getCounterPolicy(name);
      final Integer counterValue = pageContext.getCounter(name, counterPolicy);
      return style.getCounterValue(counterValue.intValue());
    }

    return resolvedToken.getText();
View Full Code Here

    if (baselineInfo == null)
    {
      baselineInfo = box.getNominalBaselineInfo();
    }

    final CSSValue dominantBaselineValue = box.getDominantBaseline();
    setDominantBaseline(TextUtility.translateDominantBaseline
        (dominantBaselineValue, baselineInfo.getDominantBaseline()));

    final ComputedLayoutProperties blp = box.getComputedLayoutProperties();
    insetsTop = blp.getBorderTop() + blp.getPaddingTop();
View Full Code Here

        // todo: Allow to select other than the first baseline ..
      }

      BoxAlignContext parent = box;
      final CSSValue verticalAlignment = child.getNode().getVerticalAlignment();
      if (VerticalAlign.TOP.equals(verticalAlignment) ||
          VerticalAlign.BOTTOM.equals(verticalAlignment))
      {
        // Those alignments ignore the normal alignment rules and all boxes
        // align themself on the extended linebox.
View Full Code Here

  }

  private long computeShift(final AlignContext child, final BoxAlignContext box)
  {
    final RenderNode node = child.getNode();
    final CSSValue baselineShift = node.getBaselineShift();

    if (baselineShift == null ||
        BaselineShift.BASELINE.equals(baselineShift))
    {
      return 0;
View Full Code Here

                                       final int defaultBaseLine)
  {
    // This is a length value and defines the ASCENT that is used as
    // alignment position.
    final RenderNode node = context.getNode();
    final CSSValue alignmentAdjust = node.getAlignmentAdjust();
    if (CSSAutoValue.getInstance().equals(alignmentAdjust))
    {
      return context.getBaselineDistance(defaultBaseLine);
    }
    if (alignmentAdjust instanceof CSSConstant)
View Full Code Here

  {
    // Aligns elements with vertical-align TOP and vertical-align BOTTOM
    AlignContext child = box.getFirstChild();
    while (child != null)
    {
      final CSSValue verticalAlignment = child.getNode().getVerticalAlignment();
      if (VerticalAlign.TOP.equals(verticalAlignment))
      {
        final long childTopEdge = child.getBeforeEdge();
        final long parentTopEdge = lineBox.getBeforeEdge();
        child.shift(parentTopEdge - childTopEdge);
View Full Code Here

  {
    final StyleKey[] styleKeys = source.getPropertyKeysAsArray();
    for (int i = 0; i < styleKeys.length; i++)
    {
      final StyleKey key = styleKeys[i];
      final CSSValue value = source.getPropertyCSSValue(key);
      if (value == null)
      {
        continue;
      }
View Full Code Here

        final StyleKey keyByName =
            StyleKeyRegistry.getRegistry().findKeyByName(name);

        if (value instanceof CSSValue)
        {
          final CSSValue cssvalue = (CSSValue) value;
          if (keyByName != null)
          {
            targetRule.setPropertyValue(keyByName, cssvalue);
          }
          else
          {
            targetRule.setPropertyValueAsString(name, cssvalue.getCSSText());
          }
        }
        else if (value != null)
        {
          targetRule.setPropertyValueAsString(name, String.valueOf(value));
View Full Code Here

    {
      final PageSize defaultVal = metaData.getDefaultPageSize();
      return defaultVal;
    }
    final CSSValuePair valuePair = (CSSValuePair) sizeVal;
    final CSSValue firstValue = valuePair.getFirstValue();
    if (firstValue instanceof CSSNumericValue == false)
    {
      final PageSize defaultVal = metaData.getDefaultPageSize();
      return defaultVal;
    }
    final CSSValue secondValue = valuePair.getSecondValue();
    if (secondValue instanceof CSSNumericValue == false)
    {
      final PageSize defaultVal = metaData.getDefaultPageSize();
      return defaultVal;
    }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.values.CSSValue

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.