Package gui.page

Class Selection

java.lang.Object
gui.page.Selection

public class Selection extends Object
Perform bulk operations on GUIMedia within the same Page.

A Selection is created for a Page. Then, GUIMedia from that Page can be added to the Selection.

The GUIMedia within a Selection can then be moved, renamed, rotated, etc. all together.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Selection(Page page, javafx.scene.effect.Effect selectedEffect)
    Create a new Selection for the given Page.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMedia(GUIMedia<?>... media)
    Add the given GUIMedia to the selection.
    boolean
    contains(GUIMedia<?> media)
    Return whether or not the given GUIMedia is selected.
    void
    Delete the selected Media from the page.
    double
    Return an angle for the selection.
    javafx.collections.ObservableSet<GUIMedia<?>>
     
    Return a name for the selection.
    int
    Return a Z-Index for the selection.
    void
    move(javafx.geometry.Point2D displacement)
    Increment the positions of the selected Media by the given displacement.
    void
    Empty the selection.
    void
    removeMedia(GUIMedia<?>... media)
    Remove the given GUIMedia from the selection.
    void
    rename(String name)
    Rename the selected Media to the given name.
    void
    rotate(double angle)
    Set the angle of rotation of the selected Media to the given angle.
    void
    setZindex(int zIndex)
    Set the Z-index of the selected Media to the given Z-index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Selection

      public Selection(Page page, javafx.scene.effect.Effect selectedEffect)
      Create a new Selection for the given Page.

      The given selectedEffect will be added to GUIMedia in the selection to visually indicate their membership.

  • Method Details

    • addMedia

      public void addMedia(GUIMedia<?>... media)
      Add the given GUIMedia to the selection.
    • removeMedia

      public void removeMedia(GUIMedia<?>... media)
      Remove the given GUIMedia from the selection.
    • removeAllMedia

      public void removeAllMedia()
      Empty the selection.
    • getMedia

      public javafx.collections.ObservableSet<GUIMedia<?>> getMedia()
    • contains

      public boolean contains(GUIMedia<?> media)
      Return whether or not the given GUIMedia is selected.
    • move

      public void move(javafx.geometry.Point2D displacement)
      Increment the positions of the selected Media by the given displacement.
    • delete

      public void delete()
      Delete the selected Media from the page.
    • rename

      public void rename(String name)
      Rename the selected Media to the given name.
    • rotate

      public void rotate(double angle)
      Set the angle of rotation of the selected Media to the given angle.
    • setZindex

      public void setZindex(int zIndex)
      Set the Z-index of the selected Media to the given Z-index.
    • getName

      public String getName()
      Return a name for the selection.

      If every selected Media has the same name, that name is returned. If the selection is empty, or the selected Media do not share the same name, the empty string is returned.

    • getAngle

      public double getAngle()
      Return an angle for the selection.

      The mean average of the angles of rotation of the selected Media is returned.

    • getZindex

      public int getZindex()
      Return a Z-Index for the selection.

      The maximum Z-Index of the selected Media is returned.