Пример #1
0
 /** enable / disable Print & Export menu items */
 private void setExportingEnabled(boolean value) {
   ClientMenu cm = mapPanel.getClientFrame().getClientMenu();
   cm.setEnabled(ClientMenu.FILE_PRINT, value);
   cm.setEnabled(ClientMenu.FILE_EXPORT_JPG, value);
   cm.setEnabled(ClientMenu.FILE_EXPORT_PNG, value);
   cm.setEnabled(ClientMenu.FILE_EXPORT_SVG, value);
   cm.setEnabled(ClientMenu.FILE_EXPORT_PDF, value);
 } // setExportingEnabled()
Пример #2
0
  /** register us with Print & Export menu items */
  private void registerExportItems() {
    // remove any pre-existing listeners for these items
    ClientMenu cm = mapPanel.getClientFrame().getClientMenu();

    JMenuItem mi = cm.getMenuItem(ClientMenu.FILE_PRINT);
    removeActionListeners(mi);
    mi.addActionListener(new MapPanelSVGAction.Print(mapPanel));

    mi = cm.getMenuItem(ClientMenu.FILE_EXPORT_JPG);
    removeActionListeners(mi);
    mi.addActionListener(new MapPanelSVGAction.ExportJPG(mapPanel));

    mi = cm.getMenuItem(ClientMenu.FILE_EXPORT_PNG);
    removeActionListeners(mi);
    mi.addActionListener(new MapPanelSVGAction.ExportPNG(mapPanel));

    mi = cm.getMenuItem(ClientMenu.FILE_EXPORT_PDF);
    removeActionListeners(mi);
    mi.addActionListener(new MapPanelSVGAction.ExportPDF(mapPanel));

    mi = cm.getMenuItem(ClientMenu.FILE_EXPORT_SVG);
    removeActionListeners(mi);
    mi.addActionListener(new MapPanelSVGAction.ExportSVG(mapPanel));
  } // registerExportItems()