Package edu.cnu.mdi.item
Class PolygonItem
java.lang.Object
edu.cnu.mdi.item.AItem
edu.cnu.mdi.item.PathBasedItem
edu.cnu.mdi.item.PolygonItem
- All Implemented Interfaces:
IFeedbackProvider,IDrawable,EventListener
- Direct Known Subclasses:
EllipseItem,RadArcItem,RectangleItem
A closed, filled/stroked polygon defined in world coordinates.
The polygon geometry is stored as a world-coordinate
Path2D. Selection/reshape modifies vertices of that
path.
-
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
ConstructorsConstructorDescriptionPolygonItem(Layer layer) Create a world polygon itemPolygonItem(Layer layer, Point2D.Double[] points) Create a world polygon itemPolygonItem(Layer layer, Point2D.Double[] points, Object... keyVals) Create a world polygon item -
Method Summary
Modifier and TypeMethodDescriptionprotected voidreshape()Reshape the polygon based on the modification.voidsetPath(Point2D.Double[] points) Set the path from a world polygon.Methods 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
-
PolygonItem
Create a world polygon item- Parameters:
layer- the z layer this item is on.points- the points of the polygonkeyVals- optional key value pairs for styling the item.
-
PolygonItem
Create a world polygon item- Parameters:
layer- the z layer this item is on.points- the points of the polygon
-
PolygonItem
Create a world polygon item- Parameters:
layer- the z layer this item is on.
-
-
Method Details
-
setPath
Set the path from a world polygon.- Parameters:
points- the points of the polygon.
-
reshape
protected void reshape()Reshape the polygon based on the modification. Not much we can do to a polygon except move the selected point. Keep in mind that if control or shift was pressed, the polygon will scale rather than coming here.- Overrides:
reshapein classPathBasedItem
-