Java Code Examples for org.jgraph.graph.GraphConstants#setLineEnd()

The following examples show how to use org.jgraph.graph.GraphConstants#setLineEnd() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OverviewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns an attribute map for Overview view edges
 *
 *
 * @param edge
 * @return a map of attributes to be used for a sketchnode
 */
public static AttributeMap viewEdgeAttributes(ViewDefinitionEdge edge) {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);

	Color color = getColor("edge_overview_view");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth("edge_overview_view", 1.5));

	return map;
}
 
Example 2
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns an attribute map for normal (non-injective, non-partial) edges.
 *
 * @return a map of attributes to be used for new normal edges
 */
private AttributeMap normalEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);

	Color color = getColor(_mode + "edge_normal");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_normal", 1.5));

	return map;
}
 
Example 3
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for injective edges.
 *
 * @return a map of attributes to be used for new injective edges
 */
private AttributeMap injectiveEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_DIAMOND);
	GraphConstants.setBeginFill(map, false);
	GraphConstants.setBeginSize(map, 15);

	Color color = getColor(_mode + "edge_injective");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_injective", 1.5));

	return map;
}
 
Example 4
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for partial edges.
 *
 * @return a map of attributes to be used for partial edges
 */
private AttributeMap partialEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_LINE);
	GraphConstants.setBeginFill(map, true);
	GraphConstants.setBeginSize(map, 15);

	Color color = getColor(_mode + "edge_partial");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_partial", 1.5));

	return map;
}
 
Example 5
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for virtual edges.
 *
 * @return a map of attributes to be used for new virtual edges
 */
private AttributeMap virtualEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_NONE);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_NONE);
	GraphConstants.setDashPattern(map, new float[] { 5.0f, 3.0f });

	Color color = getColor(_mode + "edge_virtual");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_virtual", 1.5));

	return map;
}
 
Example 6
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns an attribute map for normal (non-injective, non-partial) edges.
 *
 * @return a map of attributes to be used for new normal edges
 */
private AttributeMap normalEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);

	Color color = getColor(_mode + "edge_normal");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_normal", 1.5));

	return map;
}
 
Example 7
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for injective edges.
 *
 * @return a map of attributes to be used for new injective edges
 */
private AttributeMap injectiveEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_DIAMOND);
	GraphConstants.setBeginFill(map, false);
	GraphConstants.setBeginSize(map, 15);

	Color color = getColor(_mode + "edge_injective");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_injective", 1.5));

	return map;
}
 
Example 8
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for partial edges.
 *
 * @return a map of attributes to be used for partial edges
 */
private AttributeMap partialEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setEndFill(map, true);
	GraphConstants.setEndSize(map, 10);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_LINE);
	GraphConstants.setBeginFill(map, true);
	GraphConstants.setBeginSize(map, 15);

	Color color = getColor(_mode + "edge_partial");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_partial", 1.5));

	return map;
}
 
Example 9
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Returns the attribute map for virtual edges.
 *
 * @return a map of attributes to be used for new virtual edges
 */
private AttributeMap virtualEdgeAttributes() {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, GraphConstants.ARROW_NONE);
	GraphConstants.setLineBegin(map, GraphConstants.ARROW_NONE);
	GraphConstants.setDashPattern(map, new float[] { 5.0f, 3.0f });

	Color color = getColor(_mode + "edge_virtual");

	GraphConstants.setLineColor(map, color);
	GraphConstants.setForeground(map, color);
	GraphConstants.setLineWidth(map, getWidth(_mode + "edge_virtual", 1.5));

	return map;
}
 
Example 10
Source File: RelationEdge.java    From MogwaiERDesignerNG with GNU General Public License v3.0 6 votes vote down vote up
public RelationEdge(Relation aRelation, TableCell aImporting, TableCell aExporting) {

        super(aRelation);

        GraphConstants.setLineStyle(getAttributes(), GraphConstants.STYLE_ORTHOGONAL);
        GraphConstants.setConnectable(getAttributes(), false);
        GraphConstants.setDisconnectable(getAttributes(), false);
        GraphConstants.setBendable(getAttributes(), true);

        GraphConstants.setLineWidth(getAttributes(), 1);
        GraphConstants.setLineBegin(getAttributes(), LINE_BEGIN);
        GraphConstants.setLineEnd(getAttributes(), LINE_END);

        setSource(aImporting.getChildAt(0));
        setTarget(aExporting.getChildAt(0));
    }
 
Example 11
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * TRIANGLES CF2012 Set the attributes for display of a triangle edge.
 * 
 * @param edge the edge to read attributes from
 * @return a map of attributes to be used for new triangle edges
 */
private static AttributeMap triangleEdgeAttributes(
		TriangleEdge<ViewFrame, ViewGraphModel, View, QueryNode, View_Edge> edge) {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, edge.getLineEnd());
	GraphConstants.setLineBegin(map, edge.getLineBegin());
	GraphConstants.setLineWidth(map, edge.getWidth());
	GraphConstants.setLineColor(map, edge.getColor());
	GraphConstants.setForeground(map, edge.getColor());
	GraphConstants.setDashPattern(map, new float[] { edge.getWidth(), 3 });

	return map;
}
 
Example 12
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * TRIANGLES CF2012 Set the attributes for display of a triangle edge.
 * 
 * @param edge the edge to read attributes from
 * @return a map of attributes to be used for new triangle edges
 */
private static AttributeMap triangleEdgeAttributes(
		TriangleEdge<SketchFrame, SketchGraphModel, Sketch, EntityNode, SketchEdge> edge) {
	AttributeMap map = commonEdgeAttributes();

	GraphConstants.setLineEnd(map, edge.getLineEnd());
	GraphConstants.setLineBegin(map, edge.getLineBegin());
	GraphConstants.setLineWidth(map, edge.getWidth());
	GraphConstants.setLineColor(map, edge.getColor());
	GraphConstants.setForeground(map, edge.getColor());
	GraphConstants.setDashPattern(map, new float[] { edge.getWidth(), 3 });

	return map;
}
 
Example 13
Source File: GraphVisitor.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private DefaultEdge createConnection(DefaultGraphCell cell) {
    DefaultEdge edge = new DefaultEdge();
    edge.setSource(stack.peek().getChildAt(0));
    edge.setTarget(cell);

    // Set Arrow Style for edge
    int arrow = GraphConstants.ARROW_TECHNICAL;
    GraphConstants.setLineEnd(edge.getAttributes(), arrow);
    GraphConstants.setEndFill(edge.getAttributes(), true);
    return edge;
}