mirror of
https://github.com/LucasVbr/LecteurPdfDoubleAffichage.git
synced 2026-07-09 12:47:45 +00:00
fix #47 Ouverture de Fichier par dessus un second
This commit is contained in:
@@ -4,37 +4,9 @@
|
|||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="module-library" scope="TEST">
|
<orderEntry type="library" name="pdfbox-app-2.0.25" level="project" />
|
||||||
<library name="JUnit4">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library" scope="TEST">
|
|
||||||
<library name="JUnit5.7.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.7.0/junit-jupiter-5.7.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.7.0/junit-jupiter-params-5.7.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar!/" />
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.7.0/junit-platform-engine-1.7.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="library" name="pdfbox-2.0" level="project" />
|
|
||||||
<orderEntry type="library" name="pdfbox" level="project" />
|
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
package lecteur_pdf.menuBar.menuItems;
|
package lecteur_pdf.menuBar.menuItems;
|
||||||
|
|
||||||
|
import lecteur_pdf.GestionPdf;
|
||||||
import lecteur_pdf.IhmPdf;
|
import lecteur_pdf.IhmPdf;
|
||||||
import lecteur_pdf.SelectionnerFichier;
|
import lecteur_pdf.SelectionnerFichier;
|
||||||
|
|
||||||
@@ -31,8 +32,19 @@ public class OuvrirFichier extends MenuItem {
|
|||||||
super(parent, "Ouvrir");
|
super(parent, "Ouvrir");
|
||||||
|
|
||||||
addActionListener(e -> {
|
addActionListener(e -> {
|
||||||
|
/* On charge le fichier si c'est possible */
|
||||||
File fichier = SelectionnerFichier.ouvrirFichier();
|
File fichier = SelectionnerFichier.ouvrirFichier();
|
||||||
if (fichier != null && parent.getPdfPanel().chargerPdf(fichier)) {
|
|
||||||
|
if (fichier == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Si il y a deja un fichier d'ouvert, on le ferme */
|
||||||
|
parent.getPdfPanel().dechargerPdf();
|
||||||
|
parent.setTitle(GestionPdf.TITRE_APPLICATION);
|
||||||
|
parent.pack();
|
||||||
|
|
||||||
|
if (parent.getPdfPanel().chargerPdf(fichier)) {
|
||||||
parent.setTitle(fichier.getName());
|
parent.setTitle(fichier.getName());
|
||||||
parent.pack();
|
parent.pack();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -181,6 +181,10 @@ public class PdfPanel extends JPanel {
|
|||||||
indexPageInput.setText("");
|
indexPageInput.setText("");
|
||||||
maxPageLabel.setText("/ -");
|
maxPageLabel.setText("/ -");
|
||||||
|
|
||||||
|
/* Efface les données relatives au zoom */
|
||||||
|
scaleSizing = 0.0f;
|
||||||
|
scaleZoom = 1.0f;
|
||||||
|
|
||||||
validate();
|
validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user