List of usage examples for javax.swing JTabbedPane JTabbedPane
public JTabbedPane()
TabbedPane
with a default tab placement of JTabbedPane.TOP
. From source file:com.sec.ose.osi.ui.frm.main.identification.JPanIdentifyMain.java
/** * This method initializes jTabbedPane * /*from w w w . ja v a 2 s .c om*/ * @return javax.swing.JTabbedPane */ public JTabbedPane getJTabbedPaneFileNavigation() { if (jTabbedPaneFileNavigation == null) { jTabbedPaneFileNavigation = new JTabbedPane(); jTabbedPaneFileNavigation.addTab("Tree", null, getJScrollPaneTree(), null); jTabbedPaneFileNavigation.addTab("List", null, getJScrollPaneList(), null); jTabbedPaneFileNavigation.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); jTabbedPaneFileNavigation.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { JTabbedPane pane = (JTabbedPane) e.getSource(); int selectedTab = pane.getSelectedIndex(); log.debug("[JPanIdentifyMain.getJTabbedPaneFileNavigation()] selectedTab : " + selectedTab); SelectedFilePathInfo selectedFilePathInfo = IdentifyMediator.getInstance() .getSelectedFilePathInfo(); String selectedPath = selectedFilePathInfo.getSelectedPath(); log.debug("[JPanIdentifyMain.getJTabbedPaneFileNavigation()] selectedPath : " + selectedPath); IdentifyMediator.getInstance().setFilePointerToSelectedFile(selectedPath); actForTab(selectedTab); String projectName = IdentifyMediator.getInstance().getSelectedProjectName(); refreshChildFrameForMatchedType(projectName); } }); } return jTabbedPaneFileNavigation; }
From source file:edu.clemson.cs.nestbed.client.gui.ConfigManagerFrame.java
private final JPanel buildBottomPanel() { JPanel panel = new JPanel(new BorderLayout()); JTabbedPane tabbedPane = new JTabbedPane(); Dimension size = new Dimension(WINDOW_WIDTH, WINDOW_HEIGHT / 10); panel.setSize(size);/*from ww w. ja v a2 s. c om*/ panel.setPreferredSize(size); tabbedPane.add("Symbol Profiling", new JScrollPane(profilingSymbolTable)); tabbedPane.add("Message Profiling", new JScrollPane(profilingMsgTable)); tabbedPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { profilingSymbolTable.clearSelection(); profilingMsgTable.clearSelection(); } }); panel.add(tabbedPane); return panel; }
From source file:edu.ku.brc.specify.ui.AppBase.java
/** * Creates a modal dialog displaying the the error and specify log files. *//* w w w . j a v a2 s .com*/ public static void displaySpecifyLogFiles() { File spLogFile = getFullLogFilePath(AppBase.SPECIFY_LOG); //$NON-NLS-1$ File errLogFile = getFullLogFilePath(AppBase.ERRORSYS_LOG); //$NON-NLS-1$ JTabbedPane tabPane = new JTabbedPane(); tabPane.add(getResourceString("Specify.ERROR"), getLogFilePanel(errLogFile, true)); //$NON-NLS-1$ tabPane.add("Specify", getLogFilePanel(spLogFile, true)); //$NON-NLS-1$ String title = getResourceString("Specify.LOG_FILES_TITLE");//$NON-NLS-1$ CustomDialog dialog = new CustomDialog((JFrame) UIRegistry.getTopWindow(), title, true, CustomDialog.OK_BTN, tabPane); String okLabel = getResourceString("Specify.CLOSE");//$NON-NLS-1$ dialog.setOkLabel(okLabel); dialog.createUI(); dialog.setSize(800, 600); UIHelper.centerWindow(dialog); dialog.setVisible(true); }
From source file:de.atomfrede.tools.evalutation.options.ui.OptionsDialog.java
private JTabbedPane getTabs() { if (tabs == null) { tabs = new JTabbedPane(); tabs.setTabPlacement(JTabbedPane.LEFT); }//from w ww . j a v a 2s . com return tabs; }
From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java
private Container initContainer() { JPanel containerPanel = new JPanel(new CardLayout()); JLabel loadingModelLabel = new JLabel("Loading model..."); loadingModelLabel.setHorizontalAlignment(SwingConstants.CENTER); containerPanel.add(loadingModelLabel, LOADING_MODEL_ID); tabbedPane = new JTabbedPane(); containerPanel.add(tabbedPane, PARAMETERS_PANEL_ID); // create two number of turns field numberOfTurnsField = new JFormattedTextField(); numberOfTurnsField.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsField.setInputVerifier(new InputVerifier() { @Override//ww w .jav a 2 s . com public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsField.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsField, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsField.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsField .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsField.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberOfTurnsFieldPSW = new JFormattedTextField(); numberOfTurnsFieldPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsFieldPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsFieldPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsFieldPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsFieldPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsFieldPSW .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsFieldPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); // create two number of time-steps to ignore field numberTimestepsIgnored = new JFormattedTextField(); numberTimestepsIgnored.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnored.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnored.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnored, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnored.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnored.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnored.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberTimestepsIgnoredPSW = new JFormattedTextField(); numberTimestepsIgnoredPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnoredPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnoredPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnoredPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnoredPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnoredPSW.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnoredPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); onLineChartsCheckBox = new JCheckBox(); // onLineChartsCheckBoxPSW = new JCheckBox(); advancedChartsCheckBox = new JCheckBox(); advancedChartsCheckBox.setSelected(true); // create the scroll pane for the simple parameter setting page JLabel label = null; label = new JLabel(new ImageIcon(new ImageIcon(getClass().getResource(DECORATION_IMAGE)).getImage() .getScaledInstance(DECORATION_IMAGE_WIDTH, -1, Image.SCALE_SMOOTH))); Style.registerCssClasses(label, Dashboard.CSS_CLASS_COMMON_PANEL); parametersScrollPane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); parametersScrollPane.setBorder(null); parametersScrollPane.setViewportBorder(null); breadcrumb = new Breadcrumb(); Style.registerCssClasses(breadcrumb, CSS_ID_BREADCRUMB); singleRunParametersPanel = new ScrollableJPanel(new SizeProvider() { @Override public int getHeight() { Component component = tabbedPane.getSelectedComponent(); if (component == null) { return 0; } JScrollBar scrollBar = parametersScrollPane.getHorizontalScrollBar(); return component.getSize().height - breadcrumb.getHeight() - (scrollBar.isVisible() ? scrollBar.getPreferredSize().height : 0); } @Override public int getWidth() { final int hScrollBarWidth = parametersScrollPane.getHorizontalScrollBar().getPreferredSize().width; final int width = dashboard.getSize().width - Page_Parameters.DECORATION_IMAGE_WIDTH - hScrollBarWidth; return width; } }); BoxLayout boxLayout = new BoxLayout(singleRunParametersPanel, BoxLayout.X_AXIS); singleRunParametersPanel.setLayout(boxLayout); parametersScrollPane.setViewportView(singleRunParametersPanel); JPanel breadcrumbPanel = new JPanel(new BorderLayout()); breadcrumbPanel.add(breadcrumb, BorderLayout.NORTH); breadcrumbPanel.add(parametersScrollPane, BorderLayout.CENTER); final JPanel simpleForm = FormsUtils.build("p ~ p:g", "01 t:p", label, breadcrumbPanel).getPanel(); Style.registerCssClasses(simpleForm, Dashboard.CSS_CLASS_COMMON_PANEL); tabbedPane.add("Single run", simpleForm); // create the form for the parameter sweep setting page tabbedPane.add("Parameter sweep", createParamsweepGUI()); gaSearchHandler = new GASearchHandler(currentModelHandler); gaSearchPanel = new GASearchPanel(gaSearchHandler, this); tabbedPane.add("Genetic Algorithm Search", gaSearchPanel); return containerPanel; }
From source file:edu.ucla.stat.SOCR.chart.Chart.java
/**This method initializes the Gui, by setting up the basic tabbedPanes.*/ public void init() { depMax = 1;/*from w ww.j av a 2s.c o m*/ indMax = 1; chartTitle = this.getClass().getName(); chartTitle = chartTitle.substring(chartTitle.lastIndexOf(".") + 1); String fileName = "demo" + System.getProperty("file.separator") + chartTitle + ".html"; url = Chart.class.getResource(fileName); setName(chartTitle); //Get frame of the applet //frame = getFrame(this.getContentPane()); // Create the toolBar toolBar = new JToolBar(); createActionComponents(toolBar); this.getContentPane().add(toolBar, BorderLayout.NORTH); tabbedPanelContainer = new JTabbedPane(); dataObject = new Object[rowNumber][columnNumber]; columnNames = new String[columnNumber]; independentList = new ArrayList<Integer>(); dependentList = new ArrayList<Integer>(); for (int i = 0; i < columnNumber; i++) columnNames[i] = new String(DEFAULT_HEADER + (i + 1)); initTable(); initGraphPanel(); initMapPanel(); initMixPanel(); mixPanelContainer = new JScrollPane(mixPanel); mixPanelContainer.setPreferredSize(new Dimension(600, CHART_SIZE_Y + 100)); addTabbedPane(GRAPH, graphPanel); addTabbedPane(DATA, dataPanel); addTabbedPane(MAPPING, bPanel); addTabbedPane(ALL, mixPanelContainer); tabbedPanelContainer.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (tabbedPanelContainer.getTitleAt(tabbedPanelContainer.getSelectedIndex()) == ALL) { mixPanel.removeAll(); setMixPanel(); mixPanel.validate(); } else if (tabbedPanelContainer.getTitleAt(tabbedPanelContainer.getSelectedIndex()) == GRAPH) { graphPanel.removeAll(); //setGraphPanel(); //graphPanel.validate(); setChart(); } else if (tabbedPanelContainer.getTitleAt(tabbedPanelContainer.getSelectedIndex()) == DATA) { // setTablePane(); } else if (tabbedPanelContainer.getTitleAt(tabbedPanelContainer.getSelectedIndex()) == MAPPING) { bPanel.removeAll(); mapPanel.setPreferredSize(new Dimension(CHART_SIZE_X, CHART_SIZE_Y)); bPanel.add(mapPanel, BorderLayout.CENTER); bPanel.validate(); } } }); bPanel.addComponentListener(new ComponentListener() { public void componentResized(ComponentEvent e) { } public void componentMoved(ComponentEvent e) { } public void componentShown(ComponentEvent e) { // resultPanelTextArea.append("sucess"); // System.out.print("Success"); // Add code here for updating the Panel to show proper heading paintMappingLists(listIndex); } public void componentHidden(ComponentEvent e) { } }); // the right side (including top and bottom panels) statusTextArea = new JTextPane(); //right side lower statusTextArea.setEditable(false); JScrollPane statusContainer = new JScrollPane(statusTextArea); statusContainer.setPreferredSize(new Dimension(600, 140)); if (SHOW_STATUS_TEXTAREA) { JSplitPane container = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(tabbedPanelContainer), statusContainer); container.setContinuousLayout(true); container.setDividerLocation(0.6); this.getContentPane().add(container, BorderLayout.CENTER); } else { this.getContentPane().add(new JScrollPane(tabbedPanelContainer), BorderLayout.CENTER); } updateStatus(url); }
From source file:gtu._work.ui.PropertyEditUI.java
private void initGUI() { try {/*from w ww.j a v a 2 s . com*/ setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); BorderLayout thisLayout = new BorderLayout(); this.setTitle("PropertyEditUI"); getContentPane().setLayout(thisLayout); { jMenuBar1 = new JMenuBar(); setJMenuBar(jMenuBar1); { jMenu1 = new JMenu(); jMenuBar1.add(jMenu1); jMenu1.setText("File"); { jMenuItem1 = new JMenuItem(); jMenu1.add(jMenuItem1); jMenuItem1.setText("open directory"); jMenuItem1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { File file = JCommonUtil._jFileChooser_selectDirectoryOnly(); loadCurrentFile(file); } }); } { openDirectoryAndChildren = new JMenuItem(); jMenu1.add(openDirectoryAndChildren); openDirectoryAndChildren.setText("open directory and children"); openDirectoryAndChildren.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.out.println("openDirectoryAndChildren.actionPerformed, event=" + evt); File file = JCommonUtil._jFileChooser_selectDirectoryOnly(); if (file == null) { // file = // PropertiesUtil.getJarCurrentPath(getClass());//XXX file = new File("D:\\my_tool\\english"); JCommonUtil._jOptionPane_showMessageDialog_info("load C:\\L-CONFIG !"); } DefaultListModel model = new DefaultListModel(); List<File> list = new ArrayList<File>(); FileUtil.searchFileMatchs(file, ".*\\.properties", list); for (File f : list) { File_ ff = new File_(); ff.file = f; model.addElement(ff); } backupFileList = list; fileList.setModel(model); } }); } { jMenuItem2 = new JMenuItem(); jMenu1.add(jMenuItem2); jMenuItem2.setText("save"); jMenuItem2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.out.println("jMenu3.actionPerformed, event=" + evt); if (currentFile == null) { return; } if (JCommonUtil._JOptionPane_showConfirmDialog_yesNoOption( "save to " + currentFile.getName(), "SAVE")) { try { Properties prop = new Properties(); // try { // prop.load(new // FileInputStream(currentFile)); // } catch (Exception e) { // e.printStackTrace(); // JCommonUtil.handleException(e); // return; // } loadModelToProperties(prop); prop.store(new FileOutputStream(currentFile), getTitle()); } catch (Exception e) { e.printStackTrace(); JCommonUtil.handleException(e); } } } }); } { jMenuItem3 = new JMenuItem(); jMenu1.add(jMenuItem3); jMenuItem3.setText("save to target"); jMenuItem3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { File file = JFileChooserUtil.newInstance().selectFileOnly().showSaveDialog() .getApproveSelectedFile(); if (file == null) { JCommonUtil._jOptionPane_showMessageDialog_error("file name is not correct!"); return; } if (!file.getName().contains(".properties")) { file = new File(file.getParent(), file.getName() + ".properties"); } try { Properties prop = new Properties(); // try { // prop.load(new // FileInputStream(currentFile)); // } catch (Exception e) { // e.printStackTrace(); // JCommonUtil.handleException(e); // return; // } loadModelToProperties(prop); prop.store(new FileOutputStream(file), getTitle()); } catch (Exception e) { e.printStackTrace(); JCommonUtil.handleException(e); } } }); } { jMenuItem4 = new JMenuItem(); jMenu1.add(jMenuItem4); jMenuItem4.setText("save file(sorted)"); jMenuItem4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { if (currentFile == null) { return; } try { BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(currentFile))); List<String> sortList = new ArrayList<String>(); for (String line = null; (line = reader.readLine()) != null;) { sortList.add(line); } reader.close(); Collections.sort(sortList); StringBuilder sb = new StringBuilder(); for (String line : sortList) { sb.append(line + "\n"); } FileUtil.saveToFile(currentFile, sb.toString(), "UTF8"); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }); } { jMenuItem5 = new JMenuItem(); jMenu1.add(jMenuItem5); jMenuItem5.setText(""); jMenuItem5.addActionListener(new ActionListener() { private void setMeaning(String meaning, int rowPos) { propTable.getRowSorter().getModel().setValueAt(meaning, rowPos, 2); } private void setMeaningEn1(String english, int rowPos, List<String> errSb) { EnglishTester_Diectory eng = new EnglishTester_Diectory(); try { WordInfo wordInfo = eng.parseToWordInfo(english); String meaning = getChs2Big5(wordInfo.getMeaning()); if (hasChinese(meaning)) { setMeaning(meaning, rowPos); } else { setMeaningEn2(english, rowPos, errSb); } } catch (Exception e) { errSb.add(english); e.printStackTrace(); } } private void setMeaningEn2(String english, int rowPos, List<String> errSb) { EnglishTester_Diectory2 eng2 = new EnglishTester_Diectory2(); try { WordInfo2 wordInfo = eng2.parseToWordInfo(english); String meaning = getChs2Big5(StringUtils.join(wordInfo.getMeaningList(), ";")); setMeaning(meaning, rowPos); } catch (Exception e) { errSb.add(english); e.printStackTrace(); } } private boolean hasChinese(String val) { return new StringUtil_().getChineseWord(val, true).length() > 0; } private Properties loadFromMemoryBank() { try { Properties prop = new Properties(); File f1 = new File( "D:/gtu001_dropbox/Dropbox/Apps/gtu001_test/etc_config/EnglishSearchUI_MemoryBank.properties"); File f2 = new File( "e:/gtu001_dropbox/Dropbox/Apps/gtu001_test/etc_config/EnglishSearchUI_MemoryBank.properties"); for (File f : new File[] { f1, f2 }) { if (f.exists()) { HermannEbbinghaus_Memory memory = new HermannEbbinghaus_Memory(); memory.init(f); List<MemData> memLst = memory.getAllMemData(true); for (MemData d : memLst) { prop.setProperty(d.getKey(), getChs2Big5(d.getRemark())); } break; } } return prop; } catch (Exception ex) { throw new RuntimeException(ex); } } public void actionPerformed(ActionEvent evt) { if (currentFile == null) { return; } // Properties memoryProp = loadFromMemoryBank(); Properties memoryProp = new Properties(); List<String> errSb = new ArrayList<String>(); for (int row = 0; row < propTable.getModel().getRowCount(); row++) { int rowPos = propTable.getRowSorter().convertRowIndexToModel(row); String english = StringUtils.trimToEmpty( (String) propTable.getRowSorter().getModel().getValueAt(rowPos, 1)) .toLowerCase(); String desc = (String) propTable.getRowSorter().getModel().getValueAt(rowPos, 2); if (memoryProp.containsKey(english) && StringUtils.isNotBlank(memoryProp.getProperty(english))) { setMeaning(memoryProp.getProperty(english), rowPos); } else { if (StringUtils.isBlank(desc) || !hasChinese(desc)) { if (!english.contains(" ")) { setMeaningEn1(english, rowPos, errSb); } else { setMeaningEn2(english, rowPos, errSb); } } } if (StringUtils.trimToEmpty(desc).contains("?")) { setMeaning("", rowPos); } } if (!errSb.isEmpty()) { JCommonUtil._jOptionPane_showMessageDialog_error(":\n" + errSb); } } }); } { JMenuItem jMenuItem6 = new JMenuItem(); jMenu1.add(jMenuItem6); jMenuItem6.setText(""); jMenuItem6.addActionListener(new ActionListener() { private void setMeaning(String meaning, int rowPos) { propTable.getRowSorter().getModel().setValueAt(meaning, rowPos, 2); } public void actionPerformed(ActionEvent evt) { for (int row = 0; row < propTable.getModel().getRowCount(); row++) { int rowPos = propTable.getRowSorter().convertRowIndexToModel(row); String english = StringUtils.trimToEmpty( (String) propTable.getRowSorter().getModel().getValueAt(rowPos, 1)) .toLowerCase(); String desc = (String) propTable.getRowSorter().getModel().getValueAt(rowPos, 2); if (StringUtils.trimToEmpty(desc).contains("?")) { setMeaning("", rowPos); } } } }); } } } { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("editor", null, jPanel2, null); { jScrollPane1 = new JScrollPane(); jPanel2.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(550, 314)); { TableModel propTableModel = new DefaultTableModel( new String[][] { { "", "", "" }, { "", "", "" } }, new String[] { "index", "Key", "value" }); propTable = new JTable(); JTableUtil.defaultSetting_AutoResize(propTable); jScrollPane1.setViewportView(propTable); propTable.setModel(propTableModel); propTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { JTableUtil xxxxxx = JTableUtil.newInstance(propTable); int[] rows = xxxxxx.getSelectedRows(); for (int ii : rows) { System.out.println(xxxxxx.getModel().getValueAt(ii, 1)); } JPopupMenuUtil.newInstance(propTable).applyEvent(evt) .addJMenuItem(JTableUtil.newInstance(propTable).getDefaultJMenuItems()) .show(); } }); } } { queryText = new JTextField(); jPanel2.add(queryText, BorderLayout.NORTH); queryText.getDocument() .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() { @Override public void process(DocumentEvent event) { if (currentFile == null) { return; } Properties prop = new Properties(); try { prop.load(new FileInputStream(currentFile)); } catch (Exception e) { e.printStackTrace(); JCommonUtil.handleException(e); return; } loadPropertiesToModel(prop); String text = JCommonUtil.getDocumentText(event); Pattern pattern = null; try { pattern = Pattern.compile(text); } catch (Exception ex) { } DefaultTableModel model = JTableUtil.newInstance(propTable).getModel(); for (int ii = 0; ii < model.getRowCount(); ii++) { String key = (String) model.getValueAt(ii, 1); String value = (String) model.getValueAt(ii, 2); if (key.contains(text)) { continue; } if (value.contains(text)) { continue; } if (pattern != null) { if (pattern.matcher(key).find()) { continue; } if (pattern.matcher(value).find()) { continue; } } model.removeRow(propTable.convertRowIndexToModel(ii)); ii--; } } })); } } { jPanel3 = new JPanel(); BorderLayout jPanel3Layout = new BorderLayout(); jPanel3.setLayout(jPanel3Layout); jTabbedPane1.addTab("folder", null, jPanel3, null); { jScrollPane2 = new JScrollPane(); jPanel3.add(jScrollPane2, BorderLayout.CENTER); jScrollPane2.setPreferredSize(new java.awt.Dimension(550, 314)); { fileList = new JList(); jScrollPane2.setViewportView(fileList); fileList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { JListUtil.newInstance(fileList).defaultJListKeyPressed(evt); } }); fileList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { final File_ file = JListUtil.getLeadSelectionObject(fileList); if (evt.getButton() == MouseEvent.BUTTON1) { Properties prop = new Properties(); currentFile = file.file; setTitle(currentFile.getName()); try { prop.load(new FileInputStream(file.file)); } catch (Exception e) { e.printStackTrace(); } loadPropertiesToModel(prop); } if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) { try { Runtime.getRuntime().exec(String.format("cmd /c \"%s\"", file.file)); } catch (IOException e1) { e1.printStackTrace(); } } final File parent = file.file.getParentFile(); JMenuItem openTargetDir = new JMenuItem(); openTargetDir.setText("open : " + parent); openTargetDir.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { Desktop.getDesktop().open(parent); } catch (IOException e1) { JCommonUtil.handleException(e1); } } }); JPopupMenuUtil.newInstance(fileList).addJMenuItem(openTargetDir).applyEvent(evt) .show(); } }); } } { fileQueryText = new JTextField(); jPanel3.add(fileQueryText, BorderLayout.NORTH); fileQueryText.getDocument() .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() { @Override public void process(DocumentEvent event) { String text = JCommonUtil.getDocumentText(event); DefaultListModel model = new DefaultListModel(); for (File f : backupFileList) { if (f.getName().contains(text)) { File_ ff = new File_(); ff.file = f; model.addElement(ff); } } fileList.setModel(model); } })); } { contentQueryText = new JTextField(); jPanel3.add(contentQueryText, BorderLayout.SOUTH); contentQueryText.addActionListener(new ActionListener() { void addModel(File f, DefaultListModel model) { File_ ff = new File_(); ff.file = f; model.addElement(ff); } public void actionPerformed(ActionEvent evt) { DefaultListModel model = new DefaultListModel(); String text = contentQueryText.getText(); if (StringUtils.isEmpty(contentQueryText.getText())) { return; } Pattern pattern = Pattern.compile(text); Properties pp = null; for (File f : backupFileList) { pp = new Properties(); try { pp.load(new FileInputStream(f)); for (String key : pp.stringPropertyNames()) { if (key.isEmpty()) { continue; } if (pp.getProperty(key) == null || pp.getProperty(key).isEmpty()) { continue; } if (key.contains(text)) { addModel(f, model); break; } if (pp.getProperty(key).contains(text)) { addModel(f, model); break; } if (pattern.matcher(key).find()) { addModel(f, model); break; } if (pattern.matcher(pp.getProperty(key)).find()) { addModel(f, model); break; } } } catch (Exception e) { e.printStackTrace(); } } fileList.setModel(model); } }); } } } JCommonUtil.setJFrameIcon(this, "resource/images/ico/english.ico"); JCommonUtil.setJFrameCenter(this); pack(); this.setSize(571, 408); loadCurrentFile(null); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.tiempometa.muestradatos.JMuestraDatos.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents ResourceBundle bundle = ResourceBundle.getBundle("com.tiempometa.muestradatos.muestradatos"); menuBar1 = new JMenuBar(); menu1 = new JMenu(); configMenuItem = new JMenuItem(); importTagsMenuItem = new JMenuItem(); exportTagsMenuItem = new JMenuItem(); clearTagsMenuItem = new JMenuItem(); exitMenuItem = new JMenuItem(); menu3 = new JMenu(); aboutUsMenuItem = new JMenuItem(); configureJavaMenuItem = new JMenuItem(); panel5 = new JPanel(); panel3 = new JPanel(); panel4 = new JPanel(); tabbedPane1 = new JTabbedPane(); panel2 = new JPanel(); label9 = new JLabel(); label10 = new JLabel(); label3 = new JLabel(); readerPortLabel = new JLabel(); label11 = new JLabel(); boxIpAddressLabel = new JLabel(); label4 = new JLabel(); readerStatusLabel = new JLabel(); label12 = new JLabel(); boxTypeLabel = new JLabel(); label2 = new JLabel(); rssiLevelLabel = new JLabel(); label13 = new JLabel(); preferredReaderLabel = new JLabel(); label5 = new JLabel(); regionLabel = new JLabel(); label14 = new JLabel(); preferredAntenaLabel = new JLabel(); label6 = new JLabel(); readPowerLabel = new JLabel(); label7 = new JLabel(); writePowerLevel = new JLabel(); usbConnectButton = new JButton(); boxConnectButton = new JButton(); panel1 = new JPanel(); verifyDataButton = new JButton(); loadReadingsButton = new JButton(); readTagButton = new JButton(); countTagsButton = new JButton(); programTagButton = new JButton(); panel8 = new JPanel(); setBoxTimeButton = new JButton(); getBoxTimeButton = new JButton(); label20 = new JLabel(); label19 = new JLabel(); systemTimeLabel = new JLabel(); foxberryTimeLabel = new JLabel(); foxberryTimeDiffLabel = new JLabel(); panel6 = new JPanel(); label21 = new JLabel(); label1 = new JLabel(); usbStatusLabel = new JLabel(); label16 = new JLabel(); tcpStatusLabel = new JLabel(); label8 = new JLabel(); databaseLabel = new JLabel(); panel7 = new JPanel(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("JMuestraDatos.this.title")); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); setIconImage(/* w w w.j a va 2 s. c o m*/ new ImageIcon(getClass().getResource("/com/tiempometa/resources/tiempometa_icon_large_alpha.png")) .getImage()); setResizable(false); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== menuBar1 ======== { //======== menu1 ======== { menu1.setText(bundle.getString("JMuestraDatos.menu1.text")); //---- configMenuItem ---- configMenuItem.setText(bundle.getString("JMuestraDatos.configMenuItem.text")); configMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { configMenuItemActionPerformed(e); } }); menu1.add(configMenuItem); //---- importTagsMenuItem ---- importTagsMenuItem.setText(bundle.getString("JMuestraDatos.importTagsMenuItem.text")); importTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { importTagsMenuItemActionPerformed(e); } }); menu1.add(importTagsMenuItem); //---- exportTagsMenuItem ---- exportTagsMenuItem.setText(bundle.getString("JMuestraDatos.exportTagsMenuItem.text")); exportTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { exportTagsMenuItemActionPerformed(e); } }); menu1.add(exportTagsMenuItem); //---- clearTagsMenuItem ---- clearTagsMenuItem.setText(bundle.getString("JMuestraDatos.clearTagsMenuItem.text")); clearTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearTagsMenuItemActionPerformed(e); } }); menu1.add(clearTagsMenuItem); menu1.addSeparator(); //---- exitMenuItem ---- exitMenuItem.setText(bundle.getString("JMuestraDatos.exitMenuItem.text")); exitMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem2ActionPerformed(e); } }); menu1.add(exitMenuItem); } menuBar1.add(menu1); //======== menu3 ======== { menu3.setText(bundle.getString("JMuestraDatos.menu3.text")); //---- aboutUsMenuItem ---- aboutUsMenuItem.setText(bundle.getString("JMuestraDatos.aboutUsMenuItem.text")); aboutUsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { aboutUsMenuItemActionPerformed(e); } }); menu3.add(aboutUsMenuItem); //---- configureJavaMenuItem ---- configureJavaMenuItem.setText(bundle.getString("JMuestraDatos.configureJavaMenuItem.text")); configureJavaMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { configureJavaMenuItemActionPerformed(e); } }); menu3.add(configureJavaMenuItem); } menuBar1.add(menu3); } setJMenuBar(menuBar1); //======== panel5 ======== { panel5.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(18)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(343)) }, new RowSpec[] { new RowSpec(Sizes.dluY(17)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(17)) })); } contentPane.add(panel5, BorderLayout.NORTH); //======== panel3 ======== { panel3.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(16)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); } contentPane.add(panel3, BorderLayout.WEST); //======== panel4 ======== { panel4.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(410)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("245dlu"))); //======== tabbedPane1 ======== { tabbedPane1.setFont(new Font("Tahoma", Font.BOLD, 16)); //======== panel2 ======== { panel2.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(25)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(89)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(73)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(17)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(84)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(80)) }, new RowSpec[] { new RowSpec(Sizes.dluY(20)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.DLUY8) })); //---- label9 ---- label9.setText(bundle.getString("JMuestraDatos.label9.text")); label9.setFont(new Font("Tahoma", Font.BOLD, 16)); label9.setIcon(new ImageIcon(getClass().getResource("/com/tiempometa/resources/usb_128.png"))); label9.setHorizontalAlignment(SwingConstants.CENTER); panel2.add(label9, cc.xywh(3, 3, 3, 1)); //---- label10 ---- label10.setText(bundle.getString("JMuestraDatos.label10.text")); label10.setFont(new Font("Tahoma", Font.BOLD, 16)); label10.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/briefcase_128.png"))); label10.setHorizontalAlignment(SwingConstants.CENTER); panel2.add(label10, cc.xywh(9, 3, 3, 1)); //---- label3 ---- label3.setText(bundle.getString("JMuestraDatos.label3.text")); label3.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label3, cc.xy(3, 5)); //---- readerPortLabel ---- readerPortLabel.setText(bundle.getString("JMuestraDatos.readerPortLabel.text")); panel2.add(readerPortLabel, cc.xy(5, 5)); //---- label11 ---- label11.setText(bundle.getString("JMuestraDatos.label11.text")); label11.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label11, cc.xy(9, 5)); //---- boxIpAddressLabel ---- boxIpAddressLabel.setText(bundle.getString("JMuestraDatos.boxIpAddressLabel.text")); panel2.add(boxIpAddressLabel, cc.xy(11, 5)); //---- label4 ---- label4.setText(bundle.getString("JMuestraDatos.label4.text")); label4.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label4, cc.xy(3, 7)); //---- readerStatusLabel ---- readerStatusLabel.setText(bundle.getString("JMuestraDatos.readerStatusLabel.text")); panel2.add(readerStatusLabel, cc.xy(5, 7)); //---- label12 ---- label12.setText(bundle.getString("JMuestraDatos.label12.text")); label12.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label12, cc.xy(9, 7)); //---- boxTypeLabel ---- boxTypeLabel.setText(bundle.getString("JMuestraDatos.boxTypeLabel.text")); panel2.add(boxTypeLabel, cc.xy(11, 7)); //---- label2 ---- label2.setText(bundle.getString("JMuestraDatos.label2.text")); label2.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label2, cc.xy(3, 9)); //---- rssiLevelLabel ---- rssiLevelLabel.setText(bundle.getString("JMuestraDatos.rssiLevelLabel.text")); panel2.add(rssiLevelLabel, cc.xy(5, 9)); //---- label13 ---- label13.setText(bundle.getString("JMuestraDatos.label13.text")); label13.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label13, cc.xy(9, 9)); //---- preferredReaderLabel ---- preferredReaderLabel.setText(bundle.getString("JMuestraDatos.preferredReaderLabel.text")); panel2.add(preferredReaderLabel, cc.xy(11, 9)); //---- label5 ---- label5.setText(bundle.getString("JMuestraDatos.label5.text")); label5.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label5, cc.xy(3, 11)); //---- regionLabel ---- regionLabel.setText(bundle.getString("JMuestraDatos.regionLabel.text")); panel2.add(regionLabel, cc.xy(5, 11)); //---- label14 ---- label14.setText(bundle.getString("JMuestraDatos.label14.text")); label14.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label14, cc.xy(9, 11)); //---- preferredAntenaLabel ---- preferredAntenaLabel.setText(bundle.getString("JMuestraDatos.preferredAntenaLabel.text")); panel2.add(preferredAntenaLabel, cc.xy(11, 11)); //---- label6 ---- label6.setText(bundle.getString("JMuestraDatos.label6.text")); label6.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label6, cc.xy(3, 13)); //---- readPowerLabel ---- readPowerLabel.setText(bundle.getString("JMuestraDatos.readPowerLabel.text")); panel2.add(readPowerLabel, cc.xy(5, 13)); //---- label7 ---- label7.setText(bundle.getString("JMuestraDatos.label7.text")); label7.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label7, cc.xy(3, 15)); //---- writePowerLevel ---- writePowerLevel.setText(bundle.getString("JMuestraDatos.writePowerLevel.text")); panel2.add(writePowerLevel, cc.xy(5, 15)); //---- usbConnectButton ---- usbConnectButton.setText(bundle.getString("JMuestraDatos.usbConnectButton.text")); usbConnectButton.setFont(new Font("Tahoma", Font.BOLD, 14)); usbConnectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { usbConnectButtonActionPerformed(e); } }); panel2.add(usbConnectButton, cc.xywh(3, 17, 3, 1)); //---- boxConnectButton ---- boxConnectButton.setText(bundle.getString("JMuestraDatos.boxConnectButton.text")); boxConnectButton.setFont(new Font("Tahoma", Font.BOLD, 14)); boxConnectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boxConnectButtonActionPerformed(e); } }); panel2.add(boxConnectButton, cc.xywh(9, 17, 3, 1)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel2.tab.title"), panel2); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(35)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(120)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(47)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(130)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(28)) }, new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- verifyDataButton ---- verifyDataButton.setText(bundle.getString("JMuestraDatos.verifyDataButton.text")); verifyDataButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/check_64.png"))); verifyDataButton.setHorizontalAlignment(SwingConstants.LEFT); verifyDataButton.setRolloverIcon(null); verifyDataButton.setPressedIcon(null); verifyDataButton.setFont(new Font("Tahoma", Font.BOLD, 16)); verifyDataButton.setEnabled(false); verifyDataButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { verifyDataButtonActionPerformed(e); } }); panel1.add(verifyDataButton, cc.xywh(3, 3, 3, 1)); //---- loadReadingsButton ---- loadReadingsButton.setText(bundle.getString("JMuestraDatos.loadReadingsButton.text")); loadReadingsButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/load_64.png"))); loadReadingsButton.setHorizontalAlignment(SwingConstants.LEFT); loadReadingsButton.setFont(new Font("Tahoma", Font.BOLD, 16)); loadReadingsButton.setEnabled(false); loadReadingsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loadReadingsButtonActionPerformed(e); } }); panel1.add(loadReadingsButton, cc.xywh(7, 3, 3, 1)); //---- readTagButton ---- readTagButton.setText(bundle.getString("JMuestraDatos.readTagButton.text")); readTagButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/scan_64.png"))); readTagButton.setHorizontalAlignment(SwingConstants.LEFT); readTagButton.setFont(new Font("Tahoma", Font.BOLD, 16)); readTagButton.setEnabled(false); readTagButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { readTagButtonActionPerformed(e); } }); panel1.add(readTagButton, cc.xywh(3, 5, 3, 1)); //---- countTagsButton ---- countTagsButton.setText(bundle.getString("JMuestraDatos.countTagsButton.text")); countTagsButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/counter_64.png"))); countTagsButton.setHorizontalAlignment(SwingConstants.LEFT); countTagsButton.setFont(new Font("Tahoma", Font.BOLD, 16)); countTagsButton.setEnabled(false); countTagsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { countTagsButtonActionPerformed(e); } }); panel1.add(countTagsButton, cc.xywh(7, 5, 3, 1)); //---- programTagButton ---- programTagButton.setText(bundle.getString("JMuestraDatos.programTagButton.text")); programTagButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/record_64.png"))); programTagButton.setHorizontalAlignment(SwingConstants.LEFT); programTagButton.setFont(new Font("Tahoma", Font.BOLD, 16)); programTagButton.setEnabled(false); programTagButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { programTagButtonActionPerformed(e); } }); panel1.add(programTagButton, cc.xywh(3, 7, 3, 1)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel1.tab.title"), panel1); //======== panel8 ======== { panel8.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(35)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(160)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(160)) }, new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- setBoxTimeButton ---- setBoxTimeButton.setText(bundle.getString("JMuestraDatos.setBoxTimeButton.text")); setBoxTimeButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/set_time_64.png"))); setBoxTimeButton.setHorizontalAlignment(SwingConstants.LEFT); setBoxTimeButton.setFont(new Font("Tahoma", Font.BOLD, 16)); setBoxTimeButton.setEnabled(false); setBoxTimeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setBoxTimeButtonActionPerformed(e); } }); panel8.add(setBoxTimeButton, cc.xy(3, 3)); //---- getBoxTimeButton ---- getBoxTimeButton.setText(bundle.getString("JMuestraDatos.getBoxTimeButton.text")); getBoxTimeButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/get_time_64.png"))); getBoxTimeButton.setHorizontalAlignment(SwingConstants.LEFT); getBoxTimeButton.setFont(new Font("Tahoma", Font.BOLD, 16)); getBoxTimeButton.setEnabled(false); getBoxTimeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getBoxTimeButtonActionPerformed(e); } }); panel8.add(getBoxTimeButton, cc.xy(5, 3)); //---- label20 ---- label20.setText(bundle.getString("JMuestraDatos.label20.text")); label20.setFont(new Font("Tahoma", Font.BOLD, 14)); panel8.add(label20, cc.xy(3, 5)); //---- label19 ---- label19.setText(bundle.getString("JMuestraDatos.label19.text")); label19.setFont(new Font("Tahoma", Font.BOLD, 14)); panel8.add(label19, cc.xy(5, 5)); panel8.add(systemTimeLabel, cc.xy(3, 7)); panel8.add(foxberryTimeLabel, cc.xy(5, 7)); panel8.add(foxberryTimeDiffLabel, cc.xy(5, 9)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel8.tab.title"), panel8); } panel4.add(tabbedPane1, cc.xy(1, 1)); } contentPane.add(panel4, BorderLayout.CENTER); //======== panel6 ======== { panel6.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(17)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(65)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(65)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(199)) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- label21 ---- label21.setText(bundle.getString("JMuestraDatos.label21.text")); label21.setFont(new Font("Tahoma", Font.BOLD, 16)); panel6.add(label21, cc.xy(3, 1)); //---- label1 ---- label1.setText(bundle.getString("JMuestraDatos.label1.text")); label1.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(label1, cc.xy(5, 1)); //---- usbStatusLabel ---- usbStatusLabel.setText(bundle.getString("JMuestraDatos.usbStatusLabel.text")); usbStatusLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(usbStatusLabel, cc.xy(7, 1)); //---- label16 ---- label16.setText(bundle.getString("JMuestraDatos.label16.text")); label16.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(label16, cc.xy(9, 1)); //---- tcpStatusLabel ---- tcpStatusLabel.setText(bundle.getString("JMuestraDatos.tcpStatusLabel.text")); tcpStatusLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(tcpStatusLabel, cc.xy(11, 1)); //---- label8 ---- label8.setText(bundle.getString("JMuestraDatos.label8.text")); label8.setFont(new Font("Tahoma", Font.BOLD, 16)); panel6.add(label8, cc.xy(3, 3)); //---- databaseLabel ---- databaseLabel.setText(bundle.getString("JMuestraDatos.databaseLabel.text")); panel6.add(databaseLabel, cc.xywh(3, 5, 11, 1)); } contentPane.add(panel6, BorderLayout.SOUTH); //======== panel7 ======== { panel7.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); } contentPane.add(panel7, BorderLayout.EAST); setSize(740, 620); setLocationRelativeTo(getOwner()); // //GEN-END:initComponents }
From source file:edu.harvard.mcz.imagecapture.ImageDisplayFrame.java
/** * This method initializes jTabbedPane * /* w w w . j a v a 2 s .c o m*/ * @return javax.swing.JTabbedPane */ private JTabbedPane getJTabbedPane() { if (jTabbedPane == null) { jTabbedPane = new JTabbedPane(); jTabbedPane.insertTab("FullImage", null, getPanelFullImage(), null, TAB_FULLIMAGE); jTabbedPane.insertTab("Specimen", null, getJPanelSpecimen(), null, TAB_SPECIMEN); jTabbedPane.insertTab("PinLabels", null, getJPanelLabels(), null, TAB_LABELS); jTabbedPane.insertTab("UnitTray Labels", null, getJPanelUTL(), null, TAB_UNITTRAYLABELS); jTabbedPane.insertTab("Taxon Label", null, getJPanelUnitTrayTaxon(), null, TAB_UNITTRAY); jTabbedPane.insertTab("Barcode", null, getJPanelBarcode(), null, TAB_BARCODE); } return jTabbedPane; }
From source file:ucar.unidata.idv.flythrough.Flythrough.java
/** * _more_//w w w . j a v a 2 s .c om * * * @throws RemoteException _more_ * @throws VisADException _more_ */ private void makeWidgets() throws VisADException, RemoteException { JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab("Dashboard", doMakeDashboardPanel()); tabbedPane.addTab("Values", doMakeValuesPanel()); tabbedPane.addTab("Description", doMakeDescriptionPanel()); tabbedPane.addTab("Viewpoint", doMakeViewpointPanel()); tabbedPane.addTab("Points", doMakePointsPanel()); JComponent innerContents = GuiUtils.topCenterBottom(animationWidget.getContents(), tabbedPane, doMakeNavigationPanel()); if (!showAnimation) { animationWidget.getContents().setVisible(false); } JComponent menuBar = doMakeMenuBar(); innerContents = GuiUtils.inset(innerContents, 5); contents = GuiUtils.topCenter(menuBar, innerContents); animation.setCurrent(currentIndex); }