content: /**
   * Copied and adapted from plugin
   * <a href="https://github.com/neueda/jetbrains-plugin-graph-database-support">Graph Database Support</a>
   * by Neueda Technologies, Ltd.
   * Modified by Alberto Venturini, 2022
   */
  package com.albertoventurini.graphdbplugin.visualization.settings;
  
  import com.albertoventurini.graphdbplugin.visualization.constants.VisualizationParameters;
  import com.albertoventurini.graphdbplugin.visualization.renderers.CustomEdgeRenderer;
  import prefuse.render.EdgeRenderer;
  import prefuse.render.LabelRenderer;
  import prefuse.render.ShapeRenderer;
  
  import static com.albertoventurini.graphdbplugin.visualization.constants.GraphColumns.TITLE;
  import static prefuse.Constants.EDGE_TYPE_LINE;
  
  public class RendererProvider {
  
      private static final int TEXT_OVERLAP = 12;
  
      public static LabelRenderer labelRenderer() {
          LabelRenderer labelRenderer = new LabelRenderer(TITLE);
          labelRenderer.setMaxTextWidth(VisualizationParameters.NODE_DIAMETER - TEXT_OVERLAP);
  
          return labelRenderer;
      }
  
      public static LabelRenderer edgeLabelRenderer() {
          LabelRenderer labelRenderer = new LabelRenderer(TITLE);
          labelRenderer.setMaxTextWidth(VisualizationParameters.NODE_DIAMETER - TEXT_OVERLAP);
  
          return labelRenderer;
      }
  
      public static ShapeRenderer nodeRenderer() {
          ShapeRenderer nodeRenderer = new ShapeRenderer();
          nodeRenderer.setBaseSize(VisualizationParameters.NODE_DIAMETER);
  
          return nodeRenderer;
      }
  
      public static EdgeRenderer edgeRenderer() {
          EdgeRenderer edgeRenderer = new CustomEdgeRenderer(EDGE_TYPE_LINE);
          edgeRenderer.setDefaultLineWidth(VisualizationParameters.EDGE_THICKNESS);
          edgeRenderer.setArrowHeadSize(10, 15);
  
          return edgeRenderer;
      }
  }
  