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


Java ZOrder类代码示例

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


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

示例1: createLower

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLower(CanvasModel model, Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectBelow(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to++;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:ModelReorderAction.java

示例2: createLowerBottom

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLowerBottom(CanvasModel model, Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = 0;
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:18,代码来源:ModelReorderAction.java

示例3: createRaise

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaise(CanvasModel model, Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectAbove(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to--;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.DESCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:ModelReorderAction.java

示例4: createRaiseTop

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaiseTop(CanvasModel model, Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = model.getObjectsFromBottom().size() - 1;
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:18,代码来源:ModelReorderAction.java

示例5: ClipboardActions

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
private ClipboardActions(boolean remove, AppearanceCanvas canvas) {
	this.remove = remove;
	this.canvas = canvas;
	this.canvasModel = canvas.getModel();

	ArrayList<CanvasObject> contents = new ArrayList<CanvasObject>();
	Direction anchorFacing = null;
	Location anchorLocation = null;
	ArrayList<CanvasObject> aff = new ArrayList<CanvasObject>();
	for (CanvasObject o : canvas.getSelection().getSelected()) {
		if (o.canRemove()) {
			aff.add(o);
			contents.add(o.clone());
		} else if (o instanceof AppearanceAnchor) {
			AppearanceAnchor anch = (AppearanceAnchor) o;
			anchorFacing = anch.getFacing();
			anchorLocation = anch.getLocation();
		}
	}
	contents.trimToSize();
	affected = ZOrder.getZIndex(aff, canvasModel);
	newClipboard = new ClipboardContents(contents, anchorLocation, anchorFacing);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:ClipboardActions.java

示例6: createLower

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLower(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectBelow(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to++;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:25,代码来源:ModelReorderAction.java

示例7: createLowerBottom

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLowerBottom(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = 0;
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:19,代码来源:ModelReorderAction.java

示例8: createRaise

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaise(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectAbove(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to--;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.DESCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:25,代码来源:ModelReorderAction.java

示例9: createRaiseTop

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaiseTop(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = model.getObjectsFromBottom().size() - 1;
	for (Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:19,代码来源:ModelReorderAction.java

示例10: SelectionAction

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public SelectionAction(AppearanceCanvas canvas, StringGetter displayName,
		Collection<CanvasObject> toRemove, Collection<CanvasObject> toAdd,
		Collection<CanvasObject> newSelection, Location anchorLocation,
		Direction anchorFacing) {
	this.canvas = canvas;
	this.canvasModel = canvas.getModel();
	this.displayName = displayName;
	this.toRemove = toRemove == null ? null : ZOrder.getZIndex(toRemove,
			canvasModel);
	this.toAdd = toAdd;
	this.oldSelection = new ArrayList<CanvasObject>(canvas.getSelection()
			.getSelected());
	this.newSelection = newSelection;
	this.anchorNewLocation = anchorLocation;
	this.anchorNewFacing = anchorFacing;
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:17,代码来源:SelectionAction.java

示例11: ClipboardActions

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
private ClipboardActions(boolean remove, AppearanceCanvas canvas) {
	this.remove = remove;
	this.canvas = canvas;
	this.canvasModel = canvas.getModel();

	ArrayList<CanvasObject> contents = new ArrayList<CanvasObject>();
	Direction anchorFacing = null;
	Location anchorLocation = null;
	ArrayList<CanvasObject> aff = new ArrayList<CanvasObject>();
	for (CanvasObject o : canvas.getSelection().getSelected()) {
		if (o.canRemove()) {
			aff.add(o);
			contents.add(o.clone());
		} else if (o instanceof AppearanceAnchor) {
			AppearanceAnchor anch = (AppearanceAnchor) o;
			anchorFacing = anch.getFacing();
			anchorLocation = anch.getLocation();
		}
	}
	contents.trimToSize();
	affected = ZOrder.getZIndex(aff, canvasModel);
	newClipboard = new ClipboardContents(contents, anchorLocation,
			anchorFacing);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:25,代码来源:ClipboardActions.java

示例12: createRaise

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaise(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for(Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectAbove(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to--;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.DESCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:25,代码来源:ModelReorderAction.java

示例13: createLower

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLower(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	for(Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		CanvasObject above = ZOrder.getObjectBelow(obj, model, objects);
		if (above != null) {
			int to = ZOrder.getZIndex(above, model);
			if (objects.contains(above)) {
				to++;
			}
			reqs.add(new ReorderRequest(obj, from, to));
		}
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:25,代码来源:ModelReorderAction.java

示例14: createRaiseTop

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createRaiseTop(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = model.getObjectsFromBottom().size() - 1;
	for(Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:19,代码来源:ModelReorderAction.java

示例15: createLowerBottom

import com.cburch.draw.util.ZOrder; //导入依赖的package包/类
public static ModelReorderAction createLowerBottom(CanvasModel model,
		Collection<? extends CanvasObject> objects) {
	List<ReorderRequest> reqs = new ArrayList<ReorderRequest>();
	Map<CanvasObject, Integer> zmap = ZOrder.getZIndex(objects, model);
	int to = 0;
	for(Map.Entry<CanvasObject, Integer> entry : zmap.entrySet()) {
		CanvasObject obj = entry.getKey();
		int from = entry.getValue().intValue();
		reqs.add(new ReorderRequest(obj, from, to));
	}
	if (reqs.isEmpty()) {
		return null;
	} else {
		Collections.sort(reqs, ReorderRequest.ASCENDING_FROM);
		repairRequests(reqs);
		return new ModelReorderAction(model, reqs);
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:19,代码来源:ModelReorderAction.java


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