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
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 Transformer
is 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
add a comment |
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 Transformer
is 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
add a comment |
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 Transformer
is 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
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 Transformer
is 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
java swing colors paint jung
asked Mar 7 at 21:21
Spalla DiegoSpalla Diego
486
486
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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).
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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).
add a comment |
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).
add a comment |
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).
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).
answered Mar 7 at 22:21
Tom NelsonTom Nelson
1815
1815
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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