Jung cannot paint white Rectangle as vertexWhy can't I draw an ellipse with this code?Multiple vertex types in JUNGChange Size/Color of Vertex in JUNGDisplay vertex information using JUNG libraryJUNG: unpicked vertex label colorJung coloring vertex with valueJUNG : Changing the vertex colourRandomizing Vertex Locations JUNGHow Change Color of specifics Vertex in JUNGCan't paint a custom component in Swing correctly

How does a dynamic QR code work?

Does int main() need a declaration on C++?

Do creatures with a listed speed of "0 ft., fly 30 ft. (hover)" ever touch the ground?

how do we prove that a sum of two periods is still a period?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

What does the same-ish mean?

How could indestructible materials be used in power generation?

Implication of namely

What is the opposite of "eschatology"?

Different meanings of こわい

Bullying boss launched a smear campaign and made me unemployable

How do conventional missiles fly?

my venezuela girlfriend wants to travel the USA where i live.what does she need to do and how expensive will it become or how difficult?

Ambiguity in the definition of entropy

How to prevent "they're falling in love" trope

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

What is an equivalently powerful replacement spell for the Yuan-Ti's Suggestion spell?

How do I exit BASH while loop using modulus operator?

Was the old ablative pronoun "med" or "mēd"?

What's the meaning of "Sollensaussagen"?

Unlock My Phone! February 2018

Why were 5.25" floppy drives cheaper than 8"?

Notepad++ delete until colon for every line with replace all



Jung cannot paint white Rectangle as vertex


Why can't I draw an ellipse with this code?Multiple vertex types in JUNGChange Size/Color of Vertex in JUNGDisplay vertex information using JUNG libraryJUNG: unpicked vertex label colorJung coloring vertex with valueJUNG : Changing the vertex colourRandomizing Vertex Locations JUNGHow Change Color of specifics Vertex in JUNGCan't paint a custom component in Swing correctly













0















I'm trying to fill a Rectangle shaped vertex in Jung, as mentioned in exmaples and docs, I used a Transformer:



 Transformer<String, Paint> vertexColor = new Transformer<String,Paint>() 
public Paint transform(String i)
return Color.WHITE;

;


and right after the instruction:



 vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);


where vv is VisualizationViewer.

But the Transformeris not working, it continues to say Type mismatch: cannot convert from Color to Paint though many tutorials show the same lines.



The complete method is:



 @PluginVariant(requiredParameterLabels = 0)
public static JComponent visualize(final UIPluginContext context, final OWLOntologia ontology)

JPanel base = new JPanel();

Graph<String, String> grafo = OntologyGraph.getGraph(ontology);

Layout<String, String> layout = new TreeLayout<String, String>((Forest<String, String>) grafo);
layout.setSize(new Dimension(300, 300));
VisualizationViewer<String, String> vv = new VisualizationViewer<String, String>(layout);
vv.setPreferredSize(new Dimension(300000, 300000));

Transformer<String, Shape> vertexShape = new Transformer<String, Shape>()
@Override
public Rectangle transform(String arg0)
Rectangle nodo = new Rectangle();
nodo.height = 80;
nodo.width = 200;

return nodo;

;


Transformer<String, Paint> vertexColor = new Transformer<String,Paint>()
public Paint transform(String i)
return Color.WHITE;

;


vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
vv.getRenderContext().setVertexShapeTransformer(vertexShape);
vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<String>());
vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);

final DefaultModalGraphMouse<String, Number> graphMouse3 = new DefaultModalGraphMouse<>();
vv.setGraphMouse(graphMouse3);
graphMouse3.setMode(DefaultModalGraphMouse.Mode.PICKING);

base.add(vv);

return base;










