当前位置: 首页>>代码示例>>Java>>正文


Java ZestStyles类代码示例

本文整理汇总了Java中org.eclipse.zest.core.widgets.ZestStyles的典型用法代码示例。如果您正苦于以下问题:Java ZestStyles类的具体用法?Java ZestStyles怎么用?Java ZestStyles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ZestStyles类属于org.eclipse.zest.core.widgets包,在下文中一共展示了ZestStyles类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConnections

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
private void createConnections(Refinement refinement) {
    int connectionStyle = ZestStyles.CONNECTIONS_DIRECTED;
    for (RefinementReason reason : refinement.getReasons()) {

        VariationPoint sourceVP = reason.getSource();
        VariationPoint targetVP = reason.getTarget();

        GraphNode source = nodeIndex.get(sourceVP);
        GraphNode target = nodeIndex.get(targetVP);

        if (!isValidNewConnection(source, target)) {
            continue;
        }

        GraphConnection connection = new GraphConnection(this, connectionStyle, source, target);
        connection.setHighlightColor(COLOR_CONNECTION_HIGHLIGHT);
        if (!areFocused(sourceVP, targetVP)) {
            connection.setLineStyle(SWT.LINE_DASH);
            connection.setLineColor(COLOR_CONNECTION_NOTFOCUSED);
        } else {
            connection.setLineColor(COLOR_CONNECTION_FOCUSED);
        }
        connection.setTooltip(new Label(reason.getReason()));
        connectedNodes.put(source, target);
    }
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:27,代码来源:RefinementGraph.java

示例2: createPartControl

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
    gv = new GraphViewer(parent, SWT.NONE);
    gv.setNodeStyle(ZestStyles.NODES_NO_ANIMATION);
    gv.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
    gv.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);

    labelProvider = new DepcyGraphLabelProvider(gv.getControl());
    gv.setLabelProvider(labelProvider);
    gv.setContentProvider(new DepcyGraphViewContentProvider());

    // listen to node/connection selection events
    gv.getGraphControl().addSelectionListener(new SelectionAdapter() {
    });

    // register listener to pages post selection
    getSite().getPage().addPostSelectionListener(this);

    gv.getGraphControl().addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDoubleClick(MouseEvent e) {
            ISelection selection = gv.getSelection();
            if (currentProject != null && !selection.isEmpty()
                    && selection instanceof IStructuredSelection) {
                Object obj = ((IStructuredSelection) selection).getFirstElement();
                if (obj instanceof PgStatement) {
                    PgStatement st = (PgStatement) obj;
                    try {
                        getSite().getPage().openEditor(new FileEditorInput(currentProject.getFile(
                                Path.fromOSString(ModelExporter.getRelativeFilePath(st, true)))),
                                EDITOR.SQL);
                    } catch (PartInitException ex) {
                        ExceptionNotifier.notifyDefault(ex.getLocalizedMessage(), ex);
                    }
                }
            }
        }
    });
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:41,代码来源:DepcyGraphView.java

示例3: init

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public void init(){
			//all
			wholeSash=new SashForm(parent, SWT.VERTICAL);
			//top
			SashForm topSash=new SashForm(wholeSash, SWT.HORIZONTAL);		
			//bottom
			botSash=new SashForm(wholeSash, SWT.HORIZONTAL);
			
			//top.left
			wiScrollComp=new ScrolledComposite(topSash, SWT.H_SCROLL|SWT.V_SCROLL);
			wiScrollComp.setLayout(new FillLayout());
			wiComp=new Composite(wiScrollComp, SWT.FILL);
			wiComp.setSize(width0, height0);
//			wiComp.setLayout(new FillLayout());
			GridLayout layout = new GridLayout();
			layout.numColumns=1;			
			wiComp.setLayout(layout);
			wiScrollComp.setContent(wiComp);

			//top.right
			eplTable=new EplTable(topSash, SWT.MULTI|SWT.V_SCROLL|SWT.H_SCROLL|SWT.FULL_SELECTION);
			eplTable.getTable().addMouseListener(eplTableListener);

			Composite flowGraphComp=new Composite(botSash, SWT.NONE);
			flowGraphComp.setLayout(new FillLayout());
			flowGraph=new CGraph(flowGraphComp, SWT.NONE);
			flowGraph.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);

			//bottom.right
			//flowText=new Text(botSash, SWT.NONE);
			initInstanceStatTable(botSash);
			
			//set weights
			topSash.setWeights(new int[]{3,1});
			botSash.setWeights(new int[]{3,1});
			wholeSash.setWeights(new int[]{3,1});
		}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:38,代码来源:WorkerInstancesComposite2.java

示例4: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
@Override
public int getConnectionStyle(Object rel) {
	if ( rel instanceof EntityConnectionData ) {
		EntityConnectionData d = (EntityConnectionData) rel;
		RuleResolutionInfo rri = (RuleResolutionInfo) d.dest;

		switch ( rri.getStatus() ) {
		case RESOLUTION_DISCARDED: return ZestStyles.CONNECTIONS_DASH_DOT;
		case RESOLUTION_UNKNOWN: return ZestStyles.CONNECTIONS_DOT;
		case RESOLUTION_CONFIRMED: return ZestStyles.CONNECTIONS_SOLID;			
		}			
	}

	return 0;
}
 
