Class NTxOverflow
java.lang.Object
net.thevpc.ntexup.api.document.style.NTxOverflow
Declarative policy for the parts of a node's painting that leave its own
layout box. Resolved from the
NTxPropName.OVERFLOW property (with the
NTxPropName.OVERFLOW_MARGIN and NTxPropName.OVERFLOW_FADE
modifiers) and applied centrally by the engine, so any node type can opt in
without writing custom code.
The crop box is the node's own bounds inflated on each side by the configured margin. A positive margin lets a controlled amount of overflow be shown; a negative one insets the crop inside the bounds.
NTxOverflow.Mode.VISIBLE- default, nothing is cropped.NTxOverflow.Mode.HIDDEN/NTxOverflow.Mode.CLIP- hard crop at the crop box.NTxOverflow.Mode.FADE- crop at the crop box with a soft alpha feather offadeTop()/fadeRight()/fadeBottom()/fadeLeft()pixels ending at the crop-box edge, so the content dissolves instead of ending abruptly.
Overflow is purely visual: like CSS overflow it never changes the
node's measured size or position.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NTxOverflowShared no-op instance: nothing is cropped. -
Constructor Summary
ConstructorsConstructorDescriptionNTxOverflow(NTxOverflow.Mode mode, double top, double right, double bottom, double left, double fadeTop, double fadeRight, double fadeBottom, double fadeLeft) -
Method Summary
Modifier and TypeMethodDescriptiondoublebottom()clipBounds(NTxBounds2D bounds) Same asclipShape(NTxBounds2D)but as bounds.clipShape(NTxBounds2D bounds) The rectangle the node is cropped to: its bounds inflated by the margins.doubledoublefadeLeft()doubledoublefadeTop()booleanisFade()booleandoubleleft()mode()doubleright()doubletop()
-
Field Details
-
VISIBLE
Shared no-op instance: nothing is cropped.
-
-
Constructor Details
-
NTxOverflow
public NTxOverflow(NTxOverflow.Mode mode, double top, double right, double bottom, double left, double fadeTop, double fadeRight, double fadeBottom, double fadeLeft)
-
-
Method Details
-
mode
-
isVisible
public boolean isVisible() -
isFade
public boolean isFade() -
top
public double top() -
right
public double right() -
bottom
public double bottom() -
left
public double left() -
fadeTop
public double fadeTop() -
fadeRight
public double fadeRight() -
fadeBottom
public double fadeBottom() -
fadeLeft
public double fadeLeft() -
clipShape
The rectangle the node is cropped to: its bounds inflated by the margins. -
clipBounds
Same asclipShape(NTxBounds2D)but as bounds.
-