gephi.team team mailing list archive
-
gephi.team team
-
Mailing list archive
-
Message #02509
[Merge] lp:~panisson/gephi/graphstreaming into lp:gephi
Siming Li has proposed merging lp:~panisson/gephi/graphstreaming into lp:gephi.
Requested reviews:
Gephi Team (gephi.team)
For more details, see:
https://code.launchpad.net/~panisson/gephi/graphstreaming/+merge/101569
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~panisson/gephi/graphstreaming/+merge/101569
Your team Gephi Team is requested to review the proposed merge of lp:~panisson/gephi/graphstreaming into lp:gephi.
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2012-04-11 14:38:21 +0000
@@ -0,0 +1,13 @@
+**/build
+**/nbproject/private
+**/nbproject/platform.properties
+nbproject/project.properties
+**/dist
+nbproject/private/platform-private.properties
+nbproject/private/profiler/
+.DS_Store
+.classpath
+.project
+.settings
+toolkit
+keystore.ks
=== added directory '.tx'
=== renamed directory '.tx' => '.tx.moved'
=== added file '.tx/config'
--- .tx/config 1970-01-01 00:00:00 +0000
+++ .tx/config 2012-04-11 14:38:21 +0000
@@ -0,0 +1,848 @@
+[main]
+host = gephi
+
+[gephi.org-gephi-ui-workspace]
+file_filter = WorkspaceUI\src\org\gephi\ui\workspace\<lang>.po
+source_file = WorkspaceUI\src\org\gephi\ui\workspace\org-gephi-ui-workspace.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-welcome]
+file_filter = WelcomeScreen\src\org\gephi\desktop\welcome\<lang>.po
+source_file = WelcomeScreen\src\org\gephi\desktop\welcome\org-gephi-desktop-welcome.pot
+source_lang = en
+
+[gephi.org-gephi-visualization]
+file_filter = VisualizationModule\src\org\gephi\visualization\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\org-gephi-visualization.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-screenshot]
+file_filter = VisualizationModule\src\org\gephi\visualization\screenshot\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\screenshot\org-gephi-visualization-screenshot.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-options]
+file_filter = VisualizationModule\src\org\gephi\visualization\options\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\options\org-gephi-visualization-options.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-config]
+file_filter = VisualizationModule\src\org\gephi\visualization\config\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\config\org-gephi-visualization-config.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-component]
+file_filter = VisualizationModule\src\org\gephi\visualization\component\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\component\org-gephi-visualization-component.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-apiimpl-contextmenuitems]
+file_filter = VisualizationModule\src\org\gephi\visualization\apiimpl\contextmenuitems\<lang>.po
+source_file = VisualizationModule\src\org\gephi\visualization\apiimpl\contextmenuitems\org-gephi-visualization-apiimpl-contextmenuitems.pot
+source_lang = en
+
+[gephi.org-gephi-visualization-api]
+file_filter = VisualizationAPI\src\org\gephi\visualization\api\<lang>.po
+source_file = VisualizationAPI\src\org\gephi\visualization\api\org-gephi-visualization-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-validation]
+file_filter = ValidationAPI\src\org\gephi\lib\validation\<lang>.po
+source_file = ValidationAPI\src\org\gephi\lib\validation\org-gephi-lib-validation.pot
+source_lang = en
+
+[gephi.org-gephi-utils]
+file_filter = Utils\src\org\gephi\utils\<lang>.po
+source_file = Utils\src\org\gephi\utils\org-gephi-utils.pot
+source_lang = en
+
+[gephi.org-gephi-ui-utils]
+file_filter = UIUtils\src\org\gephi\ui\utils\<lang>.po
+source_file = UIUtils\src\org\gephi\ui\utils\org-gephi-ui-utils.pot
+source_lang = en
+
+[gephi.org-gephi-ui-components]
+file_filter = UIComponents\src\org\gephi\ui\components\<lang>.po
+source_file = UIComponents\src\org\gephi\ui\components\org-gephi-ui-components.pot
+source_lang = en
+
+[gephi.org-gephi-lib-timing]
+file_filter = TimingFrameworkWrapper\src\org\gephi\lib\timing\<lang>.po
+source_file = TimingFrameworkWrapper\src\org\gephi\lib\timing\org-gephi-lib-timing.pot
+source_lang = en
+
+[gephi.org-gephi-ui-tools-plugin]
+file_filter = ToolsPlugin\src\org\gephi\ui\tools\plugin\<lang>.po
+source_file = ToolsPlugin\src\org\gephi\ui\tools\plugin\org-gephi-ui-tools-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-ui-tools-plugin-edit]
+file_filter = ToolsPlugin\src\org\gephi\ui\tools\plugin\edit\<lang>.po
+source_file = ToolsPlugin\src\org\gephi\ui\tools\plugin\edit\org-gephi-ui-tools-plugin-edit.pot
+source_lang = en
+
+[gephi.org-gephi-tools-plugin]
+file_filter = ToolsPlugin\src\org\gephi\tools\plugin\<lang>.po
+source_file = ToolsPlugin\src\org\gephi\tools\plugin\org-gephi-tools-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-tools-api]
+file_filter = ToolsAPI\src\org\gephi\tools\api\<lang>.po
+source_file = ToolsAPI\src\org\gephi\tools\api\org-gephi-tools-api.pot
+source_lang = en
+
+[gephi.org-gephi-timeline]
+file_filter = TimelineAPI\src\org\gephi\timeline\<lang>.po
+source_file = TimelineAPI\src\org\gephi\timeline\org-gephi-timeline.pot
+source_lang = en
+
+[gephi.org-jdesktop-swingx]
+file_filter = SwingX\src\org\jdesktop\swingx\<lang>.po
+source_file = SwingX\src\org\jdesktop\swingx\org-jdesktop-swingx.pot
+source_lang = en
+
+[gephi.org-gephi-lib-staxutils]
+file_filter = StaxUtils\src\org\gephi\lib\staxutils\<lang>.po
+source_file = StaxUtils\src\org\gephi\lib\staxutils\org-gephi-lib-staxutils.pot
+source_lang = en
+
+[gephi.org-gephi-ui-statistics-plugin]
+file_filter = StatisticsPluginUI\src\org\gephi\ui\statistics\plugin\<lang>.po
+source_file = StatisticsPluginUI\src\org\gephi\ui\statistics\plugin\org-gephi-ui-statistics-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-statistics-plugin]
+file_filter = StatisticsPlugin\src\org\gephi\statistics\plugin\<lang>.po
+source_file = StatisticsPlugin\src\org\gephi\statistics\plugin\org-gephi-statistics-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-statistics-plugin-builder]
+file_filter = StatisticsPlugin\src\org\gephi\statistics\plugin\builder\<lang>.po
+source_file = StatisticsPlugin\src\org\gephi\statistics\plugin\builder\org-gephi-statistics-plugin-builder.pot
+source_lang = en
+
+[gephi.org-gephi-statistics-spi]
+file_filter = StatisticsAPI\src\org\gephi\statistics\spi\<lang>.po
+source_file = StatisticsAPI\src\org\gephi\statistics\spi\org-gephi-statistics-spi.pot
+source_lang = en
+
+[gephi.org-gephi-statistics-api]
+file_filter = StatisticsAPI\src\org\gephi\statistics\api\<lang>.po
+source_file = StatisticsAPI\src\org\gephi\statistics\api\org-gephi-statistics-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-components-SplineEditor]
+file_filter = SplineEditor\src\org\gephi\ui\components\SplineEditor\<lang>.po
+source_file = SplineEditor\src\org\gephi\ui\components\SplineEditor\org-gephi-ui-components-SplineEditor.pot
+source_lang = en
+
+[gephi.org-gephi-ui-spigot-plugin]
+file_filter = SpigotPluginUI\src\org\gephi\ui\spigot\plugin\<lang>.po
+source_file = SpigotPluginUI\src\org\gephi\ui\spigot\plugin\org-gephi-ui-spigot-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-ui-spigot-plugin-email]
+file_filter = SpigotPluginUI\src\org\gephi\ui\spigot\plugin\email\<lang>.po
+source_file = SpigotPluginUI\src\org\gephi\ui\spigot\plugin\email\org-gephi-ui-spigot-plugin-email.pot
+source_lang = en
+
+[gephi.org-gephi-io-spigot-plugin]
+file_filter = SpigotPlugin\src\org\gephi\io\spigot\plugin\<lang>.po
+source_file = SpigotPlugin\src\org\gephi\io\spigot\plugin\org-gephi-io-spigot-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-spigot-plugin-email]
+file_filter = SpigotPlugin\src\org\gephi\io\spigot\plugin\email\<lang>.po
+source_file = SpigotPlugin\src\org\gephi\io\spigot\plugin\email\org-gephi-io-spigot-plugin-email.pot
+source_lang = en
+
+[gephi.org-gephi-ui-ranking-plugin]
+file_filter = RankingPluginUI\src\org\gephi\ui\ranking\plugin\<lang>.po
+source_file = RankingPluginUI\src\org\gephi\ui\ranking\plugin\org-gephi-ui-ranking-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-ranking-plugin]
+file_filter = RankingPlugin\src\org\gephi\ranking\plugin\<lang>.po
+source_file = RankingPlugin\src\org\gephi\ranking\plugin\org-gephi-ranking-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-ranking-api]
+file_filter = RankingAPI\src\org\gephi\ranking\api\<lang>.po
+source_file = RankingAPI\src\org\gephi\ranking\api\org-gephi-ranking-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-project]
+file_filter = ProjectUI\src\org\gephi\ui\project\<lang>.po
+source_file = ProjectUI\src\org\gephi\ui\project\org-gephi-ui-project.pot
+source_lang = en
+
+[gephi.org-gephi-project-explorer]
+file_filter = ProjectExplorer\src\org\gephi\project\explorer\<lang>.po
+source_file = ProjectExplorer\src\org\gephi\project\explorer\org-gephi-project-explorer.pot
+source_lang = en
+
+[gephi.org-gephi-project-io]
+file_filter = ProjectAPI\src\org\gephi\project\io\<lang>.po
+source_file = ProjectAPI\src\org\gephi\project\io\org-gephi-project-io.pot
+source_lang = en
+
+[gephi.org-gephi-project-impl]
+file_filter = ProjectAPI\src\org\gephi\project\impl\<lang>.po
+source_file = ProjectAPI\src\org\gephi\project\impl\org-gephi-project-impl.pot
+source_lang = en
+
+[gephi.org-gephi-project-api]
+file_filter = ProjectAPI\src\org\gephi\project\api\<lang>.po
+source_file = ProjectAPI\src\org\gephi\project\api\org-gephi-project-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-processor-plugin]
+file_filter = ProcessorPluginUI\src\org\gephi\ui\processor\plugin\<lang>.po
+source_file = ProcessorPluginUI\src\org\gephi\ui\processor\plugin\org-gephi-ui-processor-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-processor-plugin]
+file_filter = ProcessorPlugin\src\org\gephi\io\processor\plugin\<lang>.po
+source_file = ProcessorPlugin\src\org\gephi\io\processor\plugin\org-gephi-io-processor-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-lib-processing]
+file_filter = ProcessingWrapper\src\org\gephi\lib\processing\<lang>.po
+source_file = ProcessingWrapper\src\org\gephi\lib\processing\org-gephi-lib-processing.pot
+source_lang = en
+
+[gephi.org-gephi-preview]
+file_filter = PreviewAPI\src\org\gephi\preview\<lang>.po
+source_file = PreviewAPI\src\org\gephi\preview\org-gephi-preview.pot
+source_lang = en
+
+[gephi.org-gephi-preview-presets]
+file_filter = PreviewAPI\src\org\gephi\preview\presets\<lang>.po
+source_file = PreviewAPI\src\org\gephi\preview\presets\org-gephi-preview-presets.pot
+source_lang = en
+
+[gephi.org-gephi-ui-exporter-preview]
+file_filter = PreviewExportUI\src\org\gephi\ui\exporter\preview\<lang>.po
+source_file = PreviewExportUI\src\org\gephi\ui\exporter\preview\org-gephi-ui-exporter-preview.pot
+source_lang = en
+
+[gephi.org-gephi-io-exporter-preview]
+file_filter = PreviewExport\src\org\gephi\io\exporter\preview\<lang>.po
+source_file = PreviewExport\src\org\gephi\io\exporter\preview\org-gephi-io-exporter-preview.pot
+source_lang = en
+
+[gephi.org-gephi-preview-api]
+file_filter = PreviewAPI\src\org\gephi\preview\api\<lang>.po
+source_file = PreviewAPI\src\org\gephi\preview\api\org-gephi-preview-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-partition-plugin]
+file_filter = PartitionPluginUI\src\org\gephi\ui\partition\plugin\<lang>.po
+source_file = PartitionPluginUI\src\org\gephi\ui\partition\plugin\org-gephi-ui-partition-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-partition-plugin]
+file_filter = PartitionPlugin\src\org\gephi\partition\plugin\<lang>.po
+source_file = PartitionPlugin\src\org\gephi\partition\plugin\org-gephi-partition-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-partition-api]
+file_filter = PartitionAPI\src\org\gephi\partition\api\<lang>.po
+source_file = PartitionAPI\src\org\gephi\partition\api\org-gephi-partition-api.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-mrufiles-api]
+file_filter = MostRecentFilesAPI\src\org\gephi\desktop\mrufiles\api\<lang>.po
+source_file = MostRecentFilesAPI\src\org\gephi\desktop\mrufiles\api\org-gephi-desktop-mrufiles-api.pot
+source_lang = en
+
+[gephi.org-gephi-utils-longtask]
+file_filter = LongTaskAPI\src\org\gephi\utils\longtask\<lang>.po
+source_file = LongTaskAPI\src\org\gephi\utils\longtask\org-gephi-utils-longtask.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\org-gephi-layout-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-scale]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\scale\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\scale\org-gephi-layout-plugin-scale.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-rotate]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\rotate\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\rotate\org-gephi-layout-plugin-rotate.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-random]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\random\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\random\org-gephi-layout-plugin-random.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-multilevel]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\multilevel\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\multilevel\org-gephi-layout-plugin-multilevel.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-labelAdjust]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\labelAdjust\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\labelAdjust\org-gephi-layout-plugin-labelAdjust.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-fruchterman]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\fruchterman\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\fruchterman\org-gephi-layout-plugin-fruchterman.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-forceAtlas2]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\forceAtlas2\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\forceAtlas2\org-gephi-layout-plugin-forceAtlas2.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-forceAtlas]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\forceAtlas\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\forceAtlas\org-gephi-layout-plugin-forceAtlas.pot
+source_lang = en
+
+[gephi.org-gephi-layout-plugin-force-yifanHu]
+file_filter = LayoutPlugin\src\org\gephi\layout\plugin\force\yifanHu\<lang>.po
+source_file = LayoutPlugin\src\org\gephi\layout\plugin\force\yifanHu\org-gephi-layout-plugin-force-yifanHu.pot
+source_lang = en
+
+[gephi.org-gephi-layout-api]
+file_filter = LayoutAPI\src\org\gephi\layout\api\<lang>.po
+source_file = LayoutAPI\src\org\gephi\layout\api\org-gephi-layout-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-jogl]
+file_filter = JOGLWrapper\src\org\gephi\lib\jogl\<lang>.po
+source_file = JOGLWrapper\src\org\gephi\lib\jogl\org-gephi-lib-jogl.pot
+source_lang = en
+
+[gephi.org-gephi-lib-jcalendar]
+file_filter = JCalendarWrapper\src\org\gephi\lib\jcalendar\<lang>.po
+source_file = JCalendarWrapper\src\org\gephi\lib\jcalendar\org-gephi-lib-jcalendar.pot
+source_lang = en
+
+[gephi.org-gephi-lib-javamail]
+file_filter = JavaMailWrapper\src\org\gephi\lib\javamail\<lang>.po
+source_file = JavaMailWrapper\src\org\gephi\lib\javamail\org-gephi-lib-javamail.pot
+source_lang = en
+
+[gephi.org-gephi-lib-javacsv]
+file_filter = JavaCSVWrapper\src\org\gephi\lib\javacsv\<lang>.po
+source_file = JavaCSVWrapper\src\org\gephi\lib\javacsv\org-gephi-lib-javacsv.pot
+source_lang = en
+
+[gephi.org-gephi-lib-itext]
+file_filter = iTextWrapper\src\org\gephi\lib\itext\<lang>.po
+source_file = iTextWrapper\src\org\gephi\lib\itext\org-gephi-lib-itext.pot
+source_lang = en
+
+[gephi.org-gephi-ui-importer-plugin]
+file_filter = ImportPluginUI\src\org\gephi\ui\importer\plugin\<lang>.po
+source_file = ImportPluginUI\src\org\gephi\ui\importer\plugin\org-gephi-ui-importer-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-importer-plugin]
+file_filter = ImportPlugin\src\org\gephi\io\importer\plugin\<lang>.po
+source_file = ImportPlugin\src\org\gephi\io\importer\plugin\org-gephi-io-importer-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-importer-plugin-file]
+file_filter = ImportPlugin\src\org\gephi\io\importer\plugin\file\<lang>.po
+source_file = ImportPlugin\src\org\gephi\io\importer\plugin\file\org-gephi-io-importer-plugin-file.pot
+source_lang = en
+
+[gephi.org-gephi-io-importer-impl]
+file_filter = ImportAPI\src\org\gephi\io\importer\impl\<lang>.po
+source_file = ImportAPI\src\org\gephi\io\importer\impl\org-gephi-io-importer-impl.pot
+source_lang = en
+
+[gephi.org-gephi-io-importer-api]
+file_filter = ImportAPI\src\org\gephi\io\importer\api\<lang>.po
+source_file = ImportAPI\src\org\gephi\io\importer\api\org-gephi-io-importer-api.pot
+source_lang = en
+
+[gephi.org-gephi-graph-api]
+file_filter = GraphAPI\src\org\gephi\graph\api\<lang>.po
+source_file = GraphAPI\src\org\gephi\graph\api\org-gephi-graph-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-gleem]
+file_filter = Gleem\src\org\gephi\lib\gleem\<lang>.po
+source_file = Gleem\src\org\gephi\lib\gleem\org-gephi-lib-gleem.pot
+source_lang = en
+
+[gephi.org-gephi-ui-generator-plugin]
+file_filter = GeneratorPluginUI\src\org\gephi\ui\generator\plugin\<lang>.po
+source_file = GeneratorPluginUI\src\org\gephi\ui\generator\plugin\org-gephi-ui-generator-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-generator-plugin]
+file_filter = GeneratorPlugin\src\org\gephi\io\generator\plugin\<lang>.po
+source_file = GeneratorPlugin\src\org\gephi\io\generator\plugin\org-gephi-io-generator-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-generator-api]
+file_filter = GeneratorAPI\src\org\gephi\io\generator\api\<lang>.po
+source_file = GeneratorAPI\src\org\gephi\io\generator\api\org-gephi-io-generator-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-flamingo]
+file_filter = FlamingoWrapper\src\org\gephi\lib\flamingo\<lang>.po
+source_file = FlamingoWrapper\src\org\gephi\lib\flamingo\org-gephi-lib-flamingo.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\org-gephi-ui-filters-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin-partition]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\partition\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\partition\org-gephi-ui-filters-plugin-partition.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin-operator]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\operator\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\operator\org-gephi-ui-filters-plugin-operator.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin-graph]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\graph\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\graph\org-gephi-ui-filters-plugin-graph.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin-dynamic]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\dynamic\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\dynamic\org-gephi-ui-filters-plugin-dynamic.pot
+source_lang = en
+
+[gephi.org-gephi-ui-filters-plugin-attribute]
+file_filter = FiltersPluginUI\src\org\gephi\ui\filters\plugin\attribute\<lang>.po
+source_file = FiltersPluginUI\src\org\gephi\ui\filters\plugin\attribute\org-gephi-ui-filters-plugin-attribute.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\org-gephi-filters-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-partition]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\partition\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\partition\org-gephi-filters-plugin-partition.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-operator]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\operator\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\operator\org-gephi-filters-plugin-operator.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-hierarchy]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\hierarchy\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\hierarchy\org-gephi-filters-plugin-hierarchy.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-graph]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\graph\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\graph\org-gephi-filters-plugin-graph.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-edge]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\edge\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\edge\org-gephi-filters-plugin-edge.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-dynamic]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\dynamic\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\dynamic\org-gephi-filters-plugin-dynamic.pot
+source_lang = en
+
+[gephi.org-gephi-filters-plugin-attribute]
+file_filter = FiltersPlugin\src\org\gephi\filters\plugin\attribute\<lang>.po
+source_file = FiltersPlugin\src\org\gephi\filters\plugin\attribute\org-gephi-filters-plugin-attribute.pot
+source_lang = en
+
+[gephi.org-gephi-filters]
+file_filter = FiltersImpl\src\org\gephi\filters\<lang>.po
+source_file = FiltersImpl\src\org\gephi\filters\org-gephi-filters.pot
+source_lang = en
+
+[gephi.org-gephi-filters-api]
+file_filter = FiltersAPI\src\org\gephi\filters\api\<lang>.po
+source_file = FiltersAPI\src\org\gephi\filters\api\org-gephi-filters-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-exporter-plugin]
+file_filter = ExportPluginUI\src\org\gephi\ui\exporter\plugin\<lang>.po
+source_file = ExportPluginUI\src\org\gephi\ui\exporter\plugin\org-gephi-ui-exporter-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-exporter-plugin]
+file_filter = ExportPlugin\src\org\gephi\io\exporter\plugin\<lang>.po
+source_file = ExportPlugin\src\org\gephi\io\exporter\plugin\org-gephi-io-exporter-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-io-exporter-impl]
+file_filter = ExportAPI\src\org\gephi\io\exporter\impl\<lang>.po
+source_file = ExportAPI\src\org\gephi\io\exporter\impl\org-gephi-io-exporter-impl.pot
+source_lang = en
+
+[gephi.org-gephi-io-exporter-api]
+file_filter = ExportAPI\src\org\gephi\io\exporter\api\<lang>.po
+source_file = ExportAPI\src\org\gephi\io\exporter\api\org-gephi-io-exporter-api.pot
+source_lang = en
+
+[gephi.org-gephi-dynamic]
+file_filter = DynamicImpl\src\org\gephi\dynamic\<lang>.po
+source_file = DynamicImpl\src\org\gephi\dynamic\org-gephi-dynamic.pot
+source_lang = en
+
+[gephi.org-gephi-dynamic-api]
+file_filter = DynamicAPI\src\org\gephi\dynamic\api\<lang>.po
+source_file = DynamicAPI\src\org\gephi\dynamic\api\org-gephi-dynamic-api.pot
+source_lang = en
+
+[gephi.org-netbeans-swing-dirchooser]
+file_filter = DirectoryChooser\src\org\netbeans\swing\dirchooser\<lang>.po
+source_file = DirectoryChooser\src\org\netbeans\swing\dirchooser\org-netbeans-swing-dirchooser.pot
+source_lang = en
+
+[gephi.org-gephi-graph-dhns]
+file_filter = DHNSGraph\src\org\gephi\graph\dhns\<lang>.po
+source_file = DHNSGraph\src\org\gephi\graph\dhns\org-gephi-graph-dhns.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-tools]
+file_filter = DesktopTools\src\org\gephi\desktop\tools\<lang>.po
+source_file = DesktopTools\src\org\gephi\desktop\tools\org-gephi-desktop-tools.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-timeline]
+file_filter = DesktopTimeline\src\org\gephi\desktop\timeline\<lang>.po
+source_file = DesktopTimeline\src\org\gephi\desktop\timeline\org-gephi-desktop-timeline.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-statistics]
+file_filter = DesktopStatistics\src\org\gephi\desktop\statistics\<lang>.po
+source_file = DesktopStatistics\src\org\gephi\desktop\statistics\org-gephi-desktop-statistics.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-spigot]
+file_filter = DesktopSpigot\src\org\gephi\desktop\spigot\<lang>.po
+source_file = DesktopSpigot\src\org\gephi\desktop\spigot\org-gephi-desktop-spigot.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-recentfiles]
+file_filter = DesktopRecentFiles\src\org\gephi\desktop\recentfiles\<lang>.po
+source_file = DesktopRecentFiles\src\org\gephi\desktop\recentfiles\org-gephi-desktop-recentfiles.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-ranking]
+file_filter = DesktopRanking\src\org\gephi\desktop\ranking\<lang>.po
+source_file = DesktopRanking\src\org\gephi\desktop\ranking\org-gephi-desktop-ranking.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-project]
+file_filter = DesktopProject\src\org\gephi\desktop\project\<lang>.po
+source_file = DesktopProject\src\org\gephi\desktop\project\org-gephi-desktop-project.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-progress]
+file_filter = DesktopProgress\src\org\gephi\desktop\progress\<lang>.po
+source_file = DesktopProgress\src\org\gephi\desktop\progress\org-gephi-desktop-progress.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-preview]
+file_filter = DesktopPreview\src\org\gephi\desktop\preview\<lang>.po
+source_file = DesktopPreview\src\org\gephi\desktop\preview\org-gephi-desktop-preview.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-perspective]
+file_filter = DesktopPerspective\src\org\gephi\desktop\perspective\<lang>.po
+source_file = DesktopPerspective\src\org\gephi\desktop\perspective\org-gephi-desktop-perspective.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-perspective-plugin]
+file_filter = DesktopPerspective\src\org\gephi\desktop\perspective\plugin\<lang>.po
+source_file = DesktopPerspective\src\org\gephi\desktop\perspective\plugin\org-gephi-desktop-perspective-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-partition]
+file_filter = DesktopPartition\src\org\gephi\desktop\partition\<lang>.po
+source_file = DesktopPartition\src\org\gephi\desktop\partition\org-gephi-desktop-partition.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-layout]
+file_filter = DesktopLayout\src\org\gephi\desktop\layout\<lang>.po
+source_file = DesktopLayout\src\org\gephi\desktop\layout\org-gephi-desktop-layout.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-importer]
+file_filter = DesktopImport\src\org\gephi\desktop\importer\<lang>.po
+source_file = DesktopImport\src\org\gephi\desktop\importer\org-gephi-desktop-importer.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-hierarchy]
+file_filter = DesktopHierarchy\src\org\gephi\desktop\hierarchy\<lang>.po
+source_file = DesktopHierarchy\src\org\gephi\desktop\hierarchy\org-gephi-desktop-hierarchy.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-generate]
+file_filter = DesktopGenerate\src\org\gephi\desktop\generate\<lang>.po
+source_file = DesktopGenerate\src\org\gephi\desktop\generate\org-gephi-desktop-generate.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-filters]
+file_filter = DesktopFilters\src\org\gephi\desktop\filters\<lang>.po
+source_file = DesktopFilters\src\org\gephi\desktop\filters\org-gephi-desktop-filters.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-filters-query]
+file_filter = DesktopFilters\src\org\gephi\desktop\filters\query\<lang>.po
+source_file = DesktopFilters\src\org\gephi\desktop\filters\query\org-gephi-desktop-filters-query.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-filters-library]
+file_filter = DesktopFilters\src\org\gephi\desktop\filters\library\<lang>.po
+source_file = DesktopFilters\src\org\gephi\desktop\filters\library\org-gephi-desktop-filters-library.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-io-export]
+file_filter = DesktopExport\src\org\gephi\desktop\io\export\<lang>.po
+source_file = DesktopExport\src\org\gephi\desktop\io\export\org-gephi-desktop-io-export.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-io-export-api]
+file_filter = DesktopExport\src\org\gephi\desktop\io\export\api\<lang>.po
+source_file = DesktopExport\src\org\gephi\desktop\io\export\api\org-gephi-desktop-io-export-api.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-datalab]
+file_filter = DesktopDataLaboratory\src\org\gephi\desktop\datalab\<lang>.po
+source_file = DesktopDataLaboratory\src\org\gephi\desktop\datalab\org-gephi-desktop-datalab.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-datalab-utils]
+file_filter = DesktopDataLaboratory\src\org\gephi\desktop\datalab\utils\<lang>.po
+source_file = DesktopDataLaboratory\src\org\gephi\desktop\datalab\utils\org-gephi-desktop-datalab-utils.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-datalab-general-actions]
+file_filter = DesktopDataLaboratory\src\org\gephi\desktop\datalab\general\actions\<lang>.po
+source_file = DesktopDataLaboratory\src\org\gephi\desktop\datalab\general\actions\org-gephi-desktop-datalab-general-actions.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-context]
+file_filter = DesktopContext\src\org\gephi\desktop\context\<lang>.po
+source_file = DesktopContext\src\org\gephi\desktop\context\org-gephi-desktop-context.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-clustering]
+file_filter = DesktopClustering\src\org\gephi\desktop\clustering\<lang>.po
+source_file = DesktopClustering\src\org\gephi\desktop\clustering\org-gephi-desktop-clustering.pot
+source_lang = en
+
+[gephi.org-gephi-branding-desktop]
+file_filter = DesktopBranding\src\org\gephi\branding\desktop\<lang>.po
+source_file = DesktopBranding\src\org\gephi\branding\desktop\org-gephi-branding-desktop.pot
+source_lang = en
+
+[gephi.org-gephi-branding-desktop-reporter]
+file_filter = DesktopBranding\src\org\gephi\branding\desktop\reporter\<lang>.po
+source_file = DesktopBranding\src\org\gephi\branding\desktop\reporter\org-gephi-branding-desktop-reporter.pot
+source_lang = en
+
+[gephi.org-gephi-branding-desktop-multilingual]
+file_filter = DesktopBranding\src\org\gephi\branding\desktop\multilingual\<lang>.po
+source_file = DesktopBranding\src\org\gephi\branding\desktop\multilingual\org-gephi-branding-desktop-multilingual.pot
+source_lang = en
+
+[gephi.org-gephi-branding-desktop-actions]
+file_filter = DesktopBranding\src\org\gephi\branding\desktop\actions\<lang>.po
+source_file = DesktopBranding\src\org\gephi\branding\desktop\actions\org-gephi-branding-desktop-actions.pot
+source_lang = en
+
+[gephi.org-gephi-io-database-drivers]
+file_filter = DBDrivers\src\org\gephi\io\database\drivers\<lang>.po
+source_file = DBDrivers\src\org\gephi\io\database\drivers\org-gephi-io-database-drivers.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\org-gephi-datalab-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-values]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\values\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\values\org-gephi-datalab-plugin-manipulators-values.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\ui\org-gephi-datalab-plugin-manipulators-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-rows-merge]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\rows\merge\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\rows\merge\org-gephi-datalab-plugin-manipulators-rows-merge.pot
+source_lang = en
+
+[gephi.s--gephi-datalab-plugin-manipulators-rows-merge-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\rows\merge\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\rows\merge\ui\org-gephi-datalab-plugin-manipulators-rows-merge-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-nodes]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\nodes\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\nodes\org-gephi-datalab-plugin-manipulators-nodes.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-nodes-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\nodes\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\nodes\ui\org-gephi-datalab-plugin-manipulators-nodes-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-general]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\general\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\general\org-gephi-datalab-plugin-manipulators-general.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-general-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\general\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\general\ui\org-gephi-datalab-plugin-manipulators-general-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-edges]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\edges\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\edges\org-gephi-datalab-plugin-manipulators-edges.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-edges-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\edges\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\edges\ui\org-gephi-datalab-plugin-manipulators-edges-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-columns]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\org-gephi-datalab-plugin-manipulators-columns.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-plugin-manipulators-columns-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\ui\org-gephi-datalab-plugin-manipulators-columns-ui.pot
+source_lang = en
+
+[gephi.s--gephi-datalab-plugin-manipulators-columns-merge]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\merge\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\merge\org-gephi-datalab-plugin-manipulators-columns-merge.pot
+source_lang = en
+
+[gephi.s-phi-datalab-plugin-manipulators-columns-merge-ui]
+file_filter = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\merge\ui\<lang>.po
+source_file = DataLaboratoryPlugin\src\org\gephi\datalab\plugin\manipulators\columns\merge\ui\org-gephi-datalab-plugin-manipulators-columns-merge-ui.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-impl]
+file_filter = DataLaboratoryAPI\src\org\gephi\datalab\impl\<lang>.po
+source_file = DataLaboratoryAPI\src\org\gephi\datalab\impl\org-gephi-datalab-impl.pot
+source_lang = en
+
+[gephi.org-gephi-datalab-api]
+file_filter = DataLaboratoryAPI\src\org\gephi\datalab\api\<lang>.po
+source_file = DataLaboratoryAPI\src\org\gephi\datalab\api\org-gephi-datalab-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-commonscompress]
+file_filter = CommonsCompressWrapper\src\org\gephi\lib\commonscompress\<lang>.po
+source_file = CommonsCompressWrapper\src\org\gephi\lib\commonscompress\org-gephi-lib-commonscompress.pot
+source_lang = en
+
+[gephi.org-gephi-lib-commons-codec]
+file_filter = CommonsCodec\src\org\gephi\lib\commons\codec\<lang>.po
+source_file = CommonsCodec\src\org\gephi\lib\commons\codec\org-gephi-lib-commons-codec.pot
+source_lang = en
+
+[gephi.org-gephi-utils-collection]
+file_filter = CollectionUtils\src\org\gephi\utils\collection\<lang>.po
+source_file = CollectionUtils\src\org\gephi\utils\collection\org-gephi-utils-collection.pot
+source_lang = en
+
+[gephi.org-gephi-clustering-plugin]
+file_filter = ClusteringPlugin\src\org\gephi\clustering\plugin\<lang>.po
+source_file = ClusteringPlugin\src\org\gephi\clustering\plugin\org-gephi-clustering-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-clustering-plugin-mcl]
+file_filter = ClusteringPlugin\src\org\gephi\clustering\plugin\mcl\<lang>.po
+source_file = ClusteringPlugin\src\org\gephi\clustering\plugin\mcl\org-gephi-clustering-plugin-mcl.pot
+source_lang = en
+
+[gephi.org-gephi-clustering-api]
+file_filter = ClusteringAPI\src\org\gephi\clustering\api\<lang>.po
+source_file = ClusteringAPI\src\org\gephi\clustering\api\org-gephi-clustering-api.pot
+source_lang = en
+
+[gephi.org-gephi-lib-beansbinding]
+file_filter = BeansBindingWrapper\src\org\gephi\lib\beansbinding\<lang>.po
+source_file = BeansBindingWrapper\src\org\gephi\lib\beansbinding\org-gephi-lib-beansbinding.pot
+source_lang = en
+
+[gephi.org-gephi-lib-batik]
+file_filter = BatikWrapper\src\org\gephi\lib\batik\<lang>.po
+source_file = BatikWrapper\src\org\gephi\lib\batik\org-gephi-lib-batik.pot
+source_lang = en
+
+[gephi.org-gephi-data-attributes]
+file_filter = AttributesImpl\src\org\gephi\data\attributes\<lang>.po
+source_file = AttributesImpl\src\org\gephi\data\attributes\org-gephi-data-attributes.pot
+source_lang = en
+
+[gephi.org-gephi-data-attributes-api]
+file_filter = AttributesAPI\src\org\gephi\data\attributes\api\<lang>.po
+source_file = AttributesAPI\src\org\gephi\data\attributes\api\org-gephi-data-attributes-api.pot
+source_lang = en
+
+[gephi.org-gephi-ui-propertyeditor]
+file_filter = AttributeColumnPropertyEditor\src\org\gephi\ui\propertyeditor\<lang>.po
+source_file = AttributeColumnPropertyEditor\src\org\gephi\ui\propertyeditor\org-gephi-ui-propertyeditor.pot
+source_lang = en
+
+[gephi.org-gephi-algorithms]
+file_filter = Algorithms\src\org\gephi\algorithms\<lang>.po
+source_file = Algorithms\src\org\gephi\algorithms\org-gephi-algorithms.pot
+source_lang = en
+
+[gephi.org-gephi-ui-statistics-plugin-dynamic]
+file_filter = StatisticsPluginUI\src\org\gephi\ui\statistics\plugin\dynamic\<lang>.po
+source_file = StatisticsPluginUI\src\org\gephi\ui\statistics\plugin\dynamic\org-gephi-ui-statistics-plugin-dynamic.pot
+source_lang = en
+
+[gephi.org-gephi-statistics-plugin-dynamic-builder]
+file_filter = StatisticsPlugin\src\org\gephi\statistics\plugin\dynamic\builder\<lang>.po
+source_file = StatisticsPlugin\src\org\gephi\statistics\plugin\dynamic\builder\org-gephi-statistics-plugin-dynamic-builder.pot
+source_lang = en
+
+[gephi.org-gephi-preview-plugin]
+file_filter = PreviewPlugin\src\org\gephi\preview\plugin\<lang>.po
+source_file = PreviewPlugin\src\org\gephi\preview\plugin\org-gephi-preview-plugin.pot
+source_lang = en
+
+[gephi.org-gephi-preview-plugin-renderers]
+file_filter = PreviewPlugin\src\org\gephi\preview\plugin\renderers\<lang>.po
+source_file = PreviewPlugin\src\org\gephi\preview\plugin\renderers\org-gephi-preview-plugin-renderers.pot
+source_lang = en
+
+[gephi.org-gephi-layout]
+file_filter = LayoutAPI\src\org\gephi\layout\<lang>.po
+source_file = LayoutAPI\src\org\gephi\layout\org-gephi-layout.pot
+source_lang = en
+
+[gephi.org-gephi-desktop-preview-propertyeditors]
+file_filter = DesktopPreview\src\org\gephi\desktop\preview\propertyeditors\<lang>.po
+source_file = DesktopPreview\src\org\gephi\desktop\preview\propertyeditors\org-gephi-desktop-preview-propertyeditors.pot
+source_lang = en
+
=== added file '.tx/readme.txt'
--- .tx/readme.txt 1970-01-01 00:00:00 +0000
+++ .tx/readme.txt 2012-04-11 14:38:21 +0000
@@ -0,0 +1,4 @@
+This folder contains the https://www.transifex.net/projects/p/gephi translation tool configuration to push and pull translation files from there.
+
+!!Transifex needs "\" separators in windows to correctly find .po files, depending on your OS you should use / or \ in the config file. This can be easily replaced with a text editor.
+See set_transifex.py script
\ No newline at end of file
=== added directory 'Algorithms'
=== renamed directory 'Algorithms' => 'Algorithms.moved'
=== added file 'Algorithms/build.xml'
--- Algorithms/build.xml 1970-01-01 00:00:00 +0000
+++ Algorithms/build.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+<?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>
=== added file 'Algorithms/manifest.mf'
--- Algorithms/manifest.mf 1970-01-01 00:00:00 +0000
+++ Algorithms/manifest.mf 2012-04-11 14:38:21 +0000
@@ -0,0 +1,5 @@
+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
=== added directory 'Algorithms/nbproject'
=== added file 'Algorithms/nbproject/build-impl.xml'
--- Algorithms/nbproject/build-impl.xml 1970-01-01 00:00:00 +0000
+++ Algorithms/nbproject/build-impl.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,45 @@
+<?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>
=== added file 'Algorithms/nbproject/genfiles.properties'
--- Algorithms/nbproject/genfiles.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/nbproject/genfiles.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+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
=== added file 'Algorithms/nbproject/project.properties'
--- Algorithms/nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/nbproject/project.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
+keystore=nbproject/private/keystore.ks
+license.file=../agpl-3.0.txt
+nbm.module.author=Gephi.org
+nbm_alias=gephi
=== added file 'Algorithms/nbproject/project.xml'
--- Algorithms/nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ Algorithms/nbproject/project.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,55 @@
+<?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>
=== added file 'Algorithms/nbproject/suite.properties'
--- Algorithms/nbproject/suite.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/nbproject/suite.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,1 @@
+suite.dir=${basedir}/..
=== added directory 'Algorithms/src'
=== added directory 'Algorithms/src/org'
=== added directory 'Algorithms/src/org/gephi'
=== added directory 'Algorithms/src/org/gephi/algorithms'
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,5 @@
+OpenIDE-Module-Display-Category=Gephi Core
+OpenIDE-Module-Long-Description=\
+ Basic graph theory algorithms
+OpenIDE-Module-Name=Algorithms
+OpenIDE-Module-Short-Description=Basic graph theory algorithms
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_de.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_de.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_de.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,10 @@
+# German translation for gephi
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the gephi package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2011-03-01 15\:39+0000\nLast-Translator\: FULL NAME <EMAIL@ADDRESS>\nLanguage-Team\: German <de@xxxxxx>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:46+0000\nX-Generator\: Launchpad (build 12559)\n
+
+!OpenIDE-Module-Long-Description=
+
+!OpenIDE-Module-Short-Description=
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_es.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_es.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_es.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_fr.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_fr.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_fr.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_ja.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_ja.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_ja.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-11 00\:30+0000\nLast-Translator\: sarang <kida.siro@xxxxxxxxx>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_oc.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_oc.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_oc.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,10 @@
+# Occitan (post 1500) translation for gephi
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the gephi package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2010-10-21 13\:36+0000\nLast-Translator\: C\u00e9dric VALMARY (Tot en \u00f2c) <cvalmary@xxxxxxxx>\nLanguage-Team\: Occitan (post 1500) <oc@xxxxxx>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:46+0000\nX-Generator\: Launchpad (build 12559)\n
+
+OpenIDE-Module-Long-Description=Algoritmes de basa en teoria dels grafes
+
+OpenIDE-Module-Short-Description=Algoritmes de basa en teoria dels grafes
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_pt_BR.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_pt_BR.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_pt_BR.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 23\:22+0000\nLast-Translator\: celiofariajr <celiofariajr@xxxxxxxxx>\nLanguage-Team\: Portuguese (Brazilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'Algorithms/src/org/gephi/algorithms/Bundle_ru.properties'
--- Algorithms/src/org/gephi/algorithms/Bundle_ru.properties 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/Bundle_ru.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,10 @@
+# Russian translation for gephi
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the gephi package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2010-11-30 21\:40+0000\nLast-Translator\: Altsoph <Unknown>\nLanguage-Team\: Russian <ru@xxxxxx>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:46+0000\nX-Generator\: Launchpad (build 12559)\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
=== added file 'Algorithms/src/org/gephi/algorithms/es.po'
--- Algorithms/src/org/gephi/algorithms/es.po 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/es.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,27 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'Algorithms/src/org/gephi/algorithms/fr.po'
--- Algorithms/src/org/gephi/algorithms/fr.po 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/fr.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,27 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: French (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'Algorithms/src/org/gephi/algorithms/ja.po'
--- Algorithms/src/org/gephi/algorithms/ja.po 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/ja.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,27 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-11 00:30+0000\n"
+"Last-Translator: sarang <kida.siro@xxxxxxxxx>\n"
+"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/team/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 "基礎グラフ理論アルゴリズム"
+
+
=== added file 'Algorithms/src/org/gephi/algorithms/org-gephi-algorithms.pot'
--- Algorithms/src/org/gephi/algorithms/org-gephi-algorithms.pot 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/org-gephi-algorithms.pot 2012-04-11 14:38:21 +0000
@@ -0,0 +1,22 @@
+# Translation file for Gephi.
+# Copyright (C) 2011 Gephi contributors.
+# This file is distributed under the same license as the Gephi package.
+# Gephi Team <gephi.team@xxxxxxxxxxxxxxxxxxx>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi 0.8\n"
+"Report-Msgid-Bugs-To: gephi.team@xxxxxxxxxxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-05 14:52+0200\n"
+"Last-Translator: Mathieu Bastian <gephi.team@xxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: English <https://launchpad.net/~gephi.team>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "OpenIDE-Module-Long-Description"
+msgstr "Basic graph theory algorithms"
+
+msgid "OpenIDE-Module-Short-Description"
+msgstr "Basic graph theory algorithms"
=== added file 'Algorithms/src/org/gephi/algorithms/pt_BR.po'
--- Algorithms/src/org/gephi/algorithms/pt_BR.po 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/pt_BR.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,27 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-06 23:22+0000\n"
+"Last-Translator: celiofariajr <celiofariajr@xxxxxxxxx>\n"
+"Language-Team: Portuguese (Brazilian) (http://www.transifex.net/projects/p/gephi/team/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 "
+
+
=== added directory 'Algorithms/src/org/gephi/algorithms/shortestpath'
=== added file 'Algorithms/src/org/gephi/algorithms/shortestpath/AbstractShortestPathAlgorithm.java'
--- Algorithms/src/org/gephi/algorithms/shortestpath/AbstractShortestPathAlgorithm.java 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/shortestpath/AbstractShortestPathAlgorithm.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,100 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.awt.Color;
+import java.util.HashMap;
+import org.gephi.graph.api.Edge;
+import org.gephi.graph.api.Node;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public abstract class AbstractShortestPathAlgorithm {
+
+ protected final HashMap<Node, Color> colors;
+ protected final HashMap<Node, Double> distances;
+ protected final Node sourceNode;
+ protected double maxDistance = 0;
+
+ public AbstractShortestPathAlgorithm(Node sourceNode) {
+ this.sourceNode = sourceNode;
+ colors = new HashMap<Node, Color>();
+ distances = new HashMap<Node, Double>();
+ }
+
+ protected boolean relax(Edge edge) {
+ Node source = edge.getSource();
+ Node target = edge.getTarget();
+ double distSource = distances.get(source);
+ double distTarget = distances.get(target);
+ double weight = edgeWeight(edge);
+
+ double sourceWeight = distSource + weight;
+ if (sourceWeight < distTarget) {
+ distances.put(target, sourceWeight);
+ maxDistance = Math.max(maxDistance, sourceWeight);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected double edgeWeight(Edge edge) {
+ return edge.getWeight();
+ }
+
+ public abstract void compute();
+
+ public abstract Node getPredecessor(Node node);
+
+ public abstract Edge getPredecessorIncoming(Node node);
+
+ public HashMap<Node, Double> getDistances() {
+ return distances;
+ }
+
+ public double getMaxDistance() {
+ return maxDistance;
+ }
+}
=== added file 'Algorithms/src/org/gephi/algorithms/shortestpath/BellmanFordShortestPathAlgorithm.java'
--- Algorithms/src/org/gephi/algorithms/shortestpath/BellmanFordShortestPathAlgorithm.java 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/shortestpath/BellmanFordShortestPathAlgorithm.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,137 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.openide.util.Lookup;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class BellmanFordShortestPathAlgorithm extends AbstractShortestPathAlgorithm {
+
+ protected final DirectedGraph graph;
+ protected final HashMap<Node, Edge> predecessors;
+ protected TimeInterval timeInterval;
+
+ public BellmanFordShortestPathAlgorithm(DirectedGraph graph, Node sourceNode) {
+ super(sourceNode);
+ this.graph = graph;
+ predecessors = new HashMap<Node, 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, Double.POSITIVE_INFINITY);
+ nodeCount++;
+ }
+ distances.put(sourceNode, 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, edge);
+ }
+ }
+ if (!relaxed) {
+ break;
+ }
+ }
+
+ //Check for negative-weight cycles
+ for (Edge edge : graph.getEdges()) {
+
+ if (distances.get(edge.getSource()) + edgeWeight(edge) < distances.get(edge.getTarget())) {
+ 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);
+ 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);
+ }
+}
=== added file 'Algorithms/src/org/gephi/algorithms/shortestpath/DijkstraShortestPathAlgorithm.java'
--- Algorithms/src/org/gephi/algorithms/shortestpath/DijkstraShortestPathAlgorithm.java 1970-01-01 00:00:00 +0000
+++ Algorithms/src/org/gephi/algorithms/shortestpath/DijkstraShortestPathAlgorithm.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,147 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.openide.util.Lookup;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class DijkstraShortestPathAlgorithm extends AbstractShortestPathAlgorithm {
+
+ protected final Graph graph;
+ protected final HashMap<Node, Edge> predecessors;
+ protected TimeInterval timeInterval;
+
+ public DijkstraShortestPathAlgorithm(Graph graph, Node sourceNode) {
+ super(sourceNode);
+ this.graph = graph;
+ predecessors = new HashMap<Node, 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> nodes = new HashSet<Node>();
+
+ //Initialize
+ int nodeCount = 0;
+ for (Node node : graph.getNodes()) {
+ distances.put(node, Double.POSITIVE_INFINITY);
+ nodes.add(node);
+ nodeCount++;
+ }
+ distances.put(sourceNode, 0d);
+
+ while (!nodes.isEmpty()) {
+
+ // find node with smallest distance value
+ Double minDistance = Double.POSITIVE_INFINITY;
+ Node minDistanceNode = null;
+ for (Node k : nodes) {
+ Double dist = distances.get(k);
+ if (dist.compareTo(minDistance) < 0) {
+ minDistance = dist;
+ minDistanceNode = k;
+ }
+ }
+ Node currentNode = minDistanceNode;
+ nodes.remove(currentNode);
+
+ for (Edge edge : graph.getEdges(currentNode)) {
+ Node neighbor = graph.getOpposite(currentNode, edge);
+ double dist = edgeWeight(edge) + distances.get(currentNode);
+ if (distances.get(neighbor).equals(Double.POSITIVE_INFINITY)) {
+ distances.put(neighbor, dist);
+ maxDistance = Math.max(maxDistance, dist);
+ predecessors.put(neighbor, edge);
+ } else {
+ if (dist < distances.get(neighbor)) {
+ distances.put(neighbor, dist);
+ maxDistance = Math.max(maxDistance, dist);
+ predecessors.put(neighbor, edge);
+ }
+ }
+ }
+ }
+
+ 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);
+ 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);
+ }
+}
=== added directory 'Algorithms/test'
=== added directory 'Algorithms/test/unit'
=== added directory 'Algorithms/test/unit/src'
=== added directory 'AttributeColumnPropertyEditor'
=== renamed directory 'AttributeColumnPropertyEditor' => 'AttributeColumnPropertyEditor.moved'
=== added file 'AttributeColumnPropertyEditor/build.xml'
--- AttributeColumnPropertyEditor/build.xml 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/build.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+<?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>
=== added file 'AttributeColumnPropertyEditor/manifest.mf'
--- AttributeColumnPropertyEditor/manifest.mf 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/manifest.mf 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+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
+
=== added directory 'AttributeColumnPropertyEditor/nbproject'
=== added file 'AttributeColumnPropertyEditor/nbproject/build-impl.xml'
--- AttributeColumnPropertyEditor/nbproject/build-impl.xml 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/nbproject/build-impl.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,45 @@
+<?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>
=== added file 'AttributeColumnPropertyEditor/nbproject/genfiles.properties'
--- AttributeColumnPropertyEditor/nbproject/genfiles.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/nbproject/genfiles.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+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
=== added file 'AttributeColumnPropertyEditor/nbproject/project.properties'
--- AttributeColumnPropertyEditor/nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/nbproject/project.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
+keystore=nbproject/private/keystore.ks
+license.file=../agpl-3.0.txt
+nbm.module.author=Gephi.org
+nbm_alias=gephi
=== added file 'AttributeColumnPropertyEditor/nbproject/project.xml'
--- AttributeColumnPropertyEditor/nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/nbproject/project.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,39 @@
+<?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>
=== added file 'AttributeColumnPropertyEditor/nbproject/suite.properties'
--- AttributeColumnPropertyEditor/nbproject/suite.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/nbproject/suite.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,1 @@
+suite.dir=${basedir}/..
=== added directory 'AttributeColumnPropertyEditor/src'
=== added directory 'AttributeColumnPropertyEditor/src/org'
=== added directory 'AttributeColumnPropertyEditor/src/org/gephi'
=== added directory 'AttributeColumnPropertyEditor/src/org/gephi/ui'
=== added directory 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor'
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/AbstractAttributeColumnPropertyEditor.java'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/AbstractAttributeColumnPropertyEditor.java 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/AbstractAttributeColumnPropertyEditor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,169 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.ui.propertyeditor;
+
+import java.beans.PropertyEditorSupport;
+import java.util.ArrayList;
+import java.util.List;
+import org.gephi.data.attributes.api.AttributeColumn;
+import org.gephi.data.attributes.api.AttributeController;
+import org.gephi.data.attributes.api.AttributeModel;
+import org.gephi.data.attributes.api.AttributeType;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+abstract class AbstractAttributeColumnPropertyEditor extends PropertyEditorSupport {
+
+ public enum EditorClass {
+
+ NODE, EDGE, NODEEDGE
+ };
+
+ public enum AttributeTypeClass {
+
+ ALL, NUMBER, STRING
+ };
+ private AttributeColumn[] columns;
+ private AttributeColumn selectedColumn;
+ private EditorClass editorClass = EditorClass.NODE;
+ private AttributeTypeClass attributeTypeClass = AttributeTypeClass.ALL;
+
+ protected AbstractAttributeColumnPropertyEditor(EditorClass editorClass) {
+ this.editorClass = editorClass;
+ }
+
+ protected AbstractAttributeColumnPropertyEditor(EditorClass editorClass, AttributeTypeClass attributeClass) {
+ this.editorClass = editorClass;
+ this.attributeTypeClass = attributeClass;
+ }
+
+ protected AttributeColumn[] getColumns() {
+ List<AttributeColumn> cols = new ArrayList<AttributeColumn>();
+ AttributeModel model = Lookup.getDefault().lookup(AttributeController.class).getModel();
+ if (model != null) {
+ if (editorClass.equals(EditorClass.NODE) || editorClass.equals(EditorClass.NODEEDGE)) {
+ for (AttributeColumn column : model.getNodeTable().getColumns()) {
+ if (attributeTypeClass.equals(AttributeTypeClass.NUMBER) && isNumberColumn(column)) {
+ cols.add(column);
+ } else if (attributeTypeClass.equals(AttributeTypeClass.ALL)) {
+ cols.add(column);
+ } else if (attributeTypeClass.equals(attributeTypeClass.STRING) && isStringColumn(column)) {
+ cols.add(column);
+ }
+ }
+ }
+ if (editorClass.equals(EditorClass.EDGE) || editorClass.equals(EditorClass.NODEEDGE)) {
+ for (AttributeColumn column : model.getEdgeTable().getColumns()) {
+ if (attributeTypeClass.equals(AttributeTypeClass.NUMBER) && isNumberColumn(column)) {
+ cols.add(column);
+ } else if (attributeTypeClass.equals(AttributeTypeClass.ALL)) {
+ cols.add(column);
+ } else if (attributeTypeClass.equals(attributeTypeClass.STRING) && isStringColumn(column)) {
+ cols.add(column);
+ }
+ }
+ }
+ }
+ return cols.toArray(new AttributeColumn[0]);
+ }
+
+ @Override
+ public String[] getTags() {
+ columns = getColumns();
+ //selectedColumn = columns[0];
+ String[] tags = new String[columns.length];
+ for (int i = 0; i < columns.length; i++) {
+ tags[i] = columns[i].getTitle();
+ }
+ return tags;
+ }
+
+ @Override
+ public Object getValue() {
+ return selectedColumn;
+ }
+
+ @Override
+ public void setValue(Object value) {
+ AttributeColumn column = (AttributeColumn) value;
+ this.selectedColumn = column;
+ }
+
+ @Override
+ public String getAsText() {
+ if (selectedColumn == null) {
+ return "---";
+ }
+ return selectedColumn.getTitle();
+ }
+
+ @Override
+ public void setAsText(String text) throws IllegalArgumentException {
+ for (AttributeColumn c : columns) {
+ if (c.getTitle().equals(text)) {
+ this.selectedColumn = c;
+ }
+ }
+ }
+
+ public boolean isNumberColumn(AttributeColumn column) {
+ AttributeType type = column.getType();
+ if (type == AttributeType.DOUBLE
+ || type == AttributeType.FLOAT
+ || type == AttributeType.INT
+ || type == AttributeType.LONG) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isStringColumn(AttributeColumn column) {
+ AttributeType type = column.getType();
+ if (type == AttributeType.STRING) {
+ return true;
+ }
+ return false;
+ }
+}
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle.properties'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,5 @@
+OpenIDE-Module-Display-Category=Gephi UI
+OpenIDE-Module-Long-Description=\
+ These property editors can be used to display a combobox with current columns in a PropertySheet.
+OpenIDE-Module-Name=AttributeColumn Property Editor
+OpenIDE-Module-Short-Description=Provide PropertyEditor class for AttributeColumn properties
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_es.properties'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_es.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_es.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_fr.properties'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_fr.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_fr.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 14\:30+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_ja.properties'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_ja.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_ja.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-18 10\:40+0000\nLast-Translator\: sarang <kida.siro@xxxxxxxxx>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_pt_BR.properties'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_pt_BR.properties 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/Bundle_pt_BR.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-06 23\:31+0000\nLast-Translator\: celiofariajr <celiofariajr@xxxxxxxxx>\nLanguage-Team\: Portuguese (Brazilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnNumbersEditor.java'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnNumbersEditor.java 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnNumbersEditor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,53 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.ui.propertyeditor;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class EdgeColumnNumbersEditor extends AbstractAttributeColumnPropertyEditor {
+
+ public EdgeColumnNumbersEditor() {
+ super(EditorClass.EDGE, AttributeTypeClass.NUMBER);
+ }
+}
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnStringEditor.java'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnStringEditor.java 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/EdgeColumnStringEditor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,53 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.ui.propertyeditor;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class EdgeColumnStringEditor extends AbstractAttributeColumnPropertyEditor {
+
+ public EdgeColumnStringEditor() {
+ super(EditorClass.EDGE, AttributeTypeClass.STRING);
+ }
+}
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnNumbersEditor.java'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnNumbersEditor.java 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnNumbersEditor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,53 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.ui.propertyeditor;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class NodeColumnNumbersEditor extends AbstractAttributeColumnPropertyEditor {
+
+ public NodeColumnNumbersEditor() {
+ super(EditorClass.NODE, AttributeTypeClass.NUMBER);
+ }
+}
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnStringEditor.java'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnStringEditor.java 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/NodeColumnStringEditor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,53 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.ui.propertyeditor;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class NodeColumnStringEditor extends AbstractAttributeColumnPropertyEditor {
+
+ public NodeColumnStringEditor() {
+ super(EditorClass.NODE, AttributeTypeClass.STRING);
+ }
+}
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/es.po'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/es.po 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/es.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,30 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/fr.po'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/fr.po 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/fr.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,30 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: French (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/ja.po'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/ja.po 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/ja.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,27 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-18 10:40+0000\n"
+"Last-Translator: sarang <kida.siro@xxxxxxxxx>\n"
+"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/team/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クラスを提供する"
+
+
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/org-gephi-ui-propertyeditor.pot'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/org-gephi-ui-propertyeditor.pot 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/org-gephi-ui-propertyeditor.pot 2012-04-11 14:38:21 +0000
@@ -0,0 +1,24 @@
+# Translation file for Gephi.
+# Copyright (C) 2011 Gephi contributors.
+# This file is distributed under the same license as the Gephi package.
+# Gephi Team <gephi.team@xxxxxxxxxxxxxxxxxxx>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi 0.8\n"
+"Report-Msgid-Bugs-To: gephi.team@xxxxxxxxxxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-05 14:52+0200\n"
+"Last-Translator: Mathieu Bastian <gephi.team@xxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: English <https://launchpad.net/~gephi.team>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "OpenIDE-Module-Long-Description"
+msgstr ""
+"These property editors can be used to display a combobox with current "
+"columns in a PropertySheet."
+
+msgid "OpenIDE-Module-Short-Description"
+msgstr "Provide PropertyEditor class for AttributeColumn properties"
=== added file 'AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/pt_BR.po'
--- AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/pt_BR.po 1970-01-01 00:00:00 +0000
+++ AttributeColumnPropertyEditor/src/org/gephi/ui/propertyeditor/pt_BR.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,30 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-06 23:31+0000\n"
+"Last-Translator: celiofariajr <celiofariajr@xxxxxxxxx>\n"
+"Language-Team: Portuguese (Brazilian) (http://www.transifex.net/projects/p/gephi/team/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 "
+
+
=== added directory 'AttributeColumnPropertyEditor/test'
=== added directory 'AttributeColumnPropertyEditor/test/unit'
=== added directory 'AttributeColumnPropertyEditor/test/unit/src'
=== added directory 'AttributesAPI'
=== renamed directory 'AttributesAPI' => 'AttributesAPI.moved'
=== added file 'AttributesAPI/build.xml'
--- AttributesAPI/build.xml 1970-01-01 00:00:00 +0000
+++ AttributesAPI/build.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+<?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>
=== added file 'AttributesAPI/manifest.mf'
--- AttributesAPI/manifest.mf 1970-01-01 00:00:00 +0000
+++ AttributesAPI/manifest.mf 2012-04-11 14:38:21 +0000
@@ -0,0 +1,5 @@
+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.2
+AutoUpdate-Essential-Module: true
=== added directory 'AttributesAPI/nbproject'
=== added file 'AttributesAPI/nbproject/build-impl.xml'
--- AttributesAPI/nbproject/build-impl.xml 1970-01-01 00:00:00 +0000
+++ AttributesAPI/nbproject/build-impl.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,45 @@
+<?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>
=== added file 'AttributesAPI/nbproject/genfiles.properties'
--- AttributesAPI/nbproject/genfiles.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/nbproject/genfiles.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+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
=== added file 'AttributesAPI/nbproject/project.properties'
--- AttributesAPI/nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/nbproject/project.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
+keystore=nbproject/private/keystore.ks
+license.file=../agpl-3.0.txt
+nbm.module.author=Gephi.org
+nbm_alias=gephi
=== added file 'AttributesAPI/nbproject/project.xml'
--- AttributesAPI/nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ AttributesAPI/nbproject/project.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,59 @@
+<?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>
=== added file 'AttributesAPI/nbproject/suite.properties'
--- AttributesAPI/nbproject/suite.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/nbproject/suite.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,1 @@
+suite.dir=${basedir}/..
=== added directory 'AttributesAPI/src'
=== added directory 'AttributesAPI/src/org'
=== added directory 'AttributesAPI/src/org/gephi'
=== added directory 'AttributesAPI/src/org/gephi/data'
=== added directory 'AttributesAPI/src/org/gephi/data/attributes'
=== added directory 'AttributesAPI/src/org/gephi/data/attributes/api'
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeColumn.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeColumn.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeColumn.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,130 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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 org.gephi.data.attributes.spi.AttributeValueDelegateProvider;
+
+/**
+ * Column is the header of a data column. It belongs to an <code>AttributeTable</code>
+ * and is the key to access data within <code>AttributeRow</code>.
+ * <p>
+ * It contains its index that may be used to get the appropriate value in the
+ * <code>AttributeRow</code> values array.
+ * <p>
+ * For Gephi internal implementation purposes, names of columns are restricted. They can have any name
+ * except these defined in {@link org.gephi.data.properties.PropertiesColumn PropertiesColumn} enum.
+ * <h2>Iterate rows values</h2>
+ * <pre>
+ * Attribute row = ...;
+ * for(AttributeColumn column : table.getColumns()) {
+ * Object value = row.getValue(column);
+ * }
+ * </pre>
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ * @see AttributeRow
+ * @see AttributeTable
+ */
+public interface AttributeColumn {
+
+ /**
+ * Returns the type of this column content.
+ *
+ * @return the type of this column
+ */
+ public AttributeType getType();
+
+ /**
+ * Returns the title of this column. The title is a human-readable text that
+ * describes the column data. When no title exists, returns the <code>Id</code>
+ * of this column.
+ *
+ * @return the title of this column, if exists, or the <code>Id</code> otherwise
+ */
+ public String getTitle();
+
+ /**
+ * Returns the index of this column. The index is the fastest way to access a
+ * column from its <code>AttributeTable</code> or manipulate
+ * <code>AttributeRow</code>.
+ *
+ * @return the index of this column
+ * @see AttributeTable#getColumn(int)
+ * @see AttributeRow#getValue(int)
+ */
+ public int getIndex();
+
+ /**
+ * Returns the origin of this column content, meta-data that describes where
+ * the column comes from. Default value is <code>AttributeOrigin.DATA</code>.
+ *
+ * @return the origin of this column content
+ */
+ public AttributeOrigin getOrigin();
+
+ /**
+ * Returns the id of this column. The id is the unique identifier that describes
+ * the column data.
+ *
+ * @return the id of this column
+ */
+ public String getId();
+
+ /**
+ * Returns the default value for this column. May be <code>null</code>.
+ * <p>
+ * The returned <code>Object</code> class type is equal to the class obtained
+ * with <code>AttributeType.getType()</code>.
+ *
+ * @return the default value, or <code>null</code>
+ */
+ public Object getDefaultValue();
+
+ /**
+ * Returns the attribute value delegate provider. The Provider is always set if the origin of the
+ * current attribute column is AttributeOrigin.DELEGATE.
+ *
+ * @return attribute value delegate provider
+ */
+ public AttributeValueDelegateProvider getProvider();
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeController.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeController.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeController.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,96 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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 org.gephi.project.api.Workspace;
+
+/**
+ * This controller is the access door to {@link AttributeModel}, that contains
+ * all attributes data. Attributes are simply any data that could be associated
+ * with elements like nodes or edges. This module helps to organize data in
+ * columsn and rows in a way they can be accessed in multiple, yet efficient ways.
+ * <p>
+ * This controller is a service, and exist in the system as a singleton. It can be
+ * retrieved by using the following command:
+ * <pre>
+ * AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
+ * </pre>
+ * @author Mathieu Bastian
+ */
+public interface AttributeController {
+
+ /**
+ * Returns the model for the current <code>Workspace</code>. May return
+ * <code>null</code> if there currently no <code>Worksapce</code> active.
+ * <p>
+ * The controller maintains the current project status and is responsible of
+ * maintaining one <code>AttributeModel</code> instance per <code>Workspace</code>.
+ * Hence, the model can also be accessed by using the following code:
+ * <pre>
+ * Workspace.getLookup().get(AttributeModel.class);
+ * </pre>
+ * @return the currently active model
+ */
+ public AttributeModel getModel();
+
+ /**
+ * Returns the model for the given <code>Workspace</code>.
+ * <p>
+ * The controller maintains the current project status and is responsible of
+ * maintaining one <code>AttributeModel</code> instance per <code>Workspace</code>.
+ * Hence, the model can also be accessed by using the following code:
+ * <pre>
+ * Workspace.getLookup().get(AttributeModel.class);
+ * </pre>
+ * @return the attribute model for <code>workspace</code>.
+ */
+ public AttributeModel getModel(Workspace workspace);
+
+ /**
+ * Create a new model independent from any <code>Workspace</code>. The model
+ * can be used indepedently and then merged in another model.
+ *
+ * @return a new independent model
+ * @see AttributeModel#mergeModel(org.gephi.data.attributes.api.AttributeModel)
+ */
+ public AttributeModel newModel();
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeEvent.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeEvent.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeEvent.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,94 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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;
+
+/**
+ * Attribute event interface, that {@link AttributeListener } receives when the
+ * attribute model or any attribute row is modified.
+ * <p>
+ * <ul>
+ * <li><b>ADD_COLUMN:</b> One or several columns have been created, look at
+ * {@link AttributeEventData#getAddedColumns() } to get data.</li>
+ * <li><b>REMOVE_COLUMN:</b> One or several columns have been removed, look at
+ * {@link AttributeEventData#getRemovedColumns() } to get data.</li>
+ * <li><b>SET_VALUE:</b> A value has been set in a row, look at*
+ * {@link AttributeEventData#getTouchedValues()} to get new values and
+ * {@link AttributeEventData#getTouchedObjects() } to get objects where value
+ * has been modified.</li>
+ * </ul>
+ *
+ * @author Mathieu Bastian
+ */
+public interface AttributeEvent {
+
+ /**
+ * Attribute model events.
+ * <ul>
+ * <li><b>ADD_COLUMN:</b> One or several columns have been created, look at
+ * {@link AttributeEventData#getAddedColumns() } to get data.</li>
+ * <li><b>REMOVE_COLUMN:</b> One or several columns have been removed, look at
+ * {@link AttributeEventData#getRemovedColumns() } to get data.</li>
+ * <li><b>SET_VALUE:</b> A value has been set in a row, look at*
+ * {@link AttributeEventData#getTouchedValues()} to get new values and
+ * {@link AttributeEventData#getTouchedObjects() } to get objects where value
+ * has been modified.</li>
+ * </ul>
+ */
+ public enum EventType {
+
+ ADD_COLUMN, REMOVE_COLUMN, SET_VALUE
+ };
+
+ public EventType getEventType();
+
+ public AttributeTable getSource();
+
+ public AttributeEventData getData();
+
+ /**
+ * Returns <code>true</code> if this event is one of these in parameters.
+ * @param type the event types that are to be compared with this event
+ * @return <code>true</code> if this event is <code>type</code>,
+ * <code>false</code> otherwise
+ */
+ public boolean is(EventType... type);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeEventData.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeEventData.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeEventData.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,82 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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;
+
+/**
+ * Data associated with an attribute event.
+ *
+ * @author Mathieu Bastian
+ * @see AttributeEvent
+ */
+public interface AttributeEventData {
+
+ /**
+ * Returns columns that have been added. Look at {@link AttributeEvent#getSource() }
+ * to know to which <code>AttributeTable</code>.
+ * @return the added columns
+ */
+ public AttributeColumn[] getAddedColumns();
+
+ /**
+ * Returns columns that have been removed. Look at {@link AttributeEvent#getSource() }
+ * to know from which <code>AttributeTable</code>.
+ * @return the removed columns
+ */
+ public AttributeColumn[] getRemovedColumns();
+
+ /**
+ * Returns objects where attribute values have been modified. Objects are
+ * either <code>NodeData</code> or <code>EdgeData</code>. The index of the
+ * returned array is matching with values from <code>getTouchedValues()</code>.
+ * @return the objects modified with the <code>SET_VALUE</code>
+ * event
+ */
+ public Object[] getTouchedObjects();
+
+ /**
+ * Returns values with the <code>SET_VALUE</code> event. The
+ * <code>AttributeValue</code> object contains the new value that has been set.
+ * The index of the array is matching with values from <code>getTouchedObjects()</code>.
+ * @return the new values set with the <code>SET_VALUE</code> event.
+ */
+ public AttributeValue[] getTouchedValues();
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeListener.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeListener.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeListener.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,55 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.util.EventListener;
+
+/**
+ * Listener for attribute events.
+ *
+ * @author Mathieu Bastian
+ * @see AttributeEvent
+ */
+public interface AttributeListener extends EventListener {
+
+ public void attributesChanged(AttributeEvent event);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeModel.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeModel.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeModel.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,139 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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;
+
+/**
+ * Represents the data model, like a standard database would do. As a database,
+ * contains a list of tables, where columns are defined. By default, a model
+ * owns a <b>node</b> and <b>edge</b> table, but more could exist, depending
+ * of the model implementation.
+ * <p>
+ * The model also provides factories that are linked to this model. Use row
+ * factory to build new rows and value factory to push new values to these
+ * rows. Columns are manipulated from the <code>AttributeTable</code> class.
+ *
+ * @author Mathieu Bastian
+ * @see AttributeController
+ */
+public interface AttributeModel {
+
+ /**
+ * Returns the <b>node</b> table. Contains all the columns associated to
+ * node elements.
+ * <p>
+ * An <code>AttributeModel</code> has always <b>node</b> and <b>edge</b>
+ * tables by default.
+ *
+ * @return the node table, contains node columns
+ */
+ public AttributeTable getNodeTable();
+
+ /**
+ * Returns the <b>edge</b> table. Contains all the columns associated to
+ * edge elements.
+ * <p>
+ * An <code>AttributeModel</code> has always <b>node</b> and <b>edge</b>
+ * tables by default.
+ *
+ * @return the edge table, contains edge columns
+ */
+ public AttributeTable getEdgeTable();
+
+ /**
+ * Returns the <code>AttributeTable</code> which has the given <code>name</code>
+ * or <code>null</code> if this table doesn't exist.
+ *
+ * @param name the table's name
+ * @return the table that has been found, or <code>null</code>
+ */
+ public AttributeTable getTable(String name);
+
+ /**
+ * Returns all tables this model contains. By default, only contains
+ * <b>node</b> and <b>edge</b> tables.
+ *
+ * @return all the tables of this model
+ */
+ public AttributeTable[] getTables();
+
+ /**
+ * Return the value factory.
+ *
+ * @return the value factory
+ */
+ public AttributeValueFactory valueFactory();
+
+ /**
+ * Returns the row factory.
+ *
+ * @return the row factory
+ */
+ public AttributeRowFactory rowFactory();
+
+ /**
+ * Adds <code>listener</code> to the listeners of this table. It receives
+ * events when columns are added or removed, as well as when values are set.
+ * @param listener the listener that is to be added
+ */
+ public void addAttributeListener(AttributeListener listener);
+
+ /**
+ * Removes <code>listener</code> to the listeners of this table.
+ * @param listener the listener that is to be removed
+ */
+ public void removeAttributeListener(AttributeListener listener);
+
+ /**
+ * Merge <code>model</code> in this model. Makes the union of tables and
+ * columns of both models. Copy tables this model don't
+ * have and merge existing ones. For existing tables, call
+ * {@link AttributeTable#mergeTable(AttributeTable)}
+ * to merge columns.
+ * <p>
+ * Columns are compared according to their <code>id</code> and <code>type</code>.
+ * Columns found in <code>model</code> are appended only if they no column
+ * exist with the same <code>id</code> and <code>type</code>.
+ *
+ * @param model the model that is to be merged in this model
+ */
+ public void mergeModel(AttributeModel model);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeOrigin.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeOrigin.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeOrigin.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,66 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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.api;
+
+/**
+ * Meta-data that describes the origin of columns content. Default value is <b>DATA</b>.
+ * <ul><li><b>PROPERTY:</b> The attribute is a static field like Label, X or Y.</li>
+ * <li><b>DATA:</b> The attribute is a normal associated data to the object.</li>
+ * <li><b>COMPUTED:</b> The attribute has been computed during the program execution.</li></ul>
+ * <p>
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ */
+public enum AttributeOrigin {
+
+ PROPERTY("AttributeOrigin_property"),
+ DATA ("AttributeOrigin_data"),
+ COMPUTED("AttributeOrigin_computed"),
+ DELEGATE(null);
+
+ private final String label;
+
+ AttributeOrigin(String label) {
+ this.label = label;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeRow.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeRow.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeRow.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,192 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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 org.gephi.graph.api.Attributes;
+import org.gephi.graph.api.EdgeData;
+import org.gephi.graph.api.NodeData;
+
+/**
+ * Rows contains {@link AttributeValue}, one for each column. Rows are
+ * not stored in columns and nor in tables, they are stored in the object that
+ * possess the row, for instance <code>Nodes</code> or <code>Edges</code>.
+ * <p>
+ * But colums are fixed, stored in <code>AttributeTable</code>. Rows always
+ * contains the values in the same order as columns are described in the table.
+ * <p>
+ * For instance, if an table contains a single column <b>label</b>, the column
+ * index is equal to <b>0</b> and the value can be retrieved in the following ways:
+ * <ul>
+ * <li><code>row.getValue(column);</code></li>
+ * <li><code>row.getValue("label");</code></li>
+ * <li><code>row.getValue(0);</code></li>
+ * </ul>
+ * Rows are build from a {@link AttributeRowFactory}, that can be get from the
+ * {@link AttributeModel}.
+ * <h3>Nodes and edges</h3>
+ * Nodes and edges elements are build from <b>Graph API</b>, and already have a
+ * default row that can be found with {@link NodeData#getAttributes()} and
+ * {@link EdgeData#getAttributes()}. Please cast <code>Attributes</code> in
+ * <code>AttributesRow</code> to profit from the complete API.
+ *
+ * @author Mathieu Bastian
+ * @author Cezary Bartosiak
+ * @see AttributeColumn
+ * @see AttributeTable
+ * @see AttributeValue
+ */
+public interface AttributeRow extends Attributes {
+
+ /**
+ * Resets all data in the row.
+ */
+ public void reset();
+
+ /**
+ * Returns the number of values this rows contains. Equal to the number of
+ * columns of the <code>AttributeTable</code> this row belongs.
+ *
+ * @return the size of the values array
+ */
+ public int countValues();
+
+ /**
+ * Sets values from another row. Values must have existing column in the
+ * current table.
+ *
+ * @param row an existing row that may refer to the same columns
+ */
+ public void setValues(AttributeRow row);
+
+ /**
+ * Sets a value for this row. If the <code>column</code> retrieved from
+ * <code>value</code> cannot be found at the same index, the column
+ * <code>Id</code> is used to find the column.
+ *
+ * @param value a value that refers to an existing column for this row
+ */
+ public void setValue(AttributeValue value);
+
+ /**
+ * Sets a value at the specified column index.
+ *
+ * @param column a column that exists for this row
+ * @param value the value that is to be set a the specified column index
+ */
+ public void setValue(AttributeColumn column, Object value);
+
+ /**
+ * Sets a value at the specified column index, if column is found. The
+ * column is found if <code>column</code> refers to an existing column
+ * <code>id</code> or <code>title</code>.
+ *
+ * @param column a column <code>id</code> or <code>title</code>
+ * @param value the value that is to be set if <code>column</code> is found
+ */
+ public void setValue(String column, Object value);
+
+ /**
+ * Sets a value at the specified column index, if <code>index</code> is in
+ * range. This is equivalent as
+ * <code>setValue(AttributeColumn.getIndex(), Object)</code>.
+ *
+ * @param index a valid column index
+ * @param value the value that is to be set if <code>index</code> is valide
+ */
+ public void setValue(int index, Object value);
+
+ /**
+ * Returns the value found at the specified column index. May return
+ * <code>null</code> if the value is <code>null</code> or if the column
+ * doesn't exist.
+ *
+ * @param column a column that exists for this row
+ * @return the value found at the specified column index or
+ * <code>null</code> otherwise
+ */
+ public Object getValue(AttributeColumn column);
+
+ /**
+ * Returns the value at the specified column, if found. The
+ * column is found if <code>column</code> refers to an existing column
+ * <code>id</code> or <code>title</code>.
+ *
+ * @param column a column <code>id</code> or <code>title</code>
+ * @return the value found at the specified column or
+ * <code>null</code> otherwise
+ */
+ public Object getValue(String column);
+
+ /**
+ * Returns the value at the specified index, if <code>index</code> is in range.
+ * This is equivalent as <code>getValue(AttributeColumn.getIndex())</code>.
+ *
+ * @param index a valid column index
+ * @return the value found at the specified column or
+ * <code>null</code> otherwise
+ * @see AttributeColumn#getIndex()
+ */
+ public Object getValue(int index);
+
+ /**
+ * Returns the value array. Each <code>AttributeValue</code> is a pair between
+ * a data and the column it belongs.
+ *
+ * @return the value array of this row
+ */
+ public AttributeValue[] getValues();
+
+ /**
+ * Returns the value at given index or null if the index is not valid. Each <code>AttributeValue</code> is a pair between
+ * a data and the column it belongs.
+ * @param index
+ * @return AttributeValue at given index or null if the index is not valid
+ */
+ public AttributeValue getAttributeValueAt(int index);
+
+ /**
+ * Returns the column at given index or null if the index is not valid
+ * @param index
+ * @return AttributeColumn at given index or null if the index is not valid
+ */
+ public AttributeColumn getColumnAt(int index);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeRowFactory.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeRowFactory.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeRowFactory.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,80 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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 org.gephi.graph.api.EdgeData;
+import org.gephi.graph.api.NodeData;
+
+/**
+ * Factory which is building exclusively {@link AttributeRow}. It can be get
+ * from the {@link AttributeModel#rowFactory()}.
+ *
+ * @author Mathieu Bastian
+ */
+public interface AttributeRowFactory {
+
+ /**
+ * Returns a new row for the <b>node</b> table.
+ *
+ * @return a newly created row for the node table
+ * @see AttributeModel#getNodeTable()
+ */
+ public AttributeRow newNodeRow(NodeData nodeData);
+
+ /**
+ * Returns a new row for the <b>edge</b> table.
+ *
+ * @return a newly created row for the edge table
+ * @see AttributeModel#getEdgeTable()
+ */
+ public AttributeRow newEdgeRow(EdgeData edgeData);
+
+ /**
+ * Returns a new row for the given <code>tableName</code>, or <code>null</code>
+ * if no table with this name exists.
+ *
+ * @return a newly created row for the given table, or <code>null</code>
+ * otherwise
+ * @see AttributeModel#getTable(java.lang.String)
+ */
+ public AttributeRow newRowForTable(String tableName, Object object);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeTable.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeTable.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeTable.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,203 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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.api;
+
+import org.gephi.data.attributes.spi.AttributeValueDelegateProvider;
+import org.gephi.data.properties.PropertiesColumn;
+
+/**
+ * Table hosts columns and permits all manipulation on them. Columns can be
+ * appened with different level of details. The table maintains a map with
+ * column identifier and title (header) in order they can be retrieved efficiently.
+ * <p>
+ * Tracking added or removed columns can be performed by adding an
+ * {@link AttributeListener} to this table.
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ * @see AttributeColumn
+ * @see AttributeRow
+ */
+public interface AttributeTable {
+
+ /**
+ * Returns the name of this table.
+ *
+ * @return the name of this table
+ */
+ public String getName();
+
+ /**
+ * Returns the current columns. Call this method to iterate over columns.
+ *
+ * @return the current columns.
+ */
+ public AttributeColumn[] getColumns();
+
+ /**
+ * Returns the number of column in this table.
+ *
+ * @return the number of columns
+ */
+ public int countColumns();
+
+ /**
+ * <p>Creates and add a new column to this table. The default origin is set at <code>DATA</code>.</p>
+ * <p>The title of the column is the identifier.</p>
+ * @param id the identifier of the column
+ * @param type the type of the column
+ * @return the newly created column
+ */
+ public AttributeColumn addColumn(String id, AttributeType type);
+
+ /**
+ * <p>Creates and add a new column to this table.</p>
+ * <p>The title of the column is the identifier.</p>
+ * @param id the identifier of the column
+ * @param type the type of the column
+ * @param origin the origin of the column
+ * @return the newly created column
+ */
+ public AttributeColumn addColumn(String id, AttributeType type, AttributeOrigin origin);
+
+ /**
+ * <p>Creates and add a new column to this table.</p>
+ * <p>The title can't be null, empty or already existing in the table</p>
+ * @param id the identifier of the column
+ * @param title the title of the column
+ * @param type the type of the column
+ * @param origin the origin of the column.
+ * @param defaultValue the default value of the column.
+ * @return the newly created column
+ */
+ public AttributeColumn addColumn(String id, String title, AttributeType type, AttributeOrigin origin, Object defaultValue);
+
+ /**
+ * <p>Creates and add a new column to this table.</p>
+ * <p>The title can't be null, empty or already existing in the table</p>
+ * <p>Attribute origin will be set to AttributeOrigin.DELEGATE.</p> *
+ * @param id the identifier of the column
+ * @param title the title of the column
+ * @param type the type of the column
+ * @param attributeValueDelegateProvider the attribute value delegate provider of the column
+ * @param defaultValue the default value of the column
+ * @return the newly created column
+ */
+ public AttributeColumn addColumn(String id, String title, AttributeType type, AttributeValueDelegateProvider attributeValueDelegateProvider, Object defaultValue);
+
+ /**
+ * Creates and add a new properties column to this table. All needed informations are set in
+ * PropertiesColumn enum instance. *
+ * @param propertiesColumn the properties column
+ * @return the newly created column
+ */
+ public AttributeColumn addPropertiesColumn(PropertiesColumn propertiesColumn);
+
+ /**
+ * If exists, remove the column and all rows values.
+ *
+ * @param column the column that is to be removed
+ */
+ public void removeColumn(AttributeColumn column);
+
+ /**
+ * If exists, replace <code>source</code> by the new column created from params.
+ * @param source the column that is to be removed
+ * @param id the identifier of the column
+ * @param title the title of the column
+ * @param type the type of the column
+ * @param defaultValue the default value of the column
+ * @return the newly created column, or
+ * <code>null</code> if <code>source</code> can't be found
+ */
+ public AttributeColumn replaceColumn(AttributeColumn source, String id, String title, AttributeType type, AttributeOrigin origin, Object defaultValue);
+
+ /**
+ * Gets the column at the <code>index</code> of <code>null</code> if the
+ * index is not valid.
+ *
+ * @param index a valid column index range
+ * @return the column, or <code>null</code> if not found
+ */
+ public AttributeColumn getColumn(int index);
+
+ /**
+ * Gets the column with the given identifier or <code>null</code> if it is
+ * not found.
+ *
+ * @param id the column <code>id</code> or <code>title</code>
+ * @return the column, or <code>null</code> if not found
+ */
+ public AttributeColumn getColumn(String id);
+
+ /**
+ * Gets the column which match the given parameters or <code>null</code>
+ * if it is not found.
+ *
+ * @param title the column <code>id</code> or <code>title</code>
+ * @param type the column <code>type</code>
+ * @return the column, or <code>null</code> if not found
+ */
+ public AttributeColumn getColumn(String title, AttributeType type);
+
+ /**
+ * Return <code>true</code> if this table has a column with the given
+ * <code>title</code> or <code>id</code>.
+ *
+ * @param title the column <code>title</code> that is to be searched
+ * @return <code>true</code> if found, or <code>false</code>
+ * otherwise
+ */
+ public boolean hasColumn(String title);
+
+ /**
+ * Merge this table with the given <code>table</code> given. New columns from
+ * <code>table</code> are added to this table.
+ * <p>
+ * Columns are compared according to their <code>id</code> and <code>type</code>.
+ * Columns found in <code>model</code> are appended only if they no column
+ * exist with the same <code>id</code> and <code>type</code>.
+ *
+ * @param table the table that is to be merged with this table
+ */
+ public void mergeTable(AttributeTable table);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeType.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeType.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeType.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,595 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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.BigInteger;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Pattern;
+import org.gephi.data.attributes.type.DynamicByte;
+import org.gephi.data.attributes.type.DynamicShort;
+import org.gephi.data.attributes.type.DynamicInteger;
+import org.gephi.data.attributes.type.DynamicLong;
+import org.gephi.data.attributes.type.DynamicFloat;
+import org.gephi.data.attributes.type.DynamicDouble;
+import org.gephi.data.attributes.type.DynamicBoolean;
+import org.gephi.data.attributes.type.DynamicCharacter;
+import org.gephi.data.attributes.type.DynamicString;
+import org.gephi.data.attributes.type.DynamicBigInteger;
+import org.gephi.data.attributes.type.DynamicBigDecimal;
+import org.gephi.data.attributes.type.TimeInterval;
+import org.gephi.data.attributes.type.ByteList;
+import org.gephi.data.attributes.type.ShortList;
+import org.gephi.data.attributes.type.IntegerList;
+import org.gephi.data.attributes.type.LongList;
+import org.gephi.data.attributes.type.FloatList;
+import org.gephi.data.attributes.type.DoubleList;
+import org.gephi.data.attributes.type.BooleanList;
+import org.gephi.data.attributes.type.CharacterList;
+import org.gephi.data.attributes.type.StringList;
+import org.gephi.data.attributes.type.BigIntegerList;
+import org.gephi.data.attributes.type.BigDecimalList;
+import org.gephi.data.attributes.type.DynamicType;
+import org.gephi.data.attributes.type.Interval;
+
+/**
+ * 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 <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 date:
+ low =parseDateToDouble(parts[0]);
+ } catch (ParseException ex) {
+ low = Double.parseDouble(parts[0]);
+ }
+ try {
+ //Try first to parse as a date:
+ high =parseDateToDouble(parts[1]);
+ } catch (ParseException ex) {
+ high = Double.parseDouble(parts[1]);
+ }
+ 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]*");
+
+ private static double parseDateToDouble(String date) throws ParseException {
+ Date d = dateFormat.parse(date);
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(d);
+ return cal.getTimeInMillis();
+ }
+ private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeUtils.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeUtils.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeUtils.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,128 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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.api;
+
+import java.util.GregorianCalendar;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ */
+public abstract class AttributeUtils {
+
+ public abstract boolean isNodeColumn(AttributeColumn column);
+
+ public abstract boolean isEdgeColumn(AttributeColumn column);
+
+ public abstract boolean isColumnOfType(AttributeColumn column, AttributeType type);
+
+ public abstract boolean areAllColumnsOfType(AttributeColumn[] columns, AttributeType type);
+
+ public abstract boolean areAllColumnsOfSameType(AttributeColumn[] columns);
+
+ public abstract boolean isStringColumn(AttributeColumn column);
+
+ public abstract boolean areAllStringColumns(AttributeColumn[] columns);
+
+ public abstract boolean isNumberColumn(AttributeColumn column);
+
+ public abstract boolean areAllNumberColumns(AttributeColumn[] columns);
+
+ public abstract boolean isNumberListColumn(AttributeColumn column);
+
+ public abstract boolean areAllNumberListColumns(AttributeColumn[] columns);
+
+ public abstract boolean isNumberOrNumberListColumn(AttributeColumn column);
+
+ public abstract boolean areAllNumberOrNumberListColumns(AttributeColumn[] columns);
+
+ public abstract boolean isDynamicNumberColumn(AttributeColumn column);
+
+ public abstract boolean areAllDynamicNumberColumns(AttributeColumn[] columns);
+
+ public abstract AttributeColumn[] getNumberColumns(AttributeTable table);
+
+ public abstract AttributeColumn[] getStringColumns(AttributeTable table);
+
+ public abstract AttributeColumn[] getAllCollums(AttributeModel model);
+
+ @SuppressWarnings("rawtypes")
+ public abstract Comparable getMin(AttributeColumn column, Comparable[] values);
+
+ @SuppressWarnings("rawtypes")
+ public abstract Comparable getMax(AttributeColumn column, Comparable[] values);
+
+ public static synchronized AttributeUtils getDefault() {
+ return Lookup.getDefault().lookup(AttributeUtils.class);
+ }
+
+ /**
+ * Used for export (writes XML date strings).
+ *
+ * @param d a double to convert from
+ *
+ * @return an XML date string.
+ *
+ * @throws IllegalArgumentException if {@code d} is infinite.
+ */
+ public static String getXMLDateStringFromDouble(double d) {
+ try {
+ DatatypeFactory dateFactory = DatatypeFactory.newInstance();
+ if (d == Double.NEGATIVE_INFINITY) {
+ return "-Infinity";
+ } else if (d == Double.POSITIVE_INFINITY) {
+ return "Infinity";
+ }
+ GregorianCalendar gc = new GregorianCalendar();
+ gc.setTimeInMillis((long) d);
+ return dateFactory.newXMLGregorianCalendar(gc).toXMLFormat().substring(0, 23);
+ } catch (DatatypeConfigurationException ex) {
+ Exceptions.printStackTrace(ex);
+ return "";
+ }
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeValue.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeValue.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeValue.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,70 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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;
+
+/**
+ * Cell that contains the value for a particular {@link AttributeColumn} and
+ * {@link AttributeRow}.
+ * <p>
+ * Cells are build from a {@link AttributeValueFactory}, that can be get from the
+ * {@link AttributeModel}.
+ *
+ * @author Mathieu Bastian
+ */
+public interface AttributeValue {
+
+ /**
+ * Returns the column this value belongs.
+ *
+ * @return the column this value belongs
+ */
+ public AttributeColumn getColumn();
+
+ /**
+ * Returns the value. May be <code>null</code> or equal to the column's
+ * default value.
+ *
+ * @return the value or <code>null</code>
+ * @see AttributeColumn#getDefaultValue()
+ */
+ public Object getValue();
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/AttributeValueFactory.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/AttributeValueFactory.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/AttributeValueFactory.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,63 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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;
+
+/**
+ * Factory which is building exclusively {@link AttributeValue}. It can be get
+ * from the {@link AttributeModel#valueFactory()}.
+ *
+ * @author Mathieu Bastian
+ */
+public interface AttributeValueFactory {
+
+ /**
+ * Returns a new cell value for the given <code>column</code> and
+ * <code>value</code>. The <code>value</code> can be <code>null</code>.
+ * <p>
+ * The <code>value</code> type should be compatible with the column type.
+ *
+ * @param column the column where the cell belongs
+ * @param value a compatible value, or <code>null</code>
+ * @return the new value for the given column
+ */
+ public AttributeValue newValue(AttributeColumn column, Object value);
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+OpenIDE-Module-Display-Category=Gephi Core
+OpenIDE-Module-Long-Description=\
+ Attributes API provides access to attributes values through an efficient column/row system.
+OpenIDE-Module-Name=Attributes API
+AttributeOrigin_property = Property
+AttributeOrigin_data = Data
+AttributeOrigin_computed_name = Computed
+OpenIDE-Module-Short-Description=API for storing and retrieving attributes
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_es.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_es.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_es.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,17 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-04 19\:12+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_fr.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_fr.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_fr.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,17 @@
+# 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\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-04 19\:12+0000\nLast-Translator\: gephi <sebastien.heymann@xxxxxxxxx>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ja.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ja.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ja.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,17 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-29 18\:30+0000\nLast-Translator\: sarang <kida.siro@xxxxxxxxx>\nLanguage-Team\: Japanese (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_oc.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_oc.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_oc.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,16 @@
+# Occitan (post 1500) translation for gephi
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the gephi package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2010-10-21 13\:36+0000\nLast-Translator\: C\u00e9dric VALMARY (Tot en \u00f2c) <cvalmary@xxxxxxxx>\nLanguage-Team\: Occitan (post 1500) <oc@xxxxxx>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:46+0000\nX-Generator\: Launchpad (build 12559)\n
+
+OpenIDE-Module-Long-Description=Attributes API balha acc\u00e8s a las valors d'atribut a trav\u00e8rs un sist\u00e8ma efica\u00e7 de linhas/colomnas.
+
+AttributeOrigin_property=Proprietat
+
+AttributeOrigin_data=Donada
+
+AttributeOrigin_computed_name=Calculat
+
+OpenIDE-Module-Short-Description=API d'emmagazinatge e de recuperacion d'atributs
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_pt_BR.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_pt_BR.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_pt_BR.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,17 @@
+# 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@xxxxxxxxx>, 2011.
+!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-05 16\:43+0000\nLast-Translator\: celiofariajr <celiofariajr@xxxxxxxxx>\nLanguage-Team\: Portuguese (Brazilian) (http\://www.transifex.net/projects/p/gephi/team/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
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ru.properties'
--- AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ru.properties 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Bundle_ru.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,16 @@
+# Russian translation for gephi
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the gephi package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2010-12-01 08\:22+0000\nLast-Translator\: Altsoph <Unknown>\nLanguage-Team\: Russian <ru@xxxxxx>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:46+0000\nX-Generator\: Launchpad (build 12559)\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
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/Estimator.java'
--- AttributesAPI/src/org/gephi/data/attributes/api/Estimator.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/Estimator.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,155 @@
+/*
+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.api;
+
+/**
+ * This enum is used to determine what should be done with "ties". For example
+ * if in the given time interval some attribute has got 3 different values we
+ * should know how to estimate its value.
+ *
+ * <p>The table below shows how the estimation is done for different types
+ * ({@code -} means {@code not specified}).
+ * <table>
+ * <tr>
+ * <td></td>
+ * <td><b>AVERAGE</b></td>
+ * <td><b>MEDIAN</b></td>
+ * <td><b>MODE</b></td>
+ * <td><b>SUM</b></td>
+ * <td><b>MIN</b></td>
+ * <td><b>MAX</b></td>
+ * <td><b>FIRST</b></td>
+ * <td><b>LAST</b></td>
+ * </tr>
+ * <tr>
+ * <td><b>Real numbers</b></td>
+ * <td>arithmetic mean</td>
+ * <td>the value separating the higher half from the lower half (if there is
+ * an even number of values, the median is then defined to be the mean of
+ * the two middle values)</td>
+ * <td>the value that occurs the most frequently</td>
+ * <td>the result of addition of all values</td>
+ * <td>the lowest value</td>
+ * <td>the highest value</td>
+ * <td>the value which occured firstly</td>
+ * <td>the value which occured lastly</td>
+ * </tr>
+ * <tr>
+ * <td><b>Integers</b></td>
+ * <td>arithmetic mean - using integer division</td>
+ * <td>the value separating the higher half from the lower half (if there is
+ * an even number of values, the median is then defined to be the mean of
+ * the two middle values - using integer division)</td>
+ * <td>the value that occurs the most frequently</td>
+ * <td>the result of addition of all values</td>
+ * <td>the lowest value</td>
+ * <td>the highest value</td>
+ * <td>the value which occured firstly</td>
+ * <td>the value which occured lastly</td>
+ * </tr>
+ * <tr>
+ * <td><b>Boolean</b></td>
+ * <td>-</td>
+ * <td>the bool separating the higher half from the lower half (if there is
+ * an even number of bools, the median is then defined to be the bool
+ * which occured earlier than the second middle bool)</td>
+ * <td>the bool that occurs the most frequently</td>
+ * <td>-</td>
+ * <td>false if exists in a given set of bools, otherwise true</td>
+ * <td>true if exists in a given set of bools, otherwise false</td>
+ * <td>the bool which occured firstly</td>
+ * <td>the bool which occured lastly</td>
+ * </tr>
+ * <tr>
+ * <td><b>Character</b></td>
+ * <td>-</td>
+ * <td>the character separating the higher half from the lower half (if there
+ * is an even number of characters, the median is then defined to be the
+ * character which occured earlier than the second middle character)</td>
+ * <td>the character that occurs the most frequently</td>
+ * <td>-</td>
+ * <td>the lowest character (with the lowest {@code int} value)</td>
+ * <td>the highest character (with the highest {@code int} value)</td>
+ * <td>the character which occured firstly</td>
+ * <td>the character which occured lastly</td>
+ * </tr>
+ * <tr>
+ * <td><b>String</b></td>
+ * <td>-</td>
+ * <td>the string separating the higher half from the lower half (if there
+ * is an even number of strings, the median is then defined to be the
+ * string which occured earlier than the second middle string)</td>
+ * <td>the string that occurs the most frequently</td>
+ * <td>-</td>
+ * <td>the lowest string (using {@code compareTo} method)</td>
+ * <td>the highest string (using {@code compareTo} method)</td>
+ * <td>the string which occured firstly</td>
+ * <td>the string which occured lastly</td>
+ * </tr>
+ * <tr>
+ * <td><b>TimeInterval</b></td>
+ * <td>-</td>
+ * <td>the time interval separating the higher half from the lower half (if
+ * there is an even number of time intervals, the median is then defined
+ * to be the time interval which occured earlier than the second middle
+ * time interval)</td>
+ * <td>the time interval that occurs the most frequently</td>
+ * <td>-</td>
+ * <td>-</td>
+ * <td>-</td>
+ * <td>the time interval which occured firstly</td>
+ * <td>the time interval which occured lastly</td>
+ * </tr>
+ * </table>
+ *
+ * @author Cezary Bartosiak
+ */
+public enum Estimator {
+ AVERAGE,
+ MEDIAN,
+ MODE,
+ SUM,
+ MIN,
+ MAX,
+ FIRST,
+ LAST
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/es.po'
--- AttributesAPI/src/org/gephi/data/attributes/api/es.po 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/es.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,38 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/fr.po'
--- AttributesAPI/src/org/gephi/data/attributes/api/fr.po 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/fr.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,38 @@
+# 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://bugs.launchpad.net/gephi\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@xxxxxxxxx>\n"
+"Language-Team: French (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/ja.po'
--- AttributesAPI/src/org/gephi/data/attributes/api/ja.po 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/ja.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,36 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-29 18:30+0000\n"
+"Last-Translator: sarang <kida.siro@xxxxxxxxx>\n"
+"Language-Team: Japanese (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/org-gephi-data-attributes-api.pot'
--- AttributesAPI/src/org/gephi/data/attributes/api/org-gephi-data-attributes-api.pot 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/org-gephi-data-attributes-api.pot 2012-04-11 14:38:21 +0000
@@ -0,0 +1,33 @@
+# Translation file for Gephi.
+# Copyright (C) 2011 Gephi contributors.
+# This file is distributed under the same license as the Gephi package.
+# Gephi Team <gephi.team@xxxxxxxxxxxxxxxxxxx>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi 0.8\n"
+"Report-Msgid-Bugs-To: gephi.team@xxxxxxxxxxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-05 14:52+0200\n"
+"Last-Translator: Mathieu Bastian <gephi.team@xxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: English <https://launchpad.net/~gephi.team>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "OpenIDE-Module-Long-Description"
+msgstr ""
+"Attributes API provides access to attributes values through an efficient "
+"column/row system."
+
+msgid "AttributeOrigin_property"
+msgstr "Property"
+
+msgid "AttributeOrigin_data"
+msgstr "Data"
+
+msgid "AttributeOrigin_computed_name"
+msgstr "Computed"
+
+msgid "OpenIDE-Module-Short-Description"
+msgstr "API for storing and retrieving attributes"
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/package.html'
--- AttributesAPI/src/org/gephi/data/attributes/api/package.html 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/package.html 2012-04-11 14:38:21 +0000
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <body bgcolor="white">
+ General API that defines the data structure, attributes associated to elements.
+ <p>
+ Gephi uses <b>Attribute API</b> to store all data for elements (nodes, edges)
+ that are specific to the data manipulated - i.e. imported from a file
+ or a datasource.
+ </p>
+ <p>
+ The <code>AttributeController</code> is managing models and is the
+ access door to the system. This controller is a service, and can be
+ retrieved by using the following command:
+ </p>
+ <p><code>AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);</code></p>
+ <p>
+ Using the Attributes API, it is possible to add data columns of any type,
+ and push data to rows dynamically.
+ </p>
+ </body>
+</html>
=== added file 'AttributesAPI/src/org/gephi/data/attributes/api/pt_BR.po'
--- AttributesAPI/src/org/gephi/data/attributes/api/pt_BR.po 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/api/pt_BR.po 2012-04-11 14:38:21 +0000
@@ -0,0 +1,38 @@
+# 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@xxxxxxxxx>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: Gephi\n"
+"Report-Msgid-Bugs-To: https://bugs.launchpad.net/gephi\n"
+"POT-Creation-Date: 2011-08-05 14:52+0200\n"
+"PO-Revision-Date: 2011-08-05 16:43+0000\n"
+"Last-Translator: celiofariajr <celiofariajr@xxxxxxxxx>\n"
+"Language-Team: Portuguese (Brazilian) (http://www.transifex.net/projects/p/gephi/team/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"
+
+
=== added directory 'AttributesAPI/src/org/gephi/data/attributes/spi'
=== added file 'AttributesAPI/src/org/gephi/data/attributes/spi/AttributeValueDelegateProvider.java'
--- AttributesAPI/src/org/gephi/data/attributes/spi/AttributeValueDelegateProvider.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/spi/AttributeValueDelegateProvider.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,183 @@
+/*
+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.spi;
+
+
+import org.gephi.data.attributes.api.AttributeColumn;
+
+
+/**
+ * <h3>General information</h3>
+ * Provider for delegating attribute value. Using this interface it is possible to delegate the real
+ * value of AttributeValue object to database (relational, graph, ...), index/search engine, ...
+ * <br>
+ * For every node/edge it is possible to add, get, set and remove every attribute value.
+ *
+ * <h3>Implementation details</h3>
+ * As of implementation detail of AttributeValue immutability, both adding and setting the attribute value is done through the
+ * set[Edge|Node]AttributeValue() method, so it is absolutely necessary to treat both cases in the method body.
+ * <br>
+ * Every method takes at least 2 arguments:
+ * <ul>
+ * <li>delegate id
+ * <li>attribute column
+ * </ul>
+ * Delegate id is any type of object necessary to get the right node/edge. For instance for Neo4j it is of type Long,
+ * which is directly used as Neo4j node/relationship id. For other storing engines which require indexing key and
+ * value it could be crate (wrapper object) wrapping both values with proper types.
+ * <br>
+ * Attribute column is used usually for getting the column id which is used as property name.
+ *
+ * <h3>Automatic and manual type conversions</h3>
+ * Important thing about the whole delegating process is type conversion. It is clear that there might exist type mismatch
+ * between Gephi types and types which are supported in storing engine. During implementation it is necessary to fulfill
+ * following requirements:
+ * <ul>
+ * <li>get[Edge|Node]AttributeValue() method must return any of primitive types, String or array of these types. The
+ * conversion from array type into appropriate List type is done automatically using ListFactory method.
+ * <li>set[Edge|Node]AttributeValue() can accept any of Gephi supported types described in AttributeType constructors
+ * as class objects. It is up to the Provider to make appropriate conversion if this is needed, especially conversion
+ * from List types.
+ * </ul>
+ *
+ * <h3>Usage</h3>
+ * Every AttributeColumn has direct link to its own AttributeValueDelegateProvider. This means that it is possible to
+ * have more Providers in the same AttributeTable, each delegating from a subset of all columns. And because the fact
+ * that every AttributeValue has link to its AttributeColumn, it has direct access to its Provider too.
+ * <br>
+ * Provider will be called for getting value for every AttributeValue which has column with AttributeOrigin.DELEGATE.
+ * The first setValue() method call on Attributes/AttributeRow will set the delegate id and every other will change
+ * data in storing engine.
+ *
+ * <h3>Best practises</h3>
+ * Every implementing class should be implemented as singleton because of memory savings. This singleton should be
+ * passed during populating AttributeTable / creating columns.
+ * <br>
+ * Any other necessary implementation information / resources (as concrete database instance) should be set using
+ * static methods.
+ * <br>
+ * Any necessary convertor described in <b>Automatic and manual type conversions</b> should be implemented as static
+ * inner class.
+ *
+ * @author Martin Škurla
+ *
+ * @param <T> type parameter used to restrict delegate id type
+ */
+public abstract class AttributeValueDelegateProvider<T> {
+ /**
+ * Returns the delegated node attribute value.
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ *
+ * @return delegated node attribute value
+ */
+ public abstract Object getNodeAttributeValue(T delegateId, AttributeColumn attributeColumn);
+
+ /**
+ * Adds or sets the delegated node attribute value. It is necessary to treat both cases in the method body!
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ * @param nodeValue new/changed delegated node attribute value
+ */
+ public abstract void setNodeAttributeValue(T delegateId, AttributeColumn attributeColumn, Object nodeValue);
+
+ /**
+ * Deletes the delegated node attribute value.
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ */
+ public abstract void deleteNodeAttributeValue(T delegateId, AttributeColumn attributeColumn);
+
+ /**
+ * Returns the delegated edge attribute value.
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ *
+ * @return delegated edge attribute value
+ */
+ public abstract Object getEdgeAttributeValue(T delegateId, AttributeColumn attributeColumn);
+
+ /**
+ * Adds or sets the delegated edge attribute value. It is necessary to treat both cases in the method body!
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ * @param nodeValue new/changed delegated edge attribute value
+ */
+ public abstract void setEdgeAttributeValue(T delegateId, AttributeColumn attributeColumn, Object edgeValue);
+
+ /**
+ * Deletes the delegated edge attribute value.
+ *
+ * @param delegateId delegate id
+ * @param attributeColumn attribute column
+ */
+ public abstract void deleteEdgeAttributeValue(T delegateId, AttributeColumn attributeColumn);
+
+ /**
+ * Returns name of storage engine. This is used when graph uses more storage engines and where must be an
+ * option how to differ them in GUI.
+ *
+ * @return name of storage engine
+ */
+ public abstract String storageEngineName();//TODO >>> add documentation for these two methods
+
+ public abstract GraphItemDelegateFactoryProvider<T> graphItemDelegateFactoryProvider();
+
+
+ @Override//TODO >>> add documentation about this usage for hashing, ...
+ public final boolean equals(Object obj) {
+ if (!(obj instanceof AttributeValueDelegateProvider))
+ return false;
+
+ return ((AttributeValueDelegateProvider) obj).storageEngineName().equals(this.storageEngineName());
+ }
+
+ @Override
+ public final int hashCode() {
+ return storageEngineName().hashCode();
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/spi/GraphItemDelegateFactoryProvider.java'
--- AttributesAPI/src/org/gephi/data/attributes/spi/GraphItemDelegateFactoryProvider.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/spi/GraphItemDelegateFactoryProvider.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,58 @@
+/*
+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.spi;
+
+/**
+ *
+ * @author Martin Škurla
+ * @param <T>
+ */
+public interface GraphItemDelegateFactoryProvider<T> {
+
+ T createNode();
+
+ void deleteNode(T nodeId);
+
+ T createEdge(T startNodeId, T endNodeId);
+
+ void deleteEdge(T edgeId);
+}
=== added directory 'AttributesAPI/src/org/gephi/data/attributes/type'
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/AbstractList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/AbstractList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/AbstractList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,200 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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.Arrays;
+
+/**
+ * Complex type that defines list of any type of items. Can be created from an array or from single
+ * string using either given or default separators. Internal representation of data is array of generic
+ * type. This means that every primitive type must be first converted into wrapper type. The exact
+ * conversion process from String value into given type is done by {@link TypeConvertor TypeConvertor}
+ * class.
+ *
+ * <br/><br/>
+ * <h3>Design guidelines</h3>
+ * This is a basic abstract class that every other 'List' class should extend. In order to not misuse
+ * the API, every extending type should be one of the following:
+ * <ul>
+ * <li>helper type which restricts the type parameter and possibly brings some new functionality (e.g.
+ * {@link NumberList NumberList}). This is not final usable type so it should be declared as abstract.
+ * <li>final type that extends any of defined helper types or basic class and sets the type parameter
+ * (e.g. there are types for representing all primitive types, String, BigInteger & BigDecimal).
+ * These are final usable types so they should be declared as final.
+ * </ul>
+ *
+ * <h3>Flexibility</h3>
+ * The flexibility of this API is done in 2 ways:
+ * <ul>
+ * <li>We can add functionality by defining conversions from any other type in difference from general
+ * supported types through defining new constructors (e.g. {@link StringList StringList} class can
+ * be created from array of characters). We can also restrict the functionality (e.g. BigInteger &
+ * BigDecimal cannot be created from arrays of primitive types). The conversion process should be
+ * done by {@link TypeConvertor TypeConvertor} type if the conversion can be used in more List
+ * implementations or by 'private static T parseXXX()' method in appropriate List implementation if
+ * only this type uses the conversion (e.g. {@link StringList#parse}).
+ * <li>Any other functionality required from 'List' implementations should be done by implementing
+ * appropriate non-static methods in concrete 'List' implementations.
+ * </ul>
+ *
+ * <h3>Extensibility</h3>
+ * This API can be simply extended. New 'List' type should extend base or any helper 'List' type. We can
+ * create final 'List' implementations as well as helper 'list' implementations with appropriate modifiers
+ * (see Design Guidelines). We can define as many constructors responsible for conversions from other
+ * types and as many additional methods as we want.<br/>
+ * To fully integrate new 'List' type into the whole codebase we have to update following types:
+ * <ol>
+ * <li>{@link org.gephi.data.attributes.api.AttributeType AttributeType}:
+ * <ol>
+ * <li>add appropriate enum constants
+ * <li>update {@link org.gephi.data.attributes.api.AttributeType#parse(String str) parse(String)} method
+ * </ol>
+ * <li>{@link org.gephi.data.attributes.model.DataIndex DataIndex}:
+ * <ol>
+ * <li>add appropriate type represented by Class object into
+ * {@link org.gephi.data.attributes.model.DataIndex#SUPPORTED_TYPES SUPPORTED_TYPES} array
+ * </ol>
+ * </ol>
+ *
+ * This class defines {@link #size method for recognizing size} of the list and
+ * {@link #getItem method for getting item by index}.
+ *
+ * @param <T> type parameter defining final List type
+ *
+ * @author Martin Škurla
+ *
+ * @see TypeConvertor
+ */
+public abstract class AbstractList<T> {
+
+ public static final String DEFAULT_SEPARATOR = ",|;";
+ protected final T[] list;
+ private volatile int hashCode = 0;
+
+ public AbstractList(String input, Class<T> finalType) {
+ this(input, DEFAULT_SEPARATOR, finalType);
+ }
+
+ public AbstractList(String input, String separator, Class<T> finalType) {
+ this(TypeConvertor.<T>createArrayFromString(input, separator, finalType));
+ }
+
+ public AbstractList(T[] array) {
+ this.list = Arrays.copyOf(array, array.length);
+ }
+
+ public int size() {
+ return list.length;
+ }
+
+ public T getItem(int index) {
+ if (index >= list.length) {
+ return null;
+ }
+
+ return list[index];
+ }
+
+ public boolean contains(T value) {
+ for (int i = 0; i < list.length; i++) {
+ if (list[i].equals(value)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+
+ for (int i = 0; i < list.length; i++) {
+ builder.append(list[i]);
+ builder.append(',');
+ }
+
+ if (list.length > 0) {
+ builder.deleteCharAt(builder.length() - 1);
+ }
+
+ return builder.toString();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AbstractList<?>)) {
+ return false;
+ }
+
+ AbstractList<?> s = (AbstractList<?>) obj;
+
+ if (s.size() != this.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < list.length; i++) {
+ if (this.getItem(i) != s.getItem(i)) {
+ if (this.getItem(i)!=null&&!this.getItem(i).equals(s.getItem(i))) {
+ return false;
+ }else if(s.getItem(i)!=null&&!s.getItem(i).equals(this.getItem(i))){
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ if (hashCode == 0) {
+ int hash = 7;
+
+ for (int i = 0; i < list.length; i++) {
+ hash = 53 * hash + (this.list[i] != null ? this.list[i].hashCode() : 0);
+ }
+ hashCode = hash;
+ }
+ return hashCode;
+ }
+}
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/BigDecimalList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/BigDecimalList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/BigDecimalList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,65 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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.BigDecimal;
+
+/**
+ * Complex type that define a list of BigDecimal items. Can be created from a BigDecimal
+ * array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class BigDecimalList extends NumberList<BigDecimal> {
+
+ public BigDecimalList(BigDecimal[] array) {
+ super(array);
+ }
+
+ public BigDecimalList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public BigDecimalList(String input, String separator) {
+ super(input, separator, BigDecimal.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/BigIntegerList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/BigIntegerList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/BigIntegerList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,66 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of BigInteger items. Can be created from a BigInteger
+ * array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class BigIntegerList extends NumberList<BigInteger> {
+
+ public BigIntegerList(BigInteger[] array) {
+ super(array);
+ }
+
+ public BigIntegerList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public BigIntegerList(String input, String separator) {
+ super(input, separator, BigInteger.class);
+ }
+}
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/BooleanList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/BooleanList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/BooleanList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Boolean items. Can be created from a boolean
+ * array, from a Boolean array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class BooleanList extends AbstractList<Boolean> {
+
+ public BooleanList(boolean[] primitiveBooleanArray) {
+ super(TypeConvertor.<Boolean>convertPrimitiveToWrapperArray(primitiveBooleanArray));
+ }
+
+ public BooleanList(Boolean[] wrapperBooleanArray) {
+ super(wrapperBooleanArray);
+ }
+
+ public BooleanList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public BooleanList(String input, String separator) {
+ super(input, separator, Boolean.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/ByteList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/ByteList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/ByteList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Byte items. Can be created from a byte
+ * array, from a Byte array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class ByteList extends NumberList<Byte> {
+
+ public ByteList(byte[] primitiveByteArray) {
+ super(TypeConvertor.<Byte>convertPrimitiveToWrapperArray(primitiveByteArray));
+ }
+
+ public ByteList(Byte[] wrapperByteArray) {
+ super(wrapperByteArray);
+ }
+
+ public ByteList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public ByteList(String input, String separator) {
+ super(input, separator, Byte.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/CharacterList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/CharacterList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/CharacterList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Character items. Can be created from a char
+ * array, from a Character array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class CharacterList extends AbstractList<Character> {
+
+ public CharacterList(char[] primitiveCharArray) {
+ super(TypeConvertor.<Character>convertPrimitiveToWrapperArray(primitiveCharArray));
+ }
+
+ public CharacterList(Character[] wrapperCharArray) {
+ super(wrapperCharArray);
+ }
+
+ public CharacterList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public CharacterList(String input, String separator) {
+ super(input, separator, Character.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DoubleList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DoubleList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DoubleList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Double items. Can be created from a double
+ * array, from a Double array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class DoubleList extends NumberList<Double> {
+
+ public DoubleList(double[] primitiveDoubleArray) {
+ super(TypeConvertor.<Double>convertPrimitiveToWrapperArray(primitiveDoubleArray));
+ }
+
+ public DoubleList(Double[] wrapperDoubleArray) {
+ super(wrapperDoubleArray);
+ }
+
+ public DoubleList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public DoubleList(String input, String separator) {
+ super(input, separator, Double.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigDecimal.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigDecimal.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigDecimal.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,214 @@
+/*
+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.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link BigDecimal} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicBigDecimal extends DynamicType<BigDecimal> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicBigDecimal() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicBigDecimal(Interval<BigDecimal> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBigDecimal(List<Interval<BigDecimal>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicBigDecimal(DynamicBigDecimal source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicBigDecimal(DynamicBigDecimal source, Interval<BigDecimal> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicBigDecimal(DynamicBigDecimal source, Interval<BigDecimal> in, Interval<BigDecimal> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBigDecimal(DynamicBigDecimal source, List<Interval<BigDecimal>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicBigDecimal(DynamicBigDecimal source, List<Interval<BigDecimal>> in, List<Interval<BigDecimal>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public BigDecimal getValue(Interval interval, Estimator estimator) {
+ List<BigDecimal> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigDecimal total = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(values.get(i));
+ return total.divide(BigDecimal.valueOf(values.size()), RoundingMode.HALF_UP);
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigDecimal bd = values.get(values.size() / 2 - 1);
+ bd = bd.add(values.get(values.size() / 2));
+ return bd.divide(new BigDecimal(2));
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigDecimal sum = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(values.get(i));
+ return sum;
+ case MIN:
+ BigDecimal minimum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(values.get(i)) > 0)
+ minimum = values.get(i);
+ return minimum;
+ case MAX:
+ BigDecimal maximum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(values.get(i)) < 0)
+ maximum = values.get(i);
+ return maximum;
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return BigDecimal.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigInteger.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigInteger.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicBigInteger.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,213 @@
+/*
+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.math.BigInteger;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link BigInteger} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicBigInteger extends DynamicType<BigInteger> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicBigInteger() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicBigInteger(Interval<BigInteger> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBigInteger(List<Interval<BigInteger>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicBigInteger(DynamicBigInteger source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicBigInteger(DynamicBigInteger source, Interval<BigInteger> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicBigInteger(DynamicBigInteger source, Interval<BigInteger> in, Interval<BigInteger> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBigInteger(DynamicBigInteger source, List<Interval<BigInteger>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicBigInteger(DynamicBigInteger source, List<Interval<BigInteger>> in, List<Interval<BigInteger>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public BigInteger getValue(Interval interval, Estimator estimator) {
+ List<BigInteger> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigInteger total = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(values.get(i));
+ return total.divide(BigInteger.valueOf(values.size()));
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigInteger bi = values.get(values.size() / 2 - 1);
+ bi = bi.add(values.get(values.size() / 2));
+ return bi.divide(BigInteger.valueOf(2));
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigInteger sum = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(values.get(i));
+ return sum;
+ case MIN:
+ BigInteger minimum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(values.get(i)) > 0)
+ minimum = values.get(i);
+ return minimum;
+ case MAX:
+ BigInteger maximum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(values.get(i)) < 0)
+ maximum = values.get(i);
+ return maximum;
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return BigInteger.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicBoolean.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicBoolean.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicBoolean.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,204 @@
+/*
+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.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Boolean} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicBoolean extends DynamicType<Boolean> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicBoolean() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicBoolean(Interval<Boolean> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBoolean(List<Interval<Boolean>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicBoolean(DynamicBoolean source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicBoolean(DynamicBoolean source, Interval<Boolean> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicBoolean(DynamicBoolean source, Interval<Boolean> in, Interval<Boolean> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicBoolean(DynamicBoolean source, List<Interval<Boolean>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicBoolean(DynamicBoolean source, List<Interval<Boolean>> in, List<Interval<Boolean>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Boolean getValue(Interval interval, Estimator estimator) {
+ List<Boolean> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ return values.get(values.size() / 2 - 1);
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MIN:
+ Boolean minimum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(values.get(i)) > 0)
+ minimum = values.get(i);
+ return minimum;
+ case MAX:
+ Boolean maximum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(values.get(i)) < 0)
+ maximum = values.get(i);
+ return maximum;
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Boolean.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicByte.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicByte.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicByte.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,216 @@
+/*
+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.math.BigInteger;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Byte} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicByte extends DynamicType<Byte> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicByte() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicByte(Interval<Byte> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicByte(List<Interval<Byte>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicByte(DynamicByte source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicByte(DynamicByte source, Interval<Byte> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicByte(DynamicByte source, Interval<Byte> in, Interval<Byte> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicByte(DynamicByte source, List<Interval<Byte>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicByte(DynamicByte source, List<Interval<Byte>> in, List<Interval<Byte>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Byte getValue(Interval interval, Estimator estimator) {
+ List<Byte> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigInteger total = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigInteger.valueOf(values.get(i)));
+ return total.divide(BigInteger.valueOf(values.size())).byteValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigInteger bi = BigInteger.valueOf(values.get(
+ values.size() / 2 - 1));
+ bi = bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
+ return bi.divide(BigInteger.valueOf(2)).byteValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigInteger sum = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(BigInteger.valueOf(values.get(i)));
+ return sum.byteValue();
+ case MIN:
+ BigInteger minimum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(BigInteger.valueOf(
+ values.get(i))) > 0)
+ minimum = BigInteger.valueOf(values.get(i));
+ return minimum.byteValue();
+ case MAX:
+ BigInteger maximum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(BigInteger.valueOf(
+ values.get(i))) < 0)
+ maximum = BigInteger.valueOf(values.get(i));
+ return maximum.byteValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Byte.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicCharacter.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicCharacter.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicCharacter.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,205 @@
+/*
+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.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Character} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicCharacter extends DynamicType<Character> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicCharacter() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicCharacter(Interval<Character> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicCharacter(List<Interval<Character>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicCharacter(DynamicCharacter source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicCharacter(DynamicCharacter source, Interval<Character> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicCharacter(DynamicCharacter source, Interval<Character> in, Interval<Character> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicCharacter(DynamicCharacter source,
+ List<Interval<Character>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicCharacter(DynamicCharacter source, List<Interval<Character>> in, List<Interval<Character>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Character getValue(Interval interval, Estimator estimator) {
+ List<Character> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ return values.get(values.size() / 2 - 1);
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MIN:
+ Character minimum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(values.get(i)) > 0)
+ minimum = values.get(i);
+ return minimum;
+ case MAX:
+ Character maximum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(values.get(i)) < 0)
+ maximum = values.get(i);
+ return maximum;
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Character.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicDouble.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicDouble.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicDouble.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,215 @@
+/*
+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.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Double} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicDouble extends DynamicType<Double> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicDouble() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicDouble(Interval<Double> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicDouble(List<Interval<Double>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicDouble(DynamicDouble source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicDouble(DynamicDouble source, Interval<Double> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicDouble(DynamicDouble source, Interval<Double> in, Interval<Double> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicDouble(DynamicDouble source, List<Interval<Double>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicDouble(DynamicDouble source, List<Interval<Double>> in, List<Interval<Double>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Double getValue(Interval interval, Estimator estimator) {
+ List<Double> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigDecimal total = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigDecimal.valueOf(values.get(i)));
+ return total.divide(BigDecimal.valueOf((long)values.size()), 10, RoundingMode.HALF_EVEN).doubleValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigDecimal bd = new BigDecimal(
+ values.get(values.size() / 2 - 1));
+ bd = bd.add(new BigDecimal(values.get(values.size() / 2)));
+ return bd.divide(new BigDecimal(2)).doubleValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigDecimal sum = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(new BigDecimal(values.get(i)));
+ return sum.doubleValue();
+ case MIN:
+ BigDecimal minimum = new BigDecimal(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(new BigDecimal(values.get(i))) > 0)
+ minimum = new BigDecimal(values.get(i));
+ return minimum.doubleValue();
+ case MAX:
+ BigDecimal maximum = new BigDecimal(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(new BigDecimal(values.get(i))) < 0)
+ maximum = new BigDecimal(values.get(i));
+ return maximum.doubleValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Double.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicFloat.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicFloat.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicFloat.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,215 @@
+/*
+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.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Float} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicFloat extends DynamicType<Float> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicFloat() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicFloat(Interval<Float> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicFloat(List<Interval<Float>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicFloat(DynamicFloat source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicFloat(DynamicFloat source, Interval<Float> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicFloat(DynamicFloat source, Interval<Float> in, Interval<Float> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicFloat(DynamicFloat source, List<Interval<Float>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicFloat(DynamicFloat source, List<Interval<Float>> in, List<Interval<Float>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Float getValue(Interval interval, Estimator estimator) {
+ List<Float> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigDecimal total = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigDecimal.valueOf(values.get(i).doubleValue()));
+ return total.divide(BigDecimal.valueOf((long)values.size()), 10, RoundingMode.HALF_EVEN).floatValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigDecimal bd = new BigDecimal(
+ values.get(values.size() / 2 - 1));
+ bd = bd.add(new BigDecimal(values.get(values.size() / 2)));
+ return bd.divide(new BigDecimal(2)).floatValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigDecimal sum = new BigDecimal(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(new BigDecimal(values.get(i)));
+ return sum.floatValue();
+ case MIN:
+ BigDecimal minimum = new BigDecimal(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(new BigDecimal(values.get(i))) > 0)
+ minimum = new BigDecimal(values.get(i));
+ return minimum.floatValue();
+ case MAX:
+ BigDecimal maximum = new BigDecimal(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(new BigDecimal(values.get(i))) < 0)
+ maximum = new BigDecimal(values.get(i));
+ return maximum.floatValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Float.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicInteger.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicInteger.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicInteger.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,216 @@
+/*
+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.math.BigInteger;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Integer} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicInteger extends DynamicType<Integer> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicInteger() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicInteger(Interval<Integer> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicInteger(List<Interval<Integer>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicInteger(DynamicInteger source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicInteger(DynamicInteger source, Interval<Integer> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicInteger(DynamicInteger source, Interval<Integer> in, Interval<Integer> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicInteger(DynamicInteger source, List<Interval<Integer>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicInteger(DynamicInteger source, List<Interval<Integer>> in, List<Interval<Integer>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Integer getValue(Interval interval, Estimator estimator) {
+ List<Integer> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigInteger total = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigInteger.valueOf(values.get(i)));
+ return total.divide(BigInteger.valueOf(values.size())).intValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigInteger bi = BigInteger.valueOf(values.get(
+ values.size() / 2 - 1));
+ bi = bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
+ return bi.divide(BigInteger.valueOf(2)).intValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigInteger sum = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(BigInteger.valueOf(values.get(i)));
+ return sum.intValue();
+ case MIN:
+ BigInteger minimum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(BigInteger.valueOf(
+ values.get(i))) > 0)
+ minimum = BigInteger.valueOf(values.get(i));
+ return minimum.intValue();
+ case MAX:
+ BigInteger maximum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(BigInteger.valueOf(
+ values.get(i))) < 0)
+ maximum = BigInteger.valueOf(values.get(i));
+ return maximum.intValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Integer.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicLong.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicLong.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicLong.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,216 @@
+/*
+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.math.BigInteger;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Long} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicLong extends DynamicType<Long> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicLong() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicLong(Interval<Long> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicLong(List<Interval<Long>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicLong(DynamicLong source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicLong(DynamicLong source, Interval<Long> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicLong(DynamicLong source, Interval<Long> in, Interval<Long> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicLong(DynamicLong source, List<Interval<Long>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicLong(DynamicLong source, List<Interval<Long>> in, List<Interval<Long>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Long getValue(Interval interval, Estimator estimator) {
+ List<Long> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigInteger total = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigInteger.valueOf(values.get(i)));
+ return total.divide(BigInteger.valueOf(values.size())).longValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigInteger bi = BigInteger.valueOf(values.get(
+ values.size() / 2 - 1));
+ bi = bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
+ return bi.divide(BigInteger.valueOf(2)).longValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigInteger sum = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(BigInteger.valueOf(values.get(i)));
+ return sum.longValue();
+ case MIN:
+ BigInteger minimum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(BigInteger.valueOf(
+ values.get(i))) > 0)
+ minimum = BigInteger.valueOf(values.get(i));
+ return minimum.longValue();
+ case MAX:
+ BigInteger maximum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(BigInteger.valueOf(
+ values.get(i))) < 0)
+ maximum = BigInteger.valueOf(values.get(i));
+ return maximum.longValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Long.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicShort.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicShort.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicShort.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,216 @@
+/*
+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.math.BigInteger;
+import java.util.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link Short} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicShort extends DynamicType<Short> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicShort() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicShort(Interval<Short> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicShort(List<Interval<Short>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicShort(DynamicShort source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicShort(DynamicShort source, Interval<Short> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicShort(DynamicShort source, Interval<Short> in, Interval<Short> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicShort(DynamicShort source, List<Interval<Short>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicShort(DynamicShort source, List<Interval<Short>> in, List<Interval<Short>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public Short getValue(Interval interval, Estimator estimator) {
+ List<Short> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ if (values.size() == 1)
+ return values.get(0);
+ BigInteger total = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ total = total.add(BigInteger.valueOf(values.get(i)));
+ return total.divide(BigInteger.valueOf(values.size())).shortValue();
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ BigInteger bi = BigInteger.valueOf(values.get(
+ values.size() / 2 - 1));
+ bi = bi.add(BigInteger.valueOf(values.get(values.size() / 2)));
+ return bi.divide(BigInteger.valueOf(2)).shortValue();
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ BigInteger sum = BigInteger.valueOf(0);
+ for (int i = 0; i < values.size(); ++i)
+ sum = sum.add(BigInteger.valueOf(values.get(i)));
+ return sum.shortValue();
+ case MIN:
+ BigInteger minimum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(BigInteger.valueOf(
+ values.get(i))) > 0)
+ minimum = BigInteger.valueOf(values.get(i));
+ return minimum.shortValue();
+ case MAX:
+ BigInteger maximum = BigInteger.valueOf(values.get(0));
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(BigInteger.valueOf(
+ values.get(i))) < 0)
+ maximum = BigInteger.valueOf(values.get(i));
+ return maximum.shortValue();
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Short.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicString.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicString.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicString.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,204 @@
+/*
+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.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Represents {@link String} type which can have got different values in
+ * different time intervals.
+ *
+ * @author Cezary Bartosiak
+ */
+public final class DynamicString extends DynamicType<String> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicString() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicString(Interval<String> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicString(List<Interval<String>> in) {
+ super(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicString(DynamicString source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicString(DynamicString source, Interval<String> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicString(DynamicString source, Interval<String> in, Interval<String> out) {
+ super(source, in, out);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicString(DynamicString source, List<Interval<String>> in) {
+ super(source, in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicString(DynamicString source, List<Interval<String>> in, List<Interval<String>> out) {
+ super(source, in, out);
+ }
+
+ @Override
+ public String getValue(Interval interval, Estimator estimator) {
+ List<String> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ return values.get(values.size() / 2 - 1);
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MIN:
+ String minimum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (minimum.compareTo(values.get(i)) > 0)
+ minimum = values.get(i);
+ return minimum;
+ case MAX:
+ String maximum = values.get(0);
+ for (int i = 1; i < values.size(); ++i)
+ if (maximum.compareTo(values.get(i)) < 0)
+ maximum = values.get(i);
+ return maximum;
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return String.class;
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/DynamicType.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/DynamicType.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/DynamicType.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,499 @@
+/*
+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.Estimator;
+
+/**
+ * A special type which provides methods of getting/setting values of any time
+ * interval. It is internally implemented using Interval Tree for efficiency.
+ *
+ * @author Cezary Bartosiak
+ *
+ * @param <T> type of data
+ */
+public abstract class DynamicType<T> {
+ protected IntervalTree<T> intervalTree;
+
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public DynamicType() {
+ intervalTree = new IntervalTree<T>();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param in interval to add (could be null)
+ */
+ public DynamicType(Interval<T> in) {
+ this();
+ if (in != null)
+ intervalTree.insert(in);
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval<T>>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public DynamicType(List<Interval<T>> in) {
+ this();
+ if (in != null)
+ for (Interval<T> interval : in)
+ intervalTree.insert(interval);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public DynamicType(DynamicType<T> source) {
+ if (source == null)
+ intervalTree = new IntervalTree<T>();
+ else intervalTree = new IntervalTree<T>(source.intervalTree);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ */
+ public DynamicType(DynamicType<T> source, Interval<T> in) {
+ this(source);
+ if (in != null)
+ intervalTree.insert(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code Interval<T>} in. Before add it removes from the newly created
+ * object all intervals that overlap with a given {@code Interval<T>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in interval to add (could be null)
+ * @param out interval to remove (could be null)
+ */
+ public DynamicType(DynamicType<T> source, Interval<T> in, Interval<T> out) {
+ this(source);
+ if (out != null)
+ intervalTree.delete(out);
+ if (in != null)
+ intervalTree.insert(in);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public DynamicType(DynamicType<T> source, List<Interval<T>> in) {
+ this(source);
+ if (in != null)
+ for (Interval<T> interval : in)
+ intervalTree.insert(interval);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval<T>>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval<T>>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public DynamicType(DynamicType<T> source, List<Interval<T>> in, List<Interval<T>> out) {
+ this(source);
+ if (out != null)
+ for (Interval<T> interval : out)
+ intervalTree.delete(interval);
+ if (in != null)
+ for (Interval<T> interval : in)
+ intervalTree.insert(interval);
+ }
+
+ /**
+ * Returns the leftmost point or {@code Double.NEGATIVE_INFINITY} in case
+ * of no intervals.
+ *
+ * @return the leftmost point.
+ */
+ public double getLow() {
+ return intervalTree.getLow();
+ }
+
+ /**
+ * Returns the rightmost point or {@code Double.POSITIVE_INFINITY} in case
+ * of no intervals.
+ *
+ * @return the rightmost point.
+ */
+ public double getHigh() {
+ return intervalTree.getHigh();
+ }
+
+ /**
+ * Indicates if the leftmost point is excluded.
+ *
+ * @return {@code true} if the leftmost point is excluded,
+ * {@code false} otherwise.
+ */
+ public boolean isLowExcluded() {
+ return intervalTree.isLowExcluded();
+ }
+
+ /**
+ * Indicates if the rightmost point is excluded.
+ *
+ * @return {@code true} if the rightmost point is excluded,
+ * {@code false} otherwise.
+ */
+ public boolean isHighExcluded() {
+ return intervalTree.isHighExcluded();
+ }
+
+ /**
+ * Indicates if a given time interval overlaps with any interval of this instance.
+ *
+ * @param interval a given time interval
+ *
+ * @return {@code true} a given time interval overlaps with any interval of this
+ * instance, otherwise {@code false}.
+ */
+ public boolean isInRange(Interval interval) {
+ return intervalTree.overlapsWith(interval);
+ }
+
+ /**
+ * Indicates if [{@code low}, {@code high}] interval overlaps with any interval of this instance.
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ *
+ * @return {@code true} a given time interval overlaps with any interval of this
+ * instance, otherwise {@code false}.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ */
+ public boolean isInRange(double low, double high) {
+ if (low > high)
+ throw new IllegalArgumentException(
+ "The left endpoint of the interval must be less than " +
+ "the right endpoint.");
+
+ return intervalTree.overlapsWith(new Interval(low, high));
+ }
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a [{@code -inf}, {@code inf}] time interval.
+ * {@code Estimator.FIRST} is used.
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a [{@code -inf}, {@code inf}] time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @see Estimator
+ */
+ public T getValue() {
+ return getValue(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
+ }
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a given time interval.
+ * {@code Estimator.FIRST} is used.
+ *
+ * @param interval a given time interval
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a given time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @see Estimator
+ */
+ public T getValue(Interval interval) {
+ return getValue(interval, Estimator.FIRST);
+ }
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a [{@code low}, {@code high}] time interval.
+ * {@code Estimator.FIRST} is used.
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a [{@code low}, {@code high}] time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ *
+ * @see Estimator
+ */
+ public T getValue(double low, double high) {
+ return getValue(low, high, Estimator.FIRST);
+ }
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a [{@code -inf}, {@code inf}] time interval.
+ *
+ * @param estimator used to estimate the result
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a [{@code -inf}, {@code inf}] time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @throws UnsupportedOperationException if type {@code T} doesn't support
+ * the given {@code estimator}.
+ *
+ * @see Estimator
+ */
+ public T getValue(Estimator estimator) {
+ return getValue(Double.NEGATIVE_INFINITY,
+ Double.POSITIVE_INFINITY,
+ estimator);
+ }
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a given time interval.
+ *
+ * @param interval a given time interval
+ * @param estimator used to estimate the result
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a given time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @throws UnsupportedOperationException if type {@code T} doesn't support
+ * the given {@code estimator}.
+ *
+ * @see Estimator
+ */
+ public abstract T getValue(Interval interval, Estimator estimator);
+
+ /**
+ * Returns the estimated value of a set of values whose time intervals
+ * overlap with a [{@code low}, {@code high}] time interval.
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ * @param estimator used to estimate the result
+ *
+ * @return the estimated value of a set of values whose time intervals
+ * overlap with a [{@code low}, {@code high}] time interval or
+ * {@code null} if there are no intervals.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ * @throws UnsupportedOperationException if type {@code T} doesn't support
+ * the given {@code estimator}.
+ *
+ * @see Estimator
+ */
+ public T getValue(double low, double high, Estimator estimator) {
+ if (low > high)
+ throw new IllegalArgumentException(
+ "The left endpoint of the interval must be less than " +
+ "the right endpoint.");
+
+ return getValue(new Interval(low, high, false, false), estimator);
+ }
+
+ /**
+ * Returns a list of all values stored in this instance.
+ *
+ * @return a list of all values stored in this instance.
+ */
+ public List<T> getValues() {
+ return getValues(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
+ }
+
+ /**
+ * Returns a list of values whose time intervals overlap with a
+ * [{@code low}, {@code high}] time interval.
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ *
+ * @return a list of values whose time intervals overlap with a
+ * [{@code low}, {@code high}] time interval.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ */
+ public List<T> getValues(double low, double high) {
+ return getValues(new Interval(low, high));
+ }
+
+ /**
+ * Returns a list of values whose time intervals overlap with a
+ * given time interval.
+ *
+ * @param interval a given time interval
+ *
+ * @return a list of values whose time intervals overlap with a
+ * given time interval.
+ */
+ public List<T> getValues(Interval interval) {
+ List<T> result = new ArrayList<T>();
+ for (Interval<T> i : intervalTree.search(interval))
+ result.add(i.getValue());
+ return result;
+ }
+
+ /**
+ * Returns a list of all intervals.
+ *
+ * @return a list of intervals which overlap with a given time interval.
+ */
+ public List<Interval<T>> getIntervals() {
+ return intervalTree.getIntervals();
+ }
+
+ /**
+ * Returns a list of intervals which overlap with a given time interval.
+ *
+ * @param interval a given time interval
+ *
+ * @return a list of intervals which overlap with a given time interval.
+ */
+ public List<Interval<T>> getIntervals(Interval interval) {
+ return intervalTree.search(interval);
+ }
+
+ /**
+ * Returns a list of intervals which overlap with a
+ * [{@code low}, {@code high}] time interval.
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ *
+ * @return a list of intervals which overlap with a
+ * [{@code low}, {@code high}] time interval.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ */
+ public List<Interval<T>> getIntervals(double low, double high) {
+ return intervalTree.search(low, high);
+ }
+
+ /**
+ * Returns the underlying type {@code T}.
+ *
+ * @return the underlying type {@code T}.
+ */
+ public abstract Class getUnderlyingType();
+
+ /**
+ * Compares this instance with the specified object for equality.
+ *
+ * <p>Note that two {@code DynamicType} instances are equal if they have got
+ * the same type {@code T} and their interval trees are equal.
+ *
+ * @param obj object to which this instance is to be compared
+ *
+ * @return {@code true} if and only if the specified {@code Object} is a
+ * {@code DynamicType} which has the same type {@code T} and an
+ * equal interval tree.
+ *
+ * @see #hashCode
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null && obj.getClass().equals(this.getClass()) &&
+ ((DynamicType<T>)obj).intervalTree.equals(intervalTree))
+ return true;
+ return false;
+ }
+
+ /**
+ * Returns a hashcode of this instance.
+ *
+ * @return a hashcode of this instance.
+ */
+ @Override
+ public int hashCode() {
+ return intervalTree.hashCode();
+ }
+
+ /**
+ * Creates a string representation of all the intervals with their values.
+ *
+ * @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) {
+ return intervalTree.toString(timesAsDoubles);
+ }
+
+ /**
+ * Returns a string representation of this instance in a format
+ * {@code <[low, high, value], ..., [low, high, value]>}. Intervals are
+ * ordered by its left endpoint.
+ *
+ * @return a string representation of this instance.
+ */
+ @Override
+ public String toString() {
+ return intervalTree.toString();
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/FloatList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/FloatList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/FloatList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Float items. Can be created from a float
+ * array, from a Float array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class FloatList extends NumberList<Float> {
+
+ public FloatList(float[] primitiveFloatArray) {
+ super(TypeConvertor.<Float>convertPrimitiveToWrapperArray(primitiveFloatArray));
+ }
+
+ public FloatList(Float[] wrapperFloatArray) {
+ super(wrapperFloatArray);
+ }
+
+ public FloatList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public FloatList(String input, String separator) {
+ super(input, separator, Float.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/IntegerList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/IntegerList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/IntegerList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Integer items. Can be created from a int
+ * array, from a Integer array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class IntegerList extends NumberList<Integer> {
+
+ public IntegerList(int[] primitiveIntArray) {
+ super(TypeConvertor.<Integer>convertPrimitiveToWrapperArray(primitiveIntArray));
+ }
+
+ public IntegerList(Integer[] wrapperIntArray) {
+ super(wrapperIntArray);
+ }
+
+ public IntegerList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public IntegerList(String input, String separator) {
+ super(input, separator, Integer.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/Interval.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/Interval.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/Interval.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,321 @@
+/*
+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);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/IntervalTree.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/IntervalTree.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/IntervalTree.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,695 @@
+/*
+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.Arrays;
+import java.util.List;
+
+/**
+ * It is essentially a map from intervals to object which can be queried for
+ * {@code Interval} instances associated with a particular interval of time.
+ *
+ * <p>Insertion can be performed in <i>O</i>(lg <i>n</i>) time, where <i>n</i>
+ * is the number of nodes. All intervals in a tree that overlap some interval
+ * <i>i</i> can be listed in <i>O</i>(min(<i>n</i>, <i>k</i> lg <i>n</i>) time,
+ * where <i>k</i> is the number of intervals in the output list. Thus search and
+ * deletion can be performed in this time.
+ *
+ * <p>The space consumption is <i>O</i>(<i>n</i>).
+ *
+ * <p>Note that this implementation doesn't allow intervals to be duplicated.
+ *
+ * <p>References:
+ * <ul>
+ * <li>Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.
+ * Introduction to Algorithms, Second Edition. MIT, 2001. ISBN 83-204-2879-3
+ * </ul>
+ *
+ * @author Cezary Bartosiak
+ *
+ * @param <T> type of data
+ */
+public final class IntervalTree<T> {
+ private Node nil; // the sentinel node
+ private Node root; // the root of this interval tree
+
+ /**
+ * Constructs an empty {@code IntervalTree}.
+ */
+ public IntervalTree() {
+ nil = new Node();
+ nil.left = nil.right = nil.p = nil;
+ root = nil;
+ }
+
+ /**
+ * Constructs a copy of the given {@code IntervalTree}.
+ *
+ * @param intervalTree a copied {@code IntervalTree}
+ */
+ public IntervalTree(IntervalTree<T> intervalTree) {
+ this();
+ copy(intervalTree.root.left, intervalTree.nil);
+ }
+
+ private void copy(Node x, Node nil) {
+ if (x != nil) {
+ copy(x.left, nil);
+ insert(x.i);
+ copy(x.right, nil);
+ }
+ }
+
+ private boolean compareLow(Interval a, Interval b) {
+ if (a.getLow() < b.getLow() || a.getLow() == b.getLow() &&
+ (!a.isLowExcluded() || b.isHighExcluded()))
+ return true;
+ return false;
+ }
+
+ /**
+ * Inserts the {@code interval} into this {@code IntervalTree}.
+ *
+ * @param interval an interval to be inserted
+ *
+ * @throws NullPointerException if {@code interval} is null.
+ */
+ public void insert(Interval<T> interval) {
+ if (interval == null)
+ throw new NullPointerException("Interval cannot be null.");
+
+ insert(new Node(interval));
+ }
+
+ private void insert(Node z) {
+ z.left = z.right = nil;
+
+ Node y = root;
+ Node x = root.left;
+ while (x != nil) {
+ y = x;
+ if (compareLow(z.i, y.i))
+ x = x.left;
+ else x = x.right;
+ y.max = Math.max(z.max, y.max);
+ }
+ z.p = y;
+ if (y == root || compareLow(z.i, y.i))
+ y.left = z;
+ else y.right = z;
+ insertFixup(z);
+ }
+
+ private void insertFixup(Node z) {
+ Node y = nil;
+
+ z.color = RED;
+ while (z.p.color == RED)
+ if (z.p == z.p.p.left) {
+ y = z.p.p.right;
+ if (y.color == RED) {
+ z.p.color = BLACK;
+ y.color = BLACK;
+ z.p.p.color = RED;
+ z = z.p.p;
+ }
+ else {
+ if (z == z.p.right) {
+ z = z.p;
+ leftRotate(z);
+ }
+ z.p.color = BLACK;
+ z.p.p.color = RED;
+ rightRotate(z.p.p);
+ }
+ }
+ else {
+ y = z.p.p.left;
+ if (y.color == RED) {
+ z.p.color = BLACK;
+ y.color = BLACK;
+ z.p.p.color = RED;
+ z = z.p.p;
+ }
+ else {
+ if (z == z.p.left) {
+ z = z.p;
+ rightRotate(z);
+ }
+ z.p.color = BLACK;
+ z.p.p.color = RED;
+ leftRotate(z.p.p);
+ }
+ }
+ root.left.color = BLACK;
+ }
+
+ /**
+ * Removes all intervals from this {@code IntervalTree} that overlap with
+ * the given {@code interval}.
+ *
+ * @param interval determines which intervals should be removed
+ *
+ * @throws NullPointerException if {@code interval} is null.
+ */
+ public void delete(Interval interval) {
+ if (interval == null)
+ throw new NullPointerException("Interval cannot be null.");
+
+ for (Node n : searchNodes(interval))
+ delete(n);
+ }
+
+ private void delete(Node z) {
+ z.max = Double.NEGATIVE_INFINITY;
+ for (Node i = z.p; i != root; i = i.p)
+ i.max = Math.max(i.left.max, i.right.max);
+
+ Node y;
+ Node x;
+
+ if (z.left == nil || z.right == nil)
+ y = z;
+ else y = succesor(z);
+ if (y.left == nil)
+ x = y.right;
+ else x = y.left;
+ x.p = y.p;
+ if (root == x.p)
+ root.left = x;
+ else if (y == y.p.left)
+ y.p.left = x;
+ else y.p.right = x;
+ if (y != z) {
+ if (y.color == BLACK)
+ deleteFixup(x);
+
+ y.left = z.left;
+ y.right = z.right;
+ y.p = z.p;
+ y.color = z.color;
+ z.left.p = z.right.p = y;
+ if (z == z.p.left)
+ z.p.left = y;
+ else z.p.right = y;
+ }
+ else if (y.color == BLACK)
+ deleteFixup(x);
+ }
+
+ private void deleteFixup(Node x) {
+ while (x != root.left && x.color == BLACK)
+ if (x == x.p.left) {
+ Node w = x.p.right;
+ if (w.color == RED) {
+ w.color = BLACK;
+ x.p.color = RED;
+ leftRotate(x.p);
+ w = x.p.right;
+ }
+ if (w.left.color == BLACK && w.right.color == BLACK) {
+ w.color = RED;
+ x = x.p;
+ }
+ else {
+ if (w.right.color == BLACK) {
+ w.left.color = BLACK;
+ w.color = RED;
+ rightRotate(w);
+ w = x.p.right;
+ }
+ w.color = x.p.color;
+ x.p.color = BLACK;
+ w.right.color = BLACK;
+ leftRotate(x.p);
+ x = root.left;
+ }
+ }
+ else {
+ Node w = x.p.left;
+ if (w.color == RED) {
+ w.color = BLACK;
+ x.p.color = RED;
+ rightRotate(x.p);
+ w = x.p.left;
+ }
+ if (w.right.color == BLACK && w.left.color == BLACK) {
+ w.color = RED;
+ x = x.p;
+ }
+ else {
+ if (w.left.color == BLACK) {
+ w.right.color = BLACK;
+ w.color = RED;
+ leftRotate(w);
+ w = x.p.left;
+ }
+ w.color = x.p.color;
+ x.p.color = BLACK;
+ w.left.color = BLACK;
+ rightRotate(x.p);
+ x = root.left;
+ }
+ }
+ x.color = BLACK;
+ }
+
+ private void leftRotate(Node x) {
+ Node y = x.right;
+
+ x.right = y.left;
+ if (y.left != nil)
+ y.left.p = x;
+ y.p = x.p;
+ if (x == x.p.left)
+ x.p.left = y;
+ else x.p.right = y;
+ y.left = x;
+ x.p = y;
+
+ y.max = x.max;
+ x.max = Math.max(x.i.getHigh(), Math.max(x.left.max, x.right.max));
+ }
+
+ private void rightRotate(Node x) {
+ Node y = x.left;
+
+ x.left = y.right;
+ if (y.right != nil)
+ y.right.p = x;
+ y.p = x.p;
+ if (x == x.p.left)
+ x.p.left = y;
+ else x.p.right = y;
+ y.right = x;
+ x.p = y;
+
+ y.max = x.max;
+ x.max = Math.max(x.i.getHigh(), Math.max(x.left.max, x.right.max));
+ }
+
+ private Node succesor(Node x) {
+ Node y = x.right;
+ if (y != nil) {
+ while (y.left != nil)
+ y = y.left;
+ return y;
+ }
+ y = x.p;
+ while (x == y.right) {
+ x = y;
+ y = y.p;
+ }
+ if (y == root)
+ return nil;
+ return y;
+ }
+
+ /**
+ * Returns the interval with the lowest left endpoint.
+ *
+ * @return the interval with the lowest left endpoint
+ * or null if the tree is empty.
+ */
+ public Interval<T> minimum() {
+ if (root.left == nil)
+ return null;
+ return treeMinimum(root.left).i;
+ }
+
+ private Node treeMinimum(Node x) {
+ while (x.left != nil)
+ x = x.left;
+ return x;
+ }
+
+ /**
+ * Returns the interval with the highest left endpoint.
+ *
+ * @return the interval with the highest left endpoint
+ * or null if the tree is empty.
+ */
+ public Interval<T> maximum() {
+ if (root.left == nil)
+ return null;
+ return treeMaximum(root.left).i;
+ }
+
+ private Node treeMaximum(Node x) {
+ while (x.right != nil)
+ x = x.right;
+ return x;
+ }
+
+ /**
+ * Returns the leftmost point or {@code Double.NEGATIVE_INFINITY} in case
+ * of no intervals.
+ *
+ * @return the leftmost point.
+ */
+ public double getLow() {
+ if (isEmpty())
+ return Double.NEGATIVE_INFINITY;
+ return minimum().getLow();
+ }
+
+ /**
+ * Returns the rightmost point or {@code Double.POSITIVE_INFINITY} in case
+ * of no intervals.
+ *
+ * @return the rightmost point.
+ */
+ public double getHigh() {
+ if (isEmpty())
+ return Double.POSITIVE_INFINITY;
+ return root.left.max;
+ }
+
+ /**
+ * Indicates if the leftmost point is excluded.
+ *
+ * @return {@code true} if the leftmost point is excluded,
+ * {@code false} otherwise.
+ */
+ public boolean isLowExcluded() {
+ if (isEmpty())
+ return true;
+ return minimum().isLowExcluded();
+ }
+
+ /**
+ * Indicates if the rightmost point is excluded.
+ *
+ * @return {@code true} if the rightmost point is excluded,
+ * {@code false} otherwise.
+ */
+ public boolean isHighExcluded() {
+ if (isEmpty())
+ return true;
+ return maximum().isHighExcluded();
+ }
+
+ /**
+ * Indicates if this {@code IntervalTree} contains 0 intervals.
+ *
+ * @return {@code true} if this {@code IntervalTree} is empty,
+ * {@code false} otherwise.
+ */
+ public boolean isEmpty() {
+ return root.left == nil;
+ }
+
+ /**
+ * Returns all intervals.
+ *
+ * @return all intervals
+ */
+ public List<Interval<T>> getIntervals() {
+ List<Interval<T>> list = new ArrayList<Interval<T>>();
+ inorderTreeWalk(root.left, list);
+ return list;
+ }
+
+ /**
+ * Returns all intervals overlapping with a given {@code Interval}.
+ *
+ * @param interval an {#code Interval} to be searched for overlaps
+ *
+ * @return all intervals overlapping with a given {@code Interval}.
+ *
+ * @throws NullPointerException if {@code interval} is null.
+ */
+ public List<Interval<T>> search(Interval interval) {
+ if (interval == null)
+ throw new NullPointerException("Interval cannot be null.");
+
+ List<Interval<T>> overlaps = new ArrayList<Interval<T>>();
+ for (Node n : searchNodes(interval))
+ overlaps.add(n.i);
+ return overlaps;
+ }
+
+ /**
+ * Returns all intervals overlapping with an interval given by {@code low}
+ * and {@code high}. They are considered as included by default.
+ *
+ * @param low the left endpoint of an interval to be searched for overlaps
+ * @param high the right endpoint an interval to be searched for overlaps
+ *
+ * @return all intervals overlapping with an interval given by {@code low}
+ * and {@code high}.
+ *
+ * @throws IllegalArgumentException if {@code low} > {@code high}.
+ */
+ public List<Interval<T>> search(double low, double high) {
+ if (low > high)
+ throw new IllegalArgumentException(
+ "The left endpoint of the interval must be less than " +
+ "the right endpoint.");
+
+ List<Interval<T>> overlaps = new ArrayList<Interval<T>>();
+ for (Node n : searchNodes(new Interval(low, high)))
+ overlaps.add(n.i);
+ return overlaps;
+ }
+
+ private List<Node> searchNodes(Interval interval) {
+ List<Node> result = new ArrayList<Node>();
+ searchNodes(root.left, interval, result);
+ return result;
+ }
+
+ private void searchNodes(Node n, Interval interval, List<Node> result) {
+ // Don't search nodes that don't exist.
+ if (n == nil)
+ return;
+
+ // Skip all nodes that have got their max value below the start of
+ // the given interval.
+ if (interval.getLow() > n.max)
+ return;
+
+ // Search left children.
+ if (n.left != nil)
+ searchNodes(n.left, interval, result);
+
+ // Check this node.
+ if (n.i.compareTo(interval) == 0)
+ result.add(n);
+
+ // Skip all nodes to the right of nodes whose low value is past the end
+ // of the given interval.
+ if (interval.compareTo(n.i) < 0)
+ return;
+
+ // Otherwise, search right children.
+ if (n.right != nil)
+ searchNodes(n.right, interval, result);
+ }
+
+ /**
+ * Indicates if this {@code IntervalTree} overlaps with the given time interval.
+ *
+ * @param interval a given time interval
+ *
+ * @return {@code true} if this {@code IntervalTree} overlaps with {@code interval},
+ * {@code false} otherwise.
+ */
+ public boolean overlapsWith(Interval interval) {
+ return overlapsWith(root.left, interval);
+ }
+
+ private boolean overlapsWith(Node n, Interval interval) {
+ // Don't search nodes that don't exist.
+ if (n == nil)
+ return false;
+
+ // Skip all nodes that have got their max value below the start of
+ // the given interval.
+ if (interval.getLow() > n.max)
+ return false;
+
+ // Search left children.
+ if (n.left != nil)
+ if (overlapsWith(n.left, interval))
+ return true;
+
+ // Check this node.
+ if (n.i.compareTo(interval) == 0)
+ return true;
+
+ // Skip all nodes to the right of nodes whose low value is past the end
+ // of the given interval.
+ if (interval.compareTo(n.i) < 0)
+ return false;
+
+ // Otherwise, search right children.
+ if (n.right != nil)
+ if (overlapsWith(n.right, interval))
+ return true;
+
+ // No overlaps, return false.
+ return false;
+ }
+
+ private void inorderTreeWalk(Node x, List<Interval<T>> list) {
+ if (x != nil) {
+ inorderTreeWalk(x.left, list);
+ list.add(x.i);
+ inorderTreeWalk(x.right, list);
+ }
+ }
+
+ /**
+ * Compares this interval tree with the specified object for equality.
+ *
+ * <p>Note that two interval trees are equal if they contain the same
+ * intervals.
+ *
+ * @param obj object to which this interval tree is to be compared
+ *
+ * @return {@code true} if and only if the specified {@code Object} is a
+ * {@code IntervalTree} which contain the same intervals as this
+ * {@code IntervalTree's}.
+ *
+ * @see #hashCode
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null && obj.getClass().equals(this.getClass())) {
+ List<Interval<T>> thisIntervals = new ArrayList<Interval<T>>();
+ List<Interval<T>> objIntervals = new ArrayList<Interval<T>>();
+ inorderTreeWalk(root.left, thisIntervals);
+ ((IntervalTree<T>)obj).inorderTreeWalk(
+ ((IntervalTree<T>)obj).root.left, objIntervals);
+ if (thisIntervals.size() == objIntervals.size()) {
+ for (int i = 0; i < thisIntervals.size(); ++i)
+ if (!thisIntervals.get(i).equals(objIntervals.get(i)))
+ return false;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns a hashcode of this interval tree.
+ *
+ * @return a hashcode of this interval tree.
+ */
+ @Override
+ public int hashCode() {
+ List<Interval<T>> list = new ArrayList<Interval<T>>();
+ inorderTreeWalk(root.left, list);
+ return Arrays.deepHashCode(list.toArray());
+ }
+
+ /**
+ * Creates a string representation of all the intervals with their values.
+ *
+ * @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) {
+ List<Interval<T>> list = new ArrayList<Interval<T>>();
+ inorderTreeWalk(root.left, list);
+ if (!list.isEmpty()) {
+ StringBuilder sb = new StringBuilder("<");
+ sb.append(list.get(0).toString(timesAsDoubles));
+ for (int i = 1; i < list.size(); ++i)
+ sb.append("; ").append(list.get(i).toString(timesAsDoubles));
+ sb.append(">");
+ return sb.toString();
+ }
+ return "<empty>";
+ }
+
+ /**
+ * Returns a string representation of this interval tree in a format
+ * {@code <[low, high, value], ..., [low, high, value]>}. Nodes are visited
+ * in {@code inorder}.
+ *
+ * <p>Times are always shown as doubles.</p>
+ *
+ * @return a string representation of this interval tree.
+ */
+ @Override
+ public String toString() {
+ return toString(true);
+ }
+
+ private class Node {
+ public Interval<T> i; // i.low is the key of this node
+ public double max; // the maximum value of any interval endpoint
+ // stored in the subtree rooted at this node
+
+ public Color color; // the color of this node
+ public Node left; // the left subtree of this node
+ public Node right; // the right subtree of this node
+ public Node p; // the parent node
+
+ /*
+ * Constructs a sentinel node by default.
+ */
+ public Node() {
+ color = BLACK;
+ }
+
+ /*
+ * Constructs a new {@code Node} instance.
+ */
+ public Node(Interval<T> i) {
+ this();
+ this.i = i;
+ this.max = i.getHigh();
+ }
+ }
+
+ private enum Color {
+ RED, BLACK
+ }
+
+ private static final Color RED = Color.RED;
+ private static final Color BLACK = Color.BLACK;
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/LongList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/LongList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/LongList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Long items. Can be created from a long
+ * array, from a Long array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class LongList extends NumberList<Long> {
+
+ public LongList(long[] primitiveLongArray) {
+ super(TypeConvertor.<Long>convertPrimitiveToWrapperArray(primitiveLongArray));
+ }
+
+ public LongList(Long[] wrapperLongArray) {
+ super(wrapperLongArray);
+ }
+
+ public LongList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public LongList(String input, String separator) {
+ super(input, separator, Long.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/NumberList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/NumberList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/NumberList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,65 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that defines list of items that are numbers.
+ *
+ * @param <T> type parameter restricted to types extending Number type
+ *
+ * @author Martin Škurla
+ */
+public abstract class NumberList<T extends Number> extends AbstractList<T> {
+
+ public NumberList(T[] wrapperArray) {
+ super(wrapperArray);
+ }
+
+ public NumberList(String input, Class<T> finalType) {
+ this(input, AbstractList.DEFAULT_SEPARATOR, finalType);
+ }
+
+ public NumberList(String input, String separator, Class<T> finalType) {
+ super(input, separator, finalType);
+ }
+}
+
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/ShortList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/ShortList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/ShortList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,67 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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;
+
+/**
+ * Complex type that define a list of Short items. Can be created from a short
+ * array, from a Short array or from single string using either given or default separators.
+ *
+ * @author Martin Škurla
+ */
+public final class ShortList extends NumberList<Short> {
+
+ public ShortList(short[] primitiveShortArray) {
+ super(TypeConvertor.<Short>convertPrimitiveToWrapperArray(primitiveShortArray));
+ }
+
+ public ShortList(Short[] wrapperShortArray) {
+ super(wrapperShortArray);
+ }
+
+ public ShortList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ public ShortList(String input, String separator) {
+ super(input, separator, Short.class);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/StringList.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/StringList.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/StringList.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,118 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>
+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.AttributeType;
+
+/**
+ * Complex type that define a list of String items. Can be created from a String
+ * array, from a char array or from single string using either given or default separators.
+ * <p>
+ * String list is useful when, for a particular type, the number of string
+ * that define an element is not known by advance.
+ *
+ * @author Martin Škurla
+ * @author Mathieu Bastian
+ * @see AttributeType
+ */
+public final class StringList extends AbstractList<String> {
+
+ /**
+ * Create a new string from a char array. One char per list cell.
+ *
+ * @param list the list
+ */
+ public StringList(char[] list) {
+ super(StringList.parse(list));
+ }
+
+ /**
+ * Create a new string list with the given items.
+ *
+ * @param list the list of string items
+ */
+ public StringList(String[] list) {
+ super(list);
+ }
+
+ /**
+ * Create a new string list with items found in the given value. Default
+ * separators <code>,|;</code> are used to split the string in a list.
+ *
+ * @param input a string with default separators
+ */
+ public StringList(String input) {
+ this(input, AbstractList.DEFAULT_SEPARATOR);
+ }
+
+ /**
+ * Create a new string list with items found using given separators.
+ *
+ * @param input a string with separators defined in <code>separator</code>
+ * @param separator the separators chars that are to be used to split
+ * <code>value</code>
+ */
+ public StringList(String input, String separator) {
+ super(input, separator, String.class);
+ }
+
+ private static String[] parse(char[] list) {
+ String[] resultList = new String[list.length];
+
+ for (int i = 0; i < list.length; i++) {
+ resultList[i] = "" + list[i];
+ }
+
+ return resultList;
+ }
+
+ /**
+ * Returns the item at the specified <code>index</code>. May return
+ * <code>null</code> if <code>index</code> is out of range.
+ *
+ * @param index the position in the string list
+ * @return the item at the specified position, or <code>null</code>
+ */
+ public String getString(int index) {
+ return getItem(index);
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/TimeInterval.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/TimeInterval.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/TimeInterval.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,335 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian, 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.Hashtable;
+import java.util.List;
+import org.gephi.data.attributes.api.AttributeUtils;
+import org.gephi.data.attributes.api.Estimator;
+
+/**
+ * Complex type for specifying time interval. An, interval is two
+ * <code>double</code> with <code>low</code> inferior or equal to
+ * <code>high</code>. Thus intervals can have got included or excluded
+ * bounds.
+ *
+ * @author Mathieu Bastian, Cezary Bartosiak
+ */
+public final class TimeInterval extends DynamicType<Double[]> {
+ /**
+ * Constructs a new {@code DynamicType} instance with no intervals.
+ */
+ public TimeInterval() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code interval}.
+ *
+ * @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)
+ */
+ public TimeInterval(double low, double high, boolean lopen, boolean ropen) {
+ super(new Interval<Double[]>(low, high, lopen, ropen));
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance that contains a given
+ * {@code interval} [{@code low}, {@code high}].
+ *
+ * @param low the left endpoint
+ * @param high the right endpoint
+ */
+ public TimeInterval(double low, double high) {
+ super(new Interval<Double[]>(low, high));
+ }
+
+ /**
+ * Constructs a new {@code DynamicType} instance with intervals given by
+ * {@code List<Interval>} in.
+ *
+ * @param in intervals to add (could be null)
+ */
+ public TimeInterval(List<Interval> in) {
+ super(getList(in));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ */
+ public TimeInterval(TimeInterval source) {
+ super(source);
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code interval}.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @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)
+ */
+ public TimeInterval(TimeInterval source, double low, double high, boolean lopen, boolean ropen) {
+ super(source, new Interval<Double[]>(low, high, lopen, ropen));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code interval} [{@code low}, {@code high}].
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param low the left endpoint
+ * @param high the right endpoint
+ */
+ public TimeInterval(TimeInterval source, double low, double high) {
+ super(source, new Interval<Double[]>(low, high));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code interval} [{@code alow}, {@code ahigh}]. Before add it removes
+ * from the newly created object all intervals that overlap with a given
+ * {@code interval} [{@code rlow}, {@code rhigh}].
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param alow the left endpoint of the interval to add
+ * @param ahigh the right endpoint of the interval to add
+ * @param alopen indicates if the left endpoint of the interval to add is excluded (true in this case)
+ * @param aropen indicates if the right endpoint of the interval to add is excluded (true in this case)
+ * @param rlow the left endpoint of the interval to remove
+ * @param rhigh the right endpoint of the interval to remove
+ * @param blopen indicates if the left endpoint of the interval to remove is excluded (true in this case)
+ * @param bropen indicates if the right endpoint of the interval to remove is excluded (true in this case)
+ */
+ public TimeInterval(TimeInterval source, double alow, double ahigh, boolean alopen, boolean aropen,
+ double rlow, double rhigh, boolean blopen, boolean bropen) {
+ super(source,
+ new Interval<Double[]>(alow, ahigh, alopen, aropen),
+ new Interval<Double[]>(rlow, rhigh, blopen, bropen));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} that contains a given
+ * {@code interval} [{@code alow}, {@code ahigh}]. Before add it removes
+ * from the newly created object all intervals that overlap with a given
+ * {@code interval} [{@code rlow}, {@code rhigh}].
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param alow the left endpoint of the interval to add
+ * @param ahigh the right endpoint of the interval to add
+ * @param rlow the left endpoint of the interval to remove
+ * @param rhigh the right endpoint of the interval to remove
+ */
+ public TimeInterval(TimeInterval source, double alow, double ahigh, double rlow, double rhigh) {
+ super(source,
+ new Interval<Double[]>(alow, ahigh),
+ new Interval<Double[]>(rlow, rhigh));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval>} in.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ */
+ public TimeInterval(TimeInterval source, List<Interval> in) {
+ super(source, getList(in));
+ }
+
+ /**
+ * Constructs a deep copy of {@code source} with additional intervals
+ * given by {@code List<Interval>} in. Before add it removes from the
+ * newly created object all intervals that overlap with intervals given by
+ * {@code List<Interval>} out.
+ *
+ * @param source an object to copy from (could be null, then completely new
+ * instance is created)
+ * @param in intervals to add (could be null)
+ * @param out intervals to remove (could be null)
+ */
+ public TimeInterval(TimeInterval source, List<Interval> in, List<Interval> out) {
+ super(source, getList(in), getList(out));
+ }
+
+ private static List<Interval<Double[]>> getList(List<Interval> arg) {
+ if (arg == null)
+ return null;
+ List<Interval<Double[]>> list = new ArrayList<Interval<Double[]>>();
+ for (Interval item : arg)
+ list.add(new Interval<Double[]>(item.getLow(), item.getHigh(),
+ item.isLowExcluded(), item.isHighExcluded()));
+ return list;
+ }
+
+ @Override
+ public Double[] getValue(Interval interval, Estimator estimator) {
+ List<Double[]> values = getValues(interval);
+ if (values.isEmpty())
+ return null;
+
+ switch (estimator) {
+ case AVERAGE:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MEDIAN:
+ if (values.size() % 2 == 1)
+ return values.get(values.size() / 2);
+ return values.get(values.size() / 2 - 1);
+ case MODE:
+ Hashtable<Integer, Integer> map =
+ new Hashtable<Integer, Integer>();
+ for (int i = 0; i < values.size(); ++i) {
+ int prev = 0;
+ if (map.containsKey(values.get(i).hashCode()))
+ prev = map.get(values.get(i).hashCode());
+ map.put(values.get(i).hashCode(), prev + 1);
+ }
+ int max = map.get(values.get(0).hashCode());
+ int index = 0;
+ for (int i = 1; i < values.size(); ++i)
+ if (max < map.get(values.get(i).hashCode())) {
+ max = map.get(values.get(i).hashCode());
+ index = i;
+ }
+ return values.get(index);
+ case SUM:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MIN:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case MAX:
+ throw new UnsupportedOperationException(
+ "Not supported estimator");
+ case FIRST:
+ return values.get(0);
+ case LAST:
+ return values.get(values.size() - 1);
+ default:
+ throw new IllegalArgumentException("Unknown estimator.");
+ }
+ }
+
+ @Override
+ public List<Double[]> getValues(Interval interval) {
+ List<Double[]> result = new ArrayList<Double[]>();
+ for (Interval<Double[]> i : intervalTree.search(interval))
+ result.add(new Double[] { i.getLow(), i.getHigh() });
+ return result;
+ }
+
+ @Override
+ public Class getUnderlyingType() {
+ return Double[].class;
+ }
+
+ @Override
+ public String toString(boolean timesAsDoubles) {
+ if (timesAsDoubles)
+ return toString();
+ return toStringTimesAsDates();
+ }
+
+ /**
+ * Returns a string representation of this instance in a format
+ * {@code <[low, high], ..., [low, high]>}. Intervals are
+ * ordered by its left endpoint.
+ *
+ * <p>Times are always shown as dates.</p>
+ *
+ * @return a string representation of this instance.
+ */
+ public String toStringTimesAsDates() {
+ List<Interval<Double[]>> list = getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
+ if (!list.isEmpty()) {
+ StringBuilder sb = new StringBuilder("<");
+ sb.append(list.get(0).isLowExcluded() ? "(" : "[").append(AttributeUtils.getXMLDateStringFromDouble(
+ list.get(0).getLow())).append(", ").append(AttributeUtils.getXMLDateStringFromDouble(
+ list.get(0).getHigh())).append(list.get(0).isHighExcluded() ? ")" : "]");
+ for (int i = 1; i < list.size(); ++i)
+ sb.append("; ").append(list.get(i).isLowExcluded() ? "(" : "[").append(AttributeUtils.
+ getXMLDateStringFromDouble(list.get(i).getLow())).append(", ").append(AttributeUtils.
+ getXMLDateStringFromDouble(list.get(i).getHigh())).append(list.get(i).isHighExcluded() ? ")" : "]");
+ sb.append(">");
+ return sb.toString();
+ }
+ return "<empty>";
+ }
+
+ /**
+ * Returns a string representation of this instance in a format
+ * {@code <[low, high], ..., [low, high]>}. Intervals are
+ * ordered by its left endpoint.
+ *
+ * @return a string representation of this instance.
+ */
+ @Override
+ public String toString() {
+ List<Interval<Double[]>> list = getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
+ if (!list.isEmpty()) {
+ StringBuilder sb = new StringBuilder("<");
+ sb.append(list.get(0).isLowExcluded() ? "(" : "[").append(list.get(0).getLow()).append(", ").
+ append(list.get(0).getHigh()).append(list.get(0).isHighExcluded() ? ")" : "]");
+ for (int i = 1; i < list.size(); ++i)
+ sb.append("; ").append(list.get(i).isLowExcluded() ? "(" : "[").append(list.get(i).getLow()).
+ append(", ").append(list.get(i).getHigh()).append(list.get(i).isHighExcluded() ? ")" : "]");
+ sb.append(">");
+ return sb.toString();
+ }
+ return "<empty>";
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/TypeConvertor.java'
--- AttributesAPI/src/org/gephi/data/attributes/type/TypeConvertor.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/TypeConvertor.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,301 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Martin Škurla <bujacik@xxxxxxxxx>, Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import org.gephi.data.attributes.api.AttributeType;
+
+/**
+ * Class responsible for type manipulation and creation needed in Attributes API.
+ *
+ * @author Martin Škurla
+ * @author Mathieu Bastian
+ */
+public final class TypeConvertor {
+
+ private static final String CONVERSION_METHOD_NAME = "valueOf";
+
+ private TypeConvertor() {
+ }
+
+ /**
+ * Creates array of given type from single String value. String value is always parsed by given
+ * separator into smaller chunks. Every chunk will represent independent object in final array.
+ * The exact conversion process from String value into final type is done by
+ * {@link #createInstanceFromString createInstanceFromString} method.
+ *
+ * @param <T> type parameter representing final array type
+ * @param input input
+ * @param separator separator which will be used in the process of tokenizing input
+ * @param finalType type of final array
+ *
+ * @return final array
+ *
+ * @throws NullPointerException if any of given parameters is null
+ * @throws IllegalArgumentException if array of given type cannot be created
+ *
+ * @see #createInstanceFromString createInstanceFromString
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T[] createArrayFromString(String input, String separator, Class<T> finalType) {
+ if (input == null || separator == null || finalType == null) {
+ throw new NullPointerException();
+ }
+
+ String[] stringValues = input.split(separator);
+ T[] resultList = (T[]) Array.newInstance(finalType, stringValues.length);
+
+ for (int i = 0; i < stringValues.length; i++) {
+ String stringValue = stringValues[i].trim();
+ T resultValue = null;
+
+ if (finalType == String.class) {
+ resultValue = (T) stringValue;
+ } else {
+ resultValue = TypeConvertor.<T>createInstanceFromString(stringValue, finalType);
+ }
+
+ resultList[i] = resultValue;
+ }
+ return resultList;
+ }
+
+ /**
+ * Transforms String value to any kind of object with given type. The concrete conversion
+ * must be done by the type itself. This assumes, that given type defines at least one of the
+ * following:
+ * <ul>
+ * <li>public constructor with single parameter of type String
+ * <li>factory method "valueOf" with single parameter of type String<br />
+ * If given type does not definy any of these requirements, IllegalArgumentException will be
+ * thrown.
+ *
+ * @param <T> type parameter representing final type
+ * @param input input
+ * @param finalType type of final object
+ *
+ * @return final object
+ *
+ * @throws NullPointerException if any of given parameters is null
+ * @throws IllegalArgumentException if given type cannot be created
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T createInstanceFromString(String input, Class<T> finalType) {
+ if (input == null || finalType == null) {
+ throw new NullPointerException();
+ }
+
+ T resultValue = null;
+
+ try {
+ Method conversionMethod = finalType.getMethod(CONVERSION_METHOD_NAME, String.class);
+
+ resultValue = (T) conversionMethod.invoke(null, input);
+ } catch (NoSuchMethodException e) {
+ try {
+ Constructor<T> constructor = finalType.getConstructor(String.class);
+ resultValue = constructor.newInstance(input);
+ } catch (NoSuchMethodException e1) {
+ String errorMessage = String.format(
+ "Type '%s' does not have neither method 'T %s(String)' nor constructor '<init>(String)'...",
+ finalType,
+ CONVERSION_METHOD_NAME);
+
+ throw new IllegalArgumentException(errorMessage);
+ } catch (Exception e2) {
+ }
+ } catch (Exception e) {
+ }
+ return resultValue;
+ }
+
+ /**
+ * Converts given array of primitive type into array of wrapper type.
+ *
+ * @param <T> type parameter representing final wrapper type
+ * @param primitiveArray primitive array
+ *
+ * @return wrapper array
+ *
+ * @throws NullPointerException if given parameter is null
+ * @throws IllegalArgumentException if given parameter is not array or given parameter is not
+ * array of primitive type
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T[] convertPrimitiveToWrapperArray(Object primitiveArray) {
+ if (primitiveArray == null) {
+ throw new NullPointerException();
+ }
+
+ if (!primitiveArray.getClass().isArray()) {
+ throw new IllegalArgumentException("Given object is not of primitive array: " + primitiveArray.getClass());
+ }
+
+ Class<?> primitiveClass = primitiveArray.getClass().getComponentType();
+ Class<T> wrapperClass = (Class<T>) getWrapperFromPrimitive(primitiveClass);
+ int arrayLength = Array.getLength(primitiveArray);
+ T[] wrapperArray = (T[]) Array.newInstance(wrapperClass, arrayLength);
+
+ for (int i = 0; i < arrayLength; i++) {
+ T arrayItem = (T) Array.get(primitiveArray, i);
+ wrapperArray[i] = arrayItem;
+ }
+
+ return wrapperArray;
+ }
+
+ /**
+ * Returns wrapper type from given primitive type.
+ *
+ * @param primitiveType primitive type
+ *
+ * @return wrapper type
+ *
+ * @throws NullPointerException if given parameter is null
+ * @throws IllegalArgumentException if given parameter is not a primitive type
+ */
+ public static Class<?> getWrapperFromPrimitive(Class<?> primitiveType) {
+ if (primitiveType == null) {
+ throw new NullPointerException();
+ }
+
+ if (primitiveType == byte.class) {
+ return Byte.class;
+ } else if (primitiveType == short.class) {
+ return Short.class;
+ } else if (primitiveType == int.class) {
+ return Integer.class;
+ } else if (primitiveType == long.class) {
+ return Long.class;
+ } else if (primitiveType == float.class) {
+ return Float.class;
+ } else if (primitiveType == double.class) {
+ return Double.class;
+ } else if (primitiveType == boolean.class) {
+ return Boolean.class;
+ } else if (primitiveType == char.class) {
+ return Character.class;
+ }
+
+ throw new IllegalArgumentException("Given type '" + primitiveType + "' is not primitive...");
+ }
+
+ /**
+ * Returns the underlying static type from <code>dynamicType</code> For example
+ * returns <code>FLOAT</code> if given type is <code>DYNAMIC_FLOAT</code>.
+ * @param dynamicType a dynamic type
+ * @return the underlying static type
+ * @throws IllegalArgumentException if <code>dynamicType</code> is not dynamic
+ */
+ public static AttributeType getStaticType(AttributeType dynamicType) {
+ if (!dynamicType.isDynamicType()) {
+ throw new IllegalArgumentException("Given type '" + dynamicType + "' is not dynamic.");
+ }
+ switch (dynamicType) {
+ case DYNAMIC_BIGDECIMAL:
+ return AttributeType.BIGDECIMAL;
+ case DYNAMIC_BIGINTEGER:
+ return AttributeType.BIGINTEGER;
+ case DYNAMIC_BOOLEAN:
+ return AttributeType.BOOLEAN;
+ case DYNAMIC_BYTE:
+ return AttributeType.BYTE;
+ case DYNAMIC_CHAR:
+ return AttributeType.CHAR;
+ case DYNAMIC_DOUBLE:
+ return AttributeType.DOUBLE;
+ case DYNAMIC_FLOAT:
+ return AttributeType.FLOAT;
+ case DYNAMIC_INT:
+ return AttributeType.INT;
+ case DYNAMIC_LONG:
+ return AttributeType.LONG;
+ case DYNAMIC_SHORT:
+ return AttributeType.SHORT;
+ case DYNAMIC_STRING:
+ return AttributeType.STRING;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Returns the corresponding dynamic type from <code>staticType</code> For example
+ * returns <code>DYNAMIC_FLOAT</code> if given type is <code>FLOAT</code>.
+ * @param staticType a static type
+ * @return the corresponding dynamic type
+ * @throws IllegalArgumentException if <code>staticType</code> is not static
+ */
+ public static AttributeType getDynamicType(AttributeType staticType) {
+ if (staticType.isDynamicType()) {
+ throw new IllegalArgumentException("Given type '" + staticType + "' is not static.");
+ }
+ switch (staticType) {
+ case BIGDECIMAL:
+ return AttributeType.DYNAMIC_BIGDECIMAL;
+ case BIGINTEGER:
+ return AttributeType.DYNAMIC_BIGINTEGER;
+ case BOOLEAN:
+ return AttributeType.DYNAMIC_BOOLEAN;
+ case BYTE:
+ return AttributeType.DYNAMIC_BYTE;
+ case CHAR:
+ return AttributeType.DYNAMIC_CHAR;
+ case DOUBLE:
+ return AttributeType.DYNAMIC_DOUBLE;
+ case FLOAT:
+ return AttributeType.DYNAMIC_FLOAT;
+ case INT:
+ return AttributeType.DYNAMIC_INT;
+ case LONG:
+ return AttributeType.DYNAMIC_LONG;
+ case SHORT:
+ return AttributeType.DYNAMIC_SHORT;
+ case STRING:
+ return AttributeType.DYNAMIC_STRING;
+ default:
+ return null;
+ }
+ }
+}
=== added file 'AttributesAPI/src/org/gephi/data/attributes/type/package.html'
--- AttributesAPI/src/org/gephi/data/attributes/type/package.html 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/attributes/type/package.html 2012-04-11 14:38:21 +0000
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <body bgcolor="white">
+ Defines new immutable types that can represent attributes.
+ <p>
+ Defines more complex type of data than Java doesn't provide. Types defined
+ here may be supported by {@link org.gephi.data.attributes.api.AttributeType} and exploited by others
+ API.
+ </p>
+ </body>
+</html>
=== added directory 'AttributesAPI/src/org/gephi/data/properties'
=== added file 'AttributesAPI/src/org/gephi/data/properties/PropertiesColumn.java'
--- AttributesAPI/src/org/gephi/data/properties/PropertiesColumn.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/org/gephi/data/properties/PropertiesColumn.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,117 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, Martin Škurla <bujacik@xxxxxxxxx>
+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.properties;
+
+import org.gephi.data.attributes.api.AttributeOrigin;
+import org.gephi.data.attributes.api.AttributeType;
+
+/**
+ * Enum that define static <code>AttributeColumn</code> indexes, like <code>ID</code>
+ * or <code>LABEL</code>. Use these enum to find the index of these columns in
+ * node and edge table.
+ * <h4>Get nodes ID column
+ * <pre>
+ * AttributeColumn col = nodeTable.getColumn(PropertiesColumn.NODE_ID.getIndex());
+ * </pre>
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ */
+public enum PropertiesColumn {
+
+ NODE_ID (0, "id", AttributeType.STRING, AttributeOrigin.PROPERTY, null),
+ NODE_LABEL (1, "label", AttributeType.STRING, AttributeOrigin.PROPERTY, null),
+ EDGE_ID (0, "id", AttributeType.STRING, AttributeOrigin.PROPERTY, null),
+ EDGE_LABEL (1, "label", AttributeType.STRING, AttributeOrigin.PROPERTY, null),
+ EDGE_WEIGHT (2, "weight", AttributeType.FLOAT, AttributeOrigin.PROPERTY, 1f),
+ NEO4J_RELATIONSHIP_TYPE(3, "neo4j_rt", AttributeType.STRING, AttributeOrigin.DELEGATE, null){
+ @Override
+ public String getTitle() {
+ return "Neo4j Relationship Type";
+ }
+ };
+
+ private final int index;
+ private final String id;
+ private final AttributeType type;
+ private final AttributeOrigin origin;
+ private final Object defaultValue;
+
+ PropertiesColumn(int index, String id, AttributeType attributeType, AttributeOrigin origin, Object defaultValue) {
+ this.index = index;
+ this.id = id;
+ this.type = attributeType;
+ this.origin = origin;
+ this.defaultValue = defaultValue;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Returns column title which will be showed to user in AttributeTables. Default title is derived
+ * from id uppercasing first character. For multiword titles, getTitle() method in appropriate enum
+ * constant object should be overridden.
+ *
+ * @return title
+ */
+ public String getTitle() {
+ return Character.toUpperCase(id.charAt(0)) + id.substring(1, id.length());
+ }
+
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ public AttributeType getType() {
+ return type;
+ }
+
+ public AttributeOrigin getOrigin() {
+ return origin;
+ }
+}
+
=== added file 'AttributesAPI/src/overview.html'
--- AttributesAPI/src/overview.html 1970-01-01 00:00:00 +0000
+++ AttributesAPI/src/overview.html 2012-04-11 14:38:21 +0000
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <body>
+ Attributes API provides access to attributes values through an
+ efficient column/row system.
+ <p>
+ Attributes are data associated to elements like <b>node</b> or <b>edge</b>.
+ Various kind of data can be set for each element. The API allows to
+ define data columns with a <b>title</b> and a <b>type</b> in tables
+ and then creates row to push data values. By default, there are two
+ tables: <b>node</b> and <b>edge</b>.
+ </p>
+ </body>
+</html>
=== added directory 'AttributesAPI/test'
=== added directory 'AttributesAPI/test/unit'
=== added directory 'AttributesAPI/test/unit/src'
=== added directory 'AttributesAPI/test/unit/src/org'
=== added directory 'AttributesAPI/test/unit/src/org/gephi'
=== added directory 'AttributesAPI/test/unit/src/org/gephi/data'
=== added directory 'AttributesAPI/test/unit/src/org/gephi/data/attributes'
=== added directory 'AttributesAPI/test/unit/src/org/gephi/data/attributes/type'
=== added file 'AttributesAPI/test/unit/src/org/gephi/data/attributes/type/DynamicTypeTest.java'
--- AttributesAPI/test/unit/src/org/gephi/data/attributes/type/DynamicTypeTest.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/test/unit/src/org/gephi/data/attributes/type/DynamicTypeTest.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,612 @@
+/*
+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);
+ }
+}
=== added file 'AttributesAPI/test/unit/src/org/gephi/data/attributes/type/IntegerListTest.java'
--- AttributesAPI/test/unit/src/org/gephi/data/attributes/type/IntegerListTest.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/test/unit/src/org/gephi/data/attributes/type/IntegerListTest.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,88 @@
+/*
+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);
+ }
+}
=== added file 'AttributesAPI/test/unit/src/org/gephi/data/attributes/type/StringListTest.java'
--- AttributesAPI/test/unit/src/org/gephi/data/attributes/type/StringListTest.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/test/unit/src/org/gephi/data/attributes/type/StringListTest.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,88 @@
+/*
+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);
+ }
+}
=== added file 'AttributesAPI/test/unit/src/org/gephi/data/attributes/type/TypeConvertorTest.java'
--- AttributesAPI/test/unit/src/org/gephi/data/attributes/type/TypeConvertorTest.java 1970-01-01 00:00:00 +0000
+++ AttributesAPI/test/unit/src/org/gephi/data/attributes/type/TypeConvertorTest.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,113 @@
+/*
+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]);
+ }
+}
=== added directory 'AttributesImpl'
=== renamed directory 'AttributesImpl' => 'AttributesImpl.moved'
=== added file 'AttributesImpl/build.xml'
--- AttributesImpl/build.xml 1970-01-01 00:00:00 +0000
+++ AttributesImpl/build.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,8 @@
+<?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>
=== added file 'AttributesImpl/manifest.mf'
--- AttributesImpl/manifest.mf 1970-01-01 00:00:00 +0000
+++ AttributesImpl/manifest.mf 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+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.1
+
=== added directory 'AttributesImpl/nbproject'
=== added file 'AttributesImpl/nbproject/build-impl.xml'
--- AttributesImpl/nbproject/build-impl.xml 1970-01-01 00:00:00 +0000
+++ AttributesImpl/nbproject/build-impl.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,45 @@
+<?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>
=== added file 'AttributesImpl/nbproject/genfiles.properties'
--- AttributesImpl/nbproject/genfiles.properties 1970-01-01 00:00:00 +0000
+++ AttributesImpl/nbproject/genfiles.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+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
=== added file 'AttributesImpl/nbproject/project.properties'
--- AttributesImpl/nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ AttributesImpl/nbproject/project.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,6 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
+keystore=nbproject/private/keystore.ks
+license.file=../agpl-3.0.txt
+nbm.module.author=Gephi.org
+nbm_alias=gephi
=== added file 'AttributesImpl/nbproject/project.xml'
--- AttributesImpl/nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ AttributesImpl/nbproject/project.xml 2012-04-11 14:38:21 +0000
@@ -0,0 +1,68 @@
+<?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>
=== added file 'AttributesImpl/nbproject/suite.properties'
--- AttributesImpl/nbproject/suite.properties 1970-01-01 00:00:00 +0000
+++ AttributesImpl/nbproject/suite.properties 2012-04-11 14:38:21 +0000
@@ -0,0 +1,1 @@
+suite.dir=${basedir}/..
=== added directory 'AttributesImpl/src'
=== added directory 'AttributesImpl/src/org'
=== added directory 'AttributesImpl/src/org/gephi'
=== added directory 'AttributesImpl/src/org/gephi/data'
=== added directory 'AttributesImpl/src/org/gephi/data/attributes'
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AbstractAttributeModel.java'
--- AttributesImpl/src/org/gephi/data/attributes/AbstractAttributeModel.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AbstractAttributeModel.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,173 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, Martin Škurla <bujacik@xxxxxxxxx>
+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.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import org.gephi.data.attributes.api.AttributeListener;
+import org.gephi.data.attributes.api.AttributeModel;
+import org.gephi.data.attributes.api.AttributeRowFactory;
+import org.gephi.data.attributes.api.AttributeTable;
+import org.gephi.data.attributes.api.AttributeType;
+import org.gephi.data.attributes.api.AttributeValueFactory;
+import org.gephi.data.attributes.event.AbstractEvent;
+import org.gephi.data.attributes.event.AttributeEventManager;
+import org.gephi.data.properties.PropertiesColumn;
+import org.openide.util.NbBundle;
+
+/**
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ */
+public abstract class AbstractAttributeModel implements AttributeModel {
+
+ //Classes
+ private ConcurrentMap<String, AttributeTableImpl> tableMap;
+ private AttributeTableImpl nodeTable;
+ private AttributeTableImpl edgeTable;
+ //Factory
+ private AttributeFactoryImpl factory;
+ //Events
+ protected AttributeEventManager eventManager;
+
+ //Data API
+ public AbstractAttributeModel() {
+ tableMap = new ConcurrentHashMap<String, AttributeTableImpl>();
+ nodeTable = new AttributeTableImpl(this, NbBundle.getMessage(AttributeTableImpl.class, "NodeAttributeTable.name"));
+ edgeTable = new AttributeTableImpl(this, NbBundle.getMessage(AttributeTableImpl.class, "EdgeAttributeTable.name"));
+ tableMap.put(nodeTable.name, nodeTable);
+ tableMap.put(edgeTable.name, edgeTable);
+ factory = new AttributeFactoryImpl(this);
+ }
+
+ protected void createPropertiesColumn() {
+ // !!! the position of PropertiesColumn enum constants in following arrays must be the same
+ // !!! as index in each constant
+ PropertiesColumn[] columnsForNodeTable = {PropertiesColumn.NODE_ID,
+ PropertiesColumn.NODE_LABEL};
+ PropertiesColumn[] columnsForEdgeTable = {PropertiesColumn.EDGE_ID,
+ PropertiesColumn.EDGE_LABEL,
+ PropertiesColumn.EDGE_WEIGHT};
+
+ for (PropertiesColumn columnForNodeTable : columnsForNodeTable)
+ nodeTable.addPropertiesColumn(columnForNodeTable);
+
+ for (PropertiesColumn columnForEdgeTable : columnsForEdgeTable)
+ edgeTable.addPropertiesColumn(columnForEdgeTable);
+ }
+
+ public abstract Object getManagedValue(Object obj, AttributeType attributeType);
+
+ public void clear() {
+ }
+
+ public AttributeTableImpl getNodeTable() {
+ return nodeTable;
+ }
+
+ public AttributeTableImpl getEdgeTable() {
+ return edgeTable;
+ }
+
+ public AttributeTableImpl getTable(String name) {
+ AttributeTableImpl attTable = tableMap.get(name);
+ if (attTable != null) {
+ return attTable;
+ }
+ return null;
+ }
+
+ public AttributeTableImpl[] getTables() {
+ return tableMap.values().toArray(new AttributeTableImpl[0]);
+ }
+
+ public AttributeRowFactory rowFactory() {
+ return factory;
+ }
+
+ public AttributeValueFactory valueFactory() {
+ return factory;
+ }
+
+ public AttributeFactoryImpl getFactory() {
+ return factory;
+ }
+
+ public void addTable(AttributeTableImpl table) {
+ tableMap.put(table.getName(), table);
+ }
+
+ public void addAttributeListener(AttributeListener listener) {
+ eventManager.addAttributeListener(listener);
+ }
+
+ public void removeAttributeListener(AttributeListener listener) {
+ eventManager.removeAttributeListener(listener);
+ }
+
+ public void fireAttributeEvent(AbstractEvent event) {
+ eventManager.fireEvent(event);
+ }
+
+ public void mergeModel(AttributeModel model) {
+ if (model.getNodeTable() != null) {
+ nodeTable.mergeTable(model.getNodeTable());
+ }
+ if (model.getEdgeTable() != null) {
+ edgeTable.mergeTable(model.getEdgeTable());
+ }
+
+ for (AttributeTable table : model.getTables()) {
+ if (table != model.getNodeTable() && table != model.getEdgeTable()) {
+ AttributeTable existingTable = tableMap.get(table.getName());
+ if (existingTable != null) {
+ ((AttributeTableImpl) existingTable).mergeTable(table);
+ } else {
+ AttributeTableImpl newTable = new AttributeTableImpl(this, table.getName());
+ tableMap.put(newTable.getName(), newTable);
+ newTable.mergeTable(table);
+ }
+ }
+ }
+ }
+}
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AttributeColumnImpl.java'
--- AttributesImpl/src/org/gephi/data/attributes/AttributeColumnImpl.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AttributeColumnImpl.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,129 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, Martin Škurla <bujacik@xxxxxxxxx>
+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.AttributeOrigin;
+import org.gephi.data.attributes.api.AttributeType;
+import org.gephi.data.attributes.spi.AttributeValueDelegateProvider;
+
+/**
+ *
+ * @author Mathieu Bastian
+ * @author Martin Škurla
+ */
+public class AttributeColumnImpl implements AttributeColumn {
+
+ protected final AttributeTableImpl table;
+ protected int index;
+ protected final String id;
+ protected final String title;
+ protected final AttributeType type;
+ protected final AttributeOrigin origin;
+ protected final AttributeValueImpl defaultValue;
+ protected final AttributeValueDelegateProvider attributeValueDelegateProvider;
+
+ public AttributeColumnImpl(AttributeTableImpl table, int index, String id, String title, AttributeType attributeType, AttributeOrigin origin, Object defaultValue, AttributeValueDelegateProvider attributeValueDelegateProvider) {
+ this.table = table;
+ this.index = index;
+ this.id = id;
+ this.type = attributeType;
+ this.title = title;
+ this.origin = origin;
+ this.attributeValueDelegateProvider = attributeValueDelegateProvider;
+ this.defaultValue = new AttributeValueImpl(this, defaultValue);
+ }
+
+ public AttributeTableImpl getTable() {
+ return table;
+ }
+
+ public AttributeType getType() {
+ return type;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public AttributeOrigin getOrigin() {
+ return origin;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public Object getDefaultValue() {
+ return defaultValue.getValue();
+ }
+
+ public AttributeValueDelegateProvider getProvider() {
+ return attributeValueDelegateProvider;
+ }
+
+ @Override
+ public String toString() {
+ return title + " (" + type.toString() + ")";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof AttributeColumn) {
+ AttributeColumnImpl o = (AttributeColumnImpl) obj;
+ return id.equals(o.id) && o.type == type;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 53 * hash + (this.id != null ? this.id.hashCode() : 0);
+ hash = 53 * hash + (this.type != null ? this.type.hashCode() : 0);
+ return hash;
+ }
+}
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AttributeContollerImpl.java'
--- AttributesImpl/src/org/gephi/data/attributes/AttributeContollerImpl.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AttributeContollerImpl.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,125 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.AttributeController;
+import org.gephi.data.attributes.api.AttributeModel;
+import org.gephi.data.attributes.model.IndexedAttributeModel;
+import org.gephi.data.attributes.model.TemporaryAttributeModel;
+import org.gephi.project.api.ProjectController;
+import org.gephi.project.api.WorkspaceProvider;
+import org.gephi.project.api.Workspace;
+import org.gephi.project.api.WorkspaceListener;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+@ServiceProvider(service = AttributeController.class)
+public class AttributeContollerImpl implements AttributeController {
+
+ private ProjectController projectController;
+
+ public AttributeContollerImpl() {
+ projectController = Lookup.getDefault().lookup(ProjectController.class);
+ projectController.addWorkspaceListener(new WorkspaceListener() {
+
+ public void initialize(Workspace workspace) {
+ AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
+ if (m == null) {
+ workspace.add(new IndexedAttributeModel());
+ }
+ }
+
+ public void select(Workspace workspace) {
+ }
+
+ public void unselect(Workspace workspace) {
+ }
+
+ public void close(Workspace workspace) {
+ }
+
+ public void disable() {
+ }
+ });
+ if (projectController.getCurrentProject() != null) {
+ for (Workspace workspace : projectController.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces()) {
+ AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
+ if (m == null) {
+ workspace.add(new IndexedAttributeModel());
+ }
+ }
+ }
+ }
+
+ public AttributeModel getModel() {
+ Workspace workspace = projectController.getCurrentWorkspace();
+ if (workspace != null) {
+ AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
+ if (model != null) {
+ return model;
+ }
+ model = new IndexedAttributeModel();
+ workspace.add(model);
+ return model;
+ }
+ return null;
+ }
+
+ public AttributeModel getModel(Workspace workspace) {
+ AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
+ if (model != null) {
+ return model;
+ }
+ model = new IndexedAttributeModel();
+ workspace.add(model);
+ return model;
+ }
+
+ public AttributeModel newModel() {
+ TemporaryAttributeModel model = new TemporaryAttributeModel();
+ return model;
+ }
+}
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AttributeFactoryImpl.java'
--- AttributesImpl/src/org/gephi/data/attributes/AttributeFactoryImpl.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AttributeFactoryImpl.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,98 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.AttributeOrigin;
+import org.gephi.data.attributes.api.AttributeRowFactory;
+import org.gephi.data.attributes.api.AttributeValueFactory;
+import org.gephi.data.attributes.api.AttributeValue;
+import org.gephi.graph.api.EdgeData;
+import org.gephi.graph.api.NodeData;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+public class AttributeFactoryImpl implements AttributeValueFactory, AttributeRowFactory {
+
+ private AbstractAttributeModel model;
+
+ public AttributeFactoryImpl(AbstractAttributeModel model) {
+ this.model = model;
+ }
+
+ public AttributeValue newValue(AttributeColumn column, Object value) {
+ if (value == null) {
+ return new AttributeValueImpl((AttributeColumnImpl) column, null);
+ }
+
+ if (value.getClass() != column.getType().getType() && value.getClass() == String.class) {
+ value = column.getType().parse((String) value);
+ }
+ Object managedValue = value;
+ if (!column.getOrigin().equals(AttributeOrigin.PROPERTY)) {
+ managedValue = model.getManagedValue(value, column.getType());
+ }
+ return new AttributeValueImpl((AttributeColumnImpl) column, managedValue);
+ }
+
+ public AttributeRowImpl newNodeRow(NodeData nodeData) {
+ return new AttributeRowImpl(model.getNodeTable(), nodeData);
+ }
+
+ public AttributeRowImpl newEdgeRow(EdgeData edgeData) {
+ return new AttributeRowImpl(model.getEdgeTable(), edgeData);
+ }
+
+ public AttributeRowImpl newRowForTable(String tableName, Object object) {
+ AttributeTableImpl attTable = model.getTable(tableName);
+ if (attTable != null) {
+ return new AttributeRowImpl(attTable, object);
+ }
+ return null;
+ }
+
+ public void setModel(AbstractAttributeModel model) {
+ this.model = model;
+ }
+}
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AttributeModelDuplicateProvider.java'
--- AttributesImpl/src/org/gephi/data/attributes/AttributeModelDuplicateProvider.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AttributeModelDuplicateProvider.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,66 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>
+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.AttributeController;
+import org.gephi.data.attributes.api.AttributeModel;
+import org.gephi.project.api.Workspace;
+import org.gephi.project.spi.WorkspaceDuplicateProvider;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author Mathieu Bastian
+ */
+@ServiceProvider(service = WorkspaceDuplicateProvider.class, position = 10)
+public class AttributeModelDuplicateProvider implements WorkspaceDuplicateProvider {
+
+ public void duplicate(Workspace source, Workspace destination) {
+ AttributeController controller = Lookup.getDefault().lookup(AttributeController.class);
+ AttributeModel sourceModel = controller.getModel(source);
+ AttributeModel destModel = controller.getModel(destination);
+ if (sourceModel != null && destModel != null) {
+ destModel.mergeModel(sourceModel);
+ }
+ }
+}
=== added file 'AttributesImpl/src/org/gephi/data/attributes/AttributeRowImpl.java'
--- AttributesImpl/src/org/gephi/data/attributes/AttributeRowImpl.java 1970-01-01 00:00:00 +0000
+++ AttributesImpl/src/org/gephi/data/attributes/AttributeRowImpl.java 2012-04-11 14:38:21 +0000
@@ -0,0 +1,253 @@
+/*
+Copyright 2008-2010 Gephi
+Authors : Mathieu Bastian <mathieu.bastian@xxxxxxxxx>, 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 {
+
+ prot