Methods Summary |
---|
protected void | attachEdgeSourceAnchor(java.lang.String edge, ViewNode oldSourceNode, ViewNode sourceNode)
final ConnectionWidget connection = (ConnectionWidget) findWidget(edge);
final Widget source = findWidget(sourceNode);
connection.bringToBack();
source.bringToFront();
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(source));
|
protected void | attachEdgeTargetAnchor(java.lang.String edge, ViewNode oldTargetNode, ViewNode targetNode)
final ConnectionWidget connection = (ConnectionWidget) findWidget(edge);
final Widget target = findWidget(targetNode);
connection.bringToBack();
target.bringToFront();
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(target));
|
protected org.netbeans.api.visual.widget.Widget | attachEdgeWidget(java.lang.String edge)
ConnectionWidget connectionWidget = new ConnectionWidget(this);
connectionLayer.addChild(connectionWidget);
return connectionWidget;
|
protected org.netbeans.api.visual.widget.Widget | attachNodeWidget(ViewNode node)
Widget widget = createBox(node, node.name, node.id);
widget.getActions().addAction(createSelectAction());
widget.getActions().addAction(moveAction);
widgetLayer.addChild(widget);
return widget;
|
private org.netbeans.api.visual.widget.Widget | createBox(ViewNode node, java.lang.String nodeName, java.lang.String id)
final String shortName = getShortName(nodeName);
node.setShortName(shortName);
GradientWidget box = new GradientWidget(this, node);
box.setLayout(LayoutFactory.createVerticalFlowLayout());
box.setBorder(BorderFactory.createLineBorder(2, Color.BLACK));
box.setOpaque(true);
LabelWidget label = new LabelWidget(this);
label.setFont(getDefaultFont().deriveFont(Font.PLAIN, 12.0f));
label.setLabel(shortName);
label.setBorder(BorderFactory.createEmptyBorder(6, 6, 0, 6));
label.setAlignment(LabelWidget.Alignment.CENTER);
box.addChild(label);
label = new LabelWidget(this);
label.setFont(getDefaultFont().deriveFont(Font.PLAIN, 10.0f));
label.setLabel(getAddress(nodeName));
label.setBorder(BorderFactory.createEmptyBorder(3, 6, 0, 6));
label.setAlignment(LabelWidget.Alignment.CENTER);
box.addressWidget = label;
box.addChild(label);
label = new LabelWidget(this);
label.setFont(getDefaultFont().deriveFont(Font.PLAIN, 10.0f));
label.setLabel(id);
label.setBorder(BorderFactory.createEmptyBorder(3, 6, 6, 6));
label.setAlignment(LabelWidget.Alignment.CENTER);
box.addChild(label);
return box;
|
private static java.lang.String | getAddress(java.lang.String name)
String[] nameAndHashcode = name.split("@");
return "@" + nameAndHashcode[1];
|
public ViewNode | getRoot()
return root;
|
private static java.lang.String | getShortName(java.lang.String name)
String[] nameAndHashcode = name.split("@");
String[] packages = nameAndHashcode[0].split("\\.");
return packages[packages.length - 1];
|
void | setRoot(ViewNode root)
this.root = root;
|