diff --git a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/Layout5Test.java b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/Layout5Test.java index 2e363b6bd239..ecfef365d712 100644 --- a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/Layout5Test.java +++ b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/Layout5Test.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.uiDesigner.core; import junit.framework.TestCase; @@ -21,8 +7,6 @@ import javax.swing.*; import java.awt.*; public final class Layout5Test extends TestCase{ - - public void test1() { final JPanel panel = new JPanel(new GridLayoutManager(2,3, new Insets(0,0,0,0), 0, 0)); @@ -79,7 +63,7 @@ public final class Layout5Test extends TestCase{ final Dimension preferredSize = panel.getPreferredSize(); // after getPreferredSize() invocation, the field should be not null - final DimensionInfo horizontalInfo = layoutManager.myHorizontalInfo; + final DimensionInfo horizontalInfo = layoutManager.getHorizontalInfo(); assertEquals(3, horizontalInfo.getCellCount()); assertEquals(GridConstraints.SIZEPOLICY_CAN_SHRINK, horizontalInfo.getCellSizePolicy(0)); assertEquals(GridConstraints.SIZEPOLICY_WANT_GROW, horizontalInfo.getCellSizePolicy(1)); @@ -130,7 +114,7 @@ public final class Layout5Test extends TestCase{ final Dimension preferredSize = panel.getPreferredSize(); // after getPreferredSize() invocation, the field should be not null - final DimensionInfo horizontalInfo = layoutManager.myHorizontalInfo; + final DimensionInfo horizontalInfo = layoutManager.getHorizontalInfo(); assertEquals(GridConstraints.SIZEPOLICY_FIXED, horizontalInfo.getCellSizePolicy(0)); assertEquals(GridConstraints.SIZEPOLICY_WANT_GROW | GridConstraints.SIZEPOLICY_CAN_SHRINK, horizontalInfo.getCellSizePolicy(1)); assertEquals(GridConstraints.SIZEPOLICY_FIXED, horizontalInfo.getCellSizePolicy(2)); diff --git a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/SpansTest.java b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/SpansTest.java index e4439bb6f6be..3be9bb5c3bba 100644 --- a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/SpansTest.java +++ b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/SpansTest.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.uiDesigner.core; import junit.framework.TestCase; @@ -174,7 +160,7 @@ public final class SpansTest extends TestCase { final Dimension preferredSize = panel.getPreferredSize(); // field will be not null after getPreferredSize() - final DimensionInfo horizontalInfo = layoutManager.myHorizontalInfo; + final DimensionInfo horizontalInfo = layoutManager.getHorizontalInfo(); assertEquals(GridConstraints.SIZEPOLICY_WANT_GROW | GridConstraints.SIZEPOLICY_CAN_GROW, horizontalInfo.getCellSizePolicy(0)); assertEquals(GridConstraints.SIZEPOLICY_CAN_SHRINK, horizontalInfo.getCellSizePolicy(1)); assertEquals(GridConstraints.SIZEPOLICY_WANT_GROW, horizontalInfo.getCellSizePolicy(2)); diff --git a/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java b/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java index 8443ee1e0a7d..f0f5a66a46b9 100644 --- a/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java +++ b/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.uiDesigner.core; import javax.swing.*; @@ -56,10 +42,8 @@ public final class GridLayoutManager extends AbstractLayout { private final int[] myWidths; private LayoutState myLayoutState; - /** - * package-private because is used in tests - */ - DimensionInfo myHorizontalInfo; + + private DimensionInfo myHorizontalInfo; /** * package-private because is used in tests */ @@ -101,6 +85,11 @@ public final class GridLayoutManager extends AbstractLayout { myHeights = new int[rowCount]; } + //@VisibleForTesting + public DimensionInfo getHorizontalInfo() { + return myHorizontalInfo; + } + /** * don't delete this constructor! don't use this constructor!!! should be used ONLY in generated code or in tests */ diff --git a/platform/forms_rt/src/com/intellij/uiDesigner/core/HorizontalInfo.java b/platform/forms_rt/src/com/intellij/uiDesigner/core/HorizontalInfo.java index 34b367dacc06..d9adf2a122a4 100644 --- a/platform/forms_rt/src/com/intellij/uiDesigner/core/HorizontalInfo.java +++ b/platform/forms_rt/src/com/intellij/uiDesigner/core/HorizontalInfo.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.uiDesigner.core; final class HorizontalInfo extends DimensionInfo{ @@ -47,7 +33,7 @@ final class HorizontalInfo extends DimensionInfo{ @Override public DimensionInfo getDimensionInfo(GridLayoutManager grid) { - return grid.myHorizontalInfo; + return grid.getHorizontalInfo(); } @Override