Class EquipmentVisualStyle
java.lang.Object
neqsim.process.processmodel.diagram.EquipmentVisualStyle
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate static final StringDefault node height in inches.private static final StringDefault node width in inches.private static final Map<EquipmentEnum, EquipmentVisualStyle> Cached styles by EquipmentEnum.private final Stringprivate static final StringFont name for labels.private static final StringFont size for labels.private final Stringprivate final Stringprivate static final longprivate final Stringprivate final Stringprivate static final Map<String, EquipmentVisualStyle> Cached styles by equipment type.private final String -
Constructor Summary
ConstructorsConstructorDescriptionEquipmentVisualStyle(String shape, String fillColor, String borderColor) Creates a visual style with default dimensions.EquipmentVisualStyle(String shape, String fillColor, String borderColor, String fontColor, String width, String height, String style) Creates a new visual style with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringescapeLabel(String label) Escapes special characters in label for Graphviz.Gets the border color.Gets the fill color.Gets the font color.Gets the height.getShape()Gets the shape.getStyle()Gets the style.static EquipmentVisualStyleGets the visual style for an equipment type.static EquipmentVisualStylegetStyle(EquipmentEnum equipmentEnum) Gets the visual style for an EquipmentEnum type.static EquipmentVisualStylegetStyleForEquipment(ProcessEquipmentInterface equipment) Gets the visual style for a process equipment instance.getWidth()Gets the width.private static voidInitializes default styles for all NeqSim equipment types.private static voidInitializes EquipmentEnum to style mappings for unified equipment type access.toGraphvizAttributes(String label) Generates Graphviz node attributes string.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
DEFAULT_WIDTH
-
DEFAULT_HEIGHT
-
FONT_NAME
-
FONT_SIZE
-
STYLE_CACHE
Cached styles by equipment type. -
ENUM_CACHE
Cached styles by EquipmentEnum. -
shape
-
fillColor
-
borderColor
-
fontColor
-
width
-
height
-
style
-
-
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 namefillColor- fill color (hex or named)borderColor- border color (hex or named)fontColor- font colorwidth- node width in inchesheight- node height in inchesstyle- additional style (filled, rounded, etc.)
-
EquipmentVisualStyle
-
-
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
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
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
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
-
escapeLabel
-
getShape
-
getFillColor
-
getBorderColor
-
getFontColor
-
getWidth
-
getHeight
-
getStyle
-