use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment in project binnavi by google.
the class CNodeFunctions method createCommentNode.
/**
* Attaches a comment node to a given view node.
*
* @param parent Parent used for dialogs.
* @param view The view where the new comment node is created.
* @param node The node the new comment node is attached to.
*/
public static void createCommentNode(final JFrame parent, final INaviView view, final INaviViewNode node) {
Preconditions.checkNotNull(parent, "IE02128: Parent argument can not be null");
Preconditions.checkNotNull(view, "IE02129: View argument can not be null");
Preconditions.checkNotNull(node, "IE01726: Node argument can not be null");
// TODO (timkornau): this is just transposed from the old code
// needs to be checked to if we still want this to be like this.
final CTextNode source = view.getContent().createTextNode(null);
final CNaviViewEdge edge = view.getContent().createEdge(source, node, EdgeType.TEXTNODE_EDGE);
final DialogTextNodeComment dlg = new DialogTextNodeComment(parent, source);
GuiHelper.centerChildToParent(parent, dlg, true);
dlg.setVisible(true);
final List<IComment> newComment = dlg.getComment();
if (newComment == null) {
view.getContent().deleteEdge(edge);
view.getContent().deleteNode(source);
}
}
use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment in project binnavi by google.
the class CGraphDialogs method showTextNodeCommentDialog.
/**
* Shows a dialog where the comment of a text node can be edited.
*
* @param parent Parent window of the dialog.
* @param node Text node whose comment is edited.
*/
public static void showTextNodeCommentDialog(final JFrame parent, final CTextNode node) {
final DialogTextNodeComment dlg = new DialogTextNodeComment(parent, node);
GuiHelper.centerChildToParent(parent, dlg, true);
dlg.setVisible(true);
}
Aggregations