<commit_before>package tonegod.gui.core;

import com.jme3.app.Application;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.font.LineWrapMode;
import com.jme3.font.Rectangle;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector4f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.texture.Texture;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import tonegod.gui.controls.extras.DragElement;
import tonegod.gui.controls.form.Form;
import tonegod.gui.core.layouts.Layout;
import tonegod.gui.core.layouts.LayoutHints;
import tonegod.gui.core.utils.UIDUtil;
import tonegod.gui.effects.Effect;

/**
 * <p>
 * The Element class is the primitive in which all controls in the GUI portion or the library 
 * are built upon.  Unlink the overloaded common constructor(s) you will find throughout the library, 
 * the library, there is a single verbose constructor:<br/>
 * </br>
 * @see #Element(tonegod.gui.core.ElementManager, java.lang.String, com.jme3.math.Vector2f, com.jme3.math.Vector2f, com.jme3.math.Vector4f, java.lang.String)
 * </p>
 * <p>
 * Element is backed by a 9-patch style Mesh and can be both movable and resizable
 * by simply flagging them as such.  There is no need to add Listeners to leverage 
 * this default behavior.<br/>
 * <br/>
 * See both:<br/>
 * @see #setIsMovable(boolean)
 * @see #setIsResizable(boolean)
 * </p>
 * @author t0neg0d
 */
public class Element extends Node {
	public static enum Borders {
		NW,
		N,
		NE,
		W,
		E,
		SW,
		S,
		SE;
	};
	/**
	 * Some controls provide different layout's based on the orientation of the control
	 */
	public static enum Orientation {
		/**
		 * Vertical layout
		 */
		VERTICAL,
		/**
		 * Horizontal layout
		 */
		HORIZONTAL
	}
	/**
	 * Defines how the element will dock to it's parent element during resize events
	 */
	public static enum Docking {
		/**
		 * Docks to the top left of parent
		 */
		NW,
		/**
		 * Docks to the top right of parent
		 */
		NE,
		/**
		 * Docks to the bottom left of parent
		 */
		SW,
		/**
		 * Docks to the bottom right of parent
		 */
		SE
	}
	
	//<editor-fold desc="Fields">
	protected Application app;
	protected ElementManager screen;
	private String UID;
	private Vector2f position = new Vector2f();
	public Vector2f orgPosition;
	private Vector2f dimensions = new Vector2f();
	public Vector2f orgDimensions, orgRelDimensions;
	public Vector4f borders = new Vector4f(1,1,1,1);
	public Vector4f borderHandles = new Vector4f(12,12,12,12);
	private Vector2f minDimensions = new Vector2f(10, 10);
	
	private boolean ignoreMouse = false;
	protected boolean isMovable = false;
	private boolean lockToParentBounds = false;
	private boolean isResizable = false;
	private boolean resizeN = true;
	private boolean resizeS = true;
	private boolean resizeW = true;
	private boolean resizeE = true;
	private boolean dockN = false;
	private boolean dockW = true;
	private boolean dockE = false;
	private boolean dockS = true;
	private boolean scaleNS = true;
	private boolean scaleEW = true;
	
	private boolean effectParent = false;
	private boolean effectAbsoluteParent = false;
	
	private Geometry geom;
	private ElementQuadGrid model;
	private boolean tileImage = false;
	private Material mat;
	private Texture defaultTex;
	private boolean useLocalAtlas = false;
	private String atlasCoords = "";
	private Texture alphaMap = null;
	
	protected BitmapText textElement;
//	protected TextElement textElement;
	protected Vector2f textPosition = new Vector2f(0,0);
	protected LineWrapMode textWrap = LineWrapMode.Word;
	protected BitmapFont.Align textAlign = BitmapFont.Align.Left;
	protected BitmapFont.VAlign textVAlign = BitmapFont.VAlign.Top;
	protected String text = "";
	private String toolTipText = null;
	
	protected BitmapFont font;
	protected float fontSize = 20;
	protected float textPadding = 0;
	protected ColorRGBA fontColor = ColorRGBA.White;
	private ColorRGBA defaultColor = new ColorRGBA(1,1,1,0);
	
	private Element elementParent = null;
	protected Map<String, Element> elementChildren = new LinkedHashMap();
	
	// Clipping
	protected boolean isClipped = false;
	protected boolean wasClipped = false;
	protected Element clippingLayer, secondaryClippingLayer;
	protected Vector4f clippingBounds = new Vector4f();
	private Vector4f clipPadding = new Vector4f(0,0,0,0);
	private float textClipPadding = 0;
	
	// New Clipping
	private List<ClippingDefine> clippingLayers = new ArrayList();
	private List<ClippingDefine> remClippingLayers = new ArrayList();
	private Vector4f clipTest = new Vector4f();
	
	protected boolean isVisible = true;
	protected boolean wasVisible = true;
	protected boolean isVisibleAsModal = false;
	private boolean hasFocus = false;
	private boolean resetKeyboardFocus = true;
	
	private Form form;
	private int tabIndex = 0;
	
	private float zOrder;
	private boolean effectZOrder = true;
	private Map<Effect.EffectEvent, Effect> effects = new HashMap();
	
