Comparar commits
354 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| f8c032d38b | |||
| d873229ed8 | |||
| 17798a0f81 | |||
| 586e72d4fb | |||
| ec2916565f | |||
| b5c0de406d | |||
| 5777cab4a8 | |||
| 8d05d3958e | |||
| 38e540d8b3 | |||
| 2ce8a3378c | |||
| 23b47bfe12 | |||
| 4b93a004f6 | |||
| 5b36a9f4b6 | |||
| b92f7dd857 | |||
| 52819685e9 | |||
| c2ee37971f | |||
| 96951871fd | |||
| 1b99cc7fe2 | |||
| d873611a2b | |||
| 7a2dcf9bbb | |||
| 046c8efcfb | |||
| 325f60dcab | |||
| 5d7ce7249d | |||
| 535b3ebf99 | |||
| a56db00d36 | |||
| 440b0bdf7e | |||
| f27bbaf7c7 | |||
| d7f321a4bb | |||
| 7409c4fdf6 | |||
| ca72bf6e58 | |||
| 16547aeb93 | |||
| 761701b37e | |||
| 84d050fc48 | |||
| d4bd6896b6 | |||
| 076e9dde7f | |||
| 3af6a89dcd | |||
| 30a10531f6 | |||
| 70d8a4b766 | |||
| 93e8d2f1cc | |||
| d99e990ef2 | |||
| 0f392cfb57 | |||
| 9a99053130 | |||
| 4608208d8e | |||
| 4df863a221 | |||
| db61bb4ac0 | |||
| 23cb8c875f | |||
| 2b9df0f666 | |||
| 9ead548b8e | |||
| a516fac1c3 | |||
| 3ecaa139a6 | |||
| 8743d446d2 | |||
| 0299ef4031 | |||
| 77ec95b76d | |||
| 2d49376813 | |||
| 9b4ffe4ad3 | |||
| 1841a0dde6 | |||
| f79e56880d | |||
| e343581ea4 | |||
| 36327abc0b | |||
| 133d787f12 | |||
| d419d857b4 | |||
| b247f7e310 | |||
| ef1695fe59 | |||
| 8a168364ff | |||
| 8b3e6c75fd | |||
| f2d01585c7 | |||
| 795eb453ce | |||
| 1bc40b4dfc | |||
| e4fb5b4fcf | |||
| 851507afeb | |||
| 6e1f812846 | |||
| 4afd75b332 | |||
| 9bef9d46d7 | |||
| b4ade84641 | |||
| 54b6662663 | |||
| c7f95f1bf9 | |||
| 2b2721f795 | |||
| 509d6baf8f | |||
| 84e721aa6b | |||
| dd1ed43235 | |||
| 56b65b1d9f | |||
| 3955dfbf42 | |||
| c9e397ba43 | |||
| 27e9ae02ac | |||
| 5c89726fc3 | |||
| f217730682 | |||
| 83452510e1 | |||
| 4ffa88d58c | |||
| 10aeb80029 | |||
| d1f6cd6b40 | |||
| 297fe912af | |||
| af722fae5e | |||
| 5086cce845 | |||
| c071086d9b | |||
| 68e7822ea5 | |||
| 69ccc43101 | |||
| acbe4bcaf9 | |||
| 017f801f88 | |||
| f4888f5d46 | |||
| 9852ec5bda | |||
| acb1ceba7f | |||
| f61e469c9a | |||
| 683c30ce39 | |||
| b66ff8cae2 | |||
| 9bb97e2454 | |||
| d9c9522e1e | |||
| db459ff9f9 | |||
| 2aa35be755 | |||
| 5b00186710 | |||
| 0ad61139c5 | |||
| 39a99e5856 | |||
| cbdce1c18f | |||
| f28957b9b8 | |||
| 68d0488623 | |||
| 9b5f8f0b58 | |||
| c6af330b52 | |||
| 07d67961b8 | |||
| ae6074f3af | |||
| 5afef61125 | |||
| b5948fc750 | |||
| e6f79529a9 | |||
| c9e0742720 | |||
| b3d11ae86b | |||
| 21bea2bea7 | |||
| 46ee327fc6 | |||
| 5eda676d97 | |||
| 143635f90b | |||
| cc37a02844 | |||
| c30f743f85 | |||
| 8fb939bfed | |||
| 14d32a80c2 | |||
| 8e350df215 | |||
| 3d12ba9b88 | |||
| 3fa18e67d4 | |||
| bc05917012 | |||
| d2af0fbca1 | |||
| 431fc592f2 | |||
| 9f5857a96f | |||
| 0f0da1be77 | |||
| 1b4080c7af | |||
| e59b7ccf01 | |||
| 7b36dbfe02 | |||
| baec9199a9 | |||
| 1c2f686d48 | |||
| 24098f8bdc | |||
| 5398cd1dda | |||
| 7a3e579f7a | |||
| be4c42e229 | |||
| 0e3facf787 | |||
| 865db80e51 | |||
| 396a5f8666 | |||
| c34d0ea9c3 | |||
| 9057c563e2 | |||
| 0c962cf783 | |||
| 4104a2e7b8 | |||
| f031ff6b63 | |||
| b9d67a895d | |||
| 223da54ac5 | |||
| 1fb3fd0726 | |||
| 310efb3522 | |||
| 3a48a5c87e | |||
| 3ebffd4807 | |||
| 5e7eb963aa | |||
| 5b70b184b1 | |||
| 240f4a5ccf | |||
| 70c4f5fee2 | |||
| e4ac375e15 | |||
| ab62a6bede | |||
| 1ab13abd05 | |||
| 09decb6804 | |||
| 0fa6e99a3f | |||
| dd10de286c | |||
| 930a4d3364 | |||
| b4ed125b9f | |||
| 4ad80ff76e | |||
| ee3bff1ec9 | |||
| 80fcd3fd23 | |||
| abc058d404 | |||
| 24a797be13 | |||
| f946cb3289 | |||
| 1b0ca6dc39 | |||
| 97199a3e43 | |||
| 635b6f4284 | |||
| 0bca238f9c | |||
| c72846a35e | |||
| 9194c27d62 | |||
| c6a2e7d31c | |||
| 85a4e3325d | |||
| 810602a62d | |||
| b8bd3bb214 | |||
| 7669105933 | |||
| 16611286ec | |||
| 3f219e903c | |||
| 41062bd4ab | |||
| 62ad2c6eb5 | |||
| ac91e04884 | |||
| 42b0f6f9b5 | |||
| 92727e6469 | |||
| 1758293a0c | |||
| ecc7fe12dc | |||
| 1eeb8b6a4f | |||
| 542cfa4c7a | |||
| 26c437105d | |||
| a37ff1aed0 | |||
| 1e6b9849ac | |||
| 418f0a7fee | |||
| a5136f4083 | |||
| ff65a9edaa | |||
| 3cef860299 | |||
| ab02babbd8 | |||
| 8f23ee564b | |||
| 8e6e2ce55e | |||
| c376f88ca8 | |||
| a5a4310644 | |||
| 460ddd7407 | |||
| 1daa71b0d3 | |||
| 77b973c1a9 | |||
| 2691a96bf6 | |||
| 0df20c3d6e | |||
| 893f599078 | |||
| 8e0cf5eb27 | |||
| d818ed3c43 | |||
| c13ff9e39a | |||
| ae2c66f737 | |||
| a5ac72e43d | |||
| 569eaf8af0 | |||
| e9b20ac529 | |||
| ee9e693bb7 | |||
| a24452bfd8 | |||
| 408b47f3f8 | |||
| 357672ff4d | |||
| 3dad51bc9d | |||
| 3102fc9be5 | |||
| a7480870ac | |||
| 3ff58b88e0 | |||
| 96c33c0aad | |||
| 8406d5ac6f | |||
| 4b6d6a175c | |||
| 6dd61b1fb0 | |||
| df73f31cb3 | |||
| a020fff6be | |||
| a946ef1d9c | |||
| ad28029706 | |||
| 4634e7217e | |||
| 759e056375 | |||
| ccc765d34f | |||
| f61a8e9793 | |||
| d1f76ded6e | |||
| e0a446bc46 | |||
| aeaa23d7e9 | |||
| 22c58489a7 | |||
| 8ee85137a0 | |||
| 7e43adaf80 | |||
| a8d9686f95 | |||
| 76387e918b | |||
| cbc252297f | |||
| faa835ed32 | |||
| 00f23677b6 | |||
| dc091c5849 | |||
| ce0e9a69a9 | |||
| 64463f8e6c | |||
| 48cc183263 | |||
| 7cf6000e18 | |||
| 98b31c955f | |||
| b5db9996ab | |||
| 5c635bb6ca | |||
| 1754417b85 | |||
| 306adefd0f | |||
| 5983869d7f | |||
| 625495f5dc | |||
| 098a260c64 | |||
| 5778417458 | |||
| 86ce44ba55 | |||
| 99fdd776e0 | |||
| e5d13c0203 | |||
| 298aca0d5b | |||
| c51a160ab2 | |||
| 373c35bc79 | |||
| 6bfc371fdc | |||
| cd0ea5221f | |||
| c881cd267f | |||
| 9d3541085a | |||
| 61ce299b06 | |||
| 0aad688d16 | |||
| befb397071 | |||
| 949c78e4c0 | |||
| 2a7bd148ae | |||
| 3e512a8fee | |||
| da7b035d36 | |||
| bffc9b648c | |||
| 566ac791c9 | |||
| 4934ac0fd6 | |||
| f727bc1642 | |||
| 78f6f3105e | |||
| f9136081a4 | |||
| bdf6b20b2a | |||
| b65651d29b | |||
| 5b6dd5648a | |||
| 1ee73a5aaf | |||
| abfa850163 | |||
| 8d41db01d8 | |||
| 245434de18 | |||
| 1ee91ec0d3 | |||
| f030b6f9ce | |||
| b69395c3a9 | |||
| 4434ff4487 | |||
| 409302299b | |||
| e302638077 | |||
| 564acfb4fa | |||
| 73b4730c4a | |||
| 0bbe484b0c | |||
| 1cae117a23 | |||
| 016648903e | |||
| 372e79c738 | |||
| 75237b89f4 | |||
| fb7f2621df | |||
| 1dab2cb3b6 | |||
| 15442be80d | |||
| 0fb90a528a | |||
| ee9f42be38 | |||
| 5883056b47 | |||
| 4b67c38e5f | |||
| 83d315cf0c | |||
| b42417a3f0 | |||
| 41f82f6484 | |||
| e401428610 | |||
| 4ee4857c0e | |||
| 4377d04fb5 | |||
| e1762d9aee | |||
| dc93a09e93 | |||
| aa251f940a | |||
| da0fd339f2 | |||
| 9b2079668f | |||
| ff1ae68c1c | |||
| de8c087fd0 | |||
| 1ab845fe12 | |||
| f5161a55ac | |||
| 3ede3af94a | |||
| bdc1f92bd8 | |||
| 9f813b5500 | |||
| 4935d58946 | |||
| b88b7e2a03 | |||
| c7b4fa002c | |||
| 3c13058c33 | |||
| 84bba149f4 | |||
| b18bd02d3d | |||
| 8d1c63c22c | |||
| 69e7a7b1cd | |||
| 8b07bc8d97 | |||
| e9ba8cde2a | |||
| 67a820003d | |||
| 64b97a17b9 | |||
| f4fdf2c4b7 | |||
| f2934accc0 |
+99
-9
@@ -1,11 +1,101 @@
|
||||
**/build
|
||||
**/nbproject/private
|
||||
**/nbproject/platform.properties
|
||||
nbproject/project.properties
|
||||
**/dist
|
||||
**/target
|
||||
.DS_Store
|
||||
toolkit
|
||||
keystore.ks
|
||||
dist/**
|
||||
build/**
|
||||
nbproject/private/**
|
||||
/target/
|
||||
/modules/AlgorithmsPlugin/target/
|
||||
/modules/AttributeColumnPropertyEditor/target/
|
||||
/modules/AttributesAPI/target/
|
||||
/modules/AttributesImpl/target/
|
||||
/modules/ClusteringAPI/target/
|
||||
/modules/ClusteringPlugin/target/
|
||||
/modules/CollectionUtils/target/
|
||||
/modules/DataLaboratoryAPI/target/
|
||||
/modules/DataLaboratoryPlugin/target/
|
||||
/modules/DesktopClustering/target/
|
||||
/modules/DBDrivers/target/
|
||||
/modules/DesktopContext/target/
|
||||
/modules/DesktopBranding/target/
|
||||
/modules/DesktopDataLaboratory/target/
|
||||
/modules/DesktopFilters/target/
|
||||
/modules/DesktopProgress/target/
|
||||
/modules/DesktopExport/target/
|
||||
/modules/DesktopGenerate/target/
|
||||
/modules/DesktopHierarchy/target/
|
||||
/modules/DesktopImport/target/
|
||||
/modules/DesktopLayout/target/
|
||||
/modules/DesktopPartition/target/
|
||||
/modules/DesktopPerspective/target/
|
||||
/modules/DesktopPreview/target/
|
||||
/modules/DesktopProject/target/
|
||||
/modules/DesktopRanking/target/
|
||||
/modules/DesktopRecentFiles/target/
|
||||
/modules/DesktopSpigot/target/
|
||||
/modules/DesktopStatistics/target/
|
||||
/modules/DesktopTimeline/target/
|
||||
/modules/DesktopTools/target/
|
||||
/modules/DHNSGraph/target/
|
||||
/modules/DirectoryChooser/target/
|
||||
/modules/DynamicAPI/target/
|
||||
/modules/DynamicImpl/target/
|
||||
/modules/ExportAPI/target/
|
||||
/modules/ExportPlugin/target/
|
||||
/modules/ExportPluginUI/target/
|
||||
/modules/FiltersAPI/target/
|
||||
/modules/FiltersImpl/target/
|
||||
/modules/FiltersPlugin/target/
|
||||
/modules/FiltersPluginUI/target/
|
||||
/modules/GeneratorAPI/target/
|
||||
/modules/GeneratorPlugin/target/
|
||||
/modules/GeneratorPluginUI/target/
|
||||
/modules/application/target/
|
||||
/modules/branding/target/
|
||||
/modules/Gleem/target/
|
||||
/modules/GraphAPI/target/
|
||||
/modules/ImportAPI/target/
|
||||
/modules/ImportPlugin/target/
|
||||
/modules/ImportPluginUI/target/
|
||||
/modules/LayoutAPI/target/
|
||||
/modules/LayoutPlugin/target/
|
||||
/modules/LongTaskAPI/target/
|
||||
/modules/MostRecentFilesAPI/target/
|
||||
/modules/PartitionAPI/target/
|
||||
/modules/PartitionPlugin/target/
|
||||
/modules/PartitionPluginUI/target/
|
||||
/modules/PerspectiveAPI/target/
|
||||
/modules/PreviewAPI/target/
|
||||
/modules/PreviewExport/target/
|
||||
/modules/PreviewExportUI/target/
|
||||
/modules/PreviewPlugin/target/
|
||||
/modules/ProcessorPlugin/target/
|
||||
/modules/ProcessorPluginUI/target/
|
||||
/modules/ProjectAPI/target/
|
||||
/modules/ProjectUI/target/
|
||||
/modules/RankingAPI/target/
|
||||
/modules/RankingPlugin/target/
|
||||
/modules/RankingPluginUI/target/
|
||||
/modules/SettingsUpgrader/target/
|
||||
/modules/SpigotPlugin/target/
|
||||
/modules/SpigotPluginUI/target/
|
||||
/modules/SplineEditor/target/
|
||||
/modules/StatisticsAPI/target/
|
||||
/modules/StatisticsPlugin/target/
|
||||
/modules/StatisticsPluginUI/target/
|
||||
/modules/TimelineAPI/target/
|
||||
/modules/ToolsAPI/target/
|
||||
/modules/ToolsPlugin/target/
|
||||
/modules/UIComponents/target/
|
||||
/modules/UIUtils/target/
|
||||
/modules/Utils/target/
|
||||
/modules/ValidationAPI/target/
|
||||
/modules/VisualizationAPI/target/
|
||||
/modules/VisualizationImpl/target/
|
||||
/modules/WelcomeScreen/target/
|
||||
/modules/WorkspaceUI/target/
|
||||
/modules/JFreeChartWrapper/target/
|
||||
/modules/CommonsWrapper/target/
|
||||
/modules/CoreLibraryWrapper/target/
|
||||
/modules/UILibraryWrapper/target/
|
||||
/modules/AppearanceAPI/target/
|
||||
/modules/AppearancePlugin/target/
|
||||
/modules/AppearancePluginUI/target/
|
||||
/modules/DesktopAppearance/target/
|
||||
|
||||
+883
-795
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.algorithms" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.algorithms.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
@@ -1,5 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.algorithms
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/algorithms/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.1.1
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.algorithms-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
build.xml.data.CRC32=7a62de64
|
||||
build.xml.script.CRC32=cf335b84
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=7a62de64
|
||||
nbproject/build-impl.xml.script.CRC32=7f9d9135
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
@@ -1,6 +0,0 @@
|
||||
javac.source=1.5
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
keystore=nbproject/private/keystore.ks
|
||||
license.file=../gpl-3.0.txt
|
||||
nbm.module.author=Gephi.org
|
||||
nbm_alias=gephi
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.algorithms</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.dynamic.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.algorithms.shortestpath</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1 +0,0 @@
|
||||
suite.dir=${basedir}/..
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-02-29 20\:31+0000\nLast-Translator\: Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>\nLanguage-Team\: Czech (http\://www.transifex.net/projects/p/gephi/language/cs/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: cs\nPlural-Forms\: nplurals\=3; plural\=(n\=\=1) ? 0 \: (n>\=2 && n<\=4) ? 1 \: 2\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Z\u00e1kladn\u00ed algoritmy teorie graf\u016f
|
||||
|
||||
OpenIDE-Module-Short-Description=Z\u00e1kladn\u00ed algoritmy teorie graf\u016f
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/language/es/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: es\nPlural-Forms\: nplurals\=2; plural\=(n \!\= 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Algoritmos b\u00e1sicos de la teor\u00eda de grafos
|
||||
|
||||
OpenIDE-Module-Short-Description=Algoritmos b\u00e1sicos de la teor\u00eda de grafos
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/language/fr/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: fr\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Algorithmes de base en th\u00e9orie des graphes
|
||||
|
||||
OpenIDE-Module-Short-Description=Algorithmes de base en th\u00e9orie des graphes
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-11 00\:30+0000\nLast-Translator\: Siro Kida <kida.siro@gmail.com>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/language/ja/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ja\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u57fa\u790e\u30b0\u30e9\u30d5\u7406\u8ad6\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0
|
||||
|
||||
OpenIDE-Module-Short-Description=\u57fa\u790e\u30b0\u30e9\u30d5\u7406\u8ad6\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# C\u00e9lio CJr <celiofariajr@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 23\:22+0000\nLast-Translator\: C\u00e9lio Faria Jr. <celiofariajr@gmail.com>\nLanguage-Team\: Portuguese (Brazil) (http\://www.transifex.net/projects/p/gephi/language/pt_BR/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: pt_BR\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Algoritmos b\u00e1sicos de teoria de grafos
|
||||
|
||||
OpenIDE-Module-Short-Description=Algoritmos b\u00e1sicos de teoria de grafos
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Russian (http\://www.transifex.net/projects/p/gephi/language/ru/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ru\nPlural-Forms\: nplurals\=3; plural\=(n%10\=\=1 && n%100\!\=11 ? 0 \: n%10>\=2 && n%10<\=4 && (n%100<10 || n%100>\=20) ? 1 \: 2)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432
|
||||
|
||||
OpenIDE-Module-Short-Description=\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432
|
||||
@@ -1,10 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-08 00\:21+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Chinese (China) (http\://www.transifex.net/projects/p/gephi/language/zh_CN/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: zh_CN\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u57fa\u672c\u7684\u56fe\u8bba\u7b97\u6cd5
|
||||
|
||||
OpenIDE-Module-Short-Description=\u57fa\u672c\u7684\u56fe\u8bba\u7b97\u6cd5
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyněk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-02-29 20:31+0000\n"
|
||||
"Last-Translator: Zbyněk Schwarz <zbynek.schwarz@gmail.com>\n"
|
||||
"Language-Team: Czech (http://www.transifex.net/projects/p/gephi/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Základní algoritmy teorie grafů"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Základní algoritmy teorie grafů"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 14:30+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Algoritmos básicos de la teoría de grafos"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Algoritmos básicos de la teoría de grafos"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 14:30+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: French (http://www.transifex.net/projects/p/gephi/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Algorithmes de base en théorie des graphes"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Algorithmes de base en théorie des graphes"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-11 00:30+0000\n"
|
||||
"Last-Translator: Siro Kida <kida.siro@gmail.com>\n"
|
||||
"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/language/ja/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ja\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "基礎グラフ理論アルゴリズム"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "基礎グラフ理論アルゴリズム"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Célio CJr <celiofariajr@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 23:22+0000\n"
|
||||
"Last-Translator: Célio Faria Jr. <celiofariajr@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.net/projects/p/gephi/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Algoritmos básicos de teoria de grafos "
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Algoritmos básicos de teoria de grafos "
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 14:30+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.net/projects/p/gephi/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Базовые алгоритмы теории графов"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Базовые алгоритмы теории графов"
|
||||
-138
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
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.algorithms.shortestpath;
|
||||
|
||||
import java.util.HashMap;
|
||||
import org.gephi.data.attributes.type.TimeInterval;
|
||||
import org.gephi.dynamic.DynamicUtilities;
|
||||
import org.gephi.dynamic.api.DynamicController;
|
||||
import org.gephi.graph.api.DirectedGraph;
|
||||
import org.gephi.graph.api.Edge;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.graph.api.NodeData;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class BellmanFordShortestPathAlgorithm extends AbstractShortestPathAlgorithm {
|
||||
|
||||
protected final DirectedGraph graph;
|
||||
protected final HashMap<NodeData, Edge> predecessors;
|
||||
protected TimeInterval timeInterval;
|
||||
|
||||
public BellmanFordShortestPathAlgorithm(DirectedGraph graph, Node sourceNode) {
|
||||
super(sourceNode);
|
||||
this.graph = graph;
|
||||
predecessors = new HashMap<NodeData, Edge>();
|
||||
DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
|
||||
if (dynamicController != null) {
|
||||
timeInterval = DynamicUtilities.getVisibleInterval(dynamicController.getModel(graph.getGraphModel().getWorkspace()));
|
||||
}
|
||||
}
|
||||
|
||||
public void compute() {
|
||||
|
||||
graph.readLock();
|
||||
|
||||
//Initialize
|
||||
int nodeCount = 0;
|
||||
for (Node node : graph.getNodes()) {
|
||||
distances.put(node.getNodeData(), Double.POSITIVE_INFINITY);
|
||||
nodeCount++;
|
||||
}
|
||||
distances.put(sourceNode.getNodeData(), 0d);
|
||||
|
||||
|
||||
//Relax edges repeatedly
|
||||
for (int i = 0; i < nodeCount; i++) {
|
||||
|
||||
boolean relaxed = false;
|
||||
for (Edge edge : graph.getEdges()) {
|
||||
Node target = edge.getTarget();
|
||||
if (relax(edge)) {
|
||||
relaxed = true;
|
||||
predecessors.put(target.getNodeData(), edge);
|
||||
}
|
||||
}
|
||||
if (!relaxed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Check for negative-weight cycles
|
||||
for (Edge edge : graph.getEdges()) {
|
||||
|
||||
if (distances.get(edge.getSource().getNodeData()) + edgeWeight(edge) < distances.get(edge.getTarget().getNodeData())) {
|
||||
graph.readUnlock();
|
||||
throw new RuntimeException("The Graph contains a negative-weighted cycle");
|
||||
}
|
||||
}
|
||||
|
||||
graph.readUnlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double edgeWeight(Edge edge) {
|
||||
if (timeInterval != null) {
|
||||
return edge.getWeight(timeInterval.getLow(), timeInterval.getHigh());
|
||||
}
|
||||
return edge.getWeight();
|
||||
}
|
||||
|
||||
public Node getPredecessor(Node node) {
|
||||
Edge edge = predecessors.get(node.getNodeData());
|
||||
if (edge != null) {
|
||||
if (edge.getSource().getNodeData() != node.getNodeData()) {
|
||||
return edge.getSource();
|
||||
} else {
|
||||
return edge.getTarget();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Edge getPredecessorIncoming(Node node) {
|
||||
return predecessors.get(node.getNodeData());
|
||||
}
|
||||
}
|
||||
-158
@@ -1,158 +0,0 @@
|
||||
/*
|
||||
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.algorithms.shortestpath;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.gephi.data.attributes.type.TimeInterval;
|
||||
import org.gephi.dynamic.DynamicUtilities;
|
||||
import org.gephi.dynamic.api.DynamicController;
|
||||
import org.gephi.graph.api.Edge;
|
||||
import org.gephi.graph.api.Graph;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.graph.api.NodeData;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class DijkstraShortestPathAlgorithm extends AbstractShortestPathAlgorithm {
|
||||
|
||||
protected final Graph graph;
|
||||
protected final HashMap<NodeData, Edge> predecessors;
|
||||
protected TimeInterval timeInterval;
|
||||
|
||||
public DijkstraShortestPathAlgorithm(Graph graph, Node sourceNode) {
|
||||
super(sourceNode);
|
||||
this.graph = graph;
|
||||
predecessors = new HashMap<NodeData, Edge>();
|
||||
DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
|
||||
if (dynamicController != null) {
|
||||
timeInterval = DynamicUtilities.getVisibleInterval(dynamicController.getModel(graph.getGraphModel().getWorkspace()));
|
||||
}
|
||||
}
|
||||
|
||||
public void compute() {
|
||||
|
||||
graph.readLock();
|
||||
Set<Node> unsettledNodes = new HashSet<Node>();
|
||||
Set<NodeData> settledNodes = new HashSet<NodeData>();
|
||||
|
||||
//Initialize
|
||||
for (Node node : graph.getNodes()) {
|
||||
distances.put(node.getNodeData(), Double.POSITIVE_INFINITY);
|
||||
}
|
||||
distances.put(sourceNode.getNodeData(), 0d);
|
||||
unsettledNodes.add(sourceNode);
|
||||
|
||||
while (!unsettledNodes.isEmpty()) {
|
||||
|
||||
// find node with smallest distance value
|
||||
Double minDistance = Double.POSITIVE_INFINITY;
|
||||
Node minDistanceNode = null;
|
||||
for (Node k : unsettledNodes) {
|
||||
Double dist = distances.get(k.getNodeData());
|
||||
if (minDistanceNode == null) {
|
||||
minDistanceNode = k;
|
||||
}
|
||||
|
||||
if (dist.compareTo(minDistance) < 0) {
|
||||
minDistance = dist;
|
||||
minDistanceNode = k;
|
||||
}
|
||||
}
|
||||
unsettledNodes.remove(minDistanceNode);
|
||||
settledNodes.add(minDistanceNode.getNodeData());
|
||||
|
||||
for (Edge edge : graph.getEdges(minDistanceNode)) {
|
||||
Node neighbor = graph.getOpposite(minDistanceNode, edge);
|
||||
if (!settledNodes.contains(neighbor.getNodeData())) {
|
||||
double dist = getShortestDistance(minDistanceNode) + edgeWeight(edge);
|
||||
if (getShortestDistance(neighbor) > dist) {
|
||||
|
||||
distances.put(neighbor.getNodeData(), dist);
|
||||
predecessors.put(neighbor.getNodeData(), edge);
|
||||
unsettledNodes.add(neighbor);
|
||||
maxDistance = Math.max(maxDistance, dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
graph.readUnlock();
|
||||
}
|
||||
|
||||
private double getShortestDistance(Node destination) {
|
||||
Double d = distances.get(destination.getNodeData());
|
||||
if (d == null) {
|
||||
return Double.POSITIVE_INFINITY;
|
||||
} else {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double edgeWeight(Edge edge) {
|
||||
if (timeInterval != null) {
|
||||
return edge.getWeight(timeInterval.getLow(), timeInterval.getHigh());
|
||||
}
|
||||
return edge.getWeight();
|
||||
}
|
||||
|
||||
public Node getPredecessor(Node node) {
|
||||
Edge edge = predecessors.get(node.getNodeData());
|
||||
if (edge != null) {
|
||||
if (edge.getSource() != node) {
|
||||
return edge.getSource();
|
||||
} else {
|
||||
return edge.getTarget();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Edge getPredecessorIncoming(Node node) {
|
||||
return predecessors.get(node.getNodeData());
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-08 00:21+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/gephi/language/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "基本的图论算法"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "基本的图论算法"
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.ui.propertyeditor" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.ui.propertyeditor.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.ui.propertyeditor
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/ui/propertyeditor/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.1
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.ui.propertyeditor-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
build.xml.data.CRC32=b90a9a84
|
||||
build.xml.script.CRC32=fee76ed2
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=b90a9a84
|
||||
nbproject/build-impl.xml.script.CRC32=3fb6a735
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.1
|
||||
@@ -1,6 +0,0 @@
|
||||
javac.source=1.5
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
keystore=nbproject/private/keystore.ks
|
||||
license.file=../gpl-3.0.txt
|
||||
nbm.module.author=Gephi.org
|
||||
nbm_alias=gephi
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.ui.propertyeditor</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.6.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.ui.propertyeditor</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1 +0,0 @@
|
||||
suite.dir=${basedir}/..
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-02-29 19\:11+0000\nLast-Translator\: Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>\nLanguage-Team\: Czech (http\://www.transifex.net/projects/p/gephi/language/cs/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: cs\nPlural-Forms\: nplurals\=3; plural\=(n\=\=1) ? 0 \: (n>\=2 && n<\=4) ? 1 \: 2\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Tyto edito\u0159i vlastnost\u00ed mohou b\u00fdt pou\u017eity pro zobrazen\u00ed rozbalovac\u00edho r\u00e1me\u010dku se sou\u010dasn\u00fdmi sloupci v PropertySheet.
|
||||
|
||||
OpenIDE-Module-Short-Description=Poskytnout t\u0159\u00eddu PropertyEditor pro vlastnosti AttributeColumn
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/language/es/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: es\nPlural-Forms\: nplurals\=2; plural\=(n \!\= 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Estos editores de propiedades pueden ser utilizados para mostrar un combobox con las columnas actuales en un PropertySheet.
|
||||
|
||||
OpenIDE-Module-Short-Description=Proporcionar la clase PropertyEditor para las propiedades de AttributeColumn
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/language/fr/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: fr\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Ces \u00e9diteurs de propri\u00e9t\u00e9 sont utilisables pour afficher une combobox avec les colonnes courantes dans un PropertySheet.
|
||||
|
||||
OpenIDE-Module-Short-Description=Fournit la classe PropertyEditor pour les propri\u00e9t\u00e9s de AttributeColumn
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-18 10\:40+0000\nLast-Translator\: Siro Kida <kida.siro@gmail.com>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/language/ja/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ja\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u3053\u308c\u3089\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30a8\u30c7\u30a3\u30bf\u306f\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u30b7\u30fc\u30c8\u3067\u3001\u73fe\u5728\u306e\u5217\u3092\u6301\u3064\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
|
||||
|
||||
OpenIDE-Module-Short-Description=AttributeColumn\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306ePropertyEditor\u30af\u30e9\u30b9\u3092\u63d0\u4f9b\u3059\u308b
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# C\u00e9lio CJr <celiofariajr@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 23\:31+0000\nLast-Translator\: C\u00e9lio Faria Jr. <celiofariajr@gmail.com>\nLanguage-Team\: Portuguese (Brazil) (http\://www.transifex.net/projects/p/gephi/language/pt_BR/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: pt_BR\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Estes editores de propriedades pode ser usados para exibir um combobox com as colunas atuais em uma PropertySheet.
|
||||
|
||||
OpenIDE-Module-Short-Description=Fornece classe PropertyEditor para propriedades do tipo AttributeColumn
|
||||
@@ -1,11 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# <altsoph@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-10-07 06\:10+0000\nLast-Translator\: Altsoph <altsoph@gmail.com>\nLanguage-Team\: Russian (http\://www.transifex.net/projects/p/gephi/language/ru/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ru\nPlural-Forms\: nplurals\=3; plural\=(n%10\=\=1 && n%100\!\=11 ? 0 \: n%10>\=2 && n%10<\=4 && (n%100<10 || n%100>\=20) ? 1 \: 2)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0431\u043e-\u0431\u043e\u043a\u0441\u0430 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 \u0432 PropertySheet
|
||||
|
||||
OpenIDE-Module-Short-Description=\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 PropertyEditor \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 AttributeColumn
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-08 00\:21+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Chinese (China) (http\://www.transifex.net/projects/p/gephi/language/zh_CN/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: zh_CN\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u8fd9\u4e9b\u5c5e\u6027\u7f16\u8f91\u5668\u53ef\u7528\u4e8e\u663e\u793a\u5f53\u524d\u5217\u5728PropertySheet\u4e2d\u7684\u4e00\u4e2aComboBox\u3002
|
||||
|
||||
OpenIDE-Module-Short-Description=\u63d0\u4f9bAttributeColumn\u5c5e\u6027\u7684PropertyEditor\u7c7b
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyněk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-02-29 19:11+0000\n"
|
||||
"Last-Translator: Zbyněk Schwarz <zbynek.schwarz@gmail.com>\n"
|
||||
"Language-Team: Czech (http://www.transifex.net/projects/p/gephi/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Tyto editoři vlastností mohou být použity pro zobrazení rozbalovacího rámečku se současnými sloupci v PropertySheet."
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Poskytnout třídu PropertyEditor pro vlastnosti AttributeColumn"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 14:30+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Estos editores de propiedades pueden ser utilizados para mostrar un combobox con las columnas actuales en un PropertySheet."
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Proporcionar la clase PropertyEditor para las propiedades de AttributeColumn"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 14:30+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: French (http://www.transifex.net/projects/p/gephi/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Ces éditeurs de propriété sont utilisables pour afficher une combobox avec les colonnes courantes dans un PropertySheet."
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Fournit la classe PropertyEditor pour les propriétés de AttributeColumn"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-18 10:40+0000\n"
|
||||
"Last-Translator: Siro Kida <kida.siro@gmail.com>\n"
|
||||
"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/language/ja/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ja\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "これらのプロパティエディタは、プロパティシートで、現在の列を持つコンボボックスを表示するために使用することができます。"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "AttributeColumnのプロパティのPropertyEditorクラスを提供する"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Célio CJr <celiofariajr@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-06 23:31+0000\n"
|
||||
"Last-Translator: Célio Faria Jr. <celiofariajr@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.net/projects/p/gephi/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Estes editores de propriedades pode ser usados para exibir um combobox com as colunas atuais em uma PropertySheet."
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Fornece classe PropertyEditor para propriedades do tipo AttributeColumn "
|
||||
@@ -1,25 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# <altsoph@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-10-07 06:10+0000\n"
|
||||
"Last-Translator: Altsoph <altsoph@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.net/projects/p/gephi/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Редакторы свойств могут быть использованы для отображения комбо-бокса с текущими колонками в PropertySheet"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Предоставляет класс PropertyEditor для свойств AttributeColumn "
|
||||
@@ -1,24 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-08 00:21+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/gephi/language/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "这些属性编辑器可用于显示当前列在PropertySheet中的一个ComboBox。"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "提供AttributeColumn属性的PropertyEditor类"
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.data.attributes.api" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.data.attributes.api.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
@@ -1,5 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
OpenIDE-Module: org.gephi.data.attributes.api
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/data/attributes/api/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.0.7
|
||||
AutoUpdate-Essential-Module: true
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.data.attributes.api-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
build.xml.data.CRC32=1965fabe
|
||||
build.xml.script.CRC32=3725a65f
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
nbproject/build-impl.xml.data.CRC32=1965fabe
|
||||
nbproject/build-impl.xml.script.CRC32=24a2766f
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
@@ -1,6 +0,0 @@
|
||||
javac.source=1.5
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
keystore=nbproject/private/keystore.ks
|
||||
license.file=../gpl-3.0.txt
|
||||
nbm.module.author=Gephi.org
|
||||
nbm_alias=gephi
|
||||
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.5</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.31.2.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<test-dependencies>
|
||||
<test-type>
|
||||
<name>unit</name>
|
||||
<test-dependency>
|
||||
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
||||
<compile-dependency/>
|
||||
</test-dependency>
|
||||
</test-type>
|
||||
</test-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.data.attributes.api</package>
|
||||
<package>org.gephi.data.attributes.spi</package>
|
||||
<package>org.gephi.data.attributes.type</package>
|
||||
<package>org.gephi.data.properties</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1 +0,0 @@
|
||||
suite.dir=${basedir}/..
|
||||
@@ -1,602 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>, Martin Škurla, Cezary Bartosiak
|
||||
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.data.attributes.api;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import org.gephi.data.attributes.type.*;
|
||||
import org.openide.util.Exceptions;
|
||||
|
||||
/**
|
||||
* The different type an {@link AttributeColumn} can have.
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
* @author Martin Škurla
|
||||
* @author Cezary Bartosiak
|
||||
*/
|
||||
public enum AttributeType {
|
||||
|
||||
BYTE(Byte.class),
|
||||
SHORT(Short.class),
|
||||
INT(Integer.class),
|
||||
LONG(Long.class),
|
||||
FLOAT(Float.class),
|
||||
DOUBLE(Double.class),
|
||||
BOOLEAN(Boolean.class),
|
||||
CHAR(Character.class),
|
||||
STRING(String.class),
|
||||
BIGINTEGER(BigInteger.class),
|
||||
BIGDECIMAL(BigDecimal.class),
|
||||
DYNAMIC_BYTE(DynamicByte.class),
|
||||
DYNAMIC_SHORT(DynamicShort.class),
|
||||
DYNAMIC_INT(DynamicInteger.class),
|
||||
DYNAMIC_LONG(DynamicLong.class),
|
||||
DYNAMIC_FLOAT(DynamicFloat.class),
|
||||
DYNAMIC_DOUBLE(DynamicDouble.class),
|
||||
DYNAMIC_BOOLEAN(DynamicBoolean.class),
|
||||
DYNAMIC_CHAR(DynamicCharacter.class),
|
||||
DYNAMIC_STRING(DynamicString.class),
|
||||
DYNAMIC_BIGINTEGER(DynamicBigInteger.class),
|
||||
DYNAMIC_BIGDECIMAL(DynamicBigDecimal.class),
|
||||
TIME_INTERVAL(TimeInterval.class),
|
||||
LIST_BYTE(ByteList.class),
|
||||
LIST_SHORT(ShortList.class),
|
||||
LIST_INTEGER(IntegerList.class),
|
||||
LIST_LONG(LongList.class),
|
||||
LIST_FLOAT(FloatList.class),
|
||||
LIST_DOUBLE(DoubleList.class),
|
||||
LIST_BOOLEAN(BooleanList.class),
|
||||
LIST_CHARACTER(CharacterList.class),
|
||||
LIST_STRING(StringList.class),
|
||||
LIST_BIGINTEGER(BigIntegerList.class),
|
||||
LIST_BIGDECIMAL(BigDecimalList.class);
|
||||
private final Class type;
|
||||
|
||||
AttributeType(Class type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return type.getSimpleName();
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the enum constant.
|
||||
*
|
||||
* @return the name of the enum constant
|
||||
*/
|
||||
public String getTypeString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the
|
||||
* <code>Class</code> the type is associated with.
|
||||
*
|
||||
* @return the
|
||||
* <code>class</code> the type is associated with
|
||||
*/
|
||||
public Class getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to parse the given
|
||||
* <code>str</code> snippet in an object of the type associated to this
|
||||
* <code>AttributeType</code>. For instance if the type is <b>Boolean</b>, and
|
||||
* <code>str</code> equals
|
||||
* <code>true</code>, this method will succeed to return a
|
||||
* <code>Boolean</code> instance. May throw
|
||||
* <code>NumberFormatException</code>.
|
||||
*
|
||||
* <code>DYNAMIC</code> types and
|
||||
* <code>TIME_INTERVAL</code> cannot be parsed with this method (see
|
||||
* <code>isDynamicType</code> method) and a UnsupportedOperationException will be thrown if it is tried.
|
||||
*
|
||||
* @param str the string that is to be parsed
|
||||
* @return an instance of the type of this or null if not able to parse given string as the type
|
||||
* <code>AttributeType</code>.
|
||||
*/
|
||||
public Object parse(String str) {
|
||||
switch (this) {
|
||||
case BYTE:
|
||||
return new Byte(removeDecimalDigitsFromString(str));
|
||||
case SHORT:
|
||||
return new Short(removeDecimalDigitsFromString(str));
|
||||
case INT:
|
||||
return new Integer(removeDecimalDigitsFromString(str));
|
||||
case LONG:
|
||||
return new Long(removeDecimalDigitsFromString(str));
|
||||
case FLOAT:
|
||||
return new Float(str);
|
||||
case DOUBLE:
|
||||
return new Double(str);
|
||||
case BOOLEAN:
|
||||
return new Boolean(str);
|
||||
case CHAR:
|
||||
return new Character(str.charAt(0));
|
||||
case BIGINTEGER:
|
||||
return new BigInteger(removeDecimalDigitsFromString(str));
|
||||
case BIGDECIMAL:
|
||||
return new BigDecimal(str);
|
||||
case DYNAMIC_BYTE:
|
||||
case DYNAMIC_SHORT:
|
||||
case DYNAMIC_INT:
|
||||
case DYNAMIC_LONG:
|
||||
case DYNAMIC_FLOAT:
|
||||
case DYNAMIC_DOUBLE:
|
||||
case DYNAMIC_BOOLEAN:
|
||||
case DYNAMIC_CHAR:
|
||||
case DYNAMIC_STRING:
|
||||
case DYNAMIC_BIGINTEGER:
|
||||
case DYNAMIC_BIGDECIMAL:
|
||||
case TIME_INTERVAL:
|
||||
return parseDynamic(str);
|
||||
case LIST_BYTE:
|
||||
return new ByteList(removeDecimalDigitsFromString(str));
|
||||
case LIST_SHORT:
|
||||
return new ShortList(removeDecimalDigitsFromString(str));
|
||||
case LIST_INTEGER:
|
||||
return new IntegerList(removeDecimalDigitsFromString(str));
|
||||
case LIST_LONG:
|
||||
return new LongList(removeDecimalDigitsFromString(str));
|
||||
case LIST_FLOAT:
|
||||
return new FloatList(str);
|
||||
case LIST_DOUBLE:
|
||||
return new DoubleList(str);
|
||||
case LIST_BOOLEAN:
|
||||
return new BooleanList(str);
|
||||
case LIST_CHARACTER:
|
||||
return new CharacterList(str);
|
||||
case LIST_STRING:
|
||||
return new StringList(str);
|
||||
case LIST_BIGINTEGER:
|
||||
return new BigIntegerList(removeDecimalDigitsFromString(str));
|
||||
case LIST_BIGDECIMAL:
|
||||
return new BigDecimalList(str);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private Object parseDynamic(String str) {
|
||||
if (str.equals("<empty>")) {
|
||||
return createDynamicObject(null);
|
||||
}
|
||||
|
||||
if (str.startsWith("<")) {
|
||||
str = str.substring(1);
|
||||
}
|
||||
if (str.endsWith(">")) {
|
||||
str = str.substring(0, str.length() - 1);
|
||||
}
|
||||
String[] intervals = str.split("; *");
|
||||
|
||||
List<Interval> in = new ArrayList<Interval>();
|
||||
|
||||
for (String interval : intervals) {
|
||||
boolean lopen = interval.startsWith("(");
|
||||
boolean ropen = interval.endsWith(")");
|
||||
|
||||
interval = interval.substring(1, interval.length() - 1);
|
||||
String[] parts = interval.split(", *", 3);
|
||||
double low, high;
|
||||
try {
|
||||
//Try first to parse as a single double:
|
||||
low = Double.parseDouble(parts[0]);
|
||||
} catch (Exception ex) {
|
||||
try {
|
||||
low = getDoubleFromXMLDateString(parts[0]);
|
||||
} catch (ParseException ex1) {
|
||||
return null;//Can't parse as number or date
|
||||
}
|
||||
}
|
||||
try {
|
||||
//Try first to parse as a single double:
|
||||
high = Double.parseDouble(parts[1]);
|
||||
} catch (Exception ex) {
|
||||
try {
|
||||
high = getDoubleFromXMLDateString(parts[1]);
|
||||
} catch (ParseException ex1) {
|
||||
return null;//Can't parse as number or date
|
||||
}
|
||||
}
|
||||
Object value = null;
|
||||
switch (this) {
|
||||
case DYNAMIC_BYTE:
|
||||
value = new Byte(removeDecimalDigitsFromString(parts[2]));
|
||||
break;
|
||||
case DYNAMIC_SHORT:
|
||||
value = new Short(removeDecimalDigitsFromString(parts[2]));
|
||||
break;
|
||||
case DYNAMIC_INT:
|
||||
value = new Integer(removeDecimalDigitsFromString(parts[2]));
|
||||
break;
|
||||
case DYNAMIC_LONG:
|
||||
value = new Long(removeDecimalDigitsFromString(parts[2]));
|
||||
break;
|
||||
case DYNAMIC_FLOAT:
|
||||
value = new Float(parts[2]);
|
||||
break;
|
||||
case DYNAMIC_DOUBLE:
|
||||
value = new Double(parts[2]);
|
||||
break;
|
||||
case DYNAMIC_BOOLEAN:
|
||||
value = new Boolean(parts[2]);
|
||||
break;
|
||||
case DYNAMIC_CHAR:
|
||||
value = new Character(parts[2].charAt(0));
|
||||
break;
|
||||
case DYNAMIC_STRING:
|
||||
value = parts[2];
|
||||
break;
|
||||
case DYNAMIC_BIGINTEGER:
|
||||
value = new BigInteger(removeDecimalDigitsFromString(parts[2]));
|
||||
break;
|
||||
case DYNAMIC_BIGDECIMAL:
|
||||
value = new BigDecimal(parts[2]);
|
||||
break;
|
||||
case TIME_INTERVAL:
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
|
||||
in.add(new Interval(low, high, lopen, ropen, value));
|
||||
}
|
||||
|
||||
return createDynamicObject(in);
|
||||
}
|
||||
|
||||
private DynamicType createDynamicObject(List<Interval> in) {
|
||||
if (!this.isDynamicType()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (this) {
|
||||
case DYNAMIC_BYTE: {
|
||||
ArrayList<Interval<Byte>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Byte>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Byte>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Byte) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicByte(lin);
|
||||
}
|
||||
case DYNAMIC_SHORT: {
|
||||
ArrayList<Interval<Short>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Short>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Short>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Short) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicShort(lin);
|
||||
}
|
||||
case DYNAMIC_INT: {
|
||||
ArrayList<Interval<Integer>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Integer>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Integer>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Integer) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicInteger(lin);
|
||||
}
|
||||
case DYNAMIC_LONG: {
|
||||
ArrayList<Interval<Long>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Long>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Long>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Long) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicLong(lin);
|
||||
}
|
||||
case DYNAMIC_FLOAT: {
|
||||
ArrayList<Interval<Float>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Float>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Float>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Float) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicFloat(lin);
|
||||
}
|
||||
case DYNAMIC_DOUBLE: {
|
||||
ArrayList<Interval<Double>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Double>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Double>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Double) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicDouble(lin);
|
||||
}
|
||||
case DYNAMIC_BOOLEAN: {
|
||||
ArrayList<Interval<Boolean>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Boolean>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Boolean>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Boolean) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicBoolean(lin);
|
||||
}
|
||||
case DYNAMIC_CHAR: {
|
||||
ArrayList<Interval<Character>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<Character>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<Character>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (Character) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicCharacter(lin);
|
||||
}
|
||||
case DYNAMIC_STRING: {
|
||||
ArrayList<Interval<String>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<String>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<String>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (String) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicString(lin);
|
||||
}
|
||||
case DYNAMIC_BIGINTEGER: {
|
||||
ArrayList<Interval<BigInteger>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<BigInteger>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<BigInteger>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (BigInteger) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicBigInteger(lin);
|
||||
}
|
||||
case DYNAMIC_BIGDECIMAL: {
|
||||
ArrayList<Interval<BigDecimal>> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval<BigDecimal>>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval<BigDecimal>(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded(), (BigDecimal) interval.getValue()));
|
||||
}
|
||||
}
|
||||
return new DynamicBigDecimal(lin);
|
||||
}
|
||||
case TIME_INTERVAL: {
|
||||
ArrayList<Interval> lin = null;
|
||||
if (in != null) {
|
||||
lin = new ArrayList<Interval>();
|
||||
for (Interval interval : in) {
|
||||
lin.add(new Interval(interval.getLow(), interval.getHigh(),
|
||||
interval.isLowExcluded(), interval.isHighExcluded()));
|
||||
}
|
||||
}
|
||||
return new TimeInterval(lin);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an
|
||||
* <code>AttributeType</code> from the given
|
||||
* <code>obj</code> type. If the given
|
||||
* <code>obj</code> class match with an
|
||||
* <code>AttributeType</code> type, returns this type. Returns
|
||||
* <code>null</code> otherwise. <p> For instance if <b>obj instanceof Float</b> equals <b>true</b>, returns
|
||||
* <code>AttributeType.FLOAT</code>.
|
||||
*
|
||||
* @param obj the object that is to be parsed
|
||||
* @return the compatible
|
||||
* <code>AttributeType</code>, or
|
||||
* <code>null</code> if no type is found or the input object is null
|
||||
*/
|
||||
public static AttributeType parse(Object obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
Class<?> c = obj.getClass();
|
||||
|
||||
for (AttributeType attributeType : AttributeType.values()) {
|
||||
if (c.equals(attributeType.getType())) {
|
||||
return attributeType;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an dynamic
|
||||
* <code>AttributeType</code> from the given
|
||||
* <code>obj</code> type. If the given
|
||||
* <code>obj</code> class match with an
|
||||
* <code>AttributeType</code> type, returns this type. Returns
|
||||
* <code>null</code> otherwise. <p> For instance if <b>obj instanceof Float</b> equals <b>true</b>, returns
|
||||
* <code>AttributeType.DYNAMIC_FLOAT</code>.
|
||||
*
|
||||
* @param obj the object that is to be parsed
|
||||
* @return the compatible
|
||||
* <code>AttributeType</code>, or
|
||||
* <code>null</code>
|
||||
*/
|
||||
public static AttributeType parseDynamic(Object obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Class<?> c = obj.getClass();
|
||||
|
||||
if (c.equals(Byte.class)) {
|
||||
return DYNAMIC_BYTE;
|
||||
}
|
||||
if (c.equals(Short.class)) {
|
||||
return DYNAMIC_SHORT;
|
||||
}
|
||||
if (c.equals(Integer.class)) {
|
||||
return DYNAMIC_INT;
|
||||
}
|
||||
if (c.equals(Long.class)) {
|
||||
return DYNAMIC_LONG;
|
||||
}
|
||||
if (c.equals(Float.class)) {
|
||||
return DYNAMIC_FLOAT;
|
||||
}
|
||||
if (c.equals(Double.class)) {
|
||||
return DYNAMIC_DOUBLE;
|
||||
}
|
||||
if (c.equals(Boolean.class)) {
|
||||
return DYNAMIC_BOOLEAN;
|
||||
}
|
||||
if (c.equals(Character.class)) {
|
||||
return DYNAMIC_CHAR;
|
||||
}
|
||||
if (c.equals(String.class)) {
|
||||
return DYNAMIC_STRING;
|
||||
}
|
||||
if (c.equals(BigInteger.class)) {
|
||||
return DYNAMIC_BIGINTEGER;
|
||||
}
|
||||
if (c.equals(BigDecimal.class)) {
|
||||
return DYNAMIC_BIGDECIMAL;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this type is a {@code DynamicType}.
|
||||
*
|
||||
* @return {@code true} if this is a {@code DynamicType}, {@code false} otherwise
|
||||
*/
|
||||
public boolean isDynamicType() {
|
||||
switch (this) {
|
||||
case DYNAMIC_BYTE:
|
||||
case DYNAMIC_SHORT:
|
||||
case DYNAMIC_INT:
|
||||
case DYNAMIC_LONG:
|
||||
case DYNAMIC_FLOAT:
|
||||
case DYNAMIC_DOUBLE:
|
||||
case DYNAMIC_BOOLEAN:
|
||||
case DYNAMIC_CHAR:
|
||||
case DYNAMIC_STRING:
|
||||
case DYNAMIC_BIGINTEGER:
|
||||
case DYNAMIC_BIGDECIMAL:
|
||||
case TIME_INTERVAL:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isListType() {
|
||||
if (this.equals(LIST_BIGDECIMAL)
|
||||
|| this.equals(LIST_BIGINTEGER)
|
||||
|| this.equals(LIST_BOOLEAN)
|
||||
|| this.equals(LIST_BYTE)
|
||||
|| this.equals(LIST_CHARACTER)
|
||||
|| this.equals(LIST_DOUBLE)
|
||||
|| this.equals(LIST_FLOAT)
|
||||
|| this.equals(LIST_INTEGER)
|
||||
|| this.equals(LIST_LONG)
|
||||
|| this.equals(LIST_SHORT)
|
||||
|| this.equals(LIST_STRING)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the decimal digits and point of the numbers of string when necessary. Used for trying to parse decimal numbers as not decimal. For example BigDecimal to BigInteger.
|
||||
*
|
||||
* @param s String to remove decimal digits
|
||||
* @return String without dot and decimal digits.
|
||||
*/
|
||||
private String removeDecimalDigitsFromString(String s) {
|
||||
return removeDecimalDigitsFromStringPattern.matcher(s).replaceAll("");
|
||||
}
|
||||
private static final Pattern removeDecimalDigitsFromStringPattern = Pattern.compile("\\.[0-9]*");
|
||||
//For trying date parsing:
|
||||
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private static DatatypeFactory dateFactory;
|
||||
|
||||
static {
|
||||
try {
|
||||
dateFactory = DatatypeFactory.newInstance();
|
||||
} catch (DatatypeConfigurationException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
//Throws exception when a date can't be parsed
|
||||
public static double getDoubleFromXMLDateString(String str) throws ParseException {
|
||||
try {
|
||||
return dateFactory.newXMLGregorianCalendar(str.length() > 23 ? str.substring(0, 23) : str).
|
||||
toGregorianCalendar().getTimeInMillis();
|
||||
} catch (IllegalArgumentException ex) {
|
||||
//Try simple format
|
||||
Date date = dateFormat.parse(str);
|
||||
return date.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-02-29 19\:39+0000\nLast-Translator\: Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>\nLanguage-Team\: Czech (http\://www.transifex.net/projects/p/gephi/language/cs/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: cs\nPlural-Forms\: nplurals\=3; plural\=(n\=\=1) ? 0 \: (n>\=2 && n<\=4) ? 1 \: 2\n
|
||||
|
||||
OpenIDE-Module-Long-Description=API vlastnost\u00ed poskytuje p\u0159\u00edstup k hodnot\u00e1m vlastnost\u00ed pomoc\u00ed \u00fa\u010dinn\u00e9ho syst\u00e9mu sloupec/\u0159\u00e1dek.
|
||||
|
||||
AttributeOrigin_property=Vlastnost
|
||||
|
||||
AttributeOrigin_data=Data
|
||||
|
||||
AttributeOrigin_computed_name=Spo\u010d\u00edt\u00e1no
|
||||
|
||||
OpenIDE-Module-Short-Description=API pro ukl\u00e1d\u00e1n\u00ed a z\u00edsk\u00e1v\u00e1n\u00ed vlastnost\u00ed
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-04 19\:12+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/language/es/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: es\nPlural-Forms\: nplurals\=2; plural\=(n \!\= 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Attributes API proporciona acceso a valores de atributos mediante un sistema eficiente de filas/columnas.
|
||||
|
||||
AttributeOrigin_property=Propiedad
|
||||
|
||||
AttributeOrigin_data=Dato
|
||||
|
||||
AttributeOrigin_computed_name=Calculado
|
||||
|
||||
OpenIDE-Module-Short-Description=API para almacenar y recuperar atributos
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-04 19\:12+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/language/fr/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: fr\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=Attributes API donne acc\u00e8s aux valeurs d'attribut \u00e0 travers un syst\u00e8me efficace de lignes/colonnes.
|
||||
|
||||
AttributeOrigin_property=Propri\u00e9t\u00e9
|
||||
|
||||
AttributeOrigin_data=Donn\u00e9e
|
||||
|
||||
AttributeOrigin_computed_name=Calcul\u00e9
|
||||
|
||||
OpenIDE-Module-Short-Description=API de stockage et de r\u00e9cup\u00e9ration d'attributs
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-29 18\:30+0000\nLast-Translator\: Siro Kida <kida.siro@gmail.com>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/language/ja/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ja\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u5c5e\u6027API\u306f\u3001\u52b9\u7387\u7684\u306a\u5217/\u884c\u306e\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u7528\u3057\u3066\u5c5e\u6027\u5024\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002
|
||||
|
||||
AttributeOrigin_property=\u30d7\u30ed\u30d1\u30c6\u30a3
|
||||
|
||||
AttributeOrigin_data=\u30c7\u30fc\u30bf
|
||||
|
||||
AttributeOrigin_computed_name=\u8a08\u7b97\u3055\u308c\u305f
|
||||
|
||||
OpenIDE-Module-Short-Description=\u5c5e\u6027\u3092\u683c\u7d0d\u304a\u3088\u3073\u53d6\u5f97\u3059\u308b\u305f\u3081\u306eAPI
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# C\u00e9lio CJr <celiofariajr@gmail.com>, 2011.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-05 16\:43+0000\nLast-Translator\: C\u00e9lio Faria Jr. <celiofariajr@gmail.com>\nLanguage-Team\: Portuguese (Brazil) (http\://www.transifex.net/projects/p/gephi/language/pt_BR/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: pt_BR\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=A API de atributos fornece acesso aos valores de atributos por meio de um sistema eficiente de colunas e linhas.
|
||||
|
||||
AttributeOrigin_property=Propriedade
|
||||
|
||||
AttributeOrigin_data=Dado
|
||||
|
||||
AttributeOrigin_computed_name=Calculado
|
||||
|
||||
OpenIDE-Module-Short-Description=API de armazenamento e recupera\u00e7\u00e3o de dados
|
||||
@@ -1,17 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-04 19\:14+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Russian (http\://www.transifex.net/projects/p/gephi/language/ru/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ru\nPlural-Forms\: nplurals\=3; plural\=(n%10\=\=1 && n%100\!\=11 ? 0 \: n%10>\=2 && n%10<\=4 && (n%100<10 || n%100>\=20) ? 1 \: 2)\n
|
||||
|
||||
OpenIDE-Module-Long-Description=API \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a.
|
||||
|
||||
AttributeOrigin_property=\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e
|
||||
|
||||
AttributeOrigin_data=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435
|
||||
|
||||
AttributeOrigin_computed_name=\u0420\u0430\u0441\u0447\u0438\u0442\u0430\u043d\u043e
|
||||
|
||||
OpenIDE-Module-Short-Description=API \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c
|
||||
@@ -1,16 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-08 00\:21+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: Chinese (China) (http\://www.transifex.net/projects/p/gephi/language/zh_CN/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: zh_CN\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
OpenIDE-Module-Long-Description=\u5c5e\u6027\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\u63d0\u4f9b\u4e86\u4e00\u4e2a\u901a\u8fc7\u6709\u6548\u7684\u5217/\u884c\u7cfb\u7edf\u6765\u8bbf\u95ee\u5c5e\u6027\u503c\u3002
|
||||
|
||||
AttributeOrigin_property=\u5c5e\u6027
|
||||
|
||||
AttributeOrigin_data=\u6570\u636e
|
||||
|
||||
AttributeOrigin_computed_name=\u8ba1\u7b97
|
||||
|
||||
OpenIDE-Module-Short-Description=\u7528\u4e8e\u5b58\u50a8\u548c\u63d0\u53d6\u5c5e\u6027\u7684\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyněk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-02-29 19:39+0000\n"
|
||||
"Last-Translator: Zbyněk Schwarz <zbynek.schwarz@gmail.com>\n"
|
||||
"Language-Team: Czech (http://www.transifex.net/projects/p/gephi/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "API vlastností poskytuje přístup k hodnotám vlastností pomocí účinného systému sloupec/řádek."
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "Vlastnost"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "Data"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "Spočítáno"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "API pro ukládání a získávání vlastností"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-04 19:12+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Attributes API proporciona acceso a valores de atributos mediante un sistema eficiente de filas/columnas."
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "Propiedad"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "Dato"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "Calculado"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "API para almacenar y recuperar atributos"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-04 19:12+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: French (http://www.transifex.net/projects/p/gephi/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "Attributes API donne accès aux valeurs d'attribut à travers un système efficace de lignes/colonnes."
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "Propriété"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "Donnée"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "Calculé"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "API de stockage et de récupération d'attributs"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-29 18:30+0000\n"
|
||||
"Last-Translator: Siro Kida <kida.siro@gmail.com>\n"
|
||||
"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/language/ja/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ja\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "属性APIは、効率的な列/行のシステムを使用して属性値へのアクセスを提供します。"
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "プロパティ"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "データ"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "計算された"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "属性を格納および取得するためのAPI"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Célio CJr <celiofariajr@gmail.com>, 2011.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-05 16:43+0000\n"
|
||||
"Last-Translator: Célio Faria Jr. <celiofariajr@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.net/projects/p/gephi/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "A API de atributos fornece acesso aos valores de atributos por meio de um sistema eficiente de colunas e linhas."
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "Propriedade"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "Dado"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "Calculado"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "API de armazenamento e recuperação de dados"
|
||||
@@ -1,34 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2011-08-04 19:14+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.net/projects/p/gephi/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "API доступа к атрибутам предоставляет эффективный механизм для работы с атрибутами в терминах строк и колонок."
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "Свойство"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "Значение"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "Расчитано"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "API доступа к атрибутам"
|
||||
@@ -1,33 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-08 00:21+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/gephi/language/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "OpenIDE-Module-Long-Description"
|
||||
msgstr "属性应用程序接口提供了一个通过有效的列/行系统来访问属性值。"
|
||||
|
||||
msgid "AttributeOrigin_property"
|
||||
msgstr "属性"
|
||||
|
||||
msgid "AttributeOrigin_data"
|
||||
msgstr "数据"
|
||||
|
||||
msgid "AttributeOrigin_computed_name"
|
||||
msgstr "计算"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "用于存储和提取属性的应用程序接口"
|
||||
@@ -1,321 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Cezary Bartosiak
|
||||
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.data.attributes.type;
|
||||
|
||||
import org.gephi.data.attributes.api.AttributeUtils;
|
||||
|
||||
/**
|
||||
* This class represents an interval with some value.
|
||||
*
|
||||
* @author Cezary Bartosiak
|
||||
*
|
||||
* @param <T> type of data
|
||||
*/
|
||||
public final class Interval<T> implements Comparable<Interval> {
|
||||
|
||||
private double low; // the left endpoint
|
||||
private double high; // the right endpoint
|
||||
private boolean lopen; // indicates if the left endpoint is excluded
|
||||
private boolean ropen; // indicates if the right endpoint is excluded
|
||||
private T value; // the value stored in this interval
|
||||
|
||||
/**
|
||||
* Constructs a new interval instance
|
||||
*
|
||||
* <p>Note that {@code value} cannot be null if you want use this
|
||||
* {@code interval} as a value storage. If it is null some estimators
|
||||
* could not work and generate exceptions.
|
||||
*
|
||||
* @param interval the interval to copy the values from
|
||||
* @param value the value stored in this interval
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code low} > {@code high}.
|
||||
*/
|
||||
public Interval(Interval interval, T value) {
|
||||
this.low = interval.low;
|
||||
this.high = interval.high;
|
||||
this.lopen = interval.lopen;
|
||||
this.ropen = interval.ropen;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new interval instance.
|
||||
*
|
||||
* <p>Note that {@code value} cannot be null if you want use this
|
||||
* {@code interval} as a value storage. If it is null some estimators
|
||||
* could not work and generate exceptions.
|
||||
*
|
||||
* @param low the left endpoint
|
||||
* @param high the right endpoint
|
||||
* @param lopen indicates if the left endpoint is excluded (true in this case)
|
||||
* @param ropen indicates if the right endpoint is excluded (true in this case)
|
||||
* @param value the value stored in this interval
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code low} > {@code high}.
|
||||
*/
|
||||
public Interval(double low, double high, boolean lopen, boolean ropen, T value) {
|
||||
if (low > high) {
|
||||
throw new IllegalArgumentException(
|
||||
"The left endpoint of the interval must be less than "
|
||||
+ "the right endpoint.");
|
||||
}
|
||||
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
this.lopen = lopen;
|
||||
this.ropen = ropen;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new interval instance with no value.
|
||||
*
|
||||
* @param low the left endpoint
|
||||
* @param high the right endpoint
|
||||
* @param lopen indicates if the left endpoint is excluded (true in this case)
|
||||
* @param ropen indicates if the right endpoint is excluded (true in this case)
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code low} > {@code high}.
|
||||
*/
|
||||
public Interval(double low, double high, boolean lopen, boolean ropen) {
|
||||
this(low, high, lopen, ropen, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new interval instance with left and right endpoints included
|
||||
* by default.
|
||||
*
|
||||
* <p>Note that {@code value} cannot be null if you want use this
|
||||
* {@code interval} as a value storage. If it is null some estimators
|
||||
* could not work and generate exceptions.
|
||||
*
|
||||
* @param low the left endpoint
|
||||
* @param high the right endpoint
|
||||
* @param value the value stored in this interval
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code low} > {@code high}.
|
||||
*/
|
||||
public Interval(double low, double high, T value) {
|
||||
this(low, high, false, false, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new interval instance with no value and left and right
|
||||
* endpoints included by default.
|
||||
*
|
||||
* @param low the left endpoint
|
||||
* @param high the right endpoint
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code low} > {@code high}.
|
||||
*/
|
||||
public Interval(double low, double high) {
|
||||
this(low, high, false, false, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this interval with the specified interval for order.
|
||||
*
|
||||
* <p>Any two intervals <i>i</i> and <i>i'</i> satisfy the {@code interval
|
||||
* trichotomy}; that is, exactly one of the following three properties
|
||||
* holds:
|
||||
* <ol>
|
||||
* <li>
|
||||
* <i>i</i> and <i>i'</i> overlap;
|
||||
*
|
||||
* <li>
|
||||
* <i>i</i> is to the left of <i>i'</i> (<i>i.high < i'.low</i>);
|
||||
*
|
||||
* <li>
|
||||
* <i>i</i> is to the right of <i>i'</i> (<i>i'.high < i.low</i>).
|
||||
* </ol>
|
||||
*
|
||||
* <p>Note that if two intervals are equal ({@code i.low = i'.low} and
|
||||
* {@code i.high = i'.high}), they overlap as well. But if they simply
|
||||
* overlap (for instance {@code i.low < i'.low} and {@code i.high >
|
||||
* i'.high}) they aren't equal. Remember that if two intervals are equal,
|
||||
* they have got the same bounds excluded or included.
|
||||
*
|
||||
* @param interval the interval to be compared
|
||||
*
|
||||
* @return a negative integer, zero, or a positive integer as this interval
|
||||
* is to the left of, overlaps with, or is to the right of the
|
||||
* specified interval.
|
||||
*
|
||||
* @throws NullPointerException if {@code interval} is null.
|
||||
*/
|
||||
public int compareTo(Interval interval) {
|
||||
if (interval == null) {
|
||||
throw new NullPointerException("Interval cannot be null.");
|
||||
}
|
||||
|
||||
if (high < interval.low || high <= interval.low && (ropen || interval.lopen)) {
|
||||
return -1;
|
||||
}
|
||||
if (interval.high < low || interval.high <= low && (interval.ropen || lopen)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left endpoint.
|
||||
*
|
||||
* @return the left endpoint.
|
||||
*/
|
||||
public double getLow() {
|
||||
return low;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right endpoint.
|
||||
*
|
||||
* @return the right endpoint.
|
||||
*/
|
||||
public double getHigh() {
|
||||
return high;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the left endpoint is excluded.
|
||||
*
|
||||
* @return {@code true} if the left endpoint is excluded,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public boolean isLowExcluded() {
|
||||
return lopen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the right endpoint is excluded.
|
||||
*
|
||||
* @return {@code true} if the right endpoint is excluded,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public boolean isHighExcluded() {
|
||||
return ropen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value stored in this interval.
|
||||
*
|
||||
* @return the value stored in this interval.
|
||||
*/
|
||||
public T getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this interval with the specified object for equality.
|
||||
*
|
||||
* <p>Note that two intervals are equal if {@code i.low = i'.low} and
|
||||
* {@code i.high = i'.high} and they have got the bounds excluded/included.
|
||||
*
|
||||
* @param obj object to which this interval is to be compared
|
||||
*
|
||||
* @return {@code true} if and only if the specified {@code Object} is a
|
||||
* {@code Interval} whose low and high are equal to this
|
||||
* {@code Interval's}.
|
||||
*
|
||||
* @see #compareTo(org.gephi.data.attributes.type.Interval)
|
||||
* @see #hashCode
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj.getClass().equals(this.getClass())) {
|
||||
Interval<T> interval = (Interval<T>) obj;
|
||||
if (low == interval.low && high == interval.high
|
||||
&& lopen == interval.lopen && ropen == interval.ropen) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 97 * hash + (int) (Double.doubleToLongBits(this.low) ^ (Double.doubleToLongBits(this.low) >>> 32));
|
||||
hash = 97 * hash + (int) (Double.doubleToLongBits(this.high) ^ (Double.doubleToLongBits(this.high) >>> 32));
|
||||
hash = 97 * hash + (this.lopen ? 1 : 0);
|
||||
hash = 97 * hash + (this.ropen ? 1 : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string representation of the interval with its value.
|
||||
*
|
||||
* @param timesAsDoubles indicates if times should be shown as doubles or dates
|
||||
*
|
||||
* @return a string representation with times as doubles or dates.
|
||||
*/
|
||||
public String toString(boolean timesAsDoubles) {
|
||||
if (timesAsDoubles) {
|
||||
return (lopen ? "(" : "[") + low + ", " + high + ", " + value + (ropen ? ")" : "]");
|
||||
} else {
|
||||
return (lopen ? "(" : "[") + AttributeUtils.getXMLDateStringFromDouble(low) + ", "
|
||||
+ AttributeUtils.getXMLDateStringFromDouble(high) + ", " + value + (ropen ? ")" : "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this interval in one of the formats:
|
||||
* <ol>
|
||||
* <li>
|
||||
* {@code [low, high, value]}
|
||||
* <li>
|
||||
* {@code (low, high, value]}
|
||||
* <li>
|
||||
* {@code [low, high, value)}
|
||||
* <li>
|
||||
* {@code (low, high, value)}
|
||||
* </ol>
|
||||
*
|
||||
* <p>Times are always shown as doubles</p>
|
||||
*
|
||||
* @return a string representation of this interval.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString(true);
|
||||
}
|
||||
}
|
||||
@@ -1,612 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Cezary Bartosiak
|
||||
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.data.attributes.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.data.attributes.api.Estimator;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit test for DynamicType class.
|
||||
*
|
||||
* @author Cezary Bartosiak
|
||||
*/
|
||||
public class DynamicTypeTest {
|
||||
public DynamicTypeTest() { }
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception { }
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception { }
|
||||
|
||||
@Before
|
||||
public void setUp() { }
|
||||
|
||||
@After
|
||||
public void tearDown() { }
|
||||
|
||||
@Test
|
||||
public void testCopyConstructors() {
|
||||
System.out.println("copyConstructors");
|
||||
DynamicDouble expected1 = makeTree1();
|
||||
DynamicDouble instance1 = makeTree1();
|
||||
DynamicDouble expected2 = makeTree1_in();
|
||||
DynamicDouble instance2 = new DynamicDouble(makeTree1(),
|
||||
new Interval<Double>(-2.0, -1.0, 10.0));
|
||||
DynamicDouble expected3 = makeTree1_out();
|
||||
DynamicDouble instance3 = new DynamicDouble(makeTree1(),
|
||||
null,
|
||||
new Interval<Double>(0.0, 30.0));
|
||||
DynamicDouble expected4 = makeTree1_in_out();
|
||||
DynamicDouble instance4 = new DynamicDouble(makeTree1(),
|
||||
new Interval<Double>(-2.0, -1.0, 10.0),
|
||||
new Interval<Double>(0.0, 30.0));
|
||||
assertEquals(expected1, instance1);
|
||||
assertEquals(expected2, instance2);
|
||||
assertEquals(expected3, instance3);
|
||||
assertEquals(expected4, instance4);
|
||||
System.out.println("instance1: " + instance1);
|
||||
System.out.println("instance2: " + instance2);
|
||||
System.out.println("instance3: " + instance3);
|
||||
System.out.println("instance4: " + instance4);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetLow() {
|
||||
System.out.println("getLow()");
|
||||
DynamicDouble instance1 = makeTree1();
|
||||
DynamicDouble instance2 = new DynamicDouble();
|
||||
Double expResult1 = 0.0;
|
||||
Double result1 = instance1.getLow();
|
||||
Double expResult2 = Double.NEGATIVE_INFINITY;
|
||||
Double result2 = instance2.getLow();
|
||||
assertEquals(expResult1, result1);
|
||||
assertEquals(expResult2, result2);
|
||||
System.out.println("expResult1: " + expResult1);
|
||||
System.out.println("result1: " + result1);
|
||||
System.out.println("expResult2: " + expResult2);
|
||||
System.out.println("result2: " + result2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetHigh() {
|
||||
System.out.println("getHigh()");
|
||||
DynamicDouble instance1 = makeTree1();
|
||||
DynamicDouble instance2 = new DynamicDouble();
|
||||
Double expResult1 = 30.0;
|
||||
Double result1 = instance1.getHigh();
|
||||
Double expResult2 = Double.POSITIVE_INFINITY;
|
||||
Double result2 = instance2.getHigh();
|
||||
assertEquals(expResult1, result1);
|
||||
assertEquals(expResult2, result2);
|
||||
System.out.println("expResult1: " + expResult1);
|
||||
System.out.println("result1: " + result1);
|
||||
System.out.println("expResult2: " + expResult2);
|
||||
System.out.println("result2: " + result2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsInRange() {
|
||||
System.out.println("isInRange()");
|
||||
DynamicDouble instance = makeTree1();
|
||||
Boolean expResult1 = false;
|
||||
Boolean result1 = instance.isInRange(11.0, 14.0);
|
||||
Boolean expResult2 = true;
|
||||
Boolean result2 = instance.isInRange(9.0, 12.0);
|
||||
assertEquals(expResult1, result1);
|
||||
assertEquals(expResult2, result2);
|
||||
System.out.println("expResult1: " + expResult1);
|
||||
System.out.println("result1: " + result1);
|
||||
System.out.println("expResult2: " + expResult2);
|
||||
System.out.println("result2: " + result2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValue_0args() {
|
||||
System.out.println("getValue()");
|
||||
DynamicDouble instance = makeTree1();
|
||||
Double value1 = instance.getValue();
|
||||
Double value2 = 0.0;
|
||||
assertEquals(value1, value2);
|
||||
System.out.println("value1: " + value1);
|
||||
System.out.println("value2: " + value2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValue_double_double() {
|
||||
System.out.println("getValue(double, double)");
|
||||
DynamicDouble instance = makeTree1();
|
||||
Double value1 = instance.getValue(14, 16);
|
||||
Double value2 = 4.0;
|
||||
assertEquals(value1, value2);
|
||||
System.out.println("value1: " + value1);
|
||||
System.out.println("value2: " + value2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValue_Estimator() {
|
||||
System.out.println("getValue(Estimator)");
|
||||
DynamicDouble dInstance = makeTree1();
|
||||
DynamicInteger nInstance = makeTreeInteger();
|
||||
DynamicBoolean bInstance = makeTreeBoolean();
|
||||
DynamicCharacter cInstance = makeTreeCharacter();
|
||||
DynamicString sInstance = makeTreeString();
|
||||
Double valueRealAverage1 = dInstance.getValue(Estimator.AVERAGE);
|
||||
Double valueRealAverage2 = 4.5;
|
||||
Double valueRealMedian1 = dInstance.getValue(Estimator.MEDIAN);
|
||||
Double valueRealMedian2 = 4.5;
|
||||
Integer valueIntegerAverage1 = nInstance.getValue(Estimator.AVERAGE);
|
||||
Integer valueIntegerAverage2 = 4;
|
||||
Integer valueIntegerMedian1 = nInstance.getValue(Estimator.MEDIAN);
|
||||
Integer valueIntegerMedian2 = 4;
|
||||
Integer valueIntegerSum1 = nInstance.getValue(Estimator.SUM);
|
||||
Integer valueIntegerSum2 = 45;
|
||||
Integer valueIntegerMin1 = nInstance.getValue(Estimator.MIN);
|
||||
Integer valueIntegerMin2 = 0;
|
||||
Integer valueIntegerMax1 = nInstance.getValue(Estimator.MAX);
|
||||
Integer valueIntegerMax2 = 9;
|
||||
Boolean valueBooleanMin1 = bInstance.getValue(Estimator.MIN);
|
||||
Boolean valueBooleanMin2 = false;
|
||||
Boolean valueBooleanMax1 = bInstance.getValue(Estimator.MAX);
|
||||
Boolean valueBooleanMax2 = true;
|
||||
Character valueCharacterMin1 = cInstance.getValue(Estimator.MIN);
|
||||
Character valueCharacterMin2 = '0';
|
||||
Character valueCharacterMax1 = cInstance.getValue(Estimator.MAX);
|
||||
Character valueCharacterMax2 = '9';
|
||||
String valueStringMedian1 = sInstance.getValue(Estimator.MEDIAN);
|
||||
String valueStringMedian2 = "5";
|
||||
String valueStringMode1 = sInstance.getValue(Estimator.MODE);
|
||||
String valueStringMode2 = "0_repeat";
|
||||
String valueStringMin1 = sInstance.getValue(Estimator.MIN);
|
||||
String valueStringMin2 = "0";
|
||||
String valueStringMax1 = sInstance.getValue(Estimator.MAX);
|
||||
String valueStringMax2 = "9";
|
||||
String valueStringFirst1 = sInstance.getValue(Estimator.FIRST);
|
||||
String valueStringFirst2 = "0";
|
||||
String valueStringLast1 = sInstance.getValue(Estimator.LAST);
|
||||
String valueStringLast2 = "0_repeat";
|
||||
assertEquals(valueRealAverage1, valueRealAverage2);
|
||||
assertEquals(valueRealMedian1, valueRealMedian2);
|
||||
assertEquals(valueIntegerAverage1, valueIntegerAverage2);
|
||||
assertEquals(valueIntegerMedian1, valueIntegerMedian2);
|
||||
assertEquals(valueIntegerSum1, valueIntegerSum2);
|
||||
assertEquals(valueIntegerMin1, valueIntegerMin2);
|
||||
assertEquals(valueIntegerMax1, valueIntegerMax2);
|
||||
assertEquals(valueBooleanMin1, valueBooleanMin2);
|
||||
assertEquals(valueBooleanMax1, valueBooleanMax2);
|
||||
assertEquals(valueCharacterMin1, valueCharacterMin2);
|
||||
assertEquals(valueCharacterMax1, valueCharacterMax2);
|
||||
assertEquals(valueStringMedian1, valueStringMedian2);
|
||||
assertEquals(valueStringMode1, valueStringMode2);
|
||||
assertEquals(valueStringMin1, valueStringMin2);
|
||||
assertEquals(valueStringMax1, valueStringMax2);
|
||||
assertEquals(valueStringFirst1, valueStringFirst2);
|
||||
assertEquals(valueStringLast1, valueStringLast2);
|
||||
System.out.println("valueRealAverage1: " + valueRealAverage1);
|
||||
System.out.println("valueRealAverage2: " + valueRealAverage2);
|
||||
System.out.println("valueRealMedian1: " + valueRealMedian1);
|
||||
System.out.println("valueRealMedian2: " + valueRealMedian2);
|
||||
System.out.println("valueIntegerAverage1: " + valueIntegerAverage1);
|
||||
System.out.println("valueIntegerAverage2: " + valueIntegerAverage2);
|
||||
System.out.println("valueIntegerMedian1: " + valueIntegerMedian1);
|
||||
System.out.println("valueIntegerMedian2: " + valueIntegerMedian2);
|
||||
System.out.println("valueIntegerSum1: " + valueIntegerSum1);
|
||||
System.out.println("valueIntegerSum2: " + valueIntegerSum2);
|
||||
System.out.println("valueIntegerMin1: " + valueIntegerMin1);
|
||||
System.out.println("valueIntegerMin2: " + valueIntegerMin2);
|
||||
System.out.println("valueIntegerMax1: " + valueIntegerMax1);
|
||||
System.out.println("valueIntegerMax2: " + valueIntegerMax2);
|
||||
System.out.println("valueBooleanMin1: " + valueBooleanMin1);
|
||||
System.out.println("valueBooleanMin2: " + valueBooleanMin2);
|
||||
System.out.println("valueBooleanMax1: " + valueBooleanMax1);
|
||||
System.out.println("valueBooleanMax2: " + valueBooleanMax2);
|
||||
System.out.println("valueCharacterMin1: " + valueCharacterMin1);
|
||||
System.out.println("valueCharacterMin2: " + valueCharacterMin2);
|
||||
System.out.println("valueCharacterMax1: " + valueCharacterMax1);
|
||||
System.out.println("valueCharacterMax2: " + valueCharacterMax2);
|
||||
System.out.println("valueStringMedian1: " + valueStringMedian1);
|
||||
System.out.println("valueStringMedian2: " + valueStringMedian2);
|
||||
System.out.println("valueStringMode1: " + valueStringMode1);
|
||||
System.out.println("valueStringMode2: " + valueStringMode2);
|
||||
System.out.println("valueStringMin1: " + valueStringMin1);
|
||||
System.out.println("valueStringMin2: " + valueStringMin2);
|
||||
System.out.println("valueStringMax1: " + valueStringMax1);
|
||||
System.out.println("valueStringMax2: " + valueStringMax2);
|
||||
System.out.println("valueStringFirst1: " + valueStringFirst1);
|
||||
System.out.println("valueStringFirst2: " + valueStringFirst2);
|
||||
System.out.println("valueStringLast1: " + valueStringLast1);
|
||||
System.out.println("valueStringLast2: " + valueStringLast2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValue_3args() {
|
||||
System.out.println("getValue(double, double, Estimator)");
|
||||
DynamicDouble instance = makeTree1();
|
||||
Double valueRealAverage1 = instance.getValue(1, 9, Estimator.AVERAGE);
|
||||
Double valueRealAverage2 = 1.5;
|
||||
Double valueRealSum1 = instance.getValue(1, 9, Estimator.SUM);
|
||||
Double valueRealSum2 = 6.0;
|
||||
assertEquals(valueRealAverage1, valueRealAverage2);
|
||||
assertEquals(valueRealSum1, valueRealSum2);
|
||||
System.out.println("valueRealAverage1: " + valueRealAverage1);
|
||||
System.out.println("valueRealAverage2: " + valueRealAverage2);
|
||||
System.out.println("valueRealSum1: " + valueRealSum1);
|
||||
System.out.println("valueRealSum2: " + valueRealSum2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValues_0args() {
|
||||
System.out.println("getValues()");
|
||||
DynamicDouble instance = makeTree3();
|
||||
List<Double> values1 = instance.getValues();
|
||||
List<Double> values2 = new ArrayList<Double>();
|
||||
for (int i = 0; i < 4; ++i)
|
||||
values2.add((double)i);
|
||||
assertEquals(values1, values2);
|
||||
System.out.println("values1: " + values1);
|
||||
System.out.println("values2: " + values2);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetValues_double_double() {
|
||||
System.out.println("getValues(double, double)");
|
||||
DynamicDouble instance = makeTree1();
|
||||
List<Double> values11 = instance.getValues(
|
||||
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
|
||||
List<Double> values12 = new ArrayList<Double>();
|
||||
for (int i = 0; i < 10; ++i)
|
||||
values12.add((double)i);
|
||||
List<Double> values21 = instance.getValues(0, 9);
|
||||
List<Double> values22 = new ArrayList<Double>();
|
||||
for (int i = 0; i < 4; ++i)
|
||||
values22.add((double)i);
|
||||
List<Double> values31 = instance.getValues(14, 19);
|
||||
List<Double> values32 = new ArrayList<Double>();
|
||||
for (int i = 4; i < 8; ++i)
|
||||
values32.add((double)i);
|
||||
List<Double> values41 = instance.getValues(24, 31);
|
||||
List<Double> values42 = new ArrayList<Double>();
|
||||
for (int i = 8; i < 10; ++i)
|
||||
values42.add((double)i);
|
||||
assertEquals(values11, values12);
|
||||
assertEquals(values21, values22);
|
||||
assertEquals(values31, values32);
|
||||
assertEquals(values41, values42);
|
||||
System.out.println("values11: " + values11);
|
||||
System.out.println("values12: " + values12);
|
||||
System.out.println("values21: " + values21);
|
||||
System.out.println("values22: " + values22);
|
||||
System.out.println("values31: " + values31);
|
||||
System.out.println("values32: " + values32);
|
||||
System.out.println("values41: " + values41);
|
||||
System.out.println("values42: " + values42);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetIntervals() {
|
||||
System.out.println("getIntervals(double, double)");
|
||||
DynamicDouble instance = makeTree1();
|
||||
List<Interval<Double>> list = instance.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
|
||||
String result = "<empty>";
|
||||
if (!list.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("<");
|
||||
sb.append(list.get(0).toString());
|
||||
for (int i = 1; i < list.size(); ++i)
|
||||
sb.append("; ").append(list.get(i).toString());
|
||||
sb.append(">");
|
||||
result = sb.toString();
|
||||
}
|
||||
String expResult = instance.toString();
|
||||
assertEquals(result, expResult);
|
||||
System.out.println("result: " + result);
|
||||
System.out.println("expResult: " + expResult);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetUnderlyingType() {
|
||||
System.out.println("getUnderlyingType");
|
||||
DynamicType dInstance = makeTree1();
|
||||
DynamicType nInstance = makeTreeInteger();
|
||||
DynamicType bInstance = makeTreeBoolean();
|
||||
DynamicType cInstance = makeTreeCharacter();
|
||||
DynamicType sInstance = makeTreeString();
|
||||
assertEquals(dInstance.getUnderlyingType(), Double.class);
|
||||
assertEquals(nInstance.getUnderlyingType(), Integer.class);
|
||||
assertEquals(bInstance.getUnderlyingType(), Boolean.class);
|
||||
assertEquals(cInstance.getUnderlyingType(), Character.class);
|
||||
assertEquals(sInstance.getUnderlyingType(), String.class);
|
||||
System.out.println("dInstance: " + dInstance.getUnderlyingType());
|
||||
System.out.println("nInstance: " + nInstance.getUnderlyingType());
|
||||
System.out.println("bInstance: " + bInstance.getUnderlyingType());
|
||||
System.out.println("cInstance: " + cInstance.getUnderlyingType());
|
||||
System.out.println("sInstance: " + sInstance.getUnderlyingType());
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
System.out.println("equals(Object)");
|
||||
DynamicDouble instance1 = makeTree1();
|
||||
DynamicDouble instance2 = makeTree1();
|
||||
DynamicDouble instance3 = makeTree2();
|
||||
DynamicDouble instance4 = makeTree3();
|
||||
boolean expResult1 = true;
|
||||
boolean result1 = instance1.equals(instance1);
|
||||
boolean expResult2 = true;
|
||||
boolean result2 = instance1.equals(instance2);
|
||||
boolean expResult3 = false;
|
||||
boolean result3 = instance2.equals(instance3);
|
||||
boolean expResult4 = false;
|
||||
boolean result4 = instance3.equals(instance4);
|
||||
assertEquals(expResult1, result1);
|
||||
assertEquals(expResult2, result2);
|
||||
assertEquals(expResult3, result3);
|
||||
assertEquals(expResult4, result4);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHashCode() {
|
||||
System.out.println("hashCode()");
|
||||
DynamicDouble instance1 = makeTree1();
|
||||
DynamicDouble instance2 = makeTree1();
|
||||
assertEquals(instance1.hashCode(), instance1.hashCode());
|
||||
assertEquals(instance1.hashCode(), instance2.hashCode());
|
||||
System.out.println("instance1.hashcode(): " + instance1.hashCode());
|
||||
System.out.println("instance2.hashcode(): " + instance2.hashCode());
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToString() {
|
||||
System.out.println("toString()");
|
||||
DynamicDouble instance = makeELboundsTree();
|
||||
StringBuilder expResult = new StringBuilder("<");
|
||||
expResult.append("[0.1, 0.2, 1.0); ");
|
||||
expResult.append("[0.2, 0.3, 2.0); ");
|
||||
expResult.append("(0.3, 0.4, 3.0)");
|
||||
expResult.append(">");
|
||||
String result = instance.toString();
|
||||
assertEquals(expResult.toString(), result);
|
||||
System.out.println("expResult: " + expResult);
|
||||
System.out.println("result: " + result);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeserialization() {
|
||||
System.out.println("deserialization");
|
||||
DynamicDouble instance1 = makeELboundsTree();
|
||||
DynamicDouble instance2 = (DynamicDouble)AttributeType.DYNAMIC_DOUBLE.parse(instance1.toString());
|
||||
DynamicDouble instance3 = new DynamicDouble();
|
||||
DynamicDouble instance4 = (DynamicDouble)AttributeType.DYNAMIC_DOUBLE.parse(instance3.toString());
|
||||
TimeInterval instance5 = makeTimeInterval();
|
||||
TimeInterval instance6 = (TimeInterval)AttributeType.TIME_INTERVAL.parse(instance5.toString());
|
||||
assertEquals(instance1, instance2);
|
||||
assertEquals(instance3, instance4);
|
||||
assertEquals(instance5, instance6);
|
||||
System.out.println("instance1: " + instance1);
|
||||
System.out.println("instance2: " + instance2);
|
||||
System.out.println("instance3: " + instance3);
|
||||
System.out.println("instance4: " + instance4);
|
||||
System.out.println("instance5: " + instance5);
|
||||
System.out.println("instance6: " + instance6);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrder() {
|
||||
DynamicInteger instance = new DynamicInteger();
|
||||
instance = new DynamicInteger(instance, new Interval<Integer>(2009, 2010, 1));
|
||||
instance = new DynamicInteger(instance, new Interval<Integer>(2006, 2007, 2));
|
||||
instance = new DynamicInteger(instance, new Interval<Integer>(2001, 2002, 3));
|
||||
|
||||
List<Interval<Integer>> intervals = instance.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
|
||||
assertEquals(new Interval<Integer>(2001, 2002, 3), intervals.get(0));
|
||||
assertEquals(new Interval<Integer>(2006, 2007, 2), intervals.get(1));
|
||||
assertEquals(new Interval<Integer>(2009, 2010, 1), intervals.get(2));
|
||||
}
|
||||
|
||||
private TimeInterval makeTimeInterval() {
|
||||
List<Interval> intervals = new ArrayList<Interval>();
|
||||
intervals.add(new Interval<Double>(0.1, 0.2, false, true));
|
||||
intervals.add(new Interval<Double>(0.2, 0.3, false, true));
|
||||
intervals.add(new Interval<Double>(0.3, 0.4, true, true));
|
||||
return new TimeInterval(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeELboundsTree() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>(0.1, 0.2, false, true, 1.0));
|
||||
intervals.add(new Interval<Double>(0.2, 0.3, false, true, 2.0));
|
||||
intervals.add(new Interval<Double>(0.3, 0.4, true, true, 3.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree1() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>(26.0, 26.0, 9.0));
|
||||
intervals.add(new Interval<Double>(0.0, 3.0, 0.0));
|
||||
intervals.add(new Interval<Double>(6.0, 10.0, 2.0));
|
||||
intervals.add(new Interval<Double>(5.0, 8.0, 1.0));
|
||||
intervals.add(new Interval<Double>(8.0, 9.0, 3.0));
|
||||
intervals.add(new Interval<Double>(17.0, 19.0, 6.0));
|
||||
intervals.add(new Interval<Double>(16.0, 21.0, 5.0));
|
||||
intervals.add(new Interval<Double>(15.0, 23.0, 4.0));
|
||||
intervals.add(new Interval<Double>(25.0, 30.0, 8.0));
|
||||
intervals.add(new Interval<Double>(19.0, 20.0, 7.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree1_in() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>( 26.0, 26.0, 9.0));
|
||||
intervals.add(new Interval<Double>( 0.0, 3.0, 0.0));
|
||||
intervals.add(new Interval<Double>( 6.0, 10.0, 2.0));
|
||||
intervals.add(new Interval<Double>( 5.0, 8.0, 1.0));
|
||||
intervals.add(new Interval<Double>( 8.0, 9.0, 3.0));
|
||||
intervals.add(new Interval<Double>( 17.0, 19.0, 6.0));
|
||||
intervals.add(new Interval<Double>( 16.0, 21.0, 5.0));
|
||||
intervals.add(new Interval<Double>( 15.0, 23.0, 4.0));
|
||||
intervals.add(new Interval<Double>( 25.0, 30.0, 8.0));
|
||||
intervals.add(new Interval<Double>( 19.0, 20.0, 7.0));
|
||||
intervals.add(new Interval<Double>(-2.0, -1.0, 10.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree1_out() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree1_in_out() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>(-2.0, -1.0, 10.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree2() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>(3.0, 7.0, 0.0));
|
||||
intervals.add(new Interval<Double>(4.0, 5.0, 1.0));
|
||||
intervals.add(new Interval<Double>(6.0, 6.0, 2.0));
|
||||
intervals.add(new Interval<Double>(9.0, 10.0, 3.0));
|
||||
intervals.add(new Interval<Double>(11.0, 12.0, 4.0));
|
||||
intervals.add(new Interval<Double>(15.0, 20.0, 5.0));
|
||||
intervals.add(new Interval<Double>(16.0, 20.0, 6.0));
|
||||
intervals.add(new Interval<Double>(18.0, 21.0, 7.0));
|
||||
intervals.add(new Interval<Double>(24.0, 29.0, 8.0));
|
||||
intervals.add(new Interval<Double>(30.0, 31.0, 9.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicDouble makeTree3() {
|
||||
List<Interval<Double>> intervals = new ArrayList<Interval<Double>>();
|
||||
intervals.add(new Interval<Double>(0.0, 3.0, 0.0));
|
||||
intervals.add(new Interval<Double>(5.0, 8.0, 1.0));
|
||||
intervals.add(new Interval<Double>(6.0, 10.0, 2.0));
|
||||
intervals.add(new Interval<Double>(8.0, 9.0, 3.0));
|
||||
return new DynamicDouble(intervals);
|
||||
}
|
||||
|
||||
private DynamicInteger makeTreeInteger() {
|
||||
List<Interval<Integer>> intervals = new ArrayList<Interval<Integer>>();
|
||||
intervals.add(new Interval<Integer>(0.0, 3.0, 0));
|
||||
intervals.add(new Interval<Integer>(5.0, 8.0, 1));
|
||||
intervals.add(new Interval<Integer>(6.0, 10.0, 2));
|
||||
intervals.add(new Interval<Integer>(8.0, 9.0, 3));
|
||||
intervals.add(new Interval<Integer>(15.0, 23.0, 4));
|
||||
intervals.add(new Interval<Integer>(16.0, 21.0, 5));
|
||||
intervals.add(new Interval<Integer>(17.0, 19.0, 6));
|
||||
intervals.add(new Interval<Integer>(19.0, 20.0, 7));
|
||||
intervals.add(new Interval<Integer>(25.0, 30.0, 8));
|
||||
intervals.add(new Interval<Integer>(26.0, 26.0, 9));
|
||||
return new DynamicInteger(intervals);
|
||||
}
|
||||
|
||||
private DynamicBoolean makeTreeBoolean() {
|
||||
List<Interval<Boolean>> intervals = new ArrayList<Interval<Boolean>>();
|
||||
intervals.add(new Interval<Boolean>(0.0, 3.0, false));
|
||||
intervals.add(new Interval<Boolean>(5.0, 8.0, false));
|
||||
intervals.add(new Interval<Boolean>(6.0, 10.0, false));
|
||||
intervals.add(new Interval<Boolean>(8.0, 9.0, false));
|
||||
intervals.add(new Interval<Boolean>(15.0, 23.0, false));
|
||||
intervals.add(new Interval<Boolean>(16.0, 21.0, false));
|
||||
intervals.add(new Interval<Boolean>(17.0, 19.0, true));
|
||||
intervals.add(new Interval<Boolean>(19.0, 20.0, true));
|
||||
intervals.add(new Interval<Boolean>(25.0, 30.0, true));
|
||||
intervals.add(new Interval<Boolean>(26.0, 26.0, true));
|
||||
return new DynamicBoolean(intervals);
|
||||
}
|
||||
|
||||
private DynamicCharacter makeTreeCharacter() {
|
||||
List<Interval<Character>> intervals =
|
||||
new ArrayList<Interval<Character>>();
|
||||
intervals.add(new Interval<Character>(0.0, 3.0, '0'));
|
||||
intervals.add(new Interval<Character>(5.0, 8.0, '1'));
|
||||
intervals.add(new Interval<Character>(6.0, 10.0, '2'));
|
||||
intervals.add(new Interval<Character>(8.0, 9.0, '3'));
|
||||
intervals.add(new Interval<Character>(15.0, 23.0, '4'));
|
||||
intervals.add(new Interval<Character>(16.0, 21.0, '5'));
|
||||
intervals.add(new Interval<Character>(17.0, 19.0, '6'));
|
||||
intervals.add(new Interval<Character>(19.0, 20.0, '7'));
|
||||
intervals.add(new Interval<Character>(25.0, 30.0, '8'));
|
||||
intervals.add(new Interval<Character>(26.0, 26.0, '9'));
|
||||
return new DynamicCharacter(intervals);
|
||||
}
|
||||
|
||||
private DynamicString makeTreeString() {
|
||||
List<Interval<String>> intervals = new ArrayList<Interval<String>>();
|
||||
intervals.add(new Interval<String>(0.0, 3.0, "0"));
|
||||
intervals.add(new Interval<String>(5.0, 8.0, "1"));
|
||||
intervals.add(new Interval<String>(6.0, 10.0, "2"));
|
||||
intervals.add(new Interval<String>(8.0, 9.0, "3"));
|
||||
intervals.add(new Interval<String>(15.0, 23.0, "4"));
|
||||
intervals.add(new Interval<String>(16.0, 21.0, "5"));
|
||||
intervals.add(new Interval<String>(17.0, 19.0, "6"));
|
||||
intervals.add(new Interval<String>(19.0, 20.0, "7"));
|
||||
intervals.add(new Interval<String>(25.0, 30.0, "8"));
|
||||
intervals.add(new Interval<String>(26.0, 26.0, "9"));
|
||||
intervals.add(new Interval<String>(26.0, 26.0, "0_repeat"));
|
||||
intervals.add(new Interval<String>(27.0, 27.0, "0_repeat"));
|
||||
return new DynamicString(intervals);
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Martin Škurla
|
||||
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.data.attributes.type;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Martin Škurla
|
||||
*/
|
||||
public class IntegerListTest {
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromStringWithDefaultSeparator() {
|
||||
IntegerList list = new IntegerList("11,22;33");
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromStringWithGivenSeparator() {
|
||||
IntegerList list = new IntegerList("11/22/33", "/");
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromPrimitiveArray() {
|
||||
IntegerList list = new IntegerList(new int[] {11, 22, 33});
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromWrapperArray() {
|
||||
IntegerList list = new IntegerList(new Integer[] {11, 22, 33});
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromEmptyPrimitiveArray() {
|
||||
IntegerList list = new IntegerList(new int [0]);
|
||||
assertEquals(list.size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromEmptyWrapperArray() {
|
||||
IntegerList list = new IntegerList(new Integer [0]);
|
||||
assertEquals(list.size(), 0);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Cezary Bartosiak
|
||||
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.data.attributes.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit test for IntervalTree class.
|
||||
*
|
||||
* @author Cezary Bartosiak
|
||||
*/
|
||||
public class IntervalTreeTest {
|
||||
public IntervalTreeTest() { }
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception { }
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception { }
|
||||
|
||||
@Before
|
||||
public void setUp() { }
|
||||
|
||||
@After
|
||||
public void tearDown() { }
|
||||
|
||||
@Test
|
||||
public void testClass() {
|
||||
System.out.println("Class");
|
||||
|
||||
IntervalTree<Integer> itree = new IntervalTree<Integer>();
|
||||
itree.insert(new Interval<Integer>(1.0, 1.0));
|
||||
itree.insert(new Interval<Integer>(5.0, 5.0));
|
||||
itree.insert(new Interval<Integer>(7.0, 7.0));
|
||||
itree.delete(new Interval<Integer>(5.0, 5.0));
|
||||
itree.insert(new Interval<Integer>(5.0, 6.0));
|
||||
itree.delete(new Interval<Integer>(5.0, 7.0));
|
||||
itree.insert(new Interval<Integer>(5.0, 7.0));
|
||||
itree.delete(new Interval<Integer>(1.0, 1.0));
|
||||
itree.insert(new Interval<Integer>(1.0, 2.0));
|
||||
itree.delete(new Interval<Integer>(1.0, 2.0));
|
||||
itree.insert(new Interval<Integer>(1.0, 2.0));
|
||||
List<Interval<Integer>> list = new ArrayList<Interval<Integer>>();
|
||||
list.add(new Interval<Integer>(5.0, 7.0));
|
||||
assertEquals(itree.search(4.0, 5.0), list);
|
||||
System.out.println("itree.search(4.0, 5.0): " + itree.search(4.0, 5.0));
|
||||
System.out.println("list: " + list);
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Martin Škurla
|
||||
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.data.attributes.type;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Martin Škurla
|
||||
*/
|
||||
public class StringListTest {
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromStringWithDefaultSeparator() {
|
||||
StringList list = new StringList("aa,bb;cc");
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromStringWithGivenSeparator() {
|
||||
StringList list = new StringList("aa/bb/cc", "/");
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromStringArray() {
|
||||
StringList list = new StringList(new String[] {"aa", "bb", "cc"});
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromCharArray() {
|
||||
StringList list = new StringList(new char[] {'a', 'b', 'c'});
|
||||
assertEquals(list.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromEmptyStringArray() {
|
||||
StringList list = new StringList(new String[0]);
|
||||
assertEquals(list.size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingListFromEmptyCharArray() {
|
||||
StringList list = new StringList(new char[0]);
|
||||
assertEquals(list.size(), 0);
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Martin Škurla
|
||||
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.data.attributes.type;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Martin Škurla
|
||||
*/
|
||||
public class TypeConvertorTest {
|
||||
|
||||
@Test
|
||||
public void testCreatingInstanceFromStringUsingConversionMethod() {
|
||||
int result = TypeConvertor.createInstanceFromString("123", Integer.class);
|
||||
assertEquals(result, 123);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingInstanceFromStringUsingConstructor() {
|
||||
BigInteger result = TypeConvertor.createInstanceFromString("123", BigInteger.class);
|
||||
assertEquals(result, new BigInteger("123"));
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testCreatingInstanceFromStringThroughInappropriateObject() {
|
||||
TypeConvertor.createInstanceFromString("some text", Object.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatingArrayFromString() {
|
||||
Integer[] result = TypeConvertor.createArrayFromString("1;2;3;4;5", ";", Integer.class);
|
||||
assertArrayEquals(result, new Integer[] {1, 2, 3, 4, 5});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGettingWrapperFromPrimitive() {
|
||||
Class<?>[] primitiveTypes = {byte.class, short.class, int.class, long.class,
|
||||
float.class, double.class, boolean.class, char.class};
|
||||
Class<?>[] wrapperTypes = {Byte.class, Short.class, Integer.class, Long.class,
|
||||
Float.class, Double.class, Boolean.class, Character.class};
|
||||
|
||||
for (int index = 0; index < primitiveTypes.length; index++) {
|
||||
Class<?> primitiveType = primitiveTypes[index];
|
||||
Class<?> wrapperType = TypeConvertor.getWrapperFromPrimitive(primitiveType);
|
||||
|
||||
assertEquals(wrapperType, wrapperTypes[index]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testGettingWrapperFromPrimitiveIllegalArgument() {
|
||||
TypeConvertor.getWrapperFromPrimitive(String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertingPrimitiveToWrapperArray() {
|
||||
Integer[] result = TypeConvertor.<Integer>convertPrimitiveToWrapperArray(new int[] {1, 2, 3, 4, 5, 6});
|
||||
|
||||
assertArrayEquals(result, new Integer[] {1, 2, 3, 4, 5, 6});
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testConvertingPrimitiveToWrapperArrayArgumentNotArray() {
|
||||
TypeConvertor.convertPrimitiveToWrapperArray(new Object());
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testConvertingPrimitiveToWrapperArrayArgumentNotPrimitiveArray() {
|
||||
TypeConvertor.convertPrimitiveToWrapperArray(new Object[0]);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.data.attributes" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.data.attributes.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.data.attributes
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/data/attributes/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.0.5
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.data.attributes-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
build.xml.data.CRC32=6cb52fcf
|
||||
build.xml.script.CRC32=6ef893f6
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.45.1
|
||||
nbproject/build-impl.xml.data.CRC32=6cb52fcf
|
||||
nbproject/build-impl.xml.script.CRC32=311b5299
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1
|
||||
@@ -1,6 +0,0 @@
|
||||
javac.source=1.5
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
keystore=nbproject/private/keystore.ks
|
||||
license.file=../gpl-3.0.txt
|
||||
nbm.module.author=Gephi.org
|
||||
nbm_alias=gephi
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.data.attributes</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.6.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.6.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<test-dependencies>
|
||||
<test-type>
|
||||
<name>unit</name>
|
||||
</test-type>
|
||||
</test-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.data.attributes.spi</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -1 +0,0 @@
|
||||
suite.dir=${basedir}/..
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>, Cezary Bartosiak
|
||||
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.data.attributes;
|
||||
|
||||
import org.gephi.data.attributes.api.AttributeColumn;
|
||||
import org.gephi.data.attributes.api.AttributeEvent.EventType;
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.data.attributes.api.AttributeRow;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.data.attributes.api.AttributeValue;
|
||||
import org.gephi.data.attributes.event.ValueEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
* @author Cezary Bartosiak
|
||||
*/
|
||||
public class AttributeRowImpl implements AttributeRow {
|
||||
|
||||
protected final Object object;
|
||||
protected final AttributeTableImpl attributeTable;
|
||||
protected AttributeValueImpl[] values;
|
||||
protected int rowVersion = -1;
|
||||
|
||||
public AttributeRowImpl(AttributeTableImpl attributeTable, Object object) {
|
||||
this.attributeTable = attributeTable;
|
||||
this.object = object;
|
||||
reset();
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
rowVersion = attributeTable.getVersion();
|
||||
int attSize = attributeTable.countColumns();
|
||||
AttributeValueImpl[] newValues = new AttributeValueImpl[attSize];
|
||||
for (int i = 0; i < attSize; i++) {
|
||||
newValues[i] = attributeTable.getColumn(i).defaultValue;
|
||||
}
|
||||
this.values = newValues;
|
||||
}
|
||||
|
||||
public void setValues(AttributeRow attributeRow) {
|
||||
if (attributeRow == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
AttributeValue[] attValues = attributeRow.getValues();
|
||||
for (int i = 0; i < attValues.length; i++) {
|
||||
setValue(attValues[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(int index, Object value) {
|
||||
AttributeColumn column = attributeTable.getColumn(index);
|
||||
if (column != null) {
|
||||
setValue(column, value);
|
||||
} else {
|
||||
throw new IllegalArgumentException("The column doesn't exist");
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(String column, Object value) {
|
||||
if (column == null) {
|
||||
throw new NullPointerException("Column is null");
|
||||
}
|
||||
AttributeColumn attributeColumn = attributeTable.getColumn(column);
|
||||
if (attributeColumn != null) {
|
||||
setValue(attributeColumn, value);
|
||||
} else {
|
||||
//add column
|
||||
AttributeType type = AttributeType.parse(value);
|
||||
//System.out.println("parsed value type: " + value.getClass());
|
||||
if (type != null) {
|
||||
attributeColumn = attributeTable.addColumn(column, type);
|
||||
setValue(attributeColumn, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(AttributeColumn column, Object value) {
|
||||
if (column == null) {
|
||||
throw new NullPointerException("Column is null");
|
||||
}
|
||||
|
||||
AttributeValue attValue = attributeTable.getFactory().newValue(column, value);
|
||||
setValue(attValue);
|
||||
}
|
||||
|
||||
public void setValue(AttributeValue value) {
|
||||
AttributeColumn column = value.getColumn();
|
||||
if (attributeTable.getColumn(column.getIndex()) != column) {
|
||||
column = attributeTable.getColumn(column);
|
||||
if (column == null) {
|
||||
throw new IllegalArgumentException("The "+attributeTable.getName()+" value column "+value.getColumn().getId()+" with index "+value.getColumn().getIndex()+" doesn't exist");
|
||||
}
|
||||
value = attributeTable.getFactory().newValue(column, value.getValue());
|
||||
}
|
||||
|
||||
setValue(column.getIndex(), (AttributeValueImpl) value);
|
||||
}
|
||||
|
||||
private void setValue(int index, AttributeValueImpl value) {
|
||||
updateColumns();
|
||||
|
||||
AttributeValueImpl oldValue = this.values[index];
|
||||
|
||||
this.values[index] = value;
|
||||
|
||||
if (!((oldValue == null && value == null) || (oldValue != null && oldValue.equals(value)))
|
||||
&& index > 0 && !value.getColumn().getOrigin().equals(AttributeOrigin.COMPUTED)) { //0 is the index of node id and edge id cols, not useful to send these events
|
||||
attributeTable.model.fireAttributeEvent(new ValueEvent(EventType.SET_VALUE, attributeTable, object, value));
|
||||
}
|
||||
}
|
||||
|
||||
public Object getValue(AttributeColumn column) {
|
||||
if (column == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
updateColumns();
|
||||
int index = column.getIndex();
|
||||
if (checkIndexRange(index)) {
|
||||
AttributeValue val = values[index];
|
||||
if (val.getColumn() == column) {
|
||||
return val.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getValue(int index) {
|
||||
updateColumns();
|
||||
if (checkIndexRange(index)) {
|
||||
AttributeColumn attributeColumn = attributeTable.getColumn(index);
|
||||
return getValue(attributeColumn);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getValue(String column) {
|
||||
updateColumns();
|
||||
AttributeColumn attributeColumn = attributeTable.getColumn(column);
|
||||
if (attributeColumn != null) {
|
||||
return getValue(attributeColumn);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public AttributeValue[] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public AttributeValue getAttributeValueAt(int index) {
|
||||
if (checkIndexRange(index)) {
|
||||
return values[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int countValues() {
|
||||
updateColumns();
|
||||
return values.length;
|
||||
}
|
||||
|
||||
public AttributeColumn getColumnAt(int index) {
|
||||
updateColumns();
|
||||
return attributeTable.getColumn(index);
|
||||
}
|
||||
|
||||
public Object getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
private void updateColumns() {
|
||||
|
||||
int tableVersion = attributeTable.getVersion();
|
||||
if (rowVersion < tableVersion) {
|
||||
|
||||
//Need to update
|
||||
AttributeColumnImpl[] columns = attributeTable.getColumns();
|
||||
AttributeValueImpl[] newValues = new AttributeValueImpl[columns.length];
|
||||
|
||||
int j = 0;
|
||||
for (int i = 0; i < columns.length; i++) {
|
||||
AttributeColumnImpl tableCol = columns[i];
|
||||
newValues[i] = tableCol.defaultValue;
|
||||
while (j < values.length) {
|
||||
AttributeValueImpl val = values[j++];
|
||||
if (val.getColumn() == tableCol) {
|
||||
newValues[i] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
values = newValues;
|
||||
|
||||
//Upd version
|
||||
rowVersion = tableVersion;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkIndexRange(int index) {
|
||||
return index < values.length && index >= 0;
|
||||
}
|
||||
|
||||
public int getRowVersion() {
|
||||
return rowVersion;
|
||||
}
|
||||
|
||||
public void setRowVersion(int rowVersion) {
|
||||
this.rowVersion = rowVersion;
|
||||
}
|
||||
|
||||
public void setValues(AttributeValueImpl[] values) {
|
||||
this.values = values;
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>, Martin Škurla <bujacik@gmail.com>
|
||||
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.data.attributes;
|
||||
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.data.attributes.api.AttributeValue;
|
||||
import org.gephi.data.attributes.spi.AttributeValueDelegateProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
* @author Martin Škurla
|
||||
*/
|
||||
public final class AttributeValueImpl implements AttributeValue {
|
||||
|
||||
private final AttributeColumnImpl column;
|
||||
private final Object value;
|
||||
|
||||
public AttributeValueImpl(AttributeColumnImpl column, Object value) {
|
||||
this.column = column;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public AttributeColumnImpl getColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
if (column.getOrigin() != AttributeOrigin.DELEGATE) {
|
||||
return value;
|
||||
}
|
||||
else {
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
AttributeValueDelegateProvider attributeValueDelegateProvider = column.getProvider();
|
||||
|
||||
Object result;
|
||||
if (AttributeUtilsImpl.getDefault().isEdgeColumn(column))
|
||||
result = attributeValueDelegateProvider.getEdgeAttributeValue(value, column);
|
||||
else if (AttributeUtilsImpl.getDefault().isNodeColumn(column))
|
||||
result = attributeValueDelegateProvider.getNodeAttributeValue(value, column);
|
||||
else
|
||||
throw new AssertionError();
|
||||
|
||||
// important for Neo4j and in future also for other storing engines
|
||||
// the conversion can be necessary because of types mismatch
|
||||
// for Neo4j return type can be array of primitive type which must be
|
||||
// converted into List type
|
||||
if (result.getClass().isArray())
|
||||
result = ListFactory.fromArray(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj instanceof AttributeValue) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
Object thisVal = this.getValue();
|
||||
Object objVal = ((AttributeValue) obj).getValue();
|
||||
if (thisVal == null && objVal == null) {
|
||||
return true;
|
||||
}
|
||||
if (thisVal != null && objVal != null && thisVal.equals(objVal)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-02-29 20\:31+0000\nLast-Translator\: Zbyn\u011bk Schwarz <zbynek.schwarz@gmail.com>\nLanguage-Team\: Czech (http\://www.transifex.net/projects/p/gephi/language/cs/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: cs\nPlural-Forms\: nplurals\=3; plural\=(n\=\=1) ? 0 \: (n>\=2 && n<\=4) ? 1 \: 2\n
|
||||
|
||||
NodeAttributeTable.name=Uzly
|
||||
|
||||
EdgeAttributeTable.name=Hrany
|
||||
|
||||
GraphAttributeTable.name=Graf
|
||||
|
||||
OpenIDE-Module-Short-Description=V\u00fdchoz\u00ed zaveden\u00e9 API vlastnost\u00ed
|
||||
@@ -1,16 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Eduardo Ramos <eduramiba@gmail.com>, 2012.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-16 23\:07+0000\nLast-Translator\: Eduardo Ramos <eduramiba@gmail.com>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/language/es/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: es\nPlural-Forms\: nplurals\=2; plural\=(n \!\= 1)\n
|
||||
|
||||
NodeAttributeTable.name=Nodos
|
||||
|
||||
EdgeAttributeTable.name=Aristas
|
||||
|
||||
GraphAttributeTable.name=Grafo
|
||||
|
||||
OpenIDE-Module-Short-Description=Implementaci\u00f3n por defecto del m\u00f3dulo Attributes API
|
||||
@@ -1,16 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
# <sebastien.heymann@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-03-08 15\:11+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/language/fr/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: fr\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
NodeAttributeTable.name=Noeuds
|
||||
|
||||
EdgeAttributeTable.name=Liens
|
||||
|
||||
GraphAttributeTable.name=Graphe
|
||||
|
||||
OpenIDE-Module-Short-Description=Impl\u00e9mentation standard du module Attributes API
|
||||
@@ -1,15 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-15 02\:15+0000\nLast-Translator\: Siro Kida <kida.siro@gmail.com>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/language/ja/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ja\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
NodeAttributeTable.name=\u30ce\u30fc\u30c9
|
||||
|
||||
EdgeAttributeTable.name=\u8fba
|
||||
|
||||
GraphAttributeTable.name=\u30b0\u30e9\u30d5
|
||||
|
||||
OpenIDE-Module-Short-Description=\u5c5e\u6027API\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5b9f\u88c5
|
||||
@@ -1,16 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# C\u00e9lio CJr <celiofariajr@gmail.com>, 2011.
|
||||
# C\u00e9lio Faria Jr. <celiofariajr@gmail.com>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-17 13\:08+0000\nLast-Translator\: C\u00e9lio Faria Jr. <celiofariajr@gmail.com>\nLanguage-Team\: Portuguese (Brazil) (http\://www.transifex.net/projects/p/gephi/language/pt_BR/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: pt_BR\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
|
||||
NodeAttributeTable.name=N\u00f3s
|
||||
|
||||
EdgeAttributeTable.name=Arestas
|
||||
|
||||
GraphAttributeTable.name=Grafo
|
||||
|
||||
OpenIDE-Module-Short-Description=Implementa\u00e7\u00e3o padr\u00e3o da API Attributes.
|
||||
@@ -1,16 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# <altsoph@gmail.com>, 2012.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-01-15 08\:32+0000\nLast-Translator\: Altsoph <altsoph@gmail.com>\nLanguage-Team\: Russian (http\://www.transifex.net/projects/p/gephi/language/ru/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: ru\nPlural-Forms\: nplurals\=3; plural\=(n%10\=\=1 && n%100\!\=11 ? 0 \: n%10>\=2 && n%10<\=4 && (n%100<10 || n%100>\=20) ? 1 \: 2)\n
|
||||
|
||||
NodeAttributeTable.name=\u0423\u0437\u043b\u044b
|
||||
|
||||
EdgeAttributeTable.name=\u0420\u0451\u0431\u0440\u0430
|
||||
|
||||
GraphAttributeTable.name=\u0413\u0440\u0430\u0444
|
||||
|
||||
OpenIDE-Module-Short-Description=\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438
|
||||
@@ -1,15 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Xi-Nian Zuo <zuoxn@psych.ac.cn>, 2012.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://github.com/gephi/gephi/issues\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2012-03-15 09\:34+0000\nLast-Translator\: Xi-Nian Zuo <zuoxn@psych.ac.cn>\nLanguage-Team\: Chinese (China) (http\://www.transifex.net/projects/p/gephi/language/zh_CN/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: zh_CN\nPlural-Forms\: nplurals\=1; plural\=0\n
|
||||
|
||||
NodeAttributeTable.name=\u8282\u70b9
|
||||
|
||||
EdgeAttributeTable.name=\u8fb9
|
||||
|
||||
GraphAttributeTable.name=\u56fe
|
||||
|
||||
OpenIDE-Module-Short-Description=\u5c5e\u6027API\u7684\u9ed8\u8ba4\u5b9e\u73b0\u3002
|
||||
@@ -1,31 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Zbyněk Schwarz <zbynek.schwarz@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-02-29 20:31+0000\n"
|
||||
"Last-Translator: Zbyněk Schwarz <zbynek.schwarz@gmail.com>\n"
|
||||
"Language-Team: Czech (http://www.transifex.net/projects/p/gephi/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: cs\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "Uzly"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "Hrany"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "Graf"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Výchozí zavedené API vlastností"
|
||||
@@ -1,32 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Eduardo Ramos <eduramiba@gmail.com>, 2012.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-16 23:07+0000\n"
|
||||
"Last-Translator: Eduardo Ramos <eduramiba@gmail.com>\n"
|
||||
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "Nodos"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "Aristas"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "Grafo"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Implementación por defecto del módulo Attributes API"
|
||||
@@ -1,32 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
# <sebastien.heymann@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-03-08 15:11+0000\n"
|
||||
"Last-Translator: gephi <sebastien.heymann@gmail.com>\n"
|
||||
"Language-Team: French (http://www.transifex.net/projects/p/gephi/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "Noeuds"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "Liens"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "Graphe"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Implémentation standard du module Attributes API"
|
||||
@@ -1,31 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Siro Kida <kida.siro@gmail.com>, 2011, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-15 02:15+0000\n"
|
||||
"Last-Translator: Siro Kida <kida.siro@gmail.com>\n"
|
||||
"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/language/ja/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ja\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "ノード"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "辺"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "グラフ"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "属性APIのデフォルトの実装"
|
||||
@@ -1,32 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Célio CJr <celiofariajr@gmail.com>, 2011.
|
||||
# Célio Faria Jr. <celiofariajr@gmail.com>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-17 13:08+0000\n"
|
||||
"Last-Translator: Célio Faria Jr. <celiofariajr@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.net/projects/p/gephi/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "Nós"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "Arestas"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "Grafo"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Implementação padrão da API Attributes."
|
||||
@@ -1,32 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# <altsoph@gmail.com>, 2012.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-01-15 08:32+0000\n"
|
||||
"Last-Translator: Altsoph <altsoph@gmail.com>\n"
|
||||
"Language-Team: Russian (http://www.transifex.net/projects/p/gephi/language/ru/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "Узлы"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "Рёбра"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "Граф"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "Стандартное API для работы с атрибутами"
|
||||
-189
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
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.data.attributes.serialization;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
import org.gephi.data.attributes.AbstractAttributeModel;
|
||||
import org.gephi.data.attributes.AttributeColumnImpl;
|
||||
import org.gephi.data.attributes.AttributeRowImpl;
|
||||
import org.gephi.data.attributes.AttributeTableImpl;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.data.attributes.api.AttributeValue;
|
||||
import org.gephi.graph.api.Edge;
|
||||
import org.gephi.graph.api.GraphModel;
|
||||
import org.gephi.graph.api.HierarchicalGraph;
|
||||
import org.gephi.graph.api.Node;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class AttributeRowSerializer {
|
||||
|
||||
private static final String ELEMENT_ROWS = "attributerows";
|
||||
private static final String ELEMENT_NODE_ROW = "noderow";
|
||||
private static final String ELEMENT_EDGE_ROW = "edgerow";
|
||||
private static final String ELEMENT_VALUE = "attvalue";
|
||||
|
||||
public void writeRows(XMLStreamWriter writer, GraphModel graphModel) throws XMLStreamException {
|
||||
writer.writeStartElement(ELEMENT_ROWS);
|
||||
|
||||
HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
|
||||
for (Node node : hierarchicalGraph.getNodesTree()) {
|
||||
if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
|
||||
AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
|
||||
writer.writeStartElement(ELEMENT_NODE_ROW);
|
||||
writer.writeAttribute("for", String.valueOf(node.getId()));
|
||||
if (writeRow(writer, row)) {
|
||||
writer.writeEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Node node : hierarchicalGraph.getNodesTree()) {
|
||||
for (Edge edge : hierarchicalGraph.getEdges(node)) {
|
||||
if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
|
||||
AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
|
||||
writer.writeStartElement(ELEMENT_EDGE_ROW);
|
||||
writer.writeAttribute("for", String.valueOf(edge.getId()));
|
||||
if (writeRow(writer, row)) {
|
||||
writer.writeEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writer.writeEndElement();
|
||||
}
|
||||
|
||||
public void readRows(XMLStreamReader reader, GraphModel graphModel, AbstractAttributeModel attributeModel) throws XMLStreamException {
|
||||
HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
|
||||
|
||||
boolean end = false;
|
||||
while (reader.hasNext() && !end) {
|
||||
int type = reader.next();
|
||||
|
||||
switch (type) {
|
||||
case XMLStreamReader.START_ELEMENT:
|
||||
String name = reader.getLocalName();
|
||||
if (ELEMENT_NODE_ROW.equalsIgnoreCase(name)) {
|
||||
int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
|
||||
Node node = hierarchicalGraph.getNode(id);
|
||||
if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
|
||||
AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
|
||||
readRow(reader, attributeModel, attributeModel.getNodeTable(), row);
|
||||
}
|
||||
} else if (ELEMENT_EDGE_ROW.equalsIgnoreCase(name)) {
|
||||
int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
|
||||
Edge edge = hierarchicalGraph.getEdge(id);
|
||||
if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
|
||||
AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
|
||||
readRow(reader, attributeModel, attributeModel.getEdgeTable(), row);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XMLStreamReader.END_ELEMENT:
|
||||
if (ELEMENT_ROWS.equalsIgnoreCase(reader.getLocalName())) {
|
||||
end = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean writeRow(XMLStreamWriter writer, AttributeRowImpl row) throws XMLStreamException {
|
||||
writer.writeAttribute("version", String.valueOf(row.getRowVersion()));
|
||||
int writtenRows = 0;
|
||||
for (AttributeValue value : row.getValues()) {
|
||||
int index = value.getColumn().getIndex();
|
||||
Object obj = value.getValue();
|
||||
if (obj != null) {
|
||||
writtenRows++;
|
||||
writer.writeStartElement(ELEMENT_VALUE);
|
||||
writer.writeAttribute("index", String.valueOf(index));
|
||||
writer.writeCharacters(obj.toString());
|
||||
writer.writeEndElement();
|
||||
}
|
||||
}
|
||||
return writtenRows > 0;
|
||||
}
|
||||
|
||||
public void readRow(XMLStreamReader reader, AbstractAttributeModel model, AttributeTableImpl table, AttributeRowImpl row) throws XMLStreamException {
|
||||
row.setRowVersion(Integer.parseInt(reader.getAttributeValue(null, "version")));
|
||||
Integer index = null;
|
||||
String value = "";
|
||||
|
||||
boolean end = false;
|
||||
while (reader.hasNext() && !end) {
|
||||
int t = reader.next();
|
||||
|
||||
switch (t) {
|
||||
case XMLStreamReader.START_ELEMENT:
|
||||
String name = reader.getLocalName();
|
||||
if (ELEMENT_VALUE.equalsIgnoreCase(name)) {
|
||||
index = Integer.parseInt(reader.getAttributeValue(null, "index"));
|
||||
}
|
||||
break;
|
||||
case XMLStreamReader.CHARACTERS:
|
||||
if (!reader.isWhiteSpace() && index != null) {
|
||||
value += reader.getText();
|
||||
}
|
||||
break;
|
||||
case XMLStreamReader.END_ELEMENT:
|
||||
if (ELEMENT_NODE_ROW.equalsIgnoreCase(reader.getLocalName()) || ELEMENT_EDGE_ROW.equalsIgnoreCase(reader.getLocalName())) {
|
||||
end = true;
|
||||
}
|
||||
if (!value.isEmpty() && index != null) {
|
||||
AttributeType type = table.getColumn(index).getType();
|
||||
Object v = type.parse(value);
|
||||
v = model.getManagedValue(v, type);
|
||||
row.setValue(index, v);
|
||||
}
|
||||
value = "";
|
||||
index = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Xi-Nian Zuo <zuoxn@psych.ac.cn>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gephi\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/gephi/gephi/issues\n"
|
||||
"POT-Creation-Date: 2011-08-05 14:52+0200\n"
|
||||
"PO-Revision-Date: 2012-03-15 09:34+0000\n"
|
||||
"Last-Translator: Xi-Nian Zuo <zuoxn@psych.ac.cn>\n"
|
||||
"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/gephi/language/zh_CN/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
"Plural-Forms: nplurals=1; plural=0\n"
|
||||
|
||||
msgid "NodeAttributeTable.name"
|
||||
msgstr "节点"
|
||||
|
||||
msgid "EdgeAttributeTable.name"
|
||||
msgstr "边"
|
||||
|
||||
msgid "GraphAttributeTable.name"
|
||||
msgstr "图"
|
||||
|
||||
msgid "OpenIDE-Module-Short-Description"
|
||||
msgstr "属性API的默认实现。"
|
||||
@@ -1,187 +0,0 @@
|
||||
/*
|
||||
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.data.attributes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.data.attributes.api.AttributeRow;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.data.attributes.api.AttributeValue;
|
||||
import org.gephi.data.attributes.model.TemporaryAttributeModel;
|
||||
import org.gephi.data.attributes.type.StringList;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu
|
||||
*/
|
||||
public class AttributeClassTest {
|
||||
|
||||
private AbstractAttributeModel manager;
|
||||
private AttributeTableImpl nodeClass;
|
||||
private AttributeFactoryImpl factory;
|
||||
//Test map
|
||||
private Map<String, AttributeColumnImpl> columnMap;
|
||||
private List<AttributeRowImpl> rows;
|
||||
|
||||
public AttributeClassTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
manager = new TemporaryAttributeModel();//Id and Label columns are automatically created at indexes 0 and 1
|
||||
nodeClass = manager.getNodeTable();
|
||||
factory = new AttributeFactoryImpl(manager);
|
||||
columnMap = new HashMap<String, AttributeColumnImpl>();
|
||||
rows = new ArrayList<AttributeRowImpl>();
|
||||
|
||||
AttributeColumnImpl co1 = nodeClass.addColumn("col1", "Column 1", AttributeType.STRING, AttributeOrigin.DATA, "nil");
|
||||
AttributeColumnImpl co2 = nodeClass.addColumn("col2", "Column 2", AttributeType.INT, AttributeOrigin.PROPERTY, 0);
|
||||
AttributeColumnImpl co3 = nodeClass.addColumn("col3", "Column 3", AttributeType.LIST_STRING, AttributeOrigin.DATA, new StringList("nothing", ","));
|
||||
AttributeColumnImpl co4 = nodeClass.addColumn("col4", "Column 4", AttributeType.STRING, AttributeOrigin.COMPUTED, "zero");
|
||||
AttributeColumnImpl co5 = nodeClass.addColumn("col5", "Column 5", AttributeType.BOOLEAN, AttributeOrigin.DATA, true);
|
||||
AttributeColumnImpl co6 = nodeClass.addColumn("col6", "Column 6", AttributeType.STRING, AttributeOrigin.DATA, "default");
|
||||
|
||||
columnMap.put("col1", co1);
|
||||
columnMap.put("col2", co2);
|
||||
columnMap.put("col3", co3);
|
||||
columnMap.put("col4", co4);
|
||||
columnMap.put("col5", co5);
|
||||
columnMap.put("col6", co6);
|
||||
|
||||
//Rows
|
||||
for (int i = 0; i < 10; i++) {
|
||||
AttributeRowImpl r = factory.newNodeRow(null);
|
||||
r.setValue(co1, "col1value " + i);
|
||||
r.setValue("col2", i);
|
||||
r.setValue("Column 3", null);
|
||||
r.setValue(5, "col4value " + i);
|
||||
r.setValue(factory.newValue(co5, false));
|
||||
rows.add(r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
manager = null;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetColumn() {
|
||||
assertSame(columnMap.get("col1"), nodeClass.getColumn("col1"));
|
||||
assertSame(columnMap.get("col1"), nodeClass.getColumn("Column 1"));
|
||||
assertSame(columnMap.get("col1"), nodeClass.getColumn(2));
|
||||
assertTrue(nodeClass.hasColumn("col1"));
|
||||
assertTrue(nodeClass.hasColumn("Column 1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValues() {
|
||||
int i = 0;
|
||||
|
||||
AttributeRow row = rows.get(0);
|
||||
assertEquals("col1value 0", row.getValue(columnMap.get("col1")));
|
||||
assertEquals(0, row.getValue(columnMap.get("col2")));
|
||||
assertNull(row.getValue(columnMap.get("col3")));
|
||||
assertEquals("col4value 0", row.getValue(columnMap.get("col4")));
|
||||
assertEquals(false, row.getValue(columnMap.get("col5")));
|
||||
assertEquals(columnMap.get("col6").getDefaultValue(), row.getValue(columnMap.get("col6")));
|
||||
|
||||
showValues(row);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddColumn() {
|
||||
AttributeColumnImpl co7 = nodeClass.addColumn("col7", "Column 7", AttributeType.STRING, AttributeOrigin.DATA, "def");
|
||||
columnMap.put("col7", co7);
|
||||
|
||||
//Test GetColumn
|
||||
assertSame(co7, nodeClass.getColumn("col7"));
|
||||
|
||||
//Test value
|
||||
AttributeRow row = rows.get(0);
|
||||
assertEquals(columnMap.get("col7").getDefaultValue(), row.getValue(columnMap.get("col7")));
|
||||
row.setValue(co7, "test");
|
||||
assertEquals("test", row.getValue(columnMap.get("col7")));
|
||||
|
||||
showValues(row);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteColumn() {
|
||||
nodeClass.removeColumn(columnMap.get("col4"));
|
||||
|
||||
//Test GetColumn
|
||||
assertNull(nodeClass.getColumn("col4"));
|
||||
|
||||
//Test value
|
||||
AttributeRow row = rows.get(0);
|
||||
assertNull(row.getValue(columnMap.get("col4")));
|
||||
|
||||
showValues(row);
|
||||
}
|
||||
|
||||
public void showValues(AttributeRow row) {
|
||||
System.out.print("Values: ");
|
||||
for (AttributeValue val : row.getValues()) {
|
||||
System.out.print("#" + val.getValue() + " ");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
-148
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
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.data.attributes;
|
||||
|
||||
import java.io.StringReader;
|
||||
import javax.xml.stream.Location;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.stream.XMLOutputFactory;
|
||||
import javax.xml.stream.XMLReporter;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
import org.gephi.data.attributes.serialization.AttributeModelSerializer;
|
||||
import java.io.StringWriter;
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.data.attributes.model.IndexedAttributeModel;
|
||||
import org.gephi.data.attributes.type.StringList;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.w3c.dom.Element;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class AttributeModelSerializerTest {
|
||||
|
||||
private IndexedAttributeModel model;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
model = new IndexedAttributeModel();
|
||||
AttributeTableImpl nodeTableImpl = model.getNodeTable();
|
||||
nodeTableImpl.addColumn("id", "Identifier", AttributeType.INT, AttributeOrigin.DATA, new Integer(0));
|
||||
nodeTableImpl.addColumn("url", AttributeType.STRING);
|
||||
nodeTableImpl.addColumn("position", "Position&<>\"'$*", AttributeType.FLOAT, AttributeOrigin.PROPERTY, new Float(0));
|
||||
nodeTableImpl.addColumn("cats", "Catégories", AttributeType.LIST_STRING, AttributeOrigin.DATA, new StringList("a,b,c,d"));
|
||||
AttributeTableImpl edgeTableImpl = model.getEdgeTable();
|
||||
edgeTableImpl.addColumn("name", AttributeType.STRING, AttributeOrigin.DATA);
|
||||
//edgeTableImpl.addColumn("weight", AttributeType.DOUBLE, AttributeOrigin.DATA);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSerializer() {
|
||||
try {
|
||||
AttributeModelSerializer serializer = new AttributeModelSerializer();
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
XMLStreamWriter writer = createWriter(stringWriter);
|
||||
serializer.writeModel(writer, model);
|
||||
writer.close();
|
||||
String s1 = stringWriter.toString();
|
||||
System.out.println(s1);
|
||||
IndexedAttributeModel model2 = new IndexedAttributeModel();
|
||||
StringReader stringReader = new StringReader(s1);
|
||||
XMLStreamReader reader = createReader(stringReader);
|
||||
serializer.readModel(reader, model2);
|
||||
stringWriter = new StringWriter();
|
||||
writer = createWriter(stringWriter);
|
||||
serializer.writeModel(writer, model2);
|
||||
String s2 = stringWriter.toString();
|
||||
System.out.println(s2);
|
||||
assertEquals(s1, s2);
|
||||
} catch (XMLStreamException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private XMLStreamWriter createWriter(StringWriter stringWriter) {
|
||||
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
|
||||
outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);
|
||||
|
||||
try {
|
||||
XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(stringWriter);
|
||||
xmlWriter.writeStartDocument("UTF-8", "1.0");
|
||||
return xmlWriter;
|
||||
} catch (XMLStreamException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private XMLStreamReader createReader(StringReader stringReader) {
|
||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||
if (inputFactory.isPropertySupported("javax.xml.stream.isValidating")) {
|
||||
inputFactory.setProperty("javax.xml.stream.isValidating", Boolean.FALSE);
|
||||
}
|
||||
inputFactory.setXMLReporter(new XMLReporter() {
|
||||
|
||||
@Override
|
||||
public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
|
||||
System.out.println("Error:" + errorType + ", message : " + message);
|
||||
}
|
||||
});
|
||||
try {
|
||||
return inputFactory.createXMLStreamReader(stringReader);
|
||||
} catch (XMLStreamException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
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