• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CompoundSnapToHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@Override 
public Object getAdapter(Class key) {
    if (key == SnapToHelper.class) {
        List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();
        if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
            helpers.add(new SnapToGeometry(this));
        }
        if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED))) {
            helpers.add(new SnapToGrid(this));
        }
        if(helpers.size()==0) {
            return null;
        } else {
            return new CompoundSnapToHelper(helpers.toArray(new SnapToHelper[0]));
        }
    }
    if (key == IPropertySource.class) {
       return new GW4EGraphEditPartProperties(this);
    }
    return null;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GraphPart.java


示例2: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
/**
 * {@inheritDoc} In this {@link EditPart} this method add adapter types for creating a
 * {@link SnapToHelper} when the editor is in snapping mode (either to grid or to shapes).
 */
@Override
public Object getAdapter(final Class key) {
  if (key == SnapToHelper.class) {
    List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();
    if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
      helpers.add(new SnapToGeometry(this));
    }
    if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED))) {
      helpers.add(new SnapToGrid(this));
    }
    if (helpers.size() == 0) {
      return null;
    } else {
      return new CompoundSnapToHelper(helpers.toArray(new SnapToHelper[0]));
    }
  }
  return super.getAdapter(key);
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:23,代码来源:ORMModelEditPart.java


示例3: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
	if (IPropertySource.class == key) {
		return getPropertySource();
	}
	if (key == SnapToHelper.class) {
		List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();
		if (Boolean.TRUE.equals(getViewer().getProperty(
				SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
			helpers.add(new SnapToGeometry(this));
		}
		if (Boolean.TRUE.equals(getViewer().getProperty(
				SnapToGrid.PROPERTY_GRID_ENABLED))) {
			helpers.add(new SnapToGrid(this));
		}
		if (helpers.size() == 0) {
			return null;
		} else {
			return new CompoundSnapToHelper(
					helpers.toArray(new SnapToHelper[0]));
		}
	}

	return super.getAdapter(key);
}
 
开发者ID:snakerflow,项目名称:snaker-designer,代码行数:27,代码来源:ProcessEditPart.java


示例4: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
public Object getAdapter(Class adapter)
{
	if (adapter == SnapToHelper.class) {
		List snapStrategies = new ArrayList();
		Boolean val = (Boolean) getViewer()
				.getProperty(RulerProvider.PROPERTY_RULER_VISIBILITY);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGuides(this));
		val = (Boolean) getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGeometry(this));
		val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));

		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);
		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = (SnapToHelper) snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(adapter);
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:27,代码来源:BONodeEditPart.java


示例5: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@Override
public Object getAdapter(final Class key) {

    if (key == SnapToHelper.class) {
        final List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();

        helpers.add(new SnapToGeometry(this));

        if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
            helpers.add(new SnapToGrid(this));
        }

        // if (Boolean.TRUE.equals(getViewer().getProperty(
        // SnapToGrid.PROPERTY_GRID_ENABLED))) {
        // helpers.add(new SnapToGrid(this));
        // }

        if (helpers.size() == 0) {
            return null;

        } else {
            return new CompoundSnapToHelper(helpers.toArray(new SnapToHelper[0]));
        }
    }

    return super.getAdapter(key);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:28,代码来源:ERDiagramEditPart.java


示例6: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();

		helpers.add(new SnapToGeometry(this));

		if (Boolean.TRUE.equals(getViewer().getProperty(
				SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
			helpers.add(new SnapToGrid(this));
		}

		// if (Boolean.TRUE.equals(getViewer().getProperty(
		// SnapToGrid.PROPERTY_GRID_ENABLED))) {
		// helpers.add(new SnapToGrid(this));
		// }

		if (helpers.size() == 0) {
			return null;

		} else {
			return new CompoundSnapToHelper(
					helpers.toArray(new SnapToHelper[0]));
		}
	}

	return super.getAdapter(key);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:30,代码来源:ERDiagramEditPart.java


示例7: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
public Object getAdapter(Class adapter) {
	if (adapter == SnapToHelper.class) {
		List<SnapToHelper> snapStrategies = new ArrayList<SnapToHelper>();
		Boolean val = (Boolean)getViewer().getProperty(RulerProvider.PROPERTY_RULER_VISIBILITY);
		/*if (val != null && val.booleanValue())*/
			//snapStrategies.add(new SnapToGuides((GraphicalEditPart) this.getParent()));

		val = (Boolean)getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED);
		//if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGeometry(this){
				@Override
				protected List generateSnapPartsList(List exclusions) {
					List children = super.generateSnapPartsList(exclusions);
					children.add(container);//add snapToParent edges behaviour
					return children;
				}
			});

		val = (Boolean)getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));
		
		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);

		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = (SnapToHelper)snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(adapter);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:35,代码来源:ElementEditPart.java


