Class DefaultFigureSelection

    • Constructor Detail

      • DefaultFigureSelection

        public DefaultFigureSelection()
    • Method Detail

      • getExtension

        public <E> E getExtension​(Class<E> extensionType)
        Description copied from interface: Extensible
        Gets the extension for this object corresponding to a specified extension type.
        Specified by:
        getExtension in interface Extensible
        Parameters:
        extensionType - the extension type.
        Returns:
        the extension for this object corresponding to the specified type, or null if an extension of type extensionType cannot be delivered.
      • setSelectionStage

        public void setSelectionStage​(int selectionStage)
        Description copied from interface: FigureSelection
        Sets the current selection stage. The maximum selection stage is given by the selected figure(s).
        Specified by:
        setSelectionStage in interface FigureSelection
        Parameters:
        selectionStage - The current selection stage.
      • getPresentationName

        public String getPresentationName()
        Description copied from interface: Selection
        Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.
        Specified by:
        getPresentationName in interface Selection
        Returns:
        A presentation name for this selection.
      • getSelectedValue

        public Object getSelectedValue()
        Description copied from interface: Selection
        Gets the selected value. The method returns null if this selection is empty.
        Specified by:
        getSelectedValue in interface Selection
        Returns:
        The selected value, or null.
      • getSelectedValues

        public Object[] getSelectedValues()
        Description copied from interface: Selection
        Gets the selected values of a multiple selection. The method returns an empty array if this selection is empty.
        Specified by:
        getSelectedValues in interface Selection
        Returns:
        The array of selected values.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Selection
        Returns:
        true if this selection is empty.
      • createTransferable

        public Transferable createTransferable​(boolean copy)
        Description copied from interface: Selection
        Creates a transferable representation of this selection.
        Specified by:
        createTransferable in interface Selection
        Parameters:
        copy - If true, the returned Transferable should hold a copy-of rather than a reference-to the selection.
        Returns:
        A transferable representation of this selection or null if this is not possible.
      • addFigureImpl

        protected boolean addFigureImpl​(int index,
                                        Figure figure)
        Description copied from class: AbstractFigure
        The default implementation throws an [@code IllegalStateException}.
        Overrides:
        addFigureImpl in class DefaultFigureCollection
        Parameters:
        index - The index.
        figure - The figure.
        Returns:
        Does never return normally.
      • removeFigureImpl

        protected boolean removeFigureImpl​(Figure figure)
        Description copied from class: AbstractFigure
        The default implementation throws an [@code IllegalStateException}.
        Overrides:
        removeFigureImpl in class DefaultFigureCollection
        Parameters:
        figure - The figure.
        Returns:
        Does never return normally.
      • lostOwnership

        public void lostOwnership​(Clipboard clipboard,
                                  Transferable contents)
        Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.
        Specified by:
        lostOwnership in interface ClipboardOwner
        Parameters:
        clipboard - the clipboard that is no longer owned
        contents - the contents which this owner had placed on the clipboard
      • draw

        public void draw​(Rendering rendering)
        Description copied from interface: Figure
        Draws this figure using the given rendering.
        Specified by:
        draw in interface Figure
        Overrides:
        draw in class DefaultFigureCollection
        Parameters:
        rendering - The rendering used to draw the figure.