示例#1
0
 public static Insets getBorderStyles(final CSS2Properties properties) {
   final int topStyle = getBorderStyle(properties.getBorderTopStyle());
   final int rightStyle = getBorderStyle(properties.getBorderRightStyle());
   final int bottomStyle = getBorderStyle(properties.getBorderBottomStyle());
   final int leftStyle = getBorderStyle(properties.getBorderLeftStyle());
   return new Insets(topStyle, leftStyle, bottomStyle, rightStyle);
 }
示例#2
0
  public static BorderInfo getBorderInfo(
      final CSS2Properties properties, final RenderState renderState) {
    final BorderInfo binfo = new BorderInfo();

    binfo.topStyle = getBorderStyle(properties.getBorderTopStyle());
    binfo.rightStyle = getBorderStyle(properties.getBorderRightStyle());
    binfo.bottomStyle = getBorderStyle(properties.getBorderBottomStyle());
    binfo.leftStyle = getBorderStyle(properties.getBorderLeftStyle());

    final ColorFactory cf = ColorFactory.getInstance();
    final String topColorSpec = properties.getBorderTopColor();
    if (topColorSpec != null) {
      binfo.topColor = cf.getColor(topColorSpec);
    }
    final String rightColorSpec = properties.getBorderRightColor();
    if (rightColorSpec != null) {
      binfo.rightColor = cf.getColor(rightColorSpec);
    }
    final String bottomColorSpec = properties.getBorderBottomColor();
    if (bottomColorSpec != null) {
      binfo.bottomColor = cf.getColor(bottomColorSpec);
    }
    final String leftColorSpec = properties.getBorderLeftColor();
    if (leftColorSpec != null) {
      binfo.leftColor = cf.getColor(leftColorSpec);
    }

    HtmlValues.populateBorderInsets(binfo, properties, renderState);

    return binfo;
  }