Class SlideElement
- Direct Known Subclasses:
ChartElement, DiagramElement, GroupElement, PictureElement, ShapeElement, TableElement
with... methods answer changed copies.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanTrue when mirrored left to right.final booleanTrue when mirrored top to bottom.final floatThe box's height in points, at least 0.final StringThe id, unique within the presentation.final StringA name for people and screen readers, or null.final floatClockwise rotation in degrees about the box's centre.final floatThe box's width in points, at least 0.final floatThe box's left edge in points.final floatThe box's top edge in points. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSlideElement(String id, String name, float x, float y, float width, float height, float rotation, boolean flipH, boolean flipV) Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(float px, float py) True when the point, in slide points, is inside the element's rotated box.protected final intA hash of the base fields.The text of the element for search, outlines and screen readers.protected final booleanTrue when the base fields equal another element's.withBounds(float nx, float ny, float nw, float nh) This element moved and resized, keeping its rotation and flips.abstract SlideElementThis element with another id, for copies.withRotation(float degrees) This element rotated to an angle.abstract SlideElementwithTransform(float x, float y, float width, float height, float rotation, boolean flipH, boolean flipV) This element moved, resized, rotated or flipped.
-
Field Details
-
id
The id, unique within the presentation. -
name
A name for people and screen readers, or null. -
x
public final float xThe box's left edge in points. -
y
public final float yThe box's top edge in points. -
width
public final float widthThe box's width in points, at least 0. -
height
public final float heightThe box's height in points, at least 0. -
rotation
public final float rotationClockwise rotation in degrees about the box's centre. -
flipH
public final boolean flipHTrue when mirrored left to right. -
flipV
public final boolean flipVTrue when mirrored top to bottom.
-
-
Constructor Details
-
SlideElement
protected SlideElement(String id, String name, float x, float y, float width, float height, float rotation, boolean flipH, boolean flipV) Base constructor.
Parameters
-
id: the id, not empty -
name: a name, or null -
x: left edge in points -
y: top edge -
width: width -
height: height -
rotation: degrees clockwise -
flipH: mirrored horizontally -
flipV: mirrored vertically
-
-
-
Method Details
-
withTransform
public abstract SlideElement withTransform(float x, float y, float width, float height, float rotation, boolean flipH, boolean flipV) This element moved, resized, rotated or flipped.
Parameters
-
x: left edge -
y: top edge -
width: width -
height: height -
rotation: degrees clockwise -
flipH: mirrored horizontally -
flipV: mirrored vertically
Returns
the changed element
-
-
withId
This element with another id, for copies.
Parameters
value: the id
Returns
the element
-
withBounds
This element moved and resized, keeping its rotation and flips.
Parameters
-
nx: left edge -
ny: top edge -
nw: width -
nh: height
Returns
the element
-
-
withRotation
This element rotated to an angle.
Parameters
degrees: clockwise
Returns
the element
-
plainText
The text of the element for search, outlines and screen readers.
Returns
the text, empty when there is none
-
contains
public boolean contains(float px, float py) True when the point, in slide points, is inside the element's rotated box.
Parameters
-
px: x -
py: y
Returns
true when inside
-
-
sameFrame
True when the base fields equal another element's.
Parameters
e: the other
Returns
true when equal
-
frameHash
protected final int frameHash()A hash of the base fields.
Returns
the hash
-