List of usage examples for javax.swing.event ChangeListener ChangeListener
ChangeListener
From source file:com.peterbochs.PeterBochsDebugger.java
private JSplitPane getJSplitPane2() { jSplitPane2 = new JSplitPane(); jSplitPane2.setPreferredSize(new java.awt.Dimension(1009, 781)); jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); {/*from w w w .ja v a2s. com*/ jSplitPane1 = new JSplitPane(); jSplitPane2.add(jSplitPane1, JSplitPane.TOP); jSplitPane1.setDividerLocation(400); { jTabbedPane1 = new JMaximizableTabbedPane(); jSplitPane1.add(jTabbedPane1, JSplitPane.RIGHT); jTabbedPane1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jTabbedPane1StateChanged(evt); } }); { jPanel10 = new JPanel(); BorderLayout jPanel10Layout = new BorderLayout(); jPanel10.setLayout(jPanel10Layout); jTabbedPane1.addTab(MyLanguage.getString("Instruction"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/text_padding_top.png")), jPanel10, null); jPanel10.setPreferredSize(new java.awt.Dimension(604, 452)); { jInstructionControlPanel = new JPanel(); jPanel10.add(jInstructionControlPanel, BorderLayout.NORTH); { ComboBoxModel jInstructionComboBoxModel = new DefaultComboBoxModel(new String[] {}); jInstructionComboBox = new JComboBox(); jInstructionControlPanel.add(jInstructionComboBox); jInstructionControlPanel.add(getDisassembleButton()); jInstructionComboBox.setModel(jInstructionComboBoxModel); jInstructionComboBox.setEditable(true); jInstructionComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jInstructionComboBoxActionPerformed(evt); } }); } { disassembleCurrentIPButton = new JButton(); jInstructionControlPanel.add(disassembleCurrentIPButton); jInstructionControlPanel.add(getJInstructionUpTenButton()); jInstructionControlPanel.add(getJInstructionUpButton()); jInstructionControlPanel.add(getJButton22()); jInstructionControlPanel.add(getJButton3()); jInstructionControlPanel.add(getJButton12()); disassembleCurrentIPButton.setText(MyLanguage.getString("Disassemble") + " cs:eip"); disassembleCurrentIPButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { disassembleCurrentIPButtonActionPerformed(evt); } }); } } { instructionTableScrollPane = new JScrollPane(); jPanel10.add(instructionTableScrollPane, BorderLayout.CENTER); { instructionTable = new JTable(); instructionTableScrollPane.setViewportView(instructionTable); instructionTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); instructionTable.setModel(new InstructionTableModel()); instructionTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); instructionTable.getTableHeader().setReorderingAllowed(false); instructionTable.getColumnModel().getColumn(0).setMaxWidth(20); instructionTable.getColumnModel().getColumn(1).setPreferredWidth(40); instructionTable.getColumnModel().getColumn(2).setPreferredWidth(200); instructionTable.getColumnModel().getColumn(3).setPreferredWidth(40); instructionTable.setDefaultRenderer(String.class, new InstructionTableCellRenderer()); instructionTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { instructionTableMouseClicked(evt); } }); } } } { jPanel4 = new JPanel(); jTabbedPane1 .addTab(MyLanguage.getString("Breakpoint"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/cancel.png")), jPanel4, null); BorderLayout jPanel4Layout = new BorderLayout(); jPanel4.setLayout(jPanel4Layout); { jScrollPane9 = new JScrollPane(); jPanel4.add(jScrollPane9, BorderLayout.CENTER); { breakpointTable = new JTable(); breakpointTable.getTableHeader().setReorderingAllowed(false); jScrollPane9.setViewportView(breakpointTable); breakpointTable.setModel(jBreakpointTableModel); breakpointTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); breakpointTable.getColumnModel().getColumn(0) .setCellRenderer(new BreakpointTableCellRenderer()); breakpointTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { breakpointTableMouseClicked(evt); } }); breakpointTable.getColumnModel().getColumn(2).setPreferredWidth(100); breakpointTable.getColumnModel().getColumn(3).setPreferredWidth(20); } } { jPanel12 = new JPanel(); jPanel4.add(jPanel12, BorderLayout.SOUTH); { jAddBreakpointButton = new JButton(); jPanel12.add(jAddBreakpointButton); jAddBreakpointButton.setText(MyLanguage.getString("Add")); jAddBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jAddBreakpointButtonActionPerformed(evt); } }); } { jDeleteBreakpointButton = new JButton(); jPanel12.add(jDeleteBreakpointButton); jDeleteBreakpointButton.setText(MyLanguage.getString("Del")); jDeleteBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jDeleteBreakpointButtonActionPerformed(evt); } }); } { jRefreshBreakpointButton = new JButton(); jPanel12.add(jRefreshBreakpointButton); jRefreshBreakpointButton.setText(MyLanguage.getString("Refresh")); jRefreshBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jRefreshBreakpointButtonActionPerformed(evt); } }); } { jEnableBreakpointButton = new JButton(); jPanel12.add(jEnableBreakpointButton); jEnableBreakpointButton.setText(MyLanguage.getString("Enable")); jEnableBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jEnableBreakpointButtonActionPerformed(evt); } }); } { jDisableBreakpointButton = new JButton(); jPanel12.add(jDisableBreakpointButton); jDisableBreakpointButton.setText(MyLanguage.getString("Disable")); jDisableBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jDisableBreakpointButtonActionPerformed(evt); } }); } { jSaveBreakpointButton = new JButton(); jPanel12.add(jSaveBreakpointButton); jSaveBreakpointButton.setText(MyLanguage.getString("Save")); jSaveBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jSaveBreakpointButtonActionPerformed(evt); } }); } { jLoadBreakpointButton = new JDropDownButton(); jPanel12.add(jLoadBreakpointButton); jPanel12.add(getJSBButton()); jPanel12.add(getJSBAButton()); jLoadBreakpointButton.setText(MyLanguage.getString("Load")); jLoadBreakpointButton.add(loadElfMenuItem); jLoadBreakpointButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jLoadBreakpointButtonActionPerformed(evt); } }); } } } { jPanel1 = new JPanel(); jTabbedPane1.addTab(MyLanguage.getString("Bochs"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/application_xp_terminal.png")), jPanel1, null); jTabbedPane1.addTab("ELF", new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/linux.png")), getJELFBreakpointPanel(), null); DiskPanel diskPanel = getDiskPanel(); if (diskPanel.getFile() != null) { jTabbedPane1.addTab(diskPanel.getFile().getName(), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/package.png")), diskPanel, null); } BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); { jScrollPane4 = new JScrollPane(); jPanel1.add(jScrollPane4, BorderLayout.CENTER); { bochsEditorPane = new JEditorPane(); jScrollPane4.setViewportView(bochsEditorPane); } } { jPanel2 = new JPanel(); TableLayout jPanel2Layout = new TableLayout(new double[][] { { TableLayout.FILL, 411.0, TableLayout.MINIMUM, TableLayout.MINIMUM }, { TableLayout.FILL } }); jPanel2Layout.setHGap(5); jPanel2Layout.setVGap(5); jPanel2.setLayout(jPanel2Layout); jPanel1.add(jPanel2, BorderLayout.SOUTH); { bochsCommandTextField = new JTextField(); jPanel2.add(bochsCommandTextField, "0, 0, 1, 0"); bochsCommandTextField.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { jBochsCommandTextFieldKeyPressed(evt); } public void keyTyped(KeyEvent evt) { bochsCommandTextFieldKeyTyped(evt); } }); } { bochsCommandButton = new JButton(); jPanel2.add(bochsCommandButton, "2, 0"); jPanel2.add(getJClearBochsButton(), "3, 0"); bochsCommandButton.setText("Run"); bochsCommandButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { bochsCommandButtonActionPerformed(evt); } }); } } } } { jTabbedPane3 = new JMaximizableTabbedPane(); jSplitPane1.add(jTabbedPane3, JSplitPane.LEFT); { jPanel8 = new JPanel(); BorderLayout jPanel8Layout = new BorderLayout(); jPanel8.setLayout(jPanel8Layout); jTabbedPane3 .addTab(MyLanguage.getString("Memory"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/memory.png")), jPanel8, null); { jScrollPane2 = new JScrollPane(); jPanel8.add(jScrollPane2, BorderLayout.CENTER); { jHexTable1 = new HexTable(); jHexTable1.getColumnModel().getColumn(0).setPreferredWidth(30); for (int x = 1; x < 9; x++) { jHexTable1.getColumnModel().getColumn(x).setPreferredWidth(10); } jScrollPane2.setViewportView(jHexTable1); jHexTable1.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); jHexTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jHexTable1.setCellSelectionEnabled(true); jHexTable1.getTableHeader().setReorderingAllowed(false); jHexTable1.setDefaultRenderer(String.class, new MemoryTableCellRenderer()); jHexTable1.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { jHexTable1MouseClicked(evt); } }); } } { jPanel9 = new JPanel(); FlowLayout jPanel9Layout = new FlowLayout(); jPanel9.setLayout(jPanel9Layout); jPanel8.add(jPanel9, BorderLayout.NORTH); { jMemoryAddressComboBox = new JComboBox(); jPanel9.add(jMemoryAddressComboBox); jMemoryAddressComboBox.setSelectedItem("0x00000000"); jMemoryAddressComboBox.setEditable(true); jMemoryAddressComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jMemoryAddressComboBoxActionPerformed(evt); } }); new Thread("addMemoryAddressComboBox thread") { public void run() { TreeSet<String> vector = Setting.getInstance().getMemoryCombo(); Iterator<String> iterator = vector.iterator(); while (iterator.hasNext()) { addMemoryAddressComboBox(iterator.next()); } } }.start(); jMemoryAddressComboBox.setSelectedItem("0x00000000"); } { jGOMemoryButton = new JButton(); jPanel9.add(jGOMemoryButton); jPanel9.add(getJGoLinearButton()); jPanel9.add(getJPreviousMemoryButton()); jPanel9.add(getJNextMemoryPageButton()); jPanel9.add(getJButton2()); jPanel9.add(getJButton5()); jGOMemoryButton.setText(MyLanguage.getString("Go")); jGOMemoryButton.setToolTipText(MyLanguage.getString("Physical_address")); jGOMemoryButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jGOMemoryButtonActionPerformed(evt); } }); } { jBinaryRadioButton = new JRadioButton(); jPanel9.add(jBinaryRadioButton); jBinaryRadioButton.setText("2"); jBinaryRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { jBinaryRadioButtonItemStateChanged(evt); } }); jBinaryRadioButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jBinaryRadioButtonStateChanged(evt); } }); getButtonGroup1().add(jBinaryRadioButton); } { jOctRadioButton1 = new JRadioButton(); jPanel9.add(jOctRadioButton1); jOctRadioButton1.setText("8"); jOctRadioButton1.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { jOctRadioButton1ItemStateChanged(evt); } }); jOctRadioButton1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jOctRadioButton1StateChanged(evt); } }); getButtonGroup1().add(jOctRadioButton1); } { jDecRadioButton = new JRadioButton(); jPanel9.add(jDecRadioButton); jDecRadioButton.setText("10"); jDecRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { jDecRadioButtonItemStateChanged(evt); } }); jDecRadioButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jDecRadioButtonStateChanged(evt); } }); getButtonGroup1().add(jDecRadioButton); } { jHexRadioButton = new JRadioButton(); jPanel9.add(jHexRadioButton); jHexRadioButton.setText("16"); jHexRadioButton.setSelected(true); jHexRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { jHexRadioButtonItemStateChanged(evt); } }); jHexRadioButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jHexRadioButtonStateChanged(evt); } }); getButtonGroup1().add(jHexRadioButton); } } } { jPanel5 = new JPanel(); jTabbedPane3 .addTab(MyLanguage.getString("GDT"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/gdt.png")), jPanel5, null); BorderLayout jPanel5Layout = new BorderLayout(); jPanel5.setLayout(jPanel5Layout); { jScrollPane3 = new JScrollPane(); jPanel5.add(jScrollPane3, BorderLayout.CENTER); jPanel5.add(getJPanel14(), BorderLayout.NORTH); { GDTTableModel jGDTTableModel = new GDTTableModel(); jGDTTable = new JTable(); jGDTTable.setModel(jGDTTableModel); jScrollPane3.setViewportView(jGDTTable); jGDTTable.getColumnModel().getColumn(0).setMaxWidth(40); jGDTTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); jGDTTable.getTableHeader().setReorderingAllowed(false); jGDTTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { jGDTTableMouseClicked(evt); } }); } } } { jPanel6 = new JPanel(); BorderLayout jPanel6Layout = new BorderLayout(); jPanel6.setLayout(jPanel6Layout); jTabbedPane3 .addTab(MyLanguage.getString("IDT"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/idt.png")), jPanel6, null); { jScrollPane10 = new JScrollPane(); jPanel6.add(jScrollPane10, BorderLayout.CENTER); jPanel6.add(getJPanel15(), BorderLayout.NORTH); { IDTTableModel jIDTTableModel = new IDTTableModel(); jIDTTable = new JTable(); jIDTTable.setModel(jIDTTableModel); jScrollPane10.setViewportView(jIDTTable); jIDTTable.getColumnModel().getColumn(0).setMaxWidth(40); jIDTTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); jIDTTable.getTableHeader().setReorderingAllowed(false); jIDTTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { jIDTTableMouseClicked(evt); } }); } } } { jPanel7 = new JPanel(); BorderLayout jPanel7Layout = new BorderLayout(); jPanel7.setLayout(jPanel7Layout); jTabbedPane3 .addTab(MyLanguage.getString("LDT"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/ldt.png")), jPanel7, null); jTabbedPane3.addTab(MyLanguage.getString("Search_memory"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/memory.png")), getJPanel17(), null); jTabbedPane3.addTab("bochsout.txt", new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/script.png")), getJPanel31(), null); { jScrollPane11 = new JScrollPane(); jPanel7.add(jScrollPane11, BorderLayout.CENTER); jPanel7.add(getJPanel16(), BorderLayout.NORTH); { LDTTableModel jLDTTableModel = new LDTTableModel(); jLDTTable = new JTable(); jLDTTable.setModel(jLDTTableModel); jScrollPane11.setViewportView(jLDTTable); jLDTTable.getColumnModel().getColumn(0).setMaxWidth(40); jLDTTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); jLDTTable.getTableHeader().setReorderingAllowed(false); jLDTTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { jLDTTableMouseClicked(evt); } }); } } } } } { jTabbedPane2 = new JMaximizableTabbedPane(); // jTabbedPane2.setCloseIcon(true); // jTabbedPane2.setMaxIcon(true); // // jTabbedPane2.addCloseListener(new CloseListener() { // public void closeOperation(MouseEvent e) { // jTabbedPane2.remove(jTabbedPane2.getOverTabIndex()); // } // }); // // jTabbedPane2.addMaxListener(new MaxListener() { // public void maxOperation(MouseEvent e) { // jTabbedPane2.detachTab(jTabbedPane2.getOverTabIndex()); // } // }); jSplitPane2.add(jTabbedPane2, JSplitPane.BOTTOM); { registerPanelScrollPane = new JScrollPane(); jTabbedPane2.addTab(MyLanguage.getString("Register"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/text_kerning.png")), registerPanelScrollPane, null); { registerPanel = new RegisterPanel(this); registerPanelScrollPane.setViewportView(registerPanel); } } { jPanel3 = new JPanel(); jTabbedPane2.addTab(MyLanguage.getString("History"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/book_addresses.png")), jPanel3, null); BorderLayout jPanel3Layout = new BorderLayout(); jPanel3.setLayout(jPanel3Layout); { jScrollPane6 = new JScrollPane(); jPanel3.add(jScrollPane6, BorderLayout.CENTER); jPanel3.add(getJPanel13(), BorderLayout.NORTH); jScrollPane6.setViewportView(getJHistoryTable()); } } { jPanel11 = new JPanel(); jTabbedPane2 .addTab(MyLanguage.getString("Paging"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/page_copy.png")), jPanel11, null); jTabbedPane2.addTab(MyLanguage.getString("Address_translate"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/page_go.png")), getJAddressTranslatePanel(), null); jTabbedPane2.addTab("Page table graph (experimental)", new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/page_lightning.png")), getJPageTableGraphPanel(), null); if (!Global.debug) { jTabbedPane2.removeTabAt(jTabbedPane2.getTabCount() - 1); } jTabbedPane2.addTab(MyLanguage.getString("Table_translate"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/page_refresh.png")), getJTableTranslateScrollPane(), null); jTabbedPane2.addTab(MyLanguage.getString("ELF_dump"), new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/linux.png")), getJELFDumpScrollPane(), null); jTabbedPane2.addTab("OS debug informations", new ImageIcon(getClass().getClassLoader() .getResource("com/peterbochs/icons/famfam_icons/bug.png")), getJOSDebugStandardPanel(), null); BorderLayout jPanel11Layout = new BorderLayout(); jPanel11.setLayout(jPanel11Layout); jPanel11.add(getJSplitPane3(), BorderLayout.CENTER); jPanel11.add(getJPanel19(), BorderLayout.NORTH); } } return jSplitPane2; }
From source file:org.nuclos.client.ui.collect.Chart.java
/** * @param entityName//from w w w . jav a2 s .c o m * @param toolBarOrientation @see JToolbar#setOrientation * @param foreignKeyFieldToParent Needs only be specified if not unique. @see #getForeignKeyFieldToParent() * @precondition entityName != null * @postcondition this.getForeignKeyFieldToParent() == foreignKeyFieldToParent */ public Chart(String entityName, int iScrollPane, int toolBarOrientation, String foreignKeyFieldToParent, boolean bFromProperties, boolean bSearchable) { super(new GridLayout(1, 1)); this.bFromProperties = bFromProperties; this.bSearchable = bSearchable; this.subform = new SubForm(entityName, -1, foreignKeyFieldToParent, bFromProperties) { private TableModelListener tblmdllistener; public void setupTableModelListener() { // set all columns visble. if (!(getSubformTable().getModel() instanceof CollectableTableModel<?>)) return; CollectableEntity colEntity = DefaultCollectableEntityProvider.getInstance() .getCollectableEntity(subform.getEntityName()); List<CollectableEntityField> lstclctefColumns = new ArrayList<CollectableEntityField>(); for (String sFieldName : colEntity.getFieldNames()) { if (!sFieldName.equalsIgnoreCase("genericObject")) lstclctefColumns.add(colEntity.getEntityField(sFieldName)); } ((CollectableTableModel<?>) getSubformTable().getModel()).setColumns(lstclctefColumns); this.tblmdllistener = new TableModelListener() { boolean enabled = Chart.this.isEnabled(); @Override public void tableChanged(TableModelEvent ev) { Chart.this.setEnabled( (subform.getJTable().getModel() instanceof SearchConditionTableModelImpl) ? false : enabled); String type = getProperty(PROPERTY_TYPE, String.class); if (type != null) { JFreeChart chart = ChartFunction.valueOf(type).createChart(Chart.this); panel.setChart(chart); panel.repaint(); } } }; getSubformTable().getModel().addTableModelListener(this.tblmdllistener); } public void removeTableModelListener() { getSubformTable().getModel().removeTableModelListener(this.tblmdllistener); this.tblmdllistener = null; } }; if (iScrollPane != -1) { this.scrollPane = new JScrollPane(); } else this.scrollPane = new JPanel(new BorderLayout()); this.toolbar = UIUtils.createNonFloatableToolBar(toolBarOrientation); this.listeners = new ArrayList<ChartToolListener>(); if (entityName == null) { throw new NullArgumentException("entityName"); } this.entityName = entityName; String sDataSource = entityName.substring(MasterDataMetaVO.CHART_ENTITY_PREFIX.length()).toLowerCase(); try { DatasourceVO datasourceVO = DatasourceDelegate.getInstance().getChartByName(sDataSource); if (datasourceVO != null) { final List<DatasourceParameterVO> lstParams = DatasourceDelegate.getInstance() .getParametersFromXML(datasourceVO.getSource()); for (Iterator iterator = lstParams.iterator(); iterator.hasNext();) { DatasourceParameterVO datasourceParameterVO = (DatasourceParameterVO) iterator.next(); if (datasourceParameterVO.getParameter().equals("genericObject")) iterator.remove(); } if (!lstParams.isEmpty() && !bSearchable && !bFromProperties) { JPanel pnl = new JPanel(new BorderLayout()); ParameterPanel pnlParameters = new ParameterPanel(lstParams, new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if (e != null && e.getSource() instanceof ParameterPanel) { try { Map<String, Object> mpParams = new HashMap<String, Object>(); ((ParameterPanel) e.getSource()).fillParameterMap(lstParams, mpParams); subform.setMapParams(mpParams); } catch (Exception e2) { //ignore. } } } }); pnl.add(pnlParameters, BorderLayout.NORTH); JSplitPane splitPane = new JSplitPane( toolBarOrientation == -1 ? JSplitPane.VERTICAL_SPLIT : toolBarOrientation, pnl, scrollPane); contentPane.add(splitPane, BorderLayout.CENTER); } else contentPane.add(scrollPane, BorderLayout.CENTER); } else { contentPane.add(scrollPane, BorderLayout.CENTER); } } catch (Exception e) { throw new NuclosFatalException("init failed for datasource " + sDataSource, e); } if (toolBarOrientation == -1) { this.toolbar.setVisible(false); } else { this.toolbar.setOrientation(toolBarOrientation); } this.foreignKeyFieldToParent = foreignKeyFieldToParent; layer = new JXLayer<JComponent>(contentPane, new TranslucentLockableUI()); layer.setName("JXLayerGlasspane"); add(layer); this.init(iScrollPane); toolbarButtons = new HashMap<String, AbstractButton>(); toolbarMenuItems = new HashMap<String, JMenuItem>(); toolbarOrder = new ArrayList<String>(); for (ToolbarFunction func : ToolbarFunction.values()) { AbstractButton button = func.createButton(); JMenuItem mi = func.createMenuItem(); toolbarButtons.put(func.name(), button); toolbarMenuItems.put(func.name(), mi); toolbar.add(button); if (func.equals(ToolbarFunction.PRINT)) { button.addActionListener(panel); mi.addActionListener(panel); } else { button.addActionListener(this); mi.addActionListener(this); } toolbarOrder.add(func.name()); } subform.setReadOnly(true); setEnabled(!bFromProperties && !bSearchable); addChartToolListener(new ChartToolListener() { @Override public void toolbarAction(String actionCommand) { if (actionCommand.equals(ToolbarFunction.SHOW.name())) { actionCommandShow(); } else if (actionCommand.equals(ToolbarFunction.SAVE.name())) { actionCommandSave(); } } }); assert this.getForeignKeyFieldToParent() == foreignKeyFieldToParent; }
From source file:com.peterbochs.PeterBochsDebugger.java
private JSpinner getJShowAfterwardSpinner() { if (jShowAfterwardSpinner == null) { SpinnerNumberModel jShowAfterwardSpinnerModel = new SpinnerNumberModel(0, 0, 100, 1); jShowAfterwardSpinner = new JSpinner(); jShowAfterwardSpinner.setMaximumSize(new java.awt.Dimension(50, 26)); jShowAfterwardSpinner.setModel(jShowAfterwardSpinnerModel); jShowAfterwardSpinner.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { jShowAfterwardSpinnerStateChanged(evt); }//from ww w. j a va 2 s . c o m }); } return jShowAfterwardSpinner; }
From source file:op.care.nursingprocess.PnlSchedule.java
/** * This method is called from within the constructor to * initialize the form./*from w w w. j a v a 2s .c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the PrinterForm Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { panelMain = new JPanel(); splitRegular = new JSplitPane(); pnlTageszeit = new JPanel(); jLabel6 = new JideLabel(); jLabel1 = new JideLabel(); jLabel2 = new JideLabel(); jLabel11 = new JideLabel(); jLabel3 = new JideLabel(); jLabel4 = new JideLabel(); txtNachtMo = new JTextField(); txtMorgens = new JTextField(); txtMittags = new JTextField(); txtNachmittags = new JTextField(); txtAbends = new JTextField(); txtNachtAb = new JTextField(); btnToTime = new JButton(); pnlUhrzeit = new JPanel(); lblUhrzeit = new JideLabel(); btnToTimeOfDay = new JButton(); txtUhrzeit = new JTextField(); cmbUhrzeit = new JComboBox(); tabWdh = new JideTabbedPane(); pnlDaily = new JPanel(); label3 = new JLabel(); spinTaeglich = new JSpinner(); jLabel7 = new JLabel(); btnJedenTag = new JButton(); pnlWeekly = new JPanel(); panel3 = new JPanel(); btnJedeWoche = new JButton(); label2 = new JLabel(); spinWoche = new JSpinner(); jLabel8 = new JLabel(); lblUhrzeit2 = new JideLabel(); lblUhrzeit3 = new JideLabel(); lblUhrzeit4 = new JideLabel(); lblUhrzeit5 = new JideLabel(); lblUhrzeit6 = new JideLabel(); lblUhrzeit7 = new JideLabel(); lblUhrzeit8 = new JideLabel(); cbMon = new JCheckBox(); cbDie = new JCheckBox(); cbMit = new JCheckBox(); cbDon = new JCheckBox(); cbFre = new JCheckBox(); cbSam = new JCheckBox(); cbSon = new JCheckBox(); pnlMonthly = new JPanel(); label4 = new JLabel(); spinMonat = new JSpinner(); label6 = new JLabel(); btnJedenMonat = new JButton(); label5 = new JLabel(); spinMonatTag = new JSpinner(); cmbTag = new JComboBox<>(); panel2 = new JPanel(); jLabel13 = new JLabel(); txtLDate = new JTextField(); lblMinutes = new JLabel(); txtMinutes = new JTextField(); pnlBemerkung = new JPanel(); jScrollPane1 = new JScrollPane(); txtBemerkung = new JTextArea(); btnSave = new JButton(); //======== this ======== setLayout(new BorderLayout()); //======== panelMain ======== { panelMain.setBorder(new LineBorder(Color.black, 2, true)); panelMain.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { panelMainComponentResized(e); } }); panelMain.setLayout(new FormLayout("$rgap, $lcgap, 223dlu:grow, $lcgap, $rgap", "$rgap, $lgap, pref, $lgap, default, $lgap, pref, $lgap, default, $lgap, 72dlu:grow, 2*($lgap, default)")); //======== splitRegular ======== { splitRegular.setDividerSize(0); splitRegular.setEnabled(false); splitRegular.setDividerLocation(150); splitRegular.setDoubleBuffered(true); //======== pnlTageszeit ======== { pnlTageszeit.setFont(new Font("Arial", Font.PLAIN, 14)); pnlTageszeit.setBorder(new EtchedBorder()); pnlTageszeit.setLayout( new FormLayout("6*(28dlu, $lcgap), default", "fill:default, $lgap, fill:default")); //---- jLabel6 ---- jLabel6.setText("Nachts, fr\u00fch morgens"); jLabel6.setOrientation(1); jLabel6.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel6.setClockwise(false); jLabel6.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel6, CC.xy(1, 1)); //---- jLabel1 ---- jLabel1.setForeground(new Color(0, 0, 204)); jLabel1.setText("Morgens"); jLabel1.setOrientation(1); jLabel1.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel1.setClockwise(false); jLabel1.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel1, CC.xy(3, 1)); //---- jLabel2 ---- jLabel2.setForeground(new Color(255, 102, 0)); jLabel2.setText("Mittags"); jLabel2.setOrientation(1); jLabel2.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel2.setClockwise(false); jLabel2.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel2, CC.xy(5, 1)); //---- jLabel11 ---- jLabel11.setForeground(new Color(0, 153, 51)); jLabel11.setText("Nachmittag"); jLabel11.setOrientation(1); jLabel11.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel11.setClockwise(false); jLabel11.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel11, CC.xy(7, 1)); //---- jLabel3 ---- jLabel3.setForeground(new Color(255, 0, 51)); jLabel3.setText("Abends"); jLabel3.setOrientation(1); jLabel3.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel3.setClockwise(false); jLabel3.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel3, CC.xy(9, 1)); //---- jLabel4 ---- jLabel4.setText("Nacht, sp\u00e4t abends"); jLabel4.setOrientation(1); jLabel4.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel4.setClockwise(false); jLabel4.setHorizontalTextPosition(SwingConstants.LEFT); pnlTageszeit.add(jLabel4, CC.xy(11, 1)); //---- txtNachtMo ---- txtNachtMo.setHorizontalAlignment(SwingConstants.RIGHT); txtNachtMo.setText("0.0"); txtNachtMo.setFont(new Font("Arial", Font.PLAIN, 14)); txtNachtMo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtNachtMoActionPerformed(e); } }); txtNachtMo.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtNachtMo, CC.xy(1, 3)); //---- txtMorgens ---- txtMorgens.setHorizontalAlignment(SwingConstants.RIGHT); txtMorgens.setText("1.0"); txtMorgens.setFont(new Font("Arial", Font.PLAIN, 14)); txtMorgens.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtMorgensActionPerformed(e); } }); txtMorgens.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtMorgens, CC.xy(3, 3)); //---- txtMittags ---- txtMittags.setHorizontalAlignment(SwingConstants.RIGHT); txtMittags.setText("0.0"); txtMittags.setFont(new Font("Arial", Font.PLAIN, 14)); txtMittags.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtMittagsActionPerformed(e); } }); txtMittags.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtMittags, CC.xy(5, 3)); //---- txtNachmittags ---- txtNachmittags.setHorizontalAlignment(SwingConstants.RIGHT); txtNachmittags.setText("0.0"); txtNachmittags.setFont(new Font("Arial", Font.PLAIN, 14)); txtNachmittags.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtNachmittagsActionPerformed(e); } }); txtNachmittags.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtNachmittags, CC.xy(7, 3)); //---- txtAbends ---- txtAbends.setHorizontalAlignment(SwingConstants.RIGHT); txtAbends.setText("0.0"); txtAbends.setFont(new Font("Arial", Font.PLAIN, 14)); txtAbends.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtAbendsActionPerformed(e); } }); txtAbends.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtAbends, CC.xy(9, 3)); //---- txtNachtAb ---- txtNachtAb.setHorizontalAlignment(SwingConstants.RIGHT); txtNachtAb.setText("0.0"); txtNachtAb.setFont(new Font("Arial", Font.PLAIN, 14)); txtNachtAb.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtNachtAbActionPerformed(e); } }); txtNachtAb.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlTageszeit.add(txtNachtAb, CC.xy(11, 3)); //---- btnToTime ---- btnToTime.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/1rightarrow.png"))); btnToTime.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnToTimeActionPerformed(e); } }); pnlTageszeit.add(btnToTime, CC.xy(13, 3)); } splitRegular.setLeftComponent(pnlTageszeit); //======== pnlUhrzeit ======== { pnlUhrzeit.setBorder(new EtchedBorder()); pnlUhrzeit.setLayout( new FormLayout("default, $ugap, 75dlu, $ugap, pref", "default:grow, $rgap, default")); //---- lblUhrzeit ---- lblUhrzeit.setText("Anzahl Massnahmen"); lblUhrzeit.setOrientation(2); lblUhrzeit.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit.setClockwise(false); lblUhrzeit.setHorizontalTextPosition(SwingConstants.LEFT); lblUhrzeit.setVerticalAlignment(SwingConstants.BOTTOM); pnlUhrzeit.add(lblUhrzeit, CC.xy(3, 1, CC.DEFAULT, CC.BOTTOM)); //---- btnToTimeOfDay ---- btnToTimeOfDay .setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/1leftarrow.png"))); btnToTimeOfDay.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnToTimeOfDayActionPerformed(e); } }); pnlUhrzeit.add(btnToTimeOfDay, CC.xy(1, 3)); //---- txtUhrzeit ---- txtUhrzeit.setHorizontalAlignment(SwingConstants.RIGHT); txtUhrzeit.setText("0.0"); txtUhrzeit.setFont(new Font("Arial", Font.PLAIN, 14)); txtUhrzeit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { txtUhrzeitActionPerformed(e); } }); txtUhrzeit.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtFocusGained(e); } @Override public void focusLost(FocusEvent e) { txtIntegerFocusLost(e); } }); pnlUhrzeit.add(txtUhrzeit, CC.xy(3, 3)); //---- cmbUhrzeit ---- cmbUhrzeit.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { cmbUhrzeitItemStateChanged(e); } }); pnlUhrzeit.add(cmbUhrzeit, CC.xy(5, 3)); } splitRegular.setRightComponent(pnlUhrzeit); } panelMain.add(splitRegular, CC.xy(3, 3)); //======== tabWdh ======== { //======== pnlDaily ======== { pnlDaily.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.setLayout(new FormLayout("2*(default), $rgap, $lcgap, 40dlu, $rgap, default", "default, $lgap, pref, $lgap, default")); //---- label3 ---- label3.setText("alle"); label3.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.add(label3, CC.xy(2, 3)); //---- spinTaeglich ---- spinTaeglich.setFont(new Font("Arial", Font.PLAIN, 14)); spinTaeglich.setModel(new SpinnerNumberModel(1, null, null, 1)); pnlDaily.add(spinTaeglich, CC.xy(5, 3)); //---- jLabel7 ---- jLabel7.setText("Tage"); jLabel7.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.add(jLabel7, CC.xy(7, 3)); //---- btnJedenTag ---- btnJedenTag.setText("Jeden Tag"); btnJedenTag.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedenTagActionPerformed(e); } }); pnlDaily.add(btnJedenTag, CC.xywh(2, 5, 6, 1)); } tabWdh.addTab("T\u00e4glich", pnlDaily); //======== pnlWeekly ======== { pnlWeekly.setFont(new Font("Arial", Font.PLAIN, 14)); pnlWeekly.setLayout(new FormLayout("default, 7*(13dlu), $lcgap, default:grow", "$ugap, $lgap, default, $lgap, pref, default:grow, $lgap, $rgap")); //======== panel3 ======== { panel3.setLayout( new FormLayout("default, $rgap, 40dlu, $rgap, 2*(default), $lcgap, default, $lcgap", "default:grow, $lgap, default")); //---- btnJedeWoche ---- btnJedeWoche.setText("Jede Woche"); btnJedeWoche.setFont(new Font("Arial", Font.PLAIN, 14)); btnJedeWoche.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedeWocheActionPerformed(e); } }); panel3.add(btnJedeWoche, CC.xywh(3, 3, 3, 1)); //---- label2 ---- label2.setText("alle"); label2.setFont(new Font("Arial", Font.PLAIN, 14)); panel3.add(label2, CC.xy(1, 1)); panel3.add(spinWoche, CC.xy(3, 1)); //---- jLabel8 ---- jLabel8.setText("Wochen am"); jLabel8.setFont(new Font("Arial", Font.PLAIN, 14)); panel3.add(jLabel8, CC.xy(5, 1)); } pnlWeekly.add(panel3, CC.xywh(2, 3, 9, 1)); //---- lblUhrzeit2 ---- lblUhrzeit2.setText("montags"); lblUhrzeit2.setOrientation(1); lblUhrzeit2.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit2.setClockwise(false); lblUhrzeit2.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit2, CC.xy(2, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit3 ---- lblUhrzeit3.setText("dienstags"); lblUhrzeit3.setOrientation(1); lblUhrzeit3.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit3.setClockwise(false); lblUhrzeit3.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit3, CC.xy(3, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit4 ---- lblUhrzeit4.setText("mittwochs"); lblUhrzeit4.setOrientation(1); lblUhrzeit4.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit4.setClockwise(false); lblUhrzeit4.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit4, CC.xy(4, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit5 ---- lblUhrzeit5.setText("donnerstags"); lblUhrzeit5.setOrientation(1); lblUhrzeit5.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit5.setClockwise(false); lblUhrzeit5.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit5, CC.xy(5, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit6 ---- lblUhrzeit6.setText("freitags"); lblUhrzeit6.setOrientation(1); lblUhrzeit6.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit6.setClockwise(false); lblUhrzeit6.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit6, CC.xy(6, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit7 ---- lblUhrzeit7.setText("samstags"); lblUhrzeit7.setOrientation(1); lblUhrzeit7.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit7.setClockwise(false); lblUhrzeit7.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit7, CC.xy(7, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit8 ---- lblUhrzeit8.setText("sonntags"); lblUhrzeit8.setOrientation(1); lblUhrzeit8.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit8.setClockwise(false); lblUhrzeit8.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit8, CC.xy(8, 5, CC.CENTER, CC.BOTTOM)); //---- cbMon ---- cbMon.setBorder(BorderFactory.createEmptyBorder()); cbMon.setMargin(new Insets(0, 0, 0, 0)); cbMon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbMonActionPerformed(e); } }); pnlWeekly.add(cbMon, CC.xy(2, 6, CC.CENTER, CC.DEFAULT)); //---- cbDie ---- cbDie.setBorder(BorderFactory.createEmptyBorder()); cbDie.setMargin(new Insets(0, 0, 0, 0)); cbDie.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbDieActionPerformed(e); } }); pnlWeekly.add(cbDie, CC.xy(3, 6, CC.CENTER, CC.DEFAULT)); //---- cbMit ---- cbMit.setBorder(BorderFactory.createEmptyBorder()); cbMit.setMargin(new Insets(0, 0, 0, 0)); cbMit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbMitActionPerformed(e); } }); pnlWeekly.add(cbMit, CC.xy(4, 6, CC.CENTER, CC.DEFAULT)); //---- cbDon ---- cbDon.setBorder(BorderFactory.createEmptyBorder()); cbDon.setMargin(new Insets(0, 0, 0, 0)); cbDon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbDonActionPerformed(e); } }); pnlWeekly.add(cbDon, CC.xy(5, 6, CC.CENTER, CC.DEFAULT)); //---- cbFre ---- cbFre.setBorder(BorderFactory.createEmptyBorder()); cbFre.setMargin(new Insets(0, 0, 0, 0)); cbFre.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbFreActionPerformed(e); } }); pnlWeekly.add(cbFre, CC.xy(6, 6, CC.CENTER, CC.DEFAULT)); //---- cbSam ---- cbSam.setBorder(BorderFactory.createEmptyBorder()); cbSam.setMargin(new Insets(0, 0, 0, 0)); cbSam.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbSamActionPerformed(e); } }); pnlWeekly.add(cbSam, CC.xy(7, 6, CC.CENTER, CC.DEFAULT)); //---- cbSon ---- cbSon.setBorder(BorderFactory.createEmptyBorder()); cbSon.setMargin(new Insets(0, 0, 0, 0)); cbSon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbSonActionPerformed(e); } }); pnlWeekly.add(cbSon, CC.xy(8, 6, CC.CENTER, CC.DEFAULT)); } tabWdh.addTab("W\u00f6chentlich", pnlWeekly); //======== pnlMonthly ======== { pnlMonthly.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.setLayout( new FormLayout("default, $lcgap, pref, $lcgap, 40dlu, $lcgap, pref, $lcgap, 61dlu", "3*(default, $lgap), default")); //---- label4 ---- label4.setText("jeden"); label4.setFont(new Font("Arial", Font.PLAIN, 14)); label4.setHorizontalAlignment(SwingConstants.TRAILING); pnlMonthly.add(label4, CC.xy(3, 3)); //---- spinMonat ---- spinMonat.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.add(spinMonat, CC.xy(5, 3)); //---- label6 ---- label6.setText("Monat"); label6.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.add(label6, CC.xy(7, 3)); //---- btnJedenMonat ---- btnJedenMonat.setText("Jeden Monat"); btnJedenMonat.setFont(new Font("Arial", Font.PLAIN, 14)); btnJedenMonat.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedenMonatActionPerformed(e); } }); pnlMonthly.add(btnJedenMonat, CC.xywh(3, 5, 5, 1)); //---- label5 ---- label5.setText("jeweils am"); label5.setFont(new Font("Arial", Font.PLAIN, 14)); label5.setHorizontalAlignment(SwingConstants.TRAILING); pnlMonthly.add(label5, CC.xy(3, 7)); //---- spinMonatTag ---- spinMonatTag.setFont(new Font("Arial", Font.PLAIN, 14)); spinMonatTag.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { spinMonatTagStateChanged(e); } }); pnlMonthly.add(spinMonatTag, CC.xy(5, 7)); //---- cmbTag ---- cmbTag.setModel(new DefaultComboBoxModel<>(new String[] { "Tag des Monats", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag" })); cmbTag.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.add(cmbTag, CC.xywh(7, 7, 3, 1)); } tabWdh.addTab("Monatlich", pnlMonthly); } panelMain.add(tabWdh, CC.xy(3, 7, CC.FILL, CC.FILL)); //======== panel2 ======== { panel2.setLayout(new FormLayout( "default, $lcgap, default:grow, $ugap, default, $lcgap, default:grow", "default:grow")); //---- jLabel13 ---- jLabel13.setText("Erst einplanen ab dem"); jLabel13.setFont(new Font("Arial", Font.PLAIN, 14)); panel2.add(jLabel13, CC.xy(1, 1)); //---- txtLDate ---- txtLDate.setFont(new Font("Arial", Font.PLAIN, 14)); txtLDate.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { txtLDateFocusLost(e); } }); panel2.add(txtLDate, CC.xy(3, 1)); //---- lblMinutes ---- lblMinutes.setText("text"); lblMinutes.setFont(new Font("Arial", Font.PLAIN, 14)); panel2.add(lblMinutes, CC.xy(5, 1)); //---- txtMinutes ---- txtMinutes.setFont(new Font("Arial", Font.PLAIN, 14)); txtMinutes.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { txtMinutesFocusLost(e); } }); panel2.add(txtMinutes, CC.xy(7, 1)); } panelMain.add(panel2, CC.xy(3, 9)); //======== pnlBemerkung ======== { pnlBemerkung.setBorder(new TitledBorder(null, "Kommentar zur Anwendung (Erscheint im DFN)", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, new Font("Arial", Font.PLAIN, 14))); pnlBemerkung.setLayout(new BoxLayout(pnlBemerkung, BoxLayout.X_AXIS)); //======== jScrollPane1 ======== { //---- txtBemerkung ---- txtBemerkung.setColumns(20); txtBemerkung.setRows(5); jScrollPane1.setViewportView(txtBemerkung); } pnlBemerkung.add(jScrollPane1); } panelMain.add(pnlBemerkung, CC.xy(3, 11, CC.FILL, CC.FILL)); //---- btnSave ---- btnSave.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png"))); btnSave.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnSaveActionPerformed(e); } }); panelMain.add(btnSave, CC.xy(3, 13, CC.RIGHT, CC.DEFAULT)); } add(panelMain, BorderLayout.CENTER); }
From source file:op.controlling.PnlQMSSchedule.java
/** * This method is called from within the constructor to * initialize the form.// ww w . j a va 2 s .c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the PrinterForm Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { panelMain = new JPanel(); lblMeasure = new JLabel(); txtQMS = new JTextField(); lblLocation = new JLabel(); cmbLocation = new TreeComboBox(); tabWdh = new JideTabbedPane(); pnlDaily = new JPanel(); lblEveryDay = new JLabel(); spinTaeglich = new JSpinner(); lblDays = new JLabel(); btnJedenTag = new JButton(); pnlWeekly = new JPanel(); panel3 = new JPanel(); btnJedeWoche = new JButton(); lblEveryWeek = new JLabel(); spinWoche = new JSpinner(); lblWeeks = new JLabel(); lblUhrzeit2 = new JideLabel(); lblUhrzeit3 = new JideLabel(); lblUhrzeit4 = new JideLabel(); lblUhrzeit5 = new JideLabel(); lblUhrzeit6 = new JideLabel(); lblUhrzeit7 = new JideLabel(); lblUhrzeit8 = new JideLabel(); cbMon = new JRadioButton(); cbDie = new JRadioButton(); cbMit = new JRadioButton(); cbDon = new JRadioButton(); cbFre = new JRadioButton(); cbSam = new JRadioButton(); cbSon = new JRadioButton(); pnlMonthly = new JPanel(); lblEveryMonth = new JLabel(); spinMonat = new JSpinner(); lblMonth = new JLabel(); btnJedenMonat = new JButton(); llblOnDayOfMonth = new JLabel(); spinDayInMonth = new JSpinner(); cmbTag = new JComboBox<>(); pnlYearly = new JPanel(); lblEveryYear = new JLabel(); spinYearly = new JSpinner(); lblYear = new JLabel(); btnEveryYear = new JButton(); lblOnDay = new JLabel(); spinDayInMonthInYear = new JSpinner(); cmbMonth = new JComboBox(); lblLDate = new JLabel(); jdcStartingOn = new JDateChooser(); jScrollPane1 = new JScrollPane(); txtBemerkung = new JTextArea(); btnSave = new JButton(); lblDueDays = new JLabel(); txtDueDays = GUITools.createIntegerTextField(1, 31, 1); //======== this ======== setLayout(new BorderLayout()); //======== panelMain ======== { panelMain.setBorder(new LineBorder(Color.black, 2, true)); panelMain.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { panelMainComponentResized(e); } }); panelMain.setLayout(new FormLayout("$rgap, $lcgap, 35dlu:grow, $ugap, 105dlu:grow, $lcgap, $rgap", "default, $nlgap, 18dlu, $lgap, default, $nlgap, 2*(default, $lgap), pref, $lgap, default, $nlgap, default, $lgap, 72dlu:grow, $lgap, default, $lgap, $rgap")); //---- lblMeasure ---- lblMeasure.setText("text"); lblMeasure.setFont(new Font("Arial", Font.PLAIN, 10)); lblMeasure.setHorizontalAlignment(SwingConstants.TRAILING); panelMain.add(lblMeasure, CC.xy(5, 1)); //---- txtQMS ---- txtQMS.setFont(new Font("Arial", Font.BOLD, 14)); panelMain.add(txtQMS, CC.xywh(3, 3, 3, 1, CC.DEFAULT, CC.FILL)); //---- lblLocation ---- lblLocation.setText("text"); lblLocation.setFont(new Font("Arial", Font.PLAIN, 10)); lblLocation.setHorizontalAlignment(SwingConstants.TRAILING); panelMain.add(lblLocation, CC.xy(5, 5)); panelMain.add(cmbLocation, CC.xy(5, 7)); //======== tabWdh ======== { //======== pnlDaily ======== { pnlDaily.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.setLayout(new FormLayout("2*(default), $rgap, $lcgap, 40dlu, $rgap, default", "default, $lgap, pref, $lgap, default")); //---- lblEveryDay ---- lblEveryDay.setText("alle"); lblEveryDay.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.add(lblEveryDay, CC.xy(2, 3)); //---- spinTaeglich ---- spinTaeglich.setFont(new Font("Arial", Font.PLAIN, 14)); spinTaeglich.setModel(new SpinnerNumberModel(1, null, null, 1)); pnlDaily.add(spinTaeglich, CC.xy(5, 3)); //---- lblDays ---- lblDays.setText("Tage"); lblDays.setFont(new Font("Arial", Font.PLAIN, 14)); pnlDaily.add(lblDays, CC.xy(7, 3)); //---- btnJedenTag ---- btnJedenTag.setText("Jeden Tag"); btnJedenTag.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedenTagActionPerformed(e); } }); pnlDaily.add(btnJedenTag, CC.xywh(2, 5, 6, 1)); } tabWdh.addTab("T\u00e4glich", pnlDaily); //======== pnlWeekly ======== { pnlWeekly.setFont(new Font("Arial", Font.PLAIN, 14)); pnlWeekly.setLayout(new FormLayout("default, 7*(13dlu), $lcgap, default:grow", "$ugap, $lgap, default, $lgap, fill:53dlu:grow, $nlgap, default:grow, $lgap, $rgap")); //======== panel3 ======== { panel3.setLayout( new FormLayout("default, $rgap, 40dlu, $rgap, 2*(default), $lcgap, default, $lcgap", "default:grow, $lgap, default")); //---- btnJedeWoche ---- btnJedeWoche.setText("Jede Woche"); btnJedeWoche.setFont(new Font("Arial", Font.PLAIN, 14)); btnJedeWoche.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedeWocheActionPerformed(e); } }); panel3.add(btnJedeWoche, CC.xywh(3, 3, 3, 1)); //---- lblEveryWeek ---- lblEveryWeek.setText("alle"); lblEveryWeek.setFont(new Font("Arial", Font.PLAIN, 14)); panel3.add(lblEveryWeek, CC.xy(1, 1)); panel3.add(spinWoche, CC.xy(3, 1)); //---- lblWeeks ---- lblWeeks.setText("Wochen am"); lblWeeks.setFont(new Font("Arial", Font.PLAIN, 14)); panel3.add(lblWeeks, CC.xy(5, 1)); } pnlWeekly.add(panel3, CC.xywh(2, 3, 9, 1)); //---- lblUhrzeit2 ---- lblUhrzeit2.setText("montags"); lblUhrzeit2.setOrientation(1); lblUhrzeit2.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit2.setClockwise(false); lblUhrzeit2.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit2, CC.xy(2, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit3 ---- lblUhrzeit3.setText("dienstags"); lblUhrzeit3.setOrientation(1); lblUhrzeit3.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit3.setClockwise(false); lblUhrzeit3.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit3, CC.xy(3, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit4 ---- lblUhrzeit4.setText("mittwochs"); lblUhrzeit4.setOrientation(1); lblUhrzeit4.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit4.setClockwise(false); lblUhrzeit4.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit4, CC.xy(4, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit5 ---- lblUhrzeit5.setText("donnerstags"); lblUhrzeit5.setOrientation(1); lblUhrzeit5.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit5.setClockwise(false); lblUhrzeit5.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit5, CC.xy(5, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit6 ---- lblUhrzeit6.setText("freitags"); lblUhrzeit6.setOrientation(1); lblUhrzeit6.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit6.setClockwise(false); lblUhrzeit6.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit6, CC.xy(6, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit7 ---- lblUhrzeit7.setText("samstags"); lblUhrzeit7.setOrientation(1); lblUhrzeit7.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit7.setClockwise(false); lblUhrzeit7.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit7, CC.xy(7, 5, CC.CENTER, CC.BOTTOM)); //---- lblUhrzeit8 ---- lblUhrzeit8.setText("sonntags"); lblUhrzeit8.setOrientation(1); lblUhrzeit8.setFont(new Font("Arial", Font.PLAIN, 14)); lblUhrzeit8.setClockwise(false); lblUhrzeit8.setHorizontalTextPosition(SwingConstants.LEFT); pnlWeekly.add(lblUhrzeit8, CC.xy(8, 5, CC.CENTER, CC.BOTTOM)); //---- cbMon ---- cbMon.setBorder(BorderFactory.createEmptyBorder()); cbMon.setMargin(new Insets(0, 0, 0, 0)); cbMon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbMonActionPerformed(e); } }); pnlWeekly.add(cbMon, CC.xy(2, 7, CC.CENTER, CC.DEFAULT)); //---- cbDie ---- cbDie.setBorder(BorderFactory.createEmptyBorder()); cbDie.setMargin(new Insets(0, 0, 0, 0)); cbDie.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbDieActionPerformed(e); } }); pnlWeekly.add(cbDie, CC.xy(3, 7, CC.CENTER, CC.DEFAULT)); //---- cbMit ---- cbMit.setBorder(BorderFactory.createEmptyBorder()); cbMit.setMargin(new Insets(0, 0, 0, 0)); cbMit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbMitActionPerformed(e); } }); pnlWeekly.add(cbMit, CC.xy(4, 7, CC.CENTER, CC.DEFAULT)); //---- cbDon ---- cbDon.setBorder(BorderFactory.createEmptyBorder()); cbDon.setMargin(new Insets(0, 0, 0, 0)); cbDon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbDonActionPerformed(e); } }); pnlWeekly.add(cbDon, CC.xy(5, 7, CC.CENTER, CC.DEFAULT)); //---- cbFre ---- cbFre.setBorder(BorderFactory.createEmptyBorder()); cbFre.setMargin(new Insets(0, 0, 0, 0)); cbFre.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbFreActionPerformed(e); } }); pnlWeekly.add(cbFre, CC.xy(6, 7, CC.CENTER, CC.DEFAULT)); //---- cbSam ---- cbSam.setBorder(BorderFactory.createEmptyBorder()); cbSam.setMargin(new Insets(0, 0, 0, 0)); cbSam.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbSamActionPerformed(e); } }); pnlWeekly.add(cbSam, CC.xy(7, 7, CC.CENTER, CC.DEFAULT)); //---- cbSon ---- cbSon.setBorder(BorderFactory.createEmptyBorder()); cbSon.setMargin(new Insets(0, 0, 0, 0)); cbSon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cbSonActionPerformed(e); } }); pnlWeekly.add(cbSon, CC.xy(8, 7, CC.CENTER, CC.DEFAULT)); } tabWdh.addTab("W\u00f6chentlich", pnlWeekly); //======== pnlMonthly ======== { pnlMonthly.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.setLayout( new FormLayout("default, $lcgap, pref, $lcgap, 40dlu, $lcgap, pref, $lcgap, 61dlu", "3*(default, $lgap), default")); //---- lblEveryMonth ---- lblEveryMonth.setText("jeden"); lblEveryMonth.setFont(new Font("Arial", Font.PLAIN, 14)); lblEveryMonth.setHorizontalAlignment(SwingConstants.TRAILING); pnlMonthly.add(lblEveryMonth, CC.xy(3, 3)); //---- spinMonat ---- spinMonat.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.add(spinMonat, CC.xy(5, 3)); //---- lblMonth ---- lblMonth.setText("Monat"); lblMonth.setFont(new Font("Arial", Font.PLAIN, 14)); pnlMonthly.add(lblMonth, CC.xy(7, 3)); //---- btnJedenMonat ---- btnJedenMonat.setText("Jeden Monat"); btnJedenMonat.setFont(new Font("Arial", Font.PLAIN, 14)); btnJedenMonat.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnJedenMonatActionPerformed(e); } }); pnlMonthly.add(btnJedenMonat, CC.xywh(3, 5, 5, 1)); //---- llblOnDayOfMonth ---- llblOnDayOfMonth.setText("jeweils am"); llblOnDayOfMonth.setFont(new Font("Arial", Font.PLAIN, 14)); llblOnDayOfMonth.setHorizontalAlignment(SwingConstants.TRAILING); pnlMonthly.add(llblOnDayOfMonth, CC.xy(3, 7)); //---- spinDayInMonth ---- spinDayInMonth.setFont(new Font("Arial", Font.PLAIN, 14)); spinDayInMonth.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { spinMonatTagStateChanged(e); } }); pnlMonthly.add(spinDayInMonth, CC.xy(5, 7)); //---- cmbTag ---- cmbTag.setModel(new DefaultComboBoxModel<>(new String[] { "Tag des Monats", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag" })); cmbTag.setFont(new Font("Arial", Font.PLAIN, 14)); cmbTag.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { cmbTagItemStateChanged(e); } }); pnlMonthly.add(cmbTag, CC.xywh(7, 7, 3, 1)); } tabWdh.addTab("Monatlich", pnlMonthly); //======== pnlYearly ======== { pnlYearly.setLayout(new FormLayout("30dlu, $rgap, 26dlu, $rgap, pref, $ugap, default", "default, 15dlu, default")); //---- lblEveryYear ---- lblEveryYear.setText("alle"); lblEveryYear.setFont(new Font("Arial", Font.PLAIN, 14)); lblEveryYear.setHorizontalAlignment(SwingConstants.TRAILING); pnlYearly.add(lblEveryYear, CC.xy(1, 1)); //---- spinYearly ---- spinYearly.setFont(new Font("Arial", Font.PLAIN, 14)); pnlYearly.add(spinYearly, CC.xy(3, 1)); //---- lblYear ---- lblYear.setText("Jahre"); lblYear.setFont(new Font("Arial", Font.PLAIN, 14)); pnlYearly.add(lblYear, CC.xy(5, 1)); //---- btnEveryYear ---- btnEveryYear.setText("jedes Jahr"); btnEveryYear.setFont(new Font("Arial", Font.PLAIN, 14)); btnEveryYear.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnEveryYearActionPerformed(e); } }); pnlYearly.add(btnEveryYear, CC.xy(7, 1)); //---- lblOnDay ---- lblOnDay.setText("alle"); lblOnDay.setFont(new Font("Arial", Font.PLAIN, 14)); lblOnDay.setHorizontalAlignment(SwingConstants.TRAILING); pnlYearly.add(lblOnDay, CC.xy(1, 3)); //---- spinDayInMonthInYear ---- spinDayInMonthInYear.setFont(new Font("Arial", Font.PLAIN, 14)); pnlYearly.add(spinDayInMonthInYear, CC.xy(3, 3)); pnlYearly.add(cmbMonth, CC.xywh(5, 3, 3, 1)); } tabWdh.addTab("text", pnlYearly); } panelMain.add(tabWdh, CC.xywh(3, 11, 3, 1, CC.FILL, CC.FILL)); //---- lblLDate ---- lblLDate.setText("text"); lblLDate.setFont(new Font("Arial", Font.PLAIN, 10)); lblLDate.setHorizontalAlignment(SwingConstants.TRAILING); panelMain.add(lblLDate, CC.xy(5, 13)); panelMain.add(jdcStartingOn, CC.xywh(3, 15, 3, 1)); //======== jScrollPane1 ======== { //---- txtBemerkung ---- txtBemerkung.setColumns(20); txtBemerkung.setRows(5); txtBemerkung.setFont(new Font("Arial", Font.PLAIN, 14)); txtBemerkung.setLineWrap(true); txtBemerkung.setWrapStyleWord(true); jScrollPane1.setViewportView(txtBemerkung); } panelMain.add(jScrollPane1, CC.xywh(3, 17, 3, 1, CC.DEFAULT, CC.FILL)); //---- btnSave ---- btnSave.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png"))); btnSave.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnSaveActionPerformed(e); } }); panelMain.add(btnSave, CC.xy(5, 19, CC.RIGHT, CC.DEFAULT)); //---- lblDueDays ---- lblDueDays.setText("text"); lblDueDays.setFont(new Font("Arial", Font.PLAIN, 10)); lblDueDays.setHorizontalAlignment(SwingConstants.TRAILING); panelMain.add(lblDueDays, CC.xy(3, 5)); //---- txtDueDays ---- txtDueDays.setFont(new Font("Arial", Font.PLAIN, 14)); panelMain.add(txtDueDays, CC.xy(3, 7, CC.DEFAULT, CC.FILL)); } add(panelMain, BorderLayout.CENTER); //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); buttonGroup1.add(cbMon); buttonGroup1.add(cbDie); buttonGroup1.add(cbMit); buttonGroup1.add(cbDon); buttonGroup1.add(cbFre); buttonGroup1.add(cbSam); buttonGroup1.add(cbSon); }
From source file:op.users.PnlUser.java
private void initPanel() { fg = GUITools.getColor(OPDE.getProps().getProperty("EARLY_FGBHP")); bg = GUITools.getColor(OPDE.getProps().getProperty("EARLY_BGBHP")); contentMap = new HashMap<String, JPanel>(); cpMap = new HashMap<String, CollapsiblePane>(); usermap = new HashMap<String, Users>(); OPDE.getDisplayManager()/*from w w w .j a v a2 s . co m*/ .setMainMessage(OPDE.getAppInfo().getInternalClasses().get(internalClassID).getShortDescription()); prepareSearchArea(); tabMain.setTitleAt(TAB_USER, SYSTools.xx("opde.users.tab.users")); tabMain.setTitleAt(TAB_GROUPS, SYSTools.xx("opde.users.tab.groups")); tabMain.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { buildPanel(); } }); }
From source file:org.apache.cayenne.modeler.dialog.db.DbLoaderOptionsDialog.java
protected void initController() { selectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { processSelect();//w w w .ja v a 2s. com } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { processCancel(); } }); loadProcedures.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { procNamePatternField.setEnabled(loadProcedures.isSelected()); procedureLabel.setEnabled(loadProcedures.isSelected()); } }); }
From source file:org.apache.cayenne.modeler.dialog.db.merge.MergerOptions.java
protected void initController() { BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this); sqlBinding = builder.bindToTextArea(view.getSql(), "textForSQL"); builder.bindToAction(view.getGenerateButton(), "generateSchemaAction()"); builder.bindToAction(view.getSaveSqlButton(), "storeSQLAction()"); builder.bindToAction(view.getCancelButton(), "closeAction()"); // refresh SQL if different tables were selected view.getTabs().addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (view.getTabs().getSelectedIndex() == 1) { // this assumes that some tables where checked/unchecked... not very // efficient refreshGeneratorAction(); }/*from w ww . j av a 2s . c o m*/ } }); }
From source file:org.apache.jmeter.visualizers.RespTimeGraphVisualizer.java
/** * Initialize the GUI./*from ww w . ja v a 2s . co m*/ */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.setLayout(new BorderLayout()); // MAIN PANEL JPanel mainPanel = new JPanel(); Border margin = new EmptyBorder(10, 10, 5, 10); Border margin2 = new EmptyBorder(10, 10, 5, 10); mainPanel.setBorder(margin); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(makeTitlePanel()); JPanel settingsPane = new VerticalPanel(); settingsPane.setBorder(margin2); graphPanel = new RespTimeGraphChart(); graphPanel.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGTH)); settingsPane.add(createGraphActionsPane()); settingsPane.add(createGraphSettingsPane()); settingsPane.add(createGraphTitlePane()); settingsPane.add(createLinePane()); settingsPane.add(createGraphDimensionPane()); JPanel axisPane = new JPanel(new BorderLayout()); axisPane.add(createGraphXAxisPane(), BorderLayout.WEST); axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER); settingsPane.add(axisPane); settingsPane.add(createLegendPane()); tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane); //$NON-NLS-1$ tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel); //$NON-NLS-1$ // If clic on the Graph tab, make the graph (without apply interval or filter) ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource(); int index = srcTab.getSelectedIndex(); if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) { //$NON-NLS-1$ actionMakeGraph(); } } }; tabbedGraph.addChangeListener(changeListener); this.add(mainPanel, BorderLayout.NORTH); this.add(tabbedGraph, BorderLayout.CENTER); }
From source file:org.apache.jmeter.visualizers.StatGraphVisualizer.java
/** * Main visualizer setup./*from w w w . j ava 2 s.c o m*/ */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.setLayout(new BorderLayout()); // MAIN PANEL JPanel mainPanel = new JPanel(); Border margin = new EmptyBorder(10, 10, 5, 10); Border margin2 = new EmptyBorder(10, 10, 5, 10); mainPanel.setBorder(margin); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(makeTitlePanel()); myJTable = new JTable(model); JMeterUtils.applyHiDPI(myJTable); // Fix centering of titles myJTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer(COLUMNS_MSG_PARAMETERS)); myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70)); RendererUtils.applyRenderers(myJTable, RENDERERS); myScrollPane = new JScrollPane(myJTable); settingsPane = new VerticalPanel(); settingsPane.setBorder(margin2); graphPanel = new AxisGraph(); graphPanel.setPreferredSize(new Dimension(defaultWidth, defaultHeight)); settingsPane.add(createGraphActionsPane()); settingsPane.add(createGraphColumnPane()); settingsPane.add(createGraphTitlePane()); settingsPane.add(createGraphDimensionPane()); JPanel axisPane = new JPanel(new BorderLayout()); axisPane.add(createGraphXAxisPane(), BorderLayout.WEST); axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER); settingsPane.add(axisPane); settingsPane.add(createLegendPane()); tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane); //$NON-NLS-1$ tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel); //$NON-NLS-1$ // If clic on the Graph tab, make the graph (without apply interval or filter) ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource(); int index = srcTab.getSelectedIndex(); if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) { //$NON-NLS-1$ actionMakeGraph(); } } }; tabbedGraph.addChangeListener(changeListener); spane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); spane.setLeftComponent(myScrollPane); spane.setRightComponent(tabbedGraph); spane.setResizeWeight(.2); spane.setBorder(null); // see bug jdk 4131528 spane.setContinuousLayout(true); this.add(mainPanel, BorderLayout.NORTH); this.add(spane, BorderLayout.CENTER); }