org.rubato.composer
Class JComposer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.rubato.composer.JComposer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.Observer, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class JComposer
extends javax.swing.JFrame
implements java.util.Observer

The main window of Rubato Composer.

Author:
Gérard Milmeister
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int STATUS_ERROR
           
static int STATUS_INFO
           
static int STATUS_WARNING
           
static java.awt.Color[] statusColor
           
 
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JComposer()
           
 
Method Summary
 void addJMacroRubetteView(NetworkModel networkModel, JNetwork jnetwork)
          Creates a new MacroRubette view based on the specified model.
 void addJRubette()
          Adds the Rubette selected in the Rubette list to the visible JNetwork.
 void addJRubette(JNetwork jnetwork, JRubette jrubette)
          Adds the Rubette selected in the list to the visible JNetwork.
 void addJRubette(JNetwork jnetwork, Rubette rubette)
          Creates a new Rubette from rubette in jnetwork.
 void addProgressMessage(java.lang.String msg)
           
 void addRubettePrototype(Rubette rubette)
          Adds the specified AbstractRubette to the JRubetteList.
 void addRubettePrototypes(java.util.List<Rubette> rubettes)
          Adds the list of AbstractRubettes to the JRubetteList.
 void clearStatus()
          Clears the status bar.
 void finishRun()
          Finish the current running.
 java.io.File getCurrentDirectory()
          Returns the current directory.
 JRubetteList getJRubetteList()
          Returns the list showing all Rubettes.
 java.awt.Dimension getPreferredSize()
           
 RubetteManager getRubetteManager()
          Returns the current Rubette manager.
 boolean isRunning()
          Returns true iff there is a network currently running.
 boolean loseProject()
          Shows dialog asking the user if he wants to save current project.
 void makeProgress(int value)
           
 void newJNetwork()
          Creates a new JNetwork.
 void open(java.io.File file)
          Opens a project file replacing the current project.
 void quit()
          Leaves Rubato Composer.
 void refreshNetworks()
          Update all JNetworks.
 void removeJNetwork()
          Removes the visible JNetwork.
 void removeJNetwork(JNetwork jnetwork)
          Removes the specified JNetwork.
 void removeJNetworkForModel(NetworkModel networkModel)
          Removes the JNetwork that has the specified NetworkModel.
 void removeProblemsFor(JRubette jrubette)
          Removes all problems for the given JRubette from the problem list.
 void removeRubettePrototype(Rubette rubette)
          Removes the specified AbstractRubette from the JRubetteList.
 void renameJNetwork(JNetwork jnetwork, java.lang.String name)
          Gives the specified JNetwork visible a new name.
 void resetProgressWindow(int max)
           
 void setChanged(boolean b)
           
 void setCurrentDirectory(java.io.File file)
          Sets the current directory to file.
 void setRubetteManager(RubetteManager manager)
          Sets the current Rubette manager.
 void setStatus(java.lang.String msg, int type)
          Sets the status bar to msg.
 void setStatusError(java.lang.String msg, java.lang.Object... objects)
          Displays an error message in the status bar.
 void setStatusInfo(java.lang.String msg, java.lang.Object... objects)
          Displays an information message in the status bar.
 void setStatusWarning(java.lang.String msg, java.lang.Object... objects)
          Displays a warning message in the status bar.
 void showDenotatorBuilder()
           
 void showErrorDialog(java.lang.String msg, java.lang.Object... objects)
          Shows an error dialog with the specified message.
 void showFormBuilder()
           
 void showModuleBuilder()
           
 void showModuleMorphismBuilder()
           
 void showObjectBrowser()
           
 void showProgressWindow(boolean show)
           
 void showSchemeDialog()
           
 void showSchemeEditor()
           
 void startPartialRun(java.util.ArrayList<RubetteModel> runList)
          Runs the rubettes in runList in the given order.
 void startRun()
          Starts running of the currently visible JNetwork.
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

STATUS_INFO

public static final int STATUS_INFO
See Also:
Constant Field Values

STATUS_WARNING

public static final int STATUS_WARNING
See Also:
Constant Field Values

STATUS_ERROR

public static final int STATUS_ERROR
See Also:
Constant Field Values

statusColor

public static final java.awt.Color[] statusColor
Constructor Detail

JComposer

public JComposer()
Method Detail

setRubetteManager

public void setRubetteManager(RubetteManager manager)
Sets the current Rubette manager.


getRubetteManager

public RubetteManager getRubetteManager()
Returns the current Rubette manager.


addRubettePrototypes

