@@ -8,13 +8,19 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;

/**
*
* @author MICHAEL
*/
public class TXT {

public static LinkedList PUNTOS = new LinkedList();
public static LinkedList MAPA = new LinkedList();

public ArrayList<LinkedList> INFO = new ArrayList<LinkedList>();

public void Puntos(String file) {

File archivo = null;
@@ -33,31 +39,14 @@ public void Puntos(String file) {

while ((linea = br.readLine()) != null) {
String codigo = "";
String provincia = "";
String direccion = "";
String espacio = " ";
boolean flag1 = true;
boolean flag2 = true;
boolean flag3 = true;
char[] informacion = linea.toCharArray();

int i = 0;
while (i < informacion.length) {
//***********************************************************DIRECCION
if (flag3 == false) {
char elemento = informacion[i];

if (linea.equals("PUNTOS")) {
break;
}

direccion += String.valueOf(elemento);

if (linea.equals("MAPA")) {
return;
}
i++;
}
//***********************************************************CODIGO
if (flag1) {
char elemento = informacion[i];
@@ -78,17 +67,11 @@ public void Puntos(String file) {

i++;
}
//***********************************************************PROVINCIA
//***********************************************************DIRECCION
if (flag2 == false) {
char elemento = informacion[i];

if (String.valueOf(elemento).equals(espacio)) {
flag3 = false;
flag2 = true;

}

provincia += String.valueOf(elemento);
direccion += String.valueOf(elemento);

if (linea.equals("MAPA")) {
return;
@@ -97,9 +80,10 @@ public void Puntos(String file) {
}

}
System.out.println(codigo);
System.out.println(provincia);
System.out.println(direccion);

Direcciones punto = new Direcciones(codigo, direccion);
PUNTOS.append(punto);

}

//****SIN IMPORTANCIA
@@ -112,6 +96,7 @@ public void Puntos(String file) {
try {
if (null != fr) {
fr.close();
System.out.println("DONE!! :"+ PUNTOS.size());
}
} catch (Exception e2) {
e2.printStackTrace();
@@ -144,6 +129,7 @@ public void Mapa(String file) {
String principal = "";
String enlaces = "";
String espacio = " ";

boolean flag1 = true;
boolean flag2 = true;
char[] informacion = linea.toCharArray();
@@ -177,8 +163,12 @@ public void Mapa(String file) {
}

}
System.out.println(principal);
System.out.println(enlaces);
EnlazePeso(enlaces);

Enlaces Map = new Enlaces(principal, INFO.get(0), INFO.get(1));
MAPA.append(Map);
INFO.clear();

}
}

@@ -192,11 +182,61 @@ public void Mapa(String file) {
try {
if (null != fr) {
fr.close();
System.out.println("DONE!!");
System.out.println(MAPA.size());
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}

public ArrayList EnlazePeso(String linea) {
LinkedList ENLACES = new LinkedList();
LinkedList PESOS = new LinkedList();

char[] arreglo = linea.toCharArray();

int i = 0;
String enlace = "";
String peso = "";
char espacio = ' ';
char abre = '(';
char cierra = ')';
boolean flag = true;
boolean flag1 = true;
while (i < arreglo.length) {

if (flag) {
if ((arreglo[i] != espacio) && (arreglo[i] != abre)) {
enlace += arreglo[i];
}
if (arreglo[i] == abre) {
flag = false;
flag1 = false;
ENLACES.append(enlace);
enlace = "";
}

}
if (flag1 == false) {
if ((arreglo[i] != cierra) && (arreglo[i] != abre)) {
peso += arreglo[i];
}
if (arreglo[i] == cierra) {
flag = true;
flag1 = true;
PESOS.append(peso);
peso = "";
}

}
i++;
}
INFO.add(ENLACES);
INFO.add(PESOS);
return INFO;
}
//public

}
@@ -32,20 +32,42 @@
<Component id="jSeparator1" alignment="0" min="-2" pref="649" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="49" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="Cargar_Mapa" min="-2" pref="120" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="146" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Component id="Cargar_Mapa" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jTextField2" min="-2" pref="107" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField1" min="-2" pref="107" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="126" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="246" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="397" max="-2" attributes="0"/>
<Component id="CANCELAR" min="-2" pref="159" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="ACEPTAR" min="-2" pref="159" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="19" max="32767" attributes="0"/>
<EmptySpace pref="155" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="CANCELAR" min="-2" pref="159" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Component id="ACEPTAR" min="-2" pref="159" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="770" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
@@ -62,19 +84,41 @@
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="Cargar_Mapa" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextField2" alignment="3" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextField1" alignment="3" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel3" min="-2" pref="187" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="ACEPTAR" min="-2" pref="78" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="CANCELAR" min="-2" pref="78" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="CANCELAR" alignment="3" min="-2" pref="78" max="-2" attributes="0"/>
<Component id="ACEPTAR" alignment="3" min="-2" pref="78" max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="123" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="257" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -129,5 +173,33 @@
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="REPARTIDORES:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="TIEMPO:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
</Component>
<Component class="javax.swing.JTextField" name="jTextField2">
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="MAPA:"/>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -5,6 +5,9 @@
*/
package Interfaz;

import Implementaciones.Direcciones;
import Implementaciones.Enlaces;
import Implementaciones.LinkedList;
import Implementaciones.TXT;
import java.io.BufferedReader;
import java.io.File;
@@ -42,6 +45,11 @@ private void initComponents() {
ACEPTAR = new javax.swing.JButton();
CANCELAR = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

@@ -74,6 +82,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

jLabel4.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel4.setText("REPARTIDORES:");

jLabel5.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel5.setText("TIEMPO:");

jLabel6.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel6.setText("MAPA:");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
@@ -86,17 +103,33 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 649, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(Cargar_Mapa, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(146, 146, 146)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(397, 397, 397)
.addComponent(CANCELAR, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(ACEPTAR, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(19, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(35, 35, 35)
.addComponent(Cargar_Mapa, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(126, 126, 126)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(155, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(CANCELAR, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(33, 33, 33)
.addComponent(ACEPTAR, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(50, 50, 50))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(59, 59, 59)
.addComponent(jLabel6)
.addContainerGap(770, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -110,15 +143,31 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(Cargar_Mapa, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(48, 48, 48)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField2))
.addGap(33, 33, 33)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jTextField1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(CANCELAR, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ACEPTAR, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(ACEPTAR, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(CANCELAR, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37))))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(123, 123, 123)
.addComponent(jLabel6)
.addContainerGap(257, Short.MAX_VALUE)))
);

pack();
@@ -140,7 +189,7 @@ private void Cargar_MapaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
if (option == JFileChooser.APPROVE_OPTION) {
file = dig.getSelectedFile().getPath();
}
//leer.Puntos(file);
leer.Puntos(file);
leer.Mapa(file);

}//GEN-LAST:event_Cargar_MapaActionPerformed
@@ -195,6 +244,11 @@ public void run() {
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration//GEN-END:variables
}
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="jLabel1"/>
</Properties>
</Component>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
@@ -23,13 +30,209 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="805" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="281" max="-2" attributes="0"/>
</Group>
<Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" pref="348" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="10" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="Dibujar" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="PanelDibujo" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jToggleButton1" min="-2" pref="88" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane2" min="-2" pref="438" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="520" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="475" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel2" min="-2" pref="231" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="PanelDibujo" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="71" max="-2" attributes="0"/>
<Component id="Dibujar" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jScrollPane2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="22" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jToggleButton1" min="-2" pref="31" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="72" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="PanelDibujo">

<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="534" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="220" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
<Component class="javax.swing.JButton" name="Dibujar">
<Properties>
<Property name="text" type="java.lang.String" value="Dibujar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="DibujarActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="jList1">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="LISTA DE PEDIDOS"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="REPARTIDORES"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="TIEMPO SALIDA P."/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="MAPA"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Snap ITC" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="REPARTIDORES EN RUTA"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="jList2">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/Imagenes/Imagen1.png"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JToggleButton" name="jToggleButton1">
</Component>
</SubComponents>
</Form>
@@ -5,8 +5,15 @@
*/
package Interfaz;

import Dibujos.Dibujo;
import Implementaciones.Direcciones;
import Implementaciones.LinkedList;
import Implementaciones.Nodo;
import Implementaciones.TXT;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Toolkit;
import java.util.ArrayList;

/**
*
@@ -19,7 +26,7 @@ public class Principal extends javax.swing.JFrame {
*/
public Principal() {
initComponents();

Toolkit t = Toolkit.getDefaultToolkit();

Dimension d = t.getScreenSize();
@@ -40,22 +47,169 @@ public Principal() {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jLabel1 = new javax.swing.JLabel();
PanelDibujo = new javax.swing.JPanel();
Dibujar = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jList2 = new javax.swing.JList();
jLabel2 = new javax.swing.JLabel();
jToggleButton1 = new javax.swing.JToggleButton();

jLabel1.setText("jLabel1");

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

javax.swing.GroupLayout PanelDibujoLayout = new javax.swing.GroupLayout(PanelDibujo);
PanelDibujo.setLayout(PanelDibujoLayout);
PanelDibujoLayout.setHorizontalGroup(
PanelDibujoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 534, Short.MAX_VALUE)
);
PanelDibujoLayout.setVerticalGroup(
PanelDibujoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 220, Short.MAX_VALUE)
);

Dibujar.setText("Dibujar");
Dibujar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DibujarActionPerformed(evt);
}
});

jList1.setEnabled(false);
jScrollPane1.setViewportView(jList1);

jLabel6.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel6.setText("LISTA DE PEDIDOS");

jLabel7.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel7.setText("REPARTIDORES");

jLabel8.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel8.setText("TIEMPO SALIDA P.");

jLabel9.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel9.setText("MAPA");

jLabel10.setFont(new java.awt.Font("Snap ITC", 0, 24)); // NOI18N
jLabel10.setText("REPARTIDORES EN RUTA");

jList2.setEnabled(false);
jScrollPane2.setViewportView(jList2);

jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Imagen1.png"))); // NOI18N

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 805, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel8)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel10)
.addComponent(jLabel7)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(Dibujar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(PanelDibujo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 438, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26))))))
.addGroup(layout.createSequentialGroup()
.addGap(520, 520, 520)
.addComponent(jLabel9)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 475, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(PanelDibujo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGap(71, 71, 71)
.addComponent(Dibujar)))
.addGap(28, 28, 28)
.addComponent(jLabel8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6)
.addGap(18, 18, 18)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21))
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(22, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(72, 72, 72))))))
);

pack();
}// </editor-fold>//GEN-END:initComponents

private void DibujarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DibujarActionPerformed
// TODO add your handling code here:
Graphics k = PanelDibujo.getGraphics();
int i = 0;
TXT info = new TXT();
LinkedList puntos = (LinkedList) info.PUNTOS;

while (i < info.PUNTOS.size()) {
if (i == 0) {
} else {

Direcciones codigos = (Direcciones) puntos.getElement();

Dibujo ci = new Dibujo();
ci.Dibujar(k, codigos.getCodigo());

puntos.next();
i++;
}
}
puntos.goToStart();
}//GEN-LAST:event_DibujarActionPerformed

/**
* @param args the command line arguments
*/
@@ -92,5 +246,19 @@ public void run() {
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Dibujar;
private javax.swing.JPanel PanelDibujo;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JList jList1;
private javax.swing.JList jList2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JToggleButton jToggleButton1;
// End of variables declaration//GEN-END:variables
}