Package edu.cnu.mdi.item
Class RectangleItem
java.lang.Object
edu.cnu.mdi.item.AItem
edu.cnu.mdi.item.PathBasedItem
edu.cnu.mdi.item.PolygonItem
edu.cnu.mdi.item.RectangleItem
- All Implemented Interfaces:
IFeedbackProvider,IDrawable,EventListener
- Direct Known Subclasses:
ImageItem,TextItem,VirtualWindowItem
A closed, four-vertex
PolygonItem initialized from a world-coordinate
rectangle.
Unlike a general polygon, resizing (without shift/control) preserves the
rectangle shape: reshape() moves only the dragged corner and its
two adjacent vertices, keeping opposite sides axis-aligned with each other
rather than allowing an arbitrary quadrilateral.
-
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
ConstructorsConstructorDescriptionRectangleItem(Layer layer, Rectangle2D.Double wr) Create a world rectangle object.RectangleItem(Layer layer, Rectangle2D.Double wr, Object... keyVals) Create a world rectangle object. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidreshape()Reshape the item based on the modification.Methods inherited from class edu.cnu.mdi.item.PolygonItem
setPathMethods inherited from class edu.cnu.mdi.item.PathBasedItem
contains, drawItem, getBounds, getRotatePoint, getWorldBounds, modify, rotate, scale, shouldDraw, singlePointBounds, threePointAngle, translateWorld, updateFocusMethods inherited from class edu.cnu.mdi.item.AItem
acceptModification, applyGeometryProperties, applyProperties, applyStyleProperties, createPopupMenu, doubleClicked, 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, setSelected, setStyle, setStyleEditable, setVisible, startModification, stopModification, translateLocal
-
Constructor Details
-
RectangleItem
Create a world rectangle object.- Parameters:
layer- the z layer this item is on.wr- the initial bounds of the item.keyVals- optional key value pairs to set properties of the item. SeeAItem(Layer, Object...)for details.
-
RectangleItem
Create a world rectangle object.- Parameters:
layer- the z layer this item is on.wr- the initial bounds of the item.
-
-
Method Details
-
reshape
protected void reshape()Reshape the item based on the modification. Keep in mind that if control or shift was pressed, the item will scale rather than coming here.- Overrides:
reshapein classPolygonItem
-