本文整理汇总了Java中org.netbeans.api.visual.widget.ConnectionWidget.setTargetAnchor方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionWidget.setTargetAnchor方法的具体用法?Java ConnectionWidget.setTargetAnchor怎么用?Java ConnectionWidget.setTargetAnchor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.widget.ConnectionWidget
的用法示例。
在下文中一共展示了ConnectionWidget.setTargetAnchor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCollisionsCollector
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void testCollisionsCollector () {
Scene scene = new Scene ();
ConnectionWidget widget = new ConnectionWidget (scene);
widget.setSourceAnchor (AnchorFactory.createFixedAnchor (new Point (100, 100)));
widget.setTargetAnchor (AnchorFactory.createFixedAnchor (new Point (300, 200)));
widget.setRouter (RouterFactory.createOrthogonalSearchRouter (new CollisionsCollector() {
public void collectCollisions (List<Rectangle> verticalCollisions, List<Rectangle> horizontalCollisions) {
getRef ().println ("CollisionsCollector invoked");
}
}));
scene.addChild (widget);
JFrame frame = showFrame (scene);
frame.setVisible(false);
frame.dispose ();
compareReferenceFiles ();
}
示例2: testConnectionWidgetCollisionsCollector
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void testConnectionWidgetCollisionsCollector () {
Scene scene = new Scene ();
final ConnectionWidget widget = new ConnectionWidget (scene);
widget.setSourceAnchor (AnchorFactory.createFixedAnchor (new Point (100, 100)));
widget.setTargetAnchor (AnchorFactory.createFixedAnchor (new Point (300, 200)));
widget.setRouter (RouterFactory.createOrthogonalSearchRouter (new ConnectionWidgetCollisionsCollector () {
public void collectCollisions (ConnectionWidget connectionWidget, List<Rectangle> verticalCollisions, List<Rectangle> horizontalCollisions) {
getRef ().println ("ConnectionWidgetCollisionsCollector invoked - is widget valid: " + (connectionWidget == widget));
}
}));
scene.addChild (widget);
JFrame frame = showFrame (scene);
frame.setVisible(false);
frame.dispose ();
compareReferenceFiles ();
}
示例3: creaCandidateCorrespondence
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
private void creaCandidateCorrespondence(ValueCorrespondence valueCorrespondence, MappingTask mappingTask) {
INode iNodeSource = finder.findNodeInSchema(valueCorrespondence.getSourcePaths().get(0), mappingTask.getSourceProxy());
VMDPinWidgetSource sourceWidget = (VMDPinWidgetSource) iNodeSource.getAnnotation(Costanti.PIN_WIDGET_TREE_SPICY);
INode iNodeTarget = finder.findNodeInSchema(valueCorrespondence.getTargetPath(), mappingTask.getTargetProxy());
VMDPinWidgetTarget targetWidget = (VMDPinWidgetTarget) iNodeTarget.getAnnotation(Costanti.PIN_WIDGET_TREE_SPICY);
ConnectionWidget connection = new ConnectionWidget(glassPane.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.DASHED_STROKE;
connection.setStroke(stroke);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setConnectionWidget(connection);
connectionInfo.setValueCorrespondence(valueCorrespondence);
connection.setToolTipText(connectionInfo.getValueCorrespondence().toString());
setColorOnConfidence(connectionInfo, connection);
glassPane.getConnectionLayer().addChild(connection, connectionInfo);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionSpicy(glassPane.getScene())));
connection.getActions().addAction(ActionFactory.createSelectAction(new MySelectConnectionActionProvider(glassPane.getConnectionLayer())));
glassPane.getScene().validate();
}
示例4: creaCorrespondence
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
private void creaCorrespondence(VariableCorrespondence variableCorrespondence, ValueCorrespondence valueCorrespondence, MappingTask mappingTask) {
INode iNodeSource = finder.findNodeInSchema(valueCorrespondence.getSourcePaths().get(0), mappingTask.getSourceProxy());
VMDPinWidgetSource sourceWidget = (VMDPinWidgetSource) iNodeSource.getAnnotation(Costanti.PIN_WIDGET_TREE);
INode iNodeTarget = finder.findNodeInSchema(valueCorrespondence.getTargetPath(), mappingTask.getTargetProxy());
VMDPinWidgetTarget targetWidget = (VMDPinWidgetTarget) iNodeTarget.getAnnotation(Costanti.PIN_WIDGET_TREE);
ConnectionWidget connection = new ConnectionWidget(glassPane.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setConnectionWidget(connection);
connectionInfo.setValueCorrespondence(valueCorrespondence);
connection.setToolTipText(connectionInfo.getValueCorrespondence().toString());
glassPane.getConnectionLayer().addChild(connection, connectionInfo);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionMappingTask(glassPane.getScene())));
connection.getActions().addAction(ActionFactory.createSelectAction(new MySelectConnectionActionProvider(glassPane.getConnectionLayer())));
// analisiFiltro.creaWidgetEsisteFiltro(connection, connectionInfo);
glassPane.getScene().validate();
}
示例5: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
ConnectionWidget connection = new ConnectionWidget(scene);
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = creator.getStroke();
connection.setStroke(stroke);
if (targetWidget instanceof FunctionalDependencyWidget) {
setWidgetFunctionalDependency(sourceWidget, targetWidget, connection);
connectionLayer.addChild(connection);
}
if (targetWidget instanceof VMDPinWidgetTarget) {
if (createJoinCondition(sourceWidget, targetWidget)) {
return;
}
}
}
示例6: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
try {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionConst(sourceWidget.getScene(), caratteristicheWidget)));
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
caratteristicheWidget.setFormValidation(new FormValidation(false));
creator.createCorrespondenceWithSourceValue(mainLayer, sourceWidget, targetWidget, connectionInfo);
caratteristicheWidget.addConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
} catch (ExpressionSyntaxException ese) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + ese, DialogDescriptor.WARNING_MESSAGE));
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING));
}
}
示例7: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
try {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(sourceWidget.getScene(), mainLayer, caratteristiche)));
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
if (!caratteristiche.getTargetList().isEmpty()) {
review.removeFunctionalDependency(caratteristiche.getFunctionalDependency(), caratteristiche.isSource());
}
caratteristiche.addTargetWidget((VMDPinWidget) targetWidget);
creator.createCorrespondenceWithFunctionalDep(mainLayer, caratteristiche, connectionInfo);
caratteristiche.setConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
} catch (ExpressionSyntaxException e) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
}
}
示例8: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
try {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunc(sourceWidget.getScene(), mainLayer, caratteristiche)));
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
caratteristiche.setTargetWidget((VMDPinWidgetTarget) targetWidget);
creator.createCorrespondenceWithFunction(mainLayer, targetWidget, caratteristiche, connectionInfo);
caratteristiche.setConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
} catch (ExpressionSyntaxException e) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
}
}
示例9: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
ConnectionWidget connection = new ConnectionWidget(scene);
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = creator.getStroke();
connection.setStroke(stroke);
if (targetWidget instanceof FunctionWidget) {
setWidget(sourceWidget, targetWidget, connection);
connectionLayer.addChild(connection);
}
if (targetWidget instanceof FunctionalDependencyWidget) {
setWidgetFunctionalDependency(sourceWidget, targetWidget, connection);
connectionLayer.addChild(connection);
}
if (targetWidget instanceof VMDPinWidgetTarget) {
createCorrespondence(connection, sourceWidget, targetWidget);
}
if (targetWidget instanceof VMDPinWidgetSource) {
if (createJoinCondition(sourceWidget, targetWidget)) {
return;
}
}
}
示例10: createConnectionToTargetImpl
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
private ConnectionInfo createConnectionToTargetImpl(Widget sourceWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
connection.setStroke(stroke);
CaratteristicheWidgetInterConst caratteristicheWidget = (CaratteristicheWidgetInterConst) mainLayer.getChildConstraint(sourceWidget);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionConst(sourceWidget.getScene(), caratteristicheWidget)));
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
caratteristicheWidget.addConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
return connectionInfo;
}
示例11: createConnectionFromFunctionalDependecyImpl
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
private ConnectionInfo createConnectionFromFunctionalDependecyImpl(Widget functionalDepWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
ConnectionWidget connection = new ConnectionWidget(functionalDepWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(functionalDepWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
connection.setStroke(stroke);
connection.setVisible(true);
CaratteristicheWidgetInterFunctionalDep caratteristicheWidget = (CaratteristicheWidgetInterFunctionalDep) mainLayer.getChildConstraint(functionalDepWidget);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(functionalDepWidget.getScene(), mainLayer, caratteristicheWidget)));
caratteristicheWidget.addTargetWidget((VMDPinWidget) targetWidget);
ConnectionInfo connectionInfo = new ConnectionInfo();
// connectionInfo.setTargetWidget(targetWidget);
// connectionInfo.setConnectionWidget(connection);
connectionLayer.addChild(connection, connectionInfo);
return connectionInfo;
}
示例12: createConnectionFromFunctionImpl
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
private ConnectionInfo createConnectionFromFunctionImpl(Widget functionWidget, Widget targetWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
ConnectionWidget connection = new ConnectionWidget(functionWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(functionWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
connection.setStroke(stroke);
CaratteristicheWidgetInterFunction caratteristicheWidget = (CaratteristicheWidgetInterFunction) mainLayer.getChildConstraint(functionWidget);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunc(functionWidget.getScene(), mainLayer, caratteristicheWidget)));
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
connectionLayer.addChild(connection, connectionInfo);
return connectionInfo;
}
示例13: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
try {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setSourceWidget(sourceWidget);
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
setCompositionWidget(sourceWidget, targetWidget, connection, connectionInfo);
caratteristiche.setConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
} catch (ExpressionSyntaxException e) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
}
}
示例14: createConnection
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void createConnection(Widget sourceWidget, Widget targetWidget) {
try {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createRectangularAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(targetWidget));
Stroke stroke = Costanti.BASIC_STROKE;
connection.setStroke(stroke);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.setSourceWidget(sourceWidget);
connectionInfo.setTargetWidget(targetWidget);
connectionInfo.setConnectionWidget(connection);
if (targetWidget instanceof ChainWidget) {
setCompositionWidget(sourceWidget, targetWidget, connection, connectionInfo);
} else if (targetWidget instanceof MergeWidget) {
setMergeWidget(sourceWidget, targetWidget, connection, connectionInfo);
}
caratteristiche.setConnectionInfo(connectionInfo);
connectionLayer.addChild(connection, connectionInfo);
} catch (ExpressionSyntaxException e) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
}
}
示例15: testShow
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
public void testShow () {
Scene scene = new Scene ();
LayerWidget mainLayer = new LayerWidget (scene);
scene.addChild(mainLayer);
Widget w1 = new Widget (scene);
w1.setBorder (BorderFactory.createLineBorder ());
w1.setPreferredLocation (new Point (100, 100));
w1.setPreferredSize (new Dimension (40, 20));
mainLayer.addChild(w1);
Widget w2 = new Widget (scene);
w2.setBorder (BorderFactory.createLineBorder ());
w2.setPreferredLocation (new Point (200, 100));
w2.setPreferredSize (new Dimension (40, 20));
mainLayer.addChild(w2);
LayerWidget connLayer = new LayerWidget (scene);
scene.addChild(connLayer);
ConnectionWidget conn = new ConnectionWidget(scene);
conn.setSourceAnchor(AnchorFactory.createRectangularAnchor(w1));
conn.setTargetAnchor(AnchorFactory.createRectangularAnchor(w2));
connLayer.addChild(conn);
Color color = (Color) (new DefaultLookFeel()).getBackground();
assertScene (scene, color,
new Rectangle (99, 99, 42, 22),
new Rectangle (199, 99, 42, 22),
new Rectangle (138, 108, 64, 4)
);
}