public void addRubettePrototypes(java.util.List<Rubette> rubettes)
Adds the list of AbstractRubettes to the JRubetteList.


addRubettePrototype

public void addRubettePrototype(Rubette rubette)
Adds the specified AbstractRubette to the JRubetteList.


removeRubettePrototype

public void removeRubettePrototype(Rubette rubette)
Removes the specified AbstractRubette from the JRubetteList.


getJRubetteList

public JRubetteList getJRubetteList()
Returns the list showing all Rubettes.


showErrorDialog

public void showErrorDialog(java.lang.String msg,
                            java.lang.Object... objects)
Shows an error dialog with the specified message. Also displays the message in the status bar.


setStatusError

public void setStatusError(java.lang.String msg,
                           java.lang.Object... objects)
Displays an error message in the status bar.


setStatusWarning

public void setStatusWarning(java.lang.String msg,
                             java.lang.Object... objects)
Displays a warning message in the status bar.


setStatusInfo

public void setStatusInfo(java.lang.String msg,
                          java.lang.Object... objects)
Displays an information message in the status bar.


setStatus

public void setStatus(java.lang.String msg,
                      int type)
Sets the status bar to msg.

Parameters:
msg - the message to show in the status bar
type - the kind of message, STATUS_INFO, STATUS_ERROR or STATUS_WARNING

clearStatus

public void clearStatus()
Clears the status bar.


loseProject

public boolean loseProject()
Shows dialog asking the user if he wants to save current project. Saves the project according to answer.

Returns:
true iff the current project can be discarded

open

public void open(java.io.File file)
Opens a project file replacing the current project. Prompts the user to save if the current project has changed.


quit

public void quit()
Leaves Rubato Composer.


getCurrentDirectory

public java.io.File getCurrentDirectory()
Returns the current directory.


setCurrentDirectory

public void setCurrentDirectory(java.io.File file)
Sets the current directory to file. Additionally the user preference for current directory is set.


addJRubette

public void addJRubette()
Adds the Rubette selected in the Rubette list to the visible JNetwork.


addJRubette

public void addJRubette(JNetwork jnetwork,
                        Rubette rubette)
Creates a new Rubette from rubette in jnetwork.


addJRubette

public void addJRubette(JNetwork jnetwork,
                        JRubette jrubette)
Adds the Rubette selected in the list to the visible JNetwork.


newJNetwork

public void newJNetwork()
Creates a new JNetwork.


addJMacroRubetteView

public void addJMacroRubetteView(NetworkModel networkModel,
                                 JNetwork jnetwork)
Creates a new MacroRubette view based on the specified model.

Parameters:
networkModel - the model to base the view on
jnetwork - the JNetwork that the MacroRubette resides in

removeJNetwork

public void removeJNetwork()
Removes the visible JNetwork.


removeJNetwork

public void removeJNetwork(JNetwork jnetwork)
Removes the specified JNetwork.


removeJNetworkForModel

public void removeJNetworkForModel(NetworkModel networkModel)
Removes the JNetwork that has the specified NetworkModel.


renameJNetwork

public void renameJNetwork(JNetwork jnetwork,
                           java.lang.String name)
Gives the specified JNetwork visible a new name.


refreshNetworks

public void refreshNetworks()
Update all JNetworks. Essentially updates their titles.


finishRun

public void finishRun()
Finish the current running. Problems are added to the problem list and buttons are reenabled.


startRun

public void startRun()
Starts running of the currently visible JNetwork. Dependencies are computed, the problem list is cleared and buttons, except the stop button, are disabled. A new Runner process is created.


startPartialRun

public void startPartialRun(java.util.ArrayList<RubetteModel> runList)
Runs the rubettes in runList in the given order.


isRunning

public boolean isRunning()
Returns true iff there is a network currently running.


removeProblemsFor

public void removeProblemsFor(JRubette jrubette)
Removes all problems for the given JRubette from the problem list.


showModuleBuilder

public void showModuleBuilder()

showModuleMorphismBuilder

public void showModuleMorphismBuilder()

showDenotatorBuilder

public void showDenotatorBuilder()

showFormBuilder

public void showFormBuilder()

showObjectBrowser

public void showObjectBrowser()

showSchemeDialog

public void showSchemeDialog()

showSchemeEditor

public void showSchemeEditor()

showProgressWindow

public void showProgressWindow(boolean show)

resetProgressWindow

public void resetProgressWindow(int max)

makeProgress

public void makeProgress(int value)

addProgressMessage

public void addProgressMessage(java.lang.String msg)

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

setChanged

public void setChanged(boolean b)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Container