Class EquipmentVisualStyle

java.lang.Object
neqsim.process.processmodel.diagram.EquipmentVisualStyle
All Implemented Interfaces:
Serializable

public class EquipmentVisualStyle extends Object implements Serializable
Defines visual styling for process equipment in PFD diagrams.

This class provides Graphviz-compatible visual attributes for each equipment type following oil & gas industry conventions:

  • Shapes that resemble P&ID symbols
  • Colors that indicate function
  • Consistent sizing for professional appearance
Version:
1.0
Author:
NeqSim
See Also:
  • Field Details

  • Constructor Details

    • EquipmentVisualStyle

      public EquipmentVisualStyle(String shape, String fillColor, String borderColor, String fontColor, String width, String height, String style)
      Creates a new visual style with the specified attributes.
      Parameters:
      shape - Graphviz shape name
      fillColor - fill color (hex or named)
      borderColor - border color (hex or named)
      fontColor - font color
      width - node width in inches
      height - node height in inches
      style - additional style (filled, rounded, etc.)
    • EquipmentVisualStyle

      public EquipmentVisualStyle(String shape, String fillColor, String borderColor)
      Creates a visual style with default dimensions.
      Parameters:
      shape - Graphviz shape name
      fillColor - fill color
      borderColor - border color
  • Method Details

    • initializeDefaultStyles

      private static void initializeDefaultStyles()
      Initializes default styles for all NeqSim equipment types.

      Equipment categories follow industry P&ID conventions:

      • Separators/Vessels: Cylinder shapes, green tones
      • Rotating equipment: Trapezoid/circle shapes, blue tones
      • Heat exchangers: Rectangle shapes, orange/yellow tones
      • Valves: Diamond shapes, pink tones
      • Control/Utility: Dashed outlines, gray tones
    • initializeEnumMappings

      private static void initializeEnumMappings()
      Initializes EquipmentEnum to style mappings for unified equipment type access.

      This enables consistent styling whether equipment comes from direct NeqSim creation or DEXPI import.

    • getStyle

      public static EquipmentVisualStyle getStyle(String equipmentType)
      Gets the visual style for an equipment type.
      Parameters:
      equipmentType - the equipment type (class name or simplified name)
      Returns:
      the visual style, or default if not found
    • getStyle

      public static EquipmentVisualStyle getStyle(EquipmentEnum equipmentEnum)
      Gets the visual style for an EquipmentEnum type.

      This method provides unified access to styles whether equipment comes from direct NeqSim creation or DEXPI import. DEXPI-imported equipment uses DexpiProcessUnit.getMappedEquipment() to get the EquipmentEnum.

      Parameters:
      equipmentEnum - the canonical equipment type
      Returns:
      the visual style, or default if not found
    • getStyleForEquipment

      public static EquipmentVisualStyle getStyleForEquipment(ProcessEquipmentInterface equipment)
      Gets the visual style for a process equipment instance.

      This method automatically handles DEXPI-imported equipment by using the mapped EquipmentEnum, ensuring consistent styling regardless of equipment origin.

      Parameters:
      equipment - the process equipment
      Returns:
      the visual style, or default if not found
    • toGraphvizAttributes

      public String toGraphvizAttributes(String label)
      Generates Graphviz node attributes string.
      Parameters:
      label - the node label
      Returns:
      Graphviz attribute string
    • escapeLabel

      private String escapeLabel(String label)
      Escapes special characters in label for Graphviz.
      Parameters:
      label - the label
      Returns:
      escaped label
    • getShape

      public String getShape()
      Gets the shape.
      Returns:
      the shape
    • getFillColor

      public String getFillColor()
      Gets the fill color.
      Returns:
      the fill color
    • getBorderColor

      public String getBorderColor()
      Gets the border color.
      Returns:
      the border color
    • getFontColor

      public String getFontColor()
      Gets the font color.
      Returns:
      the font color
    • getWidth

      public String getWidth()
      Gets the width.
      Returns:
      the width
    • getHeight

      public String getHeight()
      Gets the height.
      Returns:
      the height
    • getStyle

      public String getStyle()
      Gets the style.
      Returns:
      the style