/** * Construct a new mouse region. * * @param in_origin The screen origin. * @param in_width The region width. * @param in_height The region height. * * @return A new mouse region. */ public static JCameraSphericalMouseRegion newRegion( final JCameraScreenOrigin in_origin, final float in_width, final float in_height) { return new JCameraSphericalMouseRegion(in_origin, in_width, in_height); }
/** * 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)); }
/** * Builds a new {@link JCameraSphericalMouseRegion JCameraSphericalMouseRegion}. * @return An immutable instance of JCameraSphericalMouseRegion * @throws java.lang.IllegalStateException if any required attributes are missing */ public JCameraSphericalMouseRegion build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return JCameraSphericalMouseRegion.validate(new JCameraSphericalMouseRegion(null, origin, width, height)); }