Skip to content

Commit

Permalink
List Reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetmelon committed Aug 25, 2014
1 parent c2dc2fb commit 93ccc26
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 214 deletions.
4 changes: 2 additions & 2 deletions build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sun, 24 Aug 2014 22:06:09 -0400
#Mon, 25 Aug 2014 00:47:39 -0400


C\:\\Users\\Paul\\Documents\\NetBeansProjects\\PDFMerge=
C\:\\Users\\Paul\\Documents\\GitHub\\PDFMerge=
Empty file.
Empty file.
Binary file modified build/classes/pdfmerge/MainFrame$1.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame$2.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame$3.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame$4.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame$5.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame$6.class
Binary file not shown.
Binary file modified build/classes/pdfmerge/MainFrame.class
Binary file not shown.
197 changes: 0 additions & 197 deletions build/classes/pdfmerge/MainFrame.form

This file was deleted.

Binary file modified dist/PDFMerge.jar
Binary file not shown.
33 changes: 32 additions & 1 deletion dist/README.TXT
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
This is a basic PDF Merging software with GUI. Double click to go!
========================
BUILD OUTPUT DESCRIPTION
========================

When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).

To run the project from the command line, go to the dist folder and
type the following:

java -jar "PDFMerge.jar"

To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.

Notes:

* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
3 changes: 3 additions & 0 deletions src/pdfmerge/MainFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@
<Property name="text" type="java.lang.String" value="Move Down"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bMoveDownActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
34 changes: 20 additions & 14 deletions src/pdfmerge/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@
package pdfmerge;

import java.awt.Desktop;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.io.*;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JList;
import javax.swing.TransferHandler;
import javax.swing.filechooser.FileNameExtensionFilter;
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.util.PDFMergerUtility;
Expand Down Expand Up @@ -118,6 +111,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

bMoveDown.setText("Move Down");
bMoveDown.setEnabled(false);
bMoveDown.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bMoveDownActionPerformed(evt);
}
});

menu_Close.setText("File");

Expand Down Expand Up @@ -203,13 +201,13 @@ private void bMergeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:
}

fc.setSelectedFile(new File("MyMerge.pdf"));
boolean bMerge = false;
boolean isMerged = false;
if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
File fOut = fc.getSelectedFile();
if (fOut.getName().endsWith(".pdf")) {
bMerge = mergePDFs(fOut.getPath());
isMerged = mergePDFs(fOut.getPath());
} else {
bMerge = mergePDFs(fOut.getPath() + ".pdf");
isMerged = mergePDFs(fOut.getPath() + ".pdf");
}
lStatus.setText("Done!");
try {
Expand Down Expand Up @@ -257,10 +255,10 @@ private void bRemovePdfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI

private void bMoveUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bMoveUpActionPerformed
// TODO add your handling code here:
if(pdfList.getSelectedIndex() >= 0)
{
}
int nIndex = pdfList.getSelectedIndex();
pdfModel.add(nIndex-1, pdfModel.get(nIndex));
pdfModel.remove(nIndex+1);
pdfList.setSelectedIndex(nIndex-1);
}//GEN-LAST:event_bMoveUpActionPerformed

private void pdfListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_pdfListValueChanged
Expand All @@ -284,6 +282,14 @@ private void pdfListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GE
bRemovePdf.setEnabled(false);
}//GEN-LAST:event_pdfListValueChanged

private void bMoveDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bMoveDownActionPerformed
// TODO add your handling code here:
int nIndex = pdfList.getSelectedIndex();
pdfModel.add(nIndex+2, pdfModel.get(nIndex));
pdfModel.remove(nIndex);
pdfList.setSelectedIndex(nIndex+1);
}//GEN-LAST:event_bMoveDownActionPerformed

/**
* @param args the command line arguments
*/
Expand Down

0 comments on commit 93ccc26

Please sign in to comment.