Package edu.cnu.mdi.item
Class PolylineItem
java.lang.Object
edu.cnu.mdi.item.AItem
edu.cnu.mdi.item.PathBasedItem
edu.cnu.mdi.item.PolylineItem
- All Implemented Interfaces:
IFeedbackProvider,IDrawable,EventListener
- Direct Known Subclasses:
ConnectorItem
An open, stroked-only polyline defined in world coordinates.
Unlike PolygonItem, the path is not closed back to its first
point, and the fill color is forced to null so only the connecting
segments are drawn. The 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
ConstructorsConstructorDescriptionPolylineItem(Layer layer, Point2D.Double[] points) Create a world polyline itemPolylineItem(Layer layer, Point2D.Double[] points, Object... keyVals) Create a world polyline item -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawItem(Graphics2D g2, IContainer container) Custom drawer for the item.protected voidreshape()Reshape the polygon based on the modification.Methods inherited from class edu.cnu.mdi.item.PathBasedItem
contains, 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
-
PolylineItem
Create a world polyline item- Parameters:
layer- the z layer this item is on.points- the points of the polyline
-
PolylineItem
Create a world polyline item- Parameters:
layer- the z layer this item is on.points- the points of the polylinekeyVals- optional key value pairs for styling the item. SeeAItem(Layer, Object...)for more details.
-
-
Method Details
-
drawItem
Custom drawer for the item.- Overrides:
drawItemin classPathBasedItem- Parameters:
g2- the graphics context.container- the graphical container being rendered.
-
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
-