|
|
@ -24,6 +24,7 @@ import javax.swing.UIManager; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
|
|
|
|
import com.fr.base.svg.SVGIcon; |
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
@ -57,14 +58,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
|
|
|
|
|
|
|
|
private static final Color LINE_COLOR = new Color(0xababab); |
|
|
|
private static final Color LINE_COLOR = new Color(0xababab); |
|
|
|
|
|
|
|
|
|
|
|
private static final Icon ADD_WORK_SHEET = IOUtils.readIcon("com/fr/base/images/oem/addworksheet.png"); |
|
|
|
private static final Icon ADD_WORK_SHEET = SVGIcon.readSVGIcon("com/fr/base/images/oem/add_worksheet_normal.svg", 22, 12); |
|
|
|
protected static final Icon ADD_POLY_SHEET = IOUtils.readIcon("com/fr/design/images/sheet/addpolysheet.png"); |
|
|
|
protected static final Icon ADD_POLY_SHEET = SVGIcon.readSVGIcon("com/fr/design/images/sheet/add_polysheet_normal.svg", 22, 12); |
|
|
|
private static final Icon WORK_SHEET_ICON = IOUtils.readIcon("com/fr/base/images/oem/worksheet.png"); |
|
|
|
private static final Icon WORK_SHEET_ICON = SVGIcon.readSVGIcon("com/fr/base/images/oem/worksheet_normal.svg", 12, 12); |
|
|
|
private static final Icon POLY_SHEET_ICON = IOUtils.readIcon("com/fr/design/images/sheet/polysheet.png"); |
|
|
|
private static final Icon POLY_SHEET_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/polysheet_normal.svg", 12, 12); |
|
|
|
private static final Icon LEFT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/left_normal@1x.png"); |
|
|
|
private static final Icon LEFT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/pre_page_normal.svg"); |
|
|
|
private static final Icon RIGHT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/right_normal@1x.png"); |
|
|
|
private static final Icon RIGHT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/next_page_normal.svg"); |
|
|
|
private static final Icon DISABLED_LEFT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/left_hover@1x.png"); |
|
|
|
private static final Icon DISABLED_LEFT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/pre_page_disabled.svg"); |
|
|
|
private static final Icon DISABLED_RIGHT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/right_hover@1x.png"); |
|
|
|
private static final Icon DISABLED_RIGHT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/next_page_disabled.svg"); |
|
|
|
private static final int NUM = 10; |
|
|
|
private static final int NUM = 10; |
|
|
|
|
|
|
|
|
|
|
|
private static final int ICON_SEP_DISTANCE = 8; |
|
|
|
private static final int ICON_SEP_DISTANCE = 8; |
|
|
@ -134,7 +135,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
* 编辑的对象实例 |
|
|
|
* 编辑的对象实例 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private ReportComponentComposite reportComposite; |
|
|
|
private ReportComponentComposite reportComposite; |
|
|
|
|
|
|
|
|
|
|
|
private int selectedIndex = -1; |
|
|
|
private int selectedIndex = -1; |
|
|
|
|
|
|
|
|
|
|
|
private JPanel buttonPane; |
|
|
|
private JPanel buttonPane; |
|
|
@ -332,7 +333,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
leftButton.setEnabled(buttonEnabled); |
|
|
|
leftButton.setEnabled(buttonEnabled); |
|
|
|
rightButton.setEnabled(buttonEnabled); |
|
|
|
rightButton.setEnabled(buttonEnabled); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 抽出来方便OEM |
|
|
|
* 抽出来方便OEM |
|
|
|
* @return |
|
|
|
* @return |
|
|
@ -417,10 +418,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
|
|
|
|
|
|
|
|
// 画两个添加sheet图标
|
|
|
|
// 画两个添加sheet图标
|
|
|
|
iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; |
|
|
|
iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; |
|
|
|
|
|
|
|
|
|
|
|
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() + ICON_SEP_DISTANCE, 3); |
|
|
|
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); |
|
|
@ -626,7 +627,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
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); |
|
|
@ -636,14 +637,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
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 + GRID_TOSHEET_RIGHT) { |
|
|
|
if (evtX > iconLocation && evtX < iconLocation + GRID_TOSHEET_RIGHT) { |
|
|
|
firstInsertActionPerformed(); |
|
|
|
firstInsertActionPerformed(); |
|
|
|
} else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) { |
|
|
|
} else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) { |
|
|
|
new PolyReportInsertAction().actionPerformed(null); |
|
|
|
new PolyReportInsertAction().actionPerformed(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void addInsertGridShortCut(MenuDef def){ |
|
|
|
protected void addInsertGridShortCut(MenuDef def){ |
|
|
@ -847,7 +848,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected class GridReportInsertAction extends SheetInsertAction { |
|
|
|
protected class GridReportInsertAction extends SheetInsertAction { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected TemplateReport newTemplateReport() { |
|
|
|
protected TemplateReport newTemplateReport() { |
|
|
|
return new WorkSheet(); |
|
|
|
return new WorkSheet(); |
|
|
|