Class AbstractStrangeEonsEditor

  • All Implemented Interfaces:
    Commandable, StrangeEonsEditor, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    Direct Known Subclasses:
    AbstractGameComponentEditor, AbstractSupportEditor

    public abstract class AbstractStrangeEonsEditor
    extends javax.swing.JInternalFrame
    implements StrangeEonsEditor
    The abstract base class from which all editors that can appear in the document tab strip are derived.
    Since:
    3.0
    Author:
    Chris Jennings
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JInternalFrame

        javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static javax.swing.Icon DEFAULT_EDITOR_ICON
      The default icon used by new editors.
      • Fields inherited from class javax.swing.JInternalFrame

        closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEditorListener​(StrangeEonsEditor.EditorListener eal)
      Adds a new StrangeEonsEditor.EditorListener to this editor.
      void addHeartbeatListener​(StrangeEonsEditor.HeartbeatListener hl)
      Adds a new HeartbeatListener to this editor.
      boolean canPerformCommand​(AbstractCommand command)
      Returns true if the commandable wishes to handle the given command.
      void clear()
      Clears the contents of this component to a blank state, if the user gives permission.
      protected void clearImpl()
      Subclasses should override this to clear the edited document if CLEAR is a supported command.
      boolean close()
      Closes the editor window.
      protected boolean confirmLossOfUnsavedChanges()
      If hasUnsavedChanges() returns true, this will display a dialog box asking the user to confirm whether it is acceptable to lose unsaved changes.
      protected void createTimer()
      Creates a heartbeat timer that ticks at the default rate.
      protected void createTimer​(int updatePeriod)
      Creates a heartbeat timer at the specified rate, in milliseconds.
      void dispose()
      Releases resources when the editor will no longer be used.
      void doDefaultCloseAction()  
      void export()
      Exports the editor content as a different file format.
      protected boolean fireHeartbeatEvent()
      This method is called by onHeartbeat() to notify heartbeat listeners.
      javax.swing.border.Border getBorder()  
      java.io.File getFile()
      Returns the file used to save this component, or null if it is a new, unsaved file or the editor is not associated with any particular file.
      javax.swing.Icon getFrameIcon()
      Returns the editor window icon.
      GameComponent getGameComponent()
      Returns the edited game component, or null if this editor is not editing a game component.
      javax.swing.JPopupMenu getTabStripPopupMenu()
      Returns a popup menu for this editor when the editor's tab is right clicked in the document tab strip.
      java.lang.String getTitle()
      Returns the title used to describe this editor.
      java.lang.String getToolTipText()
      Returns the tool tip text displayed for the editor's tab.
      boolean hasUnsavedChanges()
      Returns true if this document has unsaved changes.
      boolean isAttached()
      Returns true if this editor is currently attached to the document tab strip.
      boolean isCommandApplicable​(AbstractCommand command)
      Returns true if the command can be performed by this commandable in its current state.
      protected void onHeartbeat()
      This method is called to allow the editor to perform heartbeat processing.
      void performCommand​(AbstractCommand command)
      Performs the command.
      void print()
      Open the print dialog for this editor, allowing the user to print the edited component.
      protected void printImpl​(java.awt.print.PrinterJob job)
      Subclasses should override this to print the edited document if PRINT is a supported command.
      protected void removeAllStrangeEonsListeners()
      Removes all listeners for events specific to Strange Eons.
      void removeEditorListener​(StrangeEonsEditor.EditorListener eal)
      Removes a new StrangeEonsEditor.EditorListener from this editor.
      void removeHeartbeatListener​(StrangeEonsEditor.HeartbeatListener hl)
      Removes a HeartbeatListener from this editor.
      void resumeTimedUpdates()
      Resumes stopped preview updates.
      void save()
      Saves this editor's content to its current save location.
      void saveAs()
      Saves this editor's content to a file selected by the user.
      protected void saveImpl​(java.io.File f)
      Saves the editor content to the specified file.
      void select()
      Selects this editor, making it the active editor.
      void setAttached​(boolean attach)
      Sets whether this editor is attached to the document tab strip.
      void setFile​(java.io.File newFile)
      Sets the preferred file to use when saving the edited component.
      void setFrameIcon​(javax.swing.Icon icon)
      Sets the preferred icon to use for this editor window.
      void setTitle​(java.lang.String title)
      Sets the title of this document.
      void setToolTipText​(java.lang.String toolTipText)
      Sets the title of this document.
      void setUnsavedChanges​(boolean isDirty)
      Marks whether the document has unsaved changes.
      StrangeEonsEditor spinOff()
      Creates a duplicate of this editor.
      protected StrangeEonsEditor spinOffImpl()
      Subclasses should override this to clone the edited document if SPIN_OFF is a supported command.
      void stopTimedUpdates()
      Stops updating the preview pane when the game component is modified.
      java.lang.String toString()
      Returns a string describing the editor, including the class name, size, edited file, and game component (if any).
      • Methods inherited from class javax.swing.JInternalFrame

        addImpl, addInternalFrameListener, createRootPane, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setUI, show, toBack, toFront, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_EDITOR_ICON

        public static final javax.swing.Icon DEFAULT_EDITOR_ICON
        The default icon used by new editors.
    • Constructor Detail

      • AbstractStrangeEonsEditor

        public AbstractStrangeEonsEditor()
        Creates a new abstract editor.
    • Method Detail

      • close

        public boolean close()
        Description copied from interface: StrangeEonsEditor
        Closes the editor window. If there are unsaved changes, the user will be prompted first and may cancel the close attempt.
        Specified by:
        close in interface StrangeEonsEditor
        Returns:
        returns true if the editor was actually closed, or false if the user cancelled the attempt or closing was otherwise prevented
      • doDefaultCloseAction

        public void doDefaultCloseAction()
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the title of this document. As it shown in the document's tab, the title text should be kept short. The title value may be null, which is equivalent to an empty title.
        Specified by:
        setTitle in interface StrangeEonsEditor
        Parameters:
        title - the text of the title to display
      • getTitle

        public java.lang.String getTitle()
        Returns the title used to describe this editor. The returned value is never null; if a null title is set with setTitle(java.lang.String) then this method returns an empty string.

        If no title has been explicitly set, then a default title will be returned. The default title will be the game component name for game component editors, and otherwise the file name. If there is no name or file available, then a dummy title consisting of a single space is returned.

        Specified by:
        getTitle in interface StrangeEonsEditor
        Returns:
        the current title, which is guaranteed not to be null
      • setToolTipText

        public void setToolTipText​(java.lang.String toolTipText)
        Sets the title of this document. As it shown in the document's tab, the title text should be kept short. The title value may be null, which is equivalent to an empty title.
        Specified by:
        setToolTipText in interface StrangeEonsEditor
        Parameters:
        toolTipText - the text of the title to display
      • getToolTipText

        public java.lang.String getToolTipText()
        Returns the tool tip text displayed for the editor's tab. If no tool tip has been explicitly set, a default tool tip will be returned. The default tool tip will get the name of the file, if getFile() returns a non-null value, or else the localized interface text with key ae-unsaved ("Untitled").
        Specified by:
        getToolTipText in interface StrangeEonsEditor
        Returns:
        the tool tip text to display, or null to clear the tool tip
      • getTabStripPopupMenu

        public javax.swing.JPopupMenu getTabStripPopupMenu()
        Description copied from interface: StrangeEonsEditor
        Returns a popup menu for this editor when the editor's tab is right clicked in the document tab strip. Because a new menu instance is created each time it is called, subclasses may call a super implementation to obtain a default menu and then modify it.
        Specified by:
        getTabStripPopupMenu in interface StrangeEonsEditor
        Returns:
        the popup menu that will be displayed when the user right clicks on the document's tab
      • getGameComponent

        public GameComponent getGameComponent()
        Returns the edited game component, or null if this editor is not editing a game component.

        The AbstractStrangeEonsEditor implementation always returns null.

        Specified by:
        getGameComponent in interface StrangeEonsEditor
        Returns:
        the game component currently being edited by this editor, or null
      • canPerformCommand

        public boolean canPerformCommand​(AbstractCommand command)
        Returns true if the commandable wishes to handle the given command. This method defines the set of commands that the commandable responds to. The commandable might not be able to act on the command at the current moment. For example, a commandable that responds to "Cut" could return true from handlesCommand, but false from Commandable.isCommandApplicable(ca.cgjennings.apps.arkham.commands.AbstractCommand) if there is currently no selection to cut.

        The base class will return false for all commands.

        Specified by:
        canPerformCommand in interface Commandable
        Specified by:
        canPerformCommand in interface StrangeEonsEditor
        Parameters:
        command - the command to be performed
        Returns:
        true if this commandable wishes to handle the command (even if it cannot execute the command currently)
      • confirmLossOfUnsavedChanges

        protected boolean confirmLossOfUnsavedChanges()
        If hasUnsavedChanges() returns true, this will display a dialog box asking the user to confirm whether it is acceptable to lose unsaved changes. The method returns true if the user wants to continue (and lose the unsaved changes), otherwise false. If hasUnsavedChanges() returns false, then this method will return true without showing a dialog.

        Note: If the application is running in bundle test mode, then the method will return true without showing a dialog box. (This makes testing faster since the tester can experiment with the tested plug-in without having to click on confirm buttons when the test finishes and the test application instance is closed.)

        Returns:
        true if the operation can proceed
        See Also:
        CommandLineArguments.plugintest
      • hasUnsavedChanges

        public boolean hasUnsavedChanges()
        Returns true if this document has unsaved changes. calling {@link #setUnsavedChanges}( true ).
        Specified by:
        hasUnsavedChanges in interface StrangeEonsEditor
        Returns:
        true if changes would be lost if the document was closed without saving
        See Also:
        setUnsavedChanges(boolean)
      • setUnsavedChanges

        public void setUnsavedChanges​(boolean isDirty)
        Marks whether the document has unsaved changes. The application uses this to determine whether it is safe to close an editor without saving and to update the document's visual state. This flag is cleared whenever the file is saved successfully.
        Parameters:
        isDirty - if true, tells the application that this editor has unsaved changes
      • saveImpl

        protected void saveImpl​(java.io.File f)
                         throws java.io.IOException
        Saves the editor content to the specified file. This method is called by {link #save} in response to save requests. Subclasses must override it to write an appropriate file for the document if the editor supports saving.
        Parameters:
        f - the file to write content to
        Throws:
        java.io.IOException - if the save fails
      • clearImpl

        protected void clearImpl()
        Subclasses should override this to clear the edited document if CLEAR is a supported command.
      • export

        public void export()
        Exports the editor content as a different file format. The procedure for exporting and the exact format(s) available will vary with the editor.

        The base class does not support exports, and will throw an exception if this method is called. Subclasses that support the EXPORT command must override this method to implement appropriate behaviour.

        Specified by:
        export in interface StrangeEonsEditor
        Throws:
        java.lang.AssertionError - if called when the EXPORT command is supported
        See Also:
        StrangeEonsEditor.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
      • print

        public void print()
        Open the print dialog for this editor, allowing the user to print the edited component. If this operation is not supported by this editor, an UnsupportedOperationException is thrown. This implementation creates a default PrinterJob and then passes it to printImpl(java.awt.print.PrinterJob). It also performs exception handling, including the PrinterAbortException that is thrown if the user cancels a print. To implement printing, override printImpl to print the content using the provided job. Note that this method does not display a print dialog; you can do this from printImpl using job.printDialog().
        Specified by:
        print in interface StrangeEonsEditor
        See Also:
        printImpl(java.awt.print.PrinterJob)
      • printImpl

        protected void printImpl​(java.awt.print.PrinterJob job)
                          throws javax.print.PrintException,
                                 java.awt.print.PrinterException
        Subclasses should override this to print the edited document if PRINT is a supported command.
        Parameters:
        job - the printer job to use for printing
        Throws:
        javax.print.PrintException - if a printing error occurs
        java.awt.print.PrinterException - if a printing error occurs
      • spinOffImpl

        protected StrangeEonsEditor spinOffImpl()
        Subclasses should override this to clone the edited document if SPIN_OFF is a supported command.
        Returns:
        a new editor with an exact copy of this document
      • createTimer

        protected void createTimer()
        Creates a heartbeat timer that ticks at the default rate. The default rate is determined from the setting key update-rate, and can be changed in the Preferences dialog.
        See Also:
        createTimer(int)
      • createTimer

        protected void createTimer​(int updatePeriod)
        Creates a heartbeat timer at the specified rate, in milliseconds. Note that an update period of longer than a few seconds may cause the interface to appear to be responding sluggishly.
        Parameters:
        updatePeriod - the approximate time between heartbeats, in milliseconds
      • stopTimedUpdates

        public void stopTimedUpdates()
        Stops updating the preview pane when the game component is modified.
        See Also:
        resumeTimedUpdates()
      • resumeTimedUpdates

        public void resumeTimedUpdates()
        Resumes stopped preview updates.
        See Also:
        stopTimedUpdates()
      • onHeartbeat

        protected void onHeartbeat()
        This method is called to allow the editor to perform heartbeat processing. The base class will call fireHeartbeatEvent() to notify any attached listeners.
      • fireHeartbeatEvent

        protected final boolean fireHeartbeatEvent()
        This method is called by onHeartbeat() to notify heartbeat listeners. Subclasses that override the default heartbeat handling without calling the super implementation must call this to ensure that registered listeners are correctly notified.
        Returns:
        true if any registered listener returns true to indicate content changes
      • addHeartbeatListener

        public void addHeartbeatListener​(StrangeEonsEditor.HeartbeatListener hl)
        Adds a new HeartbeatListener to this editor.
        Parameters:
        hl - the listener to add
        Since:
        2.00 (final)
      • removeHeartbeatListener

        public void removeHeartbeatListener​(StrangeEonsEditor.HeartbeatListener hl)
        Removes a HeartbeatListener from this editor.
        Parameters:
        hl - the listener to remove
        Since:
        2.00 (final)
      • removeAllStrangeEonsListeners

        protected void removeAllStrangeEonsListeners()
        Removes all listeners for events specific to Strange Eons. This method is called when the editor is being disposed of. It removes any editor and heartbeat event listeners that were added through the editor. Subclasses are responsible for overriding this method to remove any additional listener types that they define and to call the superclass implementation.
      • toString

        public java.lang.String toString()
        Returns a string describing the editor, including the class name, size, edited file, and game component (if any).
        Overrides:
        toString in class java.awt.Component
        Returns:
        a string describing the editor
      • dispose

        public void dispose()
        Releases resources when the editor will no longer be used. Note that although windows can typically be redisplayed after being disposed of by simply making them visible, editors are not designed to be used after this method is called.

        Note: This method should not typically be called by plug-in code. If you wish to close an open editor, call its close() method instead.

        Overrides:
        dispose in class javax.swing.JInternalFrame
      • getBorder

        public final javax.swing.border.Border getBorder()
        Overrides:
        getBorder in class javax.swing.JComponent
      • setFrameIcon

        public void setFrameIcon​(javax.swing.Icon icon)
        Sets the preferred icon to use for this editor window. This icon may be used to represent the window in various parts of the application interface. Possible example uses include the following: the document tab, the editor's item in the Window menu, and the frame icon of the editor's detached window. Note, however, that there is no guarantee that the icon will be used, or how. Furthermore, the icon may be used in modified form.
        Overrides:
        setFrameIcon in class javax.swing.JInternalFrame
        Parameters:
        icon - the preferred icon for the editor window
        See Also:
        JInternalFrame.getFrameIcon()
      • getFrameIcon

        public javax.swing.Icon getFrameIcon()
        Returns the editor window icon.
        Overrides:
        getFrameIcon in class javax.swing.JInternalFrame
        Returns:
        the icon for the editor, or null if no icon is set
      • setAttached

        public void setAttached​(boolean attach)
        Sets whether this editor is attached to the document tab strip. If true, the editor is attached; this is the default state for new editors. If false, the editor is detached from the tab strip. When detached, the editor appears in its own floating window separate from the main application window. The editor reattaches when the window is closed.
        Parameters:
        attach - if true, attaches the window to the tab strip
      • isAttached

        public boolean isAttached()
        Returns true if this editor is currently attached to the document tab strip.
        Returns:
        true if the editor is attached
        See Also:
        setAttached(boolean)