MAJ
This commit is contained in:
parent
cb43ed0845
commit
24a55d1cdb
Binary file not shown.
6
bin/.gitignore
vendored
6
bin/.gitignore
vendored
@ -1,3 +1,9 @@
|
||||
/app/
|
||||
/MEPTL/
|
||||
/resources/
|
||||
/allContent.svg
|
||||
/allcontent.png
|
||||
/allcontentmini.png
|
||||
/auteurcreateur.png
|
||||
/auteurcreateur.svg
|
||||
/auteurcreateurmini.png
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
137
src/app/afficheText.java
Normal file
137
src/app/afficheText.java
Normal file
@ -0,0 +1,137 @@
|
||||
package app;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
|
||||
import cXML.node;
|
||||
|
||||
public class afficheText extends JEditorPane {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
public void refreshAffichage(node nod) {
|
||||
|
||||
if(nod!=null) {
|
||||
setContentType("text/html");
|
||||
node nodeParent = nod.getParent();
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(baliseStyle.balise());
|
||||
|
||||
sb.append("<p class=\"p1\">Parent = " + nodeParent.getNomElt() + "</p><br>");
|
||||
sb.append("<hr>");
|
||||
sb.append("<br><h1>Nom du node : " + nod.getNomElt() + "</h1><br>");
|
||||
sb.append("<hr>");
|
||||
|
||||
|
||||
if(nod.getAttributs().size()>0) {
|
||||
if(nod.getAttributs().size()==1) sb.append("<br><h4><u>L'ATTRIBUT DU NODE</u></h4>");
|
||||
if(nod.getAttributs().size()>1) sb.append("<br><h4><u>LES ATTRIBUTS DU NODE</u></h4>");
|
||||
}
|
||||
if(nod.getAttributs().size()<=0) {
|
||||
if(nod.getAttributs().size()==1) sb.append("<br><h4><u>PAS D'ATTRIBUT DANS CE NODE</u></h4>");
|
||||
}
|
||||
|
||||
Enumeration<String> key = nod.getAttributs().keys();
|
||||
List<String> Lesattributsdunode = new ArrayList<String>();
|
||||
while(key.hasMoreElements()) {
|
||||
String K = key.nextElement();
|
||||
Lesattributsdunode.add(K);
|
||||
}
|
||||
//permet le tri par ordre alphabétique des clés du dictionnaire
|
||||
Lesattributsdunode = Lesattributsdunode.stream().sorted().collect(Collectors.toList());
|
||||
|
||||
if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p2\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p2\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p2\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p2\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
|
||||
if(nod.getAttributs().get("evaluer")!=null) if(!nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(nod.getAttributs().size()>0) {
|
||||
if(nod.getAttributs().get("evaluer")==null) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!nod.retourneLesContenusEnfants("").trim().isEmpty()) {
|
||||
sb.append("<br><br><h4><u>Contenu</u></h4><br> " + nod.retourneLesContenusEnfants("") );
|
||||
}
|
||||
|
||||
setText("<html>"+sb.toString()+"</html>");
|
||||
}
|
||||
if(nod==null) {
|
||||
setText("");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
148
src/app/allContent.java
Normal file
148
src/app/allContent.java
Normal file
@ -0,0 +1,148 @@
|
||||
package app;
|
||||
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
import cXML.node;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
public class allContent extends JFrame {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
private JTextField textFieldPoint;
|
||||
private JLabel lblExplication;
|
||||
node nod;
|
||||
afficheText J;
|
||||
JComboBox<String> comboBoxValeur;
|
||||
String valeur="strict";
|
||||
int point=0;
|
||||
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public allContent(node nod, afficheText J) {
|
||||
this.nod=nod;
|
||||
this.J=J;
|
||||
|
||||
|
||||
if(nod.getAttributs().get("allContent")!=null) {
|
||||
String value = nod.getAttributs().get("allContent");
|
||||
if(value.contains("strictSansEspace")) { value=value.replace("strictSansEspace", "");valeur="strictSansEspace";}
|
||||
if(value.contains("strict")) {value=value.replace("strict", "");valeur="strict";}
|
||||
if(value.contains("environ")) {value=value.replace("environ", "");valeur="environ";}
|
||||
|
||||
point = Integer.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
setTitle("allContent");
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 450, 300);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(null);
|
||||
|
||||
JButton btnNewButton = new JButton("Valide");
|
||||
btnNewButton.setBounds(295, 216, 114, 34);
|
||||
contentPane.add(btnNewButton);
|
||||
|
||||
JLabel lblValeurDeLattribut = new JLabel("Type d'évaluation");
|
||||
lblValeurDeLattribut.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
lblValeurDeLattribut.setBounds(10, 105, 130, 22);
|
||||
contentPane.add(lblValeurDeLattribut);
|
||||
|
||||
JLabel lblDescription = new JLabel("<html>Cet attribut permet d'évaluer le contenu du node et de celui des nodes enfants de ce node.</html>");
|
||||
lblDescription.setLabelFor(this);
|
||||
lblDescription.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
lblDescription.setBounds(10, 11, 399, 50);
|
||||
contentPane.add(lblDescription);
|
||||
|
||||
comboBoxValeur = new JComboBox<String>();
|
||||
comboBoxValeur.setModel(new DefaultComboBoxModel<String>(new String[] {"strict", "strictSansEspace", "environ"}));
|
||||
comboBoxValeur.setSelectedItem(valeur);
|
||||
comboBoxValeur.setBounds(150, 106, 130, 22);
|
||||
contentPane.add(comboBoxValeur);
|
||||
|
||||
JLabel lblPoint = new JLabel("Combien de point?");
|
||||
lblPoint.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
lblPoint.setBounds(10, 72, 130, 22);
|
||||
contentPane.add(lblPoint);
|
||||
|
||||
textFieldPoint = new JTextField();
|
||||
textFieldPoint.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
textFieldPoint.setText("0");
|
||||
textFieldPoint.setBounds(150, 72, 43, 20);
|
||||
textFieldPoint.setColumns(6);
|
||||
textFieldPoint.setText(String.valueOf(point));
|
||||
contentPane.add(textFieldPoint);
|
||||
|
||||
|
||||
lblExplication = new JLabel("<html>Dans le fichier de l'étudiants.<br>Le contenu du node doit être rigoureusement identique, CASE comprise.</html>");
|
||||
|
||||
if(comboBoxValeur.getSelectedItem().equals("strict")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node doit être rigoureusement identique, CASE comprise.</html>");
|
||||
}
|
||||
if(comboBoxValeur.getSelectedItem().equals("strictSansEspace")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node doit être rigoureusement identique, CASE comprise, mais ignore les espaces en début et fin.</html>");
|
||||
}
|
||||
if(comboBoxValeur.getSelectedItem().equals("environ")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node peut être plus ou moins proche (voir le paramètre similude), la CASE est ignorée.</html>");
|
||||
}
|
||||
|
||||
lblExplication.setBounds(10, 149, 399, 56);
|
||||
contentPane.add(lblExplication);
|
||||
|
||||
|
||||
comboBoxValeur.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if(comboBoxValeur.getSelectedItem().equals("strict")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node doit être rigoureusement identique, CASE comprise.</html>");
|
||||
}
|
||||
if(comboBoxValeur.getSelectedItem().equals("strictSansEspace")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node doit être rigoureusement identique, CASE comprise, mais ignore les espaces en début et fin.</html>");
|
||||
}
|
||||
if(comboBoxValeur.getSelectedItem().equals("environ")) {
|
||||
lblExplication.setText("<html>Dans le fichier de l'étudiants.<br>Le contenu du node peut être plus ou moins proche (voir le paramètre similude), la CASE est ignorée.</html>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnNewButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
int point = Integer.valueOf(textFieldPoint.getText());
|
||||
if(point<0) point =0;
|
||||
nod.getAttributs().put("allContent", comboBoxValeur.getSelectedItem() + String.valueOf(point));
|
||||
J.refreshAffichage(nod);
|
||||
dispose();
|
||||
} catch (Exception e2) {
|
||||
JOptionPane.showMessageDialog(null, "Le nombre de point doit être un entier.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package app;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
|
||||
import cXML.node;
|
||||
|
||||
import java.awt.FlowLayout;
|
||||
@ -19,10 +21,17 @@ import javax.swing.JOptionPane;
|
||||
import java.awt.Font;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.FocusManager;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.ActionEvent;
|
||||
import javax.swing.ImageIcon;
|
||||
import java.awt.GridLayout;
|
||||
|
||||
|
||||
public class attributs extends JFrame {
|
||||
|
||||
@ -31,25 +40,30 @@ public class attributs extends JFrame {
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
|
||||
node nod;
|
||||
afficheText J;
|
||||
int indexSelect=0;
|
||||
|
||||
ArrayList<JLabel> Leslabels = new ArrayList<JLabel>();
|
||||
ArrayList<JTextField> Lesvaleurs = new ArrayList<JTextField>();
|
||||
ArrayList<JCheckBox> Lesevaluer = new ArrayList<JCheckBox>();
|
||||
ArrayList<JTextField> Lespoints = new ArrayList<JTextField>();
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
@SuppressWarnings("unlikely-arg-type")
|
||||
public attributs(node nod) {
|
||||
public attributs(node nod, afficheText J) {
|
||||
this.nod=nod;
|
||||
this.J=J;
|
||||
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setBounds(100, 100, 727, 669);
|
||||
setBounds(100, 100, 779, 669);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
|
||||
ArrayList<JLabel> Leslabels = new ArrayList<JLabel>();
|
||||
ArrayList<JTextField> Lesvaleurs = new ArrayList<JTextField>();
|
||||
ArrayList<JCheckBox> Lesevaluer = new ArrayList<JCheckBox>();
|
||||
ArrayList<JTextField> Lespoints = new ArrayList<JTextField>();
|
||||
|
||||
|
||||
JPanel panelGauche = new JPanel();
|
||||
contentPane.add(panelGauche, BorderLayout.WEST);
|
||||
@ -70,13 +84,37 @@ public class attributs extends JFrame {
|
||||
|
||||
JPanel panelDroite = new JPanel();
|
||||
contentPane.add(panelDroite, BorderLayout.EAST);
|
||||
JButton btnNewButton_1 = new JButton("Intervalle");
|
||||
btnNewButton_1.setIcon(new ImageIcon(attributs.class.getResource("/resources/intervallemini.png")));
|
||||
btnNewButton_1.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int j = Lesvaleurs.get(indexSelect).getCaretPosition();
|
||||
System.out.println("position du cursor "+ j);
|
||||
String newValue = Lesvaleurs.get(indexSelect).getText().substring(0, j) + "→" + Lesvaleurs.get(indexSelect).getText().substring(j, Lesvaleurs.get(indexSelect).getText().length());
|
||||
Lesvaleurs.get(indexSelect).setText(newValue);
|
||||
}
|
||||
});
|
||||
panelDroite.setLayout(new GridLayout(12, 1, 0, 0));
|
||||
|
||||
panelDroite.add(btnNewButton_1);
|
||||
|
||||
JButton btnNewButton_2 = new JButton("Text clean");
|
||||
btnNewButton_2.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int j = Lesvaleurs.get(indexSelect).getCaretPosition();
|
||||
System.out.println("position du cursor "+ j);
|
||||
Lesvaleurs.get(indexSelect).setText(Lesvaleurs.get(indexSelect).getText() + "¢");
|
||||
}
|
||||
});
|
||||
btnNewButton_2.setIcon(new ImageIcon(attributs.class.getResource("/resources/textcleanmini.png")));
|
||||
panelDroite.add(btnNewButton_2);
|
||||
|
||||
JScrollPane scrollPaneCentre = new JScrollPane();
|
||||
contentPane.add(scrollPaneCentre, BorderLayout.CENTER);
|
||||
|
||||
JPanel panelCentre = new JPanel();
|
||||
scrollPaneCentre.setViewportView(panelCentre);
|
||||
panelCentre.setLayout(new MigLayout("", "[100px:n,grow][150px:n,grow 150][::80px][80px:n,grow]", "[::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px]"));
|
||||
panelCentre.setLayout(new MigLayout("", "[100px:n,grow][150px:n,grow 150][::80px][80px:n]", "[::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px]"));
|
||||
|
||||
JLabel lblNewLabel = new JLabel("Nom attribut");
|
||||
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
|
||||
@ -92,9 +130,7 @@ public class attributs extends JFrame {
|
||||
|
||||
JLabel lblNewLabel_3 = new JLabel("Point(s)");
|
||||
lblNewLabel_3.setFont(new Font("Tahoma", Font.BOLD, 11));
|
||||
panelCentre.add(lblNewLabel_3, "cell 3 0");
|
||||
|
||||
|
||||
panelCentre.add(lblNewLabel_3, "cell 3 0,alignx left");
|
||||
|
||||
|
||||
Enumeration<String> key = nod.getAttributs().keys();
|
||||
@ -119,11 +155,13 @@ public class attributs extends JFrame {
|
||||
}
|
||||
|
||||
JTextField txtFielPoints = new JTextField(point);
|
||||
txtFielPoints.setColumns(2);
|
||||
JTextField txtFielValue = new JTextField(value);
|
||||
txtFielValue.addMouseListener(new MyMouseListener());
|
||||
txtFielPoints.setColumns(3);
|
||||
checkEval.setSelected(evaluer);
|
||||
|
||||
Leslabels.add(new JLabel(k));
|
||||
Lesvaleurs.add(new JTextField(value));
|
||||
Lesvaleurs.add(txtFielValue);
|
||||
Lespoints.add(txtFielPoints);
|
||||
Lesevaluer.add(checkEval);
|
||||
}
|
||||
@ -141,19 +179,20 @@ public class attributs extends JFrame {
|
||||
panelCentre.add(Lespoints.get(i), "cell 3 " + i+1 +",alignx left,growy");
|
||||
}
|
||||
|
||||
//Enabled information
|
||||
//Enabled false les valeurs ne peuvente être modifiée
|
||||
for(int i = 0 ; i<Leslabels.size();i++) {
|
||||
if(Leslabels.get(i).getText().equals("style:name")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:display-name")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:next-style-name")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:parent-style-name")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:family")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:master-page-name")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("numeroabsolue")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("numero")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:page_number")) {Lesvaleurs.get(i).setEditable(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:name")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:display-name")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:next-style-name")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:parent-style-name")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:family")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:master-page-name")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("numeroabsolue")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("numero")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
if(Leslabels.get(i).getText().equals("style:page_number")) {Lesvaleurs.get(i).setEnabled(false);}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
btnNewButton.addActionListener(new ActionListener() {
|
||||
@ -172,13 +211,13 @@ public class attributs extends JFrame {
|
||||
pointNumeric = Integer.valueOf(Lespoints.get(i).getText());
|
||||
point = String.valueOf(pointNumeric);
|
||||
} catch (Exception e2) {
|
||||
JOptionPane.showMessageDialog(null, "La valeur pour l'attributs " + Leslabels.get(i) + " n'est pas un entier");
|
||||
JOptionPane.showMessageDialog(null, "La valeur pour l'attribut " + Leslabels.get(i) + " n'est pas un entier");
|
||||
}
|
||||
value = value + point;
|
||||
|
||||
nod.getAttributs().put(Leslabels.get(i).getText(), value);
|
||||
|
||||
|
||||
J.refreshAffichage(nod);
|
||||
dispose();
|
||||
|
||||
}
|
||||
@ -187,13 +226,36 @@ public class attributs extends JFrame {
|
||||
});
|
||||
|
||||
|
||||
addMouseListener((MouseListener) new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent me) {
|
||||
System.out.println(me);
|
||||
Component focusOwner = FocusManager.getCurrentManager().getFocusOwner();
|
||||
System.out.println(focusOwner.getName());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
class MyMouseListener extends MouseAdapter {
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getClickCount() == 3) {
|
||||
System.out.println("triple-click");
|
||||
} else if (evt.getClickCount() == 2) {
|
||||
System.out.println("double-click");
|
||||
}
|
||||
else if (evt.getClickCount() == 1) {
|
||||
System.out.println("click");
|
||||
}
|
||||
Component focusOwner = FocusManager.getCurrentManager().getFocusOwner();
|
||||
indexSelect = Lesvaleurs.indexOf(focusOwner);
|
||||
System.out.println("indexSelect = " + indexSelect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,18 +11,15 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenu;
|
||||
@ -62,7 +59,7 @@ public class create extends JFrame {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// les élément de create
|
||||
private JTree tree = new JTree();
|
||||
private JEditorPane textNodeSelect = new JEditorPane();
|
||||
private afficheText textNodeSelect = new afficheText();
|
||||
private JToolBar toolBar = new JToolBar();
|
||||
private JMenuBar menuBar = new JMenuBar();
|
||||
|
||||
@ -168,7 +165,10 @@ public class create extends JFrame {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if(tree.getSelectionPath()!=null) {
|
||||
refeshNodeSelected();
|
||||
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
createPopupMenuTree(nod);
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -180,125 +180,6 @@ public class create extends JFrame {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void refeshNodeSelected() {
|
||||
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
|
||||
|
||||
if(tree.getSelectionPath()!=null) {
|
||||
|
||||
textNodeSelect.setContentType("text/html");
|
||||
|
||||
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
node nodeParent = nod.getParent();
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(balisestyles());
|
||||
|
||||
sb.append("<p class=\"p1\">Parent = " + nodeParent.getNomElt() + "</p><br>");
|
||||
sb.append("<hr>");
|
||||
sb.append("<br><h1>Nom du node : " + nod.getNomElt() + "</h1><br>");
|
||||
sb.append("<hr>");
|
||||
|
||||
|
||||
if(nod.getAttributs().size()>0) {
|
||||
if(nod.getAttributs().size()==1) sb.append("<br><h4><u>L'ATTRIBUT DU NODE</u></h4>");
|
||||
if(nod.getAttributs().size()>1) sb.append("<br><h4><u>LES ATTRIBUTS DU NODE</u></h4>");
|
||||
}
|
||||
if(nod.getAttributs().size()<=0) {
|
||||
if(nod.getAttributs().size()==1) sb.append("<br><h4><u>PAS D'ATTRIBUT DANS CE NODE</u></h4>");
|
||||
}
|
||||
|
||||
Enumeration<String> key = nod.getAttributs().keys();
|
||||
List<String> Lesattributsdunode = new ArrayList<String>();
|
||||
while(key.hasMoreElements()) {
|
||||
String K = key.nextElement();
|
||||
Lesattributsdunode.add(K);
|
||||
}
|
||||
//permet le tri par ordre alphabétique des clés du dictionnaire
|
||||
Lesattributsdunode = Lesattributsdunode.stream().sorted().collect(Collectors.toList());
|
||||
|
||||
if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p2\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p2\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p2\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p2\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
|
||||
if(nod.getAttributs().get("evaluer")!=null) if(!nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(nod.getAttributs().size()>0) {
|
||||
if(nod.getAttributs().get("evaluer")==null) {
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs d'analyseWriter</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
sb.append("<br>");
|
||||
sb.append("<ul>");
|
||||
sb.append("<li class=\"p3\"><b><u>Les attributs de Writer</u></b></li>");
|
||||
for(int i=0; i < Lesattributsdunode.size();i++) {
|
||||
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(Lesattributsdunode.get(i))) {
|
||||
sb.append("<li class=\"p3\"><b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
|
||||
}
|
||||
}
|
||||
sb.append("</ul>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!nod.retourneLesContenusEnfants("").trim().isEmpty()) {
|
||||
sb.append("<br><br><h4><u>Contenu</u></h4><br> " + nod.retourneLesContenusEnfants("") );
|
||||
}
|
||||
|
||||
textNodeSelect.setText("<html>"+sb.toString()+"</html>");
|
||||
|
||||
createPopupMenuTree(nod);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -436,10 +317,7 @@ public class create extends JFrame {
|
||||
}
|
||||
|
||||
tree.setComponentPopupMenu(mnPopupTree);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -544,14 +422,7 @@ public class create extends JFrame {
|
||||
toolBar.addSeparator();
|
||||
JButton button = toolBar.add( actEvaluer );
|
||||
button.setIcon(new ImageIcon(create.class.getResource("/resources/evaluate.png")));
|
||||
|
||||
// if(commandes.fichierAnalyseValide) {
|
||||
// toolBar.add( actConfiguration ).setEnabled(true);
|
||||
// toolBar.add( actEvaluer ).setEnabled(true);
|
||||
// }else {
|
||||
// toolBar.add( actConfiguration ).setEnabled( false );
|
||||
// toolBar.add( actEvaluer ).setEnabled(false);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -630,7 +501,7 @@ public class create extends JFrame {
|
||||
@Override public void actionPerformed( ActionEvent e ) {
|
||||
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
new attributs(nod);
|
||||
new attributs(nod,textNodeSelect);
|
||||
System.out.println( "ouvre la fenêtre attributs" );
|
||||
}
|
||||
};
|
||||
@ -770,7 +641,6 @@ public class create extends JFrame {
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
} catch (CloneNotSupportedException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
System.out.println("Save as file: " + fileToSave.getAbsolutePath());
|
||||
@ -931,7 +801,7 @@ public class create extends JFrame {
|
||||
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.<br>Cependant,la valeur a été modifiée.<br>poids=1.</h2>");
|
||||
}else {
|
||||
nod.poids(Double.valueOf(poids));
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
textNodeSelect.setText(balisestyles());
|
||||
@ -982,8 +852,7 @@ public class create extends JFrame {
|
||||
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier.<br>L'attribut n'a pas été modifiée.</h2>");
|
||||
}
|
||||
}
|
||||
refeshNodeSelected();
|
||||
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1026,8 +895,7 @@ public class create extends JFrame {
|
||||
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier.<br>L'attribut n'a pas été modifiée.</h2>");
|
||||
}
|
||||
}
|
||||
refeshNodeSelected();
|
||||
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1049,20 +917,7 @@ public class create extends JFrame {
|
||||
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
|
||||
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
int point = 0;
|
||||
String valeur = "strict";
|
||||
if(nod.getAttributs().get("allContent")!=null) {
|
||||
String value = nod.getAttributs().get("allContent");
|
||||
if(value.contains("strictSansEspace")) { value=value.replace("strictSansEspace", "");valeur="strictSansEspace";}
|
||||
if(value.contains("strict")) {value=value.replace("strict", "");valeur="strict";}
|
||||
if(value.contains("environ")) {value=value.replace("environ", "");valeur="environ";}
|
||||
|
||||
point = Integer.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
refeshNodeSelected();
|
||||
new allContent(nod,textNodeSelect);
|
||||
|
||||
}
|
||||
};
|
||||
@ -1086,7 +941,8 @@ public class create extends JFrame {
|
||||
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
nod.supprimeAttribut("evalNameNode");
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
|
||||
}
|
||||
};
|
||||
@ -1116,7 +972,8 @@ public class create extends JFrame {
|
||||
|
||||
String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre);
|
||||
nod.titre(a);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1148,7 +1005,8 @@ public class create extends JFrame {
|
||||
if(nod.getAttributs().get("titre3")!=null) {
|
||||
nod.supprimeAttribut("titre3");
|
||||
}
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1177,7 +1035,8 @@ public class create extends JFrame {
|
||||
|
||||
String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre);
|
||||
nod.titre1(a);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1205,7 +1064,8 @@ public class create extends JFrame {
|
||||
|
||||
String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre);
|
||||
nod.titre2(a);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1233,7 +1093,8 @@ public class create extends JFrame {
|
||||
|
||||
String a = JOptionPane.showInputDialog(null,"Quel est le titre?",titre);
|
||||
nod.titre3(a);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1264,7 +1125,8 @@ public class create extends JFrame {
|
||||
|
||||
if(!avertissement) {
|
||||
nod.saut(true);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
||||
}
|
||||
@ -1299,7 +1161,8 @@ public class create extends JFrame {
|
||||
|
||||
if(!avertissement) {
|
||||
nod.saut(false);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
||||
}
|
||||
@ -1419,7 +1282,8 @@ public class create extends JFrame {
|
||||
if(nod.getLevel()==1) {
|
||||
nod.addMenu(true);
|
||||
}
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
||||
}
|
||||
@ -1455,7 +1319,8 @@ public class create extends JFrame {
|
||||
if(!avertissement) {
|
||||
nod.evaluerTrue();
|
||||
nod.addMenu(true);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
||||
}
|
||||
@ -1489,7 +1354,8 @@ public class create extends JFrame {
|
||||
if(!avertissement) {
|
||||
nod.evaluerTrue();
|
||||
nod.addMenu(false);
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
|
||||
}
|
||||
@ -1573,7 +1439,8 @@ public class create extends JFrame {
|
||||
|
||||
node nod = (node) selectNode.getUserObject();
|
||||
nod.evaluerFalse();
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(nod);
|
||||
// refeshNodeSelected();
|
||||
|
||||
|
||||
}
|
||||
@ -1594,7 +1461,8 @@ public class create extends JFrame {
|
||||
|
||||
@Override public void actionPerformed( ActionEvent e ) {
|
||||
expandAll();
|
||||
refeshNodeSelected();
|
||||
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1613,7 +1481,8 @@ public class create extends JFrame {
|
||||
|
||||
@Override public void actionPerformed( ActionEvent e ) {
|
||||
collapseAll();
|
||||
refeshNodeSelected();
|
||||
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1636,7 +1505,7 @@ public class create extends JFrame {
|
||||
textNodeSelect.setContentType("text/html");
|
||||
|
||||
expandNode(selectNode);
|
||||
refeshNodeSelected();
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1659,7 +1528,7 @@ public class create extends JFrame {
|
||||
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
|
||||
textNodeSelect.setContentType("text/html");
|
||||
collapseNode(selectNode);
|
||||
refeshNodeSelected();
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1783,7 +1652,8 @@ public class create extends JFrame {
|
||||
}
|
||||
|
||||
} else {
|
||||
refeshNodeSelected();
|
||||
textNodeSelect.refreshAffichage(null);
|
||||
// refeshNodeSelected();
|
||||
}
|
||||
|
||||
|
||||
|
BIN
src/resources/intervalle.png
Normal file
BIN
src/resources/intervalle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 586 B |
BIN
src/resources/intervallemini.png
Normal file
BIN
src/resources/intervallemini.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 388 B |
BIN
src/resources/textclean.png
Normal file
BIN
src/resources/textclean.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
src/resources/textcleanmini.png
Normal file
BIN
src/resources/textcleanmini.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 901 B |
Loading…
Reference in New Issue
Block a user