Package org.stathissideris.ascii2image.graphics

Examples of org.stathissideris.ascii2image.graphics.CustomShapeDefinition


                    // the dir that contains the config file:
                    currentDir = configFile.getParentFile().getAbsolutePath();
                }
            }
            if (qName.equals(SHAPE_TAG_NAME)) {
                CustomShapeDefinition definition = new CustomShapeDefinition();

                int len = attributes.getLength();
                for (int i = 0; i < len; i++) {
                    String name = attributes.getQName(i);
                    String value = attributes.getValue(i);

                    if (name.equals("tag")) {
                        definition.setTag(value);
                    } else if (name.equals("stretch")) {
                        definition
                                .setStretches(getBooleanFromAttributeValue(value));
                    } else if (name.equals("border")) {
                        definition
                                .setHasBorder(getBooleanFromAttributeValue(value));
                    } else if (name.equals("shadow")) {
                        definition
                                .setDropsShadow(getBooleanFromAttributeValue(value));
                    } else if (name.equals("comment")) {
                        definition.setComment(value);
                    } else if (name.equals("filename")) {
                        File file = new File(value);
                        if (file.isAbsolute()) {
                            definition.setFilename(value);
                        } else { // relative to the location of the config file
                            // or to the group's base dir
                            definition.setFilename(createFilename(currentDir,
                                    value));
                        }
                    }
                }

                if (shapeDefinitions.containsKey(definition.getTag())) {
                    CustomShapeDefinition oldDef = shapeDefinitions
                            .get(definition.getTag());
                    System.err.println("*** Warning: shape \""
                            + oldDef.getTag() + "\" (file: "
                            + oldDef.getFilename()
                            + ") has been redefined as file: "
                            + definition.getFilename());
                }

                File file = new File(definition.getFilename());
View Full Code Here

TOP

Related Classes of org.stathissideris.ascii2image.graphics.CustomShapeDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.