Editable mania! I love to delegate.
Augmented standard scene and spot scene models with versions that provide access to data only needed by the editor and loader. Filtered that whole paradigm down through the locations and portals and all that. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@737 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EditableScene.java,v 1.1 2001/11/12 20:56:56 mdb Exp $
|
||||
// $Id: EditableScene.java,v 1.2 2001/12/04 22:34:04 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.tools;
|
||||
|
||||
@@ -40,12 +40,32 @@ public interface EditableScene extends DisplayScene
|
||||
*/
|
||||
public void setNeighborIds (int[] neighborIds);
|
||||
|
||||
/**
|
||||
* Implementations must provide a scene model that represents the
|
||||
* current state of this editable scene in response to a call to this
|
||||
* method. Whether they maintain an up to date scene model all along
|
||||
* or generate one at the time this method is called is up to the
|
||||
* implementation.
|
||||
/**
|
||||
* Returns the human readable name of this scene.
|
||||
*/
|
||||
public SceneModel getSceneModel ();
|
||||
public String getName ();
|
||||
|
||||
/**
|
||||
* Setse the human readable name of this scene.
|
||||
*/
|
||||
public void setName (String name);
|
||||
|
||||
/**
|
||||
* Returns the names of the neighbors of this scene.
|
||||
*/
|
||||
public String[] getNeighborNames ();
|
||||
|
||||
/**
|
||||
* Sets the names of the neighbors of this scene.
|
||||
*/
|
||||
public void setNeighborNames (String[] neighborNames);
|
||||
|
||||
/**
|
||||
* Implementations must provide an editable scene model that
|
||||
* represents the current state of this editable scene in response to
|
||||
* a call to this method. Whether they maintain an up to date scene
|
||||
* model all along or generate one at the time this method is called
|
||||
* is up to the implementation.
|
||||
*/
|
||||
public EditableSceneModel getSceneModel ();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EditableSceneImpl.java,v 1.2 2001/11/13 02:25:36 mdb Exp $
|
||||
// $Id: EditableSceneImpl.java,v 1.3 2001/12/04 22:34:04 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.tools;
|
||||
|
||||
@@ -17,9 +17,9 @@ public class EditableSceneImpl
|
||||
* Creates an instance that will obtain data from the supplied scene
|
||||
* model and update it when changes are made.
|
||||
*/
|
||||
public EditableSceneImpl (SceneModel model)
|
||||
public EditableSceneImpl (EditableSceneModel model)
|
||||
{
|
||||
super(model, null);
|
||||
super(model.sceneModel, null);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -41,8 +41,35 @@ public class EditableSceneImpl
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public SceneModel getSceneModel ()
|
||||
public String getName ()
|
||||
{
|
||||
return _model;
|
||||
return _emodel.sceneName;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void setName (String name)
|
||||
{
|
||||
_emodel.sceneName = name;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public String[] getNeighborNames ()
|
||||
{
|
||||
return _emodel.neighborNames;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void setNeighborNames (String[] neighborNames)
|
||||
{
|
||||
_emodel.neighborNames = neighborNames;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public EditableSceneModel getSceneModel ()
|
||||
{
|
||||
return _emodel;
|
||||
}
|
||||
|
||||
/** A reference to our editable scene model. */
|
||||
protected EditableSceneModel _emodel;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// $Id: EditableSceneModel.java,v 1.1 2001/12/04 22:34:04 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.tools;
|
||||
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
|
||||
/**
|
||||
* The editable scene model contains information above and beyond the
|
||||
* regular scene model that is necessary for editing and loading scenes.
|
||||
*/
|
||||
public class EditableSceneModel
|
||||
{
|
||||
/** The scene model that we extend. */
|
||||
public SceneModel sceneModel;
|
||||
|
||||
/** The human readable name of this scene. */
|
||||
public String sceneName;
|
||||
|
||||
/** The human readable name of this scene's neighbors. */
|
||||
public String[] neighborNames;
|
||||
}
|
||||
Reference in New Issue
Block a user