Custom Styles Tutorial

Label Edit Button

This step shows how to display a button on a label that starts the label editor. The button is defined in class MySimpleLabelStyle so that it is available in all labels.

Things to Try

  • Click the edit button to open the label editor.
  • Take a look at method MySimpleLabelStyle.render().

Left to Do

  • Make edit button invisible when zoom level is very low.
  • Allow to change the background color of labels.
  • Create a custom edge style.
  • Create a custom port style for nodes.
  • Use the decorator pattern to add label edges to the nodes.
  • Create a custom group node style.