artofillusion.animation
Class Score

java.lang.Object
  extended by BorderContainer
      extended by artofillusion.animation.Score
All Implemented Interfaces:
EditingWindow, PopupMenuManager

public class Score
extends BorderContainer
implements EditingWindow, PopupMenuManager

This is a Widget which displays all the tracks for objects in a scene, and shows where their keyframes are.


Field Summary
static int MULTI_GRAPH_MODE
           
static int SCROLL_AND_SCALE
           
static int SELECT_AND_MOVE
           
static int SINGLE_GRAPH_MODE
           
static int TRACKS_MODE
           
 
Constructor Summary
Score(LayoutWindow win)
           
 
Method Summary
 void addSelectedKeyframes(SelectionInfo[] newsel)
          Add a set of keyframes to the selection.
 void addTrack(java.lang.Object[] obj, java.lang.Class trackClass, java.lang.Object[] extraArgs, boolean deselectOthers)
          Add a track to the specified objects.
 boolean confirmClose()
          EditingWindow methods.
 void deleteSelectedKeyframes()
          Delete all selected keyframes.
 void deleteSelectedTracks()
          Delete the selected tracks.
 void duplicateSelectedTracks()
          Duplicate the selected tracks.
 void editSelectedKeyframe()
          Edit the selected keyframe.
 void editSelectedTrack()
          Allow the user to edit the currently selected track.
 void finishEditingTrack(Track tr)
          This method should be called when a track is done being edited.
 ViewerCanvas[] getAllViews()
          Get all ViewerCanvases contained in this window.
 boolean getAnimating()
          Get whether the display is currently being animated.
 BFrame getFrame()
          Get the BFrame for this EditingWindow: either the EditingWindow itself if it is a BFrame, or its parent if it is a BDialog.
 java.awt.Dimension getMinimumSize()
          Allow the score to be fully hidden.
 double getPlaybackSpeed()
          Get the playback speed.
 BPopupMenu getPopupMenu()
          Get the popup menu for the score.
 double getScale()
          Get the number of pixels per unit time.
 Scene getScene()
          Get the Scene which is being edited in this window.
 SelectionInfo[] getSelectedKeyframes()
          Get the currently selected keyframes.
 Track[] getSelectedTracks()
          Get the currently selected tracks.
 double getStartTime()
          Get the starting time to display.
 ToolPalette getToolPalette()
          Get the ToolPalette for this window.
 ViewerCanvas getView()
          Get the ViewerCanvas in which editing is taking place.
 boolean isKeyframeSelected(Keyframe k)
          Determine whether a particular keyframe is selected.
 boolean isKeyframeSelected(Keyframe k, int value)
          Determine whether the handle for a particular value of a keyframe is selected.
 void keyframeModifiedTracks()
          Add a keyframe to the tracks of selected objects which have been modified.
 void keyframeSelectedTracks()
          Add a keyframe to each selected track, based on the current state of the scene.
 void layoutChildren()
          Make sure the scrollbar gets adjusted when the score is resized.
 void markerMoved(Marker m, boolean intermediate)
          This is called when a time marker has been moved.
 void rebuildList()
          Rebuild the TreeList, attempting as much as possible to preserve its current state.
 void removeSelectedKeyframe(Keyframe key)
          Remove a keyframe from the selection.
 void repaintAll()
          Repaint all of the child Widgets.
 void repaintGraphs()
          Repaint all of the graphs.
 void selectAllTracks()
          Select all tracks of selected objects.
 void setHelpText(java.lang.String text)
          Set the text to display at the bottom of the window.
 void setModified()
          Register that the scene or object contained in the window has been modified.
 void setPlaybackSeed(double speed)
          Set the playback speed.
 void setScale(double s)
          Set the number of pixels per unit time.
 void setScrollPosition(int pos)
          Scroll the list and the tracks together.
 void setSelectedKeyframes(SelectionInfo[] sel)
          Set the currently selected keyframes.
 void setStartTime(double time)
          Set the starting time to display.
 void setTime(double time)
          Set the current time.
 void setTool(EditingTool tool)
          Set the currently selected EditingTool.
 void setTracksEnabled(boolean enable)
          Enable or disable all selected tracks.
 void setUndoRecord(UndoRecord command)
          Set the current UndoRecord for this EditingWindow.
 void showPopupMenu(Widget w, int x, int y)
          Display the popup menu.
 void startAnimating()
          Start animating the display.
 void stopAnimating()
          Stop animating the display.
 void tracksModified(boolean updateScene)
          This is called whenever a track is modified.
 void updateImage()
          Update the image displayed in this window.
 void updateMenus()
          Update which menus are enabled.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACKS_MODE

public static final int TRACKS_MODE
See Also:
Constant Field Values

SINGLE_GRAPH_MODE

public static final int SINGLE_GRAPH_MODE
See Also:
Constant Field Values

MULTI_GRAPH_MODE

public static final int MULTI_GRAPH_MODE
See Also:
Constant Field Values

SELECT_AND_MOVE

public static final int SELECT_AND_MOVE
See Also:
Constant Field Values

SCROLL_AND_SCALE

public static final int SCROLL_AND_SCALE
See Also:
Constant Field Values
Constructor Detail

Score

public Score(LayoutWindow win)
Method Detail

showPopupMenu

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

Specified by:
showPopupMenu in interface PopupMenuManager

getPopupMenu

public BPopupMenu getPopupMenu()
Get the popup menu for the score.


getMinimumSize

public java.awt.Dimension getMinimumSize()
Allow the score to be fully hidden.


getSelectedTracks

public Track[] getSelectedTracks()
Get the currently selected tracks.


getSelectedKeyframes

public SelectionInfo[] getSelectedKeyframes()
Get the currently selected keyframes.


