Class TLcdXYPoint

All Implemented Interfaces:
ILcdBounded, ILcdBounds, ILcdPoint, ILcdPointList, ILcdPolypoint, ILcdShape, ILcd2DEditablePoint, ILcd2DEditableShape, ILcdCloneable, Serializable, Cloneable
Direct Known Subclasses:
TLcdMeasureXYPoint, TLcdXYMPoint, TLcdXYZonalPoint

public class TLcdXYPoint extends ALcd2DEditablePoint implements ILcd2DEditablePoint
This class provides an implementation of ILcd2DEditablePoint in the cartesian space.

This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.

Use as a domain object

If you plan on using TLcdXYPoint as a domain object (e.g. using ILcdModel.addElement), please note that two TLcdXYPoint instances are considered to be equal if they describe the same location. If location does not uniquely identify your domain objects, please override equals/hashcode to take the additional properties into account. Alternatively, one could consider every class instance different, resulting in these equals/hashcode implementations:

  public boolean equals( Object aObject ) {
    return aObject == this;
  }

  public int hashCode() {
    return System.identityHashCode( this );
  }
 
Failing to respect equals/hashcode may result in undesired behavior, for example when performing spatial queries, used during painting.
See Also:
  • Constructor Details

    • TLcdXYPoint

      public TLcdXYPoint()
      Constructs and initializes a new TLcdXYPoint initialized with (0, 0).
    • TLcdXYPoint

      public TLcdXYPoint(Point aPoint)
      Constructs and initializes a new TLcdXYPoint with the same location as the specified java.awt.Point.
      Parameters:
      aPoint - the AWT point.
    • TLcdXYPoint

      public TLcdXYPoint(ILcdPoint aPoint)
      Constructs and initializes a new TLcdXYPoint with the same location as the specified ILcdPoint.
      Parameters:
      aPoint - the point.
    • TLcdXYPoint

      public TLcdXYPoint(double aX, double aY)
      Constructs and initializes a new TLcdXYPoint with the specified x and y coordinates.
      Parameters:
      aX - the x coordinate.
      aY - the y coordinate.
  • Method Details

    • move2D

      public void move2D(double aX, double aY)
      Changes the point to have the specified location.
      Specified by:
      move2D in interface ILcd2DEditableShape
      Parameters:
      aX - the x coordinate of the new location.
      aY - the y coordinate of the new location.
    • getX

      public final double getX()
      Description copied from interface: ILcdPoint
      Returns the x coordinate of this ILcdPoint.
      Specified by:
      getX in interface ILcdPoint
      Returns:
      the x coordinate of this ILcdPoint.
    • getY

      public final double getY()
      Description copied from interface: ILcdPoint
      Returns the y coordinate of this ILcdPoint.
      Specified by:
      getY in interface ILcdPoint
      Returns:
      the y coordinate of this ILcdPoint.
    • cloneAs2DEditablePoint

      public ILcd2DEditablePoint cloneAs2DEditablePoint()
      Description copied from interface: ILcdPoint
      Returns a copy of this ILcdPoint that is also an ILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable,
      Specified by:
      cloneAs2DEditablePoint in interface ILcdPoint
      Returns:
      a copy of this ILcdPoint that is also an ILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdPoint object may be read-only.
      See Also:
    • cloneAs3DEditablePoint

      public ILcd3DEditablePoint cloneAs3DEditablePoint()
      Description copied from interface: ILcdPoint
      Returns a copy of this ILcdPoint that is also an ILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable,
      Specified by:
      cloneAs3DEditablePoint in interface ILcdPoint
      Returns:
      a copy of this ILcdPoint that is also an ILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable, even if the original ILcdPoint object may be read-only.
      See Also:
    • cloneAs2DEditableBounds

      public ILcd2DEditableBounds cloneAs2DEditableBounds()
      Description copied from interface: ILcdBounds
      Returns a copy of this ILcdBounds object that is also an ILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      Specified by:
      cloneAs2DEditableBounds in interface ILcdBounds
      Returns:
      a copy of this ILcdBounds object that is also an ILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      See Also:
    • cloneAs3DEditableBounds

      public ILcd3DEditableBounds cloneAs3DEditableBounds()
      Description copied from interface: ILcdBounds
      Returns a copy of this ILcdBounds object that is also an ILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      Specified by:
      cloneAs3DEditableBounds in interface ILcdBounds
      Returns:
      a copy of this ILcdBounds object that is also an ILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      See Also: