Class DeviceItem

java.lang.Object
edu.cnu.mdi.item.AItem
edu.cnu.mdi.item.PointItem
edu.cnu.mdi.view.demo.layout.DeviceItem
All Implemented Interfaces:
IFeedbackProvider, IDrawable, EventListener

public class DeviceItem extends PointItem
  • Field Details

  • Constructor Details

    • DeviceItem

      public DeviceItem(Layer layer, Point2D.Double location, EDeviceSymbol symbol)
      Create a device item with the given symbol and world location.
      Parameters:
      layer - the z layer to add the device to
      location - the world location for the device
      symbol - the device symbol to use
  • Method Details

    • drawItem

      public void drawItem(Graphics2D g2, IContainer container)
      Description copied from class: PointItem
      Custom drawer for the item.
      Overrides:
      drawItem in class PointItem
      Parameters:
      g2 - the graphics context.
      container - the graphical container being rendered.
    • createDeviceItem

      public static DeviceItem createDeviceItem(Layer layer, Point p, EDeviceSymbol symbol)
      Create a device item centered at given point in local container coordinates
      Parameters:
      layer - the z layer to add the device to
      p - the point in local screen coordinates
      symbol - the device symbol to use
      Returns:
      the created device item
    • getFeedbackStrings

      public void getFeedbackStrings(IContainer container, Point pp, Point2D.Double wp, List<String> feedbackStrings)
      Add any appropriate feedback.
      Specified by:
      getFeedbackStrings in interface IFeedbackProvider
      Overrides:
      getFeedbackStrings in class AItem
      Parameters:
      container - the Base container.
      pp - the mouse location.
      wp - the corresponding world point.
      feedbackStrings - the List of feedback strings to add to.