Class TLcdEarthWindIcon

All Implemented Interfaces:
ILcdParameterizedIcon, ILcdOriented

public class TLcdEarthWindIcon extends ALcdEarth2DVectorIcon implements ILcdOriented
This ILcdParameterizedIcon displays wind barbs.

The parameters are interpreted depending on the parameterization. The strength should be in knots. Note that the angle indicates the direction that the wind is blowing from.

Since:
10.1
  • Constructor Details

    • TLcdEarthWindIcon

      public TLcdEarthWindIcon(ALcdEarth2DVectorIcon.Parameterization aType)
      Constructs a black wind icon of the specified type.
      Parameters:
      aType - the parameterization type
    • TLcdEarthWindIcon

      public TLcdEarthWindIcon(ALcdEarth2DVectorIcon.Parameterization aType, Color aColor)
      Constructs a wind icon of the specified type and color.
      Parameters:
      aType - the parameterization type
      aColor - the color
  • Method Details

    • getColor

      public Color getColor()
      Returns the icon color.
      Returns:
      the color of the painted icon
    • setColor

      public void setColor(Color aColor)
      Sets the icon color.
      Parameters:
      aColor - the new color
    • paintIcon

      public void paintIcon(Graphics aGraphics, int aX, int aY, double[] aParameters)
      Description copied from interface: ILcdParameterizedIcon
      Paint the icon at the specified location for the parameters
      Specified by:
      paintIcon in interface ILcdParameterizedIcon
      Parameters:
      aGraphics - the Graphics on which the icon is painted
      aX - the x coordinate at which the icon is painted. aX is the x-coordinate of the top left corner point of the icon.
      aY - the y coordinate at which the icon is painted. aY is the y-coordinate of the top left corner point of the icon.
      aParameters - the parameter values
    • getWidth

      public int getWidth(double[] aParameters)
      Description copied from interface: ILcdParameterizedIcon
      Returns the width of the icon for the given parameter values.
      Specified by:
      getWidth in interface ILcdParameterizedIcon
      Parameters:
      aParameters - the parameter values as passed in ILcdParameterizedIcon.paintIcon(java.awt.Graphics, int, int, double[])
      Returns:
      the width
    • getHeight

      public int getHeight(double[] aParameters)
      Description copied from interface: ILcdParameterizedIcon
      Returns the height of the icon for the given parameter values.
      Specified by:
      getHeight in interface ILcdParameterizedIcon
      Parameters:
      aParameters - the parameter values as passed in ILcdParameterizedIcon.paintIcon(java.awt.Graphics, int, int, double[])
      Returns:
      the height
    • anchorPointSFCT

      public void anchorPointSFCT(double[] aParameters, Point aPointSFCT)
      Description copied from class: ALcdEarthParameterizedIcon

      Returns the anchor point of this icon. The anchor point of an icon is the point on the icon that is attached to the underlying object. For example: a circle icon is attached to an underlying point object by its center. An arrow icon can for example be attached to its object at the start of the arrow. The x-coordinate of the anchor point typically lies between 0 and getWidth(). The y-coordinate typically lies between 0 and getHeight().

      Note that implementations don't need to take the anchor point into account when implementing the paintIcon method. The coordinates passed to that method always represent the top left corner of the icon. Callers of the paint method should make sure that the anchor point is taken into account.

      A good default implementation can be to use the middle of the icon:

      
       aPointSFCT.setLocation(getWidth(aParameters) / 2, getHeight(aParameters) / 2);
       

      This method implementation provides a default anchor point: (width/2, height/2). Override this method to provide an other anchor point.

      Specified by:
      anchorPointSFCT in interface ILcdParameterizedIcon
      Overrides:
      anchorPointSFCT in class ALcdEarthParameterizedIcon
      Parameters:
      aParameters - the parameter values
      aPointSFCT - the point that has to be moved to the location of the anchor point of this icon.
    • getOrientation

      public double getOrientation()
      Returns 0. The orientation of the wind barbs is computed based on the wind values, when they are painted.
      Specified by:
      getOrientation in interface ILcdOriented
      Returns:
      0