parent
							
								
									d2d5809c80
								
							
						
					
					
						commit
						47e8cf419a
					
				@ -0,0 +1,18 @@ | 
				
			||||
package mightypork.gamecore.gui.components.layout; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
import mightypork.gamecore.gui.components.BaseComponent; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * Invisible component that does nothing at all; Null object pattern | 
				
			||||
 *  | 
				
			||||
 * @author MightyPork | 
				
			||||
 */ | 
				
			||||
public class NullComponent extends BaseComponent { | 
				
			||||
	 | 
				
			||||
	@Override | 
				
			||||
	protected void renderComponent() | 
				
			||||
	{ | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
@ -1,20 +1,26 @@ | 
				
			||||
package mightypork.gamecore.gui.components.layout.linear; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
import mightypork.gamecore.gui.components.layout.NullComponent; | 
				
			||||
import mightypork.gamecore.util.math.constraints.num.Num; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * Gap in linear layout | 
				
			||||
 *  | 
				
			||||
 * @author MightyPork | 
				
			||||
 */ | 
				
			||||
public class LinearGap extends LinearRectangle { | 
				
			||||
	 | 
				
			||||
	public LinearGap(Num width) | 
				
			||||
	{ | 
				
			||||
		super(null, width); | 
				
			||||
		super(new NullComponent(), width); | 
				
			||||
	} | 
				
			||||
	 | 
				
			||||
	 | 
				
			||||
	public LinearGap(double heightPercent) | 
				
			||||
	{ | 
				
			||||
		super(null, Num.ZERO); | 
				
			||||
		this(Num.ZERO); | 
				
			||||
		setWidth(height().perc(heightPercent)); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue