Browse Source

Merge branch 'feature/10.0' of https://code.fineres.com/scm/~henry.wang/design into feature/10.0

feature/10.0
Henry.Wang 3 years ago
parent
commit
7c72424b8b
  1. 4
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java
  2. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

4
designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java

@ -24,6 +24,7 @@ import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@ -183,6 +184,9 @@ public class StateModel {
FormSelectionUtils.rebuildSelection(designer);
designer.getEditListenerTable().fireCreatorModified(
selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED);
} else {
selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer);
Toolkit.getDefaultToolkit().beep();
}
// 取消提示
designer.setPainter(null);

7
designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

@ -17,9 +17,10 @@ import java.awt.geom.RoundRectangle2D;
public class FormSpacingLineDrawer {
private static final Color LINE_COLOR = new Color(230, 82, 81);
private static final Color TEXT_COLOR = new Color(255, 255, 255);
private static final int TEXT_PADDING_HORIZONTAL = 6;
private static final int TEXT_PADDING_VERTICAL = 1;
private static final int TEXT_PADDING_HORIZONTAL = 8;
private static final int TEXT_PADDING_VERTICAL = 2;
private static final int MIN_SPACING = 10;
private static final float TIP_FONT_SIZE = 10F;
private FormDesigner designer;
private XCreator hoverCreator = null;
@ -109,7 +110,7 @@ public class FormSpacingLineDrawer {
private void drawSpacingText(Graphics g, String text, int x, int y) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setColor(LINE_COLOR);
Font newFont = g2d.getFont().deriveFont(8F).deriveFont(Font.BOLD);
Font newFont = g2d.getFont().deriveFont(TIP_FONT_SIZE).deriveFont(Font.BOLD);
g2d.setFont(newFont);
FontMetrics metrics = g2d.getFontMetrics();
int lineHeight = metrics.getAscent(); // 这里由于都是数字,要居中必须忽略掉leading和descent的高度

Loading…
Cancel
Save