A trait for graphical elements that can undergo transformations like translation, scaling, and rotation.
Type parameters
- TransformableType
-
The type of the transformable object.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Picturetrait PictureElementclass AnimatedPicturetrait DrawableElementclass Bitmaptrait VectorGraphicclass Arcclass Pointclass ReferencePointclass Polygonclass TextShow all
Members list
Type members
Classlikes
Represents an element with its coordinates, used for positioning elements at specific locations.
Represents an element with its coordinates, used for positioning elements at specific locations.
Value parameters
- element
-
The picture element to be positioned.
- x
-
The x-coordinate in pixels for positioning.
- y
-
The y-coordinate in pixels for positioning.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Abstract methods
Creates a copy of this transformable object positioned at the specified coordinates.
Creates a copy of this transformable object positioned at the specified coordinates.
Value parameters
- newPosition
-
The new position for the copied object.
Attributes
- Returns
-
A new instance of the transformable object at the specified position.
Rotates this object around a specified point by a given angle.
Rotates this object around a specified point by a given angle.
Value parameters
- angle
-
The angle in degrees to rotate the object.
- centerOfRotation
-
The point around which the object is rotated.
Attributes
- Returns
-
A new instance of the transformable object rotated by the specified angle.
Rotates the transformable object around its center by a specified angle in degrees.
Rotates the transformable object around its center by a specified angle in degrees.
Value parameters
- angle
-
The angle in degrees to rotate the object.
Attributes
- Returns
-
A new instance of the transformable object rotated by the specified angle.
Scales this object by given horizontal and vertical factors in relation to its center.
Scales this object by given horizontal and vertical factors in relation to its center.
Value parameters
- horizontalFactor
-
The factor by which to scale the object horizontally.
- verticalFactor
-
The factor by which to scale the object vertically.
Attributes
- Returns
-
A new instance of the transformable object scaled by the specified factors.
Scales this object by given horizontal and vertical factors in relation to a specified point.
Scales this object by given horizontal and vertical factors in relation to a specified point.
Value parameters
- horizontalFactor
-
The factor by which to scale the object horizontally.
- relativityPoint
-
The point in relation to which the object is scaled.
- verticalFactor
-
The factor by which to scale the object vertically.
Attributes
- Returns
-
A new instance of the transformable object scaled by the specified factors.
Concrete methods
Adds another transformable object at specified coordinates and position type.
Adds another transformable object at specified coordinates and position type.
Value parameters
- contentsAndCoordinates
-
A sequence of elements with their corresponding positions.
- positionType
-
The type of position reference (e.g., center or upper left corner).
Attributes
- Returns
-
A picture with the added content.
Adds another transformable object at a specified position.
Adds another transformable object at a specified position.
Value parameters
- contentAndCoordinates
-
The element and its position.
- positionType
-
The type of position reference.
Attributes
- Returns
-
A picture with the added content.
Adds another transformable object at a specified position.
Adds another transformable object at a specified position.
Value parameters
- content
-
The content to add.
- positionType
-
The type of position reference.
- x
-
The x-coordinate in pixels for the new position.
- y
-
The y-coordinate in pixels for the new position.
Attributes
- Returns
-
A picture with the added content.
Adds content to a specified side of this object, optionally with padding.
Adds content to a specified side of this object, optionally with padding.
Value parameters
- alignment
-
The alignment of the added content relative to the target side.
- content
-
The content to add.
- padding
-
The padding in pixels between the existing content and the added content.
- targetSide
-
The side to add content to (Top, Bottom, Left, Right).
Attributes
- Returns
-
A picture with the content added to the specified side.
Adds the given transformable object to the back of this object.
Adds the given transformable object to the back of this object.
Value parameters
- toAppend
-
The object to add to the back.
Attributes
- Returns
-
A picture with the object added to the back.
Adds content below this object, optionally with padding and horizontal alignment.
Adds content below this object, optionally with padding and horizontal alignment.
Value parameters
- alignment
-
The horizontal alignment of the added content.
- content
-
The content to add below this object.
- padding
-
The padding in pixels below this object.
Attributes
- Returns
-
A picture with the content added below.
Adds the given transformable object to the front of this object.
Adds the given transformable object to the front of this object.
Value parameters
- toPrepend
-
The object to add to the front.
Attributes
- Returns
-
A picture with the object added to the front.
Adds content to the left of this object, optionally with padding and vertical alignment.
Adds content to the left of this object, optionally with padding and vertical alignment.
Value parameters
- alignment
-
The vertical alignment of the added content.
- content
-
The content to add to the left.
- padding
-
The padding in pixels to the left of this object.
Attributes
- Returns
-
A picture with the content added to the left.
Adds content to the right of this object, optionally with padding and vertical alignment.
Adds content to the right of this object, optionally with padding and vertical alignment.
Value parameters
- alignment
-
The vertical alignment of the added content.
- content
-
The content to add to the right.
- padding
-
The padding in pixels to the right of this object.
Attributes
- Returns
-
A picture with the content added to the right.
Adds content above this object, optionally with padding and alignment.
Adds content above this object, optionally with padding and alignment.
Value parameters
- alignment
-
The horizontal alignment of the added content.
- content
-
The content to add above this object.
- padding
-
The padding in pixels above this object.
Attributes
- Returns
-
A picture with the content added above.
Alternates adding transformable objects downwards from this object.
Alternates adding transformable objects downwards from this object.
Value parameters
- alignment
-
The horizontal alignment for each added object.
- alternatives
-
A sequence of transformable objects to alternate with.
- numberOfAlternations
-
The number of times to alternate additions.
- padding
-
The vertical space between each added object.
Attributes
- Returns
-
A picture with the alternated additions applied.
- See also
Alternates adding transformable objects leftwards from this object.
Alternates adding transformable objects leftwards from this object.
Value parameters
- alignment
-
The vertical alignment for each added object.
- alternatives
-
A sequence of transformable objects to alternate with.
- numberOfAlternations
-
The number of times to alternate additions.
- padding
-
The horizontal space between each added object.
Attributes
- Returns
-
A picture with the alternated additions applied.
- See also
Alternates adding transformable objects rightwards from this object.
Alternates adding transformable objects rightwards from this object.
Value parameters
- alignment
-
The vertical alignment for each added object.
- alternatives
-
A sequence of transformable objects to alternate with.
- numberOfAlternations
-
The number of times to alternate additions.
- padding
-
The horizontal space between each added object.
Attributes
- Returns
-
A picture with the alternated additions applied.
- See also
Alternates adding transformable objects upwards from this object.
Alternates adding transformable objects upwards from this object.
Value parameters
- alignment
-
The horizontal alignment for each added object.
- alternatives
-
A sequence of transformable objects to alternate with.
- numberOfAlternations
-
The number of times to alternate additions.
- padding
-
The vertical space between each added object.
Attributes
- Returns
-
A picture with the alternated additions applied.
- See also
Alternates adding transformable objects around this object on a specified side, for a given number of alternations. This method allows for creating patterns or sequences of objects around the original object, adding them one after another in a specified direction.
Alternates adding transformable objects around this object on a specified side, for a given number of alternations. This method allows for creating patterns or sequences of objects around the original object, adding them one after another in a specified direction.
Value parameters
- alignment
-
The alignment (either horizontal or vertical, depending on the side) of the added objects relative to the original object. This parameter controls how the added objects are aligned with respect to each other.
- alternatives
-
A sequence of
Transformable
objects to alternate with. These objects are added in sequence around the original object. - numberOfAlternations
-
The total number of alternations to perform. This determines how many times objects from the
alternatives
sequence are added around this object. - padding
-
The padding in pixels between each added object, with a default value defined by smile.Settings.DefaultPaddingInPixels. This spacing is applied between successive alternations.
- side
-
The side relative to this object where the alternations will be added (Top, Bottom, Left, or Right).
Attributes
- Returns
-
A
Picture
instance that includes the original object and the alternated additions.
Crops the transformable object to a specified boundary.
Crops the transformable object to a specified boundary.
Value parameters
- boundary
-
The boundary to crop the transformable object to.
Attributes
- Returns
-
A Bitmap representing the cropped area of the transformable object.
Crops the transformable object using specified upper left and lower right corners.
Crops the transformable object using specified upper left and lower right corners.
Value parameters
- lowerRightCorner
-
The lower right corner of the crop area.
- upperLeftCorner
-
The upper left corner of the crop area.
Attributes
- Returns
-
A Bitmap representing the cropped area of the transformable object.
Crops the transformable object using an upper left corner and specified dimensions.
Crops the transformable object using an upper left corner and specified dimensions.
Value parameters
- height
-
The height of the crop area in pixels.
- upperLeftCorner
-
The upper left corner of the crop area.
- width
-
The width of the crop area in pixels.
Attributes
- Returns
-
A Bitmap representing the cropped area of the transformable object.
Crops this object to a specified area defined by upper left and lower right coordinates.
Crops this object to a specified area defined by upper left and lower right coordinates.
Value parameters
- lowerRightX
-
The x-coordinate of the lower right corner of the crop area.
- lowerRightY
-
The y-coordinate of the lower right corner of the crop area.
- upperLeftX
-
The x-coordinate of the upper left corner of the crop area.
- upperLeftY
-
The y-coordinate of the upper left corner of the crop area.
Attributes
- Returns
-
A bitmap representing the cropped area of the object.
Moves the transformable object by the specified offsets from its current position.
Moves the transformable object by the specified offsets from its current position.
Value parameters
- xOffset
-
The horizontal offset by which to move the object.
- yOffset
-
The vertical offset by which to move the object.
Attributes
- Returns
-
A new instance of
TransformableType
offset from the original position as specified.
Moves the center of the transformable object to the specified coordinates.
Moves the center of the transformable object to the specified coordinates.
Value parameters
- x
-
The x-coordinate of the new center position.
- y
-
The y-coordinate of the new center position.
Attributes
- Returns
-
A new instance of
TransformableType
with the center positioned as specified.
Moves the center of the transformable object to the specified position.
Moves the center of the transformable object to the specified position.
Value parameters
- position
-
The new center position.
Attributes
- Returns
-
A new instance of
TransformableType
with the center positioned as specified.
Moves the transformable object to a specified position, with the reference point determined by positionType
(center or upper left corner).
Moves the transformable object to a specified position, with the reference point determined by positionType
(center or upper left corner).
Value parameters
- positionType
-
The reference point for the new position: center or upper left corner.
- x
-
The x-coordinate of the new position.
- y
-
The y-coordinate of the new position.
Attributes
- Returns
-
A new instance of
TransformableType
, positioned as specified.
Moves the upper left corner of the transformable object to the specified coordinates.
Moves the upper left corner of the transformable object to the specified coordinates.
Value parameters
- x
-
The x-coordinate of the new upper left corner.
- y
-
The y-coordinate of the new upper left corner.
Attributes
- Returns
-
A new instance of
TransformableType
with the upper left corner positioned as specified.
Moves the upper left corner of the transformable object to the specified position.
Moves the upper left corner of the transformable object to the specified position.
Value parameters
- position
-
The new upper left corner position.
Attributes
- Returns
-
A new instance of
TransformableType
with the upper left corner positioned as specified.
Replicates this object downwards a specified number of times with padding and alignment.
Replicates this object downwards a specified number of times with padding and alignment.
Value parameters
- alignment
-
The horizontal alignment for each replica.
- numberOfReplicas
-
The number of times to replicate this object.
- padding
-
The vertical space between each replica.
- transformer
-
A function to apply a transformation to each replica.
Attributes
- Returns
-
A picture with the replicated additions applied.
- See also
Replicates this object leftwards a specified number of times with padding and alignment.
Replicates this object leftwards a specified number of times with padding and alignment.
Value parameters
- alignment
-
The horizontal alignment for each replica.
- numberOfReplicas
-
The number of times to replicate this object.
- padding
-
The vertical space between each replica.
- transformer
-
A function to apply a transformation to each replica.
Attributes
- Returns
-
A picture with the replicated additions applied.
- See also
Replicates this object rightwards a specified number of times with padding and alignment.
Replicates this object rightwards a specified number of times with padding and alignment.
Value parameters
- alignment
-
The horizontal alignment for each replica.
- numberOfReplicas
-
The number of times to replicate this object.
- padding
-
The vertical space between each replica.
- transformer
-
A function to apply a transformation to each replica.
Attributes
- Returns
-
A picture with the replicated additions applied.
- See also
Replicates this object to a specified direction a given number of times, each time potentially transforming it and spacing the replicas with specified padding. This method allows for creating sequences or arrays of similar objects with modifications.
Replicates this object to a specified direction a given number of times, each time potentially transforming it and spacing the replicas with specified padding. This method allows for creating sequences or arrays of similar objects with modifications.
Value parameters
- alignment
-
Determines how replicas are aligned relative to each other. This alignment can be horizontal or vertical, depending on the side specified for replication.
- numberOfReplicas
-
The total number of replicas to be created and placed. This number includes the original object in the count.
- padding
-
The space in pixels between each replica. This padding is applied uniformly between replicas to maintain consistent spacing.
- side
-
The side (Top, Bottom, Left, Right) relative to this object where the replicas will be placed.
- transformer
-
A transformation function applied to each replica before it is placed. This allows for dynamic alterations of the replicas, such as scaling, rotation, or color changes, providing versatility in the visual outcomes.
Attributes
- Returns
-
A
Picture
that represents the combined visual result of all replicas, including the original object and its transformed replicas, arranged in the specified direction with the specified alignment and spacing.
Replicates this object upwards a specified number of times with padding and alignment.
Replicates this object upwards a specified number of times with padding and alignment.
Value parameters
- alignment
-
The horizontal alignment for each replica.
- numberOfReplicas
-
The number of times to replicate this object.
- padding
-
The vertical space between each replica.
- transformer
-
A function to apply a transformation to each replica.
Attributes
- Returns
-
A picture with the replicated additions applied.
- See also
Rotates this object around a given point by 90 degrees counterclockwise.
Rotates this object around a given point by 90 degrees counterclockwise.
Attributes
Rotates this object around a given point by 90 degrees clockwise.
Rotates this object around a given point by 90 degrees clockwise.
Attributes
Scales the transformable object uniformly in both horizontal and vertical directions relative to its center.
Scales the transformable object uniformly in both horizontal and vertical directions relative to its center.
Value parameters
- factor
-
The scaling factor to apply uniformly to both dimensions.
Attributes
- Returns
-
A new instance of the transformable object scaled by the specified factor.
Scales the transformable object uniformly in both horizontal and vertical directions relative to a specified point.
Scales the transformable object uniformly in both horizontal and vertical directions relative to a specified point.
Value parameters
- factor
-
The scaling factor to apply uniformly to both dimensions.
- relativityPoint
-
The point relative to which the scaling is applied.
Attributes
- Returns
-
A new instance of the transformable object scaled by the specified factor around the given point.
Scales the transformable object to a specified width and height relative to its center.
Scales the transformable object to a specified width and height relative to its center.
Value parameters
- targetHeight
-
The target height in pixels.
- targetWidth
-
The target width in pixels.
Attributes
- Returns
-
A new instance of the transformable object scaled to the specified dimensions.
Scales this object to given width and height in relation to a given point.
Scales this object to given width and height in relation to a given point.
Value parameters
- relativityPoint
-
The point relative to which the scaling is applied.
- targetHeight
-
The target height in pixels.
- targetWidth
-
The target width in pixels.
Attributes
- Returns
-
A new instance of the transformable object scaled to the specified dimensions.