1

Archive Recent Version

This commit is contained in:
Kim Wittenburg
2017-07-24 16:18:59 +02:00
parent 81acafc6da
commit 46122c53c2
103 changed files with 4182 additions and 2078 deletions

131
src/audiobook/Book.java Executable file
View File

@@ -0,0 +1,131 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package audiobook;
//~--- JDK imports ------------------------------------------------------------
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* This class represents an audiobook
* @author Kim
*/
public class Book extends ArrayList<Chapter> {
private String album;
private String artist;
private File imageFile;
private String name;
private File targetFolder;
/**
* Creates a new empty audiobook
*/
public Book() {
name = "";
album = "";
artist = "";
}
/**
* Creates a new Audiobook with a specified image File
* @param imageFile
*/
public Book(File imageFile) {
setImageFile(imageFile);
}
/**
* Returns a <code>File</code> containing the cover of this audiobook.
* Returns <code>null</code> if no cover was selected.
*/
public File getImageFile() {
return imageFile;
}
/**
* Sets the image of this audiobook. Images have to be in jpeg or png format
* @param imageFile a file containing an Image
* @throws IllegalArgumentException If the image is not a jpg, jpeg or png Image
*/
public void setImageFile(File imageFile) throws IllegalArgumentException {
if (!Files.FileActions.hasExtention(imageFile, ".jpg", ".jpeg", ".png")) {
throw new IllegalArgumentException("Illegal Image format");
}
this.imageFile = imageFile;
}
/**
* Returns the folder the audiobook is to be stored in.
* @return a Folder
*/
public File getTargetFolder() {
return targetFolder;
}
/**
* Sets the folder the audiobook is to be stored in
* @param folder a Folder
*/
public void setTargetFolder(File folder) throws IllegalArgumentException {
if (!folder.isDirectory()) {
throw new IllegalArgumentException("Not a Folder");
}
this.targetFolder = folder;
}
/**
* Sets the album-tag information
* @param album a String
*/
public void setAlbum(String album) {
this.album = album;
}
/**
* Sets the artist-tag information
* @param artist aString
*/
public void setArtist(String artist) {
this.artist = artist;
}
/**
* Sets the name of the audiobook
* @param name a String
*/
public void setName(String name) {
this.name = name;
}
/**
* Returns the album-tag information
*/
public String getAlbum() {
return album;
}
/**
* Returns the artist-tag information
*/
public String getArtist() {
return artist;
}
/**
* Returns the name of this audiobook
*/
public String getName() {
return name;
}
}
//~ Formatted by Jindent --- http://www.jindent.com

145
src/audiobook/Chapter.java Executable file
View File

@@ -0,0 +1,145 @@
package audiobook;
//~--- non-JDK imports --------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import Dating.Time;
import org.jaudiotagger.audio.AudioFile;
import org.jaudiotagger.audio.AudioFileIO;
import org.jaudiotagger.audio.exceptions.CannotReadException;
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
import org.jaudiotagger.tag.TagException;
//~--- JDK imports ------------------------------------------------------------
import java.io.File;
import java.io.IOException;
import javax.swing.JOptionPane;
/**
* This class represents a chapter in a audiobook
* @author Kim
*/
public class Chapter implements Comparable<Chapter> {
private File file;
private Dating.Time time;
private String title;
/**
* Creates a new empty <code>Chapter</code>
*/
public Chapter() {}
/**
* Creates a new Chapter with the specified Values
* @param time the Duration of this track
* @param title the name of this chapter
* @param file the audiofile this chapter represents
*/
public Chapter(Time time, String title, File file) {
this.time = time;
this.title = title;
this.file = file;
}
@Override
public String toString() {
return title;
}
/**
* Returns the audiofile of this chapter
*/
public File getFile() {
return file;
}
/**
* Returns a <code>Time</code> Object containing the information about the duration of this chapter
*/
public Time getTime() {
return time;
}
/**
* Returns the title of this chapter
*/
public String getTitle() {
return title;
}
/**
* Sets the audiofile of this chapter
* @param file a file.
* @param calc wether the time should be calculated after setting the file.
* @throws IllegalArgumentException If the file is not a m4a file.
*
* @see #calculateTime() Chapter.calculateTime()
* @see File
*/
public void setFile(File file, boolean calc) throws IllegalArgumentException, CannotReadException, IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException {
if(!file.getName().endsWith(".m4a")){
throw new IllegalArgumentException("Not a m4a File");
}
this.file = file;
if(calc){
calculateTime();
}
}
/**
* Sets the audiofile of this chapter. The Time will NOT be calculated automatically
* @param f a File
* @throws IllegalArgumentException If the file is not a m4a file.
*
* @see File
*/
public void setFile(File f) throws IllegalArgumentException{
try{
setFile(f, false);
} catch(CannotReadException | IOException | TagException | ReadOnlyFileException | InvalidAudioFrameException ex){}
}
/**
* Sets the duration of this chapter. Should be calculated using {@link calculateTime()}.
*
* @see #calculateTime() Chapter.calculateTime();
* @see Time
*/
public void setTime(Time time) {
this.time = time;
}
/**
* Sets the title of this chapter
* @param title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Automatically calculates the audiofile's Duration and sets it for this chapter
* @see org.jaudiotagger.audio.AudioFile
* @see org.jaudiotagger.audio.AudioFileIO#read(java.io.File f);
*/
public void calculateTime()
throws CannotReadException, IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException {
AudioFile aFile = AudioFileIO.read(file);
setTime(new Time(0, 0, aFile.getAudioHeader().getTrackLength()));
}
@Override
public int compareTo(Chapter o) {
return getTitle().compareTo(o.getTitle());
}
}
//~ Formatted by Jindent --- http://www.jindent.com

