public class ObjectGroup
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
static int |
DEFAULT_GROUP_DISTANCE
グループ化可能な距離のデフォルト値 高速化メモリ節約のため、四角形を作るため誤差が出る
|
コンストラクタと説明 |
---|
ObjectGroup(int x,
int y)
Specify the coordinates of the center point to generate an object rectangle
|
ObjectGroup(int x,
int y,
int groupDistance)
Specify the coordinates of the center point to generate an object rectangle
|
ObjectGroup(java.awt.Point p)
Build object rectangle using center point p for grouping.
|
ObjectGroup(java.awt.Point p,
int groupDistance)
Build object rectangle using center point p For grouping, it's assigned groupDistance.
|
修飾子とタイプ | メソッドと説明 |
---|---|
boolean |
canMerge(ObjectGroup objectGroup)
Check whether one of the binding conditions is met.
|
java.awt.Rectangle |
getRectangle()
Get the rectangle area of object
|
static java.util.List<ObjectGroup> |
mergeAllPossibleObjects(java.util.List<ObjectGroup> objectGroups)
merge all possible object groups
|
void |
union(ObjectGroup objectGroup)
To join with the specified objectGroup, you need to make sure at whether it is possible to join in advance
|
public static final int DEFAULT_GROUP_DISTANCE
public ObjectGroup(java.awt.Point p, int groupDistance)
p
- center pointgroupDistance
- distance for groupingpublic ObjectGroup(java.awt.Point p)
p
- center pointpublic ObjectGroup(int x, int y, int groupDistance)
x
- x-coordinate of the center pointy
- y-coordinate of the center pointgroupDistance
- distance for groupingpublic ObjectGroup(int x, int y)
x
- x-coordinate of the center pointy
- y-coordinate of the center pointpublic void union(ObjectGroup objectGroup)
objectGroup
- ObjectGroup that bindpublic boolean canMerge(ObjectGroup objectGroup)
objectGroup
- target objectpublic static java.util.List<ObjectGroup> mergeAllPossibleObjects(java.util.List<ObjectGroup> objectGroups)
objectGroups
- list of object groupspublic java.awt.Rectangle getRectangle()