Ejemplo n.º 1
0
        public static void showConfigAsGDL(ConfigurationManager ConfigurationManager, string path)
        {
            PrintStream printStream = new PrintStream(new FileOutputStream(path));

            GDLDumper.dumpGDLHeader(printStream);
            Iterator iterator = ConfigurationManager.getInstanceNames(ClassLiteral <Configurable> .Value).iterator();

            while (iterator.hasNext())
            {
                string name = (string)iterator.next();
                GDLDumper.dumpComponentAsGDL(ConfigurationManager, printStream, name);
            }
            GDLDumper.dumpGDLFooter(printStream);
            printStream.close();
        }
Ejemplo n.º 2
0
        public static void dumpComponentAsGDL(ConfigurationManager cm, PrintStream @out, string name)
        {
            @out.println(new StringBuilder().append("node: {title: \"").append(name).append("\" color: ").append(GDLDumper.getColor(cm, name)).append('}').toString());
            PropertySheet propertySheet        = cm.getPropertySheet(name);
            Collection    registeredProperties = propertySheet.getRegisteredProperties();
            Iterator      iterator             = registeredProperties.iterator();

            while (iterator.hasNext())
            {
                string       text = (string)iterator.next();
                PropertyType type = propertySheet.getType(text);
                object       raw  = propertySheet.getRaw(text);
                if (raw != null)
                {
                    if (type == PropertyType.__COMPONENT)
                    {
                        @out.println(new StringBuilder().append("edge: {source: \"").append(name).append("\" target: \"").append(raw).append("\"}").toString());
                    }
                    else if (type == PropertyType.__COMPONENT_LIST)
                    {
                        List     list      = (List)raw;
                        Iterator iterator2 = list.iterator();
                        while (iterator2.hasNext())
                        {
                            object obj = iterator2.next();
                            @out.println(new StringBuilder().append("edge: {source: \"").append(name).append("\" target: \"").append(obj).append("\"}").toString());
                        }
                    }
                }
            }
        }