edu.uci.ics.jung.visualization.RenderContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jung-visualization Show documentation
Show all versions of jung-visualization Show documentation
Core visualization support for the JUNG project
The newest version!
package edu.uci.ics.jung.visualization;
import java.awt.BasicStroke;
import java.awt.Font;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.JComponent;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import edu.uci.ics.jung.algorithms.layout.GraphElementAccessor;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.util.Context;
import edu.uci.ics.jung.graph.util.EdgeIndexFunction;
import edu.uci.ics.jung.graph.util.EdgeType;
import edu.uci.ics.jung.visualization.picking.PickedState;
import edu.uci.ics.jung.visualization.renderers.EdgeLabelRenderer;
import edu.uci.ics.jung.visualization.renderers.VertexLabelRenderer;
import edu.uci.ics.jung.visualization.transform.shape.GraphicsDecorator;
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);
Function super Context,E>,Shape> getEdgeArrowTransformer();
void setEdgeArrowTransformer(Function super Context,E>,Shape> edgeArrowTransformer);
Predicate,E>> getEdgeArrowPredicate() ;
void setEdgeArrowPredicate(Predicate,E>> edgeArrowPredicate);
Function super E,Font> getEdgeFontTransformer();
void setEdgeFontTransformer(Function super E,Font> edgeFontTransformer);
Predicate,E>> getEdgeIncludePredicate();
void setEdgeIncludePredicate(Predicate,E>> edgeIncludePredicate);
Function super Context,E>,Number> getEdgeLabelClosenessTransformer();
void setEdgeLabelClosenessTransformer(
Function super Context,E>,Number> edgeLabelClosenessTransformer);
EdgeLabelRenderer getEdgeLabelRenderer();
void setEdgeLabelRenderer(EdgeLabelRenderer edgeLabelRenderer);
Function super E,Paint> getEdgeFillPaintTransformer();
void setEdgeFillPaintTransformer(Function super E,Paint> edgePaintTransformer);
Function super E,Paint> getEdgeDrawPaintTransformer();
void setEdgeDrawPaintTransformer(Function super E,Paint> edgeDrawPaintTransformer);
Function super E,Paint> getArrowDrawPaintTransformer();
void setArrowDrawPaintTransformer(Function super E,Paint> arrowDrawPaintTransformer);
Function super E,Paint> getArrowFillPaintTransformer();
void setArrowFillPaintTransformer(Function super E,Paint> arrowFillPaintTransformer);
Function super E, Shape> getEdgeShapeTransformer();
void setEdgeShapeTransformer(Function super E, Shape> edgeShapeTransformer);
Function super E,String> getEdgeLabelTransformer();
void setEdgeLabelTransformer(Function super E,String> edgeStringer);
Function super E,Stroke> getEdgeStrokeTransformer();
void setEdgeStrokeTransformer(Function super E,Stroke> edgeStrokeTransformer);
Function super E,Stroke> getEdgeArrowStrokeTransformer();
void setEdgeArrowStrokeTransformer(Function super E,Stroke> edgeArrowStrokeTransformer);
GraphicsDecorator getGraphicsContext();
void setGraphicsContext(GraphicsDecorator graphicsContext);
EdgeIndexFunction getParallelEdgeIndexFunction();
void setParallelEdgeIndexFunction(
EdgeIndexFunction parallelEdgeIndexFunction);
PickedState getPickedEdgeState();
void setPickedEdgeState(PickedState pickedEdgeState);
PickedState getPickedVertexState();
void setPickedVertexState(PickedState pickedVertexState);
CellRendererPane getRendererPane();
void setRendererPane(CellRendererPane rendererPane);
JComponent getScreenDevice();
void setScreenDevice(JComponent screenDevice);
Function super V,Font> getVertexFontTransformer();
void setVertexFontTransformer(Function super V,Font> vertexFontTransformer);
Function super V,Icon> getVertexIconTransformer();
void setVertexIconTransformer(Function super V,Icon> vertexIconTransformer);
Predicate,V>> getVertexIncludePredicate();
void setVertexIncludePredicate(Predicate,V>> vertexIncludePredicate);
VertexLabelRenderer getVertexLabelRenderer();
void setVertexLabelRenderer(VertexLabelRenderer vertexLabelRenderer);
Function super V,Paint> getVertexFillPaintTransformer();
void setVertexFillPaintTransformer(Function super V,Paint> vertexFillPaintTransformer);
Function super V,Paint> getVertexDrawPaintTransformer();
void setVertexDrawPaintTransformer(Function super V,Paint> vertexDrawPaintTransformer);
Function super V,Shape> getVertexShapeTransformer();
void setVertexShapeTransformer(Function super V,Shape> vertexShapeTransformer);
Function super V,String> getVertexLabelTransformer();
void setVertexLabelTransformer(Function super V,String> vertexStringer);
Function super V,Stroke> getVertexStrokeTransformer();
void setVertexStrokeTransformer(Function super V,Stroke> vertexStrokeTransformer);
class DirectedEdgeArrowPredicate
implements Predicate,E>> {
public boolean apply(Context,E> c) {
return c.graph.getEdgeType(c.element) == EdgeType.DIRECTED;
}
}
class UndirectedEdgeArrowPredicate
implements Predicate,E>> {
//extends AbstractGraphPredicate {
public boolean apply(Context,E> c) {
return c.graph.getEdgeType(c.element) == EdgeType.UNDIRECTED;
}
}
MultiLayerTransformer getMultiLayerTransformer();
void setMultiLayerTransformer(MultiLayerTransformer basicTransformer);
/**
* @return the pickSupport
*/
GraphElementAccessor getPickSupport();
/**
* @param pickSupport the pickSupport to set
*/
void setPickSupport(GraphElementAccessor pickSupport);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy