< prev index next >
src/java.desktop/share/classes/java/awt/GridBagLayout.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 440,450 ****
* the number of elements in columnWidth.
*
* @serial
* @see #getLayoutDimensions()
*/
! public int columnWidths[];
/**
* This field holds the overrides to the row minimum
* heights. If this field is non-{@code null} the values are
* applied to the gridbag after all of the minimum row
--- 440,450 ----
* the number of elements in columnWidth.
*
* @serial
* @see #getLayoutDimensions()
*/
! public int[] columnWidths;
/**
* This field holds the overrides to the row minimum
* heights. If this field is non-{@code null} the values are
* applied to the gridbag after all of the minimum row
*** 454,464 ****
* the number of elements in {@code rowHeights}.
*
* @serial
* @see #getLayoutDimensions()
*/
! public int rowHeights[];
/**
* This field holds the overrides to the column weights.
* If this field is non-{@code null} the values are
* applied to the gridbag after all of the columns
--- 454,464 ----
* the number of elements in {@code rowHeights}.
*
* @serial
* @see #getLayoutDimensions()
*/
! public int[] rowHeights;
/**
* This field holds the overrides to the column weights.
* If this field is non-{@code null} the values are
* applied to the gridbag after all of the columns
*** 469,479 ****
* of columns, the excess elements are ignored - they do
* not cause more columns to be created.
*
* @serial
*/
! public double columnWeights[];
/**
* This field holds the overrides to the row weights.
* If this field is non-{@code null} the values are
* applied to the gridbag after all of the rows
--- 469,479 ----
* of columns, the excess elements are ignored - they do
* not cause more columns to be created.
*
* @serial
*/
! public double[] columnWeights;
/**
* This field holds the overrides to the row weights.
* If this field is non-{@code null} the values are
* applied to the gridbag after all of the rows
*** 484,494 ****
* of rows, the excess elements are ignored - they do
* not cause more rows to be created.
*
* @serial
*/
! public double rowWeights[];
/**
* The component being positioned. This is set before calling into
* {@code adjustForGravity}.
*/
--- 484,494 ----
* of rows, the excess elements are ignored - they do
* not cause more rows to be created.
*
* @serial
*/
! public double[] rowWeights;
/**
* The component being positioned. This is set before calling into
* {@code adjustForGravity}.
*/
*** 590,600 ****
*/
public int [][] getLayoutDimensions () {
if (layoutInfo == null)
return new int[2][0];
! int dim[][] = new int [2][];
dim[0] = new int[layoutInfo.width];
dim[1] = new int[layoutInfo.height];
System.arraycopy(layoutInfo.minWidth, 0, dim[0], 0, layoutInfo.width);
System.arraycopy(layoutInfo.minHeight, 0, dim[1], 0, layoutInfo.height);
--- 590,600 ----
*/
public int [][] getLayoutDimensions () {
if (layoutInfo == null)
return new int[2][0];
! int[][] dim = new int [2][];
dim[0] = new int[layoutInfo.width];
dim[1] = new int[layoutInfo.height];
System.arraycopy(layoutInfo.minWidth, 0, dim[0], 0, layoutInfo.width);
System.arraycopy(layoutInfo.minHeight, 0, dim[1], 0, layoutInfo.height);
*** 616,626 ****
*/
public double [][] getLayoutWeights () {
if (layoutInfo == null)
return new double[2][0];
! double weights[][] = new double [2][];
weights[0] = new double[layoutInfo.width];
weights[1] = new double[layoutInfo.height];
System.arraycopy(layoutInfo.weightX, 0, weights[0], 0, layoutInfo.width);
System.arraycopy(layoutInfo.weightY, 0, weights[1], 0, layoutInfo.height);
--- 616,626 ----
*/
public double [][] getLayoutWeights () {
if (layoutInfo == null)
return new double[2][0];
! double[][] weights = new double [2][];
weights[0] = new double[layoutInfo.width];
weights[1] = new double[layoutInfo.height];
System.arraycopy(layoutInfo.weightX, 0, weights[0], 0, layoutInfo.width);
System.arraycopy(layoutInfo.weightY, 0, weights[1], 0, layoutInfo.height);
*** 927,937 ****
* we may use preCalculated sizes in whole class because of upper estimation of
* maximumArrayXIndex and maximumArrayYIndex.
*/
private long[] preInitMaximumArraySizes(Container parent){
! Component components[] = parent.getComponents();
Component comp;
GridBagConstraints constraints;
int curX, curY;
int curWidth, curHeight;
int preMaximumArrayXIndex = 0;
--- 927,937 ----
* we may use preCalculated sizes in whole class because of upper estimation of
* maximumArrayXIndex and maximumArrayYIndex.
*/
private long[] preInitMaximumArraySizes(Container parent){
! Component[] components = parent.getComponents();
Component comp;
GridBagConstraints constraints;
int curX, curY;
int curWidth, curHeight;
int preMaximumArrayXIndex = 0;
*** 1001,1011 ****
synchronized (parent.getTreeLock()) {
GridBagLayoutInfo r;
Component comp;
GridBagConstraints constraints;
Dimension d;
! Component components[] = parent.getComponents();
// Code below will address index curX+curWidth in the case of yMaxArray, weightY
// ( respectively curY+curHeight for xMaxArray, weightX ) where
// curX in 0 to preInitMaximumArraySizes.y
// Thus, the maximum index that could
// be calculated in the following code is curX+curX.
--- 1001,1011 ----
synchronized (parent.getTreeLock()) {
GridBagLayoutInfo r;
Component comp;
GridBagConstraints constraints;
Dimension d;
! Component[] components = parent.getComponents();
// Code below will address index curX+curWidth in the case of yMaxArray, weightY
// ( respectively curY+curHeight for xMaxArray, weightX ) where
// curX in 0 to preInitMaximumArraySizes.y
// Thus, the maximum index that could
// be calculated in the following code is curX+curX.
*** 2061,2071 ****
protected void ArrangeGrid(Container parent) {
Component comp;
int compindex;
GridBagConstraints constraints;
Insets insets = parent.getInsets();
! Component components[] = parent.getComponents();
Dimension d;
Rectangle r = new Rectangle();
int i, diffw, diffh;
double weight;
GridBagLayoutInfo info;
--- 2061,2071 ----
protected void ArrangeGrid(Container parent) {
Component comp;
int compindex;
GridBagConstraints constraints;
Insets insets = parent.getInsets();
! Component[] components = parent.getComponents();
Dimension d;
Rectangle r = new Rectangle();
int i, diffw, diffh;
double weight;
GridBagLayoutInfo info;
< prev index next >