public void setInsets(java.awt.Insets insets) { if (insets == null) { String message = Logging.getMessage("nullValue.InsetsIsNull"); Logging.logger().fine(message); throw new IllegalArgumentException(message); } // Class java.awt.Insets is known to override the method Object.clone(). this.insets = (java.awt.Insets) insets.clone(); }
public BlockBorder(Insets outerMargin, Insets innerMargin, Color aShade1, Color aShade2) { if (outerMargin == null) { outerMargin = EMPTY; } myOuterMargin = (Insets) outerMargin.clone(); myInsets = (Insets) outerMargin.clone(); myInsets.top += DEFAULT_INSETS.top; myInsets.left += DEFAULT_INSETS.left; myInsets.bottom += DEFAULT_INSETS.bottom; myInsets.right += DEFAULT_INSETS.right; if (innerMargin == null) { innerMargin = EMPTY; } myInsets.top += innerMargin.top; myInsets.left += innerMargin.left; myInsets.bottom += innerMargin.bottom; myInsets.right += innerMargin.right; myShade1 = aShade1; myShade2 = aShade2; }
@Override public Insets getBorderInsets(final Component c) { return (Insets) myInsets.clone(); }
/** * Returns the insets of the border. * * @param c the component for which this border insets value applies */ public Insets getBorderInsets(Component c) { return (Insets) borderInsets.clone(); }
/** * Returns margin taken from image content patches. * * @return margin taken from image content patches */ public Insets getMargin() { return (Insets) margin.clone(); }