本文整理汇总了Java中org.netbeans.modeler.widget.pin.info.PinWidgetInfo类的典型用法代码示例。如果您正苦于以下问题:Java PinWidgetInfo类的具体用法?Java PinWidgetInfo怎么用?Java PinWidgetInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PinWidgetInfo类属于org.netbeans.modeler.widget.pin.info包,在下文中一共展示了PinWidgetInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachPinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
/**
* Called by the addPin method before the pin is registered to acquire a
* widget that is going to represent the pin in the scene. The method is
* responsible for creating the widget, adding it into the scene and
* returning it from the method.
*
* @param nodeWidgetInfo
* @param pinWidgetInfo
*
* @return the widget representing the pin; null, if the pin is non-visual
*/
@Override
protected Widget attachPinWidget(NodeWidgetInfo nodeWidgetInfo, PinWidgetInfo pinWidgetInfo) {
INodeWidget nodeWidget = (INodeWidget) findWidget(nodeWidgetInfo);
if (pinWidgetInfo.getDocumentId().equals("INTERNAL")) {
return null;
}
PinWidget pinWidget = (PinWidget) this.getModelerFile().getPModelerUtil().attachPinWidget(this, nodeWidget, pinWidgetInfo);
if (pinWidget == null) {
return null;
}
if (pinWidget instanceof IBaseElementWidget) {
((IBaseElementWidget) pinWidget).setId(pinWidgetInfo.getId());
((PNodeWidget) nodeWidget).attachPinWidget(pinWidget);
}
// this.setFocusedWidget(pinWidget);
// this.validate();
return pinWidget;
}
示例2: attachEdgeTargetAnchor
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
/**
* Called by the setEdgeTarget method to notify about the changing the edge
* target in the graph model. The method is responsible for attaching a new
* target pin to the edge in the visual representation.
* <p>
* Usually it is implemented as:
* <pre>
* Widget targetPinWidget = findWidget (targetPin);
* Anchor targetAnchor = AnchorFactory.createRectangularAnchor (targetPinWidget)
* ConnectionWidget edgeWidget = (ConnectionWidget) findWidget (edge);
* edgeWidget.setTargetAnchor (targetAnchor);
* </pre>
*
* @param edge the edge which target is changed in graph model
* @param oldTargetPin the old target pin
* @param targetPin the new target pin
*/
@Override
protected void attachEdgeTargetAnchor(EdgeWidgetInfo edgeWidgetInfo, PinWidgetInfo oldTargetPin, PinWidgetInfo targetPinInfo) {
IEdgeWidget edgeWidget = (IEdgeWidget) findWidget(edgeWidgetInfo);
if (targetPinInfo == null) {//called in case of edge remove
edgeWidget.setTargetAnchor(null);
return;
}
IPinWidget targetPinWidget = (IPinWidget) findWidget(targetPinInfo);
if (targetPinWidget != null) {
NBModelerUtil.attachEdgeTargetAnchor((IModelerScene) this, edgeWidget, targetPinWidget);
} else {
INodeWidget targetNodeWidget = (INodeWidget) findWidget(getPinNode(targetPinInfo));
NBModelerUtil.attachEdgeTargetAnchor((IModelerScene) this, edgeWidget, targetNodeWidget);
}
if (edgeWidget instanceof IBaseElementWidget) {
((IBaseElementWidget) edgeWidget).init();
}
}
示例3: createNodeWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
@Override
public INodeWidget createNodeWidget(NodeWidgetInfo node) {
IPNodeWidget nodeWidget = (IPNodeWidget) this.addNode(node);
nodeWidget.setPreferredLocation(this.convertLocalToScene(node.getLocation()));
if (!node.isExist()) {
this.revalidate();
this.validateComponent();
}
if (nodeWidget instanceof IBaseElementWidget) {
if (node.getBaseElementSpec() != null) {
((IBaseElementWidget) nodeWidget).setBaseElementSpec(node.getBaseElementSpec());
}
((IBaseElementWidget) nodeWidget).init();
}
nodeWidget.getModelerScene().getModelerFile().getModelerDiagramEngine().setNodeWidgetAction(nodeWidget);
PinWidgetInfo pinWidgetInfo = new PinWidgetInfo(NBModelerUtil.getAutoGeneratedStringId(), "INTERNAL");
nodeWidget.setInternalPinWidgetInfo(pinWidgetInfo);
createPinWidget(nodeWidget.getNodeWidgetInfo(), pinWidgetInfo);
return nodeWidget;
}
示例4: createPinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
@Override
public IPinWidget createPinWidget(NodeWidgetInfo node, PinWidgetInfo pin) {
IPinWidget pinWidget = (IPinWidget) this.addPin(node, pin);
if (pinWidget instanceof IBaseElementWidget) {
if (pin.getBaseElementSpec() != null) {
((IBaseElementWidget) pinWidget).setBaseElementSpec(pin.getBaseElementSpec());
}
((IBaseElementWidget) pinWidget).init();
}
if (pinWidget != null) {
pinWidget.getModelerScene().getModelerFile().getModelerDiagramEngine().setPinWidgetAction(pinWidget);
}
return pinWidget;
}
示例5: BasicAttributeWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public BasicAttributeWidget(JPAModelerScene scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super(scene, nodeWidget, pinWidgetInfo);
this.setImage(getIcon());
// this.addPropertyVisibilityHandler("length", new PropertyVisibilityHandler<String>() {
// @Override
// public boolean isVisible() {
// Basic basicAttribute = (Basic) BasicAttributeWidget.this.getBaseElementSpec();
// return "String".equals(basicAttribute.getAttributeType());
// }
// });
// this.addPropertyVisibilityHandler("precision", new PropertyVisibilityHandler<String>() {
// @Override
// public boolean isVisible() {
// Basic basicAttribute = (Basic) BasicAttributeWidget.this.getBaseElementSpec();
// return basicAttribute.isPrecisionAttributeType();
// }
// });
// this.addPropertyVisibilityHandler("scale", new PropertyVisibilityHandler<String>() {
// @Override
// public boolean isVisible() {
// Basic basicAttribute = (Basic) BasicAttributeWidget.this.getBaseElementSpec();
// return basicAttribute.isScaleAttributeType();
// }
// });
}
示例6: BaseAttributeWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public BaseAttributeWidget(IModelerScene scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super(scene, nodeWidget, pinWidgetInfo);
this.addPropertyChangeListener("collectionType", new PropertyChangeListener<String>() {
@Override
public void changePerformed(String collectionType) { //Point here should be for only ElementCollection
if (BaseAttributeWidget.this.getBaseElementSpec() instanceof ElementCollection) {
ElementCollection elementCollection = (ElementCollection) BaseAttributeWidget.this.getBaseElementSpec();
boolean valid = false;
try {
if (collectionType != null || !collectionType.trim().isEmpty()) {
if (java.util.Collection.class.isAssignableFrom(Class.forName(collectionType.trim()))) {
valid = true;
}
}
} catch (ClassNotFoundException ex) {
//skip allow = false;
}
if (!valid) {
collectionType = java.util.Collection.class.getName();
}
elementCollection.setCollectionType(collectionType.trim());
}
}
});
}
示例7: PinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public PinWidget(S scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super((Scene) scene, scene.getColorScheme(), pinWidgetInfo.getTextDesign());
this.setModelerScene(scene);
this.pinWidgetInfo = pinWidgetInfo;
this.nodeWidget = nodeWidget;
editAction = new InplaceEditorAction<>(new TextFieldInplaceEditorProvider(new LabelInplaceEditor((Widget) this), null));
getPinNameWidget().getActions().addAction(editAction);
setPinName(pinWidgetInfo.getName());
}
示例8: attachPinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
@Override
public IPinWidget attachPinWidget(JSONBModelerScene scene, INodeWidget nodeWidget, PinWidgetInfo widgetInfo) {
IPinWidget widget = null;
if (widgetInfo.getDocumentId().equals(BranchNodeWidget.class.getSimpleName())) {
widget = new BranchNodeWidget(scene, (IPNodeWidget) nodeWidget, widgetInfo);
} else if (widgetInfo.getDocumentId().equals(LeafNodeWidget.class.getSimpleName())) {
widget = new LeafNodeWidget(scene, (IPNodeWidget) nodeWidget, widgetInfo);
} else {
throw new InvalidElmentException("Invalid JSONB Element");
}
return widget;
}
示例9: getEdgeTargetPinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public PinWidgetInfo getEdgeTargetPinWidget(INodeWidget sourceNodeWidget, INodeWidget targetNodeWidget, IEdgeWidget edgeWidget, DocumentWidget targetDocumentWidget) {
if(edgeWidget instanceof ReferenceFlowWidget || edgeWidget instanceof GeneralizationFlowWidget) {
DocumentWidget documentWidget = (DocumentWidget)targetNodeWidget;
return documentWidget.getInternalPinWidgetInfo();
} else {
throw new UnsupportedOperationException("Not supported yet.");
}
}
示例10: create
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
private <W extends JSONNodeWidget> W create(String id, String name, IBaseElement baseElement, Class<W> widgetClass) {
PinWidgetInfo pinWidgetInfo = new PinWidgetInfo(id, baseElement);
pinWidgetInfo.setName(this.getModelerScene().transferPropertyName(name));
pinWidgetInfo.setDocumentId(widgetClass.getSimpleName());
W widget = (W) createPinWidget(pinWidgetInfo);
return widget;
}
示例11: getEdgeSourcePinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public PinWidgetInfo getEdgeSourcePinWidget(INodeWidget sourceNodeWidget, INodeWidget targetNodeWidget, IEdgeWidget edgeWidget, ColumnWidget sourceColumnWidget) {
if (sourceNodeWidget instanceof TableWidget && targetNodeWidget instanceof TableWidget && edgeWidget instanceof ReferenceFlowWidget && sourceColumnWidget instanceof ForeignKeyWidget) {
ReferenceFlowWidget referenceFlowWidget = (ReferenceFlowWidget) edgeWidget;
TableWidget targetTableWidget = (TableWidget) targetNodeWidget;
DBColumn sourceColumn = (DBColumn) sourceColumnWidget.getBaseElementSpec();
IReferenceColumnWidget targetColumnWidget = targetTableWidget.findColumnWidget(sourceColumn.getReferenceColumn().getId());
referenceFlowWidget.setReferenceColumnWidget(targetColumnWidget);
referenceFlowWidget.setForeignKeyWidget((ForeignKeyWidget) sourceColumnWidget);
return sourceColumnWidget.getPinWidgetInfo();
} else {
throw new UnsupportedOperationException("Not supported yet.");
}
}
示例12: getEdgeTargetPinWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public PinWidgetInfo getEdgeTargetPinWidget(INodeWidget sourceNodeWidget, INodeWidget targetNodeWidget, IEdgeWidget edgeWidget, ColumnWidget targetColumnWidget) {
if (sourceNodeWidget instanceof TableWidget && targetNodeWidget instanceof TableWidget
&& edgeWidget instanceof ReferenceFlowWidget && targetColumnWidget instanceof ColumnWidget) {
return targetColumnWidget.getPinWidgetInfo();
} else {
throw new UnsupportedOperationException("Not supported yet.");
}
}
示例13: ParentAssociationColumnWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public ParentAssociationColumnWidget(DBModelerScene scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super(scene, nodeWidget, pinWidgetInfo);
this.addPropertyChangeListener("column_name", (PropertyChangeListener<String>) (oldValue, value) -> setMultiPropertyName(value));
this.addPropertyChangeListener("ass_override_column_name", (PropertyChangeListener<String>) (oldValue, value) -> setMultiPropertyName(value));
this.addPropertyChangeListener("table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
this.addPropertyChangeListener("ass_override_table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
}
示例14: ParentAttributeColumnWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public ParentAttributeColumnWidget(DBModelerScene scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super(scene, nodeWidget, pinWidgetInfo);
this.addPropertyChangeListener("column_name", (PropertyChangeListener<String>) (oldValue, value) -> {
setMultiPropertyName(value);
});
this.addPropertyChangeListener("attr_override_column_name", (PropertyChangeListener<String>) (oldValue, value) -> {
setMultiPropertyName(value);
});
this.addPropertyChangeListener("table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
this.addPropertyChangeListener("attr_override_table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
}
示例15: EmbeddedAssociationColumnWidget
import org.netbeans.modeler.widget.pin.info.PinWidgetInfo; //导入依赖的package包/类
public EmbeddedAssociationColumnWidget(DBModelerScene scene, IPNodeWidget nodeWidget, PinWidgetInfo pinWidgetInfo) {
super(scene, nodeWidget, pinWidgetInfo);
this.addPropertyChangeListener("column_name", (PropertyChangeListener<String>) (oldValue, value) -> setMultiPropertyName(value));
this.addPropertyChangeListener("ass_override_JoinColumn_name", (PropertyChangeListener<String>) (oldValue, value) -> setMultiPropertyName(value));
this.addPropertyChangeListener("table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
this.addPropertyChangeListener("ass_override_table_name", (PropertyChangeListener<String>) (oldValue, value) -> validateTableName(value));
}