Value placeholder, allowing the value to be computed on request. Values are provided an element for context which reduces the number of value instances that need to be created and reduces verbosity in code that specifies values
Пример #1
0
		public Table pad( float top, float left, float bottom, float right )
		{
			_padTop = new Value.Fixed( top );
			_padLeft = new Value.Fixed( left );
			_padBottom = new Value.Fixed( bottom );
			_padRight = new Value.Fixed( right );
			_sizeInvalid = true;
			return this;
		}
Пример #2
0
		/// <summary>
		/// Padding at the top edge of the table.
		/// </summary>
		/// <returns>The top.</returns>
		/// <param name="padTop">Pad top.</param>
		public Table padTop( float padTop )
		{
			_padTop = new Value.Fixed( padTop );
			_sizeInvalid = true;
			return this;
		}
Пример #3
0
		/// <summary>
		/// Padding at the bottom edge of the table.
		/// </summary>
		/// <returns>The bottom.</returns>
		/// <param name="padBottom">Pad bottom.</param>
		public Table padBottom( Value padBottom )
		{
			if( padBottom == null )
				throw new Exception( "padBottom cannot be null." );
			_padBottom = padBottom;
			_sizeInvalid = true;
			return this;
		}
Пример #4
0
		/// <summary>
		/// Padding at the right edge of the table.
		/// </summary>
		/// <returns>The right.</returns>
		/// <param name="padRight">Pad right.</param>
		public Table padRight( Value padRight )
		{
			if( padRight == null )
				throw new Exception( "padRight cannot be null." );
			_padRight = padRight;
			_sizeInvalid = true;
			return this;
		}
Пример #5
0
		public Table pad( Value top, Value left, Value bottom, Value right )
		{
			if( top == null )
				throw new Exception( "top cannot be null." );
			if( left == null )
				throw new Exception( "left cannot be null." );
			if( bottom == null )
				throw new Exception( "bottom cannot be null." );
			if( right == null )
				throw new Exception( "right cannot be null." );

			_padTop = top;
			_padLeft = left;
			_padBottom = bottom;
			_padRight = right;
			_sizeInvalid = true;

			return this;
		}
Пример #6
0
		/// <summary>
		/// Padding at the top edge of the table.
		/// </summary>
		/// <returns>The top.</returns>
		/// <param name="padTop">Pad top.</param>
		public Table padTop( Value padTop )
		{
			if( padTop == null )
				throw new Exception( "padTop cannot be null." );
			_padTop = padTop;
			_sizeInvalid = true;
			return this;
		}
Пример #7
0
		/// <summary>
		/// Removes all elements and cells from the table (same as {@link #clear()}) and additionally resets all table properties and
		/// cell, column, and row defaults.
		/// </summary>
		public void reset()
		{
			clear();
			_padTop = backgroundTop;
			_padLeft = backgroundLeft;
			_padBottom = backgroundBottom;
			_padRight = backgroundRight;
			_align = AlignInternal.center;
			_tableDebug = TableDebug.None;

			_cellDefaults.reset();

			for( int i = 0, n = _columnDefaults.Count; i < n; i++ )
			{
				var columnCell = _columnDefaults[i];
				if( columnCell != null )
					Pool<Cell>.free( columnCell );
			}
			_columnDefaults.Clear();
		}
Пример #8
0
		/// <summary>
		/// Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.
		/// </summary>
		/// <param name="pad">Pad.</param>
		public Table pad( Value pad )
		{
			if( pad == null )
				throw new Exception( "pad cannot be null." );
			
			_padTop = pad;
			_padLeft = pad;
			_padBottom = pad;
			_padRight = pad;
			_sizeInvalid = true;

			return this;
		}
Пример #9
0
 public Cell SetPadTop(float padTop)
 {
     this.padTop = new Value.Fixed(padTop);
     return(this);
 }
Пример #10
0
 public Cell SetMaxWidth(float maxWidth)
 {
     this.maxWidth = new Value.Fixed(maxWidth);
     return(this);
 }
Пример #11
0
 public Cell SetPrefWidth(float prefWidth)
 {
     this.prefWidth = new Value.Fixed(prefWidth);
     return(this);
 }
Пример #12
0
 public Cell SetMinWidth(float minWidth)
 {
     this.minWidth = new Value.Fixed(minWidth);
     return(this);
 }
Пример #13
0
        /// <summary>
        /// cell may be null
        /// </summary>
        /// <param name="cell">Cell.</param>
        public void Merge(Cell cell)
        {
            if (cell == null)
            {
                return;
            }

            if (cell.minWidth != null)
            {
                minWidth = cell.minWidth;
            }
            if (cell.minHeight != null)
            {
                minHeight = cell.minHeight;
            }
            if (cell.prefWidth != null)
            {
                prefWidth = cell.prefWidth;
            }
            if (cell.prefHeight != null)
            {
                prefHeight = cell.prefHeight;
            }
            if (cell.maxWidth != null)
            {
                maxWidth = cell.maxWidth;
            }
            if (cell.maxHeight != null)
            {
                maxHeight = cell.maxHeight;
            }
            if (cell.spaceTop != null)
            {
                spaceTop = cell.spaceTop;
            }
            if (cell.spaceLeft != null)
            {
                spaceLeft = cell.spaceLeft;
            }
            if (cell.spaceBottom != null)
            {
                spaceBottom = cell.spaceBottom;
            }
            if (cell.spaceRight != null)
            {
                spaceRight = cell.spaceRight;
            }
            if (cell.padTop != null)
            {
                padTop = cell.padTop;
            }
            if (cell.padLeft != null)
            {
                padLeft = cell.padLeft;
            }
            if (cell.padBottom != null)
            {
                padBottom = cell.padBottom;
            }
            if (cell.padRight != null)
            {
                padRight = cell.padRight;
            }
            if (cell.fillX != null)
            {
                fillX = cell.fillX;
            }
            if (cell.fillY != null)
            {
                fillY = cell.fillY;
            }
            if (cell.align != null)
            {
                align = cell.align;
            }
            if (cell.expandX != null)
            {
                expandX = cell.expandX;
            }
            if (cell.expandY != null)
            {
                expandY = cell.expandY;
            }
            if (cell.colspan != null)
            {
                colspan = cell.colspan;
            }
            if (cell.uniformX != null)
            {
                uniformX = cell.uniformX;
            }
            if (cell.uniformY != null)
            {
                uniformY = cell.uniformY;
            }
        }