List of usage examples for javax.swing JTabbedPane getSelectedIndex
@Transient public int getSelectedIndex()
From source file:net.rptools.maptool.launcher.MapToolLauncher.java
/** * This method is called from within the constructor to initialize the form * components.//w w w . j a v a 2s.c o m */ private void initComponents() { // Lee: for aesthetics and Linux won't display window controls on an untitled window. final String version = CopiedFromOtherJars.getVersion(); setTitle(CopiedFromOtherJars.getText("msg.title.mainWindow", version)); //$NON-NLS-1$ if (jbPathText == null) jbPathText = CopiedFromOtherJars.getText("msg.info.setJavaVersion"); //$NON-NLS-1$ if (jbMTJarText == null) jbMTJarText = CopiedFromOtherJars.getText("msg.info.selectMapToolJar"); //$NON-NLS-1$ if (mapToolJarName == null) mapToolJarName = CopiedFromOtherJars.getText("msg.info.selectMapToolJar"); //$NON-NLS-1$ final Container cp = getContentPane(); cp.setLayout(new BorderLayout()); final JPanel basicPanel = buildBasicPanel(); final JPanel langPanel = buildLanguagePanel(); final JPanel advancedPanel = buildAdvancedPanel(); final JPanel tsPanel = buildTroubleshootingPanel(); mtlOptions.addTab(CopiedFromOtherJars.getText("msg.tab.basic"), basicPanel); //$NON-NLS-1$ mtlOptions.addTab(CopiedFromOtherJars.getText("msg.tab.language"), langPanel); //$NON-NLS-1$ mtlOptions.addTab(CopiedFromOtherJars.getText("msg.tab.advanced"), advancedPanel); //$NON-NLS-1$ mtlOptions.addTab(CopiedFromOtherJars.getText("msg.tab.troubleshoot"), tsPanel); //$NON-NLS-1$ cp.add(mtlOptions, BorderLayout.CENTER); cp.add(jtfCommand, BorderLayout.SOUTH); // Lee: user must register MT executable jbLaunch.setEnabled( !mapToolJarName.equalsIgnoreCase(CopiedFromOtherJars.getText("msg.info.selectMapToolJar"))); //$NON-NLS-1$ jbLaunch.setText(CopiedFromOtherJars.getText("msg.info.launchMapTool")); //$NON-NLS-1$ jbLaunch.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { jbLaunchActionPerformed(evt); } catch (final IOException e) { e.printStackTrace(); } } }); jtfCommand.setEditable(false); jtfCommand.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); jtfCommand.setText(CopiedFromOtherJars.getText("msg.info.cmdLineShownHere")); //$NON-NLS-1$ jtfCommand.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent arg0) { jtfCommand.selectAll(); } @Override public void focusLost(FocusEvent arg0) { jtfCommand.setCaretPosition(0); } }); jcbKeepOpen.setSelected(false); jcbKeepOpen.setText(CopiedFromOtherJars.getText("msg.info.keepLauncherOpen")); //$NON-NLS-1$ jcbKeepOpen.setToolTipText(CopiedFromOtherJars.getText("msg.tooltip.keepLauncherOpen")); //$NON-NLS-1$ final JPanel lowerPanel = new JPanel(); lowerPanel.setLayout(new GridLayout(3, 1)); lowerPanel.setBorder(new LineBorder(Color.BLACK)); lowerPanel.add(jbLaunch); lowerPanel.add(jcbKeepOpen); lowerPanel.add(jtfCommand); cp.add(lowerPanel, BorderLayout.SOUTH); mtlOptions.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { final JTabbedPane source = (JTabbedPane) e.getSource(); final String tabName = source.getTitleAt(source.getSelectedIndex()); if (jbLaunch.isEnabled()) { jbLaunch.requestFocusInWindow(); } else { if (tabName.equals(CopiedFromOtherJars.getText("msg.tab.basic"))) { //$NON-NLS-1$ jbMTJar.requestFocusInWindow(); } else if (tabName.equals(CopiedFromOtherJars.getText("msg.tab.language"))) { //$NON-NLS-1$ // This should work as long as there's at least one language in the list. langGroup.getElements().nextElement().requestFocusInWindow(); } else if (tabName.equals(CopiedFromOtherJars.getText("msg.tab.advanced"))) { //$NON-NLS-1$ jcbConsole.requestFocusInWindow(); jtfArgs.setText(extraArgs); } else { jcbEnableAssertions.requestFocusInWindow(); } } } }); Dimension d = new Dimension(advancedPanel.getPreferredSize().width, 25); jtfArgs.setPreferredSize(d); // mtlOptions.setPreferredSize(new Dimension(350, getPreferredSize().height)); d.width = -1; d.height = -1; JLabel tabLabel = null; int tabs = mtlOptions.getTabCount(); while (tabs-- > 0) { Component tab = mtlOptions.getTabComponentAt(tabs); if (tab == null) { if (tabLabel == null) tabLabel = new JLabel(); tabLabel.setText(mtlOptions.getTitleAt(tabs)); tab = tabLabel; } Dimension dim = tab.getPreferredSize(); d.width = Math.max(dim.width, d.width); d.height = Math.max(dim.height, d.height); } // Set width to width of largest tab * number of tabs, then add 20%. d.width = d.width * 120 / 100 * mtlOptions.getTabCount(); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setIconImage(icon.getImage()); // To prevent the tabs from wrapping or scrolling setMinimumSize(new Dimension(d.width, getSize().height)); pack(); setResizable(true); }
From source file:grupob.TipoProceso.java
public TipoProceso() { initComponents();/*from w ww .j ava 2 s . co m*/ initInstitucional(); // listaRegiones.add(new Region(1,"Lima",15000)); // listaRegiones.add(new Region(1,"Arequipa",10000)); // listaRegiones.add(new Region(1,"Junin",12000)); TipoProcesoVotacion tipoNacional = Manager.queryProcesoById(1); TipoProcesoVotacion tipoRegional = Manager.queryProcesoById(2); TipoProcesoVotacion tipoDistrital = Manager.queryProcesoById(3); Calendar cal = Calendar.getInstance(); Date dateActual = cal.getTime(); textConfGeneral.setText(Recorte.rutaGeneral); textConfHuellas.setText(Recorte.rutaHuella); textConfFirmas.setText(Recorte.rutaFirma); /* Recorte.rutaGeneral = FramePrincipal.rutaGeneral; Recorte.rutaHuella = FramePrincipal.rutaHuella; Recorte.rutaFirma = FramePrincipal.rutaFirma;*/ if (tipoNacional != null && tipoNacional.getId() != 0) { if (!tipoNacional.getFechaInicio2().after(dateActual)) { fechai1Nacional.setDate(tipoNacional.getFechaInicio1().getTime()); fechai2Nacional.setDate(tipoNacional.getFechaInicio2().getTime()); fechaf1Nacional.setDate(tipoNacional.getFechaFin1().getTime()); fechaf2Nacional.setDate(tipoNacional.getFechaFin2().getTime()); } if ((tipoNacional.getFechaInicio1().before(dateActual)) && (cal.before(tipoNacional.getFechaFin2()))) { botonGuardarNacional.setEnabled(false); } if (tipoNacional.getFechaFin2().before(dateActual)) { botonGuardarNacional.setEnabled(true); } } if (tipoRegional != null && tipoRegional.getId() != 0) { if (!tipoRegional.getFechaInicio2().after(dateActual)) { fechai1Regiones.setDate(tipoRegional.getFechaInicio1().getTime()); fechai2Regiones.setDate(tipoRegional.getFechaInicio2().getTime()); fechaf1Regiones.setDate(tipoRegional.getFechaFin1().getTime()); fechaf2Regiones.setDate(tipoRegional.getFechaFin2().getTime()); porcentajeRegional.setText("" + tipoRegional.getPorcentajeMinimo() * 100); } if ((tipoRegional.getFechaInicio1().before(dateActual)) && (cal.before(tipoRegional.getFechaFin2()))) { botonGuardarRegional.setEnabled(false); } if (tipoRegional.getFechaFin2().before(dateActual)) { botonGuardarRegional.setEnabled(true); } } if (tipoDistrital != null && tipoDistrital.getId() != 0) { if (!tipoRegional.getFechaInicio2().after(dateActual)) { fechai1Distritos.setDate(tipoDistrital.getFechaInicio1().getTime()); fechai2Distritos.setDate(tipoDistrital.getFechaInicio2().getTime()); fechaf1Distritos.setDate(tipoDistrital.getFechaFin1().getTime()); fechaf2Distritos.setDate(tipoDistrital.getFechaFin2().getTime()); porcentajeDistrital.setText("" + tipoDistrital.getPorcentajeMinimo() * 100); } if ((tipoDistrital.getFechaInicio1().before(dateActual)) && (cal.before(tipoDistrital.getFechaFin2()))) { botonGuardarDistrital.setEnabled(false); // addRowRegional.setEnabled(false); // jTable6.setEnabled(false); } if (tipoDistrital.getFechaFin2().before(dateActual)) { botonGuardarDistrital.setEnabled(true); // addRowRegional.setEnabled(true); } } agregarDatos(); agregarDatosDistritos(); if (listaRegiones != null) { jTableRegiones.getColumn("Eliminar").setCellRenderer(new ButtonRenderer()); jTableRegiones.getColumn("Eliminar").setCellEditor(new botonEliminarRegiones()); } if (listaDistritos != null) { jTableDistritos.getColumn("Eliminar").setCellRenderer(new ButtonRenderer()); jTableDistritos.getColumn("Eliminar").setCellEditor(new botonEliminarDistritos()); } TableColumn sColumn = jTableDistritos.getColumnModel().getColumn(2); ArrayList<Region> lReg = Manager.queryAllRegion(); JComboBox comboBox = new JComboBox(); for (int i = 0; i < lReg.size(); i++) { comboBox.addItem(lReg.get(i).getNombre()); } sColumn.setCellEditor(new DefaultCellEditor(comboBox)); TableColumn instColumn = tblInstitucional.getColumnModel().getColumn(2); ArrayList<Local> lLoc = Manager.queryAllLocales(); JComboBox comboBoxLocal = new JComboBox(); for (int i = 0; i < lLoc.size(); i++) { comboBoxLocal.addItem(lLoc.get(i).getNombre()); } instColumn.setCellEditor(new DefaultCellEditor(comboBoxLocal)); ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { JTabbedPane sourceTabbedPane = (JTabbedPane) e.getSource(); int index = sourceTabbedPane.getSelectedIndex(); switch (index) { case 3: cargarDatosLocal(); return; default: return; } } }; jconfiguracion.addChangeListener(changeListener); }
From source file:net.pms.newgui.LooksFrame.java
public JComponent buildMain() { final JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP); tabbedPane.setUI(new CustomTabbedPaneUI()); st = new StatusTab(configuration); tt = new TracesTab(configuration, this); gt = new GeneralTab(configuration, this); nt = new NavigationShareTab(configuration, this); tr = new TranscodingTab(configuration, this); ht = new HelpTab(); tabbedPane.addTab(Messages.getString("LooksFrame.18"), st.build()); tabbedPane.addTab(Messages.getString("LooksFrame.19"), tt.build()); tabbedPane.addTab(Messages.getString("LooksFrame.20"), gt.build()); tabbedPane.addTab(Messages.getString("LooksFrame.22"), nt.build()); if (!configuration.isDisableTranscoding()) { tabbedPane.addTab(Messages.getString("LooksFrame.21"), tr.build()); } else {//from w w w . jav a2s . c o m tr.build(); } tabbedPane.addTab(Messages.getString("LooksFrame.24"), new HelpTab().build()); tabbedPane.addTab(Messages.getString("LooksFrame.25"), new AboutTab().build()); tabbedPane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { int selectedIndex = tabbedPane.getSelectedIndex(); if (HELP_PAGES[selectedIndex] != null) { PMS.setHelpPage(HELP_PAGES[selectedIndex]); // Update the contents of the help tab itself ht.updateContents(); } } }); tabbedPane.setBorder(new EmptyBorder(5, 5, 5, 5)); /* * Set the orientation of the tabbedPane. * Note: Do not use applyComponentOrientation() here because it * messes with the layout of several tabs. */ ComponentOrientation orientation = ComponentOrientation.getOrientation(PMS.getLocale()); tabbedPane.setComponentOrientation(orientation); return tabbedPane; }
From source file:com.net2plan.gui.tools.GUINetworkDesign.java
@Override public void configure(JPanel contentPane) { this.currentNetPlan = new NetPlan(); BidiMap<NetworkLayer, Integer> mapLayer2VisualizationOrder = new DualHashBidiMap<>(); Map<NetworkLayer, Boolean> layerVisibilityMap = new HashMap<>(); for (NetworkLayer layer : currentNetPlan.getNetworkLayers()) { mapLayer2VisualizationOrder.put(layer, mapLayer2VisualizationOrder.size()); layerVisibilityMap.put(layer, true); }//w w w . j a va 2 s.com this.vs = new VisualizationState(currentNetPlan, mapLayer2VisualizationOrder, layerVisibilityMap, MAXSIZEUNDOLISTPICK); topologyPanel = new TopologyPanel(this, JUNGCanvas.class); JPanel leftPane = new JPanel(new BorderLayout()); JPanel logSection = configureLeftBottomPanel(); if (logSection == null) { leftPane.add(topologyPanel, BorderLayout.CENTER); } else { JSplitPane splitPaneTopology = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPaneTopology.setTopComponent(topologyPanel); splitPaneTopology.setBottomComponent(logSection); splitPaneTopology.addPropertyChangeListener(new ProportionalResizeJSplitPaneListener()); splitPaneTopology.setBorder(new LineBorder(contentPane.getBackground())); splitPaneTopology.setOneTouchExpandable(true); splitPaneTopology.setDividerSize(7); leftPane.add(splitPaneTopology, BorderLayout.CENTER); } contentPane.add(leftPane, "grow"); viewEditTopTables = new ViewEditTopologyTablesPane(GUINetworkDesign.this, new BorderLayout()); reportPane = new ViewReportPane(GUINetworkDesign.this, JSplitPane.VERTICAL_SPLIT); setCurrentNetPlanDoNotUpdateVisualization(currentNetPlan); Pair<BidiMap<NetworkLayer, Integer>, Map<NetworkLayer, Boolean>> res = VisualizationState .generateCanvasDefaultVisualizationLayerInfo(getDesign()); vs.setCanvasLayerVisibilityAndOrder(getDesign(), res.getFirst(), res.getSecond()); /* Initialize the undo/redo manager, and set its initial design */ this.undoRedoManager = new UndoRedoManager(this, MAXSIZEUNDOLISTCHANGES); this.undoRedoManager.addNetPlanChange(); onlineSimulationPane = new OnlineSimulationPane(this); executionPane = new OfflineExecutionPanel(this); whatIfAnalysisPane = new WhatIfAnalysisPane(this); // Closing windows WindowUtils.clearFloatingWindows(); final JTabbedPane tabPane = new JTabbedPane(); tabPane.add(WindowController.WindowToTab.getTabName(WindowController.WindowToTab.network), viewEditTopTables); tabPane.add(WindowController.WindowToTab.getTabName(WindowController.WindowToTab.offline), executionPane); tabPane.add(WindowController.WindowToTab.getTabName(WindowController.WindowToTab.online), onlineSimulationPane); tabPane.add(WindowController.WindowToTab.getTabName(WindowController.WindowToTab.whatif), whatIfAnalysisPane); tabPane.add(WindowController.WindowToTab.getTabName(WindowController.WindowToTab.report), reportPane); // Installing customized mouse listener MouseListener[] ml = tabPane.getListeners(MouseListener.class); for (int i = 0; i < ml.length; i++) { tabPane.removeMouseListener(ml[i]); } // Left click works as usual, right click brings up a pop-up menu. tabPane.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { JTabbedPane tabPane = (JTabbedPane) e.getSource(); int tabIndex = tabPane.getUI().tabForCoordinate(tabPane, e.getX(), e.getY()); if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) { if (tabIndex == tabPane.getSelectedIndex()) { if (tabPane.isRequestFocusEnabled()) { tabPane.requestFocus(); tabPane.repaint(tabPane.getUI().getTabBounds(tabPane, tabIndex)); } } else { tabPane.setSelectedIndex(tabIndex); } if (!tabPane.isEnabled() || SwingUtilities.isRightMouseButton(e)) { final JPopupMenu popupMenu = new JPopupMenu(); final JMenuItem popWindow = new JMenuItem("Pop window out"); popWindow.addActionListener(e1 -> { final int selectedIndex = tabPane.getSelectedIndex(); final String tabName = tabPane.getTitleAt(selectedIndex); final JComponent selectedComponent = (JComponent) tabPane.getSelectedComponent(); // Pops up the selected tab. final WindowController.WindowToTab windowToTab = WindowController.WindowToTab .parseString(tabName); if (windowToTab != null) { switch (windowToTab) { case offline: WindowController.buildOfflineWindow(selectedComponent); WindowController.showOfflineWindow(true); break; case online: WindowController.buildOnlineWindow(selectedComponent); WindowController.showOnlineWindow(true); break; case whatif: WindowController.buildWhatifWindow(selectedComponent); WindowController.showWhatifWindow(true); break; case report: WindowController.buildReportWindow(selectedComponent); WindowController.showReportWindow(true); break; default: return; } } tabPane.setSelectedIndex(0); }); // Disabling the pop up button for the network state tab. if (WindowController.WindowToTab.parseString(tabPane .getTitleAt(tabPane.getSelectedIndex())) == WindowController.WindowToTab.network) { popWindow.setEnabled(false); } popupMenu.add(popWindow); popupMenu.show(e.getComponent(), e.getX(), e.getY()); } } } }); // Building windows WindowController.buildTableControlWindow(tabPane); WindowController.showTablesWindow(false); addAllKeyCombinationActions(); updateVisualizationAfterNewTopology(); }
From source file:com.emental.mindraider.ui.frames.MindRaiderMainWindow.java
private MindRaiderMainWindow() { super(MindRaider.getTitle(), Gfx.getGraphicsConfiguration()); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);/*from w ww. j av a2 s . com*/ } }); // catch resize addComponentListener(this); configuration = new ConfigurationBean(); // drag & drop registration DropTarget dropTarget = new DropTarget(this, (DropTargetListener) this); this.setDropTarget(dropTarget); // warn on different java version // checkJavaVersion(); singleton = this; setIconImage(IconsRegistry.getImage("programIcon.gif")); SplashScreen splash = new SplashScreen(this, false); splash.showSplashScreen(); // kernel init MindRaider.preSetProfiles(); // message in here because of locales logger.debug(Messages.getString("MindRaiderJFrame.bootingKernel")); // master control panel MindRaider.setMasterToolBar(new MasterToolBar()); getContentPane().add(MindRaider.masterToolBar, BorderLayout.NORTH); // status bar getContentPane().add(StatusBar.getStatusBar(), BorderLayout.SOUTH); // build menu buildMenu(MindRaider.spidersGraph); // profile MindRaider.setProfiles(); // left sidebar: folder/notebooks hierarchy, taxonomies, ... final JTabbedPane leftSidebar = new JTabbedPane(SwingConstants.BOTTOM); leftSidebar.setTabPlacement(SwingConstants.TOP); // TODO add icons to tabs leftSidebar.addTab(Messages.getString("MindRaiderJFrame.explorer"), ExplorerJPanel.getInstance()); // TODO just blank panel //leftSidebar.addTab("Tags",new OutlookBarMain()); leftSidebar.addTab( Messages.getString("MindRaiderJFrame.trash"), /* IconsRegistry.getImageIcon("trashFull.png"), */ TrashJPanel.getInstance()); leftSidebar.setSelectedIndex(0); leftSidebar.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { if (arg0.getSource() instanceof JTabbedPane) { if (leftSidebar.getSelectedIndex() == 1) { // refresh trash TrashJPanel.getInstance().refresh(); } } } }); // main panel: (notebook outline & RDF Navigator) + Control panel JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(OutlineJPanel.getInstance(), BorderLayout.CENTER); // split: left sidebar/main panel leftSidebarSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSidebar, mainPanel); leftSidebarSplitPane.setOneTouchExpandable(true); leftSidebarSplitPane.setDividerLocation(200); leftSidebarSplitPane.setLastDividerLocation(200); leftSidebarSplitPane.setDividerSize(6); leftSidebarSplitPane.setContinuousLayout(true); getContentPane().add(leftSidebarSplitPane, BorderLayout.CENTER); Gfx.centerAndShowWindow(this, 1024, 768); MindRaider.postSetProfiles(); if (!configuration.isShowSpidersTagSnailPane()) { OutlineJPanel.getInstance().hideSpiders(); } splash.hideSplash(); }
From source file:GUI.MainWindow.java
private void ViewModeTabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ViewModeTabPaneStateChanged JTabbedPane sourceTabbedPane = (JTabbedPane) evt.getSource(); int index = sourceTabbedPane.getSelectedIndex(); String title = sourceTabbedPane.getTitleAt(index); System.out.println("Tab changed to: " + sourceTabbedPane.getTitleAt(index)); Object layout = RightPanelCardLayout.getLayout(); if (layout instanceof java.awt.CardLayout) { java.awt.CardLayout cl = (java.awt.CardLayout) layout; if (title.equalsIgnoreCase("Vuln View")) { // Show the vuln view card cl.show(RightPanelCardLayout, "vulnView"); } else if (title.equalsIgnoreCase("Host View")) { DefaultMutableTreeNode hostRoot = new TreeUtils() .convertVulnViewToHostView((DefaultMutableTreeNode) this.VulnTree.getModel().getRoot()); DefaultTreeModel dtm = ((DefaultTreeModel) this.HostTree.getModel()); dtm.setRoot(hostRoot);//from w w w . j a va 2 s . c om dtm.reload(hostRoot); // Expand all nodes to make everything visible new TreeUtils().expandAll(this.HostTree); // Show the host view card cl.show(RightPanelCardLayout, "hostView"); } } //cardLayout.show(cardPanel, "CardToShow"); //java.awt.CardLayout cl = (java.awt.CardLayout)(RightPanelCardLayout.getLayout()) ; // }
From source file:ffx.ui.MainPanel.java
/** * {@inheritDoc}/*w w w . ja v a 2 s.c o m*/ */ @Override public void stateChanged(ChangeEvent evt) { JTabbedPane jtp = (JTabbedPane) evt.getSource(); int index = jtp.getSelectedIndex(); if (index == 0) { graphicsCanvas.selected(); } else if (index == 1) { keywordPanel.selected(); } else if (index == 2) { modelingPanel.selected(); } }
From source file:edu.ku.brc.specify.tasks.subpane.security.SecurityAdminPane.java
/** * /*from w w w.j a va 2s. c om*/ */ private void createUserPanel() { final EditorPanel infoPanel = new EditorPanel(this); final CellConstraints cc = new CellConstraints(); PermissionEditor prefsEdt = new PermissionEditor("SEC_PREFS", new PrefsPermissionEnumerator(), infoPanel, false, "SEC_NAME_TITLE", "SEC_ENABLE_PREF", null, null, null); JButton selectAllBtn = createI18NButton("SELECTALL"); JButton deselectAllBtn = createI18NButton("DESELECTALL"); final PermissionPanelEditor generalEditor = new PermissionPanelEditor(selectAllBtn, deselectAllBtn); generalEditor.addPanel( new IndvPanelPermEditor("SEC_TOOLS", "SEC_TOOLS_DSC", new TaskPermissionEnumerator(), infoPanel)); generalEditor.addPanel(new PermissionEditor("SEC_TABLES", new TablePermissionEnumerator(), infoPanel)); generalEditor.addPanel(prefsEdt); final PermissionPanelEditor objEditor = new PermissionPanelEditor(selectAllBtn, deselectAllBtn); objEditor.addPanel( new IndvPanelPermEditor("SEC_DOS", "SEC_DOS_DSC", new ObjectPermissionEnumerator(), infoPanel)); // create user form ViewBasedDisplayPanel panel = createViewBasedDisplayPanelForUser(infoPanel); // create tabbed panel for different kinds of permission editing tables final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(getResourceString("SEC_GENERAL"), generalEditor); //tabbedPane.addTab("Objects", objEditor); // I18N //final PanelBuilder mainPB = new PanelBuilder(new FormLayout("f:p:g", "t:p,4px,p,5px,f:p:g,2dlu,p"), infoPanel); //setting min size for generalEditor (only px settings work.) final PanelBuilder mainPB = new PanelBuilder(new FormLayout("f:p:g", "t:p,4px,p,5px,f:[400px,p]:g,2dlu,p"), infoPanel); // lay out controls on panel int y = 1; mainPB.add(panel, cc.xy(1, y)); y += 2; mainPB.addSeparator(getResourceString("SEC_PERMS"), cc.xy(1, y)); y += 2; mainPB.add(tabbedPane, cc.xy(1, y)); y += 2; PanelBuilder saveBtnPB = new PanelBuilder(new FormLayout("f:p:g,p,2px,p,2px,p,2px,p", "p")); Viewable viewable = panel.getMultiView().getCurrentView(); JButton valBtn = FormViewObj.createValidationIndicator(viewable.getUIComponent(), viewable.getValidator()); panel.getMultiView().getCurrentValidator().setValidationBtn(valBtn); saveBtnPB.add(selectAllBtn, cc.xy(2, 1)); saveBtnPB.add(deselectAllBtn, cc.xy(4, 1)); saveBtnPB.add(valBtn, cc.xy(6, 1)); saveBtnPB.add(infoPanel.getSaveBtn(), cc.xy(8, 1)); mainPB.add(saveBtnPB.getPanel(), cc.xy(1, y)); y += 2; String className = SpecifyUser.class.getCanonicalName(); infoCards.add(infoPanel, className); AdminInfoSubPanelWrapper subPanel = new AdminInfoSubPanelWrapper(panel); subPanel.addPermissionEditor(generalEditor); subPanel.addPermissionEditor(objEditor); infoSubPanels.put(className, subPanel); editorPanels.put(className, infoPanel); selectAllBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ((PermissionPanelEditor) tabbedPane.getComponentAt(tabbedPane.getSelectedIndex())).selectAll(); } }); deselectAllBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ((PermissionPanelEditor) tabbedPane.getComponentAt(tabbedPane.getSelectedIndex())).deselectAll(); } }); }
From source file:com.mirth.connect.client.ui.ChannelPanel.java
public void initPanelPlugins() { loadPanelPlugins();/*from ww w.j av a 2 s . c om*/ switchBottomPane(); ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource(); int index = sourceTabbedPane.getSelectedIndex(); loadPanelPlugin(sourceTabbedPane.getTitleAt(index)); } }; tabPane.addChangeListener(changeListener); }
From source file:course_generator.frmMain.java
/** * This method is called to initialize the form. *//* w w w . j a v a 2 s.com*/ private void initComponents() { // -- Main windows // ------------------------------------------------------ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); // java.util.ResourceBundle bundle = // java.util.ResourceBundle.getBundle("course_generator/Bundle"); setTitle(bundle.getString("frmMain.title")); setIconImages(null); // setName("FrameMain"); // setPreferredSize(new java.awt.Dimension(812, 800)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); // -- Layout // ------------------------------------------------------------ Container paneGlobal = getContentPane(); // paneGlobal.setLayout(new GridBagLayout()); paneGlobal.setLayout(new BorderLayout()); // -- Menu bar // ---------------------------------------------------------- Create_MenuBarMain(); // -- Main toolbar // ------------------------------------------------------ Create_MainToolbar(); paneGlobal.add(ToolBarMain, BorderLayout.NORTH); // -- Status bar // ------------------------------------------------------ Create_Statusbar(); paneGlobal.add(StatusBar, BorderLayout.SOUTH); // -- Main split bar (vertical) // ----------------------------------------- SplitPaneMain = new javax.swing.JSplitPane(); paneGlobal.add(SplitPaneMain, BorderLayout.CENTER); // -- Left side of the split bar // ---------------------------------------- jPanelLeft = new javax.swing.JPanel(); jPanelLeft.setLayout(new java.awt.BorderLayout()); // -- Add the left panel to the main split panel // ------------------------ SplitPaneMain.setLeftComponent(jPanelLeft); // -- Content of the tree javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode( "Course Generator"); javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Parcours"); javax.swing.tree.DefaultMutableTreeNode treeNode3 = new javax.swing.tree.DefaultMutableTreeNode( "Utmb 2011"); javax.swing.tree.DefaultMutableTreeNode treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Montagnard"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2008"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2009"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2010"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2011"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2012"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("UCDHL2013"); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Prvu"); treeNode3.add(treeNode4); treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Fait"); treeNode3.add(treeNode4); treeNode2.add(treeNode3); treeNode1.add(treeNode2); treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Configuration"); treeNode1.add(treeNode2); // -- Tree // -------------------------------------------------------------- jTreeMain = new javax.swing.JTree(); jTreeMain.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); jTreeMain.setPreferredSize(new java.awt.Dimension(109, 25)); // -- Add the tree to a scroll panel // ------------------------------------ jScrollPaneTree = new javax.swing.JScrollPane(); jScrollPaneTree.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jScrollPaneTree.setViewportView(jTreeMain); // -- Add the scroll panel to the left panel // ---------------------------- jPanelLeft.add(jScrollPaneTree, java.awt.BorderLayout.CENTER); // -- Right split pane // -------------------------------------------------- SplitPaneMainRight = new javax.swing.JSplitPane(); SplitPaneMainRight.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); SplitPaneMain.setRightComponent(SplitPaneMainRight); // -- Tabbed panel // ------------------------------------------------------ TabbedPaneMain = new javax.swing.JTabbedPane(); // -- Create the listener ChangeListener changeListener = new ChangeListener() { public void stateChanged(ChangeEvent changeEvent) { JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource(); int index = sourceTabbedPane.getSelectedIndex(); if (index == 4) // Tab Resume RefreshResume(); } }; TabbedPaneMain.addChangeListener(changeListener); SplitPaneMainRight.setTopComponent(TabbedPaneMain); // -- Tab - data (grid) // ------------------------------------------------- TableMain = new javax.swing.JTable(); TableMain.setModel(ModelTableMain); TableMain.getTableHeader() .setDefaultRenderer(new MainHeaderRenderer(TableMain.getTableHeader().getDefaultRenderer())); TableMain.getTableHeader().setReorderingAllowed(false); TableMain.setDefaultRenderer(ElevationClass.class, new ElevationRenderer()); TableMain.setDefaultRenderer(DistClass.class, new DistRenderer()); TableMain.setDefaultRenderer(TotalClass.class, new TotalRenderer()); TableMain.setDefaultRenderer(DiffClass.class, new DiffRenderer()); TableMain.setDefaultRenderer(CoeffClass.class, new CoeffRenderer()); TableMain.setDefaultRenderer(LatClass.class, new LatRenderer()); TableMain.setDefaultRenderer(LonClass.class, new LonRenderer()); TableMain.setDefaultRenderer(RecupClass.class, new RecupRenderer()); TableMain.setDefaultRenderer(TimeClass.class, new TimeRenderer()); TableMain.setDefaultRenderer(TimelimitClass.class, new TimelimitRenderer()); TableMain.setDefaultRenderer(HourClass.class, new HourRenderer()); TableMain.setDefaultRenderer(StationClass.class, new StationRenderer()); TableMain.setDefaultRenderer(TagClass.class, new TagRenderer()); TableMain.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); TableMain.setRowHeight(20); TableMain.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { if (evt.getButton() == evt.BUTTON1 && evt.getClickCount() >= 2 && !evt.isConsumed()) { evt.consume(); int row = TableMain.rowAtPoint(evt.getPoint()); int col = TableMain.columnAtPoint(evt.getPoint()); frmEditPosition frm = new frmEditPosition(); if (frm.showDialog(Settings, Track, row, col)) { Track.isModified = true; RefreshTableMain(); RefreshProfil(); RefreshStatusbar(Track); } } else TableMainMouseClicked(evt); } }); TableMain.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { TableMainKeyReleased(evt); } }); // -- Add the grid to a scroll panel // ------------------------------------ jScrollPaneData = new javax.swing.JScrollPane(); jScrollPaneData.setViewportView(TableMain); // -- Add the scroll panel to the tabbed panel // -------------------------- addTab(TabbedPaneMain, jScrollPaneData, bundle.getString("frmMain.TabData.tabTitle"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/satellite16.png"))); // -- Tab - Profil // ------------------------------------------------------ jPanelProfil = new javax.swing.JPanel(); jPanelProfil.setPreferredSize(new java.awt.Dimension(677, 150)); jPanelProfil.setLayout(new java.awt.BorderLayout()); // -- Profil tool bar // --------------------------------------------------- // Create_Profil_Toolbar(); // jPanelProfil.add(ToolBarProfil, java.awt.BorderLayout.WEST); // -- Profil chart // ------------------------------------------------------ jPanelProfilChart = new ChartPanel(chart); CrosshairOverlay crosshairOverlay = new CrosshairOverlay(); xCrosshair = new Crosshair(Double.NaN, Color.DARK_GRAY, new BasicStroke(0f)); // xCrosshair.setLabelVisible(true); xCrosshair.setLabelBackgroundPaint(Color.WHITE); yCrosshair = new Crosshair(Double.NaN, Color.DARK_GRAY, new BasicStroke(0f)); // yCrosshair.setLabelVisible(true); yCrosshair.setLabelBackgroundPaint(Color.WHITE); crosshairOverlay.addDomainCrosshair(xCrosshair); crosshairOverlay.addRangeCrosshair(yCrosshair); jPanelProfilChart.addOverlay(crosshairOverlay); jPanelProfilChart.setBackground(new java.awt.Color(255, 0, 51)); jPanelProfilChart.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent event) { ChartEntity chartentity = event.getEntity(); if (chartentity instanceof XYItemEntity) { XYItemEntity e = (XYItemEntity) chartentity; XYDataset d = e.getDataset(); int s = e.getSeriesIndex(); int i = e.getItem(); double x = d.getXValue(s, i); double y = d.getYValue(s, i); xCrosshair.setValue(x); yCrosshair.setValue(y); RefreshProfilInfo(i); //Refresh the position on the data grid TableMain.setRowSelectionInterval(i, i); Rectangle rect = TableMain.getCellRect(i, 0, true); TableMain.scrollRectToVisible(rect); //Refresh the marker position on the map RefreshCurrentPosMarker(Track.data.get(i).getLatitude(), Track.data.get(i).getLongitude()); } } @Override public void chartMouseMoved(ChartMouseEvent event) { } }); jPanelProfil.add(jPanelProfilChart, java.awt.BorderLayout.CENTER); // -- Profil info bar // --------------------------------------------------- jPanelProfilInfo = new javax.swing.JPanel(); jPanelProfilInfo.setLayout(new GridBagLayout()); jPanelProfil.add(jPanelProfilInfo, java.awt.BorderLayout.SOUTH); // -- Line 0 // -- Distance // ---------------------------------------------------------- lbProfilDistance = new javax.swing.JLabel(); lbProfilDistance.setText(" " + bundle.getString("frmMain.lbProfilDistance.text") + "=0.000km "); lbProfilDistance.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilDistance, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Time // -------------------------------------------------------------- lbProfilTime = new javax.swing.JLabel(); lbProfilTime.setText(" " + bundle.getString("frmMain.lbProfilTime.text") + "=00:00:00 "); lbProfilTime.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilTime, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Slope // ------------------------------------------------------------- lbProfilSlope = new javax.swing.JLabel(); lbProfilSlope.setText(" " + bundle.getString("frmMain.lbProfilSlope.text") + "=0.0% "); lbProfilSlope.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilSlope, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Name // -------------------------------------------------------------- lbProfilName = new javax.swing.JLabel(); lbProfilName.setText(" " + bundle.getString("frmMain.lbProfilName.text") + "= "); lbProfilName.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilName, 3, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Line 1 // -- Elevation // --------------------------------------------------------- lbProfilElevation = new javax.swing.JLabel(); lbProfilElevation.setText(" " + bundle.getString("frmMain.lbProfilElevation.text") + "=0m "); lbProfilElevation.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilElevation, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Hour // -------------------------------------------------------------- lbProfilHour = new javax.swing.JLabel(); lbProfilHour.setText(" " + bundle.getString("frmMain.lbProfilHour.text") + "=00:00:00 "); lbProfilHour.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilHour, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Speed // ------------------------------------------------------------- lbProfilSpeed = new javax.swing.JLabel(); lbProfilSpeed.setText(" " + bundle.getString("frmMain.lbProfilSpeed.text") + "=0.0km/h "); lbProfilSpeed.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilSpeed, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Comment // ----------------------------------------------------------- lbProfilComment = new javax.swing.JLabel(); lbProfilComment.setText(" " + bundle.getString("frmMain.lbProfilComment.text") + "= "); lbProfilComment.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Utils.addComponent(jPanelProfilInfo, lbProfilComment, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.EAST, GridBagConstraints.BOTH); // -- Distance / Temps / Pente / Nom // -- Altitude / Heure / Vitesse / Commentaire // -- Add the panel to the tabbed panel // --------------------------------- addTab(TabbedPaneMain, jPanelProfil, bundle.getString("frmMain.TabProfil.tabTitle"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/profil.png"))); // -- Tab - Statistic // --------------------------------------------------- jPanelStatistic = new javax.swing.JPanel(); jPanelStatistic.setLayout(new java.awt.BorderLayout()); // -- Statistic tool bar // --------------------------------------------------- Create_Statistic_Toolbar(); jPanelStatistic.add(ToolBarStatistic, java.awt.BorderLayout.NORTH); // TODO Add the component to display the statistics addTab(TabbedPaneMain, jPanelStatistic, bundle.getString("frmMain.TabStatistic.tabTitle"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/stat.png"))); // -- Tab - Analysis // ---------------------------------------------------- jPanelAnalyze = new javax.swing.JPanel(); // TODO Define this panel addTab(TabbedPaneMain, jPanelAnalyze, bundle.getString("frmMain.TabAnalyze.tabTitle"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/search.png"))); // -- Tab - Resume // ------------------------------------------------------ jPanelResume = new javax.swing.JPanel(); jPanelResume.setLayout(new java.awt.BorderLayout()); // -- Resume tool bar // --------------------------------------------------- Create_Resume_Toolbar(); jPanelResume.add(ToolBarResume, java.awt.BorderLayout.NORTH); TableResume = new javax.swing.JTable(); TableResume.setModel(ModelTableResume); TableResume.setRowHeight(20); TableResume.getTableHeader().setReorderingAllowed(false); TableResume.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); TableResume.getTableHeader() .setDefaultRenderer(new ResumeHeaderRenderer(TableResume.getTableHeader().getDefaultRenderer())); // TODO Change the Renderer name. Add Resume... TableResume.setDefaultRenderer(ResumeNumClass.class, new ResumeNumRenderer()); TableResume.setDefaultRenderer(ResumeNameClass.class, new ResumeNameRenderer()); TableResume.setDefaultRenderer(ResumeLineClass.class, new ResumeLineRenderer()); TableResume.setDefaultRenderer(ResumeElevationClass.class, new ResumeElevationRenderer()); TableResume.setDefaultRenderer(ResumeClimbPClass.class, new ResumeClimbPRenderer()); TableResume.setDefaultRenderer(ResumeClimbNClass.class, new ResumeClimbNRenderer()); TableResume.setDefaultRenderer(ResumeDistanceClass.class, new ResumeDistanceRenderer()); TableResume.setDefaultRenderer(ResumeTimeClass.class, new ResumeTimeRenderer()); TableResume.setDefaultRenderer(ResumeHourClass.class, new ResumeHourRenderer()); TableResume.setDefaultRenderer(ResumedtTimeClass.class, new ResumedtTimeRenderer()); TableResume.setDefaultRenderer(ResumeTimeLimitClass.class, new ResumeTimeLimitRenderer()); TableResume.setDefaultRenderer(ResumeStationTimeClass.class, new ResumeStationTimeRenderer()); TableResume.setDefaultRenderer(ResumedtDistanceClass.class, new ResumedtDistanceRenderer()); TableResume.setDefaultRenderer(ResumedtClimbPClass.class, new ResumedtClimbPRenderer()); TableResume.setDefaultRenderer(ResumedtClimbNClass.class, new ResumedtClimbNRenderer()); TableResume.setDefaultRenderer(ResumeSpeedPClass.class, new ResumeSpeedPRenderer()); TableResume.setDefaultRenderer(ResumeSpeedNClass.class, new ResumeSpeedNRenderer()); TableResume.setDefaultRenderer(ResumeAvgSlopePClass.class, new ResumeAvgSlopePRenderer()); TableResume.setDefaultRenderer(ResumeAvgSlopeNClass.class, new ResumeAvgSlopeNRenderer()); TableResume.setDefaultRenderer(ResumeAvgSpeedClass.class, new ResumeAvgSpeedRenderer()); TableResume.setDefaultRenderer(ResumeCommentClass.class, new ResumeCommentRenderer()); // TableResume.addMouseListener(new java.awt.event.MouseAdapter() { // public void mouseClicked(java.awt.event.MouseEvent evt) { // TableMainMouseClicked(evt); // } // }); // TableResume.addKeyListener(new java.awt.event.KeyAdapter() { // public void keyReleased(java.awt.event.KeyEvent evt) { // TableMainKeyReleased(evt); // } // }); // -- Add the grid to a scroll panel // ------------------------------------ jScrollPaneResume = new javax.swing.JScrollPane(); jScrollPaneResume.setViewportView(TableResume); jPanelResume.add(jScrollPaneResume, java.awt.BorderLayout.CENTER); addTab(TabbedPaneMain, jPanelResume, bundle.getString("frmMain.TabResume.tabTitle"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/grid.png"))); // -- Map panel // --------------------------------------------------------- jPanelMap = new javax.swing.JPanel(); jPanelMap.setLayout(new java.awt.BorderLayout()); Create_Map_Toolbar(); jPanelMap.add(jToolBarMapViewer, java.awt.BorderLayout.WEST); MapViewer = new org.openstreetmap.gui.jmapviewer.JMapViewer(); MapViewer.setMapMarkerVisible(true); MapViewer.setScrollWrapEnabled(true); MapViewer.setZoomButtonStyle(org.openstreetmap.gui.jmapviewer.JMapViewer.ZOOM_BUTTON_STYLE.VERTICAL); MapViewer.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { MapViewerMouseClicked(evt); } }); jPanelMap.add(MapViewer, java.awt.BorderLayout.CENTER); jScrollPanelMap = new javax.swing.JScrollPane(); jScrollPanelMap.setViewportView(jPanelMap); SplitPaneMainRight.setRightComponent(jScrollPanelMap); // -- Finished - Pack // --------------------------------------------------- pack(); }