Skip to content

Scale

final class Scale
Package: dev.joid.lib.render.transform · Module: core · Source: Scale.java

The factors of a scale in a Transformation, one per axis, fixed or read from a supplier.

1D keeps the size, 2D doubles it, a negative factor mirrors the drawing. Each factor is read each time the scale is applied.

ReturnsSignatureSummary
Scalecreate() factoryCreates a scale that keeps the size on every axis.
Scalecreate(double width, double height, double depth) factoryCreates a scale by width, height and depth along X, Y and Z.
Scalecreate(Supplier widthSupplier, Supplier heightSupplier, Supplier depthSupplier) factoryCreates a scale whose factors are read from the suppliers each time it is applied.

PropertyTypeDefaultSummary
width signaldouble1DThe factor along X: getWidth() reads it, width(double) fixes it, width(Supplier) reads it from a supplier.
height signaldouble1DThe factor along Y: getHeight() reads it, height(double) fixes it, height(Supplier) reads it from a supplier.
depth signaldouble1DThe factor along Z: getDepth() reads it, depth(double) fixes it, depth(Supplier) reads it from a supplier.

ReturnsSignatureSummary
Supplier<Double>getWidthSupplier()Returns the supplier of the X factor.
Supplier<Double>getHeightSupplier()Returns the supplier of the Y factor.
Supplier<Double>getDepthSupplier()Returns the supplier of the Z factor.

Scale create() factory

Creates a scale that keeps the size on every axis.

Scale create(double width, double height, double depth) factory

Creates a scale by width, height and depth along X, Y and Z.

Scale create(Supplier<Double> widthSupplier, Supplier<Double> heightSupplier, Supplier<Double> depthSupplier) factory

Creates a scale whose factors are read from the suppliers each time it is applied.

  • this width(double width) fluent
  • this width(Supplier<Double> widthSupplier) fluent signal
  • double getWidth()

Default: 1D

The factor along X: getWidth() reads it, width(double) fixes it, width(Supplier) reads it from a supplier.

  • this height(double height) fluent
  • this height(Supplier<Double> heightSupplier) fluent signal
  • double getHeight()

Default: 1D

The factor along Y: getHeight() reads it, height(double) fixes it, height(Supplier) reads it from a supplier.

  • this depth(double depth) fluent
  • this depth(Supplier<Double> depthSupplier) fluent signal
  • double getDepth()

Default: 1D

The factor along Z: getDepth() reads it, depth(double) fixes it, depth(Supplier) reads it from a supplier.

Supplier<Double> getWidthSupplier()

Returns the supplier of the X factor.

Supplier<Double> getHeightSupplier()

Returns the supplier of the Y factor.

Supplier<Double> getDepthSupplier()

Returns the supplier of the Z factor.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page