Package com.storedobject.svg
Class Node.Scale
java.lang.Object
com.storedobject.svg.Node.Scale
- All Implemented Interfaces:
Transformer
- Enclosing class:
Node
Transformer for scaling by factors.
- Author:
- Syam
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompute the width, height, and SVG content of the node.protected voidDo the scaling.Transform the node content.doubletransformX1(Node node) Transform the X1 coordinate.doubletransformX2(Node node) Transform the X2 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
transformY1
-
Field Details
-
width
protected double widthComputed width and height of the node after scaling (not absolute value). -
height
protected double heightComputed width and height of the node after scaling (not absolute value). -
svg
Computed SVG content of the node after scaling.
-
-
Constructor Details
-
Scale
public Scale(double scaleX, double scaleY) Constructor.- Parameters:
scaleX- X scale factor (Zero means, as per the aspect ratio).scaleY- Y scale factor (Zero means, as per the aspect ratio).
-
-
Method Details
-
compute
Compute the width, height, and SVG content of the node.- Parameters:
node- The node to be scaled.
-
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.
-
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.
-
transform
Description copied from interface:TransformerTransform the node content.Note: This is the last method invoked while transforming a node. It is used to adjust the content of the node.
- Specified by:
transformin interfaceTransformer- Parameters:
node- Node to transform.- Returns:
- Transformed node content.
-
scale
Do the scaling.- Parameters:
node- Node to scale.sX- Scale factor for X (zero if it is as per aspect ratio).sY- Scale factor for Y (zero if it is as per aspect ratio).
-