Java Code Examples for com.lowagie.text.Rectangle#BOX

The following examples show how to use com.lowagie.text.Rectangle#BOX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RtfBorderGroup.java    From itext2 with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Adds borders to the RtfBorderGroup
 * 
 * @param bordersToAdd The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX)
 * @param borderStyle The style of border to add (from RtfBorder)
 * @param borderWidth The border width to use
 * @param borderColor The border color to use
 */
public void addBorder(int bordersToAdd, int borderStyle, float borderWidth, Color borderColor) {
    if((bordersToAdd & Rectangle.LEFT) == Rectangle.LEFT) {
        setBorder(RtfBorder.LEFT_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.TOP) == Rectangle.TOP) {
        setBorder(RtfBorder.TOP_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.RIGHT) == Rectangle.RIGHT) {
        setBorder(RtfBorder.RIGHT_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.BOTTOM) == Rectangle.BOTTOM) {
        setBorder(RtfBorder.BOTTOM_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.BOX) == Rectangle.BOX && this.borderType == RtfBorder.ROW_BORDER) {
        setBorder(RtfBorder.VERTICAL_BORDER, borderStyle, borderWidth, borderColor);
        setBorder(RtfBorder.HORIZONTAL_BORDER, borderStyle, borderWidth, borderColor);
    }
}
 
Example 2
Source File: RtfBorderGroup.java    From itext2 with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Removes borders from the list of borders
 * 
 * @param bordersToRemove The borders to remove (from Rectangle)
 */
public void removeBorder(int bordersToRemove) {
    if((bordersToRemove & Rectangle.LEFT) == Rectangle.LEFT) {
        this.borders.remove(Integer.valueOf(RtfBorder.LEFT_BORDER));
    }
    if((bordersToRemove & Rectangle.TOP) == Rectangle.TOP) {
        this.borders.remove(Integer.valueOf(RtfBorder.TOP_BORDER));
    }
    if((bordersToRemove & Rectangle.RIGHT) == Rectangle.RIGHT) {
        this.borders.remove(Integer.valueOf(RtfBorder.RIGHT_BORDER));
    }
    if((bordersToRemove & Rectangle.BOTTOM) == Rectangle.BOTTOM) {
        this.borders.remove(Integer.valueOf(RtfBorder.BOTTOM_BORDER));
    }
    if((bordersToRemove & Rectangle.BOX) == Rectangle.BOX && this.borderType == RtfBorder.ROW_BORDER) {
        this.borders.remove(Integer.valueOf(RtfBorder.VERTICAL_BORDER));
        this.borders.remove(Integer.valueOf(RtfBorder.HORIZONTAL_BORDER));
    }
}
 
Example 3
Source File: PatchRtfBorderGroup.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Adds borders to the PatchRtfBorderGroup
 *
 * @param bordersToAdd
 *          The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX)
 * @param borderStyle
 *          The style of border to add (from PatchRtfBorder)
 * @param borderWidth
 *          The border width to use
 * @param borderColor
 *          The border color to use
 */
public void addBorder( int bordersToAdd, int borderStyle, float borderWidth, Color borderColor ) {
  if ( ( bordersToAdd & Rectangle.LEFT ) == Rectangle.LEFT ) {
    setBorder( PatchRtfBorder.LEFT_BORDER, borderStyle, borderWidth, borderColor );
  }
  if ( ( bordersToAdd & Rectangle.TOP ) == Rectangle.TOP ) {
    setBorder( PatchRtfBorder.TOP_BORDER, borderStyle, borderWidth, borderColor );
  }
  if ( ( bordersToAdd & Rectangle.RIGHT ) == Rectangle.RIGHT ) {
    setBorder( PatchRtfBorder.RIGHT_BORDER, borderStyle, borderWidth, borderColor );
  }
  if ( ( bordersToAdd & Rectangle.BOTTOM ) == Rectangle.BOTTOM ) {
    setBorder( PatchRtfBorder.BOTTOM_BORDER, borderStyle, borderWidth, borderColor );
  }
  if ( ( bordersToAdd & Rectangle.BOX ) == Rectangle.BOX && this.borderType == PatchRtfBorder.ROW_BORDER ) {
    setBorder( PatchRtfBorder.VERTICAL_BORDER, borderStyle, borderWidth, borderColor );
    setBorder( PatchRtfBorder.HORIZONTAL_BORDER, borderStyle, borderWidth, borderColor );
  }
}
 
Example 4
Source File: PatchRtfBorderGroup.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Removes borders from the list of borders
 *
 * @param bordersToRemove
 *          The borders to remove (from Rectangle)
 */
public void removeBorder( int bordersToRemove ) {
  if ( ( bordersToRemove & Rectangle.LEFT ) == Rectangle.LEFT ) {
    this.borders.remove( new Integer( PatchRtfBorder.LEFT_BORDER ) );
  }
  if ( ( bordersToRemove & Rectangle.TOP ) == Rectangle.TOP ) {
    this.borders.remove( new Integer( PatchRtfBorder.TOP_BORDER ) );
  }
  if ( ( bordersToRemove & Rectangle.RIGHT ) == Rectangle.RIGHT ) {
    this.borders.remove( new Integer( PatchRtfBorder.RIGHT_BORDER ) );
  }
  if ( ( bordersToRemove & Rectangle.BOTTOM ) == Rectangle.BOTTOM ) {
    this.borders.remove( new Integer( PatchRtfBorder.BOTTOM_BORDER ) );
  }
  if ( ( bordersToRemove & Rectangle.BOX ) == Rectangle.BOX && this.borderType == PatchRtfBorder.ROW_BORDER ) {
    this.borders.remove( new Integer( PatchRtfBorder.VERTICAL_BORDER ) );
    this.borders.remove( new Integer( PatchRtfBorder.HORIZONTAL_BORDER ) );
  }
}