|
@@ -32,8 +32,7 @@ public class BoxVisualizer {
|
|
|
g2d.fillRect(0, 0, canvasWidth, canvasHeight);
|
|
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
|
|
- g2d.setFont(new Font("Arial", Font.PLAIN, 12));
|
|
|
-
|
|
|
+ g2d.setFont(new Font("Microsoft YaHei", Font.PLAIN, 12)); // 适用于中文
|
|
|
for (FloorPlanTag tag : floor.getShapes()) {
|
|
|
Double[] bbox = tag.getBbox();
|
|
|
if (bbox.length < 4) continue;
|
|
@@ -52,7 +51,7 @@ public class BoxVisualizer {
|
|
|
Color color = tag.getCategory().startsWith("Tag_") ? Color.RED : Color.BLUE;
|
|
|
g2d.setColor(color);
|
|
|
g2d.drawRect(x, y, boxWidth, boxHeight);
|
|
|
- g2d.drawString(tag.getCategory(), x + 2, y + 12);
|
|
|
+ g2d.drawString(tag.getName(), x + 2, y + 12);
|
|
|
}
|
|
|
|
|
|
g2d.dispose();
|
|
@@ -68,7 +67,7 @@ public class BoxVisualizer {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
|
- String content = FileUtil.readUtf8String("C:\\Users\\4DAGE\\Downloads\\floorplan-ai (1).json");
|
|
|
+ String content = FileUtil.readUtf8String("C:\\Users\\4DAGE\\Downloads\\floorplan-ai (3).json");
|
|
|
JSONObject input = JSON.parseObject(content);
|
|
|
Floors floor = input.getJSONArray("floors").getObject(0, Floors.class);
|
|
|
|