Created
March 30, 2015 21:35
-
-
Save ftuyama/6068246a25bb08528006 to your computer and use it in GitHub Desktop.
Hyperlink Manager V 1.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package GUI; | |
import java.util.Formatter; | |
import java.util.NoSuchElementException; | |
import java.util.FormatterClosedException; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
import javax.swing.*; | |
import java.io.File; | |
public class Arquivo { | |
private Formatter arquivo; | |
private Scanner entrada; | |
Arquivo() { | |
} | |
// ---------------------------------//-------------------------------------- | |
// ######################### Funções para Salvar ########################### | |
public void openWrite(String file) { | |
try { | |
arquivo = new Formatter(file + ".txt"); | |
} catch (SecurityException semPermissao) { | |
JOptionPane.showMessageDialog(null, "sem permissão para abrir o arquivo!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} catch (FileNotFoundException arquivoInexistente) { | |
JOptionPane.showMessageDialog(null, "Arquivo inexistente ou arquivo não pode ser criado"); | |
} | |
} | |
public void write(String output) { | |
try { | |
arquivo.format(output + "\n"); | |
} catch (FormatterClosedException formatoDesconhecido) { | |
JOptionPane.showMessageDialog(null, "Erro ao escrever"); | |
} catch (NoSuchElementException excecaoElemento) { | |
JOptionPane.showMessageDialog(null, "Entrada inválida"); | |
} | |
} | |
public void closeWrite() { | |
arquivo.close(); | |
} | |
// ---------------------------------//-------------------------------------- | |
// ####################### Funções para escrever: ########################## | |
public void openRead(String aux) { | |
try { | |
entrada = new Scanner(new File(aux + ".txt")); | |
} catch (FileNotFoundException arquivoNaoEncontrado) { | |
JOptionPane.showMessageDialog(null, "Nao foi possivel abrir o arquivo! Nao encontrado!"); | |
} | |
} | |
public String read() { | |
try { | |
if (entrada.hasNext()) { | |
return (entrada.nextLine()); | |
} | |
} catch (NoSuchElementException entradaDiferente) { | |
JOptionPane.showMessageDialog(null, "Entrada diferente da esperada"); | |
entrada.close(); | |
} catch (IllegalStateException erroLeitura) { | |
JOptionPane.showMessageDialog(null, "Erro de leitura"); | |
} | |
return (""); | |
} | |
public boolean isReadable() { | |
return (entrada.hasNext()); | |
} | |
public void closeRead() { | |
entrada.close(); | |
} | |
// ---------------------------------//-------------------------------------- | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package GUI; | |
import java.awt.Color; | |
import javax.swing.*; | |
public class GUI extends javax.swing.JFrame { | |
ListaHyperlinks List = new ListaHyperlinks(); | |
public GUI() { | |
initComponents(); | |
} | |
@SuppressWarnings("unchecked") | |
// <editor-fold defaultstate="collapsed" desc="Generated Code"> | |
private void initComponents() { | |
jMenuItem2 = new javax.swing.JMenuItem(); | |
jMenuBar2 = new javax.swing.JMenuBar(); | |
jMenu3 = new javax.swing.JMenu(); | |
jMenu4 = new javax.swing.JMenu(); | |
jMenuBar3 = new javax.swing.JMenuBar(); | |
jMenu5 = new javax.swing.JMenu(); | |
jMenu6 = new javax.swing.JMenu(); | |
jProgressBar1 = new javax.swing.JProgressBar(); | |
jLabel10 = new javax.swing.JLabel(); | |
jLabel1 = new javax.swing.JLabel(); | |
jLabel2 = new javax.swing.JLabel(); | |
jTabbedPane1 = new javax.swing.JTabbedPane(); | |
jPanel3 = new javax.swing.JPanel(); | |
jButton6 = new javax.swing.JButton(); | |
jButton7 = new javax.swing.JButton(); | |
jButton8 = new javax.swing.JButton(); | |
jTextField1 = new javax.swing.JTextField(); | |
jLabel3 = new javax.swing.JLabel(); | |
jLabel4 = new javax.swing.JLabel(); | |
jTextField2 = new javax.swing.JTextField(); | |
jTextField3 = new javax.swing.JTextField(); | |
jPanel4 = new javax.swing.JPanel(); | |
jButton1 = new javax.swing.JButton(); | |
jButton2 = new javax.swing.JButton(); | |
jButton3 = new javax.swing.JButton(); | |
jTextField4 = new javax.swing.JTextField(); | |
jTextField5 = new javax.swing.JTextField(); | |
jTextField6 = new javax.swing.JTextField(); | |
jLabel5 = new javax.swing.JLabel(); | |
jLabel6 = new javax.swing.JLabel(); | |
jLabel8 = new javax.swing.JLabel(); | |
jTextField8 = new javax.swing.JTextField(); | |
jButton10 = new javax.swing.JButton(); | |
jPanel5 = new javax.swing.JPanel(); | |
jButton4 = new javax.swing.JButton(); | |
jButton5 = new javax.swing.JButton(); | |
jButton9 = new javax.swing.JButton(); | |
jTextField7 = new javax.swing.JTextField(); | |
jTextField9 = new javax.swing.JTextField(); | |
jTextField10 = new javax.swing.JTextField(); | |
jLabel7 = new javax.swing.JLabel(); | |
jLabel9 = new javax.swing.JLabel(); | |
jPanel6 = new javax.swing.JPanel(); | |
jScrollPane1 = new javax.swing.JScrollPane(); | |
jTextArea1 = new javax.swing.JTextArea(); | |
jButton11 = new javax.swing.JButton(); | |
jComboBox1 = new javax.swing.JComboBox(); | |
jButton16 = new javax.swing.JButton(); | |
jMenuBar1 = new javax.swing.JMenuBar(); | |
jMenu1 = new javax.swing.JMenu(); | |
jMenuItem1 = new javax.swing.JMenuItem(); | |
jMenuItem3 = new javax.swing.JMenuItem(); | |
jMenuItem4 = new javax.swing.JMenuItem(); | |
jMenuItem5 = new javax.swing.JMenuItem(); | |
jMenu7 = new javax.swing.JMenu(); | |
jMenuItem8 = new javax.swing.JMenuItem(); | |
jMenu2 = new javax.swing.JMenu(); | |
jMenuItem7 = new javax.swing.JMenuItem(); | |
jMenuItem6 = new javax.swing.JMenuItem(); | |
jMenuItem2.setText("jMenuItem2"); | |
jMenu3.setText("File"); | |
jMenuBar2.add(jMenu3); | |
jMenu4.setText("Edit"); | |
jMenuBar2.add(jMenu4); | |
jMenu5.setText("File"); | |
jMenuBar3.add(jMenu5); | |
jMenu6.setText("Edit"); | |
jMenuBar3.add(jMenu6); | |
jLabel10.setText("jLabel10"); | |
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); | |
setTitle("Hyperlink Manager"); | |
setBackground(new java.awt.Color(0, 0, 0)); | |
setForeground(new java.awt.Color(0, 0, 0)); | |
jLabel1.setFont(new java.awt.Font("Old English Text MT", 0, 36)); // NOI18N | |
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); | |
jLabel1.setText("Hyperlink Manager V 1.3"); | |
jLabel2.setFont(new java.awt.Font("Euclid Fraktur", 1, 18)); // NOI18N | |
jLabel2.setText("By Felipe Tuyama & Uriel"); | |
jTabbedPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); | |
jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); | |
jButton6.setText("Url"); | |
jButton6.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton6ActionPerformed(evt); | |
} | |
}); | |
jButton7.setText("Metatag"); | |
jButton7.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton7ActionPerformed(evt); | |
} | |
}); | |
jButton8.setText("Comment"); | |
jButton8.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton8ActionPerformed(evt); | |
} | |
}); | |
jTextField1.addMouseListener(new java.awt.event.MouseAdapter() { | |
public void mouseClicked(java.awt.event.MouseEvent evt) { | |
jTextField1MouseClicked(evt); | |
} | |
}); | |
jTextField1.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField1ActionPerformed(evt); | |
} | |
}); | |
jLabel3.setText("Nome da Url"); | |
jLabel4.setText("{ Url / Metatag / Comment } a adicionar"); | |
jTextField2.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField2ActionPerformed(evt); | |
} | |
}); | |
jTextField3.setEditable(false); | |
jTextField3.setForeground(new java.awt.Color(102, 102, 102)); | |
jTextField3.setText("Digite os dados e então clique no botão."); | |
jTextField3.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField3ActionPerformed(evt); | |
} | |
}); | |
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); | |
jPanel3.setLayout(jPanel3Layout); | |
jPanel3Layout.setHorizontalGroup( | |
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addGap(27, 27, 27) | |
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) | |
.addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addGap(35, 35, 35) | |
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addGap(10, 10, 10) | |
.addComponent(jLabel4)) | |
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) | |
.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE) | |
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE) | |
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING) | |
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE))) | |
.addContainerGap(44, Short.MAX_VALUE)) | |
); | |
jPanel3Layout.setVerticalGroup( | |
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addGap(40, 40, 40) | |
.addComponent(jButton6)) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addGap(20, 20, 20) | |
.addComponent(jLabel3) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addComponent(jLabel4) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addGroup(jPanel3Layout.createSequentialGroup() | |
.addComponent(jButton7) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton8))) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addContainerGap(35, Short.MAX_VALUE)) | |
); | |
jTabbedPane1.addTab("Add Menu", jPanel3); | |
jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); | |
jButton1.setText("Url"); | |
jButton1.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton1ActionPerformed(evt); | |
} | |
}); | |
jButton2.setText("Metatag"); | |
jButton2.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton2ActionPerformed(evt); | |
} | |
}); | |
jButton3.setText("Comment"); | |
jButton3.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton3ActionPerformed(evt); | |
} | |
}); | |
jTextField4.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField4ActionPerformed(evt); | |
} | |
}); | |
jTextField5.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField5ActionPerformed(evt); | |
} | |
}); | |
jTextField6.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField6ActionPerformed(evt); | |
} | |
}); | |
jLabel5.setText("Nome da Url"); | |
jLabel6.setText("{ Nome, Url, Metatag, Comment } antigo a editar"); | |
jLabel8.setText("{ Nome, Url, Metatag, Comment } novo a editar"); | |
jTextField8.setEditable(false); | |
jTextField8.setForeground(new java.awt.Color(102, 102, 102)); | |
jTextField8.setText("Digite os dados e então clique no botão."); | |
jTextField8.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField8ActionPerformed(evt); | |
} | |
}); | |
jButton10.setText("Nome"); | |
jButton10.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton10ActionPerformed(evt); | |
} | |
}); | |
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); | |
jPanel4.setLayout(jPanel4Layout); | |
jPanel4Layout.setHorizontalGroup( | |
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGap(10, 10, 10) | |
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup() | |
.addGap(27, 27, 27) | |
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) | |
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE) | |
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) | |
.addGap(35, 35, 35) | |
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) | |
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGap(10, 10, 10) | |
.addComponent(jLabel6)) | |
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGap(10, 10, 10) | |
.addComponent(jLabel8))))) | |
.addGap(0, 44, Short.MAX_VALUE)) | |
); | |
jPanel4Layout.setVerticalGroup( | |
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGap(20, 20, 20) | |
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jLabel6) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE) | |
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addContainerGap()) | |
.addGroup(jPanel4Layout.createSequentialGroup() | |
.addGap(40, 40, 40) | |
.addComponent(jButton10) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton1) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton2) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton3) | |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) | |
); | |
jTabbedPane1.addTab("Edit Menu", jPanel4); | |
jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder()); | |
jButton4.setText("Url"); | |
jButton4.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton4ActionPerformed(evt); | |
} | |
}); | |
jButton5.setText("Metatag"); | |
jButton5.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton5ActionPerformed(evt); | |
} | |
}); | |
jButton9.setText("Comment"); | |
jButton9.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton9ActionPerformed(evt); | |
} | |
}); | |
jTextField7.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField7ActionPerformed(evt); | |
} | |
}); | |
jTextField9.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField9ActionPerformed(evt); | |
} | |
}); | |
jTextField10.setEditable(false); | |
jTextField10.setForeground(new java.awt.Color(102, 102, 102)); | |
jTextField10.setText("Digite os dados e então clique no botão."); | |
jTextField10.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jTextField10ActionPerformed(evt); | |
} | |
}); | |
jLabel7.setText("Nome da Url"); | |
jLabel9.setText("{ Url, Metatag, Comment } a remover"); | |
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); | |
jPanel5.setLayout(jPanel5Layout); | |
jPanel5Layout.setHorizontalGroup( | |
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel5Layout.createSequentialGroup() | |
.addGap(27, 27, 27) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) | |
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addGap(35, 35, 35) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) | |
.addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE) | |
.addComponent(jTextField9)) | |
.addComponent(jTextField10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addGroup(jPanel5Layout.createSequentialGroup() | |
.addGap(10, 10, 10) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addComponent(jLabel9) | |
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))) | |
.addContainerGap(44, Short.MAX_VALUE)) | |
); | |
jPanel5Layout.setVerticalGroup( | |
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel5Layout.createSequentialGroup() | |
.addGap(20, 20, 20) | |
.addComponent(jLabel7) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | |
.addComponent(jButton4) | |
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel5Layout.createSequentialGroup() | |
.addComponent(jButton5) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton9)) | |
.addGroup(jPanel5Layout.createSequentialGroup() | |
.addComponent(jLabel9) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addGap(30, 30, 30)) | |
); | |
jTabbedPane1.addTab("Remove Menu", jPanel5); | |
jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder()); | |
jTextArea1.setEditable(false); | |
jTextArea1.setColumns(20); | |
jTextArea1.setRows(5); | |
jScrollPane1.setViewportView(jTextArea1); | |
jButton11.setText("Lista"); | |
jButton11.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton11ActionPerformed(evt); | |
} | |
}); | |
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nome", "Metatag", "Comment", "Data" })); | |
jComboBox1.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jComboBox1ActionPerformed(evt); | |
} | |
}); | |
jButton16.setText("Exibir por:"); | |
jButton16.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jButton16ActionPerformed(evt); | |
} | |
}); | |
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); | |
jPanel6.setLayout(jPanel6Layout); | |
jPanel6Layout.setHorizontalGroup( | |
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(jPanel6Layout.createSequentialGroup() | |
.addGap(25, 25, 25) | |
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) | |
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 402, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addGroup(jPanel6Layout.createSequentialGroup() | |
.addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) | |
.addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) | |
.addContainerGap(20, Short.MAX_VALUE)) | |
); | |
jPanel6Layout.setVerticalGroup( | |
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() | |
.addGap(6, 6, 6) | |
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | |
.addComponent(jButton11) | |
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addComponent(jButton16)) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE) | |
.addContainerGap()) | |
); | |
jTabbedPane1.addTab("View Menu", jPanel6); | |
jMenu1.setText("Arquivo"); | |
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); | |
jMenuItem1.setText("Novo"); | |
jMenuItem1.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem1ActionPerformed(evt); | |
} | |
}); | |
jMenu1.add(jMenuItem1); | |
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); | |
jMenuItem3.setText("Abrir"); | |
jMenuItem3.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem3ActionPerformed(evt); | |
} | |
}); | |
jMenu1.add(jMenuItem3); | |
jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); | |
jMenuItem4.setText("Salvar"); | |
jMenuItem4.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem4ActionPerformed(evt); | |
} | |
}); | |
jMenu1.add(jMenuItem4); | |
jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0)); | |
jMenuItem5.setText("Sair"); | |
jMenuItem5.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem5ActionPerformed(evt); | |
} | |
}); | |
jMenu1.add(jMenuItem5); | |
jMenuBar1.add(jMenu1); | |
jMenu7.setText("Tema"); | |
jMenuItem8.setText("Dark Theme"); | |
jMenuItem8.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem8ActionPerformed(evt); | |
} | |
}); | |
jMenu7.add(jMenuItem8); | |
jMenuBar1.add(jMenu7); | |
jMenu2.setText("Ajuda"); | |
jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0)); | |
jMenuItem7.setText("Ajuda"); | |
jMenuItem7.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem7ActionPerformed(evt); | |
} | |
}); | |
jMenu2.add(jMenuItem7); | |
jMenuItem6.setText("Sobre"); | |
jMenuItem6.addActionListener(new java.awt.event.ActionListener() { | |
public void actionPerformed(java.awt.event.ActionEvent evt) { | |
jMenuItem6ActionPerformed(evt); | |
} | |
}); | |
jMenu2.add(jMenuItem6); | |
jMenuBar1.add(jMenu2); | |
setJMenuBar(jMenuBar1); | |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | |
getContentPane().setLayout(layout); | |
layout.setHorizontalGroup( | |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() | |
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addContainerGap()) | |
.addGroup(layout.createSequentialGroup() | |
.addGap(24, 24, 24) | |
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) | |
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) | |
.addComponent(jTabbedPane1)) | |
.addGap(0, 23, Short.MAX_VALUE)) | |
); | |
layout.setVerticalGroup( | |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | |
.addGroup(layout.createSequentialGroup() | |
.addContainerGap() | |
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) | |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
.addComponent(jTabbedPane1) | |
.addGap(18, 18, 18) | |
.addComponent(jLabel2)) | |
); | |
pack(); | |
}// </editor-fold> | |
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) { | |
List.Urls.clear(); | |
} | |
private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) { | |
System.exit(0); | |
} | |
private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) { | |
} | |
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) { | |
} | |
private void jTextField1MouseClicked(java.awt.event.MouseEvent evt) { | |
} | |
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField1.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField2.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o comentário!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.addComment(jTextField1.getText(), jTextField2.getText()); | |
jTextField3.setText("comentário adicionado com sucesso."); | |
} | |
} | |
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField1.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField2.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite a Metatag!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.addMetaTag(jTextField1.getText(), jTextField2.getText()); | |
jTextField3.setText("metatag adicionado com sucesso."); | |
} | |
} | |
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField1.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField2.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite a URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.addUrl(jTextField2.getText(), jTextField1.getText()); | |
jTextField3.setText("url adicionada com sucesso."); | |
} | |
} | |
private void jTextField8ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField4.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField5.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome antigo da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField6.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome novo da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.editUrl(jTextField5.getText(), jTextField6.getText()); | |
jTextField8.setText("url editada com sucesso."); | |
} | |
} | |
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField4.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField5.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite a antiga metataga!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField6.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite a nova metatag!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.editMetaTag(jTextField4.getText(), jTextField5.getText(), jTextField6.getText()); | |
jTextField8.setText("metatag editada com sucesso."); | |
} | |
} | |
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField4.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da URL!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField5.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o antigo comentário!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField6.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o novo comentário!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.editComment(jTextField4.getText(), jTextField5.getText(), jTextField6.getText()); | |
jTextField8.setText("comentário editado com sucesso."); | |
} | |
} | |
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField5.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o antigo nome!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField6.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o novo nome!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.editName(jTextField5.getText(), jTextField6.getText()); | |
jTextField8.setText("nome editado com sucesso."); | |
} | |
} | |
private void jTextField10ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jTextField9ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField7.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da Url!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.removeUrl(jTextField7.getText()); | |
jTextField10.setText("url removida com sucesso."); | |
} | |
} | |
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField7.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da Url!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField9.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite a metatag a remover!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.removeMetaTag(jTextField7.getText(), jTextField9.getText()); | |
jTextField10.setText("metatag removida com sucesso."); | |
} | |
} | |
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jTextField7.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o nome da Url!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else if (jTextField9.getText().equals("")) { | |
JOptionPane.showMessageDialog(null, "Digite o comentário a remover!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} else { | |
List.removeComment(jTextField7.getText(), jTextField9.getText()); | |
jTextField10.setText("comentário removida com sucesso."); | |
} | |
} | |
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) { | |
List.SaveFile(JOptionPane.showInputDialog("Digite o nome do arquivo.")); | |
JOptionPane.showMessageDialog(null, "Arquivo salvo com sucesso!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} | |
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) { | |
List.LoadFile(JOptionPane.showInputDialog("Digite o nome do arquivo.")); | |
JOptionPane.showMessageDialog(null, "Arquivo carregado com sucesso!", | |
"Alerta", JOptionPane.WARNING_MESSAGE); | |
} | |
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) { | |
JOptionPane.showMessageDialog(null, "Hyperlink Manager V 1.3\n" | |
+ "Software desenvolvido por Felipe Tuyama & Uriel, alunos do ITA\n" | |
+ "Curso de CES-22 por Edgar Yano", | |
"Informação", JOptionPane.INFORMATION_MESSAGE); | |
} | |
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) { | |
JOptionPane.showMessageDialog(null, "O programa possui 4 funções básicas:\n" | |
+ "Adição, Edição, Remoção e Visualização.\n" | |
+ "Basta acessar a operação desejada no Menu de Abas da janela principal.\n" | |
+ "Preencha com as informações desejadas e selecione o devido botão.", "Informação", JOptionPane.INFORMATION_MESSAGE); | |
} | |
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { | |
// TODO add your handling code here: | |
} | |
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) { | |
jTextArea1.setText(List.printList()); | |
} | |
private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) { | |
if (jComboBox1.getSelectedItem()=="Nome") | |
jTextArea1.setText(List.printListByName(JOptionPane.showInputDialog("Digite o Nome:"))); | |
else if (jComboBox1.getSelectedItem()=="Metatag") | |
jTextArea1.setText(List.printListByMetaTag(JOptionPane.showInputDialog("Digite a Metatag:"))); | |
else if (jComboBox1.getSelectedItem()=="Comment") | |
jTextArea1.setText(List.printListByComment(JOptionPane.showInputDialog("Digite o Comentário:"))); | |
else if (jComboBox1.getSelectedItem()=="Data") | |
jTextArea1.setText(List.printListByDate(JOptionPane.showInputDialog("Digite a Data: (formato XX/XX/XXXX)"))); | |
} | |
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) { | |
getContentPane().setBackground(Color.black); | |
jLabel1.setForeground(Color.white); jLabel2.setForeground(Color.white); | |
jLabel3.setForeground(Color.white); jLabel4.setForeground(Color.white); | |
jLabel5.setForeground(Color.white); jLabel6.setForeground(Color.white); | |
jLabel7.setForeground(Color.white); jLabel8.setForeground(Color.white); | |
jLabel9.setForeground(Color.white); jLabel10.setForeground(Color.white); | |
jMenuBar1.setBackground(Color.black); jMenuBar1.setForeground(Color.white); | |
jMenuBar1.setOpaque(true); | |
jPanel3.setBackground(Color.black); jPanel4.setBackground(Color.black); | |
jPanel5.setBackground(Color.black); jPanel6.setBackground(Color.black); | |
jTabbedPane1.setBackground(Color.black); jTabbedPane1.setForeground(Color.white); | |
jButton1.setForeground(Color.white); jButton2.setForeground(Color.white); | |
jButton3.setForeground(Color.white); jButton4.setForeground(Color.white); | |
jButton5.setForeground(Color.white); jButton6.setForeground(Color.white); | |
jButton7.setForeground(Color.white); jButton8.setForeground(Color.white); | |
jButton9.setForeground(Color.white); jButton10.setForeground(Color.white); | |
jButton11.setForeground(Color.white); | |
jButton1.setForeground(Color.black); jButton2.setForeground(Color.black); | |
jButton3.setForeground(Color.black); jButton4.setForeground(Color.black); | |
jButton5.setForeground(Color.black); jButton6.setForeground(Color.black); | |
jButton7.setForeground(Color.black); jButton8.setForeground(Color.black); | |
jButton9.setForeground(Color.black); jButton10.setForeground(Color.black); | |
jButton11.setForeground(Color.black); | |
jButton1.setOpaque(true); jButton2.setOpaque(true); | |
jButton3.setOpaque(true); jButton4.setOpaque(true); | |
jButton5.setOpaque(true); jButton6.setOpaque(true); | |
jButton7.setOpaque(true); jButton8.setOpaque(true); | |
jButton9.setOpaque(true); jButton10.setOpaque(true); | |
jButton11.setOpaque(true); | |
} | |
public static void main(String args[]) { | |
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> | |
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. | |
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html | |
*/ | |
try { | |
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { | |
if ("Nimbus".equals(info.getName())) { | |
javax.swing.UIManager.setLookAndFeel(info.getClassName()); | |
break; | |
} | |
} | |
} catch (ClassNotFoundException ex) { | |
java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | |
} catch (InstantiationException ex) { | |
java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | |
} catch (IllegalAccessException ex) { | |
java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | |
} catch (javax.swing.UnsupportedLookAndFeelException ex) { | |
java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | |
} | |
//</editor-fold> | |
java.awt.EventQueue.invokeLater(new Runnable() { | |
public void run() { | |
new GUI().setVisible(true); | |
} | |
}); | |
} | |
// Variables declaration - do not modify | |
private javax.swing.JButton jButton1; | |
private javax.swing.JButton jButton10; | |
private javax.swing.JButton jButton11; | |
private javax.swing.JButton jButton16; | |
private javax.swing.JButton jButton2; | |
private javax.swing.JButton jButton3; | |
private javax.swing.JButton jButton4; | |
private javax.swing.JButton jButton5; | |
private javax.swing.JButton jButton6; | |
private javax.swing.JButton jButton7; | |
private javax.swing.JButton jButton8; | |
private javax.swing.JButton jButton9; | |
private javax.swing.JComboBox jComboBox1; | |
private javax.swing.JLabel jLabel1; | |
private javax.swing.JLabel jLabel10; | |
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.JLabel jLabel7; | |
private javax.swing.JLabel jLabel8; | |
private javax.swing.JLabel jLabel9; | |
private javax.swing.JMenu jMenu1; | |
private javax.swing.JMenu jMenu2; | |
private javax.swing.JMenu jMenu3; | |
private javax.swing.JMenu jMenu4; | |
private javax.swing.JMenu jMenu5; | |
private javax.swing.JMenu jMenu6; | |
private javax.swing.JMenu jMenu7; | |
private javax.swing.JMenuBar jMenuBar1; | |
private javax.swing.JMenuBar jMenuBar2; | |
private javax.swing.JMenuBar jMenuBar3; | |
private javax.swing.JMenuItem jMenuItem1; | |
private javax.swing.JMenuItem jMenuItem2; | |
private javax.swing.JMenuItem jMenuItem3; | |
private javax.swing.JMenuItem jMenuItem4; | |
private javax.swing.JMenuItem jMenuItem5; | |
private javax.swing.JMenuItem jMenuItem6; | |
private javax.swing.JMenuItem jMenuItem7; | |
private javax.swing.JMenuItem jMenuItem8; | |
private javax.swing.JPanel jPanel3; | |
private javax.swing.JPanel jPanel4; | |
private javax.swing.JPanel jPanel5; | |
private javax.swing.JPanel jPanel6; | |
private javax.swing.JProgressBar jProgressBar1; | |
private javax.swing.JScrollPane jScrollPane1; | |
private javax.swing.JTabbedPane jTabbedPane1; | |
private javax.swing.JTextArea jTextArea1; | |
private javax.swing.JTextField jTextField1; | |
private javax.swing.JTextField jTextField10; | |
private javax.swing.JTextField jTextField2; | |
private javax.swing.JTextField jTextField3; | |
private javax.swing.JTextField jTextField4; | |
private javax.swing.JTextField jTextField5; | |
private javax.swing.JTextField jTextField6; | |
private javax.swing.JTextField jTextField7; | |
private javax.swing.JTextField jTextField8; | |
private javax.swing.JTextField jTextField9; | |
// End of variables declaration | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package GUI; | |
import java.util.Calendar; | |
import java.util.ArrayList; | |
public class Hyperlink { | |
public Calendar data; | |
private String name, url; | |
private ArrayList<String> metatags = new ArrayList<>(); | |
private ArrayList<String> comentarios = new ArrayList<>(); | |
Hyperlink(){ } | |
Hyperlink (String name, String Url){ | |
data = Calendar.getInstance(); | |
this.name = name; | |
this.url = Url; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ######################### Funções sobre a Url: ########################## | |
public void setUrl (String url){ | |
data = Calendar.getInstance(); | |
this.url = url; | |
} | |
public String getUrl (){ | |
return url; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ##################### Funções sobre o Nome: ############################# | |
public void setName (String name){ | |
data = Calendar.getInstance(); | |
this.name = name; | |
} | |
public String getName (){ | |
return name; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ##################### Funções sobre a Data: ############################# | |
String NewDate; | |
int i; | |
public int GetValue(char parada) { | |
String aux = ""; | |
for (i++; NewDate.charAt(i) != parada; i++) | |
aux += NewDate.charAt(i); | |
return Integer.parseInt(aux); | |
} | |
public void setDate(String InputDate) { | |
NewDate = InputDate; | |
int year, month, date, hourOfDay, minute; | |
for (i = 0; NewDate.charAt(i)!=':'; i++); i++; | |
hourOfDay = GetValue(':'); | |
minute = GetValue(' '); | |
date = GetValue('/'); | |
month = GetValue('/'); | |
year = Integer.parseInt(NewDate.substring(i+1)); | |
data.set(year, month, date, hourOfDay, minute); | |
} | |
public String getDate() { | |
String aux = ""; | |
aux += data.get(Calendar.HOUR_OF_DAY) + ":"; | |
aux += data.get(Calendar.MINUTE) + " "; | |
aux += data.get(Calendar.DAY_OF_MONTH) + "/"; | |
aux += data.get(Calendar.MONTH) + "/"; | |
aux += data.get(Calendar.YEAR); | |
return aux; | |
} | |
public boolean containDate(String Date){ | |
boolean igualdade = false; | |
String Dia, Mes, Ano; | |
Dia = Date.substring(0, 2); | |
Mes = Date.substring(3, 5); | |
Ano = Date.substring(6, 10); | |
if(data.get(Calendar.DAY_OF_MONTH)==Integer.parseInt(Dia)) | |
if (data.get(Calendar.MONTH)==Integer.parseInt(Mes)) | |
if (data.get(Calendar.YEAR)==Integer.parseInt(Ano)) | |
igualdade = true; | |
return igualdade; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ##################### Funções sobre a MetaTag: ########################## | |
public void addMetaTag (String MetaTag){ | |
data = Calendar.getInstance(); | |
metatags.add(MetaTag); | |
} | |
public void editMetaTag (String oldMetaTag, String newMetaTag){ | |
data = Calendar.getInstance(); | |
metatags.remove(oldMetaTag); | |
metatags.add(newMetaTag); | |
} | |
public void removeMetatag(String oldMetatag) { | |
data = Calendar.getInstance(); | |
metatags.remove(oldMetatag); | |
} | |
public boolean containMetaTag (String MetaTag){ | |
return (metatags.contains(MetaTag)); | |
} | |
public String printMetaTag (){ | |
String MetaList = ""; | |
if (!metatags.isEmpty()){ | |
for(String Meta : metatags) | |
MetaList += Meta+","; | |
MetaList = MetaList.substring(0, MetaList.length()-1); | |
} | |
return MetaList ; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ################### Funções sobre o Comentário: ######################## | |
public void addComment (String Comment){ | |
data = Calendar.getInstance(); | |
comentarios.add(Comment); | |
} | |
public void editComment(String oldComment, String newComment){ | |
data = Calendar.getInstance(); | |
removeComment(oldComment); | |
addComment(newComment); | |
} | |
public void removeComment(String oldComment) { | |
data = Calendar.getInstance(); | |
comentarios.remove(oldComment); | |
} | |
public boolean containComment (String Comment){ | |
return (comentarios.contains(Comment)); | |
} | |
public String printComment (){ | |
String Comment = ""; | |
if (!comentarios.isEmpty()){ | |
for(String Come : comentarios) | |
Comment += "\n \""+Come+"\""; | |
} | |
Comment +="\n"+" "; | |
return Comment ; | |
} | |
// ---------------------------------//-------------------------------------- | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package GUI; | |
import java.util.ArrayList; | |
public class ListaHyperlinks | |
{ | |
Arquivo File = new Arquivo(); | |
ArrayList<Hyperlink> Urls = new ArrayList<>(); | |
// ---------------------------------//-------------------------------------- | |
// ######################## Funções sobre a Url: ########################### | |
public void addUrl(String URL, String name){ | |
Hyperlink newUrl = new Hyperlink(name, URL); | |
Urls.add(newUrl); | |
} | |
public void editUrl(String oldUrl, String newUrl){ | |
for (Hyperlink Url : Urls) | |
if (Url.getUrl().equals(oldUrl)) | |
Url.setUrl(newUrl); | |
} | |
public void editName(String oldName, String newName){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(oldName)) | |
Url.setName(newName); | |
} | |
public void removeUrl(String name){ | |
Hyperlink aux = new Hyperlink("",""); | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
aux = Url; | |
if (aux.getName().equals(name)) | |
Urls.remove(aux); | |
} | |
// ---------------------------------//-------------------------------------- | |
// ###################### Funções sobre a MetaTag: ######################### | |
public void addMetaTag(String name, String MetaTag){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.addMetaTag(MetaTag); | |
} | |
public void editMetaTag(String name, String oldMeta, String newMeta){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.editMetaTag(oldMeta, newMeta); | |
} | |
public void removeMetaTag(String name, String Meta){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.removeMetatag(Meta); | |
} | |
// ---------------------------------//-------------------------------------- | |
// ################## Funções sobre o Comentário: ########################## | |
public void addComment(String name, String Comment){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.addComment(Comment); | |
} | |
public void editComment(String name, String oldComment, String newComment){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.editComment(oldComment, newComment); | |
} | |
public void removeComment(String name, String Comment){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(name)) | |
Url.removeComment(Comment); | |
} | |
// ---------------------------------//-------------------------------------- | |
// ###################### Funções sobre a Impressão ######################## | |
public String printUrl(Hyperlink Url){ | |
String retorno = ""; | |
retorno+="--------------------------------------\n"; | |
retorno+="[Url #" + (Urls.indexOf(Url) + 1) + "]: "+ Url.getName()+"\n"; | |
retorno+=" "+Url.getUrl()+"\n"; | |
retorno+=" MetaTags: {" + Url.printMetaTag() + "}\n"; | |
retorno+=" Comments: " + Url.printComment()+"\n"; | |
retorno+=" Última Modificação: " + Url.getDate()+"\n"; | |
retorno+="---------------------------------------\n"; | |
return retorno; | |
} | |
public String printList() { | |
String retorno = ""; | |
retorno+="\n############## Url List ##############\n"; | |
for (Hyperlink Url : Urls) | |
retorno+=printUrl(Url); | |
if (Urls.isEmpty()) | |
retorno += "Empty List!\n"; | |
retorno+="######################################\n"; | |
return retorno; | |
} | |
public String printListByName(String Name){ | |
String retorno =""; | |
boolean empty = true; | |
retorno+="\n####### Url List Name:{"+Name+"}######\n"; | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(Name)){ | |
retorno += printUrl(Url); | |
empty = false; | |
} | |
if (empty) retorno+="Empty List!\n"; | |
retorno+="######################################\n\n"; | |
return retorno; | |
} | |
public String printListByMetaTag(String MetaTag){ | |
String retorno = ""; | |
boolean empty = true; | |
retorno+="\n#### Url List MetaTag:{"+MetaTag+"}###\n"; | |
for (Hyperlink Url : Urls) | |
if (Url.containMetaTag(MetaTag)){ | |
retorno += printUrl(Url); | |
empty = false; | |
} | |
if (empty) retorno+="Empty List!\n"; | |
retorno+="######################################\n"; | |
return retorno; | |
} | |
public String printListByComment(String Comment){ | |
String retorno = ""; | |
boolean empty = true; | |
retorno+="\n#### Url List Comment:{"+Comment+"}###\n"; | |
for (Hyperlink Url : Urls) | |
if (Url.containComment(Comment)){ | |
retorno += printUrl(Url); | |
empty = false; | |
} | |
if (empty) retorno+="Empty List!\n"; | |
retorno+="######################################\n\n"; | |
return retorno; | |
} | |
public String printListByDate(String Date){ | |
String retorno = ""; | |
boolean empty = true; | |
retorno+="\n##### Url List Date:{"+Date+"}#####\n"; | |
for (Hyperlink Url : Urls) | |
if(Url.containDate(Date)){ | |
retorno += printUrl(Url); | |
empty = false; | |
} | |
if (empty) retorno+="Empty List!\n"; | |
retorno+="######################################\n\n"; | |
return retorno; | |
} | |
// ---------------------------------//-------------------------------------- | |
// ################### Funções sobre o Load Arquivo ######################### | |
private void LoadMetaTags(String Metas, String UrlName){ | |
int i; | |
String MetaTag; | |
for (i =0; Metas.charAt(i)!='{'; i++); | |
while (Metas.charAt(i)!='}'){ | |
for (i++, MetaTag = ""; Metas.charAt(i)!=','&& Metas.charAt(i)!='}'; i++) | |
MetaTag += Metas.charAt(i); | |
addMetaTag(UrlName, MetaTag); | |
} | |
} | |
private void LoadComments(String Commen, String UrlName){ | |
String Comment = Commen.substring(2, Commen.length()-1); | |
addComment(UrlName, Comment); | |
} | |
public void LoadDate (String NewDate, String Name){ | |
for (Hyperlink Url : Urls) | |
if (Url.getName().equals(Name)) | |
Url.setDate(NewDate); | |
} | |
public void LoadFile(String Name){ | |
String Url = "", UrlName = ""; | |
File.openRead(Name); | |
while (File.isReadable()){ | |
while(!File.read().contains("Url #") && File.isReadable()); | |
if (File.isReadable()){ | |
Url = File.read(); | |
UrlName = File.read(); | |
addUrl(Url, UrlName); | |
LoadMetaTags(File.read(), UrlName); | |
File.read(); | |
for (String aux = File.read(); !(aux.equals(" ")); aux = File.read()) | |
LoadComments(aux, UrlName); | |
LoadDate(File.read(), UrlName); | |
} | |
} | |
File.closeRead(); | |
} | |
// ---------------------------------//-------------------------------------- | |
// ################### Funções sobre o save Arquivo ######################## | |
public void writeUrl(Hyperlink Url){ | |
File.write("--------------------------------------"); | |
File.write("[Url #" + (Urls.indexOf(Url) + 1) + "]: "); | |
File.write(Url.getUrl()); | |
File.write(Url.getName()); | |
File.write("MetaTags: {" + Url.printMetaTag() + "}"); | |
File.write("Comments: " + Url.printComment()); | |
File.write("Última Modificação: " + Url.getDate()); | |
File.write("---------------------------------------"); | |
} | |
public void SaveFile(String Name){ | |
File.openWrite(Name); | |
File.write("########################################"); | |
File.write("### Hyperlink Manager V 1.2 - Jarvis ###"); | |
File.write("########################################"); | |
File.write("\n############## Url List ##############"); | |
for (Hyperlink Url : Urls) | |
writeUrl(Url); | |
if (Urls.isEmpty()) | |
File.write("Empty List!"); | |
File.write("######################################"); | |
File.closeWrite(); | |
} | |
// ---------------------------------//-------------------------------------- | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment