Commit cb38fe49 authored by Andreas Tille's avatar Andreas Tille

Imported Upstream version 0.0.r5

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry excluding="**/.svn/*" kind="src" path="res"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/jdom.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/commons-net-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.4.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ipig</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
#Fri Jul 22 13:01:05 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
java -Xms1024m -Xmx1024m -jar $DIR/iPiG.jar -downloader
@echo off
java -Xms1024m -Xmx1024m -jar "%~dp0\iPiG.jar" -downloader
\ No newline at end of file
# GeneControl configuration example
# this config file is loaded by default
# fit it to your needs or indicate/load a different config file per command-line execution resp. in the graphical user interface.
# indicate needed files
# 1. Gene Annotations
# 2. Amino Acid Sequences
# 3. Path for the output files (optional)
# 4. Path to reference chromosomes
FgeneAnnoFile = M:/Downloads/Data/human/knownGene.txt
FgeneAaSeqFile = M:/Downloads/Data/human/knownGenePep.txt
FoutputPath = M:/Downloads/Data/human/
refSeqPath = M:/Downloads/Data/human/
# define the desired minimum similarity between reference amino acid sequences and self translated sequences
# comparisons of sequences with different lengths will result in a similarity of zero
minSimilarity = 0.95
\ No newline at end of file
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
java -Xms1024m -Xmx1024m -jar $DIR/iPiG.jar -controlgui
@echo off
java -Xms1024m -Xmx1024m -jar "%~dp0\iPiG.jar" -controlgui
\ No newline at end of file
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
java -Xms1024m -Xmx1024m -jar $DIR/iPiG.jar $1 $2 $3 $4 $5
@echo off
java -Xms1024m -Xmx1024m -jar "%~dp0\iPiG.jar" %1 %2 %3 %4 %5
\ No newline at end of file
# iPiG configuration example
# this config file is loaded by default
# fit it to your needs or indicate/load a different config file per command-line execution resp. in the graphical user interface.
# indicate needed files
# 1. Gene Annotations
# 2. Amino Acid Sequences
# 3. UniProt ID-mapping tab file
# 4. Proteom fasta
geneAnnoFile = M:/Downloads/Data/human/knownGene_good.txt
geneAaSeqFile = M:/Downloads/Data/human/knownGenePep.txt
protMapFile = M:/Downloads/Data/human/HUMAN_9606_idmapping_selected.tab
protSeqFile = M:/Downloads/Data/human/HUMAN.fasta
# define score boundaries for colors/suffixes in bed/gff3 output.
# the interval [minScore,maxScore] (int) is divided into 3 parts represented by the 3 colors for bed or type suffixes in gff3.
# the separation positions can be defined with threshold 1 and 2 (int or double), which have to be located in the interval.
minScore = 0
maxScore = 150
threshold1 = 50
threshold2 = 100
# for bed output, define three rgb values (comma separated) to represent the 3 parts
color1 = 191,191,191
color2 = 255,159,0
color3 = 0,255,0
\ No newline at end of file
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
java -Xms1024m -Xmx1024m -jar $DIR/iPiG.jar -gui
@echo off
java -Xms1024m -Xmx1024m -jar "%~dp0\iPiG.jar" -gui
\ No newline at end of file
Copyright (c) 2012,
Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institute, Germany,
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL Mathias Kuhring BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
iPiG - Integrating Peptide spectrum matches Into Genome browser visualizations
Introduction
------------
iPiG targets the integration of peptide spectrum matches (PSMs) from mass spectrometry (MS)
peptide identifications into the genomic visualizations provided by genome browser
such as the UCSC genome browser (http://genome.ucsc.edu/).
iPiG takes PSMs from the MS standard format mzIdentML (*.mzid) and provides results in
genome track formats (BED and GFF3 files), which can be easily imported into genome browsers.
For more details about iPiG and it's functioning, please see
"iPiG: Integrating Peptide Spectrum Matches Into Genome Browser Visualizations"
Mathias Kuhring and Bernhard Y. Renard
(submitted manuscript)
PLEASE NOTE, it is recommended to read the paper and this readme.txt file first,
followed by the wiki pages provided at the project webpage: https://sourceforge.net/projects/ipig/
Instructions
------------
iPiG comes along with two additional tools: There is the mapping procedure itself (iPiG),
an optional gene quality control (GeneControl) and download tool helping to get the necessary data (Downloader).
An example of using iPiG, GeneControl and Downloader is provided in the wiki.
GeneControl checks the integrity of the required gene annotations and the consistency between
the annotations and the corresponding amino acids sequences.
Thus, it is recommended to run it once for the gene annotations used.
System Requirements
-------------------
iPiG is developed in Java version 6, thus it is platform independent,
but requires a Java Runtime Environment (JRE) in version 6.
Version 7 is not fully tested.
The JRE can be downloaded at the Oracle webpage:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
User Interfaces
---------------
iPiG provides a command line interface (CLI) as well as a graphical user interface (GUI).
Execution scripts are provided for Windows and Linux. Type "ipig" without any
parameters to get a short help about parameter using.
On Linux platforms, it might be necessary to set execution rights for the scripts.
This can be done with "chmod +x ipig", "chmod +x ipiggui", "chmod +x gcgui", resp. "chmod +x downloader".
You might add the iPiG directory to your PATH variable to use it directly in your data folders for instance.
Please consult your operating systems manual on how to set the PATH variable.
In general, all interfaces (including GeneControl) could be addressed by executing the iPiG
script file, which is recommended using instead of executing the iPiG.jar file with Java itself.
The GUIs of iPiG, GeneControl and Downloader should be started with the additional scripts,
like "ipiggui", "gcgui" or "downloader", though no further parameters are passed by the gui scripts yet.
Data Requirements (iPiG)
------------------------
iPig requires information about gene locations and protein-gene connections. Thus several files have to be provided.
See in the wiki for recommended sources and how to indicate them.
1.) A file with peptide spectrum matches (PSMs), best in mzIdentML format.
Alternatively, a tab separated text file with particular columns (see ipig.pdf).
2.) The annotations of a reference genome in UCSC table format (*.txt).
3.) A file containing the corresponding amino acid translations in UCSC table format (*.txt).
4.) Optional but highly recommended: A Uniprot ID-mapping file (tab-delimited, *.tab).
Source: ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/
5.) Optional: A proteome in fasta format, e.g. containing the proteins used for peptide identification (*.fasta).
For more details about the formats and for examples,
please have look in the wiki and at the EXAMPLES folder.
Data Requirements (GeneControl)
-------------------------------
1.) The annotations of a reference genome in UCSC table format (*.txt).
2.) A file, containing the corresponding amino acid translations in UCSC table format (*.txt).
3.) Reference sequences of the chromosomes in fasta format, indicated by a path.
Chromosomes must be one per file each and files must be named
like the chromosomes in the annotations (e.g. chr11.fa, chrY.fa, chrIV.fa etc.).
-----------------------------------------------------------------------------------------
Copyright (c) 2012,
Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institute, Germany,
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL Mathias Kuhring BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
Downloader GUI quick help
1.)
Choose the organism depending on the source of the PSMs.
2.)
Choose the data to download for the selected organism.
To run iPiG the gene annotations, amino acid sequences
and the id mappings are necessary. The proteome can
sometimes provide additional mapping information.
To run GeneControl the gene annotations,
amino acid sequences and the genome are necessary.
3.)
Choose a path where the data can be saved/extracted.
4.)
Select if the downloads should be extracted.
5.)
If necessary, set up a proxy which is open for ftp data.
6.)
Start the downloads.
\ No newline at end of file
GeneControl GUI quick help
(for further help please refer to the readme.txt)
1.) Indicate the annotations of a reference genome
in UCSC table format.
2.) Indicate the corresponding amino acid translations
in UCSC table format (*.txt).
3.) Indicate the path to reference chromosomes in
fasta format. Chromosomes must be one per file each
and files must be named like the chromosomes in the
annotations (e.g. chr11.fa, chrY.fa, chrIV.fa etc.).
4.) Optionally, indicate a path for the output
files (execution path by default).
5.) Define the desired minimum similarity between
reference amino acid sequences and
self translated sequences
9.) Run the control by pressing the Start-button.
\ No newline at end of file
iPiG - Integrating PSMs Into Genome browser visualizations
command:
ipig <psm file>|-g|-c|-cg [<config file>]
parameters:
<psm file> indicates the file with the
peptide spectrum matches (mzid/txt)
-g, -gui starts the graphical user interface of iPiG
-c, -control starts the gene control, necessary files have
to be indicated in the configuration file
-cg, -controlgui starts the graphical user interface of the gene control
-d, -downloader starts the download gui
<config file> a different configuration file can be indicated
(otherwise ipig.conf is loaded by default)
additional requirements:
using a non-gui mode, a config file (ipig.conf by default) has to contain
several additional parameters, e.g. indicating the reference genome etc.
in a gui mode (-g and -cg), additional parameters can be indicated two ways,
within the interface or with a config file as well.
have a look into readme.txt and ipig.conf for examples and
more details about the additional parameters
\ No newline at end of file
iPiG GUI quick help
(for further help please refer to the readme.txt)
1.) Indicate a file with peptide spectrum matches
(*.mzid or *.txt).
2.) Optionally, indicate a path for the output
files (execution path by default).
3.) Indicate annotations of a reference genome in
UCSC table format (*.txt).
4.) Indicate the corresponding amino acid
translations in UCSC table format (*.txt).
5.) Optional but highly recommended, indicate a
Uniprot ID-mapping file (*.tab).
6.) Optionally, indicate a proteome in fasta
format (*.fasta).
7.) For the outputs give the score range of the
PSMs and define thresholds to separate PSMs
in three scoring groups.
8.) For the BED output give three RGB colors that
indicates the scoring group of each PSM.
9.) Run the mapping by pressing the Start-button.
\ No newline at end of file
org=Caenorhabditis elegans
genes=hgdownload.cse.ucsc.edu/goldenPath/ce10/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/ce10/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/CAEEL_6239_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/CAEEL.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/ce10/bigZips/chromFa.tar.gz
org=Danio rerio (Zebrafish)
genes=hgdownload.cse.ucsc.edu/goldenPath/danRer7/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/danRer7/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/DANRE_7955_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/DANRE.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr1.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr2.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr3.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr4.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr5.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr6.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr7.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr8.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr9.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr10.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr11.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr12.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr13.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr14.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr16.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr17.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr18.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr19.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr20.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr21.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr22.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr23.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr24.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chr25.fa.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/danRer6/chromosomes/chrM.fa.gz
org=Drosophila melanogaster (Fruit fly)
genes=hgdownload.cse.ucsc.edu/goldenPath/dm3/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/dm3/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/DROME_7227_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/DROME.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/dm3/bigZips/chromFa.tar.gz
org=Gallus gallus (Chicken)
genes=hgdownload.cse.ucsc.edu/goldenPath/galGal3/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/galGal3/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/CHICK_9031_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/CHICK.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/galGal3/bigZips/chromFa.tar.gz
org=Homo sapiens (Human)
genes=hgdownload.cse.ucsc.edu/goldenPath/hg19/database/knownGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/hg19/database/knownGenePep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/HUMAN_9606_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/HUMAN.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/chromFa.tar.gz
org=Mus musculus (Mouse)
genes=hgdownload.cse.ucsc.edu/goldenPath/mm10/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/mm10/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/MOUSE_10090_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/MOUSE.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/mm10/bigZips/chromFa.tar.gz
org=Rattus norvegicus (Rat)
genes=hgdownload.cse.ucsc.edu/goldenPath/rn4/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/rn4/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/RAT_10116_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/RAT.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/rn4/bigZips/chromFa.tar.gz
org=Saccharomyces cerevisiae (Yeast)
genes=hgdownload.cse.ucsc.edu/goldenPath/sacCer3/database/ensGene.txt.gz
aaseqs=hgdownload.cse.ucsc.edu/goldenPath/sacCer3/database/ensPep.txt.gz
idmappings=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/by_organism/YEAST_559292_idmapping_selected.tab.gz
prots=ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/YEAST.fasta.gz
chroms=hgdownload.cse.ucsc.edu/goldenPath/sacCer3/bigZips/chromFa.tar.gz
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright (c) 2012,
* Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institut, Germany,
* All rights reserved. For details, please note the license.txt.
*/
package de.rki.ng4.ipig.exceptions;
/**
* A simple exception used to exit the program. It's usually thrown up to the main class.
*
* @author Mathias Kuhring
*/
public class ExitException extends Exception {
private static final long serialVersionUID = 1L;
public ExitException(String string) {
super(string);
}
}
/* Copyright (c) 2012,
* Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institut, Germany,
* All rights reserved. For details, please note the license.txt.
*/
package de.rki.ng4.ipig.exceptions;
/**
* A simple exception used for any kind of format failure in input data.
*
* @author Mathias Kuhring
*/
public class FormatException extends Exception {
private static final long serialVersionUID = 1L;
public FormatException(String string) {
super(string);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright (c) 2012,
* Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institut, Germany,
* All rights reserved. For details, please note the license.txt.
*/
package de.rki.ng4.ipig.gui;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
/**
* <p>A extension of a JTextArea which is able to redirect (catch and print) the system output stream and system error stream.</p>
*
* <p>Source of main idea: <a href="http://unserializableone.blogspot.com/2009/01/redirecting-systemout-and-systemerr-to.html">
* http://unserializableone.blogspot.com/2009/01/redirecting-systemout-and-systemerr-to.html</a></p>
*
* @author Mathias Kuhring
*
*/
public class OutputJTextArea extends JTextArea {
private static final long serialVersionUID = 1L;
private OutputStream newout;
private PrintStream stdout = System.out;
private PrintStream stderr = System.err;
/**
* Simple constructor which prepares the redirection.
*/
public OutputJTextArea(){
super();
init();
}
/**
* This constructor prepares the redirection and initiates the text area with a passed String.
*
* @param text text to be printed in the text area
*/
public OutputJTextArea(String text){
super(text);
init();
}
/**
* This constructor prepares the redirection and creates the text area in a given size (rows and columns).
*
* @param rows number of rows
* @param cols number of columns
*/
public OutputJTextArea(int rows, int cols){
super(rows, cols);
init();
}
// initiates and adapts an output stream
private void init(){
newout = new OutputStream() {
@Override
public void write(int b) throws IOException {
updateTextArea(String.valueOf((char) b));
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
updateTextArea(new String(b, off, len));
}
@Override
public void write(byte[] b) throws IOException {
write(b, 0, b.length);
}
};
}
// used by the output stream to write into the text area
private void updateTextArea(final String text) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
append(text);
}
});
}
/**
* <p>Controls the redirection of the output stream and error stream.</p>
*
* @param out set true for redirection into the text area, false to use the standard output stream
* @param err set true for redirection into the text area, false to use the standard error stream
*/
public void redirectSystemStreams(boolean out, boolean err) {
if (out){
System.setOut(new PrintStream(newout, true));
}
else{
System.setOut(stdout);
}
if (err){
System.setErr(new PrintStream(newout, true));
}
else{
System.setErr(stderr);
}
}
}
/* Copyright (c) 2012,
* Mathias Kuhring, KuhringM@rki.de, Robert Koch-Institut, Germany,
* All rights reserved. For details, please note the license.txt.
*/
package de.rki.ng4.ipig.gui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import de.rki.ng4.ipig.tools.Configurator;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
/**
* <p>The ProxyDialog is a modal JDialog offering fields to set proxy settings
* which are written to the Configurator after submission (Ok button).
*
* @author Mathias Kuhring
*
*/
@SuppressWarnings("serial")
public class ProxyDialog extends JDialog {
private JTextField tfHost;
private JTextField tfPort;
private JTextField tfUser;
private JTextField tfPass;
private JCheckBox chckbxUseAuthenthication;
private JButton btnSet;
private JButton btnAbort;
/**
* Launch the application.
*/
public static void run() {
try {
ProxyDialog dialog = new ProxyDialog();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public ProxyDialog() {
// try native look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
System.out.println("Error setting native LAF: " + e);
}
setModal(true);
setTitle("Proxy Settings");
setBounds(100, 100, 350, 203);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
getContentPane().setLayout(null);
setLocationRelativeTo(null);
JLabel lblHost = new JLabel("Host (ftp):");
lblHost.setHorizontalAlignment(SwingConstants.RIGHT);
lblHost.setBounds(10, 11, 50, 14);
getContentPane().add(lblHost);
JLabel lblPort = new JLabel("Port:");
lblPort.setHorizontalAlignment(SwingConstants.RIGHT);