本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}