setSelectedKeyframes

public void setSelectedKeyframes(SelectionInfo[] sel)
Set the currently selected keyframes.


addSelectedKeyframes

public void addSelectedKeyframes(SelectionInfo[] newsel)
Add a set of keyframes to the selection.


removeSelectedKeyframe

public void removeSelectedKeyframe(Keyframe key)
Remove a keyframe from the selection.


isKeyframeSelected

public boolean isKeyframeSelected(Keyframe k)
Determine whether a particular keyframe is selected.


isKeyframeSelected

public boolean isKeyframeSelected(Keyframe k,
                                  int value)
Determine whether the handle for a particular value of a keyframe is selected.


rebuildList

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


getStartTime

public double getStartTime()
Get the starting time to display.


setStartTime

public void setStartTime(double time)
Set the starting time to display.


getScale

public double getScale()
Get the number of pixels per unit time.


setScale

public void setScale(double s)
Set the number of pixels per unit time.


setTime

public void setTime(double time)
Set the current time.


startAnimating

public void startAnimating()
Start animating the display.


stopAnimating

public void stopAnimating()
Stop animating the display.


getAnimating

public boolean getAnimating()
Get whether the display is currently being animated.


getPlaybackSpeed

public double getPlaybackSpeed()
Get the playback speed.


setPlaybackSeed

public void setPlaybackSeed(double speed)
Set the playback speed.


tracksModified

public void tracksModified(boolean updateScene)
This is called whenever a track is modified. It causes all graphs to be properly updated and, optionally, updates the Scene to reflect any changes to selected keyframes.


repaintGraphs

public void repaintGraphs()
Repaint all of the graphs.


repaintAll

public void repaintAll()
Repaint all of the child Widgets.


setScrollPosition

public void setScrollPosition(int pos)
Scroll the list and the tracks together.


markerMoved

public void markerMoved(Marker m,
                        boolean intermediate)
This is called when a time marker has been moved. If this is an intermediate position in the middle of a drag, then intermediate will be true.


layoutChildren

public void layoutChildren()
Make sure the scrollbar gets adjusted when the score is resized.


editSelectedTrack

public void editSelectedTrack()
Allow the user to edit the currently selected track.


finishEditingTrack

public void finishEditingTrack(Track tr)
This method should be called when a track is done being edited.


setTracksEnabled

public void setTracksEnabled(boolean enable)
Enable or disable all selected tracks.


keyframeSelectedTracks

public void keyframeSelectedTracks()
Add a keyframe to each selected track, based on the current state of the scene.


keyframeModifiedTracks

public void keyframeModifiedTracks()
Add a keyframe to the tracks of selected objects which have been modified.


duplicateSelectedTracks

public void duplicateSelectedTracks()
Duplicate the selected tracks.


deleteSelectedTracks

public void deleteSelectedTracks()
Delete the selected tracks.


selectAllTracks

public void selectAllTracks()
Select all tracks of selected objects.


addTrack

public void addTrack(java.lang.Object[] obj,
                     java.lang.Class trackClass,
                     java.lang.Object[] extraArgs,
                     boolean deselectOthers)
Add a track to the specified objects.


editSelectedKeyframe

public void editSelectedKeyframe()
Edit the selected keyframe.


deleteSelectedKeyframes

public void deleteSelectedKeyframes()
Delete all selected keyframes.


confirmClose

public boolean confirmClose()
EditingWindow methods. Most of these either do nothing, or simply call through to the corresponding methods of the LayoutWindow the Score is in.

Specified by:
confirmClose in interface EditingWindow

getToolPalette

public ToolPalette getToolPalette()
Description copied from interface: EditingWindow
Get the ToolPalette for this window.

Specified by:
getToolPalette in interface EditingWindow

setTool

public void setTool(EditingTool tool)
Description copied from interface: EditingWindow
Set the currently selected EditingTool.

Specified by:
setTool in interface EditingWindow

setHelpText

public void setHelpText(java.lang.String text)
Description copied from interface: EditingWindow
Set the text to display at the bottom of the window.

Specified by:
setHelpText in interface EditingWindow

getFrame

public BFrame getFrame()
Description copied from interface: EditingWindow
Get the BFrame for this EditingWindow: either the EditingWindow itself if it is a BFrame, or its parent if it is a BDialog.

Specified by:
getFrame in interface EditingWindow

updateImage

public void updateImage()
Description copied from interface: EditingWindow
Update the image displayed in this window.

Specified by:
updateImage in interface EditingWindow

updateMenus

public void updateMenus()
Description copied from interface: EditingWindow
Update which menus are enabled.

Specified by:
updateMenus in interface EditingWindow

setUndoRecord

public void setUndoRecord(UndoRecord command)
Description copied from interface: EditingWindow
Set the current UndoRecord for this EditingWindow.

Specified by:
setUndoRecord in interface EditingWindow

setModified

public void setModified()
Description copied from interface: EditingWindow
Register that the scene or object contained in the window has been modified.

Specified by:
setModified in interface EditingWindow

getScene

public Scene getScene()
Description copied from interface: EditingWindow
Get the Scene which is being edited in this window. If it is not a window for editing a scene, this should return null.

Specified by:
getScene in interface EditingWindow

getView

public ViewerCanvas getView()
Description copied from interface: EditingWindow
Get the ViewerCanvas in which editing is taking place. This may return null if there is no ViewerCanvas.

Specified by:
getView in interface EditingWindow

getAllViews

public ViewerCanvas[] getAllViews()
Description copied from interface: EditingWindow
Get all ViewerCanvases contained in this window. This may return null if there is no ViewerCanvas.

Specified by:
getAllViews in interface EditingWindow


Copyright © 1999-2011 by Peter Eastman.