示例8: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
	if (key == SnapToHelper.class) {
		List<SnapToHelper> snapStrategies = new ArrayList<SnapToHelper>();
		Boolean val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER, Boolean.TRUE);
		Boolean stg = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGUIDES, Boolean.TRUE);
		if (val.booleanValue() && stg != null && stg.booleanValue())
			snapStrategies.add(new SnapToGuides(this));
		val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGEOMETRY, Boolean.TRUE);
		if (val.booleanValue()) {

			SnapToGeometryThreshold snapper = new SnapToGeometryThreshold(this);
			snapper.setThreshold(2.0);
			snapStrategies.add(snapper);
		}
		val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGRID, Boolean.TRUE);
		if (val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));

		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);

		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(key);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:33,代码来源:BandEditPart.java


示例9: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
	if (key == SnapToHelper.class) {
		List<SnapToHelper> snapStrategies = new ArrayList<SnapToHelper>();
		Boolean val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER, Boolean.TRUE);
		Boolean stg = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGUIDES, Boolean.TRUE);
		if (val.booleanValue() && stg != null && stg.booleanValue())
			snapStrategies.add(new SnapToGuides(this));
		val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGEOMETRY, Boolean.TRUE);
		if (val.booleanValue()) {
			SnapToGeometryThreshold snapper = new SnapToGeometryThreshold(this);
			snapper.setThreshold(6.0);
			snapStrategies.add(snapper);
		}
		val = jConfig.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGRID, Boolean.TRUE);
		if (val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));

		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);

		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(key);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:32,代码来源:PageEditPart.java


示例10: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@Override
public Object getAdapter(Class adapter)
{
	if (adapter == SnapToHelper.class) {
		List snapStrategies = new ArrayList();
		Boolean val = (Boolean) getViewer()
				.getProperty(RulerProvider.PROPERTY_RULER_VISIBILITY);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGuides(this));
		val = (Boolean) getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGeometry(this));
		val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
		if (val != null && val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));

		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);
		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = (SnapToHelper) snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(adapter);
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:28,代码来源:HorizontalBlockModelPart.java


示例11: getAdapter

import org.eclipse.gef.CompoundSnapToHelper; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
	if (key == SnapToHelper.class) {
		List<SnapToHelper> snapStrategies = new ArrayList<SnapToHelper>();
		Boolean val = jConfig.getPropertyBoolean(
				RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER,
				Boolean.TRUE);
		Boolean stg = jConfig.getPropertyBoolean(
				RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGUIDES,
				Boolean.TRUE);
		if (val.booleanValue() && stg != null && stg.booleanValue())
			snapStrategies.add(new SnapToGuides(this));
		val = jConfig.getPropertyBoolean(
				RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGEOMETRY,
				Boolean.TRUE);
		if (val.booleanValue()) {

			SnapToGeometryThreshold snapper = new SnapToGeometryThreshold(
					this);
			snapper.setThreshold(2.0);
			snapStrategies.add(snapper);
		}
		val = jConfig.getPropertyBoolean(
				RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGRID,
				Boolean.TRUE);
		if (val.booleanValue())
			snapStrategies.add(new SnapToGrid(this));

		if (snapStrategies.size() == 0)
			return null;
		if (snapStrategies.size() == 1)
			return snapStrategies.get(0);

		SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
		for (int i = 0; i < snapStrategies.size(); i++)
			ss[i] = snapStrategies.get(i);
		return new CompoundSnapToHelper(ss);
	}
	return super.getAdapter(key);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:42,代码来源:ListEditPart.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Router类代码示例发布时间:2022-05-22
下一篇:
Java ApiKeyVehicle类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap