public final class TA_GridHelpers extends Object
Some helper methods for TA_Grid.
| Constructor and Description |
|---|
TA_GridHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addContentRow(String[][] ar,
int mode,
int rowtype,
ArrayList<ArrayList<Object>> frame)
Calculates a content row and adds it to the frame (if not empty).
|
static void |
addRule(int[][] type,
int mode,
int rowtype,
ArrayList<Integer> columns,
ArrayList<ArrayList<Object>> frame)
Calculates a rule and adds it to the frame (if not empty).
|
static int |
adjustBorder(int postype,
int v,
int h,
int mode,
ArrayList<ArrayList<Object>> frame)
Adjusts borders, testing if a particular border character is connected uo, down, left, and right in the grid.
|
static int |
convertBorders(int postype,
int v,
int h,
int vsize,
int hsize,
int mode)
Removes left/right connections if the given mode requires it and the position/type is a border.
|
static int |
convertConnectors(int postype,
int v,
int h,
int vsize,
int hsize,
int mode)
Removes top/down connections if the given mode requires and the position/type is a connector.
|
static boolean |
hasType(int postype)
Tests if the given position/type has a type, that is an up, down, left, or right.
|
public static void addRule(int[][] type,
int mode,
int rowtype,
ArrayList<Integer> columns,
ArrayList<ArrayList<Object>> frame)
Calculates a rule and adds it to the frame (if not empty).
type - rule type and options, use one of topRule, midRule, or bottomRulemode - the grid mode (from addGrid)rowtype - the row type (determined by addGrid)columns - the columns of the text (determined by addGrid)frame - internal frame to add the rendered rule topublic static void addContentRow(String[][] ar, int mode, int rowtype, ArrayList<ArrayList<Object>> frame)
Calculates a content row and adds it to the frame (if not empty).
ar - the contentmode - the grid mode (from addGrid)rowtype - the row type (determined by addGrid)frame - internal frame to add the rendered row topublic static int adjustBorder(int postype,
int v,
int h,
int mode,
ArrayList<ArrayList<Object>> frame)
Adjusts borders, testing if a particular border character is connected uo, down, left, and right in the grid.
postype - the border character as position/typev - position of the character vertically in the frameh - position of the character horizontally in the framemode - mode the grid mode (from addGrid)frame - the internal frame to find connected characterspublic static boolean hasType(int postype)
Tests if the given position/type has a type, that is an up, down, left, or right.
postype - position/type to testpublic static int convertBorders(int postype,
int v,
int h,
int vsize,
int hsize,
int mode)
Removes left/right connections if the given mode requires it and the position/type is a border.
postype - the type position to testv - vertical position of position/typeh - horizontal position of position/typevsize - max vertical indexhsize - max horizontal indexmode - the mode to test againstpublic static int convertConnectors(int postype,
int v,
int h,
int vsize,
int hsize,
int mode)
Removes top/down connections if the given mode requires and the position/type is a connector. The method will process top/bottom/mid separately
postype - the type position to testv - vertical position of position/typeh - horizontal position of position/typevsize - max vertical indexhsize - max horizontal indexmode - the mode to test againstCopyright © 2016–2017. All rights reserved.