开发者ID:anatlyzer,项目名称:anatlyzer,代码行数:16,代码来源:ResolveBindingLabelProvider.java

示例5: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
@Override
public int getConnectionStyle(Object element) {
	if ( element instanceof ISearchEdge ) {
		AtlProblemQuickfix qfx = ((ISearchEdge) element).getQuickfix();
		if ( qfx instanceof BindingProblemQuickFix ) {
			return ZestStyles.CONNECTIONS_DASH;
		}
	}
	return ZestStyles.CONNECTIONS_SOLID;
}
 
开发者ID:anatlyzer,项目名称:anatlyzer,代码行数:11,代码来源:SearchLabelProvider2.java

示例6: createNode

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
private void createNode(VariationPoint vp) {
    GraphNode vpNode = new GraphNode(this, ZestStyles.NODES_HIDE_TEXT, "VP", SPLevoUIPlugin.KOPL_ICON);
    vpNode.setData(NODE_DATA_KEY_VP, vp);

    if (isFocused(vp)) {
        vpNode.setBackgroundColor(COLOR_NODE_BACKGROUND_FOCUSED);
    } else {
        vpNode.setBackgroundColor(COLOR_NODE_BACKGROUND_NOTFOCUSED);
    }
    vpNode.setHighlightColor(COLOR_NODE_HIGHLIGHT);
    vpNode.setBorderHighlightColor(vpNode.getBorderColor());
    vpNode.setTooltip(new Label(vp.getLocation().getLabel()));
    nodeIndex.put(vp, vpNode);
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:15,代码来源:RefinementGraph.java

示例7: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
@Override
public int getConnectionStyle(Object rel) {
	return ZestStyles.CONNECTIONS_SOLID;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:5,代码来源:FigureProvider.java

示例8: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public int getConnectionStyle(Object src, Object dest) {
	return ZestStyles.CONNECTIONS_DIRECTED;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:4,代码来源:ObjectThreadDumpLockView.java

示例9: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public int getConnectionStyle(Object rel) {
	return ZestStyles.CONNECTIONS_DIRECTED;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:4,代码来源:XLogCallView.java

示例10: IvyNodeLabelProvider

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public IvyNodeLabelProvider(GraphViewer viewer) {
    this.viewer = viewer;
    this.rootDirectDependenciesDecorator.setStyles(new Color(Display.getDefault(), 197, 237, 197),
            new ConnectionStyle(ZestStyles.CONNECTIONS_SOLID, new Color(Display.getDefault(), 175, 175, 175), 1,
                    false));
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:7,代码来源:IvyNodeLabelProvider.java

示例11: getConnectionStyle

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public int getConnectionStyle(Object rel) {
    return ZestStyles.CONNECTIONS_DIRECTED;
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:4,代码来源:IvyNodeLabelProvider.java

示例12: ConfigurationConflictAlgorithm

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
public ConfigurationConflictAlgorithm() {
    // set default colors for this algorithm
    entityColor = new Color(null, 215, 27, 27);
    relationshipColor = new ConnectionStyle(ZestStyles.CONNECTIONS_SOLID, ColorConstants.red, 1, false);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:6,代码来源:ConfigurationConflictAlgorithm.java

示例13: construct

import org.eclipse.zest.core.widgets.ZestStyles; //导入依赖的package包/类
@Override
public Control construct(Composite parent) {
	Composite content = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
	GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);

	Graph graph = new Graph(content, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(graph);
	// now a few nodes
	GraphNode node1 = new GraphNode(graph, SWT.NONE, "Jim");
	GraphNode node2 = new GraphNode(graph, SWT.NONE, "Jack");
	GraphNode node3 = new GraphNode(graph, SWT.NONE, "Joe");
	GraphNode node4 = new GraphNode(graph, SWT.NONE, "Bill");
	// Lets have a directed connection
	new GraphConnection(graph, ZestStyles.CONNECTIONS_DIRECTED, node1,
			node2);
	// Lets have a dotted graph connection
	new GraphConnection(graph, ZestStyles.CONNECTIONS_DOT, node2, node3);
	// Standard connection
	new GraphConnection(graph, SWT.NONE, node3, node1);
	// Change line color and line width
	GraphConnection graphConnection = new GraphConnection(graph, SWT.NONE,
			node1, node4);
	graphConnection.changeLineColor(parent.getDisplay().getSystemColor(SWT.COLOR_GREEN));
	// Also set a text
	graphConnection.setText("This is a text");
	graphConnection.setHighlightColor(parent.getDisplay().getSystemColor(SWT.COLOR_RED));
	graphConnection.setLineWidth(3);

	graph.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
	// Selection listener on graphConnect or GraphNode is not supported
	// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=236528
	graph.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			System.out.println(e);
		}

	});

	return content;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:44,代码来源:ZestMockup.java


注:本文中的org.eclipse.zest.core.widgets.ZestStyles类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。