public void closeDialog() { if (asd != null) { aimingAt = Entity.LOC_NONE; aimingMode = IAimingModes.AIM_MODE_NONE; asd.dispose(); asd = null; this.firingDisplay.updateTarget(); } }
/** * Enables the radiobuttons in the dialog. */ public void setEnableAll(boolean enableAll) { if (asd != null) { asd.setEnableAll(enableAll); } }
getContentPane().setLayout(gridbag); c.anchor = GridBagConstraints.WEST; gridbag.setConstraints(labMessage, c); getContentPane().add(labMessage); c.anchor = GridBagConstraints.WEST; gridbag.setConstraints(checkboxes[i], c); add(checkboxes[i]); c.anchor = GridBagConstraints.CENTER; gridbag.setConstraints(butNoAim, c); add(butNoAim); pack(); setLocation((parent.getLocation().x + (parent.getSize().width / 2)) - (getSize().width / 2), (parent.getLocation().y + (parent.getSize().height / 2)) - (getSize().height / 2));
asd = new AimedShotDialog( this.firingDisplay.clientgui.frame, Messages.getString("FiringDisplay.AimedShotDialog.title"), //$NON-NLS-1$ options, enabled, aimingAt, this, this); asd.setVisible(true); this.firingDisplay.updateTarget();
public void showDialog() { if ((ce() == null) || (target == null)) { return; } if (asd != null) { int oldAimingMode = aimingMode; closeDialog(); aimingMode = oldAimingMode; } if (canAim) { final int attackerElevation = ce().getElevation() + ce().getGame().getBoard().getHex(ce().getPosition()) .getLevel(); final int targetElevation = target.getElevation() + ce().getGame().getBoard() .getHex(target.getPosition()).getLevel(); if ((target instanceof Mech) && (ce() instanceof Mech) && (attackerElevation == targetElevation)) { String[] options = { "punch", "kick" }; boolean[] enabled = { true, true }; asd = new AimedShotDialog( clientgui.frame, Messages.getString("PhysicalDisplay.AimedShotDialog.title"), //$NON-NLS-1$ Messages.getString("PhysicalDisplay.AimedShotDialog.message"), //$NON-NLS-1$ options, enabled, aimingAt, this, this); asd.setVisible(true); updateTarget(); } } }
public void closeDialog() { if (asd != null) { aimingAt = Entity.LOC_NONE; aimingMode = IAimingModes.AIM_MODE_NONE; asd.dispose(); asd = null; updateTarget(); } }