/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalMouseRegionType#width() width} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for width * @return A modified copy of the {@code this} object */ public final JCameraSphericalMouseRegion withWidth(double value) { if (Double.doubleToLongBits(this.width) == Double.doubleToLongBits(value)) return this; return validate(new JCameraSphericalMouseRegion(this, this.origin, value, this.height)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalMouseRegionType#height() height} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for height * @return A modified copy of the {@code this} object */ public final JCameraSphericalMouseRegion withHeight(double value) { if (Double.doubleToLongBits(this.height) == Double.doubleToLongBits(value)) return this; return validate(new JCameraSphericalMouseRegion(this, this.origin, this.width, value)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalMouseRegionType#origin() origin} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for origin * @return A modified copy of the {@code this} object */ public final JCameraSphericalMouseRegion withOrigin(JCameraScreenOrigin value) { if (this.origin == value) return this; JCameraScreenOrigin newValue = Objects.requireNonNull(value, "origin"); return validate(new JCameraSphericalMouseRegion(this, newValue, this.width, this.height)); }
/** * Construct a new immutable {@code JCameraSphericalMouseRegion} instance. * @param origin The value for the {@code origin} attribute * @param width The value for the {@code width} attribute * @param height The value for the {@code height} attribute * @return An immutable JCameraSphericalMouseRegion instance */ public static JCameraSphericalMouseRegion of(JCameraScreenOrigin origin, double width, double height) { return validate(new JCameraSphericalMouseRegion(origin, width, height)); }