// Copyright (C) 2018-2024, Tellusim Technologies Inc. All rights reserved
// https://tellusim.com/

package com.tellusim;
import com.tellusim.*;
import java.lang.ref.Cleaner;

/*
 */
public class ControlGrid extends Control {
	
	public ControlGrid() { init_(new_()); }
	public ControlGrid(Control[] parent) { init_(new_1(Control.self_(parent))); }
	public ControlGrid(Control[] parent, int columns) { init_(new_2(Control.self_(parent), columns)); }
	public ControlGrid(Control[] parent, int columns, float x) { init_(new_3(Control.self_(parent), columns, x, 0.0f)); }
	public ControlGrid(Control[] parent, int columns, float x, float y) { init_(new_3(Control.self_(parent), columns, x, y)); }
	public ControlGrid[] ref() { return new ControlGrid[] { this }; }
	public ControlGrid(Control base) { init_(cast_control_ptr(base.self)); }
	public Control toControl() { return new Control(base_control_ptr(self)); }
	public void setColumns(int columns) { set_columns(self, columns); }
	public int getColumns() { return get_columns(self); }
	public void setSpacing(Vector2f spacing) { set_spacing(self, spacing.self); }
	public void setSpacing(float x, float y) { set_spacing_1(self, x, y); }
	public Vector2f getSpacing() { return new Vector2f(get_spacing(self)); }
	public void setColumnRatio(int index, float ratio) { set_column_ratio(self, index, ratio); }
	public float getColumnRatio(int index) { return get_column_ratio(self, index); }
	public Vector2f getControlsSize() { return new Vector2f(get_controls_size(self)); }
	
	private static native long new_();
	private static native long new_1(long[] parent);
	private static native long new_2(long[] parent, int columns);
	private static native long new_3(long[] parent, int columns, float x, float y);
	private static native void delete_(long self);
	private static native boolean equal_control_ptr(long self, long base);
	private static native long cast_control_ptr(long self);
	private static native long base_control_ptr(long self);
	private static native void set_columns(long self, int columns);
	private static native int get_columns(long self);
	private static native void set_spacing(long self, long spacing);
	private static native void set_spacing_1(long self, float x, float y);
	private static native long get_spacing(long self);
	private static native void set_column_ratio(long self, int index, float ratio);
	private static native float get_column_ratio(long self, int index);
	private static native long get_controls_size(long self);
	
	protected ControlGrid(long self) {
		init_(self);
	}
	public static ControlGrid null_() {
		return new ControlGrid((long)0);
	}
}
