Comparar commits
6 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 3305e23b01 | |||
| 240f4a5ccf | |||
| 70c4f5fee2 | |||
| e4ac375e15 | |||
| ab62a6bede | |||
| 1ab13abd05 |
+8
-8
@@ -28,27 +28,27 @@ If you run into any trouble or have questions consult our [forum](http://forum.g
|
||||
|
||||
### Nightly builds
|
||||
|
||||
Current version is 0.8.2-SNAPSHOT
|
||||
Current version is 0.9-SNAPSHOT
|
||||
|
||||
- [gephi-0.8.2-SNAPSHOT.zip](http://nexus.gephi.org/nexus/service/local/artifact/maven/content?r=snapshots&g=org.gephi&a=gephi&v=0.8.2-SNAPSHOT&p=zip) (Windows & Linux)
|
||||
- [gephi-0.9-SNAPSHOT.zip](http://nexus.gephi.org/nexus/service/local/artifact/maven/content?r=snapshots&g=org.gephi&a=gephi&v=0.9-SNAPSHOT&p=zip) (Windows & Linux)
|
||||
|
||||
- [gephi-0.8.2-SNAPSHOT.dmg](http://nexus.gephi.org/nexus/service/local/artifact/maven/content?r=snapshots&g=org.gephi&a=gephi&v=0.8.2-SNAPSHOT&p=dmg) (Mac OS X)
|
||||
- [gephi-0.9-SNAPSHOT.dmg](http://nexus.gephi.org/nexus/service/local/artifact/maven/content?r=snapshots&g=org.gephi&a=gephi&v=0.9-SNAPSHOT&p=dmg) (Mac OS X)
|
||||
|
||||
- [gephi-0.8.2-SNAPSHOT-sources.tar.gz](http://nexus.gephi.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.gephi&a=gephi-parent&v=0.8.2-SNAPSHOT&c=sources&p=tar.gz) (Sources)
|
||||
- [gephi-0.9-SNAPSHOT-sources.tar.gz](http://nexus.gephi.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.gephi&a=gephi-parent&v=0.9-SNAPSHOT&c=sources&p=tar.gz) (Sources)
|
||||
|
||||
- [gephi-0.8.2-SNAPSHOT-javadoc.jar](http://nexus.gephi.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.gephi&a=gephi-parent&v=0.8.2-SNAPSHOT&c=javadoc&p=jar) (Javadoc)
|
||||
- [gephi-0.9-SNAPSHOT-javadoc.jar](http://nexus.gephi.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.gephi&a=gephi-parent&v=0.9-SNAPSHOT&c=javadoc&p=jar) (Javadoc)
|
||||
|
||||
## Developer Introduction
|
||||
|
||||
Gephi is developed in Java and uses OpenGL for its visualization engine. Built on the top of Netbeans Platform, it follows a loosely-coupled, modular architecture philosophy. That allows it to be used build large applications and to grow in a sustainable way. Gephi is split into modules, which depend on other modules through well-written APIs. Plugins can reuse existing APIs, create new services and even replace a default implementation with a new one.
|
||||
|
||||
Consult the [**Javadoc**](http://gephi.org/docs) for an overview of the APIs.
|
||||
Consult the [**Javadoc**](http://gephi.org/docs/api) for an overview of the APIs.
|
||||
|
||||
### Requirements
|
||||
|
||||
- Java JDK 6 or 7 with preferably [Oracle Java JDK](http://java.com/en/).
|
||||
|
||||
- [Apache Maven](http://maven.apache.org/) version 3.0.3 or later
|
||||
- [Apache Maven](http://maven.apache.org/) version 3.0.4 or later
|
||||
|
||||
### Checkout and Build the sources
|
||||
|
||||
@@ -71,7 +71,7 @@ Gephi is extensible and lets users create plug-ins to add new features, or to mo
|
||||
|
||||
- [**Plugins Portal**](http://wiki.gephi.org/index.php/Plugins_portal)
|
||||
|
||||
- [Plugins Quick Start (5 minutes)](http://wiki.gephi.org/index.php/Plugin_Quick_Start_(5_minutes))
|
||||
- [Plugins Quick Start (5 minutes)](http://wiki.gephi.org/index.php/Plugin_Quick_Start_(5_minutes\))
|
||||
|
||||
- Browse the [plugins](http://gephi.org/plugins) created by the community
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>algorithms-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ui-propertyeditor</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>AttributeColumnPropertyEditor</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>data-attributes-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>AttributesAPI</name>
|
||||
|
||||
@@ -4,20 +4,16 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>attributes</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>AttributesImpl</name>
|
||||
|
||||
<properties>
|
||||
<gephi.modules.specification.version>0.8.2.1</gephi.modules.specification.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>clustering-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ClusteringAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>clustering-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ClusteringPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>utils-collection</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>CollectionUtils</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>core-library-wrapper</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>CoreLibraryWrapper</name>
|
||||
|
||||
@@ -4,20 +4,16 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>db-drivers</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DBDrivers</name>
|
||||
|
||||
<properties>
|
||||
<gephi.modules.specification.version>0.8.2.1</gephi.modules.specification.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>graph-dhns</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DHNSGraph</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>datalab-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DataLaboratoryAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>datalab-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DataLaboratoryPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-branding</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopBranding</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-clustering</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopClustering</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-context</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopContext</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-datalab</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopDataLaboratory</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-io-export</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopExport</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-filters</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopFilters</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-generate</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopGenerate</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-hierarchy</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopHierarchy</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-import</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopImport</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-layout</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopLayout</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-partition</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopPartition</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-perspective</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopPerspective</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-preview</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopPreview</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-progress</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopProgress</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-project</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopProject</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-ranking</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopRanking</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-recent-files</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopRecentFiles</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-spigot</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopSpigot</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-statistics</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopStatistics</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-timeline</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopTimeline</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>desktop-tools</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DesktopTools</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>directory-chooser</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DirectoryChooser</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>dynamic-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DynamicAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>dynamic-impl</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>DynamicImpl</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-exporter-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ExportAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-exporter-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ExportPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>export-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ExportPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>filters-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>FiltersAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>filters-impl</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>FiltersImpl</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>filters-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>FiltersPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>filters-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>FiltersPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-generator-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>GeneratorAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-generator-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>GeneratorPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>generator-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>GeneratorPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>gleem</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>Gleem</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>graph-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>GraphAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-importer-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ImportAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-importer-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ImportPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>import-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ImportPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>layout-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>LayoutAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>layout-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>LayoutPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>utils-longtask</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>LongTaskAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>mostrecentfiles-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>MostRecentFilesAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>partition-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PartitionAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>partition-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PartitionPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>partition-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PartitionPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>perspective-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PerspectiveAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>preview-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PreviewAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-exporter-preview</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PreviewExport</name>
|
||||
|
||||
+116
-21
@@ -45,6 +45,8 @@ import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.OutputStream;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
|
||||
import org.gephi.io.exporter.spi.ByteExporter;
|
||||
import org.gephi.io.exporter.spi.VectorExporter;
|
||||
import org.gephi.preview.api.PreviewController;
|
||||
@@ -58,13 +60,13 @@ import org.gephi.utils.progress.Progress;
|
||||
import org.gephi.utils.progress.ProgressTicket;
|
||||
import org.openide.util.Lookup;
|
||||
import processing.core.PGraphicsJava2D;
|
||||
import processing.core.PMatrix;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class PNGExporter implements VectorExporter, ByteExporter, LongTask {
|
||||
|
||||
|
||||
private ProgressTicket progress;
|
||||
private boolean cancel = false;
|
||||
private Workspace workspace;
|
||||
@@ -74,24 +76,123 @@ public class PNGExporter implements VectorExporter, ByteExporter, LongTask {
|
||||
private boolean transparentBackground = false;
|
||||
private int margin = 4;
|
||||
private ProcessingTarget target;
|
||||
|
||||
|
||||
|
||||
private int extraMargin() {
|
||||
|
||||
Progress.start(progress);
|
||||
|
||||
PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
|
||||
controller.getModel(workspace).getProperties().putValue(PreviewProperty.VISIBILITY_RATIO, 1.0);
|
||||
PreviewProperties props = controller.getModel(workspace).getProperties();
|
||||
|
||||
int extraMargin = (int) Math.min(50, 0.05 * Math.max(width, height));
|
||||
System.out.println("@Var: extraMargin: "+extraMargin);
|
||||
props.putValue("width", width - 2 * extraMargin);
|
||||
props.putValue("height", height - 2 * extraMargin);
|
||||
props.putValue("margin", extraMargin);
|
||||
|
||||
controller.refreshPreview(workspace);
|
||||
target = (ProcessingTarget) controller.getRenderTarget(RenderTarget.PROCESSING_TARGET, workspace);
|
||||
target.refresh();
|
||||
|
||||
// transparent color
|
||||
Color transparentColor = new Color(255, 255, 255, 0);
|
||||
int transparentColorInt = transparentColor.getRGB();
|
||||
|
||||
// searching for external pixels
|
||||
PGraphicsJava2D pg2 = (PGraphicsJava2D) target.getGraphics();
|
||||
System.out.println("@Var: pg2: "+pg2);
|
||||
|
||||
boolean flag = false;
|
||||
int newMargin = extraMargin;
|
||||
System.out.println(pg2.pixels.length);
|
||||
for (int window = 0; window < extraMargin; window++) {
|
||||
// up
|
||||
if (flag) {
|
||||
newMargin = window;
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < width; i++) {
|
||||
if (pg2.pixels[window * width + i] != transparentColorInt) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// bottom
|
||||
if (flag) {
|
||||
newMargin = window;
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < width; i++) {
|
||||
if (pg2.pixels[height - 1 - window * width + i] != transparentColorInt) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// left
|
||||
if (flag) {
|
||||
newMargin = window;
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < height; i++) {
|
||||
if (pg2.pixels[i * width + window] != transparentColorInt) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// right
|
||||
if (flag) {
|
||||
newMargin = window;
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < height; i++) {
|
||||
if (pg2.pixels[i * width + height - 1 + window] != transparentColorInt) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
props.removeSimpleValue("width");
|
||||
props.removeSimpleValue("height");
|
||||
props.removeSimpleValue("margin");
|
||||
|
||||
return extraMargin - newMargin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute() {
|
||||
Progress.start(progress);
|
||||
|
||||
|
||||
PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
|
||||
controller.getModel(workspace).getProperties().putValue(PreviewProperty.VISIBILITY_RATIO, 1.0);
|
||||
|
||||
|
||||
int newMargin = extraMargin();
|
||||
System.out.println("@Var: newMargin: "+newMargin);
|
||||
|
||||
|
||||
PreviewProperties props = controller.getModel(workspace).getProperties();
|
||||
props.putValue("width", width);
|
||||
props.putValue("height", height);
|
||||
Color oldColor = props.getColorValue(PreviewProperty.BACKGROUND_COLOR);
|
||||
Color transparentColor = new Color(255, 255, 255, 0);
|
||||
int transparentColorInt = transparentColor.getRGB();
|
||||
if (transparentBackground) {
|
||||
props.putValue(PreviewProperty.BACKGROUND_COLOR, new Color(255, 255, 255, 0));//White transparent
|
||||
props.putValue(PreviewProperty.BACKGROUND_COLOR, transparentColor);//White transparent
|
||||
}
|
||||
props.putValue(PreviewProperty.MARGIN, new Float((float) margin));
|
||||
controller.refreshPreview(workspace);
|
||||
target = (ProcessingTarget) controller.getRenderTarget(RenderTarget.PROCESSING_TARGET, workspace);
|
||||
target.refresh();
|
||||
|
||||
|
||||
if (target instanceof LongTask) {
|
||||
((LongTask) target).setProgressTicket(progress);
|
||||
}
|
||||
@@ -100,40 +201,34 @@ public class PNGExporter implements VectorExporter, ByteExporter, LongTask {
|
||||
props.removeSimpleValue("width");
|
||||
props.removeSimpleValue("height");
|
||||
props.removeSimpleValue(PreviewProperty.MARGIN);
|
||||
|
||||
try {
|
||||
target.refresh();
|
||||
|
||||
Progress.switchToIndeterminate(progress);
|
||||
|
||||
PGraphicsJava2D pg2 = (PGraphicsJava2D) target.getGraphics();
|
||||
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
|
||||
img.setRGB(0, 0, width, height, pg2.pixels, 0, width);
|
||||
ImageIO.write(img, "png", stream);
|
||||
stream.close();
|
||||
|
||||
props.putValue(PreviewProperty.BACKGROUND_COLOR, oldColor);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Progress.finish(progress);
|
||||
|
||||
return !cancel;
|
||||
}
|
||||
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
@@ -153,22 +248,22 @@ public class PNGExporter implements VectorExporter, ByteExporter, LongTask {
|
||||
public void setTransparentBackground(boolean transparentBackground) {
|
||||
this.transparentBackground = transparentBackground;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setWorkspace(Workspace workspace) {
|
||||
this.workspace = workspace;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Workspace getWorkspace() {
|
||||
return workspace;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setOutputStream(OutputStream stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
|
||||
public boolean cancel() {
|
||||
cancel = true;
|
||||
if (target instanceof LongTask) {
|
||||
@@ -176,7 +271,7 @@ public class PNGExporter implements VectorExporter, ByteExporter, LongTask {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void setProgressTicket(ProgressTicket progressTicket) {
|
||||
this.progress = progressTicket;
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>preview-export-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PreviewExportUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>preview-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>PreviewPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>io-processor-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ProcessorPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>processor-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ProcessorPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>project-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ProjectAPI</name>
|
||||
|
||||
+361
-345
@@ -1,345 +1,361 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
|
||||
The contents of this file are subject to the terms of either the GNU
|
||||
General Public License Version 3 only ("GPL") or the Common
|
||||
Development and Distribution License("CDDL") (collectively, the
|
||||
"License"). You may not use this file except in compliance with the
|
||||
License. You can obtain a copy of the License at
|
||||
http://gephi.org/about/legal/license-notice/
|
||||
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
|
||||
specific language governing permissions and limitations under the
|
||||
License. When distributing the software, include this License Header
|
||||
Notice in each file and include the License files at
|
||||
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
|
||||
License Header, with the fields enclosed by brackets [] replaced by
|
||||
your own identifying information:
|
||||
"Portions Copyrighted [year] [name of copyright owner]"
|
||||
|
||||
If you wish your version of this file to be governed by only the CDDL
|
||||
or only the GPL Version 3, indicate your decision by adding
|
||||
"[Contributor] elects to include this software in this distribution
|
||||
under the [CDDL or GPL Version 3] license." If you do not indicate a
|
||||
single choice of license, a recipient has the option to distribute
|
||||
your version of this file under either the CDDL, the GPL Version 3 or
|
||||
to extend the choice of license to its licensees as provided above.
|
||||
However, if you add GPL Version 3 code and therefore, elected the GPL
|
||||
Version 3 license, then the option applies only if the new code is
|
||||
made subject to such option by the copyright holder.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Portions Copyrighted 2011 Gephi Consortium.
|
||||
*/
|
||||
package org.gephi.project.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.gephi.project.api.Project;
|
||||
import org.gephi.project.api.ProjectController;
|
||||
import org.gephi.project.api.Projects;
|
||||
import org.gephi.project.api.WorkspaceProvider;
|
||||
import org.gephi.project.io.LoadTask;
|
||||
import org.gephi.project.io.SaveTask;
|
||||
import org.gephi.project.api.Workspace;
|
||||
import org.gephi.project.api.WorkspaceInformation;
|
||||
import org.gephi.project.api.WorkspaceListener;
|
||||
import org.gephi.workspace.impl.WorkspaceImpl;
|
||||
import org.gephi.workspace.impl.WorkspaceInformationImpl;
|
||||
import org.gephi.project.spi.WorkspaceDuplicateProvider;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
@ServiceProvider(service = ProjectController.class)
|
||||
public class ProjectControllerImpl implements ProjectController {
|
||||
|
||||
private enum EventType {
|
||||
|
||||
INITIALIZE, SELECT, UNSELECT, CLOSE, DISABLE
|
||||
};
|
||||
//Data
|
||||
private final ProjectsImpl projects = new ProjectsImpl();
|
||||
private final List<WorkspaceListener> listeners;
|
||||
private WorkspaceImpl temporaryOpeningWorkspace;
|
||||
|
||||
public ProjectControllerImpl() {
|
||||
|
||||
//Listeners
|
||||
listeners = new ArrayList<WorkspaceListener>();
|
||||
listeners.addAll(Lookup.getDefault().lookupAll(WorkspaceListener.class));
|
||||
}
|
||||
|
||||
public void startup() {
|
||||
final String OPEN_LAST_PROJECT_ON_STARTUP = "Open_Last_Project_On_Startup";
|
||||
final String NEW_PROJECT_ON_STARTUP = "New_Project_On_Startup";
|
||||
boolean openLastProject = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(OPEN_LAST_PROJECT_ON_STARTUP, false);
|
||||
boolean newProjectStartup = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(NEW_PROJECT_ON_STARTUP, false);
|
||||
|
||||
//Default project
|
||||
if (!openLastProject && newProjectStartup) {
|
||||
newProject();
|
||||
}
|
||||
}
|
||||
|
||||
public void newProject() {
|
||||
closeCurrentProject();
|
||||
ProjectImpl project = new ProjectImpl();
|
||||
projects.addProject(project);
|
||||
openProject(project);
|
||||
}
|
||||
|
||||
public Runnable openProject(File file) {
|
||||
return new LoadTask(file);
|
||||
}
|
||||
|
||||
public Runnable saveProject(Project project) {
|
||||
if (project.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
File file = project.getLookup().lookup(ProjectInformationImpl.class).getFile();
|
||||
return saveProject(project, file);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Runnable saveProject(Project project, File file) {
|
||||
project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
|
||||
SaveTask saveTask = new SaveTask(project, file);
|
||||
return saveTask;
|
||||
}
|
||||
|
||||
public void closeCurrentProject() {
|
||||
if (projects.hasCurrentProject()) {
|
||||
ProjectImpl currentProject = projects.getCurrentProject();
|
||||
|
||||
//Event
|
||||
if (currentProject.getLookup().lookup(WorkspaceProvider.class).hasCurrentWorkspace()) {
|
||||
fireWorkspaceEvent(EventType.UNSELECT, currentProject.getLookup().lookup(WorkspaceProvider.class).getCurrentWorkspace());
|
||||
}
|
||||
for (Workspace ws : currentProject.getLookup().lookup(WorkspaceProviderImpl.class).getWorkspaces()) {
|
||||
fireWorkspaceEvent(EventType.CLOSE, ws);
|
||||
}
|
||||
|
||||
//Close
|
||||
currentProject.getLookup().lookup(ProjectInformationImpl.class).close();
|
||||
projects.closeCurrentProject();
|
||||
|
||||
fireWorkspaceEvent(EventType.DISABLE, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeProject(Project project) {
|
||||
if (projects.getCurrentProject() == project) {
|
||||
closeCurrentProject();
|
||||
}
|
||||
projects.removeProject(project);
|
||||
}
|
||||
|
||||
public Projects getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
public void setProjects(Projects projects) {
|
||||
final String OPEN_LAST_PROJECT_ON_STARTUP = "Open_Last_Project_On_Startup";
|
||||
boolean openLastProject = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(OPEN_LAST_PROJECT_ON_STARTUP, false);
|
||||
|
||||
Project lastOpenProject = null;
|
||||
for (Project p : ((ProjectsImpl) projects).getProjects()) {
|
||||
if (p.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
ProjectImpl pImpl = (ProjectImpl) p;
|
||||
pImpl.init();
|
||||
this.projects.addProject(p);
|
||||
pImpl.getLookup().lookup(ProjectInformationImpl.class).close();
|
||||
if (p == projects.getCurrentProject()) {
|
||||
lastOpenProject = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (openLastProject && lastOpenProject != null && !lastOpenProject.getLookup().lookup(ProjectInformationImpl.class).isInvalid() && lastOpenProject.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
openProject(lastOpenProject);
|
||||
} else {
|
||||
//newProject();
|
||||
}
|
||||
}
|
||||
|
||||
public Workspace newWorkspace(Project project) {
|
||||
Workspace workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.INITIALIZE, workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
public void deleteWorkspace(Workspace workspace) {
|
||||
WorkspaceInformation wi = workspace.getLookup().lookup(WorkspaceInformation.class);
|
||||
WorkspaceProviderImpl workspaceProvider = wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
|
||||
|
||||
Workspace toSelectWorkspace = null;
|
||||
if (getCurrentWorkspace() == workspace) {
|
||||
toSelectWorkspace = workspaceProvider.getPrecedingWorkspace(workspace);
|
||||
}
|
||||
|
||||
workspaceProvider.removeWorkspace(workspace);
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.CLOSE, workspace);
|
||||
|
||||
if (getCurrentWorkspace() == workspace) {
|
||||
//Select the one before, or after
|
||||
if (toSelectWorkspace == null) {
|
||||
closeCurrentProject();
|
||||
} else {
|
||||
openWorkspace(toSelectWorkspace);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void openProject(Project project) {
|
||||
final ProjectImpl projectImpl = (ProjectImpl) project;
|
||||
final ProjectInformationImpl projectInformationImpl = projectImpl.getLookup().lookup(ProjectInformationImpl.class);
|
||||
final WorkspaceProviderImpl workspaceProviderImpl = project.getLookup().lookup(WorkspaceProviderImpl.class);
|
||||
|
||||
if (projects.hasCurrentProject()) {
|
||||
closeCurrentProject();
|
||||
}
|
||||
projects.addProject(projectImpl);
|
||||
projects.setCurrentProject(projectImpl);
|
||||
projectInformationImpl.open();
|
||||
|
||||
if (!workspaceProviderImpl.hasCurrentWorkspace()) {
|
||||
if (workspaceProviderImpl.getWorkspaces().length == 0) {
|
||||
Workspace workspace = newWorkspace(project);
|
||||
openWorkspace(workspace);
|
||||
} else {
|
||||
Workspace workspace = workspaceProviderImpl.getWorkspaces()[0];
|
||||
openWorkspace(workspace);
|
||||
}
|
||||
} else {
|
||||
fireWorkspaceEvent(EventType.SELECT, workspaceProviderImpl.getCurrentWorkspace());
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectImpl getCurrentProject() {
|
||||
return projects.getCurrentProject();
|
||||
}
|
||||
|
||||
public WorkspaceImpl getCurrentWorkspace() {
|
||||
if (projects.hasCurrentProject()) {
|
||||
temporaryOpeningWorkspace = null;
|
||||
return getCurrentProject().getLookup().lookup(WorkspaceProviderImpl.class).getCurrentWorkspace();
|
||||
} else if (temporaryOpeningWorkspace != null) {
|
||||
return temporaryOpeningWorkspace;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void closeCurrentWorkspace() {
|
||||
WorkspaceImpl workspace = getCurrentWorkspace();
|
||||
if (workspace != null) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).close();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.UNSELECT, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
public void openWorkspace(Workspace workspace) {
|
||||
closeCurrentWorkspace();
|
||||
getCurrentProject().getLookup().lookup(WorkspaceProviderImpl.class).setCurrentWorkspace(workspace);
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).open();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.SELECT, workspace);
|
||||
}
|
||||
|
||||
public void cleanWorkspace(Workspace workspace) {
|
||||
}
|
||||
|
||||
public Workspace duplicateWorkspace(Workspace workspace) {
|
||||
if (projects.hasCurrentProject()) {
|
||||
Workspace duplicate = newWorkspace(projects.getCurrentProject());
|
||||
for (WorkspaceDuplicateProvider dp : Lookup.getDefault().lookupAll(WorkspaceDuplicateProvider.class)) {
|
||||
dp.duplicate(workspace, duplicate);
|
||||
}
|
||||
openWorkspace(duplicate);
|
||||
return duplicate;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void renameProject(Project project, final String name) {
|
||||
project.getLookup().lookup(ProjectInformationImpl.class).setName(name);
|
||||
}
|
||||
|
||||
public void renameWorkspace(Workspace workspace, String name) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).setName(name);
|
||||
}
|
||||
|
||||
public void setSource(Workspace workspace, String source) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).setSource(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hack to have a current workpace when opening workspace
|
||||
* @param temporaryOpeningWorkspace the opening workspace or null
|
||||
*/
|
||||
public void setTemporaryOpeningWorkspace(WorkspaceImpl temporaryOpeningWorkspace) {
|
||||
this.temporaryOpeningWorkspace = temporaryOpeningWorkspace;
|
||||
if (temporaryOpeningWorkspace != null) {
|
||||
//Init controllers with empty models
|
||||
fireWorkspaceEvent(EventType.INITIALIZE, temporaryOpeningWorkspace);
|
||||
}
|
||||
}
|
||||
|
||||
public void addWorkspaceListener(WorkspaceListener workspaceListener) {
|
||||
synchronized (listeners) {
|
||||
listeners.add(workspaceListener);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeWorkspaceListener(WorkspaceListener workspaceListener) {
|
||||
synchronized (listeners) {
|
||||
listeners.remove(workspaceListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void fireWorkspaceEvent(EventType event, Workspace workspace) {
|
||||
WorkspaceListener[] listenersArray;
|
||||
synchronized (listeners) {
|
||||
listenersArray = listeners.toArray(new WorkspaceListener[0]);
|
||||
}
|
||||
for (WorkspaceListener wl : listenersArray) {
|
||||
switch (event) {
|
||||
case INITIALIZE:
|
||||
wl.initialize(workspace);
|
||||
break;
|
||||
case SELECT:
|
||||
wl.select(workspace);
|
||||
break;
|
||||
case UNSELECT:
|
||||
wl.unselect(workspace);
|
||||
break;
|
||||
case CLOSE:
|
||||
wl.close(workspace);
|
||||
break;
|
||||
case DISABLE:
|
||||
wl.disable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
|
||||
The contents of this file are subject to the terms of either the GNU
|
||||
General Public License Version 3 only ("GPL") or the Common
|
||||
Development and Distribution License("CDDL") (collectively, the
|
||||
"License"). You may not use this file except in compliance with the
|
||||
License. You can obtain a copy of the License at
|
||||
http://gephi.org/about/legal/license-notice/
|
||||
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
|
||||
specific language governing permissions and limitations under the
|
||||
License. When distributing the software, include this License Header
|
||||
Notice in each file and include the License files at
|
||||
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
|
||||
License Header, with the fields enclosed by brackets [] replaced by
|
||||
your own identifying information:
|
||||
"Portions Copyrighted [year] [name of copyright owner]"
|
||||
|
||||
If you wish your version of this file to be governed by only the CDDL
|
||||
or only the GPL Version 3, indicate your decision by adding
|
||||
"[Contributor] elects to include this software in this distribution
|
||||
under the [CDDL or GPL Version 3] license." If you do not indicate a
|
||||
single choice of license, a recipient has the option to distribute
|
||||
your version of this file under either the CDDL, the GPL Version 3 or
|
||||
to extend the choice of license to its licensees as provided above.
|
||||
However, if you add GPL Version 3 code and therefore, elected the GPL
|
||||
Version 3 license, then the option applies only if the new code is
|
||||
made subject to such option by the copyright holder.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Portions Copyrighted 2011 Gephi Consortium.
|
||||
*/
|
||||
package org.gephi.project.impl;
|
||||
|
||||
import java.beans.PropertyEditorManager;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.gephi.project.api.Project;
|
||||
import org.gephi.project.api.ProjectController;
|
||||
import org.gephi.project.api.Projects;
|
||||
import org.gephi.project.api.WorkspaceProvider;
|
||||
import org.gephi.project.io.LoadTask;
|
||||
import org.gephi.project.io.SaveTask;
|
||||
import org.gephi.project.api.Workspace;
|
||||
import org.gephi.project.api.WorkspaceInformation;
|
||||
import org.gephi.project.api.WorkspaceListener;
|
||||
import org.gephi.workspace.impl.WorkspaceImpl;
|
||||
import org.gephi.workspace.impl.WorkspaceInformationImpl;
|
||||
import org.gephi.project.spi.WorkspaceDuplicateProvider;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
@ServiceProvider(service = ProjectController.class)
|
||||
public class ProjectControllerImpl implements ProjectController {
|
||||
|
||||
private enum EventType {
|
||||
|
||||
INITIALIZE, SELECT, UNSELECT, CLOSE, DISABLE
|
||||
};
|
||||
//Data
|
||||
private final ProjectsImpl projects = new ProjectsImpl();
|
||||
private final List<WorkspaceListener> listeners;
|
||||
private WorkspaceImpl temporaryOpeningWorkspace;
|
||||
|
||||
public ProjectControllerImpl() {
|
||||
|
||||
//Listeners
|
||||
listeners = new ArrayList<WorkspaceListener>();
|
||||
listeners.addAll(Lookup.getDefault().lookupAll(WorkspaceListener.class));
|
||||
|
||||
registerNetbeansPropertyEditors();
|
||||
}
|
||||
|
||||
/**
|
||||
* If not already registered, includes NetBeans property editors in the search path.
|
||||
* This is necessary when in the toolkit to properly save and read project files.
|
||||
*/
|
||||
private void registerNetbeansPropertyEditors() {
|
||||
List<String> list = new ArrayList<String>(Arrays.asList(PropertyEditorManager.getEditorSearchPath()));
|
||||
if(!list.contains("org.netbeans.beaninfo.editors")){
|
||||
list.add(0, "org.netbeans.beaninfo.editors");//Add first for more preference
|
||||
PropertyEditorManager.setEditorSearchPath(list.toArray(new String[list.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
public void startup() {
|
||||
final String OPEN_LAST_PROJECT_ON_STARTUP = "Open_Last_Project_On_Startup";
|
||||
final String NEW_PROJECT_ON_STARTUP = "New_Project_On_Startup";
|
||||
boolean openLastProject = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(OPEN_LAST_PROJECT_ON_STARTUP, false);
|
||||
boolean newProjectStartup = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(NEW_PROJECT_ON_STARTUP, false);
|
||||
|
||||
//Default project
|
||||
if (!openLastProject && newProjectStartup) {
|
||||
newProject();
|
||||
}
|
||||
}
|
||||
|
||||
public void newProject() {
|
||||
closeCurrentProject();
|
||||
ProjectImpl project = new ProjectImpl();
|
||||
projects.addProject(project);
|
||||
openProject(project);
|
||||
}
|
||||
|
||||
public Runnable openProject(File file) {
|
||||
return new LoadTask(file);
|
||||
}
|
||||
|
||||
public Runnable saveProject(Project project) {
|
||||
if (project.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
File file = project.getLookup().lookup(ProjectInformationImpl.class).getFile();
|
||||
return saveProject(project, file);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Runnable saveProject(Project project, File file) {
|
||||
project.getLookup().lookup(ProjectInformationImpl.class).setFile(file);
|
||||
SaveTask saveTask = new SaveTask(project, file);
|
||||
return saveTask;
|
||||
}
|
||||
|
||||
public void closeCurrentProject() {
|
||||
if (projects.hasCurrentProject()) {
|
||||
ProjectImpl currentProject = projects.getCurrentProject();
|
||||
|
||||
//Event
|
||||
if (currentProject.getLookup().lookup(WorkspaceProvider.class).hasCurrentWorkspace()) {
|
||||
fireWorkspaceEvent(EventType.UNSELECT, currentProject.getLookup().lookup(WorkspaceProvider.class).getCurrentWorkspace());
|
||||
}
|
||||
for (Workspace ws : currentProject.getLookup().lookup(WorkspaceProviderImpl.class).getWorkspaces()) {
|
||||
fireWorkspaceEvent(EventType.CLOSE, ws);
|
||||
}
|
||||
|
||||
//Close
|
||||
currentProject.getLookup().lookup(ProjectInformationImpl.class).close();
|
||||
projects.closeCurrentProject();
|
||||
|
||||
fireWorkspaceEvent(EventType.DISABLE, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeProject(Project project) {
|
||||
if (projects.getCurrentProject() == project) {
|
||||
closeCurrentProject();
|
||||
}
|
||||
projects.removeProject(project);
|
||||
}
|
||||
|
||||
public Projects getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
public void setProjects(Projects projects) {
|
||||
final String OPEN_LAST_PROJECT_ON_STARTUP = "Open_Last_Project_On_Startup";
|
||||
boolean openLastProject = NbPreferences.forModule(ProjectControllerImpl.class).getBoolean(OPEN_LAST_PROJECT_ON_STARTUP, false);
|
||||
|
||||
Project lastOpenProject = null;
|
||||
for (Project p : ((ProjectsImpl) projects).getProjects()) {
|
||||
if (p.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
ProjectImpl pImpl = (ProjectImpl) p;
|
||||
pImpl.init();
|
||||
this.projects.addProject(p);
|
||||
pImpl.getLookup().lookup(ProjectInformationImpl.class).close();
|
||||
if (p == projects.getCurrentProject()) {
|
||||
lastOpenProject = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (openLastProject && lastOpenProject != null && !lastOpenProject.getLookup().lookup(ProjectInformationImpl.class).isInvalid() && lastOpenProject.getLookup().lookup(ProjectInformationImpl.class).hasFile()) {
|
||||
openProject(lastOpenProject);
|
||||
} else {
|
||||
//newProject();
|
||||
}
|
||||
}
|
||||
|
||||
public Workspace newWorkspace(Project project) {
|
||||
Workspace workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.INITIALIZE, workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
public void deleteWorkspace(Workspace workspace) {
|
||||
WorkspaceInformation wi = workspace.getLookup().lookup(WorkspaceInformation.class);
|
||||
WorkspaceProviderImpl workspaceProvider = wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
|
||||
|
||||
Workspace toSelectWorkspace = null;
|
||||
if (getCurrentWorkspace() == workspace) {
|
||||
toSelectWorkspace = workspaceProvider.getPrecedingWorkspace(workspace);
|
||||
}
|
||||
|
||||
workspaceProvider.removeWorkspace(workspace);
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.CLOSE, workspace);
|
||||
|
||||
if (getCurrentWorkspace() == workspace) {
|
||||
//Select the one before, or after
|
||||
if (toSelectWorkspace == null) {
|
||||
closeCurrentProject();
|
||||
} else {
|
||||
openWorkspace(toSelectWorkspace);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void openProject(Project project) {
|
||||
final ProjectImpl projectImpl = (ProjectImpl) project;
|
||||
final ProjectInformationImpl projectInformationImpl = projectImpl.getLookup().lookup(ProjectInformationImpl.class);
|
||||
final WorkspaceProviderImpl workspaceProviderImpl = project.getLookup().lookup(WorkspaceProviderImpl.class);
|
||||
|
||||
if (projects.hasCurrentProject()) {
|
||||
closeCurrentProject();
|
||||
}
|
||||
projects.addProject(projectImpl);
|
||||
projects.setCurrentProject(projectImpl);
|
||||
projectInformationImpl.open();
|
||||
|
||||
if (!workspaceProviderImpl.hasCurrentWorkspace()) {
|
||||
if (workspaceProviderImpl.getWorkspaces().length == 0) {
|
||||
Workspace workspace = newWorkspace(project);
|
||||
openWorkspace(workspace);
|
||||
} else {
|
||||
Workspace workspace = workspaceProviderImpl.getWorkspaces()[0];
|
||||
openWorkspace(workspace);
|
||||
}
|
||||
} else {
|
||||
fireWorkspaceEvent(EventType.SELECT, workspaceProviderImpl.getCurrentWorkspace());
|
||||
}
|
||||
}
|
||||
|
||||
public ProjectImpl getCurrentProject() {
|
||||
return projects.getCurrentProject();
|
||||
}
|
||||
|
||||
public WorkspaceImpl getCurrentWorkspace() {
|
||||
if (projects.hasCurrentProject()) {
|
||||
temporaryOpeningWorkspace = null;
|
||||
return getCurrentProject().getLookup().lookup(WorkspaceProviderImpl.class).getCurrentWorkspace();
|
||||
} else if (temporaryOpeningWorkspace != null) {
|
||||
return temporaryOpeningWorkspace;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void closeCurrentWorkspace() {
|
||||
WorkspaceImpl workspace = getCurrentWorkspace();
|
||||
if (workspace != null) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).close();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.UNSELECT, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
public void openWorkspace(Workspace workspace) {
|
||||
closeCurrentWorkspace();
|
||||
getCurrentProject().getLookup().lookup(WorkspaceProviderImpl.class).setCurrentWorkspace(workspace);
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).open();
|
||||
|
||||
//Event
|
||||
fireWorkspaceEvent(EventType.SELECT, workspace);
|
||||
}
|
||||
|
||||
public void cleanWorkspace(Workspace workspace) {
|
||||
}
|
||||
|
||||
public Workspace duplicateWorkspace(Workspace workspace) {
|
||||
if (projects.hasCurrentProject()) {
|
||||
Workspace duplicate = newWorkspace(projects.getCurrentProject());
|
||||
for (WorkspaceDuplicateProvider dp : Lookup.getDefault().lookupAll(WorkspaceDuplicateProvider.class)) {
|
||||
dp.duplicate(workspace, duplicate);
|
||||
}
|
||||
openWorkspace(duplicate);
|
||||
return duplicate;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void renameProject(Project project, final String name) {
|
||||
project.getLookup().lookup(ProjectInformationImpl.class).setName(name);
|
||||
}
|
||||
|
||||
public void renameWorkspace(Workspace workspace, String name) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).setName(name);
|
||||
}
|
||||
|
||||
public void setSource(Workspace workspace, String source) {
|
||||
workspace.getLookup().lookup(WorkspaceInformationImpl.class).setSource(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hack to have a current workpace when opening workspace
|
||||
* @param temporaryOpeningWorkspace the opening workspace or null
|
||||
*/
|
||||
public void setTemporaryOpeningWorkspace(WorkspaceImpl temporaryOpeningWorkspace) {
|
||||
this.temporaryOpeningWorkspace = temporaryOpeningWorkspace;
|
||||
if (temporaryOpeningWorkspace != null) {
|
||||
//Init controllers with empty models
|
||||
fireWorkspaceEvent(EventType.INITIALIZE, temporaryOpeningWorkspace);
|
||||
}
|
||||
}
|
||||
|
||||
public void addWorkspaceListener(WorkspaceListener workspaceListener) {
|
||||
synchronized (listeners) {
|
||||
listeners.add(workspaceListener);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeWorkspaceListener(WorkspaceListener workspaceListener) {
|
||||
synchronized (listeners) {
|
||||
listeners.remove(workspaceListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void fireWorkspaceEvent(EventType event, Workspace workspace) {
|
||||
WorkspaceListener[] listenersArray;
|
||||
synchronized (listeners) {
|
||||
listenersArray = listeners.toArray(new WorkspaceListener[0]);
|
||||
}
|
||||
for (WorkspaceListener wl : listenersArray) {
|
||||
switch (event) {
|
||||
case INITIALIZE:
|
||||
wl.initialize(workspace);
|
||||
break;
|
||||
case SELECT:
|
||||
wl.select(workspace);
|
||||
break;
|
||||
case UNSELECT:
|
||||
wl.unselect(workspace);
|
||||
break;
|
||||
case CLOSE:
|
||||
wl.close(workspace);
|
||||
break;
|
||||
case DISABLE:
|
||||
wl.disable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>project-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ProjectUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ranking-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>RankingAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ranking-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>RankingPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ranking-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>RankingPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>settings-upgrader</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>SettingsUpgrader</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>spigot-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>SpigotPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>spigot-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>SpigotPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>spline-editor</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>SplineEditor</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>statistics-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>StatisticsAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>statistics-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>StatisticsPlugin</name>
|
||||
|
||||
@@ -172,7 +172,7 @@ public class Degree implements Statistics, LongTask {
|
||||
Progress.progress(progress, i);
|
||||
}
|
||||
|
||||
avgDegree /= (isDirected) ? 2 * graph.getNodeCount() : graph.getNodeCount();
|
||||
avgDegree /= graph.getNodeCount();
|
||||
graph.getAttributes().setValue(avgDegreeCol.getIndex(), avgDegree);
|
||||
|
||||
graph.readUnlockAll();
|
||||
|
||||
@@ -170,7 +170,7 @@ public class Hits implements Statistics, LongTask {
|
||||
for (Node node : auth_list) {
|
||||
|
||||
int n_index = indicies.get(node);
|
||||
temp_authority[n_index] = 1.0f;
|
||||
temp_authority[n_index] = authority[n_index];
|
||||
EdgeIterable edge_iter;
|
||||
if (!useUndirected) {
|
||||
edge_iter = ((HierarchicalDirectedGraph) hgraph).getInEdgesAndMetaInEdges(node);
|
||||
@@ -178,9 +178,9 @@ public class Hits implements Statistics, LongTask {
|
||||
edge_iter = ((HierarchicalUndirectedGraph) hgraph).getEdgesAndMetaEdges(node);
|
||||
}
|
||||
for (Edge edge : edge_iter) {
|
||||
Node source = hgraph.getOpposite(node, edge);
|
||||
int source_index = indicies.get(source);
|
||||
temp_authority[n_index] += hubs[source_index];
|
||||
Node target = hgraph.getOpposite(node, edge);
|
||||
int target_index = indicies.get(target);
|
||||
temp_authority[n_index] += hubs[target_index];
|
||||
}
|
||||
|
||||
auth_sum += temp_authority[n_index];
|
||||
@@ -194,10 +194,10 @@ public class Hits implements Statistics, LongTask {
|
||||
for (Node node : hub_list) {
|
||||
|
||||
int n_index = indicies.get(node);
|
||||
temp_hubs[n_index] = 1.0f;
|
||||
temp_hubs[n_index] = hubs[n_index];
|
||||
EdgeIterable edge_iter;
|
||||
if (!useUndirected) {
|
||||
edge_iter = ((HierarchicalDirectedGraph) hgraph).getOutEdgesAndMetaOutEdges(node);
|
||||
edge_iter = ((HierarchicalDirectedGraph) hgraph).getInEdgesAndMetaInEdges(node);
|
||||
} else {
|
||||
edge_iter = ((HierarchicalUndirectedGraph) hgraph).getEdgesAndMetaEdges(node);
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>statistics-plugin-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>StatisticsPluginUI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>timeline</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>TimelineAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>tools-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ToolsAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>tools-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ToolsPlugin</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ui-components</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>UIComponents</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ui-library-wrapper</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>UILibraryWrapper</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>ui-utils</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>UIUtils</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>utils</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>Utils</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>lib.validation</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>ValidationAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>visualization-api</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>VisualizationAPI</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>visualization</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>VisualizationImpl</name>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>welcome-screen</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>WelcomeScreen</name>
|
||||
|
||||
+1400
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<groupId>org.gephi</groupId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>workspace-ui</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<packaging>nbm</packaging>
|
||||
|
||||
<name>WorkspaceUI</name>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.gephi.io.exporter.preview;
|
||||
|
||||
import org.gephi.desktop.welcome.WelcomeTopComponent;
|
||||
import org.gephi.io.exporter.spi.ByteExporter;
|
||||
import org.gephi.io.importer.api.Container;
|
||||
import org.gephi.io.importer.api.ImportController;
|
||||
import org.gephi.io.importer.spi.FileImporter;
|
||||
import org.gephi.io.processor.plugin.DefaultProcessor;
|
||||
import org.gephi.project.api.ProjectController;
|
||||
import org.gephi.project.api.Workspace;
|
||||
import org.junit.Test;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: edubecks
|
||||
* Date: 5/2/13
|
||||
* Time: 6:25 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class PNGExporterTest {
|
||||
|
||||
@Test
|
||||
public void testExecute() throws Exception {
|
||||
|
||||
//Init a project - and therefore a workspace
|
||||
|
||||
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
|
||||
pc.newProject();
|
||||
Workspace workspace = pc.getCurrentWorkspace();
|
||||
|
||||
//Append container to graph structure
|
||||
String sample = "/org/gephi/desktop/welcome/samples/Les Miserables.gexf";
|
||||
|
||||
String fileString = "/org/gephi/desktop/welcome/samples/graph.gexf";
|
||||
File file = new File(fileString);
|
||||
|
||||
|
||||
final InputStream stream = WelcomeTopComponent.class.getResourceAsStream(fileString);
|
||||
System.out.println("@Var: stream: "+stream);
|
||||
|
||||
// final InputStream stream = new FileInputStream("/Users/eduBecKs/Desktop/partitions.gephi");
|
||||
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
|
||||
FileImporter fileImporter = importController.getFileImporter(".gexf");
|
||||
// FileImporter fileImporter = importController.getFileImporter(new File("/Users/eduBecKs/Desktop/partitions.gephi"));
|
||||
System.out.println("@Var: fileImporter: " + fileImporter);
|
||||
|
||||
Container container = importController.importFile(stream, fileImporter);
|
||||
|
||||
importController.process(container, new DefaultProcessor(), workspace);
|
||||
|
||||
|
||||
PNGExporter fileExporter = new PNGExporter();
|
||||
fileExporter.setHeight(1024);
|
||||
fileExporter.setWidth(1024);
|
||||
fileExporter.setMargin(0);
|
||||
fileExporter.setTransparentBackground(true);
|
||||
fileExporter.setWorkspace(workspace);
|
||||
File fileOutput = new File("/Volumes/datos/temp/test.png");
|
||||
OutputStream outStream = new BufferedOutputStream(new FileOutputStream(fileOutput));
|
||||
((ByteExporter) fileExporter).setOutputStream(outStream);
|
||||
fileExporter.execute();
|
||||
System.out.println("Holaaa");
|
||||
|
||||
}
|
||||
}
|
||||
Arquivo binário não exibido.
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.gephi</groupId>
|
||||
<artifactId>gephi-parent</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
currentVersion=Gephi 0.8.2 {0}
|
||||
LBL_splash_window_title=Starting Gephi 0.8.2
|
||||
currentVersion=Gephi 0.9-SNAPSHOT {0}
|
||||
LBL_splash_window_title=Starting Gephi 0.9-SNAPSHOT
|
||||
SplashProgressBarBounds=0,249,473,3
|
||||
SplashProgressBarColor=0xFF9933
|
||||
SplashRunningTextBounds=10,235,450,12
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário