Package com.storedobject.svg
Class Node.Anchor
java.lang.Object
com.storedobject.svg.Node.Anchor
- All Implemented Interfaces:
Transformer
- Enclosing class:
Node
Transformer for anchoring a node to another one.
- Author:
- Syam
-
Constructor Summary
ConstructorsConstructorDescriptionAnchor(Node anchoredTo, BiFunction<Node, Node, Double> computeX, BiFunction<Node, Node, Double> computeY) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubletransformX1(Node node) Transform the X1 coordinate.doubletransformX2(Node node) Transform the X2 coordinate.doubletransformY1(Node node) Transform the Y1 coordinate.doubletransformY2(Node node) Transform the Y2 coordinate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.svg.Transformer
transform
-
Constructor Details
-
Anchor
public Anchor(Node anchoredTo, BiFunction<Node, Node, Double> computeX, BiFunction<Node, Node, Double> computeY) Constructor.- Parameters:
anchoredTo- Node to anchor to.computeX- Compute X displacement from the anchor node's x1.computeY- Compute Y displacement from the anchor node's y1.
-
-
Method Details
-
transformX1
Description copied from interface:TransformerTransform the X1 coordinate.Note: This is the first method invoked while transforming a node. It is used to adjust the starting X coordinate of the node.
- Specified by:
transformX1in interfaceTransformer- Parameters:
node- Node to transform.- Returns:
- Transformed X1 coordinate.
-
transformY1
Description copied from interface:TransformerTransform the Y1 coordinate.Note: This is the second method invoked while transforming a node. It is used to adjust the starting Y coordinate of the node.
- Specified by:
transformY1in interfaceTransformer- Parameters:
node- Node to transform.- Returns:
- Transformed Y1 coordinate.
-
transformX2
Description copied from interface:TransformerTransform the X2 coordinate.Note: This is the 3rd method invoked while transforming a node. It is used to adjust the ending X coordinate of the node.
- Specified by:
transformX2in interfaceTransformer- Parameters:
node- Node to transform.- Returns:
- Transformed X2 coordinate.
-
transformY2
Description copied from interface:TransformerTransform the Y2 coordinate.Note: This is the 4th method invoked while transforming a node. It is used to adjust the ending Y coordinate of the node.
- Specified by:
transformY2in interfaceTransformer- Parameters:
node- Node to transform.- Returns:
- Transformed Y2 coordinate.
-