private JCheckBox buildOnDatabaseCheckBox() { JCheckBox checkBox = new JCheckBox(); checkBox.setModel(buildOnDatabaseCheckBoxModel()); checkBox.setText(resourceRepository().getString("onDatabase")); checkBox.setMnemonic(resourceRepository().getMnemonic("onDatabase")); return checkBox; }
void update(String group) { myTitleLabel.setText( "<html><body><h2 style=\"text-align:left;\">" + group + "</h2></body></html>"); myContentPanel.removeAll(); List<IdSet> idSets = PluginGroups.getInstance().getSets(group); for (final IdSet set : idSets) { final JCheckBox checkBox = new JCheckBox(set.getTitle(), PluginGroups.getInstance().isIdSetAllEnabled(set)); checkBox.setModel( new JToggleButton.ToggleButtonModel() { @Override public boolean isSelected() { return PluginGroups.getInstance().isIdSetAllEnabled(set); } }); checkBox.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { PluginGroups.getInstance().setIdSetEnabled(set, !checkBox.isSelected()); CustomizePluginsStepPanel.this.repaint(); } }); myContentPanel.add(checkBox); } }
// Overrides superclass method @Override public void setModel(final ButtonModel newModel) { super.setModel(newModel); // Listen for enable changes if (model instanceof ButtonModelEx) { model.addChangeListener(new IndeterminateChangeListener()); } }
@Override protected void init(String text, Icon icon) { // substitutes the underlying checkbox model: // if we had call setModel an exception would be raised // because setModel calls a getModel that return a // QuadristateButtonModel, but at this point we // have a JToggleButtonModel this.model = new QuadristateButtonModel(); super.setModel(this.model); // side effect: set listeners super.init(text, icon); }
private JComponent createToolPanel() { JComponent box = Box.createVerticalBox(); JCheckBox button = new JCheckBox(disablingItem.getText()); button.setModel(disablingItem.getModel()); box.add(Box.createGlue()); box.add(button); box.add(Box.createGlue()); JRadioButton blur = new JRadioButton(blurItem.getText()); blur.setModel(blurItem.getModel()); box.add(blur); JRadioButton emboss = new JRadioButton(embossItem.getText()); emboss.setModel(embossItem.getModel()); box.add(emboss); JRadioButton translucent = new JRadioButton(busyPainterItem.getText()); translucent.setModel(busyPainterItem.getModel()); box.add(translucent); box.add(Box.createGlue()); return box; }
public void setModel(QuadristateButtonModel model) { super.setModel(model); }
/** the JbInit method */ public void jbInit() throws Exception { // Layout definition for this panel dataPanel.setLayout(panelLayout); dataPanel.setMinimumSize(new Dimension(100, 100)); this.setLayout(borderLayout); this.setSize(new Dimension(862, 514)); this.setPreferredSize(new Dimension(479, 306)); this.setMinimumSize(new Dimension(479, 306)); this.setMaximumSize(new Dimension(479, 306)); mIdtraslo.setDocument((Document) panelBinding.bindUIControl("Idtraslo", mIdtraslo)); mIdtraslo.setEditable(false); mDescrip.setFocusable(false); mDescrip.setEditable(false); mEstadotraslotxt.setFocusable(false); mEstadopasillotxt.setFocusable(false); mEstadoprocesotraslotxt.setFocusable(false); mDescripvisualEntrada.setFocusable(false); mDescripvisualSalida.setFocusable(false); mPasilloactual.setFocusable(false); mPasillodestino.setFocusable(true); mPosplc.setFocusable(false); jCheckBoxTrasbordoEntrada.setText("Trasbord Entradas"); jCheckBoxTrasbordoEntrada.setToolTipText( "Realitzar trasbord per ubicar containers en entrada de passadis"); dataPanel.add( labelIdtraslo, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mIdtraslo, new GridBagConstraints( 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelIdtraslo.setLabelFor(mIdtraslo); mIdtraslo.setColumns(5); labelIdtraslo.setText(panelBinding.findCtrlValueBinding("Idtraslo").getLabel()); mIdtraslo.setToolTipText(panelBinding.findCtrlValueBinding("Idtraslo").getTooltip()); mDescrip.setDocument((Document) panelBinding.bindUIControl("Descrip", mDescrip)); dataPanel.add( labelDescrip, new GridBagConstraints( 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mDescrip, new GridBagConstraints( 1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelDescrip.setLabelFor(mDescrip); mDescrip.setColumns(15); labelDescrip.setText(panelBinding.findCtrlValueBinding("Descrip").getLabel()); mDescrip.setToolTipText(panelBinding.findCtrlValueBinding("Descrip").getTooltip()); mEstadotraslotxt.setDocument( (Document) panelBinding.bindUIControl("Estadotraslotxt", mEstadotraslotxt)); dataPanel.add( labelEstadotraslotxt, new GridBagConstraints( 0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mEstadotraslotxt, new GridBagConstraints( 1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelEstadotraslotxt.setLabelFor(mEstadotraslotxt); mEstadotraslotxt.setColumns(20); labelEstadotraslotxt.setText(panelBinding.findCtrlValueBinding("Estadotraslotxt").getLabel()); mEstadotraslotxt.setToolTipText( panelBinding.findCtrlValueBinding("Estadotraslotxt").getTooltip()); mEstadopasillotxt.setDocument( (Document) panelBinding.bindUIControl("Estadopasillotxt", mEstadopasillotxt)); dataPanel.add( labelEstadopasillotxt, new GridBagConstraints( 0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mEstadopasillotxt, new GridBagConstraints( 1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelEstadopasillotxt.setLabelFor(mEstadopasillotxt); mEstadopasillotxt.setColumns(20); labelEstadopasillotxt.setText(panelBinding.findCtrlValueBinding("Estadopasillotxt").getLabel()); mEstadopasillotxt.setToolTipText( panelBinding.findCtrlValueBinding("Estadopasillotxt").getTooltip()); mEstadoprocesotraslotxt.setDocument( (Document) panelBinding.bindUIControl("Estadoprocesotraslotxt", mEstadoprocesotraslotxt)); dataPanel.add( labelEstadoprocesotraslotxt, new GridBagConstraints( 0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mEstadoprocesotraslotxt, new GridBagConstraints( 1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelEstadoprocesotraslotxt.setLabelFor(mEstadoprocesotraslotxt); mEstadoprocesotraslotxt.setColumns(20); labelEstadoprocesotraslotxt.setText( panelBinding.findCtrlValueBinding("Estadoprocesotraslotxt").getLabel()); mEstadoprocesotraslotxt.setToolTipText( panelBinding.findCtrlValueBinding("Estadoprocesotraslotxt").getTooltip()); mDescripvisualEntrada.setDocument( (Document) panelBinding.bindUIControl("DescripvisualEntrada", mDescripvisualEntrada)); dataPanel.add( labelDescripvisualEntrada, new GridBagConstraints( 0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mDescripvisualEntrada, new GridBagConstraints( 1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelDescripvisualEntrada.setLabelFor(mDescripvisualEntrada); mDescripvisualEntrada.setColumns(20); labelDescripvisualEntrada.setText( panelBinding.findCtrlValueBinding("DescripvisualEntrada").getLabel()); mDescripvisualEntrada.setToolTipText( panelBinding.findCtrlValueBinding("DescripvisualEntrada").getTooltip()); mDescripvisualSalida.setDocument( (Document) panelBinding.bindUIControl("DescripvisualSalida", mDescripvisualSalida)); dataPanel.add( labelDescripvisualSalida, new GridBagConstraints( 0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mDescripvisualSalida, new GridBagConstraints( 1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelDescripvisualSalida.setLabelFor(mDescripvisualSalida); mDescripvisualSalida.setColumns(20); labelDescripvisualSalida.setText( panelBinding.findCtrlValueBinding("DescripvisualSalida").getLabel()); mDescripvisualSalida.setToolTipText( panelBinding.findCtrlValueBinding("DescripvisualSalida").getTooltip()); mPasilloactual.setDocument( (Document) panelBinding.bindUIControl("Pasilloactual", mPasilloactual)); dataPanel.add( labelPasilloactual, new GridBagConstraints( 0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mPasilloactual, new GridBagConstraints( 1, 7, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelPasilloactual.setLabelFor(mPasilloactual); mPasilloactual.setColumns(3); labelPasilloactual.setText(panelBinding.findCtrlValueBinding("Pasilloactual").getLabel()); mPasilloactual.setToolTipText(panelBinding.findCtrlValueBinding("Pasilloactual").getTooltip()); mPasillodestino.setDocument( (Document) panelBinding.bindUIControl("Pasillodestino", mPasillodestino)); dataPanel.add( labelPasillodestino, new GridBagConstraints( 0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mPasillodestino, new GridBagConstraints( 1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); labelPasillodestino.setLabelFor(mPasillodestino); mPasillodestino.setColumns(3); labelPasillodestino.setText(panelBinding.findCtrlValueBinding("Pasillodestino").getLabel()); mPasillodestino.setToolTipText( panelBinding.findCtrlValueBinding("Pasillodestino").getTooltip()); mPosplc.setDocument((Document) panelBinding.bindUIControl("Posplc", mPosplc)); dataPanel.add( labelPosplc, new GridBagConstraints( 0, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); dataPanel.add( mPosplc, new GridBagConstraints( 1, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1)); // dataPanel.add(buttonArrancar, new GridBagConstraints(0, 10, 3, 2, 0.0, 0.0, // GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 22, 63), -98, -13)); dataPanel.add( buttonArrancar, new GridBagConstraints( 0, 10, 3, 2, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0)); // dataPanel.add(jCheckBoxTrasbordoEntrada, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, // GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); labelPosplc.setLabelFor(mPosplc); mPosplc.setColumns(5); labelPosplc.setText(panelBinding.findCtrlValueBinding("Posplc").getLabel()); // Layout the datapanel and the navigation bar mPosplc.setToolTipText(panelBinding.findCtrlValueBinding("Posplc").getTooltip()); add(dataPanel, BorderLayout.CENTER); navBar.setModel( JUNavigationBar.createViewBinding( panelBinding, navBar, "SgavtrasloEntSalView1", null, "SgavtrasloEntSal1Iter")); statusBar.setModel(JUStatusBar.createPanelBinding(panelBinding, statusBar)); add(navBar, BorderLayout.NORTH); add(statusBar, BorderLayout.SOUTH); // Quitar botones de add / remove navBar.remove(navBar.getButton(JUNavigationBar.BUTTON_DELETE)); navBar.remove(navBar.getButton(JUNavigationBar.BUTTON_INSERT)); jCheckBoxTrasbordoEntrada.setModel( (ButtonModel) panelBinding.bindUIControl("Trasbordoentrada", jCheckBoxTrasbordoEntrada)); if (getIdTraslo() == 0) jCheckBoxTrasbordoEntrada.setEnabled(false); }