	private OSRBridge bridge;
	<commit_msg>changed scope of List clippingLayers<commit_after>package tonegod.gui.core;

import com.jme3.app.Application;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.font.LineWrapMode;
import com.jme3.font.Rectangle;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector4f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.texture.Texture;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import tonegod.gui.controls.extras.DragElement;
import tonegod.gui.controls.form.Form;
import tonegod.gui.core.layouts.Layout;
import tonegod.gui.core.layouts.LayoutHints;
import tonegod.gui.core.utils.UIDUtil;
import tonegod.gui.effects.Effect;

/**
 * <p>
 * The Element class is the primitive in which all controls in the GUI portion or the library 
 * are built upon.  Unlink the overloaded common constructor(s) you will find throughout the library, 
 * the library, there is a single verbose constructor:<br/>
 * </br>
 * @see #Element(tonegod.gui.core.ElementManager, java.lang.String, com.jme3.math.Vector2f, com.jme3.math.Vector2f, com.jme3.math.Vector4f, java.lang.String)
 * </p>
 * <p>
 * Element is backed by a 9-patch style Mesh and can be both movable and resizable
 * by simply flagging them as such.  There is no need to add Listeners to leverage 
 * this default behavior.<br/>
 * <br/>
 * See both:<br/>
 * @see #setIsMovable(boolean)
 * @see #setIsResizable(boolean)
 * </p>
 * @author t0neg0d
 */
public class Element extends Node {
	public static enum Borders {
		NW,
		N,
		NE,
		W,
		E,
		SW,
		S,
		SE;
	};
	/**
	 * Some controls provide different layout's based on the orientation of the control
	 */
	public static enum Orientation {
		/**
		 * Vertical layout
		 */
		VERTICAL,
		/**
		 * Horizontal layout
		 */
		HORIZONTAL
	}
	/**
	 * Defines how the element will dock to it's parent element during resize events
	 */
	public static enum Docking {
		/**
		 * Docks to the top left of parent
		 */
		NW,
		/**
		 * Docks to the top right of parent
		 */
		NE,
		/**
		 * Docks to the bottom left of parent
		 */
		SW,
		/**
		 * Docks to the bottom right of parent
		 */
		SE
	}
	
	//<editor-fold desc="Fields">
	protected Application app;
	protected ElementManager screen;
	private String UID;
	private Vector2f position = new Vector2f();
	public Vector2f orgPosition;
	private Vector2f dimensions = new Vector2f();
	public Vector2f orgDimensions, orgRelDimensions;
	public Vector4f borders = new Vector4f(1,1,1,1);
	public Vector4f borderHandles = new Vector4f(12,12,12,12);
	private Vector2f minDimensions = new Vector2f(10, 10);
	
	private boolean ignoreMouse = false;
	protected boolean isMovable = false;
	private boolean lockToParentBounds = false;
	private boolean isResizable = false;
	private boolean resizeN = true;
	private boolean resizeS = true;
	private boolean resizeW = true;
	private boolean resizeE = true;
	private boolean dockN = false;
	private boolean dockW = true;
	private boolean dockE = false;
	private boolean dockS = true;
	private boolean scaleNS = true;
	private boolean scaleEW = true;
	
	private boolean effectParent = false;
	private boolean effectAbsoluteParent = false;
	
	private Geometry geom;
	private ElementQuadGrid model;
	private boolean tileImage = false;
	private Material mat;
	private Texture defaultTex;
	private boolean useLocalAtlas = false;
	private String atlasCoords = "";
	private Texture alphaMap = null;
	
	protected BitmapText textElement;
//	protected TextElement textElement;
	protected Vector2f textPosition = new Vector2f(0,0);
	protected LineWrapMode textWrap = LineWrapMode.Word;
	protected BitmapFont.Align textAlign = BitmapFont.Align.Left;
	protected BitmapFont.VAlign textVAlign = BitmapFont.VAlign.Top;
	protected String text = "";
	private String toolTipText = null;
	
	protected BitmapFont font;
	protected float fontSize = 20;
	protected float textPadding = 0;
	protected ColorRGBA fontColor = ColorRGBA.White;
	private ColorRGBA defaultColor = new ColorRGBA(1,1,1,0);
	
	private Element elementParent = null;
	protected Map<String, Element> elementChildren = new LinkedHashMap();
	
	// Clipping
	protected boolean isClipped = false;
	protected boolean wasClipped = false;
	protected Element clippingLayer, secondaryClippingLayer;
	protected Vector4f clippingBounds = new Vector4f();
	private Vector4f clipPadding = new Vector4f(0,0,0,0);
	private float textClipPadding = 0;
	
	// New Clipping
	protected List<ClippingDefine> clippingLayers = new ArrayList();
	private List<ClippingDefine> remClippingLayers = new ArrayList();
	private Vector4f clipTest = new Vector4f();
	
	protected boolean isVisible = true;
	protected boolean wasVisible = true;
	protected boolean isVisibleAsModal = false;
	private boolean hasFocus = false;
	private boolean resetKeyboardFocus = true;
	
	private Form form;
	private int tabIndex = 0;
	
	private float zOrder;
	private boolean effectZOrder = true;
	private Map<Effect.EffectEvent, Effect> effects = new HashMap();
	
	private OSRBridge bridge;
	
{'fraction_non_alphanumeric': 0.09061843427423039, 'fraction_numerical': 0.01425047958344752, 'mean_word_length': 4.4064197530864195, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4492524', 'n_tokens_mistral': 3583, 'n_tokens_neox': 3344, 'n_words': 1058}