本文整理汇总了Java中org.netbeans.api.visual.anchor.AnchorFactory类的典型用法代码示例。如果您正苦于以下问题:Java AnchorFactory类的具体用法?Java AnchorFactory怎么用?Java AnchorFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnchorFactory类属于org.netbeans.api.visual.anchor包,在下文中一共展示了AnchorFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCollisionsCollector
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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.anchor.AnchorFactory; //导入依赖的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.anchor.AnchorFactory; //导入依赖的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: creaConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的package包/类
private MyConnectionWidget creaConnection(Widget sourceWidget, Widget targetWidget, boolean direzionale, Stroke stroke) {
MyConnectionWidget connection = new MyConnectionWidget(scene);
connection.setTargetAnchorShape(AnchorShape.NONE);
if (direzionale) {
AnchorShape anchorShape = AnchorShapeFactory.createTriangleAnchorShape(5, false, false);
connection.setTargetAnchorShape(anchorShape/*AnchorShape.TRIANGLE_HOLLOW*/);
}
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createCenterAnchor(targetWidget));
connection.setLineColor(Costanti.COLOR_CONNECTION_CONSTRAINT_DEFAULT);
connection.setStroke(stroke);
connection.setKey(true);
constraintsLayer.addChild(connection);
return connection;
}
示例5: creaConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的package包/类
private MyConnectionWidget creaConnection(Widget sourceWidget, Widget targetWidget, boolean direzionale, Stroke stroke, JoinConstraint joinConstraint) {
MyConnectionWidget connection = new MyConnectionWidget(scene);
connection.setDirezionale(direzionale);
connection.setTargetAnchorShape(AnchorShape.NONE);
if (direzionale) {
AnchorShape anchorShape = Costanti.ANCHOR_SHAPE;
connection.setTargetAnchorShape(anchorShape/*AnchorShape.TRIANGLE_HOLLOW*/);
}
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createCenterAnchor(targetWidget));
connection.setLineColor(Costanti.COLOR_CONNECTION_CONSTRAINT_DEFAULT);
connection.setStroke(stroke);
constraintsLayer.addChild(connection, joinConstraint);
constraintsLayer.revalidate();
// connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderJoinCondition(scene, constraintsLayer, joinConstraint)));
return connection;
}
示例6: creaCorrespondence
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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();
}
示例7: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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;
}
}
}
示例8: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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));
}
}
示例9: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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));
}
}
示例10: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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));
}
}
示例11: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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;
}
}
}
示例12: createConnectionToTargetImpl
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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;
}
示例13: createConnectionFromFunctionalDependecyImpl
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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;
}
示例14: createConnectionFromFunctionImpl
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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;
}
示例15: createConnection
import org.netbeans.api.visual.anchor.AnchorFactory; //导入依赖的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));
}
}