jung2

A glitch with Edge label offset

雨燕双飞 提交于 2020-01-04 10:38:11
问题 I have peculiar problem when I tried to offset the edge label in my Jung2 network. As shown in figure below the label causes the self loop difficult to see. So I decided to offset the label: vv.getRenderContext().setLabelOffset(20); And the Effect: Offset is effective for all the edges except for the edge that I need: the self loop. Anyone has a solution or a workaround ? EDIT: Does anyone know what the EdgeLabelClosenessTransformer does? And how to use it? This may solve my problem. vv

Vertex label color in Jung visualization

纵然是瞬间 提交于 2019-12-24 16:34:18
问题 I've created a graph with Jung and I'm looking into visualization options. I'm trying to change the color of the vertex labels, don't care if they are picked/unpicked, just from the get-go. I.e. I want to paint the vertex labels white, leave edge labels black (default). Can't seem to find a sample that works, the DefaultVertexLabelRenderer class should help I guess but I can't seem to get it to work. Any ideas? The code currently looks like this: public static void main(String[] args) { Graph

weird import issues - Jung2

拜拜、爱过 提交于 2019-12-13 02:47:42
问题 I've been trying to get Jung 2.1.1 to work successfully but whatever breaking changes were made are just not making sense. After importing the 2.1.1 jars, I get the error: The constructor VisualizationViewer(Network, LayoutAlgorithm, Dimension) is undefined for the line: VisualizationViewer vv = new VisualizationViewer(g, layoutAlgorithm, new Dimension(900, 900)); where Network g = NetworkBuilder.undirected().build(); // and other load steps There are other imports that aren't working, like

How to retrieve data from MYSQL to combobox in JUNG visualization

有些话、适合烂在心里 提交于 2019-12-12 03:19:50
问题 I am trying to create a JCombobox and retrieving data from the MYSQL database in JUNG visualization platform. I need to know whether i can use the same method to create a JCombo box in JUNG as we created in JAVA swing? I used the following code to create and import the data from the database. But nothing gets displayed. According to the item which is selected from Jcombo box, I've to edit the jung network. Can anyone help me this? private void mouseComboBoxActionPerformed(java.awt.event

Jung: Add legends to the frame

十年热恋 提交于 2019-12-11 10:15:23
问题 I need to add legends to my frame to show the meaning of different colored links and nodes. Does Jung have some in built legend functionality? Or do I need make my own by adding an extra panel to the right. 回答1: I added the legends in a simple way. First made an Image of the legends and then stick it to the panel via the JLabel. JLabel label = new JLabel(); label.setOpaque(true); label.setBackground(Color.WHITE); ImageIcon icon = new ImageIcon("Legend/SyncLegend.png"); label.setIcon(icon); vv

Displaying popup messgae in Jung

别说谁变了你拦得住时间么 提交于 2019-12-08 11:17:43
问题 I have created a network which consists of number of vertexes and edges. How do I show a popup message over a vertex when I move the mouse to that vertex? 回答1: AbstractPopupGraphMousePlugin and its subclasses are what you want: http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/visualization/control/AbstractPopupGraphMousePlugin.html Look for its use in PluggableRendererDemo and in GraphEditorDemo. (Other samples also use it; those samples show how to create subclasses.) 来源: https:/

How to pause JUNG “animator” (given an IterativeProcess) by using Thread Sleep?

血红的双手。 提交于 2019-12-08 07:03:14
问题 I am impelementing an interface by JUNG library for moving agents (that are JUNG nodes) between nodes. When I command the agent to move from node 1 to node 2 , and before the agent's trip to node 2 has finished I command the agent to move to node 1 . I want the agent to move to node 1 after reaching node 2 But Instead the agent gets slowed down ( Because the new command decreases its speed) and when reaches node 2 by that decreased speed it returns to node 1 by the same decreased speed. And

How to pause JUNG “animator” (given an IterativeProcess) by using Thread Sleep?

别来无恙 提交于 2019-12-07 22:58:31
I am impelementing an interface by JUNG library for moving agents (that are JUNG nodes) between nodes. When I command the agent to move from node 1 to node 2 , and before the agent's trip to node 2 has finished I command the agent to move to node 1 . I want the agent to move to node 1 after reaching node 2 But Instead the agent gets slowed down ( Because the new command decreases its speed) and when reaches node 2 by that decreased speed it returns to node 1 by the same decreased speed. And when there is a Third node That the agent is commanded to move to (when it is on the trip form node 1 to