|
|
|
@ -3,7 +3,7 @@ package com.fr.design.gui.icontainer;
|
|
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.utils.SvgPaintUtils; |
|
|
|
|
import com.fr.design.utils.SvgPaintWorker; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
|
|
|
|
@ -17,7 +17,6 @@ import java.awt.Container;
|
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Graphics; |
|
|
|
|
import java.awt.Graphics2D; |
|
|
|
|
import java.awt.Image; |
|
|
|
|
import java.awt.LayoutManager; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
@ -422,12 +421,24 @@ public class UIResizableContainer extends JPanel {
|
|
|
|
|
Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS); |
|
|
|
|
Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS); |
|
|
|
|
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null); |
|
|
|
|
SvgPaintUtils.beforePaint((Graphics2D) g); |
|
|
|
|
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
|
|
|
|
|
g.drawImage(UIConstants.DRAG_LINE, SvgPaintUtils.calculatePositionX((getWidth() - toolPaneHeight) / 2), SvgPaintUtils.calculatePositionY(3), null); |
|
|
|
|
g.drawImage(upButton, ARROW_MARGIN, 0, null); |
|
|
|
|
g.drawImage(downButton, SvgPaintUtils.calculatePositionX(getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null); |
|
|
|
|
SvgPaintUtils.afterPaint((Graphics2D) g); |
|
|
|
|
new SvgPaintWorker(g) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
this.drawImage(UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
new SvgPaintWorker(g) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
this.drawImage(upButton, ARROW_MARGIN, 0, null); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
new SvgPaintWorker(g) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
this.drawImage(downButton, (getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -524,10 +535,12 @@ public class UIResizableContainer extends JPanel {
|
|
|
|
|
button = UIConstants.DRAG_LEFT_PRESS; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
SvgPaintUtils.beforePaint((Graphics2D) g); |
|
|
|
|
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
|
|
|
|
|
g.drawImage(button, SvgPaintUtils.calculatePositionX(-6), SvgPaintUtils.calculatePositionY(ARROW_MARGIN_VERTICAL), this); |
|
|
|
|
SvgPaintUtils.afterPaint((Graphics2D) g); |
|
|
|
|
new SvgPaintWorker(g) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
this.drawImage(button, -6, ARROW_MARGIN_VERTICAL, VerticalToolPane.this); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} else { |
|
|
|
|
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null); |
|
|
|
|
if (containerWidth == toolPaneHeight) { |
|
|
|
@ -543,7 +556,12 @@ public class UIResizableContainer extends JPanel {
|
|
|
|
|
button = UIConstants.DRAG_RIGHT_PRESS; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
g.drawImage(button, SvgPaintUtils.calculatePositionX(10), ARROW_MARGIN_VERTICAL, this); |
|
|
|
|
new SvgPaintWorker(g) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
this.drawImage(button, 10, ARROW_MARGIN_VERTICAL, VerticalToolPane.this); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
if (isLeftRightDragEnabled) { |
|
|
|
|
g.drawImage(UIConstants.DRAG_DOT_VERTICAL, 2, getHeight() / 2, 5, toolPaneHeight, null); |
|
|
|
|