OpFooter(OpControl control, List<LayerMode> layerModes) { super(BoxLayout.X_AXIS); layerControls = new LayerControls(control, layerModes, pcs); invertRegionSwitch = new InvertRegionCheckBox(control, pcs); colorControls = new ColorSelectionControls(control, pcs); Box blendBox = Box.createVerticalBox(); blendBox.add(Box.createVerticalStrut(5)); blendBox.add(layerControls); blendBox.add(invertRegionSwitch); blendBox.setBackground(LightZoneSkin.Colors.ToolPanesBackground); layerControls.setAlignmentX(Component.LEFT_ALIGNMENT); invertRegionSwitch.setAlignmentX(Component.LEFT_ALIGNMENT); tabPane = new JTabbedPane(); tabPane.setFont(LightZoneSkin.fontSet.getSmallFont()); tabPane.add(LOCALE.get("ToolSettingsTabName"), blendBox); tabPane.add(LOCALE.get("ColorSelectionTabName"), colorControls); tabPane.setIconAt(0, getThemeIcon(orangeScheme, true)); tabPane.setIconAt(1, getThemeIcon(orangeScheme, false)); add(tabPane, BorderLayout.NORTH); setBackground(LightZoneSkin.Colors.ToolPanesBackground); pcs.addPropertyChangeListener(this); }
protected void init() { setTitle(Messages.getInstance().getString("ChartEditorTitle")); editModel = new LegacyChartEditModel(); editModel.addPropertyChangeListener( LegacyChartEditModel.CHART_EXPRESSION_PROPERTY, new ChartExpressionChangeHandler()); editModel.addPropertyChangeListener( LegacyChartEditModel.PRIMARY_DATA_SOURCE_PROPERTY, new PrimaryDataSourceChangeHandler()); editModel.addPropertyChangeListener( LegacyChartEditModel.SECONDARY_DATA_SOURCE_PROPERTY, new SecondaryDataSourceChangeHandler()); chartTable = new ElementMetaDataTable(); chartPropertiesTableModel = new ChartExpressionPropertiesTableModel(); primaryDataSourceTable = new ElementMetaDataTable(); primaryDataSourcePropertiesTableModel = new ExpressionPropertiesTableModel(); primaryDataSourcePropertiesTableModel.setFilterInlineExpressionProperty(true); secondaryDataSourceTable = new ElementMetaDataTable(); secondaryDataSourcePropertiesTableModel = new ExpressionPropertiesTableModel(); secondaryDataSourcePropertiesTableModel.setFilterInlineExpressionProperty(true); dataSourceTabbedPane = new JTabbedPane(); dataSourceTabbedPane.add( Messages.getInstance().getString("PrimaryDataSource"), createPrimaryDataSourcePanel()); dataSourceTabbedPane.add( Messages.getInstance().getString("SecondaryDataSource"), createSecondaryDataSourcePanel()); super.init(); }
/** TabbedPaneDemo Constructor */ public TabbedPaneDemo(SwingSet2 swingset) { // Set the title for this demo, and an icon used to represent this // demo inside the SwingSet2 app. super(swingset, "TabbedPaneDemo", "toolbar/JTabbedPane.gif"); // create tab position controls JPanel tabControls = new JPanel(); tabControls.add(new JLabel(getString("TabbedPaneDemo.label"))); top = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.top"))); left = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.left"))); bottom = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.bottom"))); right = (JRadioButton) tabControls.add(new JRadioButton(getString("TabbedPaneDemo.right"))); getDemoPanel().add(tabControls, BorderLayout.NORTH); group = new ButtonGroup(); group.add(top); group.add(bottom); group.add(left); group.add(right); top.setSelected(true); top.addActionListener(this); bottom.addActionListener(this); left.addActionListener(this); right.addActionListener(this); // create tab tabbedpane = new JTabbedPane(); getDemoPanel().add(tabbedpane, BorderLayout.CENTER); String name = getString("TabbedPaneDemo.laine"); JLabel pix = new JLabel(createImageIcon("tabbedpane/laine.jpg", name)); tabbedpane.add(name, pix); name = getString("TabbedPaneDemo.ewan"); pix = new JLabel(createImageIcon("tabbedpane/ewan.jpg", name)); tabbedpane.add(name, pix); name = getString("TabbedPaneDemo.hania"); pix = new JLabel(createImageIcon("tabbedpane/hania.jpg", name)); tabbedpane.add(name, pix); name = getString("TabbedPaneDemo.bounce"); spin = new HeadSpin(); tabbedpane.add(name, spin); tabbedpane .getModel() .addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent e) { SingleSelectionModel model = (SingleSelectionModel) e.getSource(); if (model.getSelectedIndex() == tabbedpane.getTabCount() - 1) { spin.go(); } } }); }
@Override protected Container getMainPane(JPanel taskPanel, JPanel systemPanel) { JTabbedPane pane = new JTabbedPane(); pane.setUI(new WindowsTabbedPaneUI()); JScrollPane taskPane = new JScrollPane(); taskPane.setViewportView(taskPanel); pane.add(STRINGS.TASK_GRAPH, taskPane); JScrollPane systemPane = new JScrollPane(); systemPane.setViewportView(systemPanel); pane.add(STRINGS.SYSTEM_GRAPH, systemPane); return pane; }
private void updateTabBar(Vector vtThread) { pnlThread.removeAll(); for (int iThreadIndex = 0; iThreadIndex < vtThread.size(); iThreadIndex++) { try { Vector vtThreadInfo = (Vector) vtThread.elementAt(iThreadIndex); PanelThreadMonitor mntTemp = new PanelThreadMonitor(channel); String strThreadID = (String) vtThreadInfo.elementAt(0); String strThreadName = (String) vtThreadInfo.elementAt(1); int iThreadStatus = Integer.parseInt((String) vtThreadInfo.elementAt(2)); mntTemp.setThreadID(strThreadID); mntTemp.setThreadName(strThreadName); mntTemp.setThreadStatus(iThreadStatus); showResult(mntTemp.txtMonitor, (String) vtThreadInfo.elementAt(3)); mntTemp.addPropertyChangeListener(this); pnlThread.add(strThreadName, mntTemp); mntTemp.updateStatus(); } catch (Exception e) { e.printStackTrace(); MessageBox.showMessageDialog(this, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE); } } Skin.applySkin(this); }
public void setMetricsResults(MetricDisplaySpecification displaySpecification, MetricsRun run) { final MetricCategory[] categories = MetricCategory.values(); for (final MetricCategory category : categories) { final JTable table = tables.get(category); final String type = MetricsCategoryNameUtil.getShortNameForCategory(category); final MetricTableSpecification tableSpecification = displaySpecification.getSpecification(category); final MetricsResult results = run.getResultsForCategory(category); final MetricTableModel model = new MetricTableModel(results, type, tableSpecification); table.setModel(model); final Container tab = table.getParent().getParent(); if (model.getRowCount() == 0) { tabbedPane.remove(tab); continue; } final String longName = MetricsCategoryNameUtil.getLongNameForCategory(category); tabbedPane.add(tab, longName); final MyColumnListener columnListener = new MyColumnListener(tableSpecification, table); final TableColumnModel columnModel = table.getColumnModel(); columnModel.addColumnModelListener(columnListener); final int columnCount = columnModel.getColumnCount(); for (int i = 0; i < columnCount; i++) { final TableColumn column = columnModel.getColumn(i); column.addPropertyChangeListener(columnListener); } setRenderers(table, type); setColumnWidths(table, tableSpecification); } }
/** * Load in the {@link ucar.unidata.idv.ui.ParamInfo}-s defined in the xml from the given root * Element. Create a new JTable and add it into the GUI. * * @param root The xml root * @param i Which resource is this */ private void addList(Element root, int i) { List infos; boolean isWritable = resources.isWritableResource(i); if (root != null) { infos = createParamInfoList(root); } else { if (!isWritable) { return; } infos = new ArrayList(); } if (infos.size() == 0) { // infos.add(new ParamInfo("", null, null, null, null)); } ParamDefaultsTable table = new ParamDefaultsTable(infos, isWritable); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); String editableStr = ""; if (!isWritable) { editableStr = " (" + Msg.msg("non-editable") + ") "; } JLabel label = new JLabel( "<html>" + Msg.msg("Path: ${param1}", resources.get(i) + editableStr) + "</html>"); JPanel tablePanel = GuiUtils.topCenter(GuiUtils.inset(label, 4), new JScrollPane(table)); table.label = resources.getShortName(i); tableTabbedPane.add(resources.getShortName(i), tablePanel); myTables.add(table); }
private void showErrorPanel(ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement) { ErrorPanel errorPanel = _resultTabFactory.createErrorPanel(sqlExecErrorMsgs, lastExecutedStatement); _tabbedExecutionsPanel.add( s_stringMgr.getString("SQLResultExecuterPanel.ErrorTabHeader"), errorPanel); _tabbedExecutionsPanel.setSelectedComponent(errorPanel); }
protected void addClient(SocketAddress clientAddr) { if (!containsClient(clientAddr)) { ClientPanel clientPanel = new ClientPanel(clientAddr.toString()); tabbedPane.add(clientAddr.toString(), clientPanel); clients.put(clientAddr, clientPanel); } }
/** Utility method to layout the center panel that holds the payment chart. */ private JPanel layoutCenterPanel() { JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.add("Chart", new JScrollPane(paymentsChart)); tabbedPane.add("Table", new JScrollPane(paymentsTable)); final JPanel centerPanel = new JPanel(new BorderLayout()); centerPanel.add(tabbedPane); return centerPanel; }
public void addPanel(String name, JPanel panel) { if (tabbedPane.getTabCount() == 0) { preffered = panel.getPreferredSize(); } panel.setPreferredSize(preffered); tabbedPane.add(name, panel); }
protected void createOWLVizTabUI() { setLayout(new BorderLayout()); // Create the tabbed pane tabbedPane = new JTabbedPane(); add(tabbedPane); // ///////////////////////////////////////////////////////////////////// // // Build the asserted subclass hierarchy tabs // // //////////////////////////////////////////////////////////////////// assertedGraphModel = new OWLClassGraphAssertedModel(getOWLModelManager()); OWLVizGraphPanel assertedPanel = new OWLVizGraphPanel("Asserted hierarchy", this, getOWLEditorKit(), assertedGraphModel); assertedGraphComponent = assertedPanel.getGraphComponent(); setupListeners(assertedGraphComponent); tabbedPane.add(assertedPanel.getName(), assertedPanel); graphComponents.add(assertedGraphComponent); // ///////////////////////////////////////////////////////////////////// // // Build the inferred subclass hierarchy tabs // // //////////////////////////////////////////////////////////////////// inferredGraphModel = new OWLClassGraphInferredModel(getOWLModelManager()); OWLVizGraphPanel inferredPanel = new OWLVizGraphPanel("Inferred hierarchy", this, getOWLEditorKit(), inferredGraphModel); inferredGraphComponent = inferredPanel.getGraphComponent(); tabbedPane.add(inferredPanel.getName(), inferredPanel); graphComponents.add(inferredGraphComponent); // Group the asserted and inferred hierarchy tabs, so that operations // such as showing subclasses etc. are applied to both tabs. ArrayList<GraphComponent> list = new ArrayList<GraphComponent>(); list.add(assertedGraphComponent); list.add(inferredGraphComponent); componentGroupMap.put(assertedPanel, list); componentGroupMap.put(inferredPanel, list); // Create the toolbar createToolBar(assertedGraphComponent.getController(), assertedGraphComponent.getController()); }
/** Sets up the editor, does the layout, and so on. */ protected void setup(String resultLabel) { setLayout(new BorderLayout()); add(getToolbar(), BorderLayout.WEST); modelStatsText = new JTextArea(); tabbedPane = new JTabbedPane(); tabbedPane.add("Pattern", gesDisplay()); add(tabbedPane, BorderLayout.CENTER); add(menuBar(), BorderLayout.NORTH); }
public AdvancedMonitor(String title, int x, int y, int width, int height) { setTitle(title); setBounds(x, y, width, height); setLayout(new BorderLayout()); tabs = new JTabbedPane(); threadMonitor = new ThreadMonitorPanel(); threadMonitor.setVisible(true); chunkMonitor = new ChunkMonitorPanel(); chunkMonitor.setVisible(true); perfMonitor = new PerformanceMonitorPanel(); perfMonitor.setVisible(true); tabs.add("Threads", threadMonitor); tabs.add("Chunks", chunkMonitor); tabs.add("Performance", perfMonitor); add(tabs, BorderLayout.CENTER); }
public TabbedEditor(org.colos.ejs.osejs.Osejs _ejs, String _type, String _header) { ejs = _ejs; defaultType = _type; defaultHeader = _header; defaultString = new String(res.getString(defaultHeader + ".Page")); MyActionListener al = new MyActionListener(); popupMenu = new PopupMenu(); customMenuItems(al); // Creates the top menu items // common menu items copyPage = createMenuItem("copyPage", defaultHeader, al); upPage = createMenuItem("upPage", defaultHeader, al); dnPage = createMenuItem("dnPage", defaultHeader, al); renamePage = createMenuItem("renamePage", defaultHeader, al); popupMenu.addSeparator(); togglePage = createMenuItem("togglePage", defaultHeader, al); removePage = createMenuItem("removePage", defaultHeader, al); JPanel firstPanel = createFirstPanel(); tabbedPanel = new JTabbedPane(); tabbedPanel.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tabbedPanel.add(popupMenu); // tabbedPanel.setPreferredSize (res.getDimension("TabbedEditor.PreferredSize")); tabbedPanel.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { if (OSPRuntime.isPopupTrigger(evt)) // SwingUtilities.isRightMouseButton(evt)) showMenu(evt.getComponent(), evt.getX(), evt.getY()); } }); cardLayout = new CardLayout(); finalPanel = new JPanel(cardLayout); finalPanel.add(tabbedPanel, "TabbedPanel"); finalPanel.add(firstPanel, "FirstPanel"); setFont(finalPanel.getFont()); Font font = InterfaceUtils.font(null, res.getString("Editor.TitleFont")); addPageMI.setFont(font); copyPage.setFont(font); upPage.setFont(font); dnPage.setFont(font); togglePage.setFont(font); removePage.setFont(font); renamePage.setFont(font); myFont = font.deriveFont(Font.PLAIN); showFirstPage(); }
public void loadThread(String threadID, String threadName, String threadStatus) { try { PanelThreadMonitor mntTemp = new PanelThreadMonitor(channel); int iThreadStatus = Integer.parseInt(threadStatus); mntTemp.setThreadID(threadID); mntTemp.setThreadName(threadName); mntTemp.setThreadStatus(iThreadStatus); mntTemp.addPropertyChangeListener(this); pnlThread.add(threadName, mntTemp); mntTemp.updateStatus(); Skin.applySkin(mntTemp); } catch (Exception e) { e.printStackTrace(); MessageBox.showMessageDialog(this, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE); } }
public WindowMonitorController(MonitorControllerHWC mntr, TreePane tpane) { super("Monitor: " + mntr.toString(), true, true, true, true); myMonitor = mntr; myController = myMonitor.getMyController(); treePane = tpane; enabled = myMonitor.isEnabled(); setSize(400, 500); int n = treePane.getInternalFrameCount(); setLocation(20 * n, 20 * n); AdapterWindowMonitorController listener = new AdapterWindowMonitorController(); addInternalFrameListener(listener); addComponentListener(listener); JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); fillConfigurationPanel(); tabbedPane.add("Configuration", new JScrollPane(confPanel)); getContentPane().add(tabbedPane); }
public void addOptionsPage(OptionsPage page, String tabName) { // If the page does not exist, add it, and add the component // to the page. Component c = getTab(tabName); if (c == null) { // Create a new Page Box box = new Box(BoxLayout.Y_AXIS); box.add(page); box.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); tabPane.add(tabName, box); optionPages.add(page); } else { Box box = (Box) c; box.add(Box.createVerticalStrut(7)); box.add(page); optionPages.add(page); } pack(); }
public MetricsDisplay(@NotNull Project project) { final JTable projectMetricsTable = new JBTable(); tables.put(MetricCategory.Project, projectMetricsTable); final JTable fileTypeMetricsTable = new JBTable(); tables.put(MetricCategory.FileType, fileTypeMetricsTable); final JTable moduleMetricsTable = new JBTable(); tables.put(MetricCategory.Module, moduleMetricsTable); final JTable packageMetricsTable = new JBTable(); tables.put(MetricCategory.Package, packageMetricsTable); final JTable classMetricsTable = new JBTable(); tables.put(MetricCategory.Class, classMetricsTable); final JTable interfaceMetricsTable = new JBTable(); tables.put(MetricCategory.Interface, interfaceMetricsTable); final JTable methodMetricsTable = new JBTable(); tables.put(MetricCategory.Method, methodMetricsTable); setupTable(projectMetricsTable, project); setupTable(fileTypeMetricsTable, project); setupTable(moduleMetricsTable, project); setupTable(packageMetricsTable, project); setupTable(classMetricsTable, project); setupTable(interfaceMetricsTable, project); setupTable(methodMetricsTable, project); tabbedPane.add( MetricsReloadedBundle.message("project.metrics"), ScrollPaneFactory.createScrollPane(projectMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("file.type.metrics"), ScrollPaneFactory.createScrollPane(fileTypeMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("module.metrics"), ScrollPaneFactory.createScrollPane(moduleMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("package.metrics"), ScrollPaneFactory.createScrollPane(packageMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("class.metrics"), ScrollPaneFactory.createScrollPane(classMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("interface.metrics"), ScrollPaneFactory.createScrollPane(interfaceMetricsTable)); tabbedPane.add( MetricsReloadedBundle.message("method.metrics"), ScrollPaneFactory.createScrollPane(methodMetricsTable)); }
public void removeDiffOverlay(MetricDisplaySpecification displaySpecification) { final MetricCategory[] categories = MetricCategory.values(); for (final MetricCategory category : categories) { final JTable table = tables.get(category); final MetricTableModel model = (MetricTableModel) table.getModel(); model.setPrevResults(null); final Container tab = table.getParent().getParent(); if (model.getRowCount() == 0) { tabbedPane.remove(tab); continue; } final String longName = MetricsCategoryNameUtil.getLongNameForCategory(category); tabbedPane.add(tab, longName); final String shortName = MetricsCategoryNameUtil.getShortNameForCategory(category); setRenderers(table, shortName); final MetricTableSpecification specification = displaySpecification.getSpecification(category); setColumnWidths(table, specification); } hasOverlay = false; }
public MemoryMonitor() throws IOException { NioDatagramAcceptor acceptor = new NioDatagramAcceptor(); acceptor.setHandler(new MemoryMonitorHandler(this)); DefaultIoFilterChainBuilder chain = acceptor.getFilterChain(); chain.addLast("logger", new LoggingFilter()); DatagramSessionConfig dcfg = acceptor.getSessionConfig(); dcfg.setReuseAddress(true); frame = new JFrame("Memory monitor"); tabbedPane = new JTabbedPane(); tabbedPane.add("Welcome", createWelcomePanel()); frame.add(tabbedPane, BorderLayout.CENTER); clients = new ConcurrentHashMap<SocketAddress, ClientPanel>(); frame.pack(); frame.setLocation(300, 300); frame.setVisible(true); acceptor.bind(new InetSocketAddress(PORT)); System.out.println("UDPServer listening on port " + PORT); }
// ------------------------------------------------------------------------------ public void addNewTab(String clusterIdAs3DigitString) { tabbedPane.add(createScrolledPdfViewer(clusterIdAs3DigitString), clusterIdAs3DigitString); tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1); }
private void addInformationPanel() { // Create UI elements for connection information. JPanel informationPanel = new JPanel(); informationPanel.setLayout(new BorderLayout()); // Add the Host information JPanel connPanel = new JPanel(); connPanel.setLayout(new GridBagLayout()); connPanel.setBorder(BorderFactory.createTitledBorder("Connection information")); JLabel label = new JLabel("Host: "); label.setMinimumSize(new java.awt.Dimension(150, 14)); label.setMaximumSize(new java.awt.Dimension(150, 14)); connPanel.add( label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); JFormattedTextField field = new JFormattedTextField(connection.getServiceName()); field.setMinimumSize(new java.awt.Dimension(150, 20)); field.setMaximumSize(new java.awt.Dimension(150, 20)); field.setEditable(false); field.setBorder(null); connPanel.add( field, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); // Add the Port information label = new JLabel("Port: "); label.setMinimumSize(new java.awt.Dimension(150, 14)); label.setMaximumSize(new java.awt.Dimension(150, 14)); connPanel.add( label, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); field = new JFormattedTextField(connection.getPort()); field.setMinimumSize(new java.awt.Dimension(150, 20)); field.setMaximumSize(new java.awt.Dimension(150, 20)); field.setEditable(false); field.setBorder(null); connPanel.add( field, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); // Add the connection's User information label = new JLabel("User: "******"Creation time: "); label.setMinimumSize(new java.awt.Dimension(150, 14)); label.setMaximumSize(new java.awt.Dimension(150, 14)); connPanel.add( label, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); field = new JFormattedTextField(new SimpleDateFormat("yyyy.MM.dd hh:mm:ss:SS aaa")); field.setMinimumSize(new java.awt.Dimension(150, 20)); field.setMaximumSize(new java.awt.Dimension(150, 20)); field.setValue(creationTime); field.setEditable(false); field.setBorder(null); connPanel.add( field, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); // Add the connection's creationTime information label = new JLabel("Status: "); label.setMinimumSize(new java.awt.Dimension(150, 14)); label.setMaximumSize(new java.awt.Dimension(150, 14)); connPanel.add( label, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); statusField = new JFormattedTextField(); statusField.setMinimumSize(new java.awt.Dimension(150, 20)); statusField.setMaximumSize(new java.awt.Dimension(150, 20)); statusField.setValue("Active"); statusField.setEditable(false); statusField.setBorder(null); connPanel.add( statusField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); // Add the connection panel to the information panel informationPanel.add(connPanel, BorderLayout.NORTH); // Add the Number of sent packets information JPanel packetsPanel = new JPanel(); packetsPanel.setLayout(new GridLayout(1, 1)); packetsPanel.setBorder(BorderFactory.createTitledBorder("Transmitted Packets")); statisticsTable = new DefaultTableModel( new Object[][] { {"IQ", 0, 0}, {"Message", 0, 0}, {"Presence", 0, 0}, {"Other", 0, 0}, {"Total", 0, 0} }, new Object[] {"Type", "Received", "Sent"}) { private static final long serialVersionUID = -6793886085109589269L; public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } }; JTable table = new JTable(statisticsTable); // Allow only single a selection table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packetsPanel.add(new JScrollPane(table)); // Add the packets panel to the information panel informationPanel.add(packetsPanel, BorderLayout.CENTER); tabbedPane.add("Information", new JScrollPane(informationPanel)); tabbedPane.setToolTipTextAt(4, "Information and statistics about the debugged connection"); }
private void addAdhocPacketPanel() { // Create UI elements for sending ad-hoc messages. final JTextArea adhocMessages = new JTextArea(); adhocMessages.setEditable(true); adhocMessages.setForeground(new Color(1, 94, 35)); tabbedPane.add("Ad-hoc message", new JScrollPane(adhocMessages)); tabbedPane.setToolTipTextAt(3, "Panel that allows you to send adhoc packets"); // Add pop-up menu. JPopupMenu menu = new JPopupMenu(); JMenuItem menuItem = new JMenuItem("Message"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { adhocMessages.setText( "<message to=\"\" id=\"" + StringUtils.randomString(5) + "-X\"><body></body></message>"); } }); menu.add(menuItem); menuItem = new JMenuItem("IQ Get"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { adhocMessages.setText( "<iq type=\"get\" to=\"\" id=\"" + StringUtils.randomString(5) + "-X\"><query xmlns=\"\"></query></iq>"); } }); menu.add(menuItem); menuItem = new JMenuItem("IQ Set"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { adhocMessages.setText( "<iq type=\"set\" to=\"\" id=\"" + StringUtils.randomString(5) + "-X\"><query xmlns=\"\"></query></iq>"); } }); menu.add(menuItem); menuItem = new JMenuItem("Presence"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { adhocMessages.setText( "<presence to=\"\" id=\"" + StringUtils.randomString(5) + "-X\"/>"); } }); menu.add(menuItem); menu.addSeparator(); menuItem = new JMenuItem("Send"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { if (!"".equals(adhocMessages.getText())) { AdHocPacket packetToSend = new AdHocPacket(adhocMessages.getText()); connection.sendPacket(packetToSend); } } }); menu.add(menuItem); menuItem = new JMenuItem("Clear"); menuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { adhocMessages.setText(null); } }); menu.add(menuItem); // Add listener to the text area so the popup menu can come up. adhocMessages.addMouseListener(new PopupListener(menu)); }
private void addBasicPanels() { JSplitPane allPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); allPane.setOneTouchExpandable(true); messagesTable = new DefaultTableModel( new Object[] {"Hide", "Timestamp", "", "", "Message", "Id", "Type", "To", "From"}, 0) { private static final long serialVersionUID = 8136121224474217264L; public boolean isCellEditable(int rowIndex, int mColIndex) { return false; } public Class<?> getColumnClass(int columnIndex) { if (columnIndex == 2 || columnIndex == 3) { return Icon.class; } return super.getColumnClass(columnIndex); } }; JTable table = new JTable(messagesTable); // Allow only single a selection table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // Hide the first column table.getColumnModel().getColumn(0).setMaxWidth(0); table.getColumnModel().getColumn(0).setMinWidth(0); table.getTableHeader().getColumnModel().getColumn(0).setMaxWidth(0); table.getTableHeader().getColumnModel().getColumn(0).setMinWidth(0); // Set the column "timestamp" size table.getColumnModel().getColumn(1).setMaxWidth(300); table.getColumnModel().getColumn(1).setPreferredWidth(90); // Set the column "direction" icon size table.getColumnModel().getColumn(2).setMaxWidth(50); table.getColumnModel().getColumn(2).setPreferredWidth(30); // Set the column "packet type" icon size table.getColumnModel().getColumn(3).setMaxWidth(50); table.getColumnModel().getColumn(3).setPreferredWidth(30); // Set the column "Id" size table.getColumnModel().getColumn(5).setMaxWidth(100); table.getColumnModel().getColumn(5).setPreferredWidth(55); // Set the column "type" size table.getColumnModel().getColumn(6).setMaxWidth(200); table.getColumnModel().getColumn(6).setPreferredWidth(50); // Set the column "to" size table.getColumnModel().getColumn(7).setMaxWidth(300); table.getColumnModel().getColumn(7).setPreferredWidth(90); // Set the column "from" size table.getColumnModel().getColumn(8).setMaxWidth(300); table.getColumnModel().getColumn(8).setPreferredWidth(90); // Create a table listener that listen for row selection events SelectionListener selectionListener = new SelectionListener(table); table.getSelectionModel().addListSelectionListener(selectionListener); table.getColumnModel().getSelectionModel().addListSelectionListener(selectionListener); allPane.setTopComponent(new JScrollPane(table)); messageTextArea = new JTextArea(); messageTextArea.setEditable(false); // Add pop-up menu. JPopupMenu menu = new JPopupMenu(); JMenuItem menuItem1 = new JMenuItem("Copy"); menuItem1.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // Get the clipboard Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); // Set the sent text as the new content of the clipboard clipboard.setContents(new StringSelection(messageTextArea.getText()), null); } }); menu.add(menuItem1); // Add listener to the text area so the popup menu can come up. messageTextArea.addMouseListener(new PopupListener(menu)); JPanel sublayout = new JPanel(new BorderLayout()); sublayout.add(new JScrollPane(messageTextArea), BorderLayout.CENTER); JButton clearb = new JButton("Clear All Packets"); clearb.addActionListener( new AbstractAction() { private static final long serialVersionUID = -8576045822764763613L; @Override public void actionPerformed(ActionEvent e) { messagesTable.setRowCount(0); } }); sublayout.add(clearb, BorderLayout.NORTH); allPane.setBottomComponent(sublayout); allPane.setDividerLocation(150); tabbedPane.add("All Packets", allPane); tabbedPane.setToolTipTextAt(0, "Sent and received packets processed by Smack"); // Create UI elements for client generated XML traffic. final JTextArea sentText = new JTextArea(); sentText.setWrapStyleWord(true); sentText.setLineWrap(true); sentText.setEditable(false); sentText.setForeground(new Color(112, 3, 3)); tabbedPane.add("Raw Sent Packets", new JScrollPane(sentText)); tabbedPane.setToolTipTextAt(1, "Raw text of the sent packets"); // Add pop-up menu. menu = new JPopupMenu(); menuItem1 = new JMenuItem("Copy"); menuItem1.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // Get the clipboard Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); // Set the sent text as the new content of the clipboard clipboard.setContents(new StringSelection(sentText.getText()), null); } }); JMenuItem menuItem2 = new JMenuItem("Clear"); menuItem2.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { sentText.setText(""); } }); // Add listener to the text area so the popup menu can come up. sentText.addMouseListener(new PopupListener(menu)); menu.add(menuItem1); menu.add(menuItem2); // Create UI elements for server generated XML traffic. final JTextArea receivedText = new JTextArea(); receivedText.setWrapStyleWord(true); receivedText.setLineWrap(true); receivedText.setEditable(false); receivedText.setForeground(new Color(6, 76, 133)); tabbedPane.add("Raw Received Packets", new JScrollPane(receivedText)); tabbedPane.setToolTipTextAt(2, "Raw text of the received packets before Smack process them"); // Add pop-up menu. menu = new JPopupMenu(); menuItem1 = new JMenuItem("Copy"); menuItem1.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // Get the clipboard Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); // Set the sent text as the new content of the clipboard clipboard.setContents(new StringSelection(receivedText.getText()), null); } }); menuItem2 = new JMenuItem("Clear"); menuItem2.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { receivedText.setText(""); } }); // Add listener to the text area so the popup menu can come up. receivedText.addMouseListener(new PopupListener(menu)); menu.add(menuItem1); menu.add(menuItem2); // Create a special Reader that wraps the main Reader and logs data to the GUI. ObservableReader debugReader = new ObservableReader(reader); readerListener = new ReaderListener() { public void read(final String str) { SwingUtilities.invokeLater( new Runnable() { public void run() { if (EnhancedDebuggerWindow.PERSISTED_DEBUGGER && !EnhancedDebuggerWindow.getInstance().isVisible()) { // Do not add content if the parent is not visible return; } int index = str.lastIndexOf(">"); if (index != -1) { if (receivedText.getLineCount() >= EnhancedDebuggerWindow.MAX_TABLE_ROWS) { try { receivedText.replaceRange("", 0, receivedText.getLineEndOffset(0)); } catch (BadLocationException e) { e.printStackTrace(); } } receivedText.append(str.substring(0, index + 1)); receivedText.append(NEWLINE); if (str.length() > index) { receivedText.append(str.substring(index + 1)); } } else { receivedText.append(str); } } }); } }; debugReader.addReaderListener(readerListener); // Create a special Writer that wraps the main Writer and logs data to the GUI. ObservableWriter debugWriter = new ObservableWriter(writer); writerListener = new WriterListener() { public void write(final String str) { SwingUtilities.invokeLater( new Runnable() { public void run() { if (EnhancedDebuggerWindow.PERSISTED_DEBUGGER && !EnhancedDebuggerWindow.getInstance().isVisible()) { // Do not add content if the parent is not visible return; } if (sentText.getLineCount() >= EnhancedDebuggerWindow.MAX_TABLE_ROWS) { try { sentText.replaceRange("", 0, sentText.getLineEndOffset(0)); } catch (BadLocationException e) { e.printStackTrace(); } } sentText.append(str); if (str.endsWith(">")) { sentText.append(NEWLINE); } } }); } }; debugWriter.addWriterListener(writerListener); // Assign the reader/writer objects to use the debug versions. The packet reader // and writer will use the debug versions when they are created. reader = debugReader; writer = debugWriter; }
private void jbInit() throws Exception { printButton.setToolTipText( ClientSettings.getInstance().getResources().getResource("print document")); printButton.addActionListener(new SaleCreditDocFrame_printButton_actionAdapter(this)); addPanel.setLayout(borderLayout5); confirmButton.addActionListener(new SaleCreditDocFrame_confirmButton_actionAdapter(this)); headerFormPanel.setFunctionId("DOC01_CREDITNOTES"); headerFormPanel.setFormController(controller); headerFormPanel.setVOClassName("org.jallinone.sales.documents.java.DetailSaleDocVO"); headerPanel.setLayout(borderLayout3); headerButtonsPanel.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); mainPanel.setLayout(borderLayout2); this.getContentPane().setLayout(borderLayout1); linesPanel.setLayout(borderLayout4); insertButton1.setText("insertButton1"); reloadButton1.setText("reloadButton1"); deleteButton1.setText("deleteButton1"); headerFormPanel.setLayout(gridBagLayout1); headerFormPanel.setInsertButton(insertButton1); headerFormPanel.setEditButton(editButton1); headerFormPanel.setReloadButton(reloadButton1); headerFormPanel.setDeleteButton(deleteButton1); headerFormPanel.setSaveButton(saveButton1); this.getContentPane().add(mainPanel, BorderLayout.CENTER); mainPanel.add(tabbedPane, BorderLayout.CENTER); tabbedPane.add(headerPanel, "header"); headerPanel.add(headerButtonsPanel, BorderLayout.NORTH); headerButtonsPanel.add(insertButton1, null); headerButtonsPanel.add(editButton1, null); headerButtonsPanel.add(saveButton1, null); headerButtonsPanel.add(reloadButton1, null); headerButtonsPanel.add(deleteButton1, null); headerButtonsPanel.add(confirmButton, null); printButton.setEnabled(false); headerButtonsPanel.add(printButton, null); linesPanel.add(rowsPanel, BorderLayout.CENTER); headerPanel.add(headerFormPanel, BorderLayout.CENTER); headerFormPanel.add( saleIdHeadPanel1, new GridBagConstraints( 0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); headerFormPanel.add( saleCustomerHeadPanel1, new GridBagConstraints( 0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); headerFormPanel.add( warePanel, new GridBagConstraints( 0, 2, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); headerFormPanel.add( saleTotalsPanel1, new GridBagConstraints( 0, 3, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); confirmButton.setToolTipText( ClientSettings.getInstance().getResources().getResource("credit note closing")); confirmButton.setEnabled(false); addPanel.add(saleAgentPanel, BorderLayout.NORTH); addPanel.add(saleNotesPanel, BorderLayout.CENTER); tabbedPane.add(addPanel, "notes"); tabbedPane.add(linesPanel, "items"); tabbedPane.add(discPanel, "customer discounts"); tabbedPane.add(chargePanel, "charges"); tabbedPane.add(actPanel, "activities"); headerFormPanel.addLinkedPanel(addPanel); tabbedPane.setTitleAt(0, ClientSettings.getInstance().getResources().getResource("header")); tabbedPane.setTitleAt(1, ClientSettings.getInstance().getResources().getResource("notes")); tabbedPane.setTitleAt(2, ClientSettings.getInstance().getResources().getResource("items")); tabbedPane.setTitleAt( 3, ClientSettings.getInstance().getResources().getResource("customer discounts")); tabbedPane.setTitleAt(4, ClientSettings.getInstance().getResources().getResource("charges")); tabbedPane.setTitleAt( 5, ClientSettings.getInstance().getResources().getResource("sale activities")); }
/** * Method for adding a new Panel * * @param object The new Panel */ public void addPanel(GPropertiesPanel object, String title) { pane.add(object, title); objects.add(object); }
public Component addTab(String title, Component component) { return tabs.add(title, component); }
private void jbInit() throws Exception { this.setWidth(580); this.setHeight(450); this.setDeviceType("CADH"); this.setDeviceProvider("localhost"); this.setDeviceTitle("INCAA CADH 4 Channels Transient Recorder"); this.getContentPane().setLayout(borderLayout1); jPanel1.setLayout(borderLayout2); deviceChannel1.setLabelString("Ch1: "); deviceChannel1.setOffsetNid(10); deviceChannel1.setBorderVisible(true); deviceChannel1.setInSameLine(true); deviceChannel1.setUpdateIdentifier(""); deviceChannel1.setShowVal(""); deviceChannel1.setLayout(flowLayout1); jPanel3.setLayout(gridLayout1); gridLayout1.setColumns(1); gridLayout1.setRows(4); jPanel5.setLayout(flowLayout2); deviceField2.setOffsetNid(11); deviceField2.setLabelString("Start: "); deviceField2.setIdentifier(""); deviceField1.setOffsetNid(12); deviceField1.setLabelString("End: "); deviceField1.setIdentifier(""); deviceField3.setIdentifier(""); deviceField3.setLabelString("End: "); deviceField3.setOffsetNid(30); deviceChannel2.setLayout(flowLayout3); deviceChannel2.setShowVal(""); deviceChannel2.setUpdateIdentifier(""); deviceChannel2.setInSameLine(true); deviceChannel2.setBorderVisible(true); deviceChannel2.setOffsetNid(28); deviceChannel2.setLabelString("Ch4: "); jPanel6.setLayout(flowLayout4); deviceField4.setOffsetNid(29); deviceField4.setLabelString("Start: "); deviceField4.setIdentifier(""); deviceField5.setIdentifier(""); deviceField5.setLabelString("End: "); deviceField5.setOffsetNid(24); deviceChannel3.setLayout(flowLayout5); deviceChannel3.setShowVal(""); deviceChannel3.setUpdateIdentifier(""); deviceChannel3.setInSameLine(true); deviceChannel3.setBorderVisible(true); deviceChannel3.setOffsetNid(22); deviceChannel3.setLabelString("Ch3: "); jPanel7.setLayout(flowLayout6); deviceField6.setOffsetNid(23); deviceField6.setLabelString("Start: "); deviceField6.setIdentifier(""); deviceField7.setIdentifier(""); deviceField7.setLabelString("End: "); deviceField7.setOffsetNid(18); deviceChannel4.setLayout(flowLayout7); deviceChannel4.setShowVal(""); deviceChannel4.setUpdateIdentifier(""); deviceChannel4.setInSameLine(true); deviceChannel4.setBorderVisible(true); deviceChannel4.setOffsetNid(16); deviceChannel4.setLabelString("Ch2: "); jPanel8.setLayout(flowLayout8); deviceField8.setOffsetNid(17); deviceField8.setLabelString("Start: "); deviceField8.setIdentifier(""); jPanel4.setLayout(gridLayout2); gridLayout2.setColumns(1); gridLayout2.setRows(4); deviceChannel5.setLabelString("Ch1: "); deviceChannel5.setOffsetNid(10); deviceChannel5.setBorderVisible(true); deviceChannel5.setInSameLine(true); deviceChannel5.setUpdateIdentifier(""); deviceChannel5.setShowVal(""); deviceChannel5.setLayout(flowLayout14); jPanel9.setLayout(flowLayout9); deviceField10.setOffsetNid(13); deviceField10.setLabelString("Start Idx: "); deviceField10.setIdentifier(""); deviceField9.setOffsetNid(14); deviceField9.setLabelString("End Idx: "); deviceField9.setIdentifier(""); deviceField11.setIdentifier(""); deviceField11.setLabelString("Start Idx: "); deviceField11.setOffsetNid(31); deviceField12.setIdentifier(""); deviceField12.setLabelString("End Idx: "); deviceField12.setOffsetNid(32); jPanel10.setLayout(flowLayout10); deviceChannel6.setLabelString("Ch4: "); deviceChannel6.setOffsetNid(28); deviceChannel6.setBorderVisible(true); deviceChannel6.setInSameLine(true); deviceChannel6.setUpdateIdentifier(""); deviceChannel6.setShowVal(""); deviceChannel6.setLayout(flowLayout16); deviceField13.setIdentifier(""); deviceField13.setLabelString("Start Idx: "); deviceField13.setOffsetNid(25); deviceField14.setIdentifier(""); deviceField14.setLabelString("End Idx: "); deviceField14.setOffsetNid(26); jPanel11.setLayout(flowLayout11); deviceChannel7.setLabelString("Ch3: "); deviceChannel7.setOffsetNid(22); deviceChannel7.setBorderVisible(true); deviceChannel7.setInSameLine(true); deviceChannel7.setUpdateIdentifier(""); deviceChannel7.setShowVal(""); deviceChannel7.setLayout(flowLayout15); deviceField15.setIdentifier(""); deviceField15.setLabelString("Start Idx: "); deviceField15.setOffsetNid(19); deviceField16.setIdentifier(""); deviceField16.setLabelString("End Idx: "); deviceField16.setOffsetNid(20); jPanel12.setLayout(flowLayout12); deviceChannel8.setLabelString("Ch2: "); deviceChannel8.setOffsetNid(16); deviceChannel8.setBorderVisible(true); deviceChannel8.setInSameLine(true); deviceChannel8.setUpdateIdentifier(""); deviceChannel8.setShowVal(""); deviceChannel8.setLayout(flowLayout13); jPanel2.setLayout(gridLayout3); gridLayout3.setColumns(1); gridLayout3.setRows(4); deviceField17.setOffsetNid(1); deviceField17.setTextOnly(true); deviceField17.setLabelString("CAMAC Name: "); deviceField17.setIdentifier(""); deviceChoice1.setChoiceIntValues(null); deviceChoice1.setChoiceFloatValues(null); deviceChoice1.setOffsetNid(8); deviceChoice1.setLabelString("Use Time: "); deviceChoice1.setChoiceItems(new String[] {"TRUE", "FALSE"}); deviceChoice1.setUpdateIdentifier(""); deviceChoice1.setIdentifier(""); deviceField18.setOffsetNid(2); deviceField18.setTextOnly(true); deviceField18.setLabelString("Comment: "); deviceField18.setNumCols(35); deviceField18.setIdentifier(""); deviceField20.setOffsetNid(6); deviceField20.setLabelString("Clock Source: "); deviceField20.setNumCols(15); deviceField20.setIdentifier(""); deviceField19.setOffsetNid(5); deviceField19.setLabelString("Trig. Source: "); deviceField19.setNumCols(15); deviceField19.setIdentifier(""); deviceChoice4.setChoiceIntValues(null); deviceChoice4.setChoiceFloatValues(null); deviceChoice4.setOffsetNid(4); deviceChoice4.setLabelString("Clock Mode: "); deviceChoice4.setChoiceItems(new String[] {"INTERNAL", "EXTERNAL"}); deviceChoice4.setUpdateIdentifier(""); deviceChoice4.setIdentifier(""); deviceChoice3.setChoiceIntValues(null); deviceChoice3.setChoiceFloatValues( new float[] { (float) 500000.0, (float) 250000.0, (float) 125000.0, (float) 50000.0, (float) 10000.0, (float) 5000.0, (float) 1000.0, (float) 500.0 }); deviceChoice3.setOffsetNid(7); deviceChoice3.setLabelString("Frequency: "); deviceChoice3.setChoiceItems( new String[] {"500E3", "250E3", "125E3", "50E3", "10E3", "5E3", "1E3", "500"}); deviceChoice3.setUpdateIdentifier(""); deviceChoice3.setIdentifier(""); deviceChoice2.setChoiceIntValues(new int[] {(int) 1, (int) 2, (int) 4}); deviceChoice2.setChoiceFloatValues(null); deviceChoice2.setOffsetNid(3); deviceChoice2.setLabelString("Num. Channels: "); deviceChoice2.setChoiceItems(new String[] {"1", "2", "4"}); deviceChoice2.setUpdateIdentifier(""); deviceChoice2.setIdentifier(""); deviceButtons1.setCheckExpressions(null); deviceButtons1.setCheckMessages(null); deviceButtons1.setMethods(new String[] {"INIT", "TRIGGER", "STORE"}); this.getContentPane().add(deviceButtons1, BorderLayout.SOUTH); this.getContentPane().add(jPanel1, BorderLayout.NORTH); jPanel1.add(jPanel2, BorderLayout.CENTER); jPanel2.add(jPanel13, null); jPanel13.add(deviceField17, null); jPanel13.add(deviceDispatch1, null); jPanel13.add(deviceChoice1, null); jPanel2.add(jPanel16, null); jPanel16.add(deviceField18, null); jPanel2.add(jPanel15, null); jPanel15.add(deviceField20, null); jPanel15.add(deviceField19, null); jPanel2.add(jPanel14, null); jPanel14.add(deviceChoice4, null); jPanel14.add(deviceChoice3, null); jPanel14.add(deviceChoice2, null); jPanel1.add(jTabbedPane1, BorderLayout.SOUTH); jTabbedPane1.add(jPanel3, "Channels (Time)"); jPanel3.add(deviceChannel1, null); deviceChannel1.add(jPanel5, null); jPanel5.add(deviceField2, null); jPanel5.add(deviceField1, null); jPanel3.add(deviceChannel4, null); deviceChannel4.add(jPanel8, null); jPanel8.add(deviceField8, null); jPanel8.add(deviceField7, null); jPanel3.add(deviceChannel3, null); deviceChannel3.add(jPanel7, null); jPanel7.add(deviceField6, null); jPanel7.add(deviceField5, null); jPanel3.add(deviceChannel2, null); deviceChannel2.add(jPanel6, null); jPanel6.add(deviceField4, null); jPanel6.add(deviceField3, null); jTabbedPane1.add(jPanel4, "Channels (Samples)"); jPanel4.add(deviceChannel5, null); deviceChannel5.add(jPanel9, null); jPanel9.add(deviceField10, null); jPanel9.add(deviceField9, null); jPanel4.add(deviceChannel8, null); deviceChannel8.add(jPanel12, null); jPanel12.add(deviceField15, null); jPanel12.add(deviceField16, null); jPanel4.add(deviceChannel7, null); deviceChannel7.add(jPanel11, null); jPanel11.add(deviceField13, null); jPanel11.add(deviceField14, null); jPanel4.add(deviceChannel6, null); deviceChannel6.add(jPanel10, null); jPanel10.add(deviceField11, null); jPanel10.add(deviceField12, null); }
private void jbInit() throws Exception { hierarTreePanel.setEnabled(false); warehousePanel.setLayout(borderLayout1); warehouseForm.setVOClassName("org.jallinone.warehouse.java.WarehouseVO"); this.setTitle(ClientSettings.getInstance().getResources().getResource("warehouse detail")); buttonsPanel.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); insertButton.setText("insertButton1"); reloadButton.setText("reloadButton1"); deleteButton.setText("deleteButton1"); warehouseForm.setInsertButton(insertButton); warehouseForm.setCopyButton(copyButton); warehouseForm.setEditButton(editButton); warehouseForm.setReloadButton(reloadButton); warehouseForm.setDeleteButton(deleteButton); warehouseForm.setSaveButton(saveButton); warehouseForm.setFunctionId("WAR01"); warehouseForm.setLayout(gridBagLayout1); controlZip.setAttributeName("zipWAR01"); controlZip.setCanCopy(true); controlZip.setLinkLabel(labelZip); controlZip.setMaxCharacters(20); controlProv.setAttributeName("provinceWAR01"); controlProv.setCanCopy(true); controlProv.setLinkLabel(labelProv); controlProv.setMaxCharacters(20); controlProv.setTrimText(true); controlProv.setUpperCase(true); controlCity.setAttributeName("cityWAR01"); controlCity.setCanCopy(true); controlCity.setLinkLabel(labelCity); controlAddress.setAttributeName("addressWAR01"); controlAddress.setCanCopy(true); controlAddress.setLinkLabel(labelAddress); labelAddress.setText("address"); controlCountry.setAttributeName("countryWAR01"); controlCountry.setCanCopy(true); controlCountry.setLinkLabel(labelCountry); controlCountry.setMaxCharacters(20); controlCountry.setTrimText(true); controlCountry.setUpperCase(true); labelZip.setText("zip"); labelCity.setText("city"); labelCountry.setText("country"); labelProv.setText("prov"); controlWarCode.setAttributeName("warehouseCodeWAR01"); controlWarCode.setLinkLabel(labelWarCode); controlWarCode.setMaxCharacters(20); controlWarCode.setRequired(true); controlWarCode.setRpadding(false); controlWarCode.setTrimText(true); controlWarCode.setUpperCase(true); controlWarCode.setEnabledOnEdit(false); labelWarCode.setText("warehouseCodeWAR01"); labelDescr.setText("descriptionWAR01"); controlDescr.setAttributeName("descriptionWAR01"); controlDescr.setLinkLabel(labelDescr); controlDescr.setRequired(true); labelCompanyCode.setText("companyCodeSys01WAR01"); controlCompaniesCombo.setAttributeName("companyCodeSys01WAR01"); controlCompaniesCombo.setCanCopy(true); controlCompaniesCombo.setLinkLabel(labelCompanyCode); controlCompaniesCombo.setRequired(true); controlCompaniesCombo.setEnabledOnEdit(false); labelRoles.setText("edit/delete warehouse role"); controlRoles.setAttributeName("progressiveSys04WAR01"); controlRoles.setDomainId("USERROLES"); controlRoles.setLinkLabel(labelRoles); locationsPanel.setLayout(borderLayout2); tabbedPane.add(warehousePanel, "warehousePanel"); this.getContentPane().add(buttonsPanel, BorderLayout.NORTH); this.getContentPane().add(tabbedPane, BorderLayout.CENTER); warehouseForm.add( labelZip, new GridBagConstraints( 3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCity, new GridBagConstraints( 0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelAddress, new GridBagConstraints( 0, 3, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlAddress, new GridBagConstraints( 2, 3, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlCity, new GridBagConstraints( 2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 100, 0)); warehouseForm.add( controlZip, new GridBagConstraints( 4, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlWarCode, new GridBagConstraints( 2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 100, 0)); warehousePanel.add(warehouseForm, BorderLayout.CENTER); buttonsPanel.add(insertButton, null); buttonsPanel.add(copyButton, null); buttonsPanel.add(editButton, null); buttonsPanel.add(saveButton, null); buttonsPanel.add(reloadButton, null); buttonsPanel.add(deleteButton, null); buttonsPanel.add(navigatorBar, null); warehouseForm.add( labelWarCode, new GridBagConstraints( 0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); warehouseForm.add( labelDescr, new GridBagConstraints( 0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlDescr, new GridBagConstraints( 2, 2, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlCountry, new GridBagConstraints( 4, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCountry, new GridBagConstraints( 3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelProv, new GridBagConstraints( 0, 5, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); warehouseForm.add( controlProv, new GridBagConstraints( 2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCompanyCode, new GridBagConstraints( 0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); tabbedPane.add(locationsPanel, "locationsPanel"); locationsPanel.add(split, BorderLayout.CENTER); split.setDividerLocation(150); split.add(hierarTreePanel, JSplitPane.LEFT); split.add(availPanel, JSplitPane.RIGHT); tabbedPane.add(bookedItemsPanel, "bookedItemsPanel"); tabbedPane.add(orderedItemsPanel, "orderedItemsPanel"); hierarTreePanel.setFunctionId("WAR01"); tabbedPane.setTitleAt( 0, ClientSettings.getInstance().getResources().getResource("warehouse detail")); tabbedPane.setTitleAt(1, ClientSettings.getInstance().getResources().getResource("positions")); tabbedPane.setTitleAt( 2, ClientSettings.getInstance().getResources().getResource("bookedItemsPanel")); tabbedPane.setTitleAt( 3, ClientSettings.getInstance().getResources().getResource("orderedItemsPanel")); warehouseForm.add( controlCompaniesCombo, new GridBagConstraints( 2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlRoles, new GridBagConstraints( 2, 6, 1, 2, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelRoles, new GridBagConstraints( 0, 7, 2, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); }