本文整理汇总了Java中org.netbeans.api.visual.vmd.VMDPinWidget类的典型用法代码示例。如果您正苦于以下问题:Java VMDPinWidget类的具体用法?Java VMDPinWidget怎么用?Java VMDPinWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VMDPinWidget类属于org.netbeans.api.visual.vmd包,在下文中一共展示了VMDPinWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAttribute
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void createAttribute(String table , Attribute attribute) {
VMDPinWidget attributeWidget = (VMDPinWidget)scene.addPin(table,table+attribute.getName());
attributeWidget.setPinName(attribute.getName());
attributeWidget.setToolTipText("Double click for View Table data");
attributeWidget.setLayout(LayoutFactory.createHorizontalFlowLayout(
LayoutFactory.SerialAlignment.JUSTIFY, 7));
LabelWidget type = new LabelWidget(scene);
type.setForeground(Color.GRAY);
type.setLabel(attribute.getType());
attributeWidget.addChild(type);
for(Key k : db.getKeys(table)) {
for(AttributeRef attr : k.getAttributes()) {
if(attr.getName().equals(attribute.getName()) && k.isPrimaryKey()) {
LabelWidget pk = new LabelWidget(scene);
pk.setForeground(Color.BLUE);
pk.setLabel(" PK");
attributeWidget.addChild(pk);
}
}
}
}
示例2: creaWidgetIconForSelectionCondition
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
public void creaWidgetIconForSelectionCondition() {
FORule tgd = jLayeredPane.getMappingTaskTopComponent().getScenario().getSelectedFORule();
// FindNode finder = new FindNode();
CreaWidgetEsisteSelectionCondition checker = new CreaWidgetEsisteSelectionCondition();
// MappingTask mappingTask = scenario.getMappingTask();
IDataSourceProxy source = mappingTask.getSourceProxy();
List<PathExpression> pathExpressions = findAllSelectionConditionPath(tgd.getComplexSourceQuery());
// for (SelectionCondition selectionCondition : source.getSelectionConditions()) {
for (PathExpression pathExpression : pathExpressions) {
INode iNode = finder.findNodeInSchema(pathExpression, source);
VMDPinWidget vMDPinWidget = (VMDPinWidget) iNode.getAnnotation(Costanti.PIN_WIDGET_TREE_TGD);
CaratteristicheWidgetTree caratteristicheWidgetTree = (CaratteristicheWidgetTree) glassPane.getMainLayer().getChildConstraint(vMDPinWidget);
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) caratteristicheWidgetTree.getTreePath().getLastPathComponent();
SelectionConditionInfo selectionConditionInfo = creaSelectionConditionInfo(iNode);
selectionConditionInfo.setExpressionString("false");
selectionConditionInfo.setSelectionCondition(null);
checker.creaWidgetEsisteSelectionCondition(treeNode, "false", null);
}
// }
}
示例3: deleteSelectionCondition
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void deleteSelectionCondition(boolean oldButtonState, String oldSelectionCondition, SelectionConditionInfo selectionConditionInfo) {
try {
INode iNode = getNodeSelected();
TreePath treePath = jTree.getSelectionPath();
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
review.removeSelectionCondition(selectionConditionInfo.getSelectionCondition(), dataSource);
selectionConditionInfo.setSelectionCondition(null);
selectionConditionInfo.setExpressionString("");
analisiSelection.creaWidgetEsisteSelectionCondition(treeNode, selectionConditionInfo.getExpressionString(), selectionConditionInfo.getSelectionCondition());
VMDPinWidget vMDPinWidget = (VMDPinWidget) iNode.getAnnotation(Costanti.PIN_WIDGET_TREE);
vMDPinWidget.setToolTipText(null);
aggiorna();
} catch (ExpressionSyntaxException e) {
creator.undo(selectionConditionInfo.getSelectionCondition(), dataSource);
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING));
ripristina(oldButtonState, oldSelectionCondition, selectionConditionInfo);
}
}
示例4: updateSelectionCondition
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void updateSelectionCondition(boolean oldButtonState, String oldSelectionCondition, SelectionConditionInfo selectionConditionInfo) {
try {
INode iNode = getNodeSelected();
TreePath treePath = jTree.getSelectionPath();
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
review.removeSelectionCondition(selectionConditionInfo.getSelectionCondition(), dataSource);
creator.createSelectionCondition(iNode, selectionConditionInfo.getExpressionString(), dataSource, selectionConditionInfo);
analisiSelection.creaWidgetEsisteSelectionCondition(treeNode, selectionConditionInfo.getExpressionString(),selectionConditionInfo.getSelectionCondition());
VMDPinWidget vMDPinWidget = (VMDPinWidget) iNode.getAnnotation(Costanti.PIN_WIDGET_TREE);
vMDPinWidget.setToolTipText(selectionConditionInfo.getSelectionCondition().toString());
aggiorna();
} catch (ExpressionSyntaxException e) {
creator.undo(selectionConditionInfo.getSelectionCondition(), dataSource);
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING) + " : " + e.getMessage(), DialogDescriptor.WARNING_MESSAGE));
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(Costanti.class, Costanti.SYNTAX_WARNING));
ripristina(oldButtonState, oldSelectionCondition, selectionConditionInfo);
}
}
示例5: createConnection
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的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));
}
}
示例6: createConnectionFromFunctionalDependecyImpl
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的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;
}
示例7: createPremiseNodes
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private List<VMDNodeWidget> createPremiseNodes(VMDGraphScene scene) {
List<VMDNodeWidget> result = new ArrayList<VMDNodeWidget>();
for (String commonValue : commonValues.keySet()) {
Collection<String> cells = commonValues.get(commonValue);
if (cells.size() > 1) {
VMDNodeWidget node = (VMDNodeWidget) scene.addNode(commonValue);
node.setNodeName(commonValue);
node.setBorder(premiseBorder);
createNodePin(scene, node);
result.add(node);
for (String cell : cells) {
VMDPinWidget pin = (VMDPinWidget) scene.addPin(commonValue, cell + ":" + commonValue);
pin.setPinName(cell);
}
}
}
return result;
}
示例8: settaWidgetAlbero
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void settaWidgetAlbero(VMDPinWidget pin, boolean source) {
ArrayList lista = new ArrayList();
if (source) {
lista.add(ImageUtilities.loadImage(Costanti.ICONA_PIN_SOURCE));
} else {
lista.add(ImageUtilities.loadImage(Costanti.ICONA_PIN_TARGET));
}
pin.setOpaque(false);
pin.setGlyphs(lista);
}
示例9: creaWidgetEsisteSelectionCondition
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
public void creaWidgetEsisteSelectionCondition(DefaultMutableTreeNode treeNode, String espressione, SelectionCondition selectionCondition) {
TreeNodeAdapter adapter = (TreeNodeAdapter) treeNode.getUserObject();
INode iNode = adapter.getINode();
if (!espressione.equalsIgnoreCase("true") && !espressione.equalsIgnoreCase("")) {
adapter.setSelectionCondition(true);
VMDPinWidget vMDPinWidget = (VMDPinWidget) iNode.getAnnotation(Costanti.PIN_WIDGET_TREE);
if (selectionCondition != null) {
vMDPinWidget.setToolTipText(selectionCondition.toString());
}
} else if ((espressione.equalsIgnoreCase("true") || espressione.equalsIgnoreCase(""))) {
adapter.setSelectionCondition(false);
}
}
示例10: setWidgetFunctionalDependency
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void setWidgetFunctionalDependency(Widget sourceWidget, Widget targetWidget, ConnectionWidget connection) {
CaratteristicheWidgetInterFunctionalDep caratteristiche = (CaratteristicheWidgetInterFunctionalDep) targetWidget.getParentWidget().getChildConstraint(targetWidget);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(sourceWidget.getScene(), mainLayer, caratteristiche)));
caratteristiche.addSourceWidget((VMDPinWidget) sourceWidget);
if (!caratteristiche.getTargetList().isEmpty()) {
review.removeFunctionalDependency(caratteristiche.getFunctionalDependency(), caratteristiche.isSource());
creator.createCorrespondenceWithFunctionalDep(mainLayer, caratteristiche, caratteristiche.getConnectionInfo());
}
}
示例11: addAtom
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void addAtom(RelationalAtom atom) {
logger.debug("FORMULA ATOM: " + atom.toString());
String atomId = atom.getTableNameWithAlias();
VMDNodeWidget n1 = (VMDNodeWidget) scene.addNode(atomId);
n1.setNodeName(atom.getTableNameWithAlias());
nodes.add(n1);
for (FormulaAttribute formulaVariable : atom.getAttributes()) {
logger.debug("FORMULA ATTRIBUTE PIN: " + formulaVariable.toString());
VMDPinWidget pin = (VMDPinWidget) scene.addPin(atomId, formulaVariable.hashCode() + "");
pin.setPinName(formulaVariable.toString());
}
}
示例12: attachPinWidget
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
/**
* Implements attaching a widget to a pin. The widget is VMDPinWidget and
* has object-hover and select action.
*
* @param node the node
* @param pin the pin
* @return the widget attached to the pin, null, if it is a default pin
*/
@Override
protected Widget attachPinWidget(GraphNode node, PinNode pin) {
if (pin.isHidden()) {
return null;
}
VMDPinWidget widget = new VMDPinWidget(this, scheme);
((VMDNodeWidget) findWidget(node)).attachPinWidget(widget);
widget.getActions().addAction(createObjectHoverAction());
widget.getActions().addAction(createSelectAction());
return widget;
}
示例13: updateUI
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
@Override
public void updateUI(VMDPinWidget widget, ObjectState previousState, ObjectState state) {
widget.setOpaque(state.isSelected());
if (state.isFocused() || state.isHovered()) {
widget.setBorder(BORDER_PIN_HOVERED);
} else {
widget.setBorder(BORDER_PIN);
}
// LookFeel lookFeel = getScene ().getLookFeel ();
// setBorder (BorderFactory.createCompositeBorder (BorderFactory.createEmptyBorder (8, 2), lookFeel.getMiniBorder (state)));
// setForeground (lookFeel.getForeground (state));
}
示例14: settaWidgetKey
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void settaWidgetKey(VMDPinWidget pin) {
ArrayList lista = new ArrayList();
lista.add(ImageUtilities.loadImage(Costanti.ICONA_PIN_KEY));
pin.setOpaque(false);
pin.setGlyphs(lista);
}
示例15: createConnectionToFunctionalDependecyImpl
import org.netbeans.api.visual.vmd.VMDPinWidget; //导入依赖的package包/类
private void createConnectionToFunctionalDependecyImpl(Widget sourceWidget, Widget functionalDepWidget, LayerWidget mainLayer, LayerWidget connectionLayer, Stroke stroke) {
ConnectionWidget connection = new ConnectionWidget(sourceWidget.getScene());
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setSourceAnchor(AnchorFactory.createCenterAnchor(sourceWidget));
connection.setTargetAnchor(AnchorFactory.createRectangularAnchor(functionalDepWidget));
connection.setStroke(stroke);
CaratteristicheWidgetInterFunctionalDep caratteristiche = (CaratteristicheWidgetInterFunctionalDep) mainLayer.getChildConstraint(functionalDepWidget);
connection.getActions().addAction(ActionFactory.createPopupMenuAction(new MyPopupProviderConnectionFunctionalDep(sourceWidget.getScene(), mainLayer, caratteristiche)));
caratteristiche.addSourceWidget((VMDPinWidget) sourceWidget);
connectionLayer.addChild(connection);
}