use of java.awt.image in project megameklab by MegaMek.
the class ImageHelper method getRecordSheet.
public static Image getRecordSheet(Entity unit, boolean advanced) {
Image recordSheet = null;
String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar;
if (unit instanceof BipedMech) {
if (advanced) {
recordSheet = new ImageIcon(path + "tobiped.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twbiped.png").getImage();
}
} else if (unit instanceof QuadMech) {
if (advanced) {
recordSheet = new ImageIcon(path + "toquad.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twquad.png").getImage();
}
} else if (unit instanceof VTOL) {
recordSheet = new ImageIcon(path + "twvee-vtol.png").getImage();
} else if ((unit instanceof LargeSupportTank) || ((unit instanceof Tank) && ((Tank) unit).isSuperHeavy())) {
if (unit.getOInternal(LargeSupportTank.LOC_TURRET) > 0) {
recordSheet = new ImageIcon(path + "twvee-lgsupground-turret.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twvee-lgsupground.png").getImage();
}
} else if (unit instanceof Tank) {
if ((unit.getMovementMode() == EntityMovementMode.NAVAL) || (unit.getMovementMode() == EntityMovementMode.SUBMARINE) || (unit.getMovementMode() == EntityMovementMode.HYDROFOIL)) {
if (unit.getOInternal(((Tank) unit).getLocTurret()) > 0) {
recordSheet = new ImageIcon(path + "twnaval-turret.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twnaval.png").getImage();
}
} else if (advanced) {
String imageName = "twvee-" + unit.getMovementModeAsString().toLowerCase().trim() + "-dualturret.png";
recordSheet = new ImageIcon(path + imageName).getImage();
} else {
String imageName = "twvee-" + unit.getMovementModeAsString().toLowerCase().trim() + ".png";
recordSheet = new ImageIcon(path + imageName).getImage();
}
} else if (unit instanceof Aero) {
if (unit instanceof Dropship) {
if (unit.getMovementMode() == EntityMovementMode.AERODYNE) {
recordSheet = new ImageIcon(path + "twaerodyneds.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twspheroidds.png").getImage();
}
} else if (unit instanceof ConvFighter) {
recordSheet = new ImageIcon(path + "twconventionalfighter.png").getImage();
} else if (unit instanceof SmallCraft) {
if (unit.getMovementMode() == EntityMovementMode.AERODYNE) {
recordSheet = new ImageIcon(path + "twaero-smallcraft.png").getImage();
} else {
recordSheet = new ImageIcon(path + "twspheroid-smallcraft.png").getImage();
}
} else {
recordSheet = new ImageIcon(path + "twaero.png").getImage();
}
} else if (unit instanceof BattleArmor) {
recordSheet = new ImageIcon(path + "twba.png").getImage();
} else if (unit instanceof Protomech) {
recordSheet = new ImageIcon(path + "twproto.png").getImage();
}
return recordSheet;
}
use of java.awt.image in project megameklab by MegaMek.
the class ImageHelper method getRightShieldImage.
public static Image getRightShieldImage() {
String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar;
Image image = new ImageIcon(path + "twbiped-shield-right.png").getImage();
return image;
}
use of java.awt.image in project megameklab by MegaMek.
the class ImageHelper method getShieldImage.
public static Image getShieldImage() {
String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar;
Image image = new ImageIcon(path + "twbiped-shields.png").getImage();
return image;
}
use of java.awt.image in project megameklab by MegaMek.
the class ImageHelper method getLeftShieldImage.
public static Image getLeftShieldImage() {
String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar;
Image image = new ImageIcon(path + "twbiped-shield-left.png").getImage();
return image;
}
use of java.awt.image in project megameklab by MegaMek.
the class ImageHelper method getFluffPNG.
public static Image getFluffPNG(Entity unit, String path) {
Image fluff = null;
String fluffFile = path + unit.getChassis() + " " + unit.getModel() + ".png";
if (new File(fluffFile.toLowerCase()).exists()) {
fluff = new ImageIcon(fluffFile).getImage();
}
if (fluff == null) {
fluffFile = path + unit.getModel() + ".png";
if (new File(fluffFile.toLowerCase()).exists()) {
fluff = new ImageIcon(fluffFile).getImage();
}
}
if (fluff == null) {
fluffFile = path + unit.getChassis() + ".png";
if (new File(fluffFile.toLowerCase()).exists()) {
fluff = new ImageIcon(fluffFile).getImage();
}
}
return fluff;
}
Aggregations