/** Init the SIF ui factory */ private void initSIF() { UIFactory.setDefaultImageIcon(OrbisGISIcon.getIcon("orbisgis")); // Load SIF properties try { UIFactory.loadState(new File(viewWorkspace.getSIFPath())); } catch (IOException ex) { LOGGER.error(I18N.tr("Error while loading dialogs informations."), ex); } }
/** Initialize all the buttons that can be used to manage the tree content. */ private void initButtons() { toolBar = new JToolBar(); toolBar.setFloatable(false); jButtonMenuUp = new JButton(); jButtonMenuUp.setIcon(OrbisGISIcon.getIcon("go-up")); jButtonMenuUp.setToolTipText(I18N.tr("Up")); ActionListener alu = EventHandler.create(ActionListener.class, this, "moveSelectedElementUp"); jButtonMenuUp.addActionListener(alu); toolBar.add(jButtonMenuUp); jButtonMenuDown = new JButton(); jButtonMenuDown.setIcon(OrbisGISIcon.getIcon("go-down")); jButtonMenuDown.setToolTipText(I18N.tr("Down")); ActionListener ald = EventHandler.create(ActionListener.class, this, "moveSelectedElementDown"); jButtonMenuDown.addActionListener(ald); toolBar.add(jButtonMenuDown); JButton jButtonMenuAdd = new JButton(); jButtonMenuAdd.setIcon(OrbisGISIcon.getIcon("picture_add")); jButtonMenuAdd.setToolTipText(I18N.tr("Add")); ActionListener aladd = EventHandler.create(ActionListener.class, this, "addElement"); jButtonMenuAdd.addActionListener(aladd); jButtonMenuAdd.setFocusPainted(false); toolBar.add(jButtonMenuAdd); jButtonMenuDel = new JButton(); jButtonMenuDel.setIcon(OrbisGISIcon.getIcon("picture_delete")); jButtonMenuDel.setToolTipText(I18N.tr("Delete")); ActionListener alrem = EventHandler.create(ActionListener.class, this, "removeSelectedElement"); jButtonMenuDel.addActionListener(alrem); toolBar.add(jButtonMenuDel); jButtonMenuRename = new JButton(); jButtonMenuRename.setIcon(OrbisGISIcon.getIcon("picture_edit")); jButtonMenuRename.setToolTipText(I18N.tr("Rename")); jButtonMenuRename.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { renameElement(evt); } }); toolBar.add(jButtonMenuRename); }
/** Add new menu to the OrbisGIS core */ private void addCoreMenu() { DefaultAction def = new DefaultAction( MainFrameAction.MENU_SAVE, I18N.tr("&Save"), OrbisGISIcon.getIcon("save"), EventHandler.create(ActionListener.class, this, "onMenuSaveApplication")); def.setParent(MainFrameAction.MENU_FILE).setBefore(MainFrameAction.MENU_EXIT); mainFrame.addMenu(def); def.setToolTipText(I18N.tr("Save the workspace")); JButton saveBt = new CustomButton(def); saveBt.setHideActionText(true); mainFrame.addToolBarComponent(saveBt, "align left"); }
/** * Constructor * * @param extension MapEditor instance */ public ActionUndo(MapEditorExtension extension) { super(ToolBarAction.DRAW_UNDO, I18N.tr("Undo"), extension, OrbisGISIcon.getIcon("edit-undo")); putValue(SHORT_DESCRIPTION, I18N.tr("Undo the last modification")); setLogicalGroup(ToolBarAction.DRAWING_GROUP); }