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

The following examples show how to use org.jgraph.graph.GraphConstants#setLineBegin() . 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: 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 2
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 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 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 4
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 5
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 6
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 7
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 8
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 9
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 10
Source File: MicroarrayGraph.java    From chipster with MIT License 5 votes vote down vote up
private static void setModificationEdgeStyle(DefaultEdge edge) {
	setEdgeStyle(edge);
	GraphConstants.setLineBegin(edge.getAttributes(), GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setBeginFill(edge.getAttributes(), true);
	GraphConstants.setBeginSize(edge.getAttributes(), 5);
	GraphConstants.setForeground(edge.getAttributes(), Color.LIGHT_GRAY);
	GraphConstants.setDashPattern(edge.getAttributes(), new float[] { 1f, 2f });
}
 
Example 11
Source File: MicroarrayGraph.java    From chipster with MIT License 5 votes vote down vote up
private static void setDerivationEdgeStyle(DefaultEdge edge) {
	setEdgeStyle(edge);
	GraphConstants.setLineBegin(edge.getAttributes(), GraphConstants.ARROW_TECHNICAL);
	GraphConstants.setBeginFill(edge.getAttributes(), true);
	GraphConstants.setBeginSize(edge.getAttributes(), 5);
	GraphConstants.setLineWidth(edge.getAttributes(), 1);
}