public Rectangle getComponentRect(Rectangle rect, Insets borderInsets) {
		Dimension compD = component.getPreferredSize();
		Rectangle compR = new Rectangle(0, 0, compD.width, compD.height);
		switch (titlePosition) {
			default:
			case ABOVE_TOP:
				compR.y = EDGE_SPACING;
				break;
			case TOP:
			case DEFAULT_POSITION:
				compR.y = EDGE_SPACING +
					(borderInsets.top - EDGE_SPACING - TEXT_SPACING - compD.height) / 2;
				break;
			case BELOW_TOP:
				compR.y = borderInsets.top - compD.height - TEXT_SPACING;
				break;
			case ABOVE_BOTTOM:
				compR.y = rect.height - borderInsets.bottom + TEXT_SPACING;
				break;
			case BOTTOM:
				compR.y = rect.height - borderInsets.bottom + TEXT_SPACING +
					(borderInsets.bottom - EDGE_SPACING - TEXT_SPACING - compD.height) / 2;
				break;
			case BELOW_BOTTOM:
				compR.y = rect.height - compD.height - EDGE_SPACING;
				break;
		}
		switch (titleJustification) {
			default:
			case LEFT:
			case DEFAULT_JUSTIFICATION:
				compR.x = TEXT_INSET_H + borderInsets.left;
				break;
			case RIGHT:
				compR.x = rect.width - borderInsets.right - TEXT_INSET_H - compR.width;
				break;
			case CENTER:
				compR.x = (rect.width - compR.width) / 2;
				break;
		}
		return compR;
	}
A helper class to the InlineComponentTitledPanel that implements the component-in-border effect.
<p>
<b>This class should not be used outside InlineComponentTitledPanel.</b>
 @see docking.widgets.InlineComponentTitledPanel
Ghidra/Framework/Docking/src/main/java/docking/widgets/InlineComponentTitledBorder.java