/** * 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 JCameraFPSStyleMouseRegion newRegion( final JCameraScreenOrigin in_origin, final float in_width, final float in_height) { return new JCameraFPSStyleMouseRegion(in_origin, in_width, in_height); }
/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#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 JCameraFPSStyleMouseRegion withHeight(double value) { if (Double.doubleToLongBits(this.height) == Double.doubleToLongBits(value)) return this; return validate(new JCameraFPSStyleMouseRegion(this, this.origin, this.width, value)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#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 JCameraFPSStyleMouseRegion withOrigin(JCameraScreenOrigin value) { if (this.origin == value) return this; JCameraScreenOrigin newValue = Objects.requireNonNull(value, "origin"); return validate(new JCameraFPSStyleMouseRegion(this, newValue, this.width, this.height)); }
/** * Construct a new immutable {@code JCameraFPSStyleMouseRegion} 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 JCameraFPSStyleMouseRegion instance */ public static JCameraFPSStyleMouseRegion of(JCameraScreenOrigin origin, double width, double height) { return validate(new JCameraFPSStyleMouseRegion(origin, width, height)); }
/** * Copy the current immutable object by setting a value for the {@link JCameraFPSStyleMouseRegionType#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 JCameraFPSStyleMouseRegion withWidth(double value) { if (Double.doubleToLongBits(this.width) == Double.doubleToLongBits(value)) return this; return validate(new JCameraFPSStyleMouseRegion(this, this.origin, value, this.height)); }
/** * Builds a new {@link JCameraFPSStyleMouseRegion JCameraFPSStyleMouseRegion}. * @return An immutable instance of JCameraFPSStyleMouseRegion * @throws java.lang.IllegalStateException if any required attributes are missing */ public JCameraFPSStyleMouseRegion build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return JCameraFPSStyleMouseRegion.validate(new JCameraFPSStyleMouseRegion(null, origin, width, height)); }