Skip to content

Commit

Permalink
this version has the following changes:
Browse files Browse the repository at this point in the history
fixes:

- modifiedEvent: in case a change is detected, it asks for confirmation
to avoid losses.

adds:

- new analyze tool: check if all nodes have at least one connection with
each other
- new tools:
1) invert connections, makes the connections complementary to the
current one
2) make connections, connects non-connected nodes to each other.
- select images/change images of the nodes via context menu. new images
  can be added into src/com/mxgraph/examples/swing/images with PNG
  extension to take part
  • Loading branch information
Volkan Gezer committed Jun 8, 2020
1 parent e9d72e9 commit c76652d
Show file tree
Hide file tree
Showing 4 changed files with 473 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/com/mxgraph/analysis/mxGraphStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public static boolean isConnected(mxAnalysisGraph aGraph)

//data preparation
int connectedVertices = 1;
if(vertexNum < 1) {
return true;
}
int[] visited = new int[vertexNum];
visited[0] = 1;

Expand Down
9 changes: 9 additions & 0 deletions src/com/mxgraph/app/designer/properties/editor.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pageLayout=Page Layout
antialias=Antialias
exitText=Are you sure you want to exit this program?
analyze=Analyze
tools=Tools
makeComplementary=Invert connections
makeConnections=Make missing connections
measureText=Measure distance between nodes
notConnected=Some vertices are not connected!
emptyValue=Entered {1} value is not valid!
Expand All @@ -50,6 +53,10 @@ type=Type:
cancel=Cancel
calculate=Calculate
totalDistance=Total minimal distance is:
isConnected=Check if all nodes are connected
diagramStatus=All nodes are {1}
connected=connected.
notconnected=not connected.
grid=Grid
rulers=Rulers
zoom=Zoom
Expand Down Expand Up @@ -116,6 +123,7 @@ west=West
rotateLabel=Rotate Label
rotation=Rotation
image=Image
more=More
style=Style
shape=Shape
home=Home
Expand Down Expand Up @@ -217,3 +225,4 @@ backupRecommended=Backup in ETD Format Recommended
loseDetails=Saving in Plain Topology Format removes all cosmetic information. Hence, it cannot be opened with Topology Editor again.\nConsider saving a copy as an ETD File.
noLayout=Layout unavailable
error=Error
information=Information
3 changes: 2 additions & 1 deletion src/com/mxgraph/examples/swing/editor/BasicGraphEditor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mxgraph.examples.swing.editor;

import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand Down Expand Up @@ -642,7 +643,7 @@ public Action bind(String name, final Action action)
public Action bind(String name, final Action action, String iconUrl)
{
AbstractAction newAction = new AbstractAction(name, (iconUrl != null) ? new ImageIcon(
BasicGraphEditor.class.getResource(iconUrl)) : null)
new ImageIcon(BasicGraphEditor.class.getResource(iconUrl)).getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT)) : null)
{
public void actionPerformed(ActionEvent e)
{
Expand Down
Loading

0 comments on commit c76652d

Please sign in to comment.