本文整理汇总了Java中org.eclipse.draw2d.PolylineConnection.setSourceDecoration方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineConnection.setSourceDecoration方法的具体用法?Java PolylineConnection.setSourceDecoration怎么用?Java PolylineConnection.setSourceDecoration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolylineConnection
的用法示例。
在下文中一共展示了PolylineConnection.setSourceDecoration方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decorateRelation
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
// @Override
// public void refreshVisuals() {
// super.refreshVisuals();
//
// }
@Override
protected void decorateRelation() {
final ERDiagram diagram = getDiagram();
if (diagram != null) {
final Relation relation = (Relation) getModel();
final PolylineConnection connection = (PolylineConnection) getConnectionFigure();
final String notation = diagram.getDiagramContents().getSettings().getNotation();
final Decoration decoration = DecorationFactory.getDecoration(notation, relation.getParentCardinality(), relation.getChildCardinality());
connection.setSourceDecoration(decoration.getSourceDecoration());
connection.setTargetDecoration(decoration.getTargetDecoration());
targetLabel.setText(Format.null2blank(decoration.getTargetLabel()));
}
}
示例2: refreshVisuals
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected void refreshVisuals() {
super.refreshVisuals();
final ERDiagram diagram = getDiagram();
if (diagram != null) {
final Relationship relation = (Relationship) getModel();
final PolylineConnection connection = (PolylineConnection) getConnectionFigure();
final String notation = diagram.getDiagramContents().getSettings().getNotation();
final Decoration decoration =
DecorationFactory.getDecoration(notation, relation.getParentCardinality(), relation.getChildCardinality());
connection.setSourceDecoration(decoration.getSourceDecoration());
connection.setTargetDecoration(decoration.getTargetDecoration());
targetLabel.setText(Format.null2blank(decoration.getTargetLabel()));
}
calculateAnchorLocation();
refreshBendpoints();
}
示例3: createRoleEquivalenceFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* {@link Relation}s from type roleequivalence have as figure a dashed line with a white arrow
* tips at both connection ends.
*
* @return conn org.eclipse.draw2d.PolylineConnection
*/
private static Figure createRoleEquivalenceFigure() {
// create white arrow tip 1
PolygonDecoration poly1 = new PolygonDecoration();
poly1.setAntialias(SWT.ON);
poly1.setBackgroundColor(ColorConstants.white);
poly1.setScale(5, 5);
// create white arrow tip 2
PolygonDecoration poly2 = new PolygonDecoration();
poly2.setAntialias(SWT.ON);
poly2.setBackgroundColor(ColorConstants.white);
poly2.setScale(5, 5);
PolylineConnection conn = new PolylineConnection();
conn.setAntialias(SWT.ON);
conn.setLineDash(new float[] {5.0f, 5.0f});
conn.setLineStyle(SWT.LINE_CUSTOM);
// add white arrow tip 1
conn.setTargetDecoration(poly1);
// add white arrow tip 2
conn.setSourceDecoration(poly2);
conn.setConnectionRouter(new BendpointConnectionRouter());
return conn;
}
示例4: createRoleRelationshipExclusionFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
*
* {@link Relations}s from type roleprohibition and relationshipexclusion have as figure a
* dashed line with a white arrow tip at target end of this connection.
*
* @return conn org.eclipse.draw2d.PolylineConnection
* */
private static Figure createRoleRelationshipExclusionFigure() {
// create white arrow tip
PolylineDecoration poly1 = new PolylineDecoration();
poly1.setTemplate(INVERTED_TRIANGLE_TIP);
poly1.setAntialias(SWT.ON);
poly1.setBackgroundColor(ColorConstants.black);
poly1.setScale(5, 5);
PolylineDecoration poly2 = new PolylineDecoration();
poly2.setTemplate(INVERTED_TRIANGLE_TIP);
poly2.setAntialias(SWT.ON);
poly2.setBackgroundColor(ColorConstants.black);
poly2.setScale(5, 5);
PolylineConnection conn = new PolylineConnection();
conn.setAntialias(SWT.ON);
conn.setLineDash(new float[] {5.0f, 5.0f});
conn.setLineStyle(SWT.LINE_CUSTOM);
conn.setTargetDecoration(poly1);
conn.setSourceDecoration(poly2);
conn.setConnectionRouter(new BendpointConnectionRouter());
return conn;
}
示例5: createRoleProhibitonFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* {@link Relation}s from type roleprohibition have as figure a dased line with two inverted and
* open arrow tips at both ends of this connection.
*
* @return conn org.eclipse.draw2d.PolylineConnection
*/
private static Figure createRoleProhibitonFigure() {
PolylineDecoration poly1 = new PolylineDecoration();
poly1.setTemplate(INVERTED_TRIANGLE_TIP);
poly1.setAntialias(SWT.ON);
poly1.setBackgroundColor(ColorConstants.black);
poly1.setScale(5, 5);
PolylineDecoration poly2 = new PolylineDecoration();
poly2.setTemplate(INVERTED_TRIANGLE_TIP);
poly2.setAntialias(SWT.ON);
poly2.setBackgroundColor(ColorConstants.black);
poly2.setScale(5, 5);
PolylineConnection conn = new PolylineConnection();
conn.setAntialias(SWT.ON);
conn.setLineDash(new float[] {5.0f, 5.0f});
conn.setLineStyle(SWT.LINE_CUSTOM);
conn.setTargetDecoration(poly1);
conn.setSourceDecoration(poly2);
conn.setConnectionRouter(new BendpointConnectionRouter());
return conn;
}
示例6: decorateRelation
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
// @Override
// public void refreshVisuals() {
// super.refreshVisuals();
//
// }
@Override
protected void decorateRelation() {
ERDiagram diagram = this.getDiagram();
if (diagram != null) {
Relation relation = (Relation) this.getModel();
PolylineConnection connection = (PolylineConnection) this
.getConnectionFigure();
String notation = diagram.getDiagramContents().getSettings()
.getNotation();
Decoration decoration = DecorationFactory.getDecoration(notation,
relation.getParentCardinality(),
relation.getChildCardinality());
connection.setSourceDecoration(decoration.getSourceDecoration());
connection.setTargetDecoration(decoration.getTargetDecoration());
this.targetLabel.setText(Format.null2blank(decoration.getTargetLabel()));
}
}
示例7: refreshVisuals
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected void refreshVisuals() {
super.refreshVisuals();
MFromTableJoin joinTable = getModel().getJoinTable();
final StringBuffer tt = new StringBuffer();
tt.append(getModel().getFromTable().getToolTip()).append(" ").append(joinTable.getToolTip());
new ModelVisitor<Object>(joinTable) {
@Override
public boolean visit(INode n) {
if (n instanceof IQueryString)
tt.append(((IQueryString) n).toSQLString());
return true;
}
};
PolylineConnection f = (PolylineConnection) getFigure();
f.setToolTip(new Label(tt.toString()));
// f.setLayoutManager(new DelegatingLayout());
//
// Label label = new Label("middle");
// f.add(label, new ConnectionLocator(f, ConnectionLocator.MIDDLE));
if (joinTable.getJoin().equals(AMKeyword.INNER_JOIN)) {
f.setTargetDecoration(getInnerDecoration());
f.setSourceDecoration(getInnerDecoration());
} else if (joinTable.getJoin().equals(AMKeyword.LEFT_OUTER_JOIN)) {
f.setTargetDecoration(getOuterDecoration());
f.setSourceDecoration(getInnerDecoration());
} else if (joinTable.getJoin().equals(AMKeyword.RIGHT_OUTER_JOIN)) {
f.setTargetDecoration(getInnerDecoration());
f.setSourceDecoration(getOuterDecoration());
} else if (joinTable.getJoin().equals(AMKeyword.FULL_OUTER_JOIN)) {
f.setTargetDecoration(getOuterDecoration());
f.setSourceDecoration(getOuterDecoration());
} else if (joinTable.getJoin().equals(AMKeyword.CROSS_JOIN)) {
f.setTargetDecoration(getCrossDecoration());
f.setSourceDecoration(getCrossDecoration());
}
}
示例8: createDummyConnection
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected Connection createDummyConnection(Request req) {
PolylineConnection con = (PolylineConnection) super.createDummyConnection(req);
con.setForegroundColor(Link.COLOR);
if (!(req instanceof CreateConnectionRequest)) {
con.setTargetDecoration(new PolygonDecoration());
return con;
}
CreateLinkCommand cmd = (CreateLinkCommand) ((CreateConnectionRequest) req).getStartCommand();
if (cmd.output != null)
con.setTargetDecoration(new PolygonDecoration());
else if (cmd.input != null)
con.setSourceDecoration(new PolygonDecoration());
return con;
}