/** Método para llenar los combos con Voltages. */
 public void fill_combos_voltages() {
   voltagesFound = ServiceVoltage.find_voltages();
   if (voltagesFound != null) {
     viewMainFeeder.getCmbVoltage().removeAllItems();
     for (Voltage voltage : voltagesFound) {
       if (((Phase) viewMainFeeder.getCmbPhases().getSelectedItem())
               .getName()
               .equalsIgnoreCase(TypePhases.SINGLE_PHASE_TWO_THREAD.getPhase())
           && voltage.getVoltage() < 200) {
         viewMainFeeder.getCmbVoltage().addItem(voltage);
       } else if ((((Phase) viewMainFeeder.getCmbPhases().getSelectedItem())
                   .getName()
                   .equalsIgnoreCase(TypePhases.SINGLE_PHASE_THREE_THREAD.getPhase())
               || ((Phase) viewMainFeeder.getCmbPhases().getSelectedItem())
                   .getName()
                   .equalsIgnoreCase(TypePhases.PHASE_FOUR_THREAD.getPhase()))
           && voltage.getVoltage() >= 200) {
         viewMainFeeder.getCmbVoltage().addItem(voltage);
       }
     }
     viewMainFeeder.getCmbVoltage().setSelectedIndex(0);
   } else {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200, messages.getProperty(Messages.VOLTAGES_NO_FOUND), MessagesStructure.justify));
     viewMainFeeder.dispose();
   }
 } // Fin del método
 @Override
 public void actionPerformed(ActionEvent e) {
   if (e.getSource().equals(viewMainFeeder.getBtnAdd())) {
     loadRegister();
   } else if (e.getSource().equals(viewMainFeeder.getBtnClose())) {
     viewMainFeeder.dispose();
   } else if (e.getSource().equals(viewMainFeeder.getBtnCalculateCurrentCapacity())) {
     this.calculate_conductor();
   } else if (e.getSource().equals(viewMainFeeder.getBtnCalculateBreakdown())) {
     this.calculate_breakDownVoltage();
   } else if (e.getSource().equals(viewMainFeeder.getCmbPhases())) {
     this.fill_combos_voltages();
   }
 }
 /** Método para llenar los combos con Materiales. */
 public void fill_combos_materials() {
   materialsFound = ServiceMaterial.find_materials();
   if (materialsFound != null) {
     for (Material material : materialsFound) {
       viewMainFeeder.getCmbMaterial().addItem(material);
     }
     viewMainFeeder.getCmbMaterial().setSelectedIndex(0);
   } else {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200, messages.getProperty(Messages.MATERIALS_NO_FOUND), MessagesStructure.justify));
     viewMainFeeder.dispose();
   }
 } // Fin del método
 /** Método para llenar los combos con Ductos. */
 public void fill_combos_ducts() {
   ductsFound = ServiceDuct.find_ducts();
   if (ductsFound != null) {
     for (Duct duct : ductsFound) {
       viewMainFeeder.getCmbDuct().addItem(duct);
     }
     viewMainFeeder.getCmbDuct().setSelectedIndex(0);
   } else {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200, messages.getProperty(Messages.DUCTS_NO_FOUND), MessagesStructure.justify));
     viewMainFeeder.dispose();
   }
 } // Fin del método
 /** Método para llenar los combos con Calibers. */
 public void fill_combos_calibers() {
   calibersFound = ServiceCaliber.find_caliber();
   if (calibersFound != null) {
     for (Caliber caliber : calibersFound) {
       viewMainFeeder.getCmbCaliber().addItem(caliber);
       viewMainFeeder.getCmbCalibersNeutral().addItem(caliber);
     }
     viewMainFeeder.getCmbCaliber().setSelectedIndex(0);
     viewMainFeeder.getCmbCalibersNeutral().setSelectedIndex(0);
   } else {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200, messages.getProperty(Messages.CALIBERS_NO_FOUND), MessagesStructure.justify));
     viewMainFeeder.dispose();
   }
 } // Fin del método
 /** Método para llenar los combos con temperaturas. */
 public void fill_combos_temperatures() {
   temperaturesFound = ServiceTemperature.find_temperatures();
   if (temperaturesFound != null) {
     for (Temperature temperature : temperaturesFound) {
       viewMainFeeder.getCmbTemperature().addItem(temperature);
     }
     viewMainFeeder.getCmbTemperature().setSelectedIndex(0);
   } else {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200,
             messages.getProperty(Messages.TEMPERATURES_NO_FOUND),
             MessagesStructure.justify));
     viewMainFeeder.dispose();
   }
 } // Fin del método
  /** Método para llenar los combos con Fases. */
  public void fill_combos_phases() {
    phasesFound = ServicePhase.find_phases();
    if (phasesFound != null) {
      for (Phase phase : phasesFound) {
        if (phase.getName().equalsIgnoreCase(TypePhases.PHASE_FOUR_THREAD.getPhase())) {

          viewMainFeeder.getCmbPhases().addItem(phase);
        }
      }
      viewMainFeeder.getCmbPhases().setSelectedIndex(0);
    } else {
      MessagesStructure.Warning(
          MessagesStructure.format(
              200, messages.getProperty(Messages.PHASES_NO_FOUND), MessagesStructure.justify));
      viewMainFeeder.dispose();
    }
  } // Fin del método
 /** Método para registrar carga dentro de un área. */
 private void loadRegister() {
   if (caliberPhaseFound == null || caliberNeutralFound == null || calibersHearthFound == null) {
     MessagesStructure.Warning(
         MessagesStructure.format(
             200,
             messages.getProperty(Messages.AREA_CAPACITY_INTENSITY_NO_FOUND),
             MessagesStructure.justify));
   } else {
     if (ServiceProject.insert_update_conductors_main_feeder(
         new ConductorsMainFeeder(
             viewMainFeeder.getProject(),
             caliberPhase,
             caliberNeutral,
             caliberHearth,
             caliberPipeline,
             caliberPipelineNeutral,
             conductorForPhase,
             conductorForNeutral))) {
       viewMainFeeder.dispose();
     }
   }
 }