Package edu.cnu.mdi.view
Class VirtualWindowItem
java.lang.Object
edu.cnu.mdi.item.AItem
edu.cnu.mdi.item.PathBasedItem
edu.cnu.mdi.item.PolygonItem
edu.cnu.mdi.item.RectangleItem
edu.cnu.mdi.view.VirtualWindowItem
- All Implemented Interfaces:
IFeedbackProvider,IDrawable,EventListener
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.
-
Field Summary
Fields inherited from class edu.cnu.mdi.item.AItem
_connectable, _deletable, _dirty, _displayName, _doubleClickable, _draggable, _enabled, _focus, _FOCUSFILL, _lastDrawnPolygon, _layer, _line, _locked, _modification, _path, _popupMenu, _resizable, _resizePolicy, _rightClickable, _rotatable, _selectable, _selected, _style, _styleEditable, _visible, rotateIcon, RPSIZE, RPSIZE2, SPSIZE, SPSIZE2 -
Constructor Summary
ConstructorsConstructorDescriptionVirtualWindowItem(VirtualView vview, BaseView baseView) Create a virtual window item that represents a base view inside a virtual view. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoubleClicked(MouseEvent mouseEvent) Called when the item was double clicked.voiddrawItem(Graphics2D g2, IContainer container) Custom drawer for the item.Get the base view that this item representsvoidmodify()A modification such as a drag, resize or rotate is continuing.voidSet the location of this item based on the location of the base view.voidsetSelected(boolean selected) Sets whether this item is marked as selected.voidA modification such as a drag, resize or rotate has ended.Methods inherited from class edu.cnu.mdi.item.RectangleItem
reshapeMethods inherited from class edu.cnu.mdi.item.PolygonItem
setPathMethods inherited from class edu.cnu.mdi.item.PathBasedItem
contains, getBounds, getRotatePoint, getWorldBounds, rotate, scale, shouldDraw, singlePointBounds, threePointAngle, translateWorld, updateFocusMethods inherited from class edu.cnu.mdi.item.AItem
acceptModification, applyGeometryProperties, applyProperties, applyStyleProperties, createPopupMenu, draw, drawSelections, enclosed, equals, focusFill, geometryChanged, getAzimuth, getContainer, getDisplayName, getFeedbackStrings, getFocus, getFocusPoint, getItemModification, getLastDrawnPolygon, getLayer, getLine, getPath, getPopupMenu, getResizePolicy, getSelectionPoints, getStyle, getStyleSafe, getView, hashCode, inASelectRect, inRotatePoint, inSelectPoint, isConnectable, isDeletable, isDirty, isDoubleClickable, isDraggable, isEnabled, isLocked, isResizable, isRightClickable, isRotatable, isSelectable, isSelected, isStyleEditable, isTrackable, isVisible, modificationRejected, prepareForPopup, prepareForRemoval, setAzimuth, setConnectable, setDeletable, setDirty, setDisplayName, setDoubleClickable, setDraggable, setEnabled, setFillFocus, setFocus, setLocked, setModification, setResizable, setResizePolicy, setRightClickable, setRotatable, setSelectable, setStyle, setStyleEditable, setVisible, startModification, translateLocal
-
Constructor Details
-
VirtualWindowItem
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
Called when the item was double clicked. The default implementation is to edit the item's properties. Here we want a no-op.- Overrides:
doubleClickedin classAItem- 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:
setSelectedin classAItem- Parameters:
selected- the new value of the flag.
-
modify
public void modify()A modification such as a drag, resize or rotate is continuing.- Overrides:
modifyin classPathBasedItem
-
stopModification
public void stopModification()A modification such as a drag, resize or rotate has ended.- Overrides:
stopModificationin classAItem
-
drawItem
Custom drawer for the item.- Overrides:
drawItemin classPathBasedItem- 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
Get the base view that this item represents- Returns:
- the base view
-