Browse Source

Merge pull request #329 in BA/design from ~HUGH_FINEREPORT.COM/design:master to master

* commit 'a098ae8d6c70128dd6e38e1a287a478fbc593ce6':
  抽出static方便OEM
master
superman 8 years ago
parent
commit
b8a3552805
  1. 22
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java

22
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -273,7 +273,17 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
leftButton.setEnabled(buttonEnabled);
rightButton.setEnabled(buttonEnabled);
}
/**
* 抽出来方便OEM
* @return
*/
public Icon getAddWorkSheet(){
return ADD_WORK_SHEET;
}
public Icon getWorkSheetIcon(){
return WORK_SHEET_ICON;
}
@Override
/**
* 画Tab
@ -290,7 +300,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
double textHeight = this.getSize().getHeight() - 1;
widthArray = calculateWidthArray();
int operationWidth = GRAP + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度
paintBackgroundAndLine(g2d, textHeight, maxWidth, charWidth, textAscent);
checkButton(showCount < widthArray.length);
@ -321,7 +331,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
isNeedPaintedAuthority = templateReport.getWorkSheetPrivilegeControl().checkInvisible(selectedRoles);
}
sheeticon = templateReport instanceof WorkSheet ? WORK_SHEET_ICON : POLY_SHEET_ICON;
sheeticon = templateReport instanceof WorkSheet ? getWorkSheetIcon() : POLY_SHEET_ICON;
String sheetName = workBook.getReportName(i);
if (i == selectedIndex) {
paintSelectedTab(g2d, sheeticon, textHeight, textX, sheetName, charWidth, textAscent, isNeedPaintedAuthority);
@ -352,8 +362,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
}
protected void paintAddButton(Graphics2D g2d){
ADD_WORK_SHEET.paintIcon(this, g2d, iconLocation, 3);
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE, 3);
getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3);
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3);
}
/**
@ -757,7 +767,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
widthArray = calculateWidthArray();
int width = widthArray[i];
textX += width + 1;
int operationWidth = GRAP + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度
if (i < widthArray.length - 1 && textX + widthArray[i + 1] + 1 > maxWidth) {
isOvertakeWidth = true;

Loading…
Cancel
Save