artofillusion
Class LayoutWindow

java.lang.Object
  extended by BFrame
      extended by artofillusion.LayoutWindow
All Implemented Interfaces:
EditingWindow, PopupMenuManager

public class LayoutWindow
extends BFrame
implements EditingWindow, PopupMenuManager

The LayoutWindow class represents the main window for creating and laying out scenes.


Constructor Summary
LayoutWindow(Scene s)
          Create a new LayoutWindow for editing a Scene.
 
Method Summary
 void addObject(Object3D obj, CoordinateSystem coords, java.lang.String name, UndoRecord undo)
          Add a new object to the scene.
 void addObject(ObjectInfo info, int index, UndoRecord undo)
          Add a new object to the scene.
 void addObject(ObjectInfo info, UndoRecord undo)
          Add a new object to the scene.
 void addToSelection(int which)
          Set an object to be selected.
 void alignObjectsCommand()
           
 void bindToParentCommand()
           
 void clearCommand()
           
 void clearSelection()
          Deselect all objects.
 void clearWaitCursor()
          Remove the wait cursor from everything in this window.
 boolean confirmClose()
          This method is called to close the window.
 void convertToActorCommand()
           
 void convertToTriangleCommand()
           
 void copyCommand()
           
 void createScriptObjectCommand()
           
 void cutCommand()
           
 void duplicateCommand()
           
 void editObjectCommand()
           
 void environmentCommand()
           
 void executeScript(java.io.File f)
          Execute the tool script contained in a file, passing a reference to this window in its "window" variable.
 void frameWithCameraCommand(boolean selectionOnly)
           
 ViewerCanvas[] getAllViews()
          Get all ViewerCanvases contained in this window.
 BMenu getAnimationMenu()
          Get the Animation menu.
 DockingContainer getDockingContainer(BTabbedPane.TabPosition position)
          Get the DockingContainer which holds DockableWidgets on one side of the window.
 BMenu getEditMenu()
          Get the Edit menu.
 BMenu getFileMenu()
          Get the File menu.
 BFrame getFrame()
          Get the Frame corresponding to this window.
 java.awt.Dimension getMinimumSize()
           
 BMenu getObjectMenu()
          Get the Object menu.
 BPopupMenu getPopupMenu()
          Get the popup menu.
 Scene getScene()
          Get the Scene associated with this window.
 BMenu getSceneMenu()
          Get the Scene menu.
 Score getScore()
          Get the Score for this window.
 int[] getSelectedIndices()
          Get a list of the indices of all selected objects.
 java.util.Collection<ObjectInfo> getSelectedObjects()
          Get a collection of all selected objects.
 int[] getSelectionWithChildren()
          Get the indices of all objects which are either selected, or are children of selected objects.
 boolean getSplitView()
          Get whether the window is split into four views.
 ToolPalette getToolPalette()
          Get the ToolPalette for this window.
 BMenu getToolsMenu()
          Get the Tools menu.
 ViewerCanvas getView()
          Get the ViewerCanvas which currently has focus.
 boolean isModified()
          Determine whether the scene has been modified since it was last saved.
 boolean isObjectSelected(int index)
          Determine whether an object is selected.
 boolean isObjectSelected(ObjectInfo info)
          Determine whether an object is selected.
 void jumpToTimeCommand()
           
 void linkExternalCommand()
           
 void objectLayoutCommand()
           
 void pasteCommand()
           
 void preferencesCommand()
           
 void rebuildItemList()
          Rebuild the TreeList of objects, attempting as much as possible to preserve its current state.
 void rebuildScriptsMenu()
          Rebuild the list of tool scripts in the Tools menu.
 void redoCommand()
           
 void removeFromSelection(int which)
          Deselect a single object.
 void removeObject(int which, UndoRecord undo)
          Remove an object from the scene.
 void renameObjectCommand()
           
 void renderCommand()
           
 void saveAsCommand()
           
 void saveCommand()
           
 void selectAllCommand()
           
 void setCurrentView(ViewerCanvas view)
          Set which ViewerCanvas has focus.
 void setGridCommand()
           
 void setHelpText(java.lang.String text)
          Set the help text displayed at the bottom of the window.
 void setModified()
          Set whether the scene has been modified since it was last saved.
 void setObjectListVisible(boolean visible)
          Set whether the object list should be displayed.
 void setObjectName(int which, java.lang.String name)
          Set the name of an object in the scene.
 void setScoreVisible(boolean visible)
          Set whether the score should be displayed.
 void setSelection(int which)
          Set a single object in the scene to be selected.
 void setSelection(int[] which)
          Set the list of objects in the scene which should be selected.
 void setSplitView(boolean split)
          Set whether the window is split into four views.
 void setTemplateCommand()
           
 void setTextureCommand()
           
 void setTime(double time)
          Set the time which is currently being displayed.
 void setTool(EditingTool tool)
          Set the selected EditingTool for this window.
 void setUndoRecord(UndoRecord command)
          Set the UndoRecord which will be executed if the user chooses Undo from the Edit menu.
 void setWaitCursor()
          Set the wait cursor on everything in this window.
 void severCommand()
           
 void showPopupMenu(Widget w, int x, int y)
          Display the popup menu.
 void texturesCommand()
           
 void toggleViewsCommand()
           
 void transformObjectCommand()
           
 void undoCommand()
           
 void updateImage()
          Update the images displayed in all of the viewport.
 void updateMenus()
          Update the state of all menu items.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutWindow

