Class HatchFillSymbolLayer


public final class HatchFillSymbolLayer extends FillSymbolLayer
Represents a symbol layer for polygon geometries that are filled with hatch lines, uniformly spaced parallel lines. A HatchFillSymbolLayer, when it is the only symbol layer in a multilayer polygon symbol, fills the geometry of the symbol with the specified hatch lines. Each hatch line is defined by a multilayer polyline symbol. A custom hatch line can be set through setPolyline(MultilayerPolylineSymbol) or HatchFillSymbolLayer(MultilayerPolylineSymbol, double).

The HatchFillSymbolLayer provides a similar experience to the SimpleFillSymbol, but with more customization. Whereas one may select from a list of hatch fill styles for a SimpleFillSymbol, the HatchFillSymbolLayer allows a user to specify their own fully-customized symbol to use as the hatch line. The separation between the lines and the angle of the lines can also be customized.

Since:
100.5.0
  • Constructor Details

    • HatchFillSymbolLayer

      public HatchFillSymbolLayer()
      Creates a HatchFillSymbolLayer. The default hatch line is a multilayer polyline symbol with a single SolidStrokeSymbolLayer, with a width of 1.3333 density-independent pixels (dp) and opaque black color, 0xFF000000. The hatch fill rotation angle is set to 0.0 by default.
      Since:
      100.5.0
    • HatchFillSymbolLayer

      public HatchFillSymbolLayer(MultilayerPolylineSymbol polylineSymbol, double angle)
      Creates a HatchFillSymbolLayer with a MultilayerPolylineSymbol and an angle. The fill rotates counter-clockwise with a positive angle.
      Parameters:
      polylineSymbol - the symbol to use for the hatch pattern
      angle - the angle to rotate the hatch lines in degrees, can be negative
      Throws:
      IllegalArgumentException - if polylineSymbol is null
      Since:
      100.5.0
  • Method Details

    • getAngle

      public double getAngle()
      Gets the angle of rotation of the hatch lines. The hatch lines rotate counter-clockwise with a positive angle. By default the value is 0.0.
      Returns:
      the angle in degrees
      Since:
      100.5.0
    • setAngle

      public void setAngle(double angle)
      Sets the angle of rotation of the hatch lines. The hatch lines rotate counter-clockwise with a positive angle. By default the value is 0.0.
      Parameters:
      angle - the angle in degrees, can be negative
      Since:
      100.5.0
    • getPolyline

      public MultilayerPolylineSymbol getPolyline()
      Gets the polyline symbol used to symbolize the hatch lines. If there is no polyline set, the method returns a default polyline with a single SolidStrokeSymbolLayer, with width of 1.3333 density-independent pixels (dp) and opaque black, 0xff000000, color.
      Returns:
      the polyline symbol used to symbolize the hatch lines
      Since:
      100.5.0
    • setPolyline

      public void setPolyline(MultilayerPolylineSymbol polylineSymbol)
      Sets the polyline symbol used to symbolize the hatch lines. The polyline must be a MultilayerPolylineSymbol.
      Parameters:
      polylineSymbol - the polyline to use for the hatch lines
      Throws:
      IllegalArgumentException - if polylineSymbol is null
      Since:
      100.5.0
    • getSeparation

      public double getSeparation()
      Gets the distance between the hatch lines. By default the distance is 5.3333 density-independent pixels (dp).
      Returns:
      the separation between the hatch lines in density-independent pixels (dp)
      Since:
      100.5.0
    • setSeparation

      public void setSeparation(double separation)
      Sets the distance between the hatch lines. By default the distance is 5.3333 density-independent pixels (dp).
      Parameters:
      separation - the separation between the hatch lines in density-independent pixels (dp), cannot be negative
      Throws:
      ArcGISRuntimeException - if separation is negative
      Since:
      100.5.0