java - how to use JUNG to color & shape vertices and edges -


I am facing a problem using the corrosion I want to draw a network diagram where the meridian has different shapes And will be colored and edges will be dashed or in full line in different colors.

As I am a newbie in Java, I am unable to understand the real architecture of the war when I use Settextax FillPint Transistor, it colors all corners with the same color. The corners are stored in an integer array. I am peating my head for the last one week. PLJ If you can help me or ask some counter questions, please ask me

method < Strong> setVertexFillPaintTransformer moves into a transformer that changes to a vertical color. So there are different colors for different corners, you should consider it at the top. The parameter is i in the public paint transform (integer I) , so you can provide a Colors which are based on the corner (or i ). For example, if I had a graph where the vertical was a integer , then I made the following transformer setVertexFillPaintTransformer :

  Transformer & lt; Integer, paint & gt; VertexPaint = New Transformer & lt; Integer, paint & gt; () {Personal Final Color [] Palette = {Color. Green, Color. BLUE, Color.RED}; Public paint transform (integer i) {return palette [i.intValue (%% palette.length)];}};  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -