public MegamekBorder(){ super(); initialize(SkinXMLHandler .getSkin(SkinSpecification.UIComponents.DefaultUIElement .getComp())); }
/** * Default constructor with no button text and DefaultButton * SkinSpecification. */ public MegamekButton() { super(); initialize(SkinSpecification.UIComponents.DefaultButton.getComp()); }
/** * creates PicMap engine. If no areas, labels or Backround-drawers added * this is just transparent layer over container. */ public PicMap() { rootGroup.addArea(otherAreas); rootGroup.addArea(hotAreas); rootGroup.addArea(labels); enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.COMPONENT_EVENT_MASK); }
@Override public void addNotify() { super.addNotify(); setImages(); setAreas(); setListeners(); update(); }
public TankMapSet(JComponent c, UnitDisplay unitDisplay) { this.unitDisplay = unitDisplay; comp = c; setAreas(); setLabels(); setBackGround(); translateAreas(); setContent(); }
public SpheroidMapSet(JComponent c, UnitDisplay unitDisplay) { this.unitDisplay = unitDisplay; comp = c; setAreas(); setLabels(); setBackGround(); translateAreas(); setContent(); }
public AeroMapSet(JComponent c, UnitDisplay unitDisplay) { this.unitDisplay = unitDisplay; comp = c; setAreas(); setLabels(); setBackGround(); translateAreas(); setContent(); }
public QuadMapSet(JComponent c, UnitDisplay unitDisplay) { this.unitDisplay = unitDisplay; comp = c; setAreas(); setLabels(); setGroups(); setBackGround(); }
public static PMValueLabel createValueLabel(int x, int y, String v, FontMetrics fm) { PMValueLabel l = new PMValueLabel(fm, Color.red); centerLabelAt(l, x, y); l.setValue(v); return l; }
/** * Returns Hot Area under coordinates (x, y) */ public PMHotArea getAreaUnder(int x, int y) { // Have to check all elements of hotAreas vector // from end to start. Compare against zero works faster. for (int i = (areascount - 1); i >= 0; i--) { PMHotArea ha = (PMHotArea) hotAreas.elementAt(i); if ((ha != null) && intersects(ha.getAreaShape(), x, y)) return ha; } return null; }
public synchronized static UnitDisplaySkinSpecification getUnitDisplaySkin() { if (udSpec == null) { boolean rv = initSkinXMLHandler(); if (!rv || (udSpec == null)) { // This will return a blank ud skin spec file, which will show // the default skin for the unit display return new UnitDisplaySkinSpecification(); } } return udSpec; }
public static PMSimpleLabel createLabel(String s, FontMetrics fm, Color color, int x, int y) { PMSimpleLabel l = new PMSimpleLabel(s, fm, color); centerLabelAt(l, x, y); return l; }
public MegamekBorder(String component){ super(); initialize(SkinXMLHandler.getSkin(component)); }
public void setTab(int i) { if (i > 5) { i = 5; } activeTab = i; redrawImages(); update(); }
/** * Checkpoints the combobox's current state by saving the value of it's current index. */ public void checkpoint() { checkpointIndex = getSelectedIndex(); }
/** * @return The {@link Object} stored at the checkpointed index or NULL if the {@link #checkpoint()} method has not * been called. */ public Object getCheckpointedItem() { if (checkpointIndex == -1) { return null; } return getItemAt(checkpointIndex); }
private void setAreas(){ areas[Aero.LOC_NOSE] = new PMSimplePolygonArea(noseArmor, unitDisplay, Aero.LOC_NOSE); areas[Aero.LOC_RWING] = new PMSimplePolygonArea(rightWingArmor, unitDisplay, Aero.LOC_RWING); areas[Aero.LOC_LWING] = new PMSimplePolygonArea(leftWingArmor, unitDisplay, Aero.LOC_LWING); areas[Aero.LOC_AFT] = new PMSimplePolygonArea(aftArmor, unitDisplay, Aero.LOC_AFT); areas[4] = new PMSimplePolygonArea(Structure, unitDisplay, Aero.LOC_NOSE); }
/** * Default text constructor, the button will use the DefaultButton * SkinSpecification. * * @param text */ public MegamekButton(String text) { super(text); initialize(SkinSpecification.UIComponents.DefaultButton.getComp()); }
/** * @return TRUE if the {@link #checkpoint()} method has been called and the currently selected index does not match * the checkpointed index. */ public boolean hasChanged() { return (checkpointIndex != -1) && (checkpointIndex != getSelectedIndex()); }