Class AbstractPolyModel

All Implemented Interfaces:
IPVWidgetModel, IAdaptable, IPropertySource
Direct Known Subclasses:
PolygonModel, PolyLineModel

public abstract class AbstractPolyModel extends AbstractShapeModel
  • Field Details

  • Constructor Details

    • AbstractPolyModel

      public AbstractPolyModel()
  • Method Details

    • configureProperties

      protected void configureProperties()
      Description copied from class: AbstractWidgetModel
      Configure the properties of the widget. Subclass should add new properties in this method.
      Overrides:
      configureProperties in class AbstractShapeModel
    • setPoints

      public void setPoints(org.eclipse.draw2d.geometry.PointList points, boolean rememberPoints)
      Sets the specified _points for the polygon.
      Parameters:
      points - the polygon points
      rememberPoints - true if the zero degree relative points should be remembered, false otherwise.
    • getPoints

      public org.eclipse.draw2d.geometry.PointList getPoints()
      Gets the polygon _points.
      Returns:
      the polygon _points
    • setSize

      public void setSize(int width, int height)
      Overrides:
      setSize in class AbstractWidgetModel
    • setLocation

      public void setLocation(int x, int y)
      Overrides:
      setLocation in class AbstractWidgetModel
    • rotatePoints

      public org.eclipse.draw2d.geometry.PointList rotatePoints(org.eclipse.draw2d.geometry.PointList points, double angle)
      Rotates all points.
      Parameters:
      points - The PoinList, which points should be rotated
      angle - The angle to rotate
      Returns:
      The rotated PointList
    • rememberZeroDegreePoints

      protected void rememberZeroDegreePoints(org.eclipse.draw2d.geometry.PointList points)
      Rotates the given points to 0 degrees and sets them as _originalPoints.
      Parameters:
      points - The current PointList
    • getRotationAngle

      public double getRotationAngle()
      Returns the rotation angle for this widget. Returns 0 if this widget is not rotatable
      Returns:
      The rotation angle
    • setRotationAngle

      public void setRotationAngle(double angle)
      Sets the rotation angle for this widget, only when this widget is rotatable.
      Parameters:
      angle - The angle
    • setPropertyValue

      public final void setPropertyValue(Object propertyID, Object value)
      Specified by:
      setPropertyValue in interface IPropertySource
      Overrides:
      setPropertyValue in class AbstractWidgetModel
    • getOriginalPoints

      public org.eclipse.draw2d.geometry.PointList getOriginalPoints()
    • flipHorizontally

      public void flipHorizontally()
      Description copied from class: AbstractWidgetModel
      Flip the widget figure horizontally.
      Overrides:
      flipHorizontally in class AbstractWidgetModel
    • flipHorizontally

      public void flipHorizontally(int centerX)
      Description copied from class: AbstractWidgetModel
      Flip the widget figure horizontally.
      Overrides:
      flipHorizontally in class AbstractWidgetModel
      Parameters:
      centerX - the center X coordinate
    • flipVertically

      public void flipVertically()
      Description copied from class: AbstractWidgetModel
      Flip the widget figure vertically.
      Overrides:
      flipVertically in class AbstractWidgetModel
    • flipVertically

      public void flipVertically(int centerY)
      Description copied from class: AbstractWidgetModel
      Flip the widget figure horizontally.
      Overrides:
      flipVertically in class AbstractWidgetModel
      Parameters:
      centerY - the center Y coordinate
    • rotate90

      public void rotate90(boolean clockwise)
      Description copied from class: AbstractWidgetModel
      Rotate the widget figure 90 degree.
      Overrides:
      rotate90 in class AbstractWidgetModel
      Parameters:
      clockwise - true if rotate clockwise. false if counterclockwise.
    • rotate90

      public void rotate90(boolean clockwise, org.eclipse.draw2d.geometry.Point center)
      Description copied from class: AbstractWidgetModel
      Rotate the widget figure 90 degree.
      Overrides:
      rotate90 in class AbstractWidgetModel
      Parameters:
      clockwise - true if rotate clockwise. false if counterclockwise.
    • doScale

      protected void doScale(double widthRatio, double heightRatio)
      Description copied from class: AbstractWidgetModel
      The actual code that scaling the widget.
      Overrides:
      doScale in class AbstractWidgetModel