If the MatrixViewer window has been rendered, then the title of the * MatrixViewer window will be updated to the value of the name parameter.
* @param name A name to present to the user. * @see #getDisplayName() */ @Override public void setDisplayName(String name) { super.setDisplayName(name); // See http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4302 if (_tableau != null) { _tableau.setTitle(name); } } /** Specify the associated frame and set its properties (size, etc.) * to match those stored in the _windowProperties attribute. In this * class, if the frame is null, close the tableau and set it to null. * Once closed, the matrix window will not reopen unless _tableau is * null. * @param frame The associated frame. */ @Override public void setFrame(JFrame frame) { super.setFrame(frame); if (frame == null && _tableau != null) { try { _tableau.setContainer(null); } catch (KernelException ex) { throw new InternalErrorException(ex); } _tableau = null; _effigy = null; } } /** Set or change the name. If a null argument is given the * name is set to an empty string. * Increment the version of the workspace. * This method is write-synchronized on the workspace. *If the MatrixViewer window has been rendered, then the title of the * MatrixViewer window will be updated to the value of the name parameter.
* @param name The new name. * @exception IllegalActionException If the name contains a period * or if the object is a derived object and the name argument does * not match the current name. * @exception NameDuplicationException Not thrown in this base class. * May be thrown by derived classes if the container already contains * an object with this name. * @see #getName() * @see #getName(NamedObj) */ @Override public void setName(String name) throws IllegalActionException, NameDuplicationException { super.setName(name); // See http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4302 if (_tableau != null) { _tableau.setTitle(name); } } /////////////////////////////////////////////////////////////////// //// private methods //// /** Remove the display from the current container, if there is one. */ private void _remove() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (_container != null && _pane != null) { _container.remove(_pane); _container = null; } if (_frame != null) { _frame.dispose(); _frame = null; } } }); } /////////////////////////////////////////////////////////////////// //// private variables //// /** Container with the display, if any. */ private Container _container = null; /** The effigy for the token data. */ private TokenEffigy _effigy; /** Height of the matrix viewer in pixels. */ private int _height; /** Pane with the matrix display. */ private MatrixPane _pane = null; /** The tableau with the display, if any. */ private TokenTableau _tableau; /** Width of the matrix viewer in pixels. */ private int _width; }