@ -1,15 +1,18 @@
package com.fr.design.dialog ;
import com.fine.theme.utils.FineUIScale ;
import com.fr.design.beans.BasicBeanPane ;
import com.fr.design.gui.iscrollbar.UIScrollBar ;
import javax.swing.JPanel ;
import javax.swing.JScrollBar ;
import javax.swing.SwingUtilities ;
import java.awt.AWTEvent ;
import java.awt.Color ;
import java.awt.Component ;
import java.awt.Container ;
import java.awt.Dimension ;
import java.awt.Window ;
import java.awt.LayoutManager ;
import java.awt.event.AdjustmentEvent ;
import java.awt.event.AdjustmentListener ;
@ -111,6 +114,16 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
doLayout ( ) ;
}
/ * *
* parent . getHeight与最外层ChartPropertyPane获取的高度一致 , 都是计算的面板高度而不是到设计器底部的高度
* 这里直接获取设计器高度减去单元格元素北区估算高度 , 先让滚动效果显示起来
* @return height
* /
protected int getMaxHeight ( ) {
Window window = SwingUtilities . getWindowAncestor ( this ) ;
return window . getHeight ( ) - FineUIScale . scale ( 400 ) ;
}
protected class BarLayout implements LayoutManager {
@Override
@ -135,7 +148,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
@Override
public void layoutContainer ( Container parent ) {
if ( getHeight ( ) > = leftcontentPane . getPreferredSize ( ) . height ) {
if ( getMax Height ( ) > = leftcontentPane . getPreferredSize ( ) . height ) {
scrollBar . setEnabled ( false ) ;
scrollBar . setVisible ( false ) ;
} else {
@ -143,7 +156,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
scrollBar . setEnabled ( show ) ;
scrollBar . setVisible ( show ) ;
}
maxheight = getHeight ( ) - DET_HEIGHT ;
maxheight = getMax Height ( ) - DET_HEIGHT ;
if ( ( MAXVALUE - scrollBar . getVisibleAmount ( ) ) = = 0 ) {
beginY = 0 ;
} else {