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


Java LayerType类代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:ChebyrTech,项目名称:PSD2html,代码行数:29,代码来源:PsdCmd.java

示例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);
}
 
开发者ID:ChebyrTech,项目名称:PSD2html,代码行数:26,代码来源:PsdView.java

示例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;
}
 
开发者ID:glovas,项目名称:psd-ui-generator,代码行数:27,代码来源:NodeReader.java

示例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);
}
 
开发者ID:prithivraj,项目名称:java-psd-library,代码行数:16,代码来源:LayerSectionDividerParser.java

示例5: isLeaf

import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public boolean isLeaf(Object node) {
    return node instanceof AbstractLayer && ((AbstractLayer<?>) node).getType() == LayerType.NORMAL;
}
 
开发者ID:prithivraj,项目名称:java-psd-library,代码行数:5,代码来源:TreeLayerModel.java

示例6: isLeaf

import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override 
public boolean isLeaf(Object node) { 
    return node instanceof Layer && ((Layer) node).getType() == LayerType.NORMAL; 
}
 
开发者ID:ChebyrTech,项目名称:PSD2html,代码行数:5,代码来源:TreeLayerModel.java

示例7: isLeaf

import psd.parser.layer.LayerType; //导入依赖的package包/类
@Override
public boolean isLeaf(Object node) {
    return node instanceof Layer && ((Layer) node).getType() == LayerType.NORMAL;
}
 
开发者ID:ChebyrTech,项目名称:PSD2html,代码行数:5,代码来源:TreeLayerModel.java

示例8: sectionDividerParsed

import psd.parser.layer.LayerType; //导入依赖的package包/类
public void sectionDividerParsed(LayerType type); 
开发者ID:prithivraj,项目名称:java-psd-library,代码行数:2,代码来源:LayerSectionDividerHandler.java


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