Class VirtualWindowItem

All Implemented Interfaces:
IFeedbackProvider, IDrawable, EventListener

public class VirtualWindowItem extends RectangleItem
A rectangle item, drawn on a VirtualView's annotation layer, that represents one BaseView's thumbnail location within the virtual desktop.

The constructor links the two objects both ways: baseView.setVirtualItem(this) lets the real view drive this item's position, while this item's own drag handling (modify()) is translation-only (not resizable or rotatable) and, on drag completion, moves the represented BaseView to match. Selection is a no-op; these items are not independently selectable/deselectable the way a normal drawn item is.

  • Constructor Details

    • VirtualWindowItem

      public VirtualWindowItem(VirtualView vview, BaseView baseView)
      Create a virtual window item that represents a base view inside a virtual view.
      Parameters:
      vview - the virtual view this item is in.
      baseView - the base view this item represents.
  • Method Details

    • doubleClicked

      public void doubleClicked(MouseEvent mouseEvent)
      Called when the item was double clicked. The default implementation is to edit the item's properties. Here we want a no-op.
      Overrides:
      doubleClicked in class AItem
      Parameters:
      mouseEvent - the causal event.
    • setSelected

      public void setSelected(boolean selected)
      Sets whether this item is marked as selected. Here we want a no-op.
      Overrides:
      setSelected in class AItem
      Parameters:
      selected - the new value of the flag.
    • modify

      public void modify()
      A modification such as a drag, resize or rotate is continuing.
      Overrides:
      modify in class PathBasedItem
    • stopModification

      public void stopModification()
      A modification such as a drag, resize or rotate has ended.
      Overrides:
      stopModification in class AItem
    • drawItem

      public void drawItem(Graphics2D g2, IContainer container)
      Custom drawer for the item.
      Overrides:
      drawItem in class PathBasedItem
      Parameters:
      g2 - the graphics context.
      container - the graphical container being rendered.
    • setLocation

      public void setLocation()
      Set the location of this item based on the location of the base view. This should be called whenever the base view moves.
    • getBaseView

      public BaseView getBaseView()
      Get the base view that this item represents
      Returns:
      the base view