Skip to content

Commit

Permalink
Added source-code of EscherConverter.
Browse files Browse the repository at this point in the history
  • Loading branch information
draeger committed Mar 21, 2016
1 parent 82f34ac commit c3155a4
Show file tree
Hide file tree
Showing 35 changed files with 8,023 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target/
/.settings/
/.classpath
/minimalSysBio.xml
Binary file added lib/jsbml-2492-incl-libs.jar
Binary file not shown.
Binary file added lib/org.sbgn-with-dependencies.jar
Binary file not shown.
Binary file added lib/sysbio.jar
Binary file not shown.
189 changes: 189 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>edu.ucsd.sbrg</groupId>
<artifactId>EscherConverter</artifactId>

<!-- Output to jar format -->
<packaging>jar</packaging>


<!-- =================================================================== -->
<!-- General project information -->
<!-- =================================================================== -->

<name>${project.artifactId}</name>
<version>0.6</version>
<url>https://github.com/SBRG/EscherConverter</url>
<inceptionYear>2015</inceptionYear>
<description>EscherConverter is a stand-alone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.</description>

<properties>
<jdk.version>1.8</jdk.version>
<maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
<year>${maven.build.timestamp}</year><!-- This property is used for filtering the variable ${year} in some resource files -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.license.url>http://www.opensource.org/licenses/mit-license.php</project.license.url>
<junit.version>4.11</junit.version>
</properties>

<organization>
<name>University of California, San Diego</name>
<url>http://sbrg.ucsd.edu</url>
</organization>

<issueManagement>
<url>https://github.com/SBRG/EscherConverter/issues</url>
<system>GitHub Issues</system>
</issueManagement>

<licenses>
<license>
<name>MIT License</name>
<url>${project.license.url}</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<email>[email protected]</email>
<name>Andreas Dräger</name>
<url>https://github.com/draeger/</url>
<id>draeger</id>
</developer>
</developers>

<!-- =================================================================== -->
<!-- Dependencies -->
<!-- =================================================================== -->

<dependencies>

<!-- To update or install local non-MAVEN JAR files run the command in the comments -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<!-- mvn install:install-file -Dfile=/path/to/jsbml.jar -DgroupId=org.sbml -DartifactId=JSBML -Dversion=REVISION_NUMBER -Dpackaging=jar -->
<groupId>org.sbml</groupId>
<artifactId>JSBML</artifactId>
<version>2492</version>
<scope>compile</scope>
</dependency>

<dependency>
<!-- mvn install:install-file -Dfile=/path/to/libSBGN.jar -DgroupId=org -DartifactId=sbgn -Dversion=0.2 -Dpackaging=jar -->
<groupId>org</groupId>
<artifactId>sbgn</artifactId>
<version>0.2</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<!-- mvn install:install-file -Dfile=/path/to/sysbio.jar -DgroupId=de.zbit -DartifactId=SysBio -Dversion=REVISION_NUMBER -Dpackaging=jar -->
<groupId>de.zbit</groupId>
<artifactId>SysBio</artifactId>
<version>1390</version> <!-- SVN revision -->
<scope>compile</scope>
</dependency>

</dependencies>


<!-- =================================================================== -->
<!-- Building -->
<!-- =================================================================== -->

<!-- To build the project run: -->
<!-- mvn clean compile package assembly:single -->

<build>

<finalName>${project.artifactId}-${project.version}</finalName>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<pluginManagement>

<plugins>

<!-- Download source code in Eclipse, best practice [OPTIONAL!] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>

<!-- Set a JDK compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>

<!-- Assemble executable JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<!--<mainClass>edu.ucsd.sbrg.escher.EscherConverter</mainClass>-->
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<!--<descriptor>assembly.xml</descriptor>--> <!-- Details of the assembly are described in this file -->
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<!-- This will create a JAR with all dependencies -->
<!-- mvn clean compile assembly:single -->
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</pluginManagement>

</build>

</project>
168 changes: 168 additions & 0 deletions src/main/java/edu/ucsd/sbrg/escher/AbstractBox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
* $Id$
* $URL$
* ---------------------------------------------------------------------
* This file is part of the program BioNetView.
*
* Copyright (C) 2013-2016 by the University of California, San Diego.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation. A copy of the license
* agreement is provided in the file named "LICENSE.txt" included with
* this software distribution and also available online as
* <http://www.gnu.org/licenses/lgpl-3.0-standalone.html>.
* ---------------------------------------------------------------------
*/
package edu.ucsd.sbrg.escher;

/**
*
* @author Andreas Dr&auml;ger
*
*/
public abstract class AbstractBox extends AbstractPosition implements Box {

/**
*
*/
protected Double height;
/**
*
*/
protected Double width;

/**
*
*/
public AbstractBox() {
super();
x = y = width = height = null;
}

/**
*
* @param box
*/
public AbstractBox(AbstractBox box) {
super(box);
if (box.isSetHeight()) {
setHeight(box.getHeight().doubleValue());
}
if (box.isSetWidth()) {
setWidth(box.getWidth().doubleValue());
}
}

/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
AbstractBox other = (AbstractBox) obj;
if (height == null) {
if (other.height != null) {
return false;
}
} else if (!height.equals(other.height)) {
return false;
}
if (width == null) {
if (other.width != null) {
return false;
}
} else if (!width.equals(other.width)) {
return false;
}
return true;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#getHeight()
*/
@Override
public Double getHeight() {
return height;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#getWidth()
*/
@Override
public Double getWidth() {
return width;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((height == null) ? 0 : height.hashCode());
result = prime * result + ((width == null) ? 0 : width.hashCode());
return result;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#isSetHeight()
*/
@Override
public boolean isSetHeight() {
return height != null;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#isSetWidth()
*/
@Override
public boolean isSetWidth() {
return width != null;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#setHeight(java.lang.Double)
*/
@Override
public void setHeight(Double height) {
this.height = height;
}

/* (non-Javadoc)
* @see edu.ucsd.sbrg.escher.Box#setWidth(java.lang.Double)
*/
@Override
public void setWidth(Double width) {
this.width = width;
}

/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append(getClass().getSimpleName());
builder.append(" [x=");
builder.append(x);
builder.append(", y=");
builder.append(y);
builder.append(", width=");
builder.append(width);
builder.append(", height=");
builder.append(height);
builder.append("]");
return builder.toString();
}

}
Loading

0 comments on commit c3155a4

Please sign in to comment.