|
|
@ -1,13 +1,16 @@ |
|
|
|
package com.fr.design.dialog; |
|
|
|
package com.fr.design.dialog; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JScrollBar; |
|
|
|
import javax.swing.JScrollBar; |
|
|
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import java.awt.AWTEvent; |
|
|
|
import java.awt.AWTEvent; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Window; |
|
|
|
import java.awt.Container; |
|
|
|
import java.awt.Container; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.LayoutManager; |
|
|
|
import java.awt.LayoutManager; |
|
|
@ -111,6 +114,16 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{ |
|
|
|
doLayout(); |
|
|
|
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 { |
|
|
|
protected class BarLayout implements LayoutManager { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -135,7 +148,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{ |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void layoutContainer(Container parent) { |
|
|
|
public void layoutContainer(Container parent) { |
|
|
|
if(getHeight() >= leftcontentPane.getPreferredSize().height) { |
|
|
|
if(getMaxHeight() >= leftcontentPane.getPreferredSize().height) { |
|
|
|
scrollBar.setEnabled(false); |
|
|
|
scrollBar.setEnabled(false); |
|
|
|
scrollBar.setVisible(false); |
|
|
|
scrollBar.setVisible(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -143,7 +156,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{ |
|
|
|
scrollBar.setEnabled(show); |
|
|
|
scrollBar.setEnabled(show); |
|
|
|
scrollBar.setVisible(show); |
|
|
|
scrollBar.setVisible(show); |
|
|
|
} |
|
|
|
} |
|
|
|
maxheight = getHeight() - DET_HEIGHT; |
|
|
|
maxheight = getMaxHeight() - DET_HEIGHT; |
|
|
|
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { |
|
|
|
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { |
|
|
|
beginY = 0; |
|
|
|
beginY = 0; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|