Examples of Graph


Examples of instantbach.data.Graph

     * @param file String
     * @return Graph
     * @throws BadRulesException
     */
    public Graph createProgressionGraph(String file) throws BadRulesException{
        Graph graph = new Graph();

        try {
            BufferedReader in = new BufferedReader(new FileReader(file));

            String line = "";
            while ((line = in.readLine()) != null) {
                StringTokenizer t = new StringTokenizer(line," ");
                graph.addEdge(t.nextToken(),t.nextToken(),1);
            }

            in.close();
        } catch (Exception io) {
            io.printStackTrace();
View Full Code Here

Examples of it.freedomotic.util.Graph

        }
    }

    @RequiresPermissions("environments:read")
    public void init() {
        graph = new Graph(); //the graph data structure that describes how rooms are connected through gates

        if (zones == null) {
            zones = new ArrayList<ZoneLogic>();
        }
View Full Code Here

Examples of jaron.pde.Graph

    rollGainD.addSignalListener(motionController.getRollGainD());

    // Setup a graph to display the pitch angle and the elevator output
    String kLabelPitch = "Pitch angle";
    String kLabelElevator ="Elevator signal";
    graphPitch = new Graph(this, 250, 170, 150, 120);
    graphPitch.addGraph(kLabelPitch, Colors.BLACK);
    graphPitch.getSignal(kLabelPitch).setBandwidth(45, -45);
    graphPitch.addGraph(kLabelElevator, Colors.RED);
    // Connect the pitch graph to the flight data
    flightData.getPitchAngle().addSignalListener(graphPitch.getSignal(kLabelPitch));
    flightData.getElevatorOutput().addSignalListener(graphPitch.getSignal(kLabelElevator));

    // Setup a graph to display the roll angle and the aileron output
    String kLabelRoll = "Roll angle";
    String kLabelAileron ="Aileron signal";
    graphRoll = new Graph(this, 250, 300, 150, 120);
    graphRoll.addGraph(kLabelRoll, Colors.BLACK);
    graphRoll.getSignal(kLabelRoll).setBandwidth(-45, 45);
    graphRoll.addGraph(kLabelAileron, Colors.RED);
    // Connect the roll graph to the flight data
    flightData.getRollAngle().addSignalListener(graphRoll.getSignal(kLabelRoll));
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.operators.Graph

  private String findParentNodes(final Operator op, String query) {
    for (final Operator preOp : op.getPrecedingOperators()) {
      if (preOp instanceof Filter) {
        query = preOp.serializeOperator() + query;
      } else if (preOp instanceof Graph) {
        final Graph g = (Graph) preOp;

        query = "GRAPH " + g.toString() + " {\n" + query + "}\n";
      } else if (preOp instanceof Optional) { // join left subtree...
        for (final OperatorIDTuple<Operator> opIDt : preOp
            .getSucceedingOperators()) {
          if (!opIDt.getOperator().equals(op) && opIDt.getId() == 0) {
            query = opIDt
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.beans.Graph

                try {
                    c.begin();
                    // TODO: remove only from the authoritative graph
                    c.removeStatements(uriOf(p), null, null);

                    Graph g = p.getEmbedsKnowledge();
                    if (null != g) {
                        c.removeStatements(null, null, null, uriOf(g));
                    }

                    c.commit();
View Full Code Here

Examples of net.sf.graphiti.model.Graph

  }

  @Override
  public void setGraphType(Configuration configuration, ObjectType type) {
    // create an empty graph, may be overridden
    graph = new Graph(configuration, type, true);

    String fileExt = configuration.getFileFormat().getFileExtension();
    if (fileName == null) {
      setFileName("New " + type.getName() + "." + fileExt);
    } else {
View Full Code Here

Examples of net.sf.jcontracts.dependencyanalyzer.Graph

            {
                throw new RuntimeException(
                        "Java Contract Suite: error list of source files is empty or no matches for pattern(s), no files to process!");
            }
            DependencyAnalyzer da = new DependencyAnalyzer();
            Graph dependencyGraph = null;
            log.info("parsing input files to determine dependencies.");
            long start = System.currentTimeMillis();
            MultipleCompilationUnitState multipleCompilationUnitState = new MultipleCompilationUnitState();
            try
            {
                for (int targetIndex = 0; targetIndex < targets.size(); targetIndex++)
                {
                    String filename = ((Target) targets.elementAt(targetIndex)).getName();
                    try
                    {
                        Reader is = new FileReader(filename);
                        try
                        {
                            BufferedReader bufferedIs = new BufferedReader(is);
                            try
                            {
                                recent_file = filename;
                                if (++number_of_files % 50 == 0 && number_of_files > 0)
                                {
                                    log.info(" (" + number_of_files + " files parsed)");
                                }
                                net.sf.jcontracts.codeparser.Parser parser = new net.sf.jcontracts.codeparser.Parser(
                                        bufferedIs, filename, multipleCompilationUnitState);
                                MetaclassFactory metaclassFactory = new MetaclassFactory(filename);
                                parser.setMetaclassFactory(metaclassFactory);
                                Vector v = parser.getUsedTypes();
                                da.process(v);
                            }
                            finally
                            {
                                bufferedIs.close();
                            }
                        }
                        finally
                        {
                            is.close();
                        }
                    }
                    catch (FileNotFoundException _ex)
                    {
                        throw new RuntimeException("Java Contract Suite: error file " + filename + " not found!", _ex);
                    }
                }

                long end = System.currentTimeMillis();
                log.info("Analyzed " + targets.size() + " files in " + (end - start) / 1000D + " s.");
            }
            catch (Exception e)
            {
                log.error("parsing problem while looking at " + recent_file);
                throw e;
            }
            if (multipleCompilationUnitState.hasUnresolvedNames())
            {
                String unresolvedNames = multipleCompilationUnitState.getUnresolvedNamesAsString();
                log.error("could not resolve the following type names:\n" + unresolvedNames);
                throw new RuntimeException("could not resolve the following type names:\n" + unresolvedNames);
            }
            dependencyGraph = da.getGraph();
            log.info("found " + dependencyGraph.getSize() + " relavant types referenced in the " + targets.size()
                    + " files.");
            AllOption allOption = null;
            for (int i = 0; i < options.size(); i++)
            {
                if ("a".compareTo(((Option) options.elementAt(i)).getName()) == 0)
                {
                    allOption = (AllOption) options.elementAt(i);
                }
            }

            OutputOption tmpOutputOption = null;
            for (int i = 0; i < options.size(); i++)
            {
                if ("o".compareTo(((Option) options.elementAt(i)).getName()) == 0)
                {
                    tmpOutputOption = (OutputOption) options.elementAt(i);
                }
            }

            final OutputOption outputOption = tmpOutputOption;
            Hashtable dep = null;
            log.info("starting dependency analysis (among " + dependencyGraph.getSize() + " types)");
            if (outputOption != null)
            {
                if (allOption != null)
                {
                    log.info("unconditionally instrumenting all files (-a).");
                    dep = dependencyGraph.getFileDependencyTable(new BooleanBlockWithNodeArg()
                    {

                        public boolean eval(Node n)
                        {
                            return true;
                        }

                    });
                }
                else
                {
                    dep = dependencyGraph.getFileDependencyTable(new BooleanBlockWithNodeArg()
                    {

                        public boolean eval(Node n)
                        {
                            boolean needsUpdate = false;
                            if (!n.getFilename().equals("???"))
                            {
                                String fon = "";
                                try
                                {
                                    fon = outputOption.getOutputFileName(n.getFilename(), n.getPackagename());
                                }
                                catch (IOException e)
                                {
                                    throw new RuntimeException("File " + n.getFilename()
                                            + " got deleted although the last check indicated its presence."
                                            + e.toString());
                                }
                                File fo = new File(fon);
                                File fcmc = new File(n.getFilename());
                                if (fo.lastModified() <= fcmc.lastModified())
                                {
                                    needsUpdate = true;
                                    log.info("**Java Contract Suite:INFO " + fon + " needs to be updated based on "
                                            + n.getFilename());
                                }
                                else
                                {
                                    log.info("**Java Contract Suite:INFO " + fon + " up to date.");
                                }
                                if (!needsUpdate)
                                {
                                    log.info("instrumented " + n.getName() + " (" + fon + ") is up to date.");
                                }
                            }
                            return needsUpdate;
                        }

                    });
                }
            }
            else
            {
                dep = dependencyGraph.getFileDependencyTable(new BooleanBlockWithNodeArg()
                {

                    public boolean eval(Node n)
                    {
                        return true;
                    }

                });
            }
            int level = dependencyGraph.getMaxRank();
            log.info("dependency analysis completed (" + level + " levels).");

            Vector allFileList = new Vector();
            for (; dep.containsKey(new Integer(level)); level--)
            {
                Vector fileList = new Vector();
                Vector candidates = (Vector) dep.get(new Integer(level));
                for (Enumeration e = candidates.elements(); e.hasMoreElements();)
                {
                    String targetName = (String) e.nextElement();
                    for (int i = 0; i < targets.size(); i++)
                    {
                        Target candidateTarget = (Target) targets.elementAt(i);
                        if (targetName.equals(candidateTarget.getName()))
                        {
                            fileList.addElement(candidateTarget.getName());
                            if (!allFileList.contains(candidateTarget.getName()))
                            {
                                allFileList.addElement(candidateTarget.getName());
                            }
                        }
                    }
                }
            }

            boolean needToRun = false;
            Vector v;
            for (Enumeration e = dep.elements(); !needToRun && e.hasMoreElements(); needToRun = !v.isEmpty())
            {
                v = (Vector) e.nextElement();
            }

            if (!needToRun)
            {
                throw new AllFilesUpToDateException(
                        "No need to update any instrumented files.  All sourcesfiles older than instrumented files.");
            }
            for (level = dependencyGraph.getMaxRank(); dep.containsKey(new Integer(level)); level--)
            {
                Vector fileList = new Vector();
                Vector candidates = (Vector) dep.get(new Integer(level));
                Enumeration candidateElementsEnum = candidates.elements();
                while (candidateElementsEnum.hasMoreElements())
View Full Code Here

Examples of net.sourceforge.jpowergraph.Graph

          try { Thread.sleep(1000); } catch (Exception e) { }
          if(isUpdate()){
            Display.getDefault().asyncExec(new Runnable() {
              public void run() {                 
                //update graph
                Graph graph = viewer.getGraph();
                graph.setNodeFilter(controller.getNodeFilter());

                Layouter m_layouter = new Layouter(new SpringLayoutStrategy(graph));
                m_layouter.start();

                controller.addManipulatorsAndSelectionModel(viewer);
View Full Code Here

Examples of org.antlr.misc.Graph

        }
    }

    public void sortGrammarFiles() throws IOException {
        //System.out.println("Grammar names "+getGrammarFileNames());
        Graph g = new Graph();
        List<String> missingFiles = new ArrayList<String>();
        for (String gfile : grammarFileNames) {
            try {
                GrammarSpelunker grammar = new GrammarSpelunker(inputDirectory, gfile);
                grammar.parse();
                String vocabName = grammar.getTokenVocab();
                String grammarName = grammar.getGrammarName();
                // Make all grammars depend on any tokenVocab options
                if ( vocabName!=null ) g.addEdge(gfile, vocabName+CodeGenerator.VOCAB_FILE_EXTENSION);
                // Make all generated tokens files depend on their grammars
                g.addEdge(grammarName+CodeGenerator.VOCAB_FILE_EXTENSION, gfile);
            }
            catch (FileNotFoundException fnfe) {
                ErrorManager.error(ErrorManager.MSG_CANNOT_OPEN_FILE, gfile);
                missingFiles.add(gfile);
            }
        }
        List<Object> sorted = g.sort();
        //System.out.println("sorted="+sorted);
        grammarFileNames.clear(); // wipe so we can give new ordered list
        for (int i = 0; i < sorted.size(); i++) {
            String f = (String)sorted.get(i);
            if ( missingFiles.contains(f) ) continue;
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.Graph

    }

    private void resetAll() {
        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
        for (GraphCanvas graphCanvas : graphCanvases) {
            Graph graph = graphCanvas.getGraph();
            for (Node node : graph.getNodes()) {
                resetNode(node);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.