Package com.threerings.stage.data

Examples of com.threerings.stage.data.StageSceneModel


    @Override
    protected void addSceneAttributes (SceneModel scene, AttributesImpl attrs)
    {
        super.addSceneAttributes(scene, attrs);
        StageSceneModel sscene = (StageSceneModel)scene;
        attrs.addAttribute("", "type", "", "", sscene.type);
    }
View Full Code Here


    @Override
    protected void writeSceneData (SceneModel scene, DataWriter writer)
        throws SAXException
    {
        // write out any default colorizations
        StageSceneModel sscene = (StageSceneModel)scene;
        if (sscene.defaultColors != null) {
            writer.startElement("zations");
            for (Map.Entry<Integer, Integer> entry : sscene.defaultColors.entrySet()) {
                AttributesImpl attrs = new AttributesImpl();
                attrs.addAttribute("", "classId", "", "",
View Full Code Here

        // add a rule to parse scene colorizations
        _digester.addRule("scene/zations/zation", new Rule() {
            @Override
            public void begin (String namespace, String name,
                               Attributes attrs) throws Exception {
                StageSceneModel yoscene = (StageSceneModel) digester.peek();
                int classId = Integer.parseInt(attrs.getValue("classId"));
                int colorId = Integer.parseInt(attrs.getValue("colorId"));
                yoscene.setDefaultColor(classId, colorId);
            }
        });

        // add rule sets for our aux scene models
        registerAuxRuleSet(new SpotSceneRuleSet() {
View Full Code Here

    {
        String errmsg = null;

        try {
            StageSceneParser parser = new StageSceneParser();
            StageSceneModel model = (StageSceneModel)parser.parseScene(path);
            if (model == null) {
                errmsg = "No scene found in scene file '" + path + "'.";

            } else {
                SpotSceneModel ssmodel = SpotSceneModel.getSceneModel(model);
View Full Code Here

    }

    protected void newScene ()
    {
        try {
            StageSceneModel model = StageSceneModel.blankStageSceneModel();
            model.type = StageSceneModel.WORLD;
            setScene(new StageScene(model, null));

        } catch (Exception e) {
            log.warning("Unable to set blank scene.", e);
View Full Code Here

     * Loads the scene from the specified path into the editor and returns true if it succeeds.
     */
    protected boolean loadScene (String path)
        throws IOException, SAXException
    {
        StageSceneModel model = (StageSceneModel)_parser.parseScene(path);
        if (model == null) {
            return false;
        }
        setScene(new StageScene(model, null));
        // keep track of the path for later saving
View Full Code Here

TOP

Related Classes of com.threerings.stage.data.StageSceneModel

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.