本文整理汇总了Java中org.eclipse.gef.editpolicies.SelectionEditPolicy类的典型用法代码示例。如果您正苦于以下问题:Java SelectionEditPolicy类的具体用法?Java SelectionEditPolicy怎么用?Java SelectionEditPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SelectionEditPolicy类属于org.eclipse.gef.editpolicies包,在下文中一共展示了SelectionEditPolicy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.CONNECTION_ROLE, new DwParentChildConnectionEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DwFeatureGraphicalNodeEditPolicy(editor, model));
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new DwParentChildConnectionEndpointEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy(){
DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();
@Override
protected void hideSelection() {
((DwParentChildConnectionFigure)getFigure()).setColor(theme.getLineColor());
getFigure().repaint();
}
@Override
protected void showSelection() {
((DwParentChildConnectionFigure)getFigure()).setColor(theme.getSelectionSecondaryColor());
getFigure().repaint();
}
});
}
示例2: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
return new DeleteCommand(getModel());
}
});
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new TableNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new TableLayoutEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
@Override
protected void hideSelection() {
getFigure().hideSelectedBorder();
}
@Override
protected void showSelection() {
getFigure().showSelectedBorder();
}
});
}
示例3: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.LAYOUT_ROLE, new ItemDragPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
new SelectionEditPolicy() {
@Override
protected void showSelection() {
sync.syncExec(new Runnable() {
@Override
public void run() {
((ItemFigure) getHostFigure()).changeColor(true);
}
});
}
@Override
protected void hideSelection() {
sync.syncExec(new Runnable() {
@Override
public void run() {
((ItemFigure) getHostFigure()).changeColor(false);
}
});
}
});
}
示例4: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
protected void hideSelection() {
// System.out.println("hide branch");
}
protected void showSelection() {
// System.out.println("show branch");
}
});
}
示例5: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
protected void hideSelection() {
// System.out.println("hide path");
}
protected void showSelection() {
// System.out.println("show path");
}
});
}
示例6: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
protected void hideSelection() {
refreshVisuals();
}
protected void showSelection() {
refreshVisuals();
}
});
}
示例7: createEditPolicies
import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
super.createEditPolicies();
installEditPolicy("ShowDropdown", new SelectionEditPolicy() { //$NON-NLS-1$
@Override
protected void hideSelection()
{
setShowDropdown(false);
}
@Override
protected void showSelection()
{
setShowDropdown(false);
}
@Override
protected void showPrimarySelection()
{
setShowDropdown(true);
}
private void setShowDropdown(boolean flag)
{
IFigure figure = getFigure();
if(figure instanceof ComboboxFigure) {
((ComboboxFigure)figure).setShowDropdown(flag);
}
}
});
}