|
|
|
@ -201,8 +201,9 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
listener = new ComponentAdapter(){ |
|
|
|
|
@Override public void componentResized(ComponentEvent e) { |
|
|
|
|
listener = new ComponentAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void componentResized(ComponentEvent e) { |
|
|
|
|
for (int i = 0; i < lastOneIndex * NUM; i++) { |
|
|
|
|
moveLeft(); |
|
|
|
|
} |
|
|
|
@ -277,7 +278,7 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
* @param oldIndex |
|
|
|
|
*/ |
|
|
|
|
protected void doBeforeChange(int oldIndex) { |
|
|
|
|
reportComposite.doBeforeChange(oldIndex); |
|
|
|
|
reportComposite.doBeforeChange(oldIndex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -286,7 +287,7 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
* @param newIndex |
|
|
|
|
*/ |
|
|
|
|
protected void doAfterChange(int newIndex) { |
|
|
|
|
reportComposite.doAfterChange(newIndex); |
|
|
|
|
reportComposite.doAfterChange(newIndex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -328,10 +329,11 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 抽出来方便OEM |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Icon getAddWorkSheet(){ |
|
|
|
|
return ADD_WORK_SHEET; |
|
|
|
|
public Icon getAddWorkSheet() { |
|
|
|
|
return ADD_WORK_SHEET; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -368,8 +370,10 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
|
|
|
|
|
private void paintBackgroundAndLine(Graphics2D g2d, double textHeight, double maxWidth, int charWidth, int textAscent) { |
|
|
|
|
|
|
|
|
|
int arc = FineUIUtils.getAndScaleInt("Center.arc", 10) / 2; |
|
|
|
|
Path2D roundedPath = FineUIUtils.createPartRoundRectangle(0, 0, this.getWidth(), this.getHeight(), 0, 0, 0, arc); |
|
|
|
|
int arc = FineUIUtils.getAndScaleInt("Center.arc", 8); |
|
|
|
|
Path2D roundedPath = FineUIUtils.createPartRoundRectangle(0, 0, |
|
|
|
|
this.getWidth(), this.getHeight(), |
|
|
|
|
0, 0, 0, arc); |
|
|
|
|
FlatUIUtils.setRenderingHints(g2d); |
|
|
|
|
g2d.setColor(getBackground()); |
|
|
|
|
g2d.fill(roundedPath); |
|
|
|
@ -415,8 +419,8 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
paintAddButton(g2d); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void paintAddButton(Graphics2D g2d){ |
|
|
|
|
getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); |
|
|
|
|
protected void paintAddButton(Graphics2D g2d) { |
|
|
|
|
getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); |
|
|
|
|
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + iconSepDistance, 3); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -559,41 +563,41 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (SwingUtilities.isLeftMouseButton(evt)) { |
|
|
|
|
processLeftMouseButton(evtX); |
|
|
|
|
processLeftMouseButton(evtX); |
|
|
|
|
} |
|
|
|
|
if (isBlank) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (SwingUtilities.isRightMouseButton(evt) && !isAuthorityEditing) { |
|
|
|
|
processRightMouseButton(evtX, evtY); |
|
|
|
|
processRightMouseButton(evtX, evtY); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void processRightMouseButton(int evtX, int evtY){ |
|
|
|
|
private void processRightMouseButton(int evtX, int evtY) { |
|
|
|
|
MenuDef def = new MenuDef(); |
|
|
|
|
addInsertGridShortCut(def); |
|
|
|
|
def.addShortCut(new PolyReportInsertAction(), SeparatorDef.DEFAULT, new RemoveSheetAction(), new RenameSheetAction(), |
|
|
|
|
new CopySheetAction()); |
|
|
|
|
def.addShortCut(new PolyReportInsertAction(), SeparatorDef.DEFAULT, new RemoveSheetAction(), new RenameSheetAction(), |
|
|
|
|
new CopySheetAction()); |
|
|
|
|
JPopupMenu tabPop = def.createJMenu().getPopupMenu(); |
|
|
|
|
def.updateMenu(); |
|
|
|
|
GUICoreUtils.showPopupMenu(tabPop, this, evtX - 1, evtY - 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void processLeftMouseButton(int evtX){ |
|
|
|
|
private void processLeftMouseButton(int evtX) { |
|
|
|
|
if (evtX > iconLocation && evtX < iconLocation + scale(GRID_TOSHEET_RIGHT)) { |
|
|
|
|
firstInsertActionPerformed(); |
|
|
|
|
firstInsertActionPerformed(); |
|
|
|
|
} else if (evtX > iconLocation + scale(POLY_TOSHEET_LEFT) && evtX < iconLocation + scale(POLY_TOSHEET_RIGHT)) { |
|
|
|
|
new PolyReportInsertAction().actionPerformed(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void addInsertGridShortCut(MenuDef def){ |
|
|
|
|
def.addShortCut(new GridReportInsertAction()); |
|
|
|
|
protected void addInsertGridShortCut(MenuDef def) { |
|
|
|
|
def.addShortCut(new GridReportInsertAction()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void firstInsertActionPerformed(){ |
|
|
|
|
new GridReportInsertAction().actionPerformed(null); |
|
|
|
|
protected void firstInsertActionPerformed() { |
|
|
|
|
new GridReportInsertAction().actionPerformed(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -645,7 +649,7 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
* 右移动 |
|
|
|
|
* |
|
|
|
|
* @param moveRighttDistance 右侧移动距离 |
|
|
|
|
* @param si 宽度坐标 |
|
|
|
|
* @param si 宽度坐标 |
|
|
|
|
*/ |
|
|
|
|
private void move2Right(int moveRighttDistance, int si) { |
|
|
|
|
int reportcount = reportComposite.getEditingWorkBook().getReportCount(); |
|
|
|
@ -671,7 +675,7 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
* 左移动 |
|
|
|
|
* |
|
|
|
|
* @param moveLeftDistance 左侧距离 |
|
|
|
|
* @param si 宽度坐标 |
|
|
|
|
* @param si 宽度坐标 |
|
|
|
|
*/ |
|
|
|
|
private void move2Left(int moveLeftDistance, int si) { |
|
|
|
|
if (selectedIndex > 0) { |
|
|
|
@ -746,7 +750,7 @@ public class SheetNameTabPane extends JPanel implements MouseListener, MouseMoti
|
|
|
|
|
scrollIndex++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
TemplateTheme theme = template.getTemplateTheme(); |
|
|
|
|
|
|
|
|
|
TemplateReport templateReport = newTemplateReport(); |
|
|
|
|