share|improve this question


























    0















    I'm trying to fill a Rectangle shaped vertex in Jung, as mentioned in exmaples and docs, I used a Transformer:



     Transformer<String, Paint> vertexColor = new Transformer<String,Paint>() 
    public Paint transform(String i)
    return Color.WHITE;

    ;


    and right after the instruction:



     vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);


    where vv is VisualizationViewer.

    But the Transformeris not working, it continues to say Type mismatch: cannot convert from Color to Paint though many tutorials show the same lines.



    The complete method is:



     @PluginVariant(requiredParameterLabels = 0)
    public static JComponent visualize(final UIPluginContext context, final OWLOntologia ontology)

    JPanel base = new JPanel();

    Graph<String, String> grafo = OntologyGraph.getGraph(ontology);

    Layout<String, String> layout = new TreeLayout<String, String>((Forest<String, String>) grafo);
    layout.setSize(new Dimension(300, 300));
    VisualizationViewer<String, String> vv = new VisualizationViewer<String, String>(layout);
    vv.setPreferredSize(new Dimension(300000, 300000));

    Transformer<String, Shape> vertexShape = new Transformer<String, Shape>()
    @Override
    public Rectangle transform(String arg0)
    Rectangle nodo = new Rectangle();
    nodo.height = 80;
    nodo.width = 200;

    return nodo;

    ;


    Transformer<String, Paint> vertexColor = new Transformer<String,Paint>()
    public Paint transform(String i)
    return Color.WHITE;

    ;


    vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
    vv.getRenderContext().setVertexShapeTransformer(vertexShape);
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<String>());
    vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);

    final DefaultModalGraphMouse<String, Number> graphMouse3 = new DefaultModalGraphMouse<>();
    vv.setGraphMouse(graphMouse3);
    graphMouse3.setMode(DefaultModalGraphMouse.Mode.PICKING);

    base.add(vv);

    return base;










    share|improve this question
























      0












      0








      0








      I'm trying to fill a Rectangle shaped vertex in Jung, as mentioned in exmaples and docs, I used a Transformer:



       Transformer<String, Paint> vertexColor = new Transformer<String,Paint>() 
      public Paint transform(String i)
      return Color.WHITE;

      ;


      and right after the instruction:



       vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);


      where vv is VisualizationViewer.

      But the Transformeris not working, it continues to say Type mismatch: cannot convert from Color to Paint though many tutorials show the same lines.



      The complete method is:



       @PluginVariant(requiredParameterLabels = 0)
      public static JComponent visualize(final UIPluginContext context, final OWLOntologia ontology)

      JPanel base = new JPanel();

      Graph<String, String> grafo = OntologyGraph.getGraph(ontology);

      Layout<String, String> layout = new TreeLayout<String, String>((Forest<String, String>) grafo);
      layout.setSize(new Dimension(300, 300));
      VisualizationViewer<String, String> vv = new VisualizationViewer<String, String>(layout);
      vv.setPreferredSize(new Dimension(300000, 300000));

      Transformer<String, Shape> vertexShape = new Transformer<String, Shape>()
      @Override
      public Rectangle transform(String arg0)
      Rectangle nodo = new Rectangle();
      nodo.height = 80;
      nodo.width = 200;

      return nodo;

      ;


      Transformer<String, Paint> vertexColor = new Transformer<String,Paint>()
      public Paint transform(String i)
      return Color.WHITE;

      ;


      vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
      vv.getRenderContext().setVertexShapeTransformer(vertexShape);
      vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
      vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<String>());
      vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);

      final DefaultModalGraphMouse<String, Number> graphMouse3 = new DefaultModalGraphMouse<>();
      vv.setGraphMouse(graphMouse3);
      graphMouse3.setMode(DefaultModalGraphMouse.Mode.PICKING);

      base.add(vv);

      return base;










      share|improve this question














      I'm trying to fill a Rectangle shaped vertex in Jung, as mentioned in exmaples and docs, I used a Transformer:



       Transformer<String, Paint> vertexColor = new Transformer<String,Paint>() 
      public Paint transform(String i)
      return Color.WHITE;

      ;


      and right after the instruction:



       vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);


      where vv is VisualizationViewer.

      But the Transformeris not working, it continues to say Type mismatch: cannot convert from Color to Paint though many tutorials show the same lines.



      The complete method is:



       @PluginVariant(requiredParameterLabels = 0)
      public static JComponent visualize(final UIPluginContext context, final OWLOntologia ontology)

      JPanel base = new JPanel();

      Graph<String, String> grafo = OntologyGraph.getGraph(ontology);

      Layout<String, String> layout = new TreeLayout<String, String>((Forest<String, String>) grafo);
      layout.setSize(new Dimension(300, 300));
      VisualizationViewer<String, String> vv = new VisualizationViewer<String, String>(layout);
      vv.setPreferredSize(new Dimension(300000, 300000));

      Transformer<String, Shape> vertexShape = new Transformer<String, Shape>()
      @Override
      public Rectangle transform(String arg0)
      Rectangle nodo = new Rectangle();
      nodo.height = 80;
      nodo.width = 200;

      return nodo;

      ;


      Transformer<String, Paint> vertexColor = new Transformer<String,Paint>()
      public Paint transform(String i)
      return Color.WHITE;

      ;


      vv.getRenderContext().setVertexFillPaintTransformer(vertexColor);
      vv.getRenderContext().setVertexShapeTransformer(vertexShape);
      vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
      vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<String>());
      vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);

      final DefaultModalGraphMouse<String, Number> graphMouse3 = new DefaultModalGraphMouse<>();
      vv.setGraphMouse(graphMouse3);
      graphMouse3.setMode(DefaultModalGraphMouse.Mode.PICKING);

      base.add(vv);

      return base;







      java swing colors paint jung






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 21:21









      Spalla DiegoSpalla Diego

      486




      486






















          1 Answer
          1






          active

          oldest

          votes


















          1














          What do your imports say? My guess is that either your Color or Paint got imported from javafx (or somewhere else other than java.awt).






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052980%2fjung-cannot-paint-white-rectangle-as-vertex%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            What do your imports say? My guess is that either your Color or Paint got imported from javafx (or somewhere else other than java.awt).






            share|improve this answer



























              1














              What do your imports say? My guess is that either your Color or Paint got imported from javafx (or somewhere else other than java.awt).






              share|improve this answer

























                1












                1








                1







                What do your imports say? My guess is that either your Color or Paint got imported from javafx (or somewhere else other than java.awt).






                share|improve this answer













                What do your imports say? My guess is that either your Color or Paint got imported from javafx (or somewhere else other than java.awt).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 7 at 22:21









                Tom NelsonTom Nelson

                1815




                1815





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052980%2fjung-cannot-paint-white-rectangle-as-vertex%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved