public class RelationUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ADJACENT
Positional constraint: is B adjacent to A?
|
static int |
CENTER
The center direction constant.
|
static int |
CONTAINS
Positional constraint: does A contain B?
|
static int |
EAST
The east direction constant.
|
static int |
INTERSECTS
Positional constraint: does A intersect B?
|
static int |
NO_SIZE_RATIO
No size constant.
|
static int |
NORTH
The north direction constant.
|
static int |
NORTH_EAST
The north-east direction constant.
|
static int |
NORTH_WEST
The north-west direction constant.
|
static int |
SOUTH
The south direction constant.
|
static int |
SOUTH_EAST
The south-east direction constant.
|
static int |
SOUTH_WEST
The south-west direction constant.
|
static int |
WEST
The west direction constant.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkSite(int site)
Check the given site's validity; throw an illegal argument
exception if it is not valid.
|
static double |
directionToAngle(int direction)
Return the angle in radians corresponding to the given
direction constant (EAST is 0 radians).
|
static Relation |
makeRelation(String relationType)
Return a relation with the given name and the
two given sites.
|
static Relation |
makeRelation(String relationType,
int site1,
int site2)
Return a relation with the given name and the
two given sites.
|
static int |
parseDirection(String dir)
Return a direction constant given a string.
|
static int |
parseOverlap(String overlap)
Return a position constant given a string.
|
static int |
parseSite(String site)
Return a site constant given a string.
|
static String |
printDirection(int direction)
Return a string given a direction constant.
|
static String |
printOverlap(int overlap)
Return a string given a position constant.
|
static String |
printSite(int site)
Return a string given a site constant.
|
static double |
siteX(Rectangle2D r,
int site)
Return the X coordinate of the given site for the given
rectangle.
|
static double |
siteY(Rectangle2D r,
int site)
Return the Y coordinate of the given site for the given
rectangle.
|
public static final int INTERSECTS
public static final int CONTAINS
public static final int ADJACENT
public static final int NORTH_EAST
public static final int NORTH
public static final int NORTH_WEST
public static final int NO_SIZE_RATIO
public static final int WEST
public static final int SOUTH_WEST
public static final int SOUTH
public static final int SOUTH_EAST
public static final int EAST
public static final int CENTER
public static void checkSite(int site)
public static double directionToAngle(int direction)
public static int parseSite(String site)
public static int parseDirection(String dir)
public static int parseOverlap(String overlap)
public static String printOverlap(int overlap)
public static String printSite(int site)
public static String printDirection(int direction)
public static double siteX(Rectangle2D r, int site)
public static Relation makeRelation(String relationType)
public static Relation makeRelation(String relationType, int site1, int site2)
public static double siteY(Rectangle2D r, int site)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.