private static String getTypeName(int type) {
    if (type == 0) return "raster screen";
    if (type == 1) return "printer";
    if (type == 2) return "image buffer";
    return "unknown: " + type;
  }
private static String getTypeName(int type)