├── .gitignore ├── .mailmap ├── .travis.yml ├── COPYING ├── LICENSE.CECILL-C ├── LICENSE.LGPL ├── README.md ├── changelog.md ├── doc └── stylesheet.css ├── javadoc.xml ├── pom.xml ├── src-test └── org │ └── graphstream │ ├── graph │ └── test │ │ ├── BenchPerformance.java │ │ ├── PathTest.java │ │ ├── TestAbstractElement.java │ │ ├── TestElement.java │ │ ├── TestElementAttributeConcurrency.java │ │ ├── TestGraph.java │ │ └── TestGraphSynchronisation.java │ ├── stream │ ├── binary │ │ └── test │ │ │ └── ExampleByteProxy.java │ ├── file │ │ ├── dgs │ │ │ └── test │ │ │ │ ├── TestDGSParser.java │ │ │ │ └── data │ │ │ │ ├── attributes.dgs │ │ │ │ ├── attributes_array.dgs │ │ │ │ ├── bad1.dgs │ │ │ │ ├── bad2.dgs │ │ │ │ ├── elements.dgs │ │ │ │ └── removeAttribute.dgs │ │ ├── gml │ │ │ └── test │ │ │ │ ├── SmallTest.gml │ │ │ │ ├── TestSinkGML.java │ │ │ │ ├── TestSourceGML.java │ │ │ │ ├── dynamic.gml │ │ │ │ └── example2.sif.gml │ │ ├── pajek │ │ │ └── test │ │ │ │ ├── 1.CLU │ │ │ │ ├── 1.NET │ │ │ │ ├── 1CRN.BS │ │ │ │ ├── 1CRN.MAC │ │ │ │ ├── 1CRN.NET │ │ │ │ ├── 1CTX.BS │ │ │ │ ├── 22.HIE │ │ │ │ ├── ADF073.MAC │ │ │ │ ├── ADH008.BS │ │ │ │ ├── AHO1.NET │ │ │ │ ├── AHO2.NET │ │ │ │ ├── AHO3.NET │ │ │ │ ├── AHO4.NET │ │ │ │ ├── B.NET │ │ │ │ ├── BDL011.BS │ │ │ │ ├── C.NET │ │ │ │ ├── C6H12.MAC │ │ │ │ ├── CC.NET │ │ │ │ ├── CENPROD.NET │ │ │ │ ├── CIRC.NET │ │ │ │ ├── CITE.NET │ │ │ │ ├── CP.NET │ │ │ │ ├── CPM1.NET │ │ │ │ ├── CPM2.NET │ │ │ │ ├── CPM3.NET │ │ │ │ ├── CVRML.NET │ │ │ │ ├── CX.NET │ │ │ │ ├── D.NET │ │ │ │ ├── D1.EPS │ │ │ │ ├── DNA.NET │ │ │ │ ├── DREV1.CLU │ │ │ │ ├── DREV1.NET │ │ │ │ ├── DREVO.NET │ │ │ │ ├── ETHANOL.MAC │ │ │ │ ├── ETHANOL.NET │ │ │ │ ├── FILE1.NET │ │ │ │ ├── FLOW.NET │ │ │ │ ├── FLOW3.NET │ │ │ │ ├── FLOW4.NET │ │ │ │ ├── FRAG1.NET │ │ │ │ ├── FRAG1X.NET │ │ │ │ ├── FRAG1Y.NET │ │ │ │ ├── FRAG2.NET │ │ │ │ ├── FRAG3.NET │ │ │ │ ├── FRAG4.NET │ │ │ │ ├── FRAG5.NET │ │ │ │ ├── GCD.NET │ │ │ │ ├── GR344.NET │ │ │ │ ├── GR3_44.NET │ │ │ │ ├── GR3_53.NET │ │ │ │ ├── GR3_60.NET │ │ │ │ ├── GR3_81.NET │ │ │ │ ├── H20.MAC │ │ │ │ ├── H20.NET │ │ │ │ ├── H2O.MAC │ │ │ │ ├── HEXANE.MAC │ │ │ │ ├── HEXANE.NET │ │ │ │ ├── KOCKA.NET │ │ │ │ ├── KOCKA1.NET │ │ │ │ ├── KVADRAT.NET │ │ │ │ ├── LINKS.NET │ │ │ │ ├── LOND1.NET │ │ │ │ ├── LONDON.NET │ │ │ │ ├── MCCABE1.CLU │ │ │ │ ├── MCCABE1.NET │ │ │ │ ├── MCCABE1A.NET │ │ │ │ ├── MCCABE2.CLU │ │ │ │ ├── MCCABE2.NET │ │ │ │ ├── MCCABE2A.NET │ │ │ │ ├── MREZA.NET │ │ │ │ ├── MREZA.PER │ │ │ │ ├── MREZA1.NET │ │ │ │ ├── MREZA1.PER │ │ │ │ ├── MREZA2.NET │ │ │ │ ├── MREZA3.NET │ │ │ │ ├── MREZAS1.NET │ │ │ │ ├── MREZASHR.NET │ │ │ │ ├── NEG.CLU │ │ │ │ ├── NEG.NET │ │ │ │ ├── NEIG4.NET │ │ │ │ ├── NOOY.CLU │ │ │ │ ├── NOOY.NET │ │ │ │ ├── OLDFILE.NET │ │ │ │ ├── PATH4.NET │ │ │ │ ├── PER.PER │ │ │ │ ├── PETER.NET │ │ │ │ ├── PETRI1.CLU │ │ │ │ ├── PETRI1.NET │ │ │ │ ├── PETRI2.CLU │ │ │ │ ├── PETRI2.NET │ │ │ │ ├── PETRI21.CLU │ │ │ │ ├── PETRI22.CLU │ │ │ │ ├── PETRI3.CLU │ │ │ │ ├── PETRI3.NET │ │ │ │ ├── PETRI4.CLU │ │ │ │ ├── PETRI4.NET │ │ │ │ ├── PETRI5.CLU │ │ │ │ ├── PETRI5.NET │ │ │ │ ├── PETRI51.CLU │ │ │ │ ├── PETRI51.NET │ │ │ │ ├── PETRI51X.NET │ │ │ │ ├── PETRI51Y.NET │ │ │ │ ├── PETRI52.CLU │ │ │ │ ├── PETRI52.NET │ │ │ │ ├── PETRI52X.NET │ │ │ │ ├── PETRI52Y.NET │ │ │ │ ├── PETRI53.NET │ │ │ │ ├── PETRI5X.NET │ │ │ │ ├── PETRI5Y.NET │ │ │ │ ├── PITT.NET │ │ │ │ ├── PRIME.NET │ │ │ │ ├── PRIME1.NET │ │ │ │ ├── PROT.NET │ │ │ │ ├── PROTI.NET │ │ │ │ ├── SAMPLE10.NET │ │ │ │ ├── SAMPLE6.NET │ │ │ │ ├── SAMPLE9.NET │ │ │ │ ├── SHAPES.CFG │ │ │ │ ├── SHORT.NET │ │ │ │ ├── SHR.HIE │ │ │ │ ├── SHR.NET │ │ │ │ ├── SHR.PER │ │ │ │ ├── SHRINK.CLS │ │ │ │ ├── SHRINK.CLU │ │ │ │ ├── SHRINK.HIE │ │ │ │ ├── SHRINK.NET │ │ │ │ ├── SHRINK.PER │ │ │ │ ├── SHRINK1.CLU │ │ │ │ ├── SHRINK1.HIE │ │ │ │ ├── SHRINK1.NET │ │ │ │ ├── SHRINK2.HIE │ │ │ │ ├── SHRINK2.NET │ │ │ │ ├── SHRINK4.NET │ │ │ │ ├── SLOVEN.NET │ │ │ │ ├── STROPIC.NET │ │ │ │ ├── T.NET │ │ │ │ ├── TEST1.NET │ │ │ │ ├── TINA.NET │ │ │ │ ├── TINA1.CLU │ │ │ │ ├── TINA1.HIE │ │ │ │ ├── TINA2.CLU │ │ │ │ ├── TINA2.HIE │ │ │ │ ├── TINAMATR.NET │ │ │ │ ├── TRANS.NET │ │ │ │ ├── TRANS1.CLU │ │ │ │ ├── TRANS2.CLU │ │ │ │ ├── TestPajekParser.java │ │ │ │ ├── WHITT.NET │ │ │ │ ├── WIRTH.CLU │ │ │ │ ├── WIRTH.NET │ │ │ │ ├── WRITE.CLU │ │ │ │ ├── WRITE.NET │ │ │ │ ├── WRITE.PER │ │ │ │ └── WRITE1.CLU │ │ └── test │ │ │ ├── TestFileSinkBase.java │ │ │ ├── TestFileSinkDGS.java │ │ │ ├── TestFileSinkDOT.java │ │ │ ├── TestFileSinkGraphML.java │ │ │ ├── TestFileSourceBase.java │ │ │ ├── TestFileSourceDGS.java │ │ │ ├── TestFileSourceDOT.java │ │ │ ├── TestFileSourceEdge.java │ │ │ ├── TestFileSourceGEXF.java │ │ │ ├── TestFileSourceGML.java │ │ │ ├── TestFileSourceGraphML.java │ │ │ └── data │ │ │ ├── basic.gexf │ │ │ ├── data.gexf │ │ │ ├── example-extraattributes.graphml │ │ │ ├── example.graphml │ │ │ ├── undirectedTriangle.dgs │ │ │ ├── undirectedTriangle.dot │ │ │ ├── undirectedTriangle.edge │ │ │ └── undirectedTriangle.gml │ ├── net │ │ └── test │ │ │ └── TestRMI.java │ ├── netstream │ │ └── test │ │ │ ├── ExampleNetStreamClientReceives.java │ │ │ ├── ExampleNetStreamClientSends.java │ │ │ ├── TestNetStreamDecoder.java │ │ │ ├── TestNetStreamEncoder.java │ │ │ └── TestNetStreamUtils.java │ ├── sync │ │ └── TestSync.java │ ├── test │ │ ├── TestAnnotatedSink.java │ │ ├── TestAutoCreateInStreams.java │ │ └── TestSourceBase.java │ └── thread │ │ └── test │ │ └── TestThreadProxyPipe.java │ ├── ui │ ├── graphicGraph │ │ ├── parser │ │ │ └── test │ │ │ │ └── TestStyleSheet.java │ │ └── test │ │ │ ├── TestGraphSynchronisationProxyThread.java │ │ │ └── TestGraphicGraph.java │ └── test │ │ └── util │ │ └── Display.java │ └── util │ └── test │ ├── TestDisplay.java │ ├── TestEnvironment.java │ └── data │ └── TestFilteredIterators.dgs └── src └── org └── graphstream ├── graph ├── BreadthFirstIterator.java ├── CompoundAttribute.java ├── DepthFirstIterator.java ├── Edge.java ├── EdgeFactory.java ├── EdgeRejectedException.java ├── Element.java ├── ElementNotFoundException.java ├── Graph.java ├── GraphFactory.java ├── IdAlreadyInUseException.java ├── Node.java ├── NodeFactory.java ├── Path.java ├── Structure.java ├── implementations │ ├── AbstractEdge.java │ ├── AbstractElement.java │ ├── AbstractGraph.java │ ├── AbstractNode.java │ ├── AdjacencyListGraph.java │ ├── AdjacencyListNode.java │ ├── DefaultGraph.java │ ├── Graphs.java │ ├── MultiGraph.java │ ├── MultiNode.java │ ├── OneAttributeElement.java │ ├── SingleGraph.java │ ├── SingleNode.java │ └── package-info.java └── package-info.java ├── stream ├── AnnotatedSink.java ├── AttributePipe.java ├── AttributePredicate.java ├── AttributeSink.java ├── ElementSink.java ├── GraphParseException.java ├── GraphReplay.java ├── Pipe.java ├── PipeAdapter.java ├── PipeBase.java ├── ProxyPipe.java ├── Replayable.java ├── Sink.java ├── SinkAdapter.java ├── Source.java ├── SourceAdapter.java ├── SourceBase.java ├── Timeline.java ├── binary │ ├── ByteDecoder.java │ ├── ByteEncoder.java │ ├── ByteFactory.java │ └── ByteProxy.java ├── file │ ├── FileSink.java │ ├── FileSinkBase.java │ ├── FileSinkBaseFiltered.java │ ├── FileSinkDGS.java │ ├── FileSinkDGSFiltered.java │ ├── FileSinkDGSUtility.java │ ├── FileSinkDOT.java │ ├── FileSinkDynamicGML.java │ ├── FileSinkFactory.java │ ├── FileSinkGEXF.java │ ├── FileSinkGEXF2.java │ ├── FileSinkGML.java │ ├── FileSinkGraphML.java │ ├── FileSinkImages.java │ ├── FileSinkSVG.java │ ├── FileSinkTikZ.java │ ├── FileSinkUnstyledSVG.java │ ├── FileSource.java │ ├── FileSourceBase.java │ ├── FileSourceDGS.java │ ├── FileSourceDGS1And2.java │ ├── FileSourceDOT.java │ ├── FileSourceEdge.java │ ├── FileSourceFactory.java │ ├── FileSourceGEXF.java │ ├── FileSourceGML.java │ ├── FileSourceGPX.java │ ├── FileSourceGPX.xsd │ ├── FileSourceGraphML.java │ ├── FileSourceLGL.java │ ├── FileSourceNCol.java │ ├── FileSourcePajek.java │ ├── FileSourceParser.java │ ├── FileSourceTLP.java │ ├── FileSourceXML.java │ ├── dgs │ │ ├── DGSParser.java │ │ └── OldFileSourceDGS.java │ ├── dot │ │ ├── DOTParser.java │ │ ├── DOTParser.jj │ │ ├── DOTParserConstants.java │ │ └── DOTParserTokenManager.java │ ├── gexf │ │ ├── GEXF.java │ │ ├── GEXFAttValue.java │ │ ├── GEXFAttValues.java │ │ ├── GEXFAttribute.java │ │ ├── GEXFAttributes.java │ │ ├── GEXFEdge.java │ │ ├── GEXFEdges.java │ │ ├── GEXFElement.java │ │ ├── GEXFGraph.java │ │ ├── GEXFMeta.java │ │ ├── GEXFNode.java │ │ ├── GEXFNodes.java │ │ ├── GEXFSpell.java │ │ ├── GEXFSpells.java │ │ └── SmartXMLWriter.java │ ├── gml │ │ ├── GMLContext.java │ │ ├── GMLParser.java │ │ ├── GMLParser.jj │ │ ├── GMLParserConstants.java │ │ └── GMLParserTokenManager.java │ ├── images │ │ ├── CustomResolution.java │ │ ├── FileSinkImagesFactory.java │ │ ├── Filter.java │ │ ├── Resolution.java │ │ ├── Resolutions.java │ │ └── filters │ │ │ └── AddLogoFilter.java │ ├── pajek │ │ ├── PajekContext.java │ │ ├── PajekParser.java │ │ ├── PajekParser.jj │ │ ├── PajekParserConstants.java │ │ └── PajekParserTokenManager.java │ └── tlp │ │ ├── TLPParser.java │ │ ├── TLPParser.jj │ │ ├── TLPParserConstants.java │ │ └── TLPParserTokenManager.java ├── net │ └── URLSource.java ├── netstream │ ├── NetStreamConstants.java │ ├── NetStreamDecoder.java │ ├── NetStreamEncoder.java │ └── NetStreamUtils.java ├── package-info.java ├── rmi │ ├── RMIAdapterIn.java │ ├── RMIAdapterOut.java │ ├── RMISink.java │ └── RMISource.java ├── sync │ ├── SinkTime.java │ └── SourceTime.java └── thread │ └── ThreadProxyPipe.java ├── ui ├── geom │ ├── Point2.java │ ├── Point3.java │ ├── Vector2.java │ └── Vector3.java ├── graphicGraph │ ├── GraphPosLengthUtils.java │ ├── GraphicEdge.java │ ├── GraphicElement.java │ ├── GraphicElementChangeListener.java │ ├── GraphicGraph.java │ ├── GraphicNode.java │ ├── GraphicSprite.java │ ├── HowItWorks.mkd │ ├── StyleGroup.java │ ├── StyleGroupListener.java │ ├── StyleGroupSet.java │ ├── package-info.java │ └── stylesheet │ │ ├── Color.java │ │ ├── Colors.java │ │ ├── HowItWorks.mkd │ │ ├── Rule.java │ │ ├── Selector.java │ │ ├── Style.java │ │ ├── StyleConstants.java │ │ ├── StyleSheet.java │ │ ├── StyleSheetListener.java │ │ ├── The_GraphStream_CSS │ │ ├── The_GraphStream_CSS_Dyn │ │ ├── Value.java │ │ ├── Values.java │ │ ├── package-info.java │ │ ├── parser │ │ ├── StyleSheetParser.java │ │ ├── StyleSheetParser.jj │ │ ├── StyleSheetParserConstants.java │ │ ├── StyleSheetParserTokenManager.java │ │ └── package-info.java │ │ └── rgb.properties ├── layout │ ├── Layout.java │ ├── LayoutRunner.java │ ├── Layouts.java │ ├── package-info.java │ └── springbox │ │ ├── BarnesHutLayout.java │ │ ├── EdgeSpring.java │ │ ├── Energies.java │ │ ├── GraphCellData.java │ │ ├── HowItWorks.rst │ │ ├── NodeParticle.java │ │ └── implementations │ │ ├── LinLog.java │ │ ├── LinLogNodeParticle.java │ │ ├── SpringBox.java │ │ └── SpringBoxNodeParticle.java ├── spriteManager │ ├── InvalidSpriteIDException.java │ ├── Sprite.java │ ├── SpriteFactory.java │ └── SpriteManager.java └── view │ ├── GraphRenderer.java │ ├── GraphRendererBase.java │ ├── HowItWorks │ ├── LayerRenderer.java │ ├── Selection.java │ ├── View.java │ ├── Viewer.java │ ├── ViewerListener.java │ ├── ViewerPipe.java │ ├── camera │ ├── AreaSkeleton.java │ ├── Backend.java │ ├── Camera.java │ ├── ConnectorSkeleton.java │ ├── DefaultCamera2D.java │ └── Skeleton.java │ └── util │ ├── FpsCounter.java │ ├── GraphMetrics.java │ ├── InteractiveElement.java │ ├── MouseManager.java │ └── ShortcutManager.java └── util ├── Display.java ├── Environment.java ├── GraphDiff.java ├── GraphListeners.java ├── MissingDisplayException.java ├── StepCounter.java ├── VerboseSink.java ├── cumulative ├── CumulativeAttributes.java ├── CumulativeSpells.java └── GraphSpells.java ├── parser ├── ParseException.java ├── Parser.java ├── ParserFactory.java ├── SimpleCharStream.java ├── Token.java ├── TokenMgrError.java └── template.jj ├── set └── FixedArrayList.java └── time ├── ISODateComponent.java └── ISODateIO.java /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .classpath 3 | .project 4 | bin/ 5 | target/ 6 | *.jar 7 | *.jardesc 8 | .idea 9 | gs-core.iml 10 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Antoine Dutot Antoine 2 | Antoine Dutot Antoine 3 | Antoine Dutot Antoine Dutot 4 | Antoine Dutot Antoine Dutot 5 | Antoine Dutot Antoine Dutot 6 | Antoine Dutot Antoine Dutot 7 | Antoine Dutot Ant01n3 8 | 9 | Guilhelm Savin Guilhelm Savin 10 | Guilhelm Savin Guilhelm Savin 11 | Guilhelm Savin gsavin 12 | 13 | Hicham Brahimi Hicham Brahimi 14 | Hicham Brahimi hichbra 15 | 16 | Yoann Pigné Yoann PIGNE 17 | Yoann Pigné Yoann Pigne 18 | Yoann Pigné Yoann Pigné 19 | Yoann Pigné Yoann Pigné 20 | Yoann Pigné pigne 21 | 22 | Stefan Balev sbalev 23 | Stefan Balev Stefan Balev 24 | Stefan Balev Stefan Balev -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | install: true 4 | script: mvn clean install 5 | 6 | cache: 7 | directories: 8 | - $HOME/.m2 -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GraphStream is a library whose purpose is to handle static or dynamic 2 | graph, create them from scratch, file or any source and display them. 3 | 4 | This program is free software distributed under the terms of two licenses, the 5 | CeCILL-C license that fits European law, and the GNU Lesser General Public 6 | License. You can use, modify and/ or redistribute the software under the terms 7 | of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 8 | URL or under the terms of the GNU LGPL as published by 9 | the Free Software Foundation, either version 3 of the License, or (at your 10 | option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public License 17 | along with this program. If not, see . 18 | 19 | The fact that you are presently reading this means that you have had 20 | knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 21 | -------------------------------------------------------------------------------- /LICENSE.CECILL-C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphstream/gs-core/950b87280075f92a85b564b47ce6522ced5ba53a/LICENSE.CECILL-C -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 6 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | ## [2.0.0-beta] - 2019-11 11 | 12 | ### Added 13 | 14 | - Normalize the mouse interaction between various implementations. 15 | 16 | ## [2.0-alpha] - 2018-05 17 | 18 | ### Added 19 | 20 | - Stub for new UI modules (Swing, JavaFX, Android...) 21 | - Java8+ Streams to iterate through nodes edges and so on. For instance, method `Stream nodes()` from interface `org.graphstream.graph.Structure` (superinterface of `Graph`) returns a stream of nodes. 22 | 23 | ### Changed 24 | 25 | - Serious modification of the code base in order to use Java8 Stream in place of iterators. 26 | 27 | ### Removed 28 | 29 | - The basic swing viewer 30 | - ` Iterator getNodeIterator()` (and `Edge`) 31 | and `eachEdge()` iterators from `Structure` in favore of streams. 32 | - ` Iterable getEachNode()` (and `Edge`) iterables from `Structure` in favore of streams. 33 | - the `addAttribute()` method from `Element` as it was no more than a confusing alias for `setAttribute()`. 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /javadoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src-test/org/graphstream/graph/test/PathTest.java: -------------------------------------------------------------------------------- 1 | package org.graphstream.graph.test; 2 | 3 | import org.graphstream.graph.Graph; 4 | import org.graphstream.graph.Path; 5 | import org.graphstream.graph.implementations.DefaultGraph; 6 | import org.junit.Test; 7 | 8 | public class PathTest { 9 | 10 | @Test(expected = IllegalArgumentException.class) 11 | public void add_nodeHeadMustBeInEdge() { 12 | Graph graph = createSimpleGraph(); 13 | Path path = new Path(); 14 | 15 | path.setRoot(graph.getNode("a")); 16 | 17 | // this has to fail as there is no edge between nodes "a" and "c" 18 | path.add(graph.getEdge("cd")); 19 | } 20 | 21 | @Test(expected = IllegalArgumentException.class) 22 | public void add_whenAddingEdgeRootMustBeSet() { 23 | Graph graph = createSimpleGraph(); 24 | Path path = new Path(); 25 | 26 | // this has to fail as root of the path is not set 27 | path.add(graph.getEdge("ab")); 28 | } 29 | 30 | private Graph createSimpleGraph() { 31 | Graph graph = new DefaultGraph("test"); 32 | graph.setStrict(false); 33 | graph.setAutoCreate(true); 34 | 35 | graph.addEdge("ab", "a", "b"); 36 | graph.addEdge("bc", "b", "c"); 37 | graph.addEdge("cd", "c", "d"); 38 | 39 | return graph; 40 | } 41 | } -------------------------------------------------------------------------------- /src-test/org/graphstream/graph/test/TestElementAttributeConcurrency.java: -------------------------------------------------------------------------------- 1 | package org.graphstream.graph.test; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import java.util.ArrayList; 6 | 7 | import org.graphstream.graph.Graph; 8 | import org.graphstream.graph.Node; 9 | import org.graphstream.graph.implementations.Graphs; 10 | import org.graphstream.graph.implementations.SingleGraph; 11 | import org.junit.Test; 12 | 13 | public class TestElementAttributeConcurrency { 14 | private ArrayList threads = new ArrayList(); 15 | 16 | @Test 17 | public void TestNoExceptionElementConcurrency(){ 18 | Graph graph = new SingleGraph("Graph"); 19 | Node s = graph.addNode("s"); 20 | Node t = graph.addNode("t"); 21 | Node v = graph.addNode("v"); 22 | 23 | graph.addEdge("st", "s", "t", true); 24 | graph.addEdge("tv", "t", "v", true); 25 | 26 | Graph graphSynchro = Graphs.synchronizedGraph(graph); 27 | 28 | for (int i=0; i < 10 ; i++) { 29 | //System.out.println("start thread "+i); 30 | TestRunnable r = new TestRunnable(i, graphSynchro) ; 31 | threads.add(r); 32 | 33 | Thread th = new Thread(r, "Thread "+i); 34 | th.start(); 35 | } 36 | 37 | while(!threads.isEmpty()) { 38 | for (int i=0; i < threads.size() ; i++) { 39 | if (threads.get(i).getResult() != null) { 40 | assertTrue(threads.get(i).getResult()); 41 | threads.remove(i); 42 | } 43 | } 44 | } 45 | } 46 | 47 | class TestRunnable implements Runnable { 48 | private int i; 49 | private Graph g ; 50 | private Boolean result ; 51 | 52 | public TestRunnable(int i, Graph g) { 53 | this.i = i ; 54 | this.g = g ; 55 | this.result = null; 56 | } 57 | 58 | public void run() { 59 | try { 60 | for (int j=0; j < 100000 ; j++) { 61 | g.setAttribute("Test", "Graph "+i); 62 | g.getNode("s").setAttribute("Test", "Node "+i); 63 | g.getEdge("st").setAttribute("Test", "Edge "+i); 64 | } 65 | 66 | this.result = true ; 67 | } catch (Exception e) { 68 | this.result = false; 69 | } 70 | } 71 | 72 | public Boolean getResult() { 73 | return result; 74 | } 75 | 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/attributes.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | null 0 0 3 | 4 | # 5 | # A first well-written line 6 | # 7 | an A int:123 double:123.321 string:"a string" word:"aWord" array:{1,2,3} map:[a=1,b=2,c=3] color:#FF0000 big_sci:1.27E+07 small_sci:1.27E-07 neg_sci:-1.27E-07 8 | cn A aoa:{{1,2},{3},{4,5}} 9 | 10 | # 11 | # A second bad-written line but that has to be read 12 | # 13 | an B int=123 double: 123.321 string:"a string" word:"aWord" array:{ 1, 2,3 } map:[ a = 1, b=2, c= 3 ] color:#FF0000 big_sci: 1.27e7 small_sci: 1.27e-7 neg_sci: -1.27e-7 14 | cn B aoa:{{1,2},{3},{4,5}} 15 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/attributes_array.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | test 0 0 3 | an A a1:"A","B","C" a2:{"A","B","C"} 4 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/bad1.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | bad 0 0 3 | 4 | # 5 | # This is a bad example because first line 6 | # contains some spaces after "DGS004". 7 | # 8 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/bad2.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | bad 0 0 3 | 4 | an A 5 | 6 | # 7 | # This is a bad example because lines should start with 8 | # a DGS directive, a '#' or be empty. 9 | # 10 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/elements.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | elements 0 0 3 | 4 | an A 5 | an "B" 6 | an C 7 | 8 | ae AB A B 9 | ae AC A > C 10 | ae BC C < B 11 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/dgs/test/data/removeAttribute.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | null 0 0 3 | 4 | st 0.0 5 | an "A" 6 | cn "A" +"attribute":"content" 7 | 8 | st 1.0 9 | cn "A" "attribute":"content 2" 10 | 11 | st 2.0 12 | cn "A" -"attribute" 13 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/gml/test/SmallTest.gml: -------------------------------------------------------------------------------- 1 | Author "GraphStream" 2 | Graph [ 3 | Node [ 4 | Id 1 5 | Label "AYZE34" 6 | Graphics [ 7 | x 0 8 | y 0 9 | w 10 10 | h 10 11 | fill "#fbf6fb" 12 | outline "#cccccc" 13 | outline_width 1 14 | type "ellipse" 15 | ] 16 | ] 17 | Node [ 18 | Id 2 19 | Label "UYET29" 20 | Graphics [ 21 | x 0.5 22 | y 1 23 | w 10 24 | h 10 25 | fill "#daf0da" 26 | outline "#cccccc" 27 | outline_width 1 28 | type "ellipse" 29 | ] 30 | ] 31 | Node [ 32 | Id 3 33 | Label "DSJHI45" 34 | Graphics [ 35 | x 1 36 | y 0 37 | w 10 38 | h 10 39 | fill "#f7fcf7" 40 | outline "#cccccc" 41 | outline_width 1 42 | type "ellipse" 43 | ] 44 | ] 45 | Directed true 46 | Edge [ 47 | source 1 48 | target 2 49 | Graphics [ 50 | type "line" 51 | fill "#9999ff" 52 | width 1.0 53 | ] 54 | Label "U" 55 | ] 56 | 57 | Edge [ 58 | source 2 59 | target 3 60 | Graphics [ 61 | type "line" 62 | fill "#9999ff" 63 | width 1.0 64 | ] 65 | Label "Y" 66 | ] 67 | Edge [ 68 | source 3 69 | target 1 70 | Graphics [ 71 | type "line" 72 | fill "#9999ff" 73 | width 1.0 74 | ] 75 | Label "O" 76 | ] 77 | ] 78 | Version "1.0" -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/gml/test/dynamic.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | Id "Dynamic" 3 | 4 | step 1 5 | 6 | node [ Id "A" ] 7 | node [ Id "B" ] 8 | node [ Id "C" ] 9 | 10 | step 2 11 | 12 | edge [ Id "AB" Source "A" Target "B" ] 13 | edge [ Id "BC" Source "B" Target "C" ] 14 | edge [ Id "CA" Source "C" Target "A" ] 15 | 16 | step 3 17 | 18 | +node [ Id "B" graphics [ 19 | fill "red" 20 | ]] 21 | 22 | step 4 23 | 24 | -node [ Id "A" ] 25 | 26 | step 5 27 | 28 | +node [ Id "B" Label "foo" ] 29 | 30 | step 6 31 | 32 | -edge "BC" 33 | 34 | step 7 35 | 36 | node "Z" 37 | 38 | step 8 39 | 40 | +node [ Id "B" -Label [] ] 41 | 42 | step 9 43 | 44 | directed true 45 | 46 | edge [ Id "ZB" Source "Z" Target "B" ] 47 | edge [ Id "ZC" Source "Z" Target "C" ] 48 | edge [ Id "BC" Source "B" Target "C" ] 49 | ] -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/1.CLU: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 4 4 | 5 5 | 6 6 | 7 7 | 8 8 | 9 9 | 10 10 | 11 11 | 12 12 | 13 13 | 14 14 | 15 15 | 16 16 | 17 17 | 18 18 | 19 19 | 20 20 | 21 21 | 22 22 | 23 23 | 24 24 | 25 25 | 26 26 | 1 27 | 28 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/AHO1.NET: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 "1" 0.3034 0.7561 3 | 2 "2" 0.4565 0.6039 4 | 3 "3" 0.4887 0.8188 5 | 4 "4" 0.5687 0.4184 6 | 5 "5" 0.3574 0.4180 7 | 6 "6" 0.7347 0.2678 8 | 7 "7" 0.9589 0.3105 9 | 8 "8" 0.8833 0.1269 10 | 9 "9" 0.7034 0.0411 11 | *Arcs 12 | *Edges 13 | 1 2 1 14 | 1 3 1 15 | 2 3 1 16 | 2 4 1 17 | 2 5 1 18 | 4 5 1 19 | 4 6 1 20 | 6 7 1 21 | 6 8 1 22 | 6 9 1 23 | 7 8 1 24 | 8 9 1 25 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/AHO2.NET: -------------------------------------------------------------------------------- 1 | *Network aho2 2 | *Vertices 9 3 | *Edges 4 | 1 2 5 | 1 9 6 | 2 9 7 | 2 3 8 | 2 8 9 | 3 8 10 | 3 4 11 | 4 5 12 | 4 7 13 | 5 7 14 | 5 6 15 | 6 4 16 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/AHO3.NET: -------------------------------------------------------------------------------- 1 | *Network aho3 2 | *Vertices 10 3 | *Edges 4 | 1 2 5 | 1 3 6 | 2 3 7 | 2 4 8 | 4 5 9 | 5 6 10 | 6 7 11 | 5 7 12 | 7 8 13 | 8 9 14 | 9 10 15 | 8 10 -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/AHO4.NET: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 1 0.0 0.0 3 | 2 2 0.0 0.0 4 | 3 3 0.0 0.0 5 | 4 4 0.0 0.0 6 | 5 5 0.0 0.0 7 | 6 6 0.0 0.0 8 | 7 7 0.0 0.0 9 | 8 8 0.0 0.0 10 | 9 9 0.0 0.0 11 | *Arcs 12 | *Edges 13 | 1 2 1 14 | 1 3 1 15 | 2 3 1 16 | 1 4 1 17 | 5 6 1 18 | 5 7 1 19 | 6 7 1 20 | 6 8 1 21 | 7 8 1 22 | 6 9 1 23 | 8 9 1 24 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/C6H12.MAC: -------------------------------------------------------------------------------- 1 | ;c6h12.mac 2 | ;Stick color 3 | 2(0.700, 0.700, 0.700) 4 | ;Model 5 | BS 6 | L=1.810,0.362(0.000,0.000,0.100) 7 | X=1.500,0.750(0.000,0.000,0.000) 8 | L1: 3.5340 -3.1220 -0.3290 9 | X1: 1.8310 -1.6180 0.4430 10 | X2: 0.4850 2.3950 0.4430 11 | X3: -2.3160 -0.7770 0.4430 12 | X4: -1.8310 1.6180 -0.4430 13 | X5: -0.4850 -2.3950 -0.4430 14 | X6: 2.3160 0.7770 -0.4430 15 | L2: 0.4760 2.3510 2.8430 16 | L3: -2.2740 -0.7630 2.8430 17 | L4: -1.7980 1.5880 -2.8430 18 | L5: -0.4760 -2.3510 -2.8430 19 | L6: 2.2740 0.7630 -2.8430 20 | L7: 1.7980 -1.5880 2.8430 21 | L8: 0.9370 4.6220 -0.3290 22 | L9: -4.4710 -1.5000 -0.3290 23 | L10: -3.5340 3.1220 0.3290 24 | L11: -0.9370 -4.6220 0.3290 25 | L12: 4.4710 1.5000 0.3290 26 | ;Bonds 27 | L1,X1 28 | X1,X2 29 | X1,X3 30 | X1,X5 31 | X1,X6 32 | X1,L7 33 | X2,X3 34 | X2,X4 35 | X2,X6 36 | X2,L2 37 | X2,L8 38 | X3,X4 39 | X3,X5 40 | X3,L3 41 | X3,L9 42 | X4,X5 43 | X4,X6 44 | X4,L4 45 | X4,L10 46 | X5,X6 47 | X5,L5 48 | X5,L11 49 | X6,L6 50 | X6,L12 51 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/CITE.NET: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 One 3 | 2 Two 4 | 3 Three 5 | 4 Four 6 | 5 Five 7 | 6 Six 8 | 7 Seven 9 | 8 Eight 10 | 9 Nine 11 | *Arcslist 12 | -1 3 5 13 | -2 3 4 14 | -3 4 15 | -4 5 16 | -5 6 7 8 17 | -6 8 9 18 | -7 8 9 19 | 20 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/CPM1.NET: -------------------------------------------------------------------------------- 1 | *Vertices 8 2 | 1 "1" 0.4122 0.0464 3 | 2 "2" 0.3801 0.2866 4 | 3 "3" 0.1379 0.4257 5 | 4 "4" 0.3715 0.4831 6 | 5 "5" 0.2401 0.6751 7 | 6 "6" 0.5800 0.4798 8 | 7 "7" 0.4997 0.7396 9 | 8 "8" 0.6172 0.9536 10 | *Arcs 11 | 1 2 12 l plan 12 | 2 3 8 l choose_place 13 | 2 4 4 l choose_supplier 14 | 2 6 3 l choose_employees 15 | 4 6 5 l writing_manuals 16 | 3 5 12 l building 17 | 4 5 18 l do_equipment 18 | 6 7 9 l training_employees 19 | 5 7 4 l installing_eqipment 20 | 7 8 6 l start 21 | *Edges 22 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/CPM2.NET: -------------------------------------------------------------------------------- 1 | *Vertices 7 2 | 1 "1" 0.6748 0.9471 3 | 2 "2" 0.6438 0.5902 4 | 3 "3" 0.6413 0.1926 5 | 4 "4" 0.3291 0.4104 6 | 5 "5" 0.3600 0.1603 7 | 6 "6" 0.3336 0.8347 8 | 7 "7" 0.0529 0.5324 9 | *Arcs 10 | 1 2 1 11 | 2 3 2 12 | 3 5 1 13 | 2 4 3 14 | 4 5 3 15 | 1 6 4 16 | 2 6 2 17 | 6 7 4 18 | 7 4 1 19 | 7 5 2 20 | *Edges 21 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/CPM3.NET: -------------------------------------------------------------------------------- 1 | *Vertices 21 2 | 1 1 3 | 2 2 4 | 3 3 5 | 4 4 6 | 5 5 7 | 6 6 8 | 7 7 9 | 8 8 10 | 9 9 11 | 10 10 12 | 11 11 13 | 12 12 14 | 13 13 15 | 14 14 16 | 15 15 17 | 16 16 18 | 17 17 19 | 18 18 20 | 19 19 21 | 20 20 22 | 21 21 23 | *Arcs 24 | 1 2 3 l PREUcEVANJE_NALOGE 25 | 2 4 4 l UGOTAVLJANJE_NERABNE_OPREME 26 | 2 3 2 l UGOTAVLJANJE_OPREME_ZA_SELITEV 27 | 2 5 5 l SPISEK_NABAVE_NOVE_OPREME 28 | 6 7 3 l ORGANIZACIJA_TRANSPORTA 29 | 4 8 1 l OZNAcEVANJE_NERABNE_OPREME 30 | 3 9 1 l OZNAcEVANJE_OPREME_ZA_POPRAVILO 31 | 3 10 1 l OZNAcEVANJE_OPREME_ZA_SELITEV 32 | 8 12 3 l DEMONTIRANJE_NERABNE_OPREME 33 | 9 11 3 l DEMONTIRANJE_OPREME_ZA_POPRAVILO 34 | 10 13 3 l DEMONTIRANJE_OPREME_ZA_SELITEV 35 | 12 17 5 l PRODAJA_NERABNE_OPREME 36 | 11 14 7 l POPRAVILO_OPREME 37 | 13 15 3 l PAKIRANJE_OPREME_ZA_SELITEV 38 | 14 16 2 l PAKIRANJE_POPRAVLJENE_OPREME 39 | 15 18 4 l TRANSPORT_DOBRE_OPREME 40 | 16 18 3 l TRANSPORT_POPRAVLJENE_OPREME 41 | 5 18 14 l DOSTAVA_NOVE_OPREME 42 | 18 19 10 l MONTAzA_OPREME 43 | 19 20 2 l PREGLED_IZVRsENE_MONTAzE 44 | 17 20 3 l cIscENJE_STARE_LOKACIJE 45 | 20 21 2 l ZAKLJUcNA_DELA_NA_NOVI_LOKACIJI 46 | 4 6 0 47 | 3 6 0 48 | 7 16 0 49 | 7 15 0 50 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/DREV1.CLU: -------------------------------------------------------------------------------- 1 | *Vertices 37 2 | 6 3 | 1 4 | 2 5 | 3 6 | 4 7 | 4 8 | 3 9 | 4 10 | 4 11 | 3 12 | 4 13 | 4 14 | 2 15 | 3 16 | 4 17 | 4 18 | 3 19 | 4 20 | 4 21 | 1 22 | 2 23 | 3 24 | 4 25 | 4 26 | 3 27 | 4 28 | 4 29 | 2 30 | 3 31 | 4 32 | 4 33 | 3 34 | 4 35 | 4 36 | 3 37 | 4 38 | 4 39 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/DREVO.NET: -------------------------------------------------------------------------------- 1 | *Vertices 14 2 | 1 "1" 0.6069 0.2899 3 | 2 "2" 0.3122 0.3106 4 | 3 "3" 0.7256 0.1690 5 | 4 "4" 0.5044 0.9209 6 | 5 "5" 0.9519 0.5180 7 | 6 "6" 0.4652 0.5948 8 | 7 "7" 0.4688 0.4069 9 | 8 "8" 0.2968 0.6649 10 | 9 "9" 0.8373 0.0481 11 | 10 "10" 0.5621 0.7513 12 | 11 "11" 0.9353 0.6531 13 | 12 "12" 0.9137 0.8878 14 | 13 "13" 0.7270 0.8141 15 | 14 "14" 0.1652 0.2243 16 | *Arcs 17 | *Edges 18 | 1 3 1 19 | 1 7 1 20 | 2 7 1 21 | 6 7 1 22 | 2 14 1 23 | 6 8 1 24 | 6 10 1 25 | 4 10 1 26 | 10 13 1 27 | 3 9 1 28 | 11 12 1 29 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/ETHANOL.MAC: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 "C" 0.1832 0.4252 0.4077 x_fact 1.850 ic 0.500 0.500 0.500 3 | 2 "C" 0.6087 0.4337 0.5851 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "H" 0.0995 0.0202 0.3018 x_fact 1.200 ic 1.000 1.000 1.000 5 | 4 "H" 0.0143 0.5715 0.7748 x_fact 1.200 ic 1.000 1.000 1.000 6 | 5 "H" 0.1398 0.6778 0.0225 x_fact 1.200 ic 1.000 1.000 1.000 7 | 6 "H" 0.7805 0.2846 0.2108 x_fact 1.200 ic 1.000 1.000 1.000 8 | 7 "H" 0.6528 0.1762 0.9775 x_fact 1.200 ic 1.000 1.000 1.000 9 | 8 "O" 0.7205 0.9745 0.7266 x_fact 1.400 ic 1.000 0.000 0.000 10 | 9 "H" 0.9857 0.9798 0.8369 x_fact 1.200 ic 1.000 1.000 1.000 11 | *Arcs 12 | *Edges 13 | 1 2 1 c 0.700 0.700 0.700 14 | 1 3 1 15 | 1 4 1 16 | 1 5 1 17 | 2 6 1 18 | 2 7 1 19 | 2 8 1 20 | 8 9 1 21 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/ETHANOL.NET: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 "C" 0.1832 0.4252 0.4077 x_fact 1.850 ic 0.500 0.500 0.500 3 | 2 "C" 0.6087 0.4337 0.5851 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "H" 0.0995 0.0202 0.3018 x_fact 1.200 ic 1.000 1.000 1.000 5 | 4 "H" 0.0143 0.5715 0.7748 x_fact 1.200 ic 1.000 1.000 1.000 6 | 5 "H" 0.1398 0.6778 0.0225 x_fact 1.200 ic 1.000 1.000 1.000 7 | 6 "H" 0.7805 0.2846 0.2108 x_fact 1.200 ic 1.000 1.000 1.000 8 | 7 "H" 0.6528 0.1762 0.9775 x_fact 1.200 ic 1.000 1.000 1.000 9 | 8 "O" 0.7205 0.9745 0.7266 x_fact 1.400 ic 1.000 0.000 0.000 10 | 9 "H" 0.9857 0.9798 0.8369 x_fact 1.200 ic 1.000 1.000 1.000 11 | *Arcs 12 | *Edges 13 | 1 2 1 c 0.700 0.700 0.700 14 | 1 3 1 15 | 1 4 1 16 | 1 5 1 17 | 2 6 1 18 | 2 7 1 19 | 2 8 1 20 | 8 9 1 21 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FILE1.NET: -------------------------------------------------------------------------------- 1 | *Vertices 11 2 | 1 1 3 | 2 2 4 | 3 3 5 | 4 4 6 | 5 5 7 | 6 6 8 | 7 7 9 | 8 8 10 | 9 9 11 | 10 10 12 | 11 11 13 | *Arcs 14 | 1 2 15 | 2 3 16 | 3 4 17 | 3 5 18 | 4 3 19 | 5 2 20 | 5 6 21 | 6 7 22 | 6 8 23 | 6 9 24 | 7 10 25 | 8 10 26 | 9 10 27 | 10 11 28 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG1.NET: -------------------------------------------------------------------------------- 1 | *Vertices 5 2 | 1 "N" 0.7347 0.8583 0.4908 x_fact 1.540 ic 0.000 0.000 1.000 3 | 2 "C" 0.7607 0.8664 0.4549 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "C" 0.7709 0.9301 0.4564 x_fact 1.850 ic 0.500 0.500 0.500 5 | 4 "C" 0.7475 0.9544 0.4942 x_fact 1.850 ic 0.500 0.500 0.500 6 | 5 "C" 0.7187 0.9104 0.5174 x_fact 1.850 ic 0.500 0.500 0.500 7 | *Arcs 8 | *Edges 9 | 1 2 1 10 | 1 5 1 11 | 2 3 1 12 | 3 4 1 13 | 4 5 1 14 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG1X.NET: -------------------------------------------------------------------------------- 1 | *Vertices 6 2 | 1 "N" 0.7347 0.8583 0.4908 x_fact 1.540 ic 0.000 0.000 1.000 3 | 2 "C" 0.7607 0.8664 0.4549 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "C" 0.7709 0.9301 0.4564 x_fact 1.850 ic 0.500 0.500 0.500 5 | 4 "C" 0.7475 0.9544 0.4942 x_fact 1.850 ic 0.500 0.500 0.500 6 | 5 "C" 0.7187 0.9104 0.5174 x_fact 1.850 ic 0.500 0.500 0.500 7 | 6 "H" 0.9187 0.9 0.9 8 | *Arcs 9 | *Edges 10 | 1 2 1 11 | 1 5 1 12 | 2 3 1 13 | 3 4 1 14 | 4 5 1 15 | 2 5 1 16 | 1 6 1 17 | 2 6 1 18 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG1Y.NET: -------------------------------------------------------------------------------- 1 | *Vertices 9 2 | 1 "N" 0.2517 0.3510 0.5286 x_fact 1.540 ic 0.000 0.000 1.000 3 | 2 "C" 0.6987 0.2583 0.3077 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "C" 0.7119 0.6159 0.3169 x_fact 1.850 ic 0.500 0.500 0.500 5 | 4 "C" 0.5132 0.6755 0.5495 x_fact 1.850 ic 0.500 0.500 0.500 6 | 5 "C" 0.4007 0.5099 0.6923 x_fact 1.850 ic 0.500 0.500 0.500 7 | 6 "C" 0.5795 0.0563 0.3077 x_fact 1.850 ic 0.500 0.500 0.500 8 | 7 "C" 0.3510 0.0166 0.3169 x_fact 1.850 ic 0.500 0.500 0.500 9 | 8 "C" 0.2219 0.1060 0.5495 x_fact 1.850 ic 0.500 0.500 0.500 10 | 9 "C" 0.0993 0.2947 0.6923 x_fact 1.850 ic 0.500 0.500 0.500 11 | *Arcs 12 | *Edges 13 | 1 2 1 14 | 1 5 1 15 | 2 3 1 16 | 3 4 1 17 | 4 5 1 18 | 6 7 1 19 | 6 8 1 20 | 1 8 1 21 | 2 6 1 22 | 7 8 1 23 | 8 9 1 24 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG2.NET: -------------------------------------------------------------------------------- 1 | *Vertices 6 2 | 1 "C" 0.1354 0.4929 0.4756 x_fact 1.850 ic 0.500 0.500 0.500 3 | 2 "C" 0.0908 0.5054 0.4854 x_fact 1.850 ic 0.500 0.500 0.500 4 | 3 "C" 0.1486 0.4381 0.4671 x_fact 1.850 ic 0.500 0.500 0.500 5 | 4 "C" 0.0593 0.4627 0.4863 x_fact 1.850 ic 0.500 0.500 0.500 6 | 5 "C" 0.1156 0.3939 0.4689 x_fact 1.850 ic 0.500 0.500 0.500 7 | 6 "C" 0.0731 0.4077 0.4782 x_fact 1.850 ic 0.500 0.500 0.500 8 | *Arcs 9 | *Edges 10 | 1 2 1 11 | 1 3 1 12 | 2 4 1 13 | 3 5 1 14 | 4 6 1 15 | 5 6 1 16 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG3.NET: -------------------------------------------------------------------------------- 1 | *Vertices 3 2 | 1 "C" 0.5713 0.2156 0.8263 3 | 2 "O" 0.5663 0.1412 0.8619 4 | 3 "N" 0.6125 0.2137 0.8297 5 | *Arcs 6 | *Edges 7 | 1 2 1 8 | 1 3 1 9 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG4.NET: -------------------------------------------------------------------------------- 1 | *Vertices 5 2 | 1 "O" 0.1024 0.3801 0.4883 3 | 2 "P" 0.0624 0.3810 0.4569 4 | 3 "O" 0.0661 0.3342 0.4402 5 | 4 "O" 0.0232 0.3940 0.4653 6 | 5 "O" 0.0728 0.4106 0.4336 7 | *Arcs 8 | *Edges 9 | 1 2 1 10 | 2 3 1 11 | 2 4 1 12 | 2 5 1 13 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/FRAG5.NET: -------------------------------------------------------------------------------- 1 | *Vertices 3 2 | 1 "C" 0.2437 0.2061 0.2181 3 | 2 "C" 0.2200 0.2252 0.2839 4 | 3 "C" 0.2050 0.2271 0.2767 5 | *Arcs 6 | *Edges 7 | 1 2 1 8 | 2 3 1 9 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/pajek/test/GCD.NET: -------------------------------------------------------------------------------- 1 | *Vertices 10 2 | 1 "start" 0.4271 0.0271 0.5000 ellipse 3 | 2 "read(x)" 0.4271 0.1313 0.5000 box ic LightGreen 4 | 3 "r. 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | */ 31 | package org.graphstream.stream.file.test; 32 | 33 | import org.graphstream.stream.file.FileSinkDGS; 34 | import org.graphstream.stream.file.FileSourceDGS; 35 | import org.junit.Before; 36 | 37 | public class TestFileSinkDGS extends TestFileSinkBase { 38 | @Override 39 | protected String graphFileExtension() { 40 | return ".dgs"; 41 | } 42 | 43 | @Before 44 | @Override 45 | public void setup() { 46 | input = new FileSourceDGS(); 47 | output = new FileSinkDGS(); 48 | } 49 | } -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/TestFileSinkDOT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2011-05-11 28 | * 29 | * @author Guilhelm Savin 30 | */ 31 | package org.graphstream.stream.file.test; 32 | 33 | import org.graphstream.stream.file.FileSinkDOT; 34 | import org.graphstream.stream.file.FileSourceDOT; 35 | import org.junit.Test; 36 | 37 | public class TestFileSinkDOT extends TestFileSinkBase { 38 | 39 | public void setup() { 40 | input = new FileSourceDOT(); 41 | output = new FileSinkDOT(); 42 | formatHandleDynamics = false; 43 | formatHandlesEdgesIDs = false; 44 | } 45 | 46 | protected String graphFileExtension() { 47 | return ".dot"; 48 | } 49 | 50 | @Override 51 | @Test 52 | public void test_DirectedTriangle() { 53 | ((FileSinkDOT) output).setDirected(true); 54 | super.test_DirectedTriangle(); 55 | ((FileSinkDOT) output).setDirected(false); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/basic.gexf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/data.gexf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gephi.org 5 | A Web network 6 | 7 | 8 | 9 | 10 | 11 | 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/example-extraattributes.graphml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This is a label 7 | 8 | 9 | 1 2 10 | 11 | 12 | 2 3 13 | 14 | 15 | 3 1 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/example.graphml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This is a label 7 | 8 | 9 | 1 2 10 | 11 | 12 | 2 3 13 | 14 | 15 | 3 1 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/undirectedTriangle.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | "Undirected Triangle" 0 0 3 | an A 4 | an B 5 | an C 6 | ae AB A B 7 | ae BC B C 8 | ae CA C A 9 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/undirectedTriangle.dot: -------------------------------------------------------------------------------- 1 | graph test1 { 2 | graph [ id="test1" ]; 3 | A -- B [ id=AB ]; 4 | B -- C [ id=BC ]; 5 | C -- A [ id=CA ]; 6 | } 7 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/undirectedTriangle.edge: -------------------------------------------------------------------------------- 1 | A B 2 | B C 3 | C A 4 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/file/test/data/undirectedTriangle.gml: -------------------------------------------------------------------------------- 1 | graph [ 2 | id "test1" 3 | node [ id "A" ] 4 | node [ id "B" ] 5 | node [ id "C" ] 6 | 7 | edge [ id "AB" source "A" target "B" ] 8 | edge [ id "BC" source "B" target "C" ] 9 | edge [ id "CA" source "C" target "A" ] 10 | ] 11 | 12 | -------------------------------------------------------------------------------- /src-test/org/graphstream/stream/netstream/test/ExampleNetStreamClientSends.java: -------------------------------------------------------------------------------- 1 | package org.graphstream.stream.netstream.test; 2 | 3 | import org.graphstream.graph.Graph; 4 | import org.graphstream.graph.Node; 5 | import org.graphstream.graph.implementations.DefaultGraph; 6 | import org.graphstream.graph.implementations.MultiGraph; 7 | import org.graphstream.stream.binary.ByteProxy; 8 | import org.graphstream.stream.netstream.NetStreamUtils; 9 | import org.graphstream.util.VerboseSink; 10 | 11 | import java.io.IOException; 12 | import java.net.InetAddress; 13 | 14 | public class ExampleNetStreamClientSends { 15 | public static void main(String[] args) throws IOException, InterruptedException { 16 | 17 | 18 | System.out.println("server..."); 19 | 20 | Graph g = new MultiGraph("G",false,true); 21 | 22 | VerboseSink logout = new VerboseSink(); 23 | logout.setPrefix("server logout"); 24 | g.addSink(logout); 25 | 26 | ByteProxy server = null; 27 | try { 28 | server = new ByteProxy(NetStreamUtils.getDefaultNetStreamFactory(), 2001); 29 | } catch (IOException e) { 30 | e.printStackTrace(); 31 | } 32 | server.addSink(g); 33 | server.start(); 34 | 35 | 36 | System.out.println("client..."); 37 | 38 | String id = "ME"; 39 | String label = "Mr or Ms ME"; 40 | 41 | ByteProxy client = null; 42 | try { 43 | client = new ByteProxy(NetStreamUtils.getDefaultNetStreamFactory(), ByteProxy.Mode.CLIENT, 44 | InetAddress.getLocalHost(), 2001); 45 | } catch (IOException e) { 46 | e.printStackTrace(); 47 | } 48 | client.start(); 49 | 50 | Graph graphClient = new DefaultGraph("client"); 51 | 52 | graphClient.addSink(client); 53 | 54 | //VerboseSink clientVSink = new VerboseSink(); 55 | //clientVSink.setPrefix("client graph logout"); 56 | //graphClient.addSink(clientVSink); 57 | 58 | Node n = graphClient.addNode(id); 59 | n.setAttribute( "ui.label", label); 60 | n.setAttribute( "nope", "ok", "not ok"); 61 | 62 | client.stop(); 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src-test/org/graphstream/ui/test/util/Display.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.ui.test.util; 26 | 27 | import org.graphstream.graph.Graph; 28 | import org.graphstream.ui.view.Viewer; 29 | 30 | public class Display implements org.graphstream.util.Display { 31 | @Override 32 | public Viewer display(Graph graph, boolean autoLayout) { 33 | return null; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src-test/org/graphstream/util/test/data/TestFilteredIterators.dgs: -------------------------------------------------------------------------------- 1 | DGS004 2 | null 0 0 3 | 4 | an "A0" type:"A" 5 | an "A1" type:"A" 6 | an "A2" type:"A" 7 | 8 | ae "A01" "A0" "A1" type:"A" 9 | ae "A02" "A0" "A2" type:"A" 10 | ae "A12" "A1" "A2" type:"A" 11 | 12 | an "B0" type:"B" 13 | an "B1" type:"B" 14 | an "B2" type:"B" 15 | 16 | ae "B01" "B0" "B1" type:"B" 17 | ae "B02" "B0" "B2" type:"B" 18 | ae "B12" "B1" "B2" type:"B" 19 | 20 | an "C0" type:"C" 21 | an "C1" type:"C" 22 | an "C2" type:"C" 23 | 24 | ae "C01" "C0" "C1" type:"C" 25 | ae "C02" "C0" "C2" type:"C" 26 | ae "C12" "C1" "C2" type:"C" 27 | 28 | ae "AB" "A0" "B0" 29 | ae "AC" "A0" "C0" 30 | ae "BC" "B0" "C0" 31 | -------------------------------------------------------------------------------- /src/org/graphstream/graph/EdgeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | * @author Yoann Pigné 32 | */ 33 | package org.graphstream.graph; 34 | 35 | /** 36 | * An interface aimed at dynamically creating edge objects. 37 | * 38 | * @since September 2007 39 | */ 40 | public interface EdgeFactory { 41 | /** 42 | * Create a new instance of edge. 43 | * 44 | * @param id 45 | * The new edge identifier. 46 | * @param src 47 | * The source node. 48 | * @param dst 49 | * The target node. 50 | * @param directed 51 | * Is the edge directed (in the direction source toward target). 52 | * @return The newly created edge. 53 | */ 54 | T newInstance(String id, Node src, Node dst, boolean directed); 55 | } -------------------------------------------------------------------------------- /src/org/graphstream/graph/EdgeRejectedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2011-07-23 28 | * 29 | * @author Stefan Balev 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.graph; 34 | 35 | /** 36 | * This exception is thrown when on of the endpoints of an edge does not accept 37 | * the edge. This can happen for example when one tries to add an edge between 38 | * two already connected nodes is a single graph. 39 | * 40 | */ 41 | public class EdgeRejectedException extends RuntimeException { 42 | private static final long serialVersionUID = 4952910935083960955L; 43 | 44 | public EdgeRejectedException() { 45 | super("Edge rejected"); 46 | } 47 | 48 | public EdgeRejectedException(String message) { 49 | super(message); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/org/graphstream/graph/ElementNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-12-22 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.graph; 34 | 35 | /** 36 | * Thrown when a searched object is not found. 37 | * 38 | * @since 20020615 39 | */ 40 | public class ElementNotFoundException extends RuntimeException { 41 | private static final long serialVersionUID = 5089958436773409615L; 42 | 43 | /** 44 | * Throws the message "not found". 45 | */ 46 | public ElementNotFoundException() { 47 | super("not found"); 48 | } 49 | 50 | /** 51 | * Throws message. 52 | * 53 | * @param message 54 | * The message to throw. 55 | */ 56 | public ElementNotFoundException(String message, Object... args) { 57 | super(String.format(message, args)); 58 | } 59 | } -------------------------------------------------------------------------------- /src/org/graphstream/graph/IdAlreadyInUseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-12-22 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.graph; 34 | 35 | /** 36 | * Singleton exception. 37 | * 38 | *

39 | * This exception can be raised when a class instance should be unique in one 40 | * context, but was instantiated several times. This can be used in a 41 | * "singleton" pattern, but also in set classes (containers) when the same 42 | * element has been inserted multiple times but should not. 43 | *

44 | * 45 | * @since 19990811 46 | */ 47 | public class IdAlreadyInUseException extends RuntimeException { 48 | private static final long serialVersionUID = -3000770118436738366L; 49 | 50 | /** 51 | * Throws the message "singleton exception". 52 | */ 53 | public IdAlreadyInUseException() { 54 | super("singleton exception"); 55 | } 56 | 57 | /** 58 | * Throws a given message. 59 | * 60 | * @param message 61 | * The message to throw. 62 | */ 63 | public IdAlreadyInUseException(String message) { 64 | super("singleton exception: " + message); 65 | } 66 | } -------------------------------------------------------------------------------- /src/org/graphstream/graph/NodeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | * @author Yoann Pigné 32 | */ 33 | package org.graphstream.graph; 34 | 35 | /** 36 | * An interface aimed at dynamically creating node objects. 37 | * 38 | * @since September 2007 39 | */ 40 | public interface NodeFactory { 41 | /** 42 | * Create a new instance of node. 43 | * 44 | * @return The newly created edge. 45 | */ 46 | T newInstance(String id, Graph graph); 47 | } -------------------------------------------------------------------------------- /src/org/graphstream/graph/Structure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2012-07-05 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.graph; 33 | 34 | import java.util.stream.Stream; 35 | 36 | /** 37 | * Structures are generic objects which may contain nodes and edges. 38 | * 39 | */ 40 | public interface Structure { 41 | /** 42 | * Number of nodes in this graph. 43 | * 44 | * @return The number of nodes. 45 | */ 46 | int getNodeCount(); 47 | 48 | /** 49 | * Number of edges in this graph. 50 | * 51 | * @return The number of edges. 52 | */ 53 | int getEdgeCount(); 54 | 55 | Stream nodes(); 56 | 57 | Stream edges(); 58 | } 59 | -------------------------------------------------------------------------------- /src/org/graphstream/graph/implementations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Yoann Pigné 31 | */ 32 | package org.graphstream.graph.implementations; -------------------------------------------------------------------------------- /src/org/graphstream/graph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | * @author Yoann Pigné 32 | */ 33 | package org.graphstream.graph; -------------------------------------------------------------------------------- /src/org/graphstream/stream/AttributePredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | * @author Hicham Brahimi 33 | */ 34 | package org.graphstream.stream; 35 | 36 | /** 37 | * Tell if an attribute is recognized. 38 | */ 39 | public interface AttributePredicate { 40 | /** 41 | * Tell if an attribute is recognized or not. The predicate can work on the name 42 | * of the attribute, on its value or on both. 43 | * 44 | * @param attributeName 45 | * The name of the attribute. 46 | * @param attributeValue 47 | * The value of the attribute. 48 | * @return True if the attribute must be removed from the stream of graph 49 | * events. 50 | */ 51 | boolean matches(String attributeName, Object attributeValue); 52 | } -------------------------------------------------------------------------------- /src/org/graphstream/stream/GraphParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.stream; 34 | 35 | /** 36 | * Raised when a parse error occurred while reading a graph file. 37 | * 38 | * @since 19 Sept. 2004 39 | */ 40 | public class GraphParseException extends Exception { 41 | private static final long serialVersionUID = 8469350631709220693L; 42 | 43 | public GraphParseException() { 44 | super("graph parse error"); 45 | } 46 | 47 | public GraphParseException(String message) { 48 | super(message); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/Pipe.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.stream; 34 | 35 | /** 36 | * Sink and source of graph events. 37 | * 38 | *

39 | * A filter is something that can receive graph events and produce graph events 40 | * as a result or transformation. 41 | *

42 | * 43 | * @see Source 44 | * @see Sink 45 | */ 46 | public interface Pipe extends Source, Sink { 47 | } -------------------------------------------------------------------------------- /src/org/graphstream/stream/SourceAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-22 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.stream; 34 | 35 | /** 36 | * Adapter for the input interface. 37 | * 38 | *

39 | * All methods are empty. 40 | *

41 | */ 42 | public class SourceAdapter implements Source { 43 | public void addAttributeSink(AttributeSink sink) { 44 | } 45 | 46 | public void addElementSink(ElementSink sink) { 47 | } 48 | 49 | public void addSink(Sink sink) { 50 | } 51 | 52 | public void removeAttributeSink(AttributeSink sink) { 53 | } 54 | 55 | public void removeElementSink(ElementSink sink) { 56 | } 57 | 58 | public void removeSink(Sink sink) { 59 | } 60 | 61 | public void clearAttributeSinks() { 62 | } 63 | 64 | public void clearElementSinks() { 65 | } 66 | 67 | public void clearSinks() { 68 | } 69 | } -------------------------------------------------------------------------------- /src/org/graphstream/stream/binary/ByteDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.stream.binary; 33 | 34 | import org.graphstream.stream.Source; 35 | 36 | import java.nio.ByteBuffer; 37 | 38 | /** 39 | * Decode an event that has been encoded into a binary buffer and dispatch this 40 | * event to its sources. This is a complementary features of the event encoding 41 | * in {@link ByteEncoder}. 42 | * 43 | * @since 31/01/16. 44 | */ 45 | public interface ByteDecoder extends Source { 46 | /** 47 | * Decode the buffer, and dispatch the corresponding event. 48 | * 49 | * @param buffer 50 | * event as a binary buffer 51 | */ 52 | void decode(ByteBuffer buffer); 53 | 54 | /** 55 | * Tells if the buffer contains an event that is ready to be dispatched. The 56 | * bytes considered should be from 0 to the buffer's position. The position of 57 | * the buffer SHOULD NOT be changed. 58 | * 59 | * @param buffer 60 | * @return true if the buffer contains an event 61 | */ 62 | boolean validate(ByteBuffer buffer); 63 | } 64 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/binary/ByteFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.stream.binary; 33 | 34 | /** 35 | * @since 01/02/16. 36 | */ 37 | public interface ByteFactory { 38 | /** 39 | * Create a new binary encoder. 40 | * 41 | * @return the new created encoder 42 | */ 43 | ByteEncoder createByteEncoder(); 44 | 45 | /** 46 | * Create a new binary decoder. 47 | * 48 | * @return the new created decoder 49 | */ 50 | ByteDecoder createByteDecoder(); 51 | } 52 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/FileSourceDOT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.stream.file; 34 | 35 | import java.io.Reader; 36 | 37 | import org.graphstream.stream.file.dot.DOTParser; 38 | import org.graphstream.util.parser.Parser; 39 | import org.graphstream.util.parser.ParserFactory; 40 | 41 | /** 42 | * Graph reader for GraphViz "dot" files. 43 | * 44 | * In this format, edges have no identifier. By default an automatic identifier 45 | * is added to each edge. You can add an identifier to an edge by adding an "id" 46 | * attribute to the edge. For example : 47 | * 48 | *
49 |  * A -- B [ id=AB ];
50 |  * 
51 | */ 52 | public class FileSourceDOT extends FileSourceParser { 53 | /* 54 | * (non-Javadoc) 55 | * 56 | * @see org.graphstream.stream.file.FileSourceParser#getNewFactory() 57 | */ 58 | public ParserFactory getNewParserFactory() { 59 | return new ParserFactory() { 60 | public Parser newParser(Reader reader) { 61 | return new DOTParser(FileSourceDOT.this, reader); 62 | } 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/FileSourcePajek.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2011-07-21 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.stream.file; 33 | 34 | import java.io.Reader; 35 | 36 | import org.graphstream.stream.file.pajek.PajekParser; 37 | 38 | import org.graphstream.util.parser.Parser; 39 | import org.graphstream.util.parser.ParserFactory; 40 | 41 | /** 42 | * A parser for the Pajek NET format. 43 | * 44 | * This should support most the NET file format. However this format seems to 45 | * have numerous derivative that may not be known to us. It parses the 46 | * edges/arcs, edgeslist/arclist, and matrix notations. It understands a large 47 | * part of the formating notation, and transform it to CSS "ui.style" attribute 48 | * stored on nodes and edges. 49 | * 50 | * The standard extension for such files is ".net". 51 | */ 52 | public class FileSourcePajek extends FileSourceParser { 53 | public ParserFactory getNewParserFactory() { 54 | return new ParserFactory() { 55 | public Parser newParser(Reader reader) { 56 | return new PajekParser(FileSourcePajek.this, reader); 57 | } 58 | }; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/gexf/GEXFAttValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2013-09-18 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.stream.file.gexf; 33 | 34 | import javax.xml.stream.XMLStreamException; 35 | 36 | public class GEXFAttValue implements GEXFElement { 37 | GEXF root; 38 | 39 | String forId; 40 | String value; 41 | 42 | double start; 43 | double end; 44 | 45 | public GEXFAttValue(GEXF root, String forId, String value) { 46 | this.root = root; 47 | this.forId = forId; 48 | this.value = value; 49 | this.start = root.step; 50 | this.end = Double.NaN; 51 | } 52 | 53 | /* 54 | * (non-Javadoc) 55 | * 56 | * @see 57 | * org.graphstream.stream.file.gexf.GEXFElement#export(org.graphstream.stream 58 | * .file.gexf.SmartXMLWriter) 59 | */ 60 | public void export(SmartXMLWriter stream) throws XMLStreamException { 61 | stream.startElement("attvalue"); 62 | 63 | stream.stream.writeAttribute("for", forId); 64 | stream.stream.writeAttribute("value", value); 65 | 66 | if (Double.isNaN(end)) 67 | end = root.step; 68 | 69 | if (root.isExtensionEnable(Extension.DYNAMICS)) { 70 | stream.stream.writeAttribute("start", root.getTimeFormat().format.format(start)); 71 | stream.stream.writeAttribute("end", root.getTimeFormat().format.format(end)); 72 | } 73 | 74 | stream.endElement(); // ATTVALUE 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/gexf/GEXFAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2013-09-18 28 | * 29 | * @author Guilhelm Savin 30 | */ 31 | package org.graphstream.stream.file.gexf; 32 | 33 | import javax.xml.stream.XMLStreamException; 34 | 35 | public class GEXFAttribute implements GEXFElement { 36 | GEXF root; 37 | 38 | int id; 39 | String title; 40 | AttrType type; 41 | 42 | String defaultValue; 43 | String options; 44 | 45 | public GEXFAttribute(GEXF root, String key, AttrType type) { 46 | this.root = root; 47 | this.id = root.getNewAttributeIndex(); 48 | this.title = key; 49 | this.type = type; 50 | 51 | defaultValue = null; 52 | options = null; 53 | } 54 | 55 | /* 56 | * (non-Javadoc) 57 | * 58 | * @see 59 | * org.graphstream.stream.file.gexf.GEXFElement#export(org.graphstream.stream 60 | * .file.gexf.SmartXMLWriter) 61 | */ 62 | public void export(SmartXMLWriter stream) throws XMLStreamException { 63 | stream.startElement("attribute"); 64 | stream.stream.writeAttribute("id", Integer.toString(id)); 65 | stream.stream.writeAttribute("type", type.qname); 66 | 67 | if (title != null) 68 | stream.stream.writeAttribute("title", title); 69 | 70 | if (defaultValue != null) 71 | stream.leafWithText("default", defaultValue); 72 | 73 | if (options != null) 74 | stream.leafWithText("options", options); 75 | 76 | stream.endElement(); // ATTRIBUTE 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/gexf/GEXFSpell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Guilhelm Savin 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.stream.file.gexf; 33 | 34 | import javax.xml.stream.XMLStreamException; 35 | 36 | public class GEXFSpell implements GEXFElement { 37 | GEXF root; 38 | 39 | boolean startOpen; 40 | boolean endOpen; 41 | 42 | double start; 43 | double end; 44 | 45 | boolean closed; 46 | 47 | public GEXFSpell(GEXF root) { 48 | this.root = root; 49 | this.closed = false; 50 | } 51 | 52 | /* 53 | * (non-Javadoc) 54 | * 55 | * @see 56 | * org.graphstream.stream.file.gexf.GEXFElement#export(org.graphstream.stream 57 | * .file.gexf.SmartXMLWriter) 58 | */ 59 | public void export(SmartXMLWriter stream) throws XMLStreamException { 60 | stream.startElement("spell"); 61 | 62 | stream.stream.writeAttribute("start", root.getTimeFormat().format.format(start)); 63 | stream.stream.writeAttribute("end", root.getTimeFormat().format.format(closed ? end : root.step)); 64 | 65 | stream.endElement(); // SPELL 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/gml/GMLParserConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2011-07-04 28 | * 29 | * @author Antoine Dutot 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.stream.file.gml; 34 | 35 | /** 36 | * Token literal values and constants. Generated by 37 | * org.javacc.parser.OtherFilesGen#start() 38 | */ 39 | public interface GMLParserConstants { 40 | 41 | /** End of File. */ 42 | int EOF = 0; 43 | /** RegularExpression Id. */ 44 | int EOL = 5; 45 | /** RegularExpression Id. */ 46 | int DIGIT = 6; 47 | /** RegularExpression Id. */ 48 | int HEXDIGIT = 7; 49 | /** RegularExpression Id. */ 50 | int LSQBR = 8; 51 | /** RegularExpression Id. */ 52 | int RSQBR = 9; 53 | /** RegularExpression Id. */ 54 | int REAL = 10; 55 | /** RegularExpression Id. */ 56 | int STRING = 11; 57 | /** RegularExpression Id. */ 58 | int GRAPH = 12; 59 | /** RegularExpression Id. */ 60 | int DIGRAPH = 13; 61 | /** RegularExpression Id. */ 62 | int KEY = 14; 63 | /** RegularExpression Id. */ 64 | int COMMENT = 15; 65 | 66 | /** Lexical state. */ 67 | int DEFAULT = 0; 68 | 69 | /** Literal token values. */ 70 | String[] tokenImage = { "", "\" \"", "\"\\r\"", "\"\\t\"", "\"\\n\"", "", "", "", 71 | "\"[\"", "\"]\"", "", "", "\"graph\"", "\"digraph\"", "", "", }; 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/CustomResolution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images; 26 | 27 | /** 28 | * User-defined resolution. 29 | */ 30 | public class CustomResolution implements Resolution { 31 | final int width, height; 32 | 33 | public CustomResolution(int width, int height) { 34 | this.width = width; 35 | this.height = height; 36 | } 37 | 38 | public int getWidth() { 39 | return width; 40 | } 41 | 42 | public int getHeight() { 43 | return height; 44 | } 45 | 46 | @Override public String toString() { 47 | return String.format("%dx%d", width, height); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/FileSinkImagesFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images; 26 | 27 | import org.graphstream.stream.file.FileSinkImages; 28 | 29 | /** 30 | * Define a provider for FileSinkImages. 31 | */ 32 | public interface FileSinkImagesFactory { 33 | FileSinkImages createFileSinkImages(); 34 | } 35 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images; 26 | 27 | import java.awt.image.BufferedImage; 28 | 29 | /** 30 | * Defines filter that will be applied on images before writing. 31 | */ 32 | public interface Filter { 33 | void apply(BufferedImage image); 34 | } 35 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/Resolution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images; 26 | 27 | /** 28 | * Define resolution of outputted images. 29 | * An enumeration of common resolutions is provided in {@link Resolutions}. 30 | * 31 | * @see CustomResolution 32 | * @see Resolutions 33 | */ 34 | public interface Resolution { 35 | /** 36 | * Get the width of outputted images. 37 | * 38 | * @return width 39 | */ 40 | int getWidth(); 41 | 42 | /** 43 | * Get the height of outputted images. 44 | * 45 | * @return height 46 | */ 47 | int getHeight(); 48 | } 49 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/Resolutions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images; 26 | 27 | /** 28 | * Common resolutions. 29 | * 30 | * @see Graphics display resolution page on Wikipedia 31 | */ 32 | public enum Resolutions implements Resolution { 33 | QVGA(320, 240), CGA(320, 200), VGA(640, 480), NTSC(720, 480), PAL(768, 576), WVGA_5by3(800, 480), SVGA(800, 34 | 600), WVGA_16by9(854, 480), WSVGA(1024, 600), XGA(1024, 768), HD720(1280, 720), WXGA_5by3(1280, 35 | 768), WXGA_8by5(1280, 800), SXGA(1280, 1024), FWXGA(1366, 768), SXGAp(1400, 1050), WSXGAp(1680, 1050), UXGA( 36 | 1600, 1200), HD1080(1920, 1080), WUXGA(1920, 1200), TwoK(2048, 1080), QXGA(2048, 1536), WQXGA(2560, 37 | 1600), QSXGA(2560, 2048), UHD_4K(3840, 2160), UHD_8K_16by9(7680, 4320), UHD_8K_17by8(8192, 38 | 4320), UHD_8K_1by1(8192, 8192); 39 | 40 | final int width, height; 41 | 42 | Resolutions(int width, int height) { 43 | this.width = width; 44 | this.height = height; 45 | } 46 | 47 | public int getWidth() { 48 | return width; 49 | } 50 | 51 | public int getHeight() { 52 | return height; 53 | } 54 | 55 | @Override public String toString() { 56 | return String.format("%s (%dx%d)", name(), width, height); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/file/images/filters/AddLogoFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.stream.file.images.filters; 26 | 27 | import org.graphstream.stream.file.images.Filter; 28 | 29 | import javax.imageio.ImageIO; 30 | import java.awt.*; 31 | import java.awt.image.BufferedImage; 32 | import java.io.File; 33 | import java.io.IOException; 34 | 35 | /** 36 | * This filter adds a logo-picture on each outputted image. 37 | */ 38 | public class AddLogoFilter implements Filter { 39 | /** 40 | * The logo. 41 | */ 42 | private BufferedImage logo; 43 | /** 44 | * Logo position on images. 45 | */ 46 | private int x, y; 47 | 48 | /** 49 | * Create a new filter to add a logo on top of images. 50 | * 51 | * @param logoFile path to the logo picture-file 52 | * @param x x position of the logo (top-left corner is (0;0)) 53 | * @param y y position of the logo 54 | */ 55 | public AddLogoFilter(String logoFile, int x, int y) throws IOException { 56 | File f = new File(logoFile); 57 | 58 | if (f.exists()) 59 | this.logo = ImageIO.read(f); 60 | else 61 | this.logo = ImageIO.read(ClassLoader.getSystemResource(logoFile)); 62 | 63 | this.x = x; 64 | this.y = y; 65 | } 66 | 67 | public void apply(BufferedImage image) { 68 | Graphics2D g = image.createGraphics(); 69 | g.drawImage(logo, x, y, null); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/org/graphstream/stream/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Yoann Pigné 30 | * @author Guilhelm Savin 31 | */ 32 | package org.graphstream.stream; -------------------------------------------------------------------------------- /src/org/graphstream/stream/rmi/RMIAdapterOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Yoann Pigné 30 | * @author Antoine Dutot 31 | * @author Guilhelm Savin 32 | */ 33 | package org.graphstream.stream.rmi; 34 | 35 | import java.rmi.Remote; 36 | import java.rmi.RemoteException; 37 | 38 | public interface RMIAdapterOut extends Remote { 39 | void register(String url) throws RemoteException; 40 | 41 | void unregister(String url) throws RemoteException; 42 | } 43 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/GraphicElementChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Antoine Dutot 30 | * @author Guilhelm Savin 31 | */ 32 | package org.graphstream.ui.graphicGraph; 33 | 34 | /** 35 | * Interface for entities interested in changes on graphic elements. 36 | * 37 | * This interface main role is to advise renderer that an element changed and 38 | * therefore must be redrawn. This allows to avoid redrawing elements that did 39 | * not changed. 40 | */ 41 | public interface GraphicElementChangeListener { 42 | void graphicElementChanged(GraphicElement element); 43 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/StyleGroupListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Antoine Dutot 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.ui.graphicGraph; 34 | 35 | import org.graphstream.graph.Element; 36 | 37 | /** 38 | * Listen at the changes in the style group set. 39 | * 40 | * @author Antoine Dutot 41 | */ 42 | public interface StyleGroupListener { 43 | /** 44 | * The style of the element changed. 45 | * 46 | * @param element 47 | * The element. 48 | * @param oldStyle 49 | * The old style. 50 | * @param style 51 | * The changed style or the new style of the element. 52 | */ 53 | void elementStyleChanged(Element element, StyleGroup oldStyle, StyleGroup style); 54 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-07-05 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | */ 32 | package org.graphstream.ui.graphicGraph; -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/stylesheet/Colors.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Antoine Dutot 30 | * @author Guilhelm Savin 31 | * @author Richard O. Legendi 32 | * @author Hicham Brahimi 33 | * @author Yoann Pigné 34 | */ 35 | package org.graphstream.ui.graphicGraph.stylesheet; 36 | 37 | import java.util.ArrayList; 38 | 39 | /** 40 | * Ordered set of colours. 41 | */ 42 | public class Colors extends ArrayList { 43 | private static final long serialVersionUID = -7218092114483593610L; 44 | 45 | /** 46 | * New empty colour set. 47 | */ 48 | public Colors() { 49 | } 50 | 51 | /** 52 | * New copy of the other colour set. 53 | * 54 | * @param others 55 | * The other colour set to copy. 56 | */ 57 | public Colors(Colors others) { 58 | for (Color color : others) 59 | add(color); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/stylesheet/StyleSheetListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.ui.graphicGraph.stylesheet; 34 | 35 | /** 36 | * Listener for style events. 37 | */ 38 | public interface StyleSheetListener { 39 | /** 40 | * A style was changed or added. To differentiate the addition of a new style 41 | * from a change (augmentation) of an existing style, two values are passed, the 42 | * old style if augmented and the new style. The first is set to null if the 43 | * style is added. The old style is set to a value if is was augmented. 44 | * 45 | * @param oldRule 46 | * The style that changed. 47 | * @param newRule 48 | * The style that was added to the style sheet. 49 | */ 50 | void styleAdded(Rule oldRule, Rule newRule); 51 | 52 | /** 53 | * The complete style sheet was cleared. 54 | */ 55 | void styleSheetCleared(); 56 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/stylesheet/The_GraphStream_CSS_Dyn: -------------------------------------------------------------------------------- 1 | property value attribute resolve to 2 | ---------------------------------------------------------- 3 | fill-mode: dyn-plain ui.color plain 4 | size-mode: dyn-size ui.size normal 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/stylesheet/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-07-05 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | */ 32 | package org.graphstream.ui.graphicGraph.stylesheet; -------------------------------------------------------------------------------- /src/org/graphstream/ui/graphicGraph/stylesheet/parser/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | */ 32 | package org.graphstream.ui.graphicGraph.stylesheet.parser; -------------------------------------------------------------------------------- /src/org/graphstream/ui/layout/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | * @author Antoine Dutot 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.ui.layout; 34 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/layout/springbox/HowItWorks.rst: -------------------------------------------------------------------------------- 1 | The SpringBox layout organization 2 | ================================= 3 | 4 | This document details the organization and functional working of the Spring-Box graph layout package. 5 | 6 | This package, contains several force-based algorithms. It is composed of a base class named `BarnesHutLayout` that manages a set of "particles" and links between these particles. It is able to use a space decomposition technique (a quad-tree (2D) or oct-tree (3D)) to define a spatial index, and then defines for each cell of the tree a barycenter and a weitgh average for all the nodes allowing to use a Barnes-Hut technique to have a O(n log n) algorithm instead of a O(n^2). 7 | 8 | The `BarnesHutLayout` class is an abstract one. It uses a set of `NodeParticle` and `EdgeSpring`. Your own algos must refine the `BarnesHutLayout` class as well as the `NodeParticle` class in order to provide something useful. The whole simulation is handled by the `BarnesHutLayout`, however the force computation is done in the `NodeParticle` class. It is responsible for the computation of the attraction, repulsion and gravity forces. 9 | 10 | TODO finish this. 11 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/spriteManager/InvalidSpriteIDException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2012-07-12 28 | * 29 | * @author Antoine Dutot 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.ui.spriteManager; 34 | 35 | /** 36 | * Launched when a sprite is created with a dot in its identifier, which is 37 | * impossible in the current implementation. 38 | */ 39 | public class InvalidSpriteIDException extends RuntimeException { 40 | private static final long serialVersionUID = 1L; 41 | 42 | public InvalidSpriteIDException(String message) { 43 | super(message); 44 | } 45 | 46 | public InvalidSpriteIDException() { 47 | super(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/Selection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Alex Bowen 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | */ 33 | package org.graphstream.ui.view; 34 | 35 | public class Selection { 36 | public double x1, y1, x2, y2; 37 | 38 | @Override 39 | public boolean equals(Object o) { 40 | if (this == o) { 41 | return true; 42 | } 43 | if (o == null || getClass() != o.getClass()) { 44 | return false; 45 | } 46 | 47 | Selection selection = (Selection) o; 48 | 49 | if (Double.compare(selection.x1, x1) != 0) { 50 | return false; 51 | } 52 | if (Double.compare(selection.x2, x2) != 0) { 53 | return false; 54 | } 55 | if (Double.compare(selection.y1, y1) != 0) { 56 | return false; 57 | } 58 | if (Double.compare(selection.y2, y2) != 0) { 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | 65 | @Override 66 | public int hashCode() { 67 | int result; 68 | long temp; 69 | temp = Double.doubleToLongBits(x1); 70 | result = (int) (temp ^ (temp >>> 32)); 71 | temp = Double.doubleToLongBits(y1); 72 | result = 31 * result + (int) (temp ^ (temp >>> 32)); 73 | temp = Double.doubleToLongBits(x2); 74 | result = 31 * result + (int) (temp ^ (temp >>> 32)); 75 | temp = Double.doubleToLongBits(y2); 76 | result = 31 * result + (int) (temp ^ (temp >>> 32)); 77 | return result; 78 | } 79 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/ViewerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Alex Bowen 30 | * @author Guilhelm Savin 31 | * @author Dave1704 32 | */ 33 | package org.graphstream.ui.view; 34 | 35 | /** 36 | * Listener for specific viewer events. 37 | */ 38 | public interface ViewerListener { 39 | void viewClosed(String viewName); 40 | 41 | void buttonPushed(String id); 42 | 43 | void buttonReleased(String id); 44 | 45 | void mouseOver(String id); 46 | 47 | void mouseLeft(String id); 48 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/camera/AreaSkeleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2018-01-18 28 | * 29 | * @author Hicham Brahimi 30 | * @author Yoann Pigné 31 | */ 32 | package org.graphstream.ui.view.camera; 33 | 34 | import org.graphstream.ui.geom.Point2; 35 | 36 | /** 37 | * Class used by DefaultCamera, implementation in gs-ui-... Skeleton for nodes 38 | * and sprites. 39 | */ 40 | public interface AreaSkeleton { 41 | public Point2 theSize(); 42 | 43 | public Point2 theCenter(); 44 | } 45 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/camera/Skeleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2018-01-18 28 | * 29 | * @author Hicham Brahimi 30 | * @author Yoann Pigné 31 | */ 32 | package org.graphstream.ui.view.camera; 33 | 34 | /** 35 | * Elements of rendering that, contrary to the shapes, are specific to the 36 | * element, not the style group and define the basic geometry of the shape. 37 | */ 38 | public interface Skeleton { 39 | public static String attributeName = "ui.j2dsk"; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/util/InteractiveElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Beau Tremblay 30 | * @author Hicham Brahimi 31 | */ 32 | package org.graphstream.ui.view.util; 33 | 34 | public enum InteractiveElement { 35 | NODE, EDGE, SPRITE 36 | } 37 | -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/util/MouseManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-07-27 28 | * 29 | * @author Alex Bowen 30 | * @author Guilhelm Savin 31 | * @author Beau Tremblay 32 | * @author Hicham Brahimi 33 | * @author Yoann Pigné 34 | */ 35 | package org.graphstream.ui.view.util; 36 | 37 | import java.util.EnumSet; 38 | 39 | import org.graphstream.ui.graphicGraph.GraphicGraph; 40 | import org.graphstream.ui.view.View; 41 | 42 | /** 43 | * A global behavior for all mouse events on graphic elements. 44 | */ 45 | public interface MouseManager { 46 | /** 47 | * Make the manager active on the given graph and view. 48 | * 49 | * @param graph 50 | * The graph to control. 51 | * @param view 52 | * The view to control. 53 | */ 54 | void init(GraphicGraph graph, View view); 55 | 56 | /** 57 | * Release the links between this manager and the view and the graph. 58 | */ 59 | void release(); 60 | 61 | /** 62 | * Returns the set of InteractiveElements managed by the MouseManager 63 | * 64 | * @return the set of InteractiveElements managed by the MouseManager 65 | */ 66 | public EnumSet getManagedTypes(); 67 | } -------------------------------------------------------------------------------- /src/org/graphstream/ui/view/util/ShortcutManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-07-26 28 | * 29 | * @author Alex Bowen 30 | * @author Guilhelm Savin 31 | * @author Hicham Brahimi 32 | * @author Yoann Pigné 33 | */ 34 | package org.graphstream.ui.view.util; 35 | 36 | import org.graphstream.ui.graphicGraph.GraphicGraph; 37 | import org.graphstream.ui.view.View; 38 | 39 | /** 40 | * Utility to centralise the shortcuts and actions for all view instances. 41 | */ 42 | public interface ShortcutManager { 43 | /** 44 | * Make the manager active on the given graph and view. 45 | * 46 | * @param graph 47 | * The graph to control. 48 | * @param view 49 | * The view to control. 50 | */ 51 | void init(GraphicGraph graph, View view); 52 | 53 | /** 54 | * Release the links between this manager and the view and the graph. 55 | */ 56 | void release(); 57 | } -------------------------------------------------------------------------------- /src/org/graphstream/util/MissingDisplayException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | package org.graphstream.util; 26 | 27 | public class MissingDisplayException extends Exception { 28 | public MissingDisplayException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/org/graphstream/util/parser/Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-04-17 28 | * 29 | * @author Guilhelm Savin 30 | */ 31 | package org.graphstream.util.parser; 32 | 33 | import java.io.IOException; 34 | 35 | public interface Parser { 36 | /** 37 | * Parse the whole stream. 38 | * 39 | * @throws ParseException 40 | */ 41 | void all() throws IOException, ParseException; 42 | 43 | /** 44 | * Start parsing the stream. 45 | * 46 | * @throws ParseException 47 | */ 48 | void open() throws IOException, ParseException; 49 | 50 | /** 51 | * 52 | * @return 53 | * @throws ParseException 54 | */ 55 | boolean next() throws IOException, ParseException; 56 | 57 | /** 58 | * Close the stream. 59 | * 60 | * @throws IOException 61 | */ 62 | void close() throws IOException; 63 | } 64 | -------------------------------------------------------------------------------- /src/org/graphstream/util/parser/ParserFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GraphStream . 3 | * 4 | * GraphStream is a library whose purpose is to handle static or dynamic 5 | * graph, create them from scratch, file or any source and display them. 6 | * 7 | * This program is free software distributed under the terms of two licenses, the 8 | * CeCILL-C license that fits European law, and the GNU Lesser General Public 9 | * License. You can use, modify and/ or redistribute the software under the terms 10 | * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 11 | * URL or under the terms of the GNU LGPL as published by 12 | * the Free Software Foundation, either version 3 of the License, or (at your 13 | * option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 16 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program. If not, see . 21 | * 22 | * The fact that you are presently reading this means that you have had 23 | * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms. 24 | */ 25 | 26 | /** 27 | * @since 2009-02-19 28 | * 29 | * @author Guilhelm Savin 30 | */ 31 | package org.graphstream.util.parser; 32 | 33 | import java.io.Reader; 34 | 35 | /** 36 | * Factory to create parser. 37 | */ 38 | public interface ParserFactory { 39 | /** 40 | * Create a new parser from a reader. 41 | * 42 | * @param reader 43 | * stream to be parsed 44 | * @return a parser 45 | */ 46 | Parser newParser(Reader reader); 47 | } 48 | --------------------------------------------------------------------------------