$
This commit is contained in:
@@ -19,6 +19,12 @@ import java.awt.BorderLayout;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
|
||||
/**
|
||||
* [Romain]
|
||||
* Faire le pont entre la selection du fichier JSON et l'affichage
|
||||
* graphique du code JSON
|
||||
*/
|
||||
|
||||
public class GraphicsCore extends JFrame {
|
||||
private final Dimension DEFAULT_FRAME_SIZE;
|
||||
private final Dimension MINIMUM_FRAME_SIZE;
|
||||
@@ -42,6 +48,9 @@ public class GraphicsCore extends JFrame {
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initalisation des parametres de la Frame par defaut.
|
||||
*/
|
||||
private void init() {
|
||||
this.setSize(DEFAULT_FRAME_SIZE);
|
||||
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
@@ -51,6 +60,11 @@ public class GraphicsCore extends JFrame {
|
||||
cards.first(this.getContentPane());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation de la fenetre ou l'on nous demande de chemin absolut du fichier JSON
|
||||
*
|
||||
* @return Le JPanel de la premiere card du CardLayout
|
||||
*/
|
||||
private JPanel firstCard() {
|
||||
GridBagLayout layout = new GridBagLayout();
|
||||
GridBagConstraints gbc = new GridBagConstraints();
|
||||
@@ -83,6 +97,12 @@ public class GraphicsCore extends JFrame {
|
||||
return panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation de la fenetre ou sera afficher le code du fichier JSON
|
||||
*
|
||||
* @return Le JPanel contenant le rendu de Traitable
|
||||
* @see Graphics.Traitable
|
||||
*/
|
||||
private JPanel secondCard() {
|
||||
GraphicFile file = new GraphicFile(this.url);
|
||||
|
||||
@@ -104,6 +124,11 @@ public class GraphicsCore extends JFrame {
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permet de la fenetre ou l'on nous demande de chemin absolut du fichier JSON
|
||||
*
|
||||
* @param field Le chemin absolue du fichier JSON
|
||||
*/
|
||||
private void validationAction(String field) {
|
||||
try {
|
||||
this.url = new File(field).toURI().toURL();
|
||||
@@ -114,11 +139,20 @@ public class GraphicsCore extends JFrame {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourner dans la selection du fichier JSON
|
||||
*
|
||||
* @param panel Le JPanel ou l'on demande a l'utilisateur de choisir le fichier
|
||||
* JSON
|
||||
*/
|
||||
private void backAction(JPanel panel) {
|
||||
this.remove(panel);
|
||||
cards.first(this.getContentPane());
|
||||
}
|
||||
|
||||
/**
|
||||
* Selection du fichier JSON
|
||||
*/
|
||||
public void getPathOf() {
|
||||
JFileChooser jc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());
|
||||
|
||||
|
Reference in New Issue
Block a user