View File

@@ -0,0 +1,212 @@
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="Datei"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="UseNowMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="In H&#xf6;rbuch &#xfc;bernehmen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="UseNowMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator2">
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="SaveMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Speichern"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SaveMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="OpenMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="&#xd6;ffnen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="OpenMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="SaveAsMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Speichern unter..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SaveAsMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="CloseMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Schlie&#xdf;en"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="CloseMenuItemActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" value="Kapitelprofil Editor"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="480" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="addPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="232" max="32767" attributes="0"/>
<Component id="addPanel" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="addPanel">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Hinzuf&#xfc;gen"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="NumberButton" alignment="0" pref="209" max="32767" attributes="0"/>
<Component id="FileNameButton" alignment="0" pref="209" max="32767" attributes="0"/>
<Component id="FilePathButton" alignment="0" pref="209" max="32767" attributes="0"/>
<Component id="TagButton" alignment="0" pref="209" max="32767" attributes="0"/>
<Component id="CommentButton" alignment="0" pref="209" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="NumberButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="FileNameButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="FilePathButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="TagButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="CommentButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="NumberButton">
<Properties>
<Property name="text" type="java.lang.String" value="Kapitelnummer"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="NumberButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="FileNameButton">
<Properties>
<Property name="text" type="java.lang.String" value="Dateinamen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="FileNameButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="FilePathButton">
<Properties>
<Property name="text" type="java.lang.String" value="Dateipfad"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="FilePathButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="TagButton">
<Properties>
<Property name="text" type="java.lang.String" value="Tag"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="TagButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="CommentButton">
<Properties>
<Property name="text" type="java.lang.String" value="Vorschau Kommentar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="CommentButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="textArea">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
<Property name="dragEnabled" type="boolean" value="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@@ -0,0 +1,523 @@
package audiobook;
import java.awt.event.ActionEvent;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringReader;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import other.Strings.QuoteProcessor;
import swing.Beans.MultipleInputPane;
/**
* A class providing a JFrame to display a simple {@link javax.swing.JTextArea} to edit text.
* @author Kim
* @see JTextArea
* @see NumberQuoteProcessor
* @see M4aTagQuoteProcessor
* @see FileNameQuoteProcessor
* @see AdvancedFileNameQuoteProcessor
* @see FilepathQuoteProcessor
* @see QuoteProcessor
*/
public class ChapterProfileCreator extends javax.swing.JFrame {
/** Creates new form ChapterProfileCreator */
public ChapterProfileCreator() {
initComponents();
textArea.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
if ((!textArea.getText().equals(lastText))) {
isSaved = false;
}
if (textArea.getText() == null || textArea.getText() == "") {
isSaved = true;
}
}
@Override
public void removeUpdate(DocumentEvent e) {
if (!textArea.getText().equals(lastText)) {
isSaved = false;
}
if (textArea.getText() == null || textArea.getText() == "") {
isSaved = true;
}
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!textArea.getText().equals(lastText)) {
isSaved = false;
}
if (textArea.getText() == null || textArea.getText() == "") {
isSaved = true;
}
}
});
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
addPanel = new javax.swing.JPanel();
NumberButton = new javax.swing.JButton();
FileNameButton = new javax.swing.JButton();
FilePathButton = new javax.swing.JButton();
TagButton = new javax.swing.JButton();
CommentButton = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
textArea = new javax.swing.JTextArea();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
UseNowMenuItem = new javax.swing.JMenuItem();
jSeparator2 = new javax.swing.JPopupMenu.Separator();
SaveMenuItem = new javax.swing.JMenuItem();
OpenMenuItem = new javax.swing.JMenuItem();
SaveAsMenuItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JPopupMenu.Separator();
CloseMenuItem = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle("Kapitelprofil Editor");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
addPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Hinzufügen"));
NumberButton.setText("Kapitelnummer");
NumberButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
NumberButtonActionPerformed(evt);
}
});
FileNameButton.setText("Dateinamen");
FileNameButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
FileNameButtonActionPerformed(evt);
}
});
FilePathButton.setText("Dateipfad");
FilePathButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
FilePathButtonActionPerformed(evt);
}
});
TagButton.setText("Tag");
TagButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TagButtonActionPerformed(evt);
}
});
CommentButton.setText("Vorschau Kommentar");
CommentButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CommentButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout addPanelLayout = new javax.swing.GroupLayout(addPanel);
addPanel.setLayout(addPanelLayout);
addPanelLayout.setHorizontalGroup(
addPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(addPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(addPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(NumberButton, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
.addComponent(FileNameButton, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
.addComponent(FilePathButton, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
.addComponent(TagButton, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
.addComponent(CommentButton, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)))
);
addPanelLayout.setVerticalGroup(
addPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(addPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(NumberButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(FileNameButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(FilePathButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TagButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CommentButton)
.addGap(53, 53, 53))
);
textArea.setColumns(20);
textArea.setRows(5);
textArea.setDragEnabled(true);
jScrollPane1.setViewportView(textArea);
jMenu1.setText("Datei");
UseNowMenuItem.setText("In Hörbuch übernehmen");
UseNowMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
UseNowMenuItemActionPerformed(evt);
}
});
jMenu1.add(UseNowMenuItem);
jMenu1.add(jSeparator2);
SaveMenuItem.setText("Speichern");
SaveMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SaveMenuItemActionPerformed(evt);
}
});
jMenu1.add(SaveMenuItem);
OpenMenuItem.setText("Öffnen");
OpenMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OpenMenuItemActionPerformed(evt);
}
});
jMenu1.add(OpenMenuItem);
SaveAsMenuItem.setText("Speichern unter...");
SaveAsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SaveAsMenuItemActionPerformed(evt);
}
});
jMenu1.add(SaveAsMenuItem);
jMenu1.add(jSeparator1);
CloseMenuItem.setText("Schließen");
CloseMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CloseMenuItemActionPerformed(evt);
}
});
jMenu1.add(CloseMenuItem);
jMenuBar1.add(jMenu1);
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()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(addPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(addPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* Adds text to the TextArea to use the chapter number
* @param evt Auto generated event; Not used
*/
private void NumberButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NumberButtonActionPerformed
JPopupMenu menu = new JPopupMenu();
JMenuItem normal = new JMenuItem(new AbstractAction("Normal") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%number<formatted='false'>>");
}
});
JMenuItem formatted = new JMenuItem(new AbstractAction("Formatiert") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%number<formatted='true'>>");
}
});
normal.setToolTipText("Kapitelnummer(1, 2, ...)");
formatted.setToolTipText("Formatierte Kapitelnummer(001, 002, ...)");
menu.add(normal);
menu.add(formatted);
menu.show(this, getMousePosition().x, getMousePosition().y);
}//GEN-LAST:event_NumberButtonActionPerformed
/**
* Adds text to the TextArea to use the filepath
* @param evt Auto generated event; Not used
*/
private void FilePathButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FilePathButtonActionPerformed
textArea.append("<%filepath>");
}//GEN-LAST:event_FilePathButtonActionPerformed
/**
* Adds text to the TextArea to use the Filename
* @param evt Auto generated event; Not used
*/
private void FileNameButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FileNameButtonActionPerformed
JPopupMenu menu = new JPopupMenu();
JMenuItem withExt = new JMenuItem(new AbstractAction("Mit Endung") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%fileName<showExtention='true'>>");
}
});
JMenuItem withoutExt = new JMenuItem(new AbstractAction("Ohne Endung") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%fileName<showExtention='false'>>");
}
});
JMenuItem advanced = new JMenuItem(new AbstractAction("Teil des Dateinamens") {
@Override
public void actionPerformed(ActionEvent e) {
MultipleInputPane pane = new MultipleInputPane("Trennungstext", "Index");
pane.setToolTipText(0, "Bsp: Datei: \"01-Test.m4a\" - Trennungstext: \"-\"");
pane.setToolTipText(1, "Der Index zwischen den Trennungstexten im Dateinamen. Muss eine Zahl sein(kann mit '#' enden; dann werden alle Teile ab dem Index übernommen)!");
if (pane.showDialog(null, "Eingabe", JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
textArea.append("<%advancedFileName<sepText='" + pane.getText(0) + "' index='" + pane.getText(1) + "'>>");
}
}
});
menu.add(withExt);
menu.add(withoutExt);
menu.add(advanced);
menu.show(this, getMousePosition().x, getMousePosition().y);
}//GEN-LAST:event_FileNameButtonActionPerformed
/**
* Checks if the file was saved and exits
* @param evt Auto generated event; Not used
*/
private void CloseMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CloseMenuItemActionPerformed
if (!isSaved) {
if (JOptionPane.showConfirmDialog(this, "Die Datei wurde nicht gespeichert. Fenster trotzdem schließen?", "Schließen?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION) {
return;
}
}
dispose();
}//GEN-LAST:event_CloseMenuItemActionPerformed
/**
* Opens a JFileChooser Dialog to let the user save the text
* @param evt
*/
private void SaveAsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveAsMenuItemActionPerformed
File userDir = new File(System.getProperty("user.dir"));
File profileFolder = new File(userDir.getPath() + "/Profile");
JFileChooser chooser = new JFileChooser(profileFolder.exists() ? profileFolder : userDir);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setMultiSelectionEnabled(false);
if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
if (chooser.getSelectedFile().exists() && JOptionPane.showConfirmDialog(this, "Die Datei " + chooser.getSelectedFile().getPath() + " existiert bereits. Überschreiben?", "Überschreiben?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION) {
return;
}
try {
saveFile = chooser.getSelectedFile();
lastText = textArea.getText();
FileWriter FWriter = new FileWriter(saveFile);
BufferedWriter writer = new BufferedWriter(FWriter);
writer.write(textArea.getText());
writer.close();
FWriter.close();
isSaved = true;
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, "Beim Speichern ist ein Fehler aufgetreten.", "Fehler", JOptionPane.ERROR_MESSAGE);
}
}
}//GEN-LAST:event_SaveAsMenuItemActionPerformed
/**
* Automatically saves the file at the last given file location. If there is no last location this method calls {@link #SaveAsMenuItemActionPerformed(java.awt.event.ActionEvent) SaveAsMenuItemActionPerformed()}
* @param evt Auto generated event; Not used
*/
private void SaveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveMenuItemActionPerformed
if (saveFile == null) {
SaveAsMenuItemActionPerformed(evt);
} else {
try {
lastText = textArea.getText();
FileWriter FWriter = new FileWriter(saveFile);
BufferedWriter writer = new BufferedWriter(FWriter);
writer.write(textArea.getText());
writer.close();
FWriter.close();
isSaved = true;
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, "Beim Speichern ist ein Fehler aufgetreten.", "Fehler", JOptionPane.ERROR_MESSAGE);
}
}
}//GEN-LAST:event_SaveMenuItemActionPerformed
/**
* Checks if the file was saved and exits
* @param evt Auto generated event; Not used
*/
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
CloseMenuItemActionPerformed(null);
}//GEN-LAST:event_formWindowClosing
/**
* Adds text to the TextArea to use tags inside the files
* @param evt Auto generated event; Not used
*/
private void TagButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TagButtonActionPerformed
JPopupMenu menu = new JPopupMenu();
menu.add(new AbstractAction("Titel") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='title'>>");
}
});
menu.add(new AbstractAction("Album") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='album'>>");
}
});
menu.add(new AbstractAction("Interpret") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='artist'>>");
}
});
menu.add(new AbstractAction("Albumsinterpret") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='album_artist'>>");
}
});
menu.add(new AbstractAction("Tracknummer") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='track'>>");
}
});
menu.add(new AbstractAction("Komponist") {
@Override
public void actionPerformed(ActionEvent e) {
textArea.append("<%tag<id='composer'>>");
}
});
menu.show(this, getMousePosition().x, getMousePosition().y);
}//GEN-LAST:event_TagButtonActionPerformed
/**
* Adds text to the TextArea to use preview text
* @param evt Auto generated event; Not used
*/
private void CommentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CommentButtonActionPerformed
textArea.insert("#\n", 0);
}//GEN-LAST:event_CommentButtonActionPerformed
/**
* Lets the user use the typed profile right now in the active project
* @param evt Auto generated event; Not used
*/
private void UseNowMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UseNowMenuItemActionPerformed
try {
BufferedReader reader = new BufferedReader(new StringReader(textArea.getText()));
String profile = "";
while ((profile = reader.readLine()).startsWith("#")) {
}
Main.window.useChapterProfile(profile);
} catch (IOException ex) {
ex.printStackTrace();
}
}//GEN-LAST:event_UseNowMenuItemActionPerformed
/**
* Lets the user choose a text file to display and edit
* @param evt
*/
private void OpenMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OpenMenuItemActionPerformed
if (!isSaved) {
if (JOptionPane.showConfirmDialog(this, "Die Datei wurde nicht gespeichert. Fortfahren?", "Öffnen?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION) {
return;
}
}
File userDir = new File(System.getProperty("user.dir"));
File profileFolder = new File(userDir.getPath() + "/Profile");
JFileChooser chooser = new JFileChooser(profileFolder.exists() ? profileFolder : userDir);
chooser.setMultiSelectionEnabled(false);
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
try {
textArea.setText("");
BufferedReader reader = new BufferedReader(new FileReader(chooser.getSelectedFile()));
String line = "";
while ((line = reader.readLine()) != null) {
textArea.append((textArea.getText().length() < 1 ? "" : "\n") + line);
}
isSaved = true;
saveFile = chooser.getSelectedFile();
lastText = textArea.getText();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}//GEN-LAST:event_OpenMenuItemActionPerformed
//<editor-fold defaultstate="collapsed" desc="Variables declaration">
private boolean isSaved = false;
private File saveFile;
private String lastText;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem CloseMenuItem;
private javax.swing.JButton CommentButton;
private javax.swing.JButton FileNameButton;
private javax.swing.JButton FilePathButton;
private javax.swing.JButton NumberButton;
private javax.swing.JMenuItem OpenMenuItem;
private javax.swing.JMenuItem SaveAsMenuItem;
private javax.swing.JMenuItem SaveMenuItem;
private javax.swing.JButton TagButton;
private javax.swing.JMenuItem UseNowMenuItem;
private javax.swing.JPanel addPanel;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPopupMenu.Separator jSeparator1;
private javax.swing.JPopupMenu.Separator jSeparator2;
private javax.swing.JTextArea textArea;
// End of variables declaration//GEN-END:variables
//</editor-fold>
}

107
src/audiobook/Main.java Executable file
View File

@@ -0,0 +1,107 @@
package audiobook;
//~--- non-JDK imports --------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import Applications.Application;
import java.awt.Desktop;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URISyntaxException;
import swing.LAF.LAF;
//~--- JDK imports ------------------------------------------------------------
import java.io.File;
import java.io.IOException;
import java.net.URI;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
/**
*
* @author Kim
*/
public class Main extends Applications.Application {
/** The book which is currently edited */
public static Book currBook;
/** Variable used as default directory in JFileChooser. Represents the last selected directory. */
public static File lastDir;
/** An Object representing the non-static methods of this class */
public static Main mainObj;
/** An Instance of {@link MainWindow} which provides methods to create an audiobook */
public static MainWindow window;
/**
* Main method called on start
*/
public static void main(String[] args) {
mainObj = new Main();
lastDir = new File(System.getProperty("user.home"));
LAF.setLAF(LAF.SystemLAF);
mainObj.createAboutBox(new ImageIcon(Main.class.getResource("audiobook.png")).getImage(),
new String[] { "Version",
"Autor" }, new String[] { "2.8 Beta", "Kim" });
if (!System.getProperty("os.name").startsWith("Windows")) {
if (JOptionPane.showConfirmDialog(
null,
"Dieses Programm ist nur auf Windows Betriebssystemen vollständig nutzbar und wurde nicht auf anderen Systemen getestet.\n\n Möchten Sie das Programm beenden?",
"Warnung", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
System.exit(1);
}
}
if (!(Float.parseFloat(System.getProperty("java.specification.version")) >= 1.7)) {
JOptionPane.showMessageDialog(null,
"Dieses Programm benötigt Java Version 1.7 oder höher.\nBitte Laden Sie die Version von oracle.com",
"Fehler", JOptionPane.WARNING_MESSAGE);
try {
Desktop.getDesktop().browse(new URI("http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html"));
} catch (URISyntaxException | IOException ex) {
ex.printStackTrace();
}
System.exit(1);
}
currBook = new Book();
window = new MainWindow();
window.setLocation(Application.getScreenCenterFor(window));
window.setVisible(true);
}
@Override
public String getInfo() {
return "Ein Programm zum Erstellen von iTunes Hörbüchern";
}
public String getName() {
return "Audiobook Maker";
}
public void exit() {
int result = JOptionPane.showConfirmDialog(null,
"Achtung: Die Eingaben werden nicht gespeichert. Vorher noch eine POD Datei erstellen?",
"Beenden?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
if (result == JOptionPane.NO_OPTION) {
super.exit();
} else if (result == JOptionPane.YES_OPTION) {
window.createPODFile();
super.exit();
}
}
}
//~ Formatted by Jindent --- http://www.jindent.com

572
src/audiobook/MainWindow.form Executable file
View File

@@ -0,0 +1,572 @@
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="buttonGroup">
</Component>
<Menu class="javax.swing.JMenuBar" name="menuBar">
<SubComponents>
<Menu class="javax.swing.JMenu" name="FileMenu">
<Properties>
<Property name="text" type="java.lang.String" value="Datei"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openFilesButtonActionPerformed"/>
</Events>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="openFilesMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Dateien &#xf6;ffnen"/>
</Properties>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="loadPODFileMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="POD Datei laden"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loadPODFileMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="ExitMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Beenden"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ExitMenuItemActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="SpecialMenu">
<Properties>
<Property name="text" type="java.lang.String" value="Spezial"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="createChapterProfileMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Kapitelprofil Editor"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createChapterProfileMenuItemActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="HelpMenu">
<Properties>
<Property name="text" type="java.lang.String" value="Hilfe"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="AboutMenuItem">
<Properties>
<Property name="text" type="java.lang.String" value="&#xdc;ber"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="AboutMenuItemActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" value="Audiobook Maker"/>
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new ImageIcon(Main.class.getResource(&quot;audiobook_icon.png&quot;)).getImage()" type="code"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="menuBar"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="useProfile" max="32767" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="SortButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="FilesScrollPane" alignment="0" pref="228" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="removeButton" max="32767" attributes="1"/>
<Component id="downButton" max="32767" attributes="1"/>
<Component id="upButton" max="32767" attributes="1"/>
<Component id="openFilesButton" alignment="0" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="BookPropPanel" max="32767" attributes="0"/>
</Group>
<Component id="ChapterPropPanel" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="FilesScrollPane" pref="371" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="useProfile" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="SortButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="openFilesButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
<Component id="upButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="downButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="removeButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="BookPropPanel" min="-2" max="-2" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="ChapterPropPanel" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="openFilesButton">
<Properties>
<Property name="text" type="java.lang.String" value="Dateien &#xf6;ffnen"/>
<Property name="toolTipText" type="java.lang.String" value="Dateien zum H&#xf6;rbuch hinzuf&#xfc;gen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openFilesButtonActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="FilesScrollPane">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="ChaptersList">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new DefaultListModel()" type="code"/>
</Property>
</Properties>
<Events>
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="ChaptersListValueChanged"/>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="ChaptersListKeyPressed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="upButton">
<Properties>
<Property name="text" type="java.lang.String" value="nach oben"/>
<Property name="toolTipText" type="java.lang.String" value="Ausgew&#xe4;hltes Kapitel nach oben bewegen"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="upButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="downButton">
<Properties>
<Property name="text" type="java.lang.String" value="nach unten"/>
<Property name="toolTipText" type="java.lang.String" value="Ausgew&#xe4;hltes Kapitel nach unten bewegen"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="removeButton">
<Properties>
<Property name="text" type="java.lang.String" value="Entfernen"/>
<Property name="toolTipText" type="java.lang.String" value="Ausgew&#xe4;hltes Kapitel entfernen"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JPanel" name="ChapterPropPanel">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Kapitel-Eigenschaften"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="TitleLabel" alignment="1" max="32767" attributes="1"/>
<Component id="FileLabel" alignment="1" max="32767" attributes="1"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="fileField" pref="571" max="32767" attributes="0"/>
<Component id="titleField" alignment="0" pref="571" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="FileLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="fileField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="TitleLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="titleField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="141" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="TitleLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Titel:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="titleField">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="toolTipText" type="java.lang.String" value="Namen f&#xfc;r ausgew&#xe4;hltes Kapitel angeben"/>
<Property name="dragEnabled" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="titleFieldActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="titleField.getDocument().addDocumentListener(new DocumentListener() {&#xa; public void changedUpdate(DocumentEvent e){&#xa; renameChapter();&#xa; }&#xa;&#xa; public void removeUpdate(DocumentEvent e){&#xa; renameChapter();&#xa; }&#xa;&#xa; public void insertUpdate(DocumentEvent e){&#xa; renameChapter();&#xa; }&#xa;});"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="FileLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Datei:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="fileField">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="BookPropPanel">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="H&#xf6;rbuch-Eigenschaften"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="NameField" pref="225" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="createPodFileButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="createAudiobookButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="TargetDirLabel" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="CoverLabel" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="CoverField" pref="305" max="32767" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="SearchCoverButton" min="-2" max="-2" attributes="1"/>
</Group>
<Component id="FolderField" alignment="1" pref="358" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="RemoveCoverButton" alignment="0" max="32767" attributes="1"/>
<Component id="SearchFolderButton" alignment="0" max="32767" attributes="1"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="CopyRadioButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="moveRadioButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="DeleteFiles" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="138" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="editTagsButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="NameTagLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="NameTag" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="ArtistTagLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="ArtistTag" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="AlbumTagLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="AlbumTag" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="165" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="CoverLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="CoverField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="RemoveCoverButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="SearchCoverButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="TargetDirLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="FolderField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="SearchFolderButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="CopyRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="moveRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="DeleteFiles" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="editTagsButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="NameTagLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="NameTag" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="ArtistTagLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="ArtistTag" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="AlbumTagLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="AlbumTag" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="createAudiobookButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="createPodFileButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="NameField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="CoverLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Cover:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="CoverField">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="SearchCoverButton">
<Properties>
<Property name="text" type="java.lang.String" value="..."/>
<Property name="toolTipText" type="java.lang.String" value="Cover-Datei suchen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SearchCoverButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="createAudiobookButton">
<Properties>
<Property name="text" type="java.lang.String" value="H&#xf6;rbuch erstellen"/>
<Property name="toolTipText" type="java.lang.String" value=".m4b Datei erstellen (vorher muss eine .POD Datei erstellt werden)"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createAudiobookButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="TargetDirLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Ordner:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="FolderField">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="SearchFolderButton">
<Properties>
<Property name="text" type="java.lang.String" value="Suchen..."/>
<Property name="toolTipText" type="java.lang.String" value="Zielordner f&#xfc;r die Dateien ausw&#xe4;hlen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SearchFolderButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="CopyRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Dateien kopieren"/>
<Property name="toolTipText" type="java.lang.String" value="Audiodateien in den Zielordner kopieren"/>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="moveRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup"/>
</Property>
<Property name="text" type="java.lang.String" value="Dateien verschieben"/>
<Property name="toolTipText" type="java.lang.String" value="Audiodateien in den Zielordner verschieben"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="createPodFileButton">
<Properties>
<Property name="text" type="java.lang.String" value=".POD Datei erstellen"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createPodFileButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="NameField">
<Properties>
<Property name="text" type="java.lang.String" value="Name"/>
<Property name="toolTipText" type="java.lang.String" value="Namen f&#xfc;r das H&#xf6;rbuch ausw&#xe4;hlen"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="NameField.getDocument().addDocumentListener(new DocumentListener() {&#xa; public void changedUpdate(DocumentEvent e){&#xa; checkPOD();&#xa; }&#xa;&#xa; public void removeUpdate(DocumentEvent e){&#xa; checkPOD();&#xa; }&#xa;&#xa; public void insertUpdate(DocumentEvent e){&#xa; checkPOD();&#xa; }&#xa;});"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="editTagsButton">
<Properties>
<Property name="text" type="java.lang.String" value="Tags bearbeiten"/>
<Property name="toolTipText" type="java.lang.String" value="Tags f&#xfc;r das H&#xf6;rbuch eingeben. ACHTUNG: funktioniert noch nicht unbedingt bei iTunes"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editTagsButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="RemoveCoverButton">
<Properties>
<Property name="text" type="java.lang.String" value="L&#xf6;schen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="RemoveCoverButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="NameTagLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Name: "/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="NameTag">
<Properties>
<Property name="text" type="java.lang.String" value="..."/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="ArtistTagLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Interpret: "/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="ArtistTag">
<Properties>
<Property name="text" type="java.lang.String" value="..."/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="AlbumTagLabel">
<Properties>
<Property name="text" type="java.lang.String" value="Album: "/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="AlbumTag">
<Properties>
<Property name="text" type="java.lang.String" value="..."/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="DeleteFiles">
<Properties>
<Property name="text" type="java.lang.String" value="Dateien l&#xf6;schen"/>
<Property name="toolTipText" type="java.lang.String" value="Dateien nach erstellen des H&#xf6;rbuches aus Zielordner l&#xf6;schen (Sie werden nicht mehr ben&#xf6;tigt)"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="useProfile">
<Properties>
<Property name="text" type="java.lang.String" value="Kapitelprofil anwenden"/>
<Property name="toolTipText" type="java.lang.String" value="Namen der ausgew&#xe4;hlten Kapitel automatisch bearbeiten"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="useProfileActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="SortButton">
<Properties>
<Property name="text" type="java.lang.String" value="Sortieren"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SortButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

1668
src/audiobook/MainWindow.java Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" value=".POD Datei erstellen"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="progressBar" alignment="0" pref="424" max="32767" attributes="0"/>
<Component id="ActionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="MessageLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="ActionLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="MessageLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="progressBar" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JProgressBar" name="progressBar">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="ActionLabel">
<Properties>
<Property name="text" type="java.lang.String" value="ActionLabel"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="MessageLabel">
<Properties>
<Property name="text" type="java.lang.String" value="MessageLabel"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
</SubComponents>
</Form>

102
src/audiobook/ProgressDialog.java Executable file
View File

@@ -0,0 +1,102 @@
package audiobook;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
/**
* This class represents a simple dialog containing a progress bar and two labels
* @author Kim
* @see JProgressBar
* @see JLabel
*/
public class ProgressDialog extends javax.swing.JDialog implements PropertyChangeListener {
/** Creates new form ProgressDialog */
public ProgressDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
setLocationRelativeTo(parent);
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
progressBar = new javax.swing.JProgressBar();
ActionLabel = new javax.swing.JLabel();
MessageLabel = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle(".POD Datei erstellen");
ActionLabel.setText("ActionLabel");
MessageLabel.setText("MessageLabel");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
.addComponent(ActionLabel)
.addComponent(MessageLabel))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(ActionLabel)
.addGap(18, 18, 18)
.addComponent(MessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
@Override
public void propertyChange(PropertyChangeEvent evt) {
switch(evt.getPropertyName()){
case "ActionLabel":
ActionLabel.setText(evt.getNewValue().toString());
break;
case "MessageLabel":
MessageLabel.setText(evt.getNewValue().toString());
break;
case "Maximum":
progressBar.setMaximum(Integer.parseInt(evt.getNewValue().toString()));
break;
case "ProgressValue":
progressBar.setValue(Integer.parseInt(evt.getNewValue().toString()));
break;
case "Error":
JOptionPane.showMessageDialog(this, evt.getNewValue(), "Fehler", JOptionPane.ERROR_MESSAGE);
break;
case "Finish":
if(Boolean.parseBoolean(evt.getNewValue().toString())){
JOptionPane.showMessageDialog(this, "Prozess erfolgreich abgeschlossen", "Fertig", JOptionPane.INFORMATION_MESSAGE);
} else{
JOptionPane.showMessageDialog(this, "Der Prozess konnte nicht abgeschlossen werden.", "Fehler", JOptionPane.INFORMATION_MESSAGE);
}
setVisible(false);
dispose();
break;
}
}
//<editor-fold defaultstate="collapsed" desc="Variables declaration">
// Variables declaration - do not modify//GEN-BEGIN:variables
public javax.swing.JLabel ActionLabel;
public javax.swing.JLabel MessageLabel;
public javax.swing.JProgressBar progressBar;
// End of variables declaration//GEN-END:variables
//</editor-fold>
}

BIN
src/audiobook/audiobook.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
src/audiobook/audiobook_icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
src/audiobook/audiobook_icon2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB