Package com.storedobject.svg
Class Grid
java.lang.Object
com.storedobject.svg.Node
com.storedobject.svg.Element
com.storedobject.svg.Rectangle
com.storedobject.svg.Grid
- All Implemented Interfaces:
Serializable
Represents a rectangle with vertical and/or horizontal grid-lines at specified gaps.
Vertical and horizontal gaps may be different or absent.
- Author:
- Syam
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringProvides additional content specific to the node.doublegetHGap()Get the horizontal gap.doublegetVGap()Get the vertical gap.hGap(double hGap) Set the horizontal gap.static Gridof(double w, double h, double vGap, double hGap) Create a grid at (0, 0).static Gridof(double x, double y, double w, double h, double vGap, double hGap) Create a grid.static GridCreate a grid.voidsetHGap(double hGap) Set the horizontal gap.voidsetVGap(double vGap) Set the vertical gap.vGap(double vGap) Set the vertical gap.Methods inherited from class com.storedobject.svg.Rectangle
at, at, attributes, getHeight, getPosition, getWidth, height, of, of, setHeight, setPosition, setWidth, setX, setY, width, x, yMethods inherited from class com.storedobject.svg.Node
compute, copy, copy, createDocument, equals, escapeXml, flipHorizontally, flipHorizontallyAroundOrigin, flipVertically, flipVerticallyAroundOrigin, getCoordinates, getId, getMargin, getSvg, hashCode, id, ID, IDValue, innerContent, moveTo, moveTo, rotate, rotateAround, rotateAround, rotateAroundCenter, scale, scale, scaleHeightTo, scaleTo, scaleWidthTo, toString, toString, transform, translate, translate
-
Constructor Details
-
Grid
Constructor.- Parameters:
p- Top-left point.w- Width.h- Height.vGap- Vertical gap.hGap- Horizontal gap.
-
Grid
public Grid(double x, double y, double w, double h, double vGap, double hGap) Constructor.- Parameters:
x- Top-left X coordinate.y- Top-left Y coordinate.w- Width.h- Height.vGap- Vertical gap.hGap- Horizontal gap.
-
Grid
public Grid(double w, double h, double vGap, double hGap) Constructor.- Parameters:
w- Width.h- Height.vGap- Vertical gap.hGap- Horizontal gap.
-
Grid
Constructor.- Parameters:
p- Top-left point.vGap- Vertical gap.hGap- Horizontal gap.
-
Grid
public Grid(double vGap, double hGap) Constructor.- Parameters:
vGap- Vertical gap.hGap- Horizontal gap.
-
-
Method Details
-
setVGap
public void setVGap(double vGap) Set the vertical gap.- Parameters:
vGap- Vertical gap.
-
getVGap
public double getVGap()Get the vertical gap.- Returns:
- Vertical gap.
-
setHGap
public void setHGap(double hGap) Set the horizontal gap.- Parameters:
hGap- Horizontal gap.
-
getHGap
public double getHGap()Get the horizontal gap.- Returns:
- Horizontal gap.
-
of
-
of
Create a grid.- Parameters:
x- Top-left X coordinate.y- Top-left Y coordinate.w- Width.h- Height.vGap- Vertical gap.hGap- Horizontal gap.- Returns:
- Grid.
-
of
Create a grid at (0, 0).- Parameters:
w- Width.h- Height.vGap- Vertical gap.hGap- Horizontal gap.- Returns:
- Grid.
-
vGap
-
hGap
Set the horizontal gap.- Parameters:
hGap- Horizontal gap.- Returns:
- Self.
-
extraContent
Description copied from class:NodeProvides additional content specific to the node. This method is intended to be overridden by subclasses to define custom extra content specific to their implementation. By default, it returns null if no additional content is defined.Note: The extra content should be formatted as per SVG standards with appropriate tags. No validation is performed on the extra content.
- Overrides:
extraContentin classNode- Returns:
- A string representing the extra content of the node, or null if no extra content is defined.
-