public void actionPerformed(java.awt.event.ActionEvent evt) { btnOkayActionPerformed(evt); setVisible(false); } });
public UnitEditorDialog(JFrame parent, Entity m) { super(parent, true); entity = m; initComponents(); setLocationRelativeTo(parent); }
private void editUnit(UUID id, int idx, boolean salvage) { UnitStatus ustatus = salvage ? tracker.getSalvageStatus().get(id) : tracker.getUnitsStatus().get(id); if(null == ustatus || null == ustatus.getEntity()) { return; } Entity entity = ustatus.getEntity(); UnitEditorDialog med = new UnitEditorDialog(frame, entity); med.setVisible(true); JLabel name = lblsUnitName.get(idx); name.setText(ustatus.getDesc()); }
private void initComponents() { GridBagConstraints gridBagConstraints; getContentPane().setLayout(new BorderLayout()); setTitle("Edit damage for " + entity.getDisplayName()); initArmorPanel(); initSystemPanel(); initEquipPanel(); getContentPane().add(panMain, BorderLayout.CENTER); panButtons.add(butCancel); getContentPane().add(panButtons, BorderLayout.PAGE_END); pack();
private void initArmorPanel() { if (entity instanceof Aero) { initAeroArmorPanel(); return; } else if ((entity instanceof Infantry) && !(entity instanceof BattleArmor)) { initInfantryArmorPanel(); return;
public void mechEdit(Entity entity) { boolean editable = clientgui.getBots().get(entity.getOwner().getName()) != null; Client c; if (editable) { c = clientgui.getBots().get(entity.getOwner().getName()); } else { editable |= entity.getOwnerId() == clientgui.getClient().getLocalPlayer().getId(); c = clientgui.getClient(); } // display dialog UnitEditorDialog med = new UnitEditorDialog(clientgui.getFrame(), entity); // med.setPlayer(c.getLocalPlayer()); med.setVisible(true); c.sendUpdateEntity(entity); /* * if (editable && med.isSelect()) { // send changes * c.sendUpdateEntity(entity); } */ }
@Override public void actionPerformed(ActionEvent action) { String command = action.getActionCommand(); if (command.equalsIgnoreCase("CONFIG_BOT")) { PrincessBehaviorDialog pbd = new PrincessBehaviorDialog(frame, scenario.getBotForce(index).getBehaviorSettings(), scenario.getBotForce(index).getName()); pbd.setVisible(true); if (!pbd.dialogAborted) { scenario.getBotForce(index).setBehaviorSettings(pbd.getBehaviorSettings()); scenario.getBotForce(index).setName(pbd.getBotName()); } } else if (command.equalsIgnoreCase("EDIT_UNIT")) { if (tree.getSelectionCount() > 0) { // row 0 is root node int i = tree.getSelectionRows()[0] - 1; UnitEditorDialog med = new UnitEditorDialog(frame, scenario.getBotForce(index).getEntityList().get(i)); med.setVisible(true); } } }
public void actionPerformed(java.awt.event.ActionEvent evt) { setVisible(false); } });
if (null != selectedUnit) { Entity entity = selectedUnit.getEntity(); UnitEditorDialog med = new UnitEditorDialog(gui.getFrame(), entity); med.setVisible(true); selectedUnit.runDiagnostic(false); MekHQ.triggerEvent(new UnitChangedEvent(selectedUnit));