All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.uci.ics.jung.visualization.RenderContext Maven / Gradle / Ivy

package edu.uci.ics.jung.visualization;

import com.google.common.graph.Network;
import edu.uci.ics.jung.visualization.layout.NetworkElementAccessor;
import edu.uci.ics.jung.visualization.picking.PickedState;
import edu.uci.ics.jung.visualization.renderers.EdgeLabelRenderer;
import edu.uci.ics.jung.visualization.renderers.NodeLabelRenderer;
import edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator;
import edu.uci.ics.jung.visualization.util.Context;
import edu.uci.ics.jung.visualization.util.EdgeIndexFunction;
import java.awt.BasicStroke;
import java.awt.Font;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.util.function.Function;
import java.util.function.Predicate;
import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.JComponent;

public interface RenderContext {

  float[] dotting = {1.0f, 3.0f};
  float[] dashing = {5.0f};

  /**
   * A stroke for a dotted line: 1 pixel width, round caps, round joins, and an array of {1.0f,
   * 3.0f}.
   */
  Stroke DOTTED =
      new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, dotting, 0f);

  /**
   * A stroke for a dashed line: 1 pixel width, square caps, beveled joins, and an array of {5.0f}.
   */
  Stroke DASHED =
      new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL, 1.0f, dashing, 0f);

  /** Specifies the offset for the edge labels. */
  int LABEL_OFFSET = 10;

  int getLabelOffset();

  void setLabelOffset(int labelOffset);

  float getArrowPlacementTolerance();

  void setArrowPlacementTolerance(float arrow_placement_tolerance);

  Shape getEdgeArrow();

  void setEdgeArrow(Shape shape);

  boolean renderEdgeArrow();

  void setRenderEdgeArrow(boolean render);

  Function getEdgeFontFunction();

  void setEdgeFontFunction(Function edgeFontFunction);

  Predicate getEdgeIncludePredicate();

  void setEdgeIncludePredicate(Predicate edgeIncludePredicate);

  public float getEdgeLabelCloseness();

  public void setEdgeLabelCloseness(float closeness);

  EdgeLabelRenderer getEdgeLabelRenderer();

  void setEdgeLabelRenderer(EdgeLabelRenderer edgeLabelRenderer);

  Function getEdgeFillPaintFunction();

  void setEdgeFillPaintFunction(Function edgePaintFunction);

  Function getEdgeDrawPaintFunction();

  void setEdgeDrawPaintFunction(Function edgeDrawPaintFunction);

  Function getArrowDrawPaintFunction();

  void setArrowDrawPaintFunction(Function arrowDrawPaintFunction);

  Function getArrowFillPaintFunction();

  void setArrowFillPaintFunction(Function arrowFillPaintFunction);

  Function, E>, Shape> getEdgeShapeFunction();

  void setEdgeShapeFunction(Function, E>, Shape> edgeShapeFunction);

  Function getEdgeLabelFunction();

  void setEdgeLabelFunction(Function edgeStringer);

  Function edgeStrokeFunction();

  void setEdgeStrokeFunction(Function edgeStrokeFunction);

  Function getEdgeArrowStrokeFunction();

  void setEdgeArrowStrokeFunction(Function edgeArrowStrokeFunction);

  GraphicsDecorator getGraphicsContext();

  void setGraphicsContext(GraphicsDecorator graphicsContext);

  EdgeIndexFunction getParallelEdgeIndexFunction();

  void setParallelEdgeIndexFunction(EdgeIndexFunction parallelEdgeIndexFunction);

  PickedState getPickedEdgeState();

  void setPickedEdgeState(PickedState pickedEdgeState);

  PickedState getPickedNodeState();

  void setPickedNodeState(PickedState pickedNodeState);

  CellRendererPane getRendererPane();

  void setRendererPane(CellRendererPane rendererPane);

  JComponent getScreenDevice();

  void setScreenDevice(JComponent screenDevice);

  Function getNodeFontFunction();

  void setNodeFontFunction(Function nodeFontFunction);

  Function getNodeIconFunction();

  void setNodeIconFunction(Function nodeIconFunction);

  Predicate getNodeIncludePredicate();

  void setNodeIncludePredicate(Predicate nodeIncludePredicate);

  NodeLabelRenderer getNodeLabelRenderer();

  void setNodeLabelRenderer(NodeLabelRenderer nodeLabelRenderer);

  Function getNodeFillPaintFunction();

  void setNodeFillPaintFunction(Function nodeFillPaintFunction);

  Function getNodeDrawPaintFunction();

  void setNodeDrawPaintFunction(Function nodeDrawPaintFunction);

  Function getNodeShapeFunction();

  void setNodeShapeFunction(Function nodeShapeFunction);

  Function getNodeLabelFunction();

  void setNodeLabelFunction(Function nodeStringer);

  Function getNodeLabelDrawPaintFunction();

  void setNodeLabelDrawPaintFunction(Function nodeLabelDrawPaintFunction);

  Function getNodeStrokeFunction();

  void setNodeStrokeFunction(Function nodeStrokeFunction);

  class DirectedEdgeArrowPredicate implements Predicate> {

    public boolean test(Network graph) {
      return graph.isDirected();
    }
  }

  class UndirectedEdgeArrowPredicate implements Predicate> {

    public boolean test(Network graph) {
      return !graph.isDirected();
    }
  }

  MultiLayerTransformer getMultiLayerTransformer();

  void setMultiLayerTransformer(MultiLayerTransformer basicTransformer);

  /** @return the pickSupport */
  NetworkElementAccessor getPickSupport();

  /** @param pickSupport the pickSupport to set */
  void setPickSupport(NetworkElementAccessor pickSupport);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy