|
|
@ -38,6 +38,8 @@ import java.lang.reflect.Method; |
|
|
|
public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { |
|
|
|
public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { |
|
|
|
protected static final int FUZZY_EDGE = 10; |
|
|
|
protected static final int FUZZY_EDGE = 10; |
|
|
|
protected static final int SEPARATOR_GAP = 5; |
|
|
|
protected static final int SEPARATOR_GAP = 5; |
|
|
|
|
|
|
|
//只选中一个
|
|
|
|
|
|
|
|
private static final int ONLY_SELECT_ONE = 1; |
|
|
|
|
|
|
|
|
|
|
|
protected GridHeader gHeader; |
|
|
|
protected GridHeader gHeader; |
|
|
|
private int dragType = GridUtils.DRAG_NONE; |
|
|
|
private int dragType = GridUtils.DRAG_NONE; |
|
|
@ -227,7 +229,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { |
|
|
|
if (SwingUtilities.isRightMouseButton(evt)) { |
|
|
|
if (SwingUtilities.isRightMouseButton(evt)) { |
|
|
|
Selection cs = ePane.getSelection(); |
|
|
|
Selection cs = ePane.getSelection(); |
|
|
|
resetSelectionByRightButton(selectedCellPoint, cs, ePane); |
|
|
|
resetSelectionByRightButton(selectedCellPoint, cs, ePane); |
|
|
|
|
|
|
|
checkEndMultiSelectIndex(cs); |
|
|
|
UIPopupMenu popupMenu = createPopupMenu(ePane, evt, Math.max(dragIndex, Math.max(this.startMultiSelectIndex, this.endMultiSelectIndex))); |
|
|
|
UIPopupMenu popupMenu = createPopupMenu(ePane, evt, Math.max(dragIndex, Math.max(this.startMultiSelectIndex, this.endMultiSelectIndex))); |
|
|
|
if (popupMenu != null) { |
|
|
|
if (popupMenu != null) { |
|
|
|
GUICoreUtils.showPopupMenu(popupMenu, gHeader, evt.getX() + 1, evt.getY() + 1); |
|
|
|
GUICoreUtils.showPopupMenu(popupMenu, gHeader, evt.getX() + 1, evt.getY() + 1); |
|
|
@ -246,6 +248,16 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { |
|
|
|
ePane.repaint(); |
|
|
|
ePane.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 如果行列中有只选中一个的情况,更新下endIndex,防止列宽或行宽不匹配 |
|
|
|
|
|
|
|
* @param selection |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void checkEndMultiSelectIndex(Selection selection) { |
|
|
|
|
|
|
|
if (selection.getSelectedColumns().length == ONLY_SELECT_ONE || selection.getSelectedRows().length == ONLY_SELECT_ONE) { |
|
|
|
|
|
|
|
this.endMultiSelectIndex = this.startMultiSelectIndex; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected abstract void resetSelectionByRightButton(ColumnRow mouseSelectedColumnRow, Selection cs, ElementCasePane ePane); |
|
|
|
protected abstract void resetSelectionByRightButton(ColumnRow mouseSelectedColumnRow, Selection cs, ElementCasePane ePane); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -305,14 +317,11 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
sb.append(String.format("%.2f", new Double(len))) |
|
|
|
sb.append(String.format("%.2f", new Double(len))) |
|
|
|
.append('/').append(String.format("%.2f", new Double(tlen))) |
|
|
|
.append('/').append(String.format("%.2f", new Double(tlen))) |
|
|
|
.append(unit); |
|
|
|
.append(unit).append('(') |
|
|
|
if(!DesignerUIModeConfig.getInstance().simulateWebUIMode()){ |
|
|
|
|
|
|
|
sb.append('(') |
|
|
|
|
|
|
|
.append((int) (unitValue.toPixD(resolution))).append('/') |
|
|
|
.append((int) (unitValue.toPixD(resolution))).append('/') |
|
|
|
.append((int) (totalUnitValue.toPixD(resolution))) |
|
|
|
.append((int) (totalUnitValue.toPixD(resolution))) |
|
|
|
.append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) |
|
|
|
.append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) |
|
|
|
.append(')'); |
|
|
|
.append(')'); |
|
|
|
} |
|
|
|
|
|
|
|
return sb.toString(); |
|
|
|
return sb.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|