public PopupWindowPlacerBuilder edge(Location major, Location... minors) {
		if (minors.length > 3) {
			throw new IllegalArgumentException(
				"Too many preferred Locations: " + Arrays.toString(minors));
		}
		for (Location minor : minors) {
			if (!major.validMinor(minor)) {
				throw new IllegalArgumentException(
					"Preferred Location " + minor + " is not valid for " + major + " edge.");
			}
		}

		if (minors.length == 0) {
			// We are defaulting this as greater to lesser
			if (major.isHorizontal()) {
				add(new EdgePopupPlacer(major, Location.BOTTOM, Location.TOP));
			}
			else {
				add(new EdgePopupPlacer(major, Location.RIGHT, Location.LEFT));
			}
		}
		else if (minors.length == 1) {
			if (minors[0] == Location.CENTER) {
				// Trying center to greater and then center to lesser.
				if (major.isHorizontal()) {
					add(new EdgePopupPlacer(major, minors[0], Location.BOTTOM));
					add(new EdgePopupPlacer(major, minors[0], Location.TOP));
				}
				else {
					add(new EdgePopupPlacer(major, minors[0], Location.RIGHT));
					add(new EdgePopupPlacer(major, minors[0], Location.LEFT));
				}
			}
			else {
				// Only looking from greater/lesser to the center.
				add(new EdgePopupPlacer(major, minors[0], Location.CENTER));
			}
		}
		else { // Since we tested minors.length > 3 above, then we know we must have 2 or 3
			for (int i = 0; i < minors.length - 1; i++) {
				add(new EdgePopupPlacer(major, minors[i], minors[i + 1]));
			}
		}

		return this;
	}
Set the next PopupWindowPlacer to be one that tries to make the placement on the major
edge of the inner bounds (context) without exceeding outer bounds (screen), using
an ordered, preferred placements on that edge.  Invalid values will error.
@param major the major edge of the context area
@param minors the ordered, preferred placements on the edge. If not specified, goes from
greater-valued end of the edge to the lesser-valued end of the edge.
@return this builder
Ghidra/Framework/Docking/src/main/java/docking/widgets/shapes/PopupWindowPlacerBuilder.java