Interface ModelDecorator


public interface ModelDecorator
Used to decorate vertices and edges with additional information when rendering a model.
  • Method Details

    • getUUID

      UUID getUUID()
      Returns an UUID that uniquely identifies this decorator.
      Returns:
      an UUID that uniquely identifies this decorator.
    • getName

      String getName()
      Returns the name of the decorator. This is shown to the user to make it possible to toggle the decorator on/off.
      Returns:
      the name of the decorator.
    • getIcon

      Icon getIcon()
      Returns a 24x24 icon for representing the decorator.
      Returns:
      a 24x24 icon for representing the decorator.
    • getDrawable

      Drawable getDrawable(MTCompleteVertex vertex)
      Returns a decorator drawable for a vertex or null to not decorate the vertex in question.
      Parameters:
      vertex - The vertex to get a drawable for.
      Returns:
      a decorator drawable for a vertex or null to not decorate the vertex in question.
    • getHoverDrawable

      default Drawable getHoverDrawable(MTCompleteVertex vertex, Point p)
      Returns a drawable for when hovering over a vertex in the editor.
      Parameters:
      vertex - The vertex.
      p - The point at which the mouse is hovering, in model coordinates.
      Returns:
      A drawable or null to not render anything when hovering.
    • getDrawable

      Drawable getDrawable(MTCompleteEdge edge)
      Returns a decorator drawable for a edge or null to not decorate the edge in question.
      Parameters:
      edge - The edge to get a drawable for.
      Returns:
      Returns a decorator drawable for a edge or null to not decorate the edge in question.
    • isHideable

      boolean isHideable()
      Returns true if the decorator can be hidden through the model settings.
      Returns:
      true if the decorator can be hidden through the model settings.
    • getClickBounds

      default Rectangle getClickBounds(MTCompleteVertex vertex)
      Returns the bounds which should be clickable for a vertex decoration.
      Parameters:
      vertex - The vertex.
      Returns:
      The click bounds or null if no clicks should be received.
    • onClick

      default void onClick(MTCompleteVertex vertex, Component invoker, Point p)
      Called when a vertex decoration is clicked. This is only called when the user clicks within the non-null rectangle returned by getClickBounds(vertex).
      Parameters:
      vertex - The vertex
      invoker - The component being clicked within.
      p - The point relative to the invoker component.
    • isEnabled

      default boolean isEnabled(ModelType modelType)
      Returns true if this decorator is available for a given model type.
      Parameters:
      modelType - The model type.
      Returns:
      true if this decorator is available for a given model type.