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