Beispiel #1
0
  private LabelWidget createEdgeLabel(Edge edge) {
    LabelWidget label = new LabelWidget(this, edge.toString());
    label.setFont(Util.FIXED_WIDTH_FONT);
    label.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0));

    label.getActions().addAction(hoverAction);
    label.getActions().addAction(editAction);
    label.getActions().addAction(moveAction);
    label.getActions().addAction(edgePopupAction);
    return label;
  }
Beispiel #2
0
 private Widget createLabel(String text, int x, int y, Color color) {
   LabelWidget label = new LabelWidget(this, text);
   label.setOpaque(true);
   label.setBackground(color);
   label.setBorder(BorderFactory.createLineBorder(5));
   label.setPreferredLocation(new Point(x, y));
   label.getActions().addAction(ActionFactory.createMoveAction());
   mainLayer.addChild(label);
   return label;
 }