com.mapinfo.midev.style

## Class BoxBackground

- java.lang.Object
- - com.mapinfo.midev.style.BoxBackground

All Implemented Interfaces:
  Serializable

    public final class BoxBackground
    extends Object
    implements Serializable

`BoxBackground` defines the box around the label text. The box outline is the computed envelope of the label text which is further separated from the text by paperLength margin.

See Also:
  Serialized Form

### Field Summary

Fields
`static BoxBackground` `NONE` Constant that indicates to the renderer that a `BoxBackground` is not to be drawn.

### Constructor Summary

Constructors
Constructor and Description
`BoxBackground(IAreaStyle areaStyle, PaperLength xMargin, PaperLength yMargin)` Constructs a new `BoxBackground` object with styles and margins.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`IAreaStyle` `getAreaStyle()` Returns the `IAreaStyle` used to draw the `BoxBackground` with.
`PaperLength` `getXMargin()` Returns the x margin.
`PaperLength` `getYMargin()` Returns the y margin
`int` `hashCode()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### NONE

    public static final BoxBackground NONE

Constant that indicates to the renderer that a `BoxBackground` is not to be drawn.

### Constructor Detail

#### BoxBackground

    public BoxBackground(IAreaStyle areaStyle,
                         PaperLength xMargin,
                         PaperLength yMargin)

Constructs a new `BoxBackground` object with styles and margins.

This constructor creates a safe copy of the `IAreaStyle` so that changing it does not affect the `BoxBackground` object.

Parameters:
  `areaStyle` - the style of the box border and the fill.
  `xMargin` - the x margin in paper length.
  `yMargin` - the y margin in paper length.
Throws:
  `IllegalArgumentException` - if areaStyle, xMargin, yMargin are null or xMargin or yMargin < 0.

### Method Detail

#### getAreaStyle

    public IAreaStyle getAreaStyle()

Returns the `IAreaStyle` used to draw the `BoxBackground` with. The `IAreaStyle` returned is a copy so changes to the returned `IAreaStyle` will not be reflected in the `BoxBackground`'s `IAreaStyle`.

Returns:
  the `IAreaStyle` used to draw the `BoxBackground` with.

#### getXMargin

    public PaperLength getXMargin()

Returns the x margin.

Returns:
  the xMargin.

#### getYMargin

    public PaperLength getYMargin()

Returns the y margin

Returns:
  the yMargin.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`