|
|
@ -5,6 +5,7 @@ import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.stable.collections.utils.MathUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
@ -14,10 +15,12 @@ import java.awt.event.MouseMotionListener; |
|
|
|
|
|
|
|
|
|
|
|
public class UIResizableContainer extends JPanel { |
|
|
|
public class UIResizableContainer extends JPanel { |
|
|
|
private static final long serialVersionUID = 1854340560790476907L; |
|
|
|
private static final long serialVersionUID = 1854340560790476907L; |
|
|
|
|
|
|
|
private static final int MAX_PARA_HEIGHT = 240; |
|
|
|
private int containerWidth = 240; |
|
|
|
private int containerWidth = 240; |
|
|
|
private int preferredWidth = 240; |
|
|
|
private int preferredWidth = 240; |
|
|
|
private int toolPaneY = 300; |
|
|
|
private int toolPaneY = 300; |
|
|
|
private int toolPaneHeight = 10; |
|
|
|
private int toolPaneHeight = 10; |
|
|
|
|
|
|
|
private int bottomHeight = 30; |
|
|
|
|
|
|
|
|
|
|
|
private JComponent upPane; |
|
|
|
private JComponent upPane; |
|
|
|
private JComponent downPane; |
|
|
|
private JComponent downPane; |
|
|
@ -139,7 +142,7 @@ public class UIResizableContainer extends JPanel { |
|
|
|
* @param height |
|
|
|
* @param height |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setParameterHeight(int height) { |
|
|
|
public void setParameterHeight(int height) { |
|
|
|
paraHeight = hasParameterPane? height : 0; |
|
|
|
paraHeight = hasParameterPane? Math.min(height, MAX_PARA_HEIGHT) : 0; |
|
|
|
refreshContainer(); |
|
|
|
refreshContainer(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -208,7 +211,7 @@ public class UIResizableContainer extends JPanel { |
|
|
|
if(isDownPaneVisible){ |
|
|
|
if(isDownPaneVisible){ |
|
|
|
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); |
|
|
|
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); |
|
|
|
horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight); |
|
|
|
horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight); |
|
|
|
downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight-30); |
|
|
|
downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight - bottomHeight); |
|
|
|
verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight()); |
|
|
|
verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight()); |
|
|
|
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight()); |
|
|
|