Re: Generate roof plugin

by byDMA » Mon Jun 17, 2024 11:56 pm

So, that is the raster plan:
Image
Image
If I'm wrong let me know.

Try this:
Mac may be not correct, we will correct this later. Its experimental (replace the lines for layout):

Code: Select all

/**
	 * Layout user interface
	 * @author Daniels118 & byDMA
	 */
	protected JPanel createUI() {
		JPanel roofPanel = SwingTools.createTitledPanel(null);
		roofPanel.setBorder(null);
		// Column 0~3 Row 0~9
		roofPanel.add(roofPreview,
				new GridBagConstraints(0, 0, 4, 9, 1, 1, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
		// Column 4 Row 1
		if (OperatingSystem.isMacOSX()) {
			roofPanel.add(edgesLabel,
					new GridBagConstraints(4, 0, 2, 1, 0, 0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
		}
		// Column 4+5 Row 0~7
		roofPanel.add(scrollEdgesPane,
				new GridBagConstraints(4, 0, 2, 7, 0, 0, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
		// Column 4+5 Row 9
		roofPanel.add(resetButton,
				new GridBagConstraints(4, 9, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		if (OperatingSystem.isMacOSX()) {
			roofPanel.add(invisibilityLabel,
					new GridBagConstraints(5, 1, 1, 1, 0, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 0), 0, 0));
		}
		// Column 6+7 Row 0
		roofPanel.add(invisibilityPane,
				new GridBagConstraints(6, 0, 2, 1, 0, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 6+7 Row 1~5
		roofPanel.add(faceAngleSlider,
				new GridBagConstraints(6, 1, 2, 5, 0, 1, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
		// Column 6+7 Row 6
		roofPanel.add(finePane,
				new GridBagConstraints(6, 6, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 4+5 Row 7
		roofPanel.add(thickPane,
				new GridBagConstraints(4, 7, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 6+7 Row 7
		roofPanel.add(elevationPane,
				new GridBagConstraints(6, 7, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 6+7 Row 8
		roofPanel.add(creatorPane,
				new GridBagConstraints(6, 8, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 0 Row 9
		roofPanel.add(showHome,
				new GridBagConstraints(0, 9, 1, 1, 1, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 2 Row 9
		roofPanel.add(showTexture,
				new GridBagConstraints(2, 9, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
		// Column 3 Row 9
		roofPanel.add(reverseFaces,
				new GridBagConstraints(3, 9, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));		
		// Column 4+5 Row 8
		roofPanel.add(bordersPane,
				new GridBagConstraints(4, 8, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));	
		// Column 6+7 Row 9
		roofPanel.add(aboutButton,
				new GridBagConstraints(6, 9, 2, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
		
		// First refresh roof
		edgesList.updateUI();
		plugin.refreshRoof(plugin.homeView, plugin.resource);
		return roofPanel;
	}