public LayoutWindow(Scene s)
Create a new LayoutWindow for editing a Scene. Usually, you will not use this constructor directly. Instead, call ModellingApp.newWindow(Scene s).

Method Detail

rebuildItemList

public void rebuildItemList()
Rebuild the TreeList of objects, attempting as much as possible to preserve its current state.


rebuildScriptsMenu

public void rebuildScriptsMenu()
Rebuild the list of tool scripts in the Tools menu. This should be called whenever a script has been added to or deleted from the Scripts/Tools directory on disk.


showPopupMenu

public void showPopupMenu(Widget w,
                          int x,
                          int y)
Display the popup menu.

Specified by:
showPopupMenu in interface PopupMenuManager

getFileMenu

public BMenu getFileMenu()
Get the File menu.


getEditMenu

public BMenu getEditMenu()
Get the Edit menu.


getSceneMenu

public BMenu getSceneMenu()
Get the Scene menu.


getObjectMenu

public BMenu getObjectMenu()
Get the Object menu.


getAnimationMenu

public BMenu getAnimationMenu()
Get the Animation menu.


getToolsMenu

public BMenu getToolsMenu()
Get the Tools menu.


getPopupMenu

public BPopupMenu getPopupMenu()
Get the popup menu.


getDockingContainer

public DockingContainer getDockingContainer(BTabbedPane.TabPosition position)
Get the DockingContainer which holds DockableWidgets on one side of the window.


setWaitCursor

public void setWaitCursor()
Set the wait cursor on everything in this window.


clearWaitCursor

public void clearWaitCursor()
Remove the wait cursor from everything in this window.


getMinimumSize

public java.awt.Dimension getMinimumSize()

confirmClose

public boolean confirmClose()
This method is called to close the window. If the Scene has been modified, it first gives the user a chance to save the Scene, or to cancel. If the user cancels it, the method returns false. Otherwise, it closes the window and returns true.

Specified by:
confirmClose in interface EditingWindow

setTool

public void setTool(EditingTool tool)
Set the selected EditingTool for this window.

Specified by:
setTool in interface EditingWindow

setHelpText

public void setHelpText(java.lang.String text)
Set the help text displayed at the bottom of the window.

Specified by:
setHelpText in interface EditingWindow

getFrame

public BFrame getFrame()
Get the Frame corresponding to this window. (Because LayoutWindow is a Frame, it simply returns itself.)

Specified by:
getFrame in interface EditingWindow

updateImage

public void updateImage()
Update the images displayed in all of the viewport.

Specified by:
updateImage in interface EditingWindow

updateMenus

public void updateMenus()
Update the state of all menu items.

Specified by:
updateMenus in interface EditingWindow

setUndoRecord

public void setUndoRecord(UndoRecord command)
Set the UndoRecord which will be executed if the user chooses Undo from the Edit menu.

Specified by:
setUndoRecord in interface EditingWindow

setModified

public void setModified()
Set whether the scene has been modified since it was last saved.

Specified by:
setModified in interface EditingWindow

isModified

public boolean isModified()
Determine whether the scene has been modified since it was last saved.


addObject

public void addObject(Object3D obj,
                      CoordinateSystem coords,
                      java.lang.String name,
                      UndoRecord undo)
Add a new object to the scene. If undo is not null, appropriate commands will be added to it to undo this operation.


addObject

public void addObject(ObjectInfo info,
                      UndoRecord undo)
Add a new object to the scene. If undo is not null, appropriate commands will be added to it to undo this operation.


addObject

public void addObject(ObjectInfo info,
                      int index,
                      UndoRecord undo)
Add a new object to the scene. If undo is not null, appropriate commands will be added to it to undo this operation.


removeObject

public void removeObject(int which,
                         UndoRecord undo)
Remove an object from the scene. If undo is not null, appropriate commands will be added to it to undo this operation.


setObjectName

public void setObjectName(int which,
                          java.lang.String name)
Set the name of an object in the scene.


setTime

public void setTime(double time)
Set the time which is currently being displayed.


getScene

public Scene getScene()
Get the Scene associated with this window.

Specified by:
getScene in interface EditingWindow

getView

public ViewerCanvas getView()
Get the ViewerCanvas which currently has focus.

Specified by:
getView in interface EditingWindow

getAllViews

public ViewerCanvas[] getAllViews()
Get all ViewerCanvases contained in this window.

Specified by:
getAllViews in interface EditingWindow

setCurrentView

public void setCurrentView(ViewerCanvas view)
Set which ViewerCanvas has focus.

Parameters:
view - the ViewerCanvas which should become the currently focused view. If this is not one of the views belonging to this window, this method does nothing.

getScore

public Score getScore()
Get the Score for this window.


getToolPalette

public ToolPalette getToolPalette()
Get the ToolPalette for this window.

Specified by:
getToolPalette in interface EditingWindow

setObjectListVisible

public void setObjectListVisible(boolean visible)
Set whether the object list should be displayed.


setScoreVisible

public void setScoreVisible(boolean visible)
Set whether the score should be displayed.


setSplitView

public void setSplitView(boolean split)
Set whether the window is split into four views.


getSplitView

public boolean getSplitView()
Get whether the window is split into four views.


getSelectedIndices

public int[] getSelectedIndices()
Get a list of the indices of all selected objects.


getSelectedObjects

public java.util.Collection<ObjectInfo> getSelectedObjects()
Get a collection of all selected objects.


isObjectSelected

public boolean isObjectSelected(ObjectInfo info)
Determine whether an object is selected.


isObjectSelected

public boolean isObjectSelected(int index)
Determine whether an object is selected.


getSelectionWithChildren

public int[] getSelectionWithChildren()
Get the indices of all objects which are either selected, or are children of selected objects.


setSelection

public void setSelection(int which)
Set a single object in the scene to be selected.


setSelection

public void setSelection(int[] which)
Set the list of objects in the scene which should be selected.


addToSelection

public void addToSelection(int which)
Set an object to be selected.


clearSelection

public void clearSelection()
Deselect all objects.


removeFromSelection

public void removeFromSelection(int which)
Deselect a single object.


linkExternalCommand

public void linkExternalCommand()

saveCommand

public void saveCommand()

saveAsCommand

public void saveAsCommand()

undoCommand

public void undoCommand()

redoCommand

public void redoCommand()

cutCommand

public void cutCommand()

copyCommand

public void copyCommand()

pasteCommand

public void pasteCommand()

clearCommand

public void clearCommand()

selectAllCommand

public void selectAllCommand()

preferencesCommand

public void preferencesCommand()

duplicateCommand

public void duplicateCommand()

severCommand

public void severCommand()

editObjectCommand

public void editObjectCommand()

objectLayoutCommand

public void objectLayoutCommand()

transformObjectCommand

public void transformObjectCommand()

alignObjectsCommand

public void alignObjectsCommand()

setTextureCommand

public void setTextureCommand()

renameObjectCommand

public void renameObjectCommand()

convertToTriangleCommand

public void convertToTriangleCommand()

convertToActorCommand

public void convertToActorCommand()

createScriptObjectCommand

public void createScriptObjectCommand()

jumpToTimeCommand

public void jumpToTimeCommand()

bindToParentCommand

public void bindToParentCommand()

renderCommand

public void renderCommand()

toggleViewsCommand

public void toggleViewsCommand()

setTemplateCommand

public void setTemplateCommand()

setGridCommand

public void setGridCommand()

frameWithCameraCommand

public void frameWithCameraCommand(boolean selectionOnly)

texturesCommand

public void texturesCommand()

environmentCommand

public void environmentCommand()

executeScript

public void executeScript(java.io.File f)
Execute the tool script contained in a file, passing a reference to this window in its "window" variable.



Copyright © 1999-2011 by Peter Eastman.