本文整理汇总了Java中org.jgraph.graph.GraphConstants.setLineEnd方法的典型用法代码示例。如果您正苦于以下问题:Java GraphConstants.setLineEnd方法的具体用法?Java GraphConstants.setLineEnd怎么用?Java GraphConstants.setLineEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgraph.graph.GraphConstants
的用法示例。
在下文中一共展示了GraphConstants.setLineEnd方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RelationEdge
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
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));
}
示例2: addEdge
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void addEdge( int source, int target){
//System.out.println("adding edge: "+source+"->"+ target+ "to cell "+cellCount);
DefaultEdge edge = new DefaultEdge();
edge.setSource(cells[source].getChildAt(0));
edge.setTarget(cells[target].getChildAt(0));
int arrow = GraphConstants.ARROW_CLASSIC;
GraphConstants.setLineEnd(edge.getAttributes(), arrow);
GraphConstants.setEndFill(edge.getAttributes(), true);
// Node s = (Node)cells[source].getUserObject();
// Node t = (Node)cells[target].getUserObject();
/* _edge.arrow_x=(int)(s.x+t.x)/2;
_edge.arrow_y=(int)(s.y+t.y)/2;*/
cells[cellCount] = edge;
edgeCount++;
cellCount++;
}
示例3: connect
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void connect(Point2D start, Point2D current, PortView inPort, PortView outPort) {
Point2D p = fromScreen(start);
Point2D p2 = fromScreen(current);
if (inPort != null && outPort != null) {
ArrayList<Point2D> list = new ArrayList<Point2D>();
list.add(p);
list.add(p2);
Map map = new Hashtable();
GraphConstants.setPoints(map, list);
GraphConstants.setRouting(map, JmtGraphConstants.ROUTING_JMT);
GraphConstants.setLineEnd(map, GraphConstants.ARROW_CLASSIC);
GraphConstants.setEndFill(map, true);
GraphConstants.setConnectable(map, false);
GraphConstants.setDisconnectable(map, false);
Map<Object, Map> viewMap = new Hashtable<Object, Map>();
// Adds connection into underlying data structure
Object sourceKey = ((CellComponent) ((JmtCell) ((OutputPort) (outPort.getCell())).getUserObject()).getUserObject()).getKey();
Object targetKey = ((CellComponent) ((JmtCell) ((InputPort) (inPort.getCell())).getUserObject()).getUserObject()).getKey();
JmtEdge connection = new JmtEdge(sourceKey, targetKey, this);
viewMap.put(connection, map);
Object[] insert = new Object[] { connection };
ConnectionSet cs = new ConnectionSet();
cs.connect(connection, outPort.getCell(), true);
cs.connect(connection, inPort.getCell(), false);
// Visualizes connection only if it can be created into data structure
if (model.setConnected(sourceKey, targetKey, true)) {
graph.getModel().insert(insert, viewMap, cs, null, null);
}
}
}
示例4: ArcView
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public ArcView(Object cell) {
super(cell);
Arc arc = (Arc)cell;
AttributeMap attributes = getAttributes();
if(arc.getArcType() == Arc.NORMAL_ARC){
GraphConstants.setLineEnd(attributes, GraphConstants.ARROW_TECHNICAL);
GraphConstants.setEndFill(attributes, true);
}
else if(arc.getArcType() == Arc.READ_ARC){
GraphConstants.setLineEnd(attributes, GraphConstants.ARROW_CIRCLE);
GraphConstants.setEndFill(attributes, true);
float[] dashPattern = {5,5};
GraphConstants.setDashPattern(attributes, dashPattern);
}
else if(arc.getArcType() == Arc.INHIBITOR_ARC){
GraphConstants.setLineEnd(attributes, GraphConstants.ARROW_CIRCLE);
GraphConstants.setEndFill(attributes, false);
}
GraphConstants.setEndSize(attributes, 8);
}
示例5: ActionAssociationView
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public ActionAssociationView(Object cell) {
super(cell);
AttributeMap attributes = getAttributes();
GraphConstants.setLineEnd(attributes, GraphConstants.ARROW_SIMPLE);
GraphConstants.setEndSize(attributes, 15);
}
示例6: GeneralizationView
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public GeneralizationView(Object cell) {
super(cell);
AttributeMap attributes = getAttributes();
GraphConstants.setLineEnd(attributes, GraphConstants.ARROW_TECHNICAL);
GraphConstants.setEndSize(attributes, 15);
}
示例7: createEdgeAttributes
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
private Map createEdgeAttributes()
{
Map map = new HashMap();
// Add a Line End Attribute
GraphConstants.setLineEnd(map, GraphConstants.ARROW_SIMPLE);
// Add a label along edge attribute
GraphConstants.setLabelAlongEdge(map, true);
return map;
}
示例8: createConnection
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
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;
}
示例9: connect
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void connect(Point2D start, Point2D current, PortView inPort, PortView outPort) {
Point2D p = fromScreen(start);
Point2D p2 = fromScreen(current);
if (inPort != null && outPort != null) {
ArrayList<Point2D> list = new ArrayList<Point2D>();
list.add(p);
list.add(p2);
Map map = new Hashtable();
GraphConstants.setPoints(map, list);
GraphConstants.setRouting(map, GraphConstants.ROUTING_SIMPLE);
GraphConstants.setRouting(map, JmtGraphConstants.ROUTING_JMT);
GraphConstants.setEndFill(map, true);
// 24/09/03 - Massimo Cattai
// //////////////////////////////////////////
// Add a Line End Attribute
GraphConstants.setLineEnd(map, GraphConstants.ARROW_CLASSIC);
// 24/09/03 - end
// /////////////////////////////////////////////////////
Map<Object, Map> viewMap = new Hashtable<Object, Map>();
// ---- Adds connection into underlayng data structure -- BERTOLI
// MARCO
Object sourceKey = ((CellComponent) ((JmtCell) ((OutputPort) (outPort.getCell())).getUserObject()).getUserObject()).getKey();
Object targetKey = ((CellComponent) ((JmtCell) ((InputPort) (inPort.getCell())).getUserObject()).getUserObject()).getKey();
JmtEdge connection = new JmtEdge(sourceKey, targetKey, this);
viewMap.put(connection, map);
Object[] insert = new Object[] { connection };
ConnectionSet cs = new ConnectionSet();
cs.connect(connection, outPort.getCell(), true);
cs.connect(connection, inPort.getCell(), false);
// Visualize connection only if it can be created into data
// structure
if (model.setConnected(sourceKey, targetKey, true)) {
graph.getModel().insert(insert, viewMap, cs, null, null);
// FG
// no = false;
}
// ---- End -- BERTOLI MARCO
}
}
示例10: ArcGraphCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public ArcGraphCell() {
GraphConstants.setLineEnd(getAttributes(), GraphConstants.ARROW_TECHNICAL);
GraphConstants.setLabelPosition(getAttributes(), new Point2D.Double(GraphConstants.PERMILLE / 2, -10));
GraphConstants.setFont(getAttributes(), FONT);
}