Exemple #1
0
 /**
  * Populates {@link BorderInfo.insets}.
  *
  * @param binfo A BorderInfo with its styles already populated.
  * @param cssProperties The CSS properties object.
  * @param renderState The current render state.
  */
 public static void populateBorderInsets(
     final BorderInfo binfo, final CSS2Properties cssProperties, final RenderState renderState) {
   HtmlInsets insets = null;
   if (binfo.topStyle != HtmlValues.BORDER_STYLE_NONE) {
     final String topText = cssProperties.getBorderTopWidth();
     insets = updateTopInset(insets, topText, renderState);
   }
   if (binfo.leftStyle != HtmlValues.BORDER_STYLE_NONE) {
     final String leftText = cssProperties.getBorderLeftWidth();
     insets = updateLeftInset(insets, leftText, renderState);
   }
   if (binfo.bottomStyle != HtmlValues.BORDER_STYLE_NONE) {
     final String bottomText = cssProperties.getBorderBottomWidth();
     insets = updateBottomInset(insets, bottomText, renderState);
   }
   if (binfo.rightStyle != HtmlValues.BORDER_STYLE_NONE) {
     final String rightText = cssProperties.getBorderRightWidth();
     insets = updateRightInset(insets, rightText, renderState);
   }
   binfo.insets = insets;
 }
Exemple #2
0
 public static HtmlInsets getBorderInsets(
     final Insets borderStyles,
     final CSS2Properties cssProperties,
     final RenderState renderState) {
   HtmlInsets insets = null;
   if (borderStyles.top != HtmlValues.BORDER_STYLE_NONE) {
     final String topText = cssProperties.getBorderTopWidth();
     insets = updateTopInset(insets, topText, renderState);
   }
   if (borderStyles.left != HtmlValues.BORDER_STYLE_NONE) {
     final String leftText = cssProperties.getBorderLeftWidth();
     insets = updateLeftInset(insets, leftText, renderState);
   }
   if (borderStyles.bottom != HtmlValues.BORDER_STYLE_NONE) {
     final String bottomText = cssProperties.getBorderBottomWidth();
     insets = updateBottomInset(insets, bottomText, renderState);
   }
   if (borderStyles.right != HtmlValues.BORDER_STYLE_NONE) {
     final String rightText = cssProperties.getBorderRightWidth();
     insets = updateRightInset(insets, rightText, renderState);
   }
   return insets;
 }