本文整理汇总了Java中psd.parser.layer.LayerType类的典型用法代码示例。如果您正苦于以下问题:Java LayerType类的具体用法?Java LayerType怎么用?Java LayerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayerType类属于psd.parser.layer包,在下文中一共展示了LayerType类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTreeModel
import psd.parser.layer.LayerType; //导入依赖的package包/类
/**
* createTreeModel
* Run the layers to create the images.
* @param layers
* @param prefix
*/
public static void createTreeModel(List<Layer> layers, String prefix) {
//
// Run all sub-layers
//
for (Layer l : layers) {
if (!l.isVisible())
continue;
if (l.getType() == LayerType.HIDDEN)
continue;
if (l.getType() == LayerType.FOLDER) {
if (l.getLayersCount() > 0) {
List<Layer> ls = getLayers(l);
createTreeModel(ls, prefix);
}
exportLayer(l, prefix);
} else {
exportLayer(l, prefix);
}
}
}
示例2: createTreeModel
import psd.parser.layer.LayerType; //导入依赖的package包/类
private TreeModel createTreeModel(List<Layer> layers) {
NamedVector<Object> currLevel = new NamedVector<Object>();
Queue<NamedVector<Object>> levelQueue = new LinkedList<NamedVector<Object>>();
for (Layer l : layers) {
if (l.getType() == LayerType.HIDDEN) {
levelQueue.add(currLevel);
currLevel = new NamedVector<Object>();
}
else if (l.getType() == LayerType.FOLDER) {
currLevel.setName(l.toString());
Vector<Object> prevLevel = currLevel;
if (l.getLayersCount() > 0) {
List<Layer> ls = getLayers(l);
createTreeModel(ls);
}
currLevel.add(0, prevLevel);
}
else {
currLevel.add(0, new NamedPsdLayer(l));
}
}
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
DynamicUtilTreeNode.createChildren(root, currLevel);
return new DefaultTreeModel(root);
}
示例3: read
import psd.parser.layer.LayerType; //导入依赖的package包/类
/**
* Recursively walks the layer structure
* @param container
* @param group
*/
public View read(LayersContainer container, View group) {
View child = visitor.visit(container, group);
if (child != null) {
for (int i = 0; i < container.getLayersCount(); i++) {
Layer layer = container.getLayer(i);
if (!layer.isVisible()) {
continue;
}
if (layer.getType().equals(LayerType.FOLDER)) {
read(layer, child);
}
else{
visitor.visit(layer, child);
}
}
}
return child;
}
示例4: parse
import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public void parse(PsdInputStream stream, String tag, int size) throws IOException {
int dividerType = stream.readInt();
LayerType type = LayerType.NORMAL;
switch (dividerType) {
case 1:
case 2:
type = LayerType.FOLDER;
break;
case 3:
type = LayerType.HIDDEN;
break;
}
handler.sectionDividerParsed(type);
}
示例5: isLeaf
import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public boolean isLeaf(Object node) {
return node instanceof AbstractLayer && ((AbstractLayer<?>) node).getType() == LayerType.NORMAL;
}
示例6: isLeaf
import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public boolean isLeaf(Object node) {
return node instanceof Layer && ((Layer) node).getType() == LayerType.NORMAL;
}
示例7: isLeaf
import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public boolean isLeaf(Object node) {
return node instanceof Layer && ((Layer) node).getType() == LayerType.NORMAL;
}
示例8: sectionDividerParsed
import psd.parser.layer.LayerType; //导入依赖的package包/类
public void sectionDividerParsed(LayerType type);