Java Code Examples for javax.swing.JCheckBox

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project addis, under directory /application/src/main/java/org/drugis/addis/gui/components/.

Source file: MeasurementTable.java

  22 
vote

private JPanel createPanel(MissingMeasurementPresentation mmp){
  JPanel panel=new JPanel(new FlowLayout());
  String[] h=MeasurementInputHelper.getHeaders(mmp.getMeasurement());
  JCheckBox checkBox=BasicComponentFactory.createCheckBox(mmp.getMissingModel(),"Missing");
  JComponent[] c=MeasurementInputHelper.getComponents(mmp);
  panel.add(checkBox);
  for (int i=0; i < h.length; ++i) {
    panel.add(new JLabel(h[i]));
    panel.add(c[i]);
  }
  return panel;
}
 

Example 2

From project autopsy, under directory /KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/.

Source file: KeywordSearchConfigurationPanel3.java

  22 
vote

private void activateScriptsCheckboxes(boolean activate){
  final int components=checkPanel.getComponentCount();
  for (int i=0; i < components; ++i) {
    JCheckBox ch=(JCheckBox)checkPanel.getComponent(i);
    ch.setEnabled(activate);
  }
}
 

Example 3

From project ceres, under directory /ceres-ui/src/main/java/com/bc/ceres/swing/binding/internal/.

Source file: CheckBoxEditor.java

  22 
vote

private static JCheckBox createCheckBoxComponent(PropertyDescriptor propertyDescriptor,BindingContext bindingContext){
  JCheckBox checkBox=new JCheckBox();
  ComponentAdapter adapter=new AbstractButtonAdapter(checkBox);
  bindingContext.bind(propertyDescriptor.getName(),adapter);
  return checkBox;
}
 

Example 4

From project flyingsaucer, under directory /flying-saucer-core/src/main/java/org/xhtmlrenderer/simple/extend/form/.

Source file: CheckboxField.java

  22 
vote

public JComponent create(){
  JCheckBox checkbox=new JCheckBox();
  checkbox.setText("");
  checkbox.setOpaque(false);
  return checkbox;
}
 

Example 5

From project formic, under directory /src/java/org/formic/wizard/step/gui/.

Source file: FeatureListStep.java

  22 
vote

protected void toggleSelection(JTable table,int row){
  JCheckBox box=(JCheckBox)table.getModel().getValueAt(row,0);
  Feature feature=(Feature)table.getModel().getValueAt(row,1);
  box.doClick();
  feature.setEnabled(box.isSelected());
  processDependencies(feature);
  table.revalidate();
  table.repaint();
}
 

Example 6

From project glg2d, under directory /src/test/java/glg2d/.

Source file: VisualTest.java

  22 
vote

@Test public void drawCheckboxIconTest() throws Exception {
  tester.setPainter(new Painter(){
    @Override public void paint(    Graphics2D g2d){
      JCheckBox box=new JCheckBox();
      box.setSize(box.getPreferredSize());
      box.setSelected(true);
      box.paint(g2d);
    }
  }
);
  tester.assertSame();
}
 

Example 7

From project GraphWalker, under directory /src/main/java/org/graphwalker/GUI/.

Source file: App.java

  22 
vote

private JCheckBox makeNavigationCheckBoxButton(String imageName,String actionCommand,String toolTipText,String altText){
  JCheckBox button=new JCheckBox();
  button.setActionCommand(actionCommand);
  button.setToolTipText(toolTipText);
  button.addActionListener(this);
  button.setText(altText);
  return button;
}
 

Example 8

From project ib-ruby, under directory /misc/IBController 2-9-0/src/ibcontroller/.

Source file: Utils.java

  22 
vote

static boolean setCheckBoxSelected(Window window,String buttonText,final boolean value){
  final JCheckBox cb=findCheckBox(window,buttonText);
  if (cb == null)   return false;
  cb.setSelected(value);
  return true;
}
 

Example 9

From project imageflow, under directory /src/de/danielsenff/imageflow/gui/.

Source file: UnitPropertiesDialog.java

  22 
vote

private void addDisplaySilentCheckbox(final UnitElement unit){
  JCheckBox chkDisplay=new JCheckBox("Display result silently");
  chkDisplay.setToolTipText("After the workflow has been executed, nodes that are set to 'display' are displayed as a result.");
  chkDisplay.setSelected(unit.isDisplaySilent());
  chkDisplay.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      boolean newValue=((JCheckBox)event.getSource()).isSelected();
      unit.setDisplaySilent(newValue);
    }
  }
);
  addForm("",chkDisplay);
}
 

Example 10

From project JaamSim, under directory /com/sandwell/JavaSimulation3D/.

Source file: EditBox.java

  22 
vote

public void setListData(ArrayList<String> aList){
  if (list == null) {
    listModel=new DefaultListModel();
    list=new JList(listModel);
    list.setCellRenderer(new ListRenderer());
    checkBoxMouseAdapter=new CheckBoxMouseAdapter();
    list.addMouseListener(checkBoxMouseAdapter);
  }
  listModel.clear();
  for (  String each : aList) {
    JCheckBox checkBox=new JCheckBox(each);
    listModel.addElement(checkBox);
  }
}
 

Example 11

From project jlac, under directory /src/org/sump/analyzer/devices/.

Source file: FpgaDeviceController.java

  22 
vote

/** 
 * Creates an array of check boxes, adds it to the device controller and returns it.
 * @param label label to use on device controller component
 * @return array of created check boxes
 */
private JCheckBox[] createChannelList(JPanel pane,GridBagConstraints constraints){
  JCheckBox[] boxes=new JCheckBox[32];
  Container container=new Container();
  container.setLayout(new GridLayout(1,32));
  for (int col=31; col >= 0; col--) {
    JCheckBox box=new JCheckBox();
    box.setEnabled(false);
    container.add(box);
    if ((col % 8) == 0 && col > 0)     container.add(new JLabel());
    boxes[col]=box;
  }
  pane.add(container,constraints);
  return (boxes);
}
 

Example 12

From project jumpnevolve, under directory /lib/slick/src/org/newdawn/slick/font/effects/.

Source file: EffectUtil.java

  22 
vote

/** 
 * Prompts the user for boolean value
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
static public Value booleanValue(String name,final boolean currentValue,final String description){
  return new DefaultValue(name,String.valueOf(currentValue)){
    public void showDialog(){
      JCheckBox checkBox=new JCheckBox();
      checkBox.setSelected(currentValue);
      if (showValueDialog(checkBox,description))       value=String.valueOf(checkBox.isSelected());
    }
    public Object getObject(){
      return Boolean.valueOf(value);
    }
  }
;
}
 

Example 13

From project QuakeInjector, under directory /src/de/haukerehfeld/quakeinjector/.

Source file: PackageOverwriteDialog.java

  22 
vote

public List<String> getOverwritten(){
  List<String> overwritten=new ArrayList<String>(alwaysWriteList);
  for (  Map.Entry<String,JCheckBox> e : overwriteBoxes.entrySet()) {
    String name=e.getKey();
    JCheckBox box=e.getValue();
    if (box.isSelected()) {
      overwritten.add(name);
    }
  }
  return overwritten;
}
 

Example 14

From project ScapeToad, under directory /src/src/ch/epfl/scapetoad/.

Source file: CartogramWizard.java

  22 
vote

/** 
 * Saves the changes done by the user.
 */
public void saveChanges(){
  int nlayers=mCheckBoxList.size();
  Vector layers=new Vector();
  for (int i=0; i < nlayers; i++) {
    JCheckBox checkBox=(JCheckBox)mCheckBoxList.get(i);
    if (checkBox.isSelected()) {
      String layerName=checkBox.getText();
      Layer lyr=AppContext.layerManager.getLayer(layerName);
      layers.add(lyr);
    }
  }
  AppContext.cartogramWizard.setSimultaneousLayers(layers);
}
 

Example 15

From project skmclauncher, under directory /src/main/java/com/sk89q/mclauncher/.

Source file: OptionsPanel.java

  22 
vote

/** 
 * Build the "set" checkbox.
 * @param component component to control
 * @return checkbox
 */
private JCheckBox buildSetCheck(final Component component){
  final JCheckBox check=new JCheckBox("Set:");
  check.setBorder(null);
  check.setOpaque(false);
  check.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      component.setEnabled(check.isSelected());
    }
  }
);
  return check;
}
 

Example 16

From project beam-meris-icol, under directory /src/main/java/org/esa/beam/meris/icol/ui/.

Source file: IcolForm.java

  21 
vote

private void updateProductFormatChange(){
  if (isEnvisatOutputFormatSelected()) {
    JCheckBox saveToFileCheckBox=targetProductSelector.getSaveToFileCheckBox();
    saveToFileCheckBox.setSelected(true);
    saveToFileCheckBox.setEnabled(false);
    targetProductSelector.getFormatNameComboBox().setEnabled(true);
    targetProductSelector.getOpenInAppCheckBox().setEnabled(true);
    radianceProductTypeButton.setSelected(true);
    rhoToaProductTypeButton.setEnabled(false);
  }
 else {
    targetProductSelector.setEnabled(true);
    rhoToaProductTypeButton.setEnabled(true);
  }
  setRhoToaBandSelectionPanelEnabled(rhoToaProductTypeButton.isSelected());
}
 

Example 17

From project bndtools, under directory /bndtools.bndplugins/src/bndtools/bndplugins/repo/git/.

Source file: GitCredentialsProvider.java

  21 
vote

private static void updateCredentialItems(JComponent[] components){
  for (  JComponent component : components) {
    CredentialItem item=(CredentialItem)component.getClientProperty(CRED_ITEM);
    if (item == null) {
      continue;
    }
    if (item instanceof CredentialItem.Username) {
      JTextField field=(JTextField)component;
      ((CredentialItem.Username)item).setValue(field.getText());
      continue;
    }
    if (item instanceof CredentialItem.Password) {
      JPasswordField field=(JPasswordField)component;
      ((CredentialItem.Password)item).setValue(field.getPassword());
      continue;
    }
    if (item instanceof CredentialItem.StringType) {
      if (item.isValueSecure()) {
        JPasswordField field=(JPasswordField)component;
        ((CredentialItem.StringType)item).setValue(new String(field.getPassword()));
        continue;
      }
      JTextField field=(JTextField)component;
      ((CredentialItem.Username)item).setValue(field.getText());
      continue;
    }
    if (item instanceof CredentialItem.YesNoType) {
      JCheckBox field=(JCheckBox)component;
      ((CredentialItem.YesNoType)item).setValue(field.isSelected());
      continue;
    }
  }
}
 

Example 18

From project ChkBugReport, under directory /src/com/sonyericsson/chkbugreport/.

Source file: Gui.java

  21 
vote

private void buildSettings(JPanel settingsPanel){
  final Settings settings=mMain.getSettings();
  for (  Setting setting : settings) {
    if (setting instanceof BoolSetting) {
      final BoolSetting bs=(BoolSetting)setting;
      final JCheckBox chk=new JCheckBox(setting.getDescription());
      settingsPanel.add(chk);
      chk.setSelected(bs.get());
      chk.addChangeListener(new ChangeListener(){
        @Override public void stateChanged(        ChangeEvent e){
          bs.set(chk.isSelected());
          settings.save();
        }
      }
);
    }
  }
}
 

Example 19

From project codjo-standalone-common, under directory /src/main/java/net/codjo/utils/sql/.

Source file: DefaultDetailWindow.java

  21 
vote

/** 
 * Remplit la HashMap des composants avec le nom du champ comme cl et le composant comme valeur
 * @param conMan Description of Parameter
 * @exception SQLException Description of Exception
 */
private void initComponentList(ConnectionManager conMan) throws SQLException {
  FieldLabelComparator comparator=new FieldLabelComparator(conMan,tableToDisplay.getDBTableName());
  componentList=new TreeMap(comparator);
  Map columnList=tableToDisplay.getAllColumns();
  Iterator iter=columnList.keySet().iterator();
  while (iter.hasNext()) {
    String fieldName=(String)iter.next();
    Integer sqlType=(Integer)columnList.get(fieldName);
    if (sqlType.intValue() == Types.BIT) {
      JCheckBox cbx=new JCheckBox();
      cbx.setText("(modifi)");
      componentList.put(fieldName,cbx);
    }
 else {
      JTextField txf=new JTextField();
      componentList.put(fieldName,txf);
    }
  }
  if (tableToDisplay.getPkNames().size() == 1) {
    componentList.remove(tableToDisplay.getPkNames().get(0));
  }
}
 

Example 20

From project encog-java-workbench, under directory /src/main/java/org/encog/workbench/dialogs/common/.

Source file: CheckField.java

  21 
vote

public int createField(JPanel panel,int x,int y,int width){
  this.setField(new JCheckBox());
  this.getField().setLocation(x,y);
  this.getField().setSize(this.getField().getPreferredSize());
  this.getField().setSize(width,this.getField().getHeight());
  JLabel label=createLabel();
  label.setLocation(label.getX(),y);
  panel.add(label);
  panel.add(this.getField());
  ((JCheckBox)this.getField()).addActionListener(this);
  return y + this.getField().getHeight();
}
 

Example 21

From project FBReaderJ, under directory /obsolete/swing/src/org/geometerplus/zlibrary/ui/swing/dialogs/.

Source file: ZLBooleanOptionView.java

  21 
vote

protected void createItem(){
  final ZLBooleanOptionEntry booleanEntry=(ZLBooleanOptionEntry)myOption;
  myCheckBox=new JCheckBox(myName);
  myCheckBox.setSelected(booleanEntry.initialState());
  myCheckBox.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      booleanEntry.onStateChanged(myCheckBox.isSelected());
    }
  }
);
  myTab.insertWidget(myCheckBox);
}
 

Example 22

From project freemind, under directory /freemind/accessories/plugins/.

Source file: FormularEditor.java

  21 
vote

public void addToPanel(JPanel panel,GridBagLayout l,int y){
  super.addToPanel(panel,l,y);
  GridBagConstraints c=new GridBagConstraints();
  c.gridx=1;
  c.gridy=y;
  c.weightx=100;
  c.weighty=100;
  c.fill=GridBagConstraints.BOTH;
  final JCheckBox text=new JCheckBox();
  text.setSelected(getValue().equals("true") ? true : false);
  l.setConstraints(text,c);
  panel.add(text);
  text.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      if (e.getStateChange() == ItemEvent.DESELECTED) {
        setValue("false");
      }
 else {
        setValue("true");
      }
    }
  }
);
}
 

Example 23

From project hudsontrayapp-plugin, under directory /client-common/src/main/java/org/hudson/trayapp/gui/.

Source file: ConfigurationPanel.java

  21 
vote

/** 
 * This method initializes showHealthCB	
 * @return javax.swing.JCheckBox	
 */
private JCheckBox getShowHealthCB(){
  if (showHealthCB == null) {
    showHealthCB=new JCheckBox();
    showHealthCB.addActionListener(new java.awt.event.ActionListener(){
      public void actionPerformed(      java.awt.event.ActionEvent e){
        updatePreferencesFromUIConfiguration();
        HudsonTrayApp.getHudsonTrayAppInstance().updateTrayIcon();
      }
    }
);
  }
  return showHealthCB;
}
 

Example 24

From project isohealth, under directory /Oauth/java/jmeter/jmeter/src/main/java/org/apache/jmeter/protocol/oauth/control/gui/.

Source file: OAuthConfigGui.java

  21 
vote

/** 
 * Consumer key panel contains Consumer key Use Auth Header? Encode?
 * @return
 */
protected JPanel getConsumerKeyPanel(){
  key=new JTextField(15);
  key.setName(OAuthSampler.KEY);
  JLabel keyLabel=new JLabel(OAuthSamplerGui.getResString("oauth_consumer_key"));
  keyLabel.setLabelFor(key);
  useAuthHeader=new JCheckBox(OAuthSamplerGui.getResString("oauth_use_auth_header"));
  useAuthHeader.setName(OAuthSampler.USE_AUTH_HEADER);
  useAuthHeader.setSelected(false);
  JPanel panel=new JPanel(new GridBagLayout());
  panel.add(keyLabel,fixedConstraints);
  panel.add(key,stretchyConstraints);
  panel.add(useAuthHeader,fixedConstraints);
  return panel;
}
 

Example 25

From project jftp, under directory /src/main/java/com/myjavaworld/jftp/.

Source file: LocalFilePropertiesDlg.java

  21 
vote

private Component getAttributesPanel(){
  JPanel panel=new JPanel(new GridLayout(1,3,10,3));
  panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("title.attributes")));
  cbRead=new JCheckBox(resources.getString("text.read"),file.canRead());
  cbWrite=new JCheckBox(resources.getString("text.write"),file.canWrite());
  cbHidden=new JCheckBox(resources.getString("text.hidden"),file.isHidden());
  cbRead.setEnabled(false);
  cbWrite.setEnabled(false);
  cbHidden.setEnabled(false);
  panel.add(cbRead);
  panel.add(cbWrite);
  panel.add(cbHidden);
  return panel;
}
 

Example 26

From project jmeter-components, under directory /src/main/java/com/atlantbh/jmeter/plugins/jsonutils/jsonpathassertion/gui/.

Source file: JSONPathAssertionGui.java

  21 
vote

public void init(){
  setLayout(new BorderLayout());
  setBorder(makeBorder());
  add(makeTitlePanel(),BorderLayout.NORTH);
  VerticalPanel panel=new VerticalPanel();
  panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"JSON path assertion"));
  jsonPath=new JLabeledTextField("JSON path: ");
  jsonValue=new JLabeledTextField("Expected value: ");
  jsonValidation=new JCheckBox("Validate against expected value");
  panel.add(jsonPath);
  panel.add(jsonValue);
  panel.add(jsonValidation);
  add(panel,BorderLayout.CENTER);
}
 

Example 27

From project jninka, under directory /jninka-parent/jninka-gui/src/main/java/org/whitesource/jninka/gui/.

Source file: AgentPresenter.java

  21 
vote

private JPanel getUnknownsPanel(){
  BorderLayout layout=new BorderLayout();
  JPanel result=new JPanel(layout);
  sureMatchChk=new JCheckBox("Only get sure matches",true);
  sureMatchChk.setSelected(false);
  result.add(sureMatchChk,BorderLayout.SOUTH);
  result.setBackground(BG_COLOR);
  return result;
}
 

Example 28

From project kabeja, under directory /blocks/ui/src/main/java/org/kabeja/ui/impl/.

Source file: ProcessingRunViewComponent.java

  21 
vote

protected void chooseInput(){
  JFileChooser fc=new JFileChooser(this.baseDir);
  fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  JCheckBox cb=new JCheckBox();
  cb.setSelected(true);
  JPanel p=new JPanel(new FlowLayout());
  p.add(cb);
  p.add(new JLabel(Messages.getString("ProcessingRunViewComponent.file.dialog.autogenerate")));
  fc.setAccessory(p);
  int value=fc.showOpenDialog(null);
  if (value == JFileChooser.APPROVE_OPTION) {
    File file=fc.getSelectedFile();
    this.autogenerateOutput=cb.isSelected();
    if (file.isFile()) {
      this.baseDir=file.getParent();
      this.processInput(file);
    }
 else     if (file.isDirectory()) {
      this.baseDir=file.getAbsolutePath();
      this.log(Messages.getString("ProcessingRunViewComponent.log.select.directory") + file.getAbsolutePath() + "\n");
      this.log("No preview\n");
    }
  }
}
 

Example 29

From project LateralGM, under directory /org/lateralgm/subframes/.

Source file: SpriteFrame.java

  21 
vote

private JPanel makeSubimagesPane(){
  JPanel pane=new JPanel(new BorderLayout());
  pane.setPreferredSize(new Dimension(1,1));
  JToolBar tool=new JToolBar();
  tool.setFloatable(false);
  pane.add(tool,BorderLayout.NORTH);
  makeToolButton(tool,"SpriteFrame.ADD");
  makeToolButton(tool,"SpriteFrame.REMOVE");
  tool.addSeparator();
  makeToolButton(tool,"SpriteFrame.PREVIOUS");
  makeToolButton(tool,"SpriteFrame.NEXT");
  JCheckBox cb=new JCheckBox("Wrap",true);
  tool.add(cb);
  cb.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean b=((JCheckBox)e.getSource()).isSelected();
      if (b)       subList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
 else       subList.setLayoutOrientation(JList.VERTICAL);
    }
  }
);
  subList=new JList();
  subList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
  subList.setVisibleRowCount(-1);
  subList.setBackground(Color.LIGHT_GRAY);
  subList.setDragEnabled(true);
  subList.setDropMode(DropMode.INSERT);
  subList.setTransferHandler(new SubImageTransfer());
  subList.addMouseListener(this);
  subList.setDragEnabled(true);
  pane.add(new JScrollPane(subList),BorderLayout.CENTER);
  return pane;
}
 

Example 30

From project Moneychanger, under directory /src/main/java/com/moneychanger/ui/panels/.

Source file: WebBrowserPanel.java

  21 
vote

public WebBrowserPanel(String url,String usernameID,String passwordID,String username,String password){
  super(new BorderLayout());
  JPanel webBrowserPanel=new JPanel(new BorderLayout());
  final JWebBrowser webBrowser=new JWebBrowser();
  WebBrowserNavigationParameters parameters=new WebBrowserNavigationParameters();
  Map<String,String> postDataMap=new HashMap<String,String>();
  postDataMap.put(usernameID,username);
  postDataMap.put(passwordID,password);
  parameters.setPostData(postDataMap);
  webBrowser.navigate(url,parameters);
  webBrowserPanel.add(webBrowser,BorderLayout.CENTER);
  add(webBrowserPanel,BorderLayout.CENTER);
  JPanel buttonPanel=new JPanel(new FlowLayout(FlowLayout.CENTER,4,4));
  JCheckBox menuBarCheckBox=new JCheckBox("Menu Bar",webBrowser.isMenuBarVisible());
  menuBarCheckBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      webBrowser.setMenuBarVisible(e.getStateChange() == ItemEvent.SELECTED);
    }
  }
);
  buttonPanel.add(menuBarCheckBox);
  add(buttonPanel,BorderLayout.SOUTH);
}
 

Example 31

From project narya, under directory /core/src/main/java/com/threerings/admin/client/.

Source file: BooleanFieldEditor.java

  21 
vote

public BooleanFieldEditor(PresentsContext ctx,Field field,DObject object){
  super(ctx,field,object);
  JPanel jpan=new JPanel(new HGroupLayout(HGroupLayout.STRETCH));
  jpan.add(_value=new JCheckBox(),GroupLayout.FIXED);
  jpan.add(new Spacer(1,1));
  _value.addActionListener(this);
  add(jpan);
  _value.addFocusListener(this);
}
 

Example 32

From project netbeans-plugin, under directory /src/org/netbeans/modules/php/nette/editor/hints/ui/.

Source file: HintsPanel.java

  21 
vote

HintsPanel(){
  initComponents();
  settings=HintsSettings.getSettings();
  for (  Map.Entry<String,Boolean> entry : settings.entrySet()) {
    boolean b=entry.getValue();
    JCheckBox chbox=new JCheckBox(AbstractHint.getDescription(entry.getKey()));
    chbox.setName(entry.getKey());
    chbox.setSelected(b);
    chbox.addActionListener(new java.awt.event.ActionListener(){
      @Override public void actionPerformed(      java.awt.event.ActionEvent evt){
        checkboxClicked(evt);
      }
    }
);
    boxContainer.add(chbox);
  }
  update();
}
 

Example 33

From project packetsamurai, under directory /src/com/l2j/packetsamurai/gui/.

Source file: FilterDlg.java

  21 
vote

public void actionPerformed(ActionEvent e){
  if (e.getActionCommand().equals("ok")) {
    FilterDlg.this.setVisible(false);
  }
 else   if (e.getActionCommand().equals("apply")) {
    FilterDlg.this.getViewPane().displaySession();
  }
 else {
    JCheckBox jcb=((JCheckBox)e.getSource());
    String name=jcb.getText();
    boolean selected=jcb.isSelected();
    if (FilterDlg.this._tabPane.getSelectedIndex() == 0) {
      FilterDlg.this.getClientFilter().put(name,selected);
    }
 else {
      FilterDlg.this.getServerFilter().put(name,selected);
    }
  }
}
 

Example 34

From project pomodoro4nb, under directory /src/org/matveev/pomodoro4nb/prefs/.

Source file: PreferencesDialog.java

  21 
vote

private void updateComponentsWithPrefs(){
  enableReminderCheckbox.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      final JCheckBox box=(JCheckBox)e.getSource();
      reminderIntervalSpinner.setEnabled(box.isSelected());
    }
  }
);
  pomodoroLengthSpinner.setValue(provider.getInteger(POMODORO_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_POMODORO_LENGTH));
  shorBreakLengthSpinner.setValue(provider.getInteger(SHORT_BREAK_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_SHORT_BREAK_LENGTH));
  longBreakLengthSpinner.setValue(provider.getInteger(LONG_BREAK_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_LONG_BREAK_LENGTH));
  longBreakIntervalSpinner.setValue(provider.getInteger(LONG_BREAK_INTERVAL_KEY,DefaultPreferencesProvider.DEFAULT_LONG_BREAK_INTERVAL));
  enableSoundsCheckbox.setSelected(provider.getBoolean(ENABLE_SOUNDS_KEY,true));
  enableReminderCheckbox.setSelected(provider.getBoolean(ENABLE_REMINDER_KEY,true));
  reminderIntervalSpinner.setEnabled(provider.getBoolean(ENABLE_REMINDER_KEY,true));
}
 

Example 35

From project RegexTagForMusic, under directory /src/org/essembeh/rtfm/gui/renderers/.

Source file: ThreeStatesBooleanRenderer.java

  21 
vote

public ThreeStatesBooleanRenderer(){
  this.stateNull=new JLabel();
  this.stateTrue=new JCheckBox();
  this.stateFalse=new JCheckBox();
  this.stateTrue.setSelected(true);
  this.stateTrue.setBackground(Color.WHITE);
  this.stateFalse.setSelected(false);
  this.stateFalse.setBackground(Color.WHITE);
}
 

Example 36

From project RomRaider, under directory /src/com/romraider/editor/ecu/.

Source file: ECUEditor.java

  21 
vote

public void addRom(Rom input){
  RomTreeNode romNode=new RomTreeNode(input,settings.getUserLevel(),settings.isDisplayHighTables(),this);
  imageRoot.add(romNode);
  imageList.setRootVisible(true);
  imageList.expandRow(imageList.getRowCount() - 1);
  imageList.setRootVisible(false);
  if (null == getLastSelectedRom()) {
    setLastSelectedRom(input);
  }
  if (input.getRomID().isObsolete() && settings.isObsoleteWarning()) {
    JPanel infoPanel=new JPanel();
    infoPanel.setLayout(new GridLayout(3,1));
    infoPanel.add(new JLabel("A newer version of this ECU revision exists. " + "Please visit the following link to download the latest revision:"));
    infoPanel.add(new URL(settings.getRomRevisionURL()));
    JCheckBox check=new JCheckBox("Always display this message",true);
    check.setHorizontalAlignment(JCheckBox.RIGHT);
    check.addActionListener(new ActionListener(){
      @Override public void actionPerformed(      ActionEvent e){
        settings.setObsoleteWarning(((JCheckBox)e.getSource()).isSelected());
      }
    }
);
    infoPanel.add(check);
    showMessageDialog(this,infoPanel,"ECU Revision is Obsolete",INFORMATION_MESSAGE);
  }
  input.setContainer(this);
}
 

Example 37

From project rpiplanner, under directory /src/rpiplanner/view/.

Source file: CourseEditDialog.java

  21 
vote

protected void bind(){
  BeanProperty<JTextField,String> text=BeanProperty.create("text");
  BeanProperty<JTextArea,String> textArea=BeanProperty.create("text");
  BeanProperty<JComboBox,String> selectedItem=BeanProperty.create("selectedItem");
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("department"),departmentField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("title"),titleField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("catalogNumber"),catalogField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("description"),descriptionTextArea,textArea).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("credits"),creditsComboBox,selectedItem).bind();
  StringBuilder builder=new StringBuilder();
  for (  Course c : toEdit.getPrerequisites())   builder.append(c.getCatalogNumber());
  prerequisitesField.setText(builder.toString());
  builder=new StringBuilder();
  for (  Course c : toEdit.getCorequisites())   builder.append(c.getCatalogNumber());
  corequisitesField.setText(builder.toString());
  for (  Component c : offeredDuringPanel.getComponents()) {
    JCheckBox box=(JCheckBox)c;
    box.setSelected(false);
    if (toEdit.getAvailableTerms() != null) {
      for (      YearPart t : toEdit.getAvailableTerms()) {
        if (box.getText().equals(t.toString()))         box.setSelected(true);
      }
    }
 else {
      box.setSelected(true);
    }
  }
}
 

Example 38

From project SPaTo_Visual_Explorer, under directory /src/net/spato/sve/app/.

Source file: Updater.java

  21 
vote

public int showReleaseNotesDialog(boolean canRestart){
  String url=releaseNotesURL + "?version=" + app.VERSION+ "&index="+ indexName;
  XHTMLPanel htmlView=new XHTMLPanel();
  try {
    htmlView.setDocument(url);
  }
 catch (  Exception e) {
    throw new RuntimeException("could not fetch release notes from " + url,e);
  }
  JScrollPane scrollPane=new FSScrollPane(htmlView);
  scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  JPanel panel=new JPanel(new BorderLayout(0,10));
  panel.add(new JLabel("An update is available and can be applied the next time you start SPaTo Visual Explorer."),BorderLayout.NORTH);
  panel.add(scrollPane,BorderLayout.CENTER);
  panel.add(new JLabel("<html>You are currently running version <b>" + app.VERSION + "</b> ("+ app.VERSION_DATE+ ").</html>"),BorderLayout.SOUTH);
  panel.setPreferredSize(new Dimension(600,400));
  panel.setMinimumSize(new Dimension(300,200));
  JCheckBox cbAutoUpdate=new JCheckBox("Automatically check for updates in the future",app.prefs.getBoolean("update.check",true));
  JPanel panel2=new JPanel(new BorderLayout(0,20));
  panel2.add(panel,BorderLayout.CENTER);
  panel2.add(cbAutoUpdate,BorderLayout.SOUTH);
  Object options[]=canRestart ? new Object[]{"Restart now","Restart later","Skip this update"} : new Object[]{"Awesome!","Skip this update"};
  int result=JOptionPane.showOptionDialog(app.frame,panel2,"Good news, everyone!",JOptionPane.INFORMATION_MESSAGE,JOptionPane.YES_NO_CANCEL_OPTION,null,options,options[0]);
  app.prefs.putBoolean("update.check",cbAutoUpdate.isSelected());
  if (result == (canRestart ? 2 : 1))   return IGNORE;
  if (result == (canRestart ? 1 : 0))   return INSTALL;
  if (result == 0 && canRestart)   return RESTART;
  return NOTHING;
}
 

Example 39

From project tomighty, under directory /tomighty-swing/src/main/java/org/tomighty/ui/options/.

Source file: UserInterface.java

  21 
vote

public UserInterface(){
  autoHideOption=new JCheckBox();
  draggableWindowOption=new JCheckBox();
  showTimeOnTrayOption=new JCheckBox();
  add(createThemeOptions());
  add(autoHideOption);
  add(draggableWindowOption);
  add(showTimeOnTrayOption);
}
 

Example 40

From project verdandi, under directory /src/main/java/verdandi/ui/settings/.

Source file: DefaultSettingsPanel.java

  21 
vote

private JPanel getMiscellaneousSettingsPanel(){
  JPanel res=new JPanel();
  res.setLayout(new BoxLayout(res,BoxLayout.PAGE_AXIS));
  showTimerOnStartupCheckBox=new JCheckBox(RC.getString("settingseditor.show.timer.on.startup"));
  storePasswordCheckBox=new JCheckBox(RC.getString("settingseditor.store.password.title"));
  res.add(showTimerOnStartupCheckBox);
  res.add(storePasswordCheckBox);
  return res;
}
 

Example 41

From project watchmaker, under directory /examples/src/java/main/org/uncommons/watchmaker/examples/travellingsalesman/.

Source file: ItineraryPanel.java

  21 
vote

ItineraryPanel(List<String> cities){
  super(new BorderLayout());
  JPanel checkBoxPanel=new JPanel(new GridLayout(0,1));
  checkBoxes=new ArrayList<JCheckBox>(cities.size());
  for (  String city : cities) {
    JCheckBox checkBox=new JCheckBox(city,false);
    checkBox.setName(city);
    checkBoxes.add(checkBox);
    checkBoxPanel.add(checkBox);
  }
  add(checkBoxPanel,BorderLayout.CENTER);
  JPanel buttonPanel=new JPanel(new GridLayout(2,1));
  selectAllButton=new JButton("Select All");
  selectAllButton.setName("All");
  buttonPanel.add(selectAllButton);
  clearButton=new JButton("Clear Selection");
  clearButton.setName("None");
  buttonPanel.add(clearButton);
  ActionListener buttonListener=new ActionListener(){
    public void actionPerformed(    ActionEvent actionEvent){
      boolean select=actionEvent.getSource() == selectAllButton;
      for (      JCheckBox checkBox : checkBoxes) {
        checkBox.setSelected(select);
      }
    }
  }
;
  selectAllButton.addActionListener(buttonListener);
  clearButton.addActionListener(buttonListener);
  add(buttonPanel,BorderLayout.SOUTH);
  setBorder(BorderFactory.createTitledBorder("Itinerary"));
}
 

Example 42

From project codjo-imports, under directory /codjo-imports-gui/src/main/java/net/codjo/imports/gui/.

Source file: FieldImportDetailWindow.java

  20 
vote

public FieldImportDetailWindow(DetailDataSource dataSource,Row selectedFileRow) throws RequestException {
  super("Description d'une colonne",true,false,true,true);
  this.dataSource=dataSource;
  this.getContentPane().add(mainPanel,BorderLayout.CENTER);
  ButtonPanelLogic buttonPanelLogic=new ButtonPanelLogic();
  this.getContentPane().add(buttonPanelLogic.getGui(),BorderLayout.SOUTH);
  TableStructure currentStructure=getCurrentTableStructure(selectedFileRow);
  NumberField positionField=buildIntegerField();
  addField("position",positionLabel,positionField);
  addField("length",lengthLabel,buildIntegerField());
  StructureCombo combo=new StructureCombo(currentStructure.getFieldsBySqlKey());
  addField("dbDestinationFieldName",destinationFieldNameLabel,combo);
  JComboBox comboBox=new JComboBox(new Object[]{FieldType.STRING_FIELD,FieldType.NUMERIC_FIELD,FieldType.DATE_FIELD,FieldType.CLASS_FIELD,FieldType.BOOLEAN_FIELD});
  comboBox.setRenderer(new FieldTypeRenderer());
  addField("destinationFieldType",destinationFieldTypeLabel,comboBox);
  addField("removeLeftZeros",removeLeftZerosLabel,new JCheckBox());
  addField("expression",expressionLabel,new JTextArea(3,20));
  dataSource.declare("importSettingsId",new NumberField());
  dataSource.setFieldValue("importSettingsId",selectedFileRow.getFieldValue("importSettingsId"));
  dataSource.load();
  buttonPanelLogic.setMainDataSource(dataSource);
  boolean updateMode=dataSource.getLoadFactory() != null;
  positionField.setEnabled(!updateMode);
  translationNotifier=InternationalizationUtil.retrieveTranslationNotifier(dataSource.getGuiContext());
  translationNotifier.addInternationalizableContainer(this);
}
 

Example 43

From project drools-planner, under directory /drools-planner-examples/src/main/java/org/drools/planner/examples/common/swingui/.

Source file: SolverAndPersistenceFrame.java

  20 
vote

private JComponent createProcessingPanel(){
  JPanel panel=new JPanel(new GridLayout(0,1));
  solveAction=new SolveAction();
  solveAction.setEnabled(false);
  panel.add(new JButton(solveAction));
  terminateSolvingEarlyAction=new TerminateSolvingEarlyAction();
  terminateSolvingEarlyAction.setEnabled(false);
  panel.add(new JButton(terminateSolvingEarlyAction));
  refreshScreenDuringSolvingCheckBox=new JCheckBox("Refresh screen during solving",solutionPanel.isRefreshScreenDuringSolving());
  panel.add(refreshScreenDuringSolvingCheckBox);
  openAction=new OpenAction();
  openAction.setEnabled(true);
  panel.add(new JButton(openAction));
  saveAction=new SaveAction();
  saveAction.setEnabled(false);
  panel.add(new JButton(saveAction));
  importAction=new ImportAction();
  importAction.setEnabled(solutionBusiness.hasImporter());
  panel.add(new JButton(importAction));
  exportAction=new ExportAction();
  exportAction.setEnabled(false);
  panel.add(new JButton(exportAction));
  return panel;
}
 

Example 44

From project eclim, under directory /org.eclim.installer/java/org/eclim/installer/step/.

Source file: VimStep.java

  20 
vote

/** 
 * {@inheritDoc}
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init(){
  GuiForm form=createForm();
  String files=fieldName("files");
  fileChooser=new FileChooser(JFileChooser.DIRECTORIES_ONLY);
  fileChooser.getFileChooser().setFileHidingEnabled(false);
  fileChooser.getFileChooser().addChoosableFileFilter(new FileFilter(){
    public boolean accept(    java.io.File f){
      String path=f.getAbsolutePath();
      return f.isDirectory() && (path.matches(".*/\\.vim(/.*|$)") || !path.matches(".*/\\..*"));
    }
    public String getDescription(){
      return null;
    }
  }
);
  String skip=fieldName("skip");
  skipCheckBox=new JCheckBox(Installer.getString(skip));
  skipCheckBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean selected=((JCheckBox)e.getSource()).isSelected();
      JTextField fileField=fileChooser.getTextField();
      fileField.setEnabled(!selected);
      fileChooser.getButton().setEnabled(!selected);
      if (dirList != null) {
        dirList.setEnabled(!selected);
      }
      Validator validator=(Validator)fileField.getClientProperty("validator");
      setValid(selected || validator.isValid(fileField.getText()));
    }
  }
);
  panel=new JPanel(new MigLayout("wrap 2","[fill]","[] [] [] [fill, grow]"));
  panel.add(form.createMessagePanel(),"span");
  panel.add(new JLabel(Installer.getString(files)),"split");
  panel.add(fileChooser,"skip");
  panel.add(skipCheckBox,"span");
  form.bind(files,fileChooser.getTextField(),new ValidatorBuilder().required().isDirectory().fileExists().isWritable().validator());
  return panel;
}
 

Example 45

From project groovejaar, under directory /src/groovejaar/.

Source file: Login.java

  20 
vote

/** 
 * Create the dialog.
 */
public Login(){
  this.setIconImage(new ImageUtil().getLogo());
  setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  setBounds(100,100,278,218);
  contentPanel.setBorder(new EmptyBorder(5,5,5,5));
{
    textField=new JTextField();
    textField.setColumns(10);
  }
  getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.X_AXIS));
  passwordField=new JPasswordField();
  JLabel lblUsername=new JLabel("Username");
  JLabel lblPassword=new JLabel("Password");
  contentPanel.setLayout(new FormLayout(new ColumnSpec[]{ColumnSpec.decode("252px")},new RowSpec[]{FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("14px"),FormFactory.UNRELATED_GAP_ROWSPEC,RowSpec.decode("20px"),FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("14px"),FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("33px"),FormFactory.RELATED_GAP_ROWSPEC,FormFactory.DEFAULT_ROWSPEC}));
  contentPanel.add(textField,"1, 4, fill, top");
  contentPanel.add(lblUsername,"1, 2, center, top");
  contentPanel.add(lblPassword,"1, 6, center, top");
  contentPanel.add(passwordField,"1, 8, fill, top");
  getContentPane().add(contentPanel);
  chckbxLogin=new JCheckBox("Auto Login");
  contentPanel.add(chckbxLogin,"1, 10");
}
 

Example 46

From project jmeter-amf, under directory /src/protocol/amf/org/apache/jmeter/protocol/amf/gui/.

Source file: AmfProxyControlGui.java

  20 
vote

private JPanel createPortPanel(){
  portField=new JTextField(AmfProxyControl.DEFAULT_PORT_S,5);
  portField.setName(PORTFIELD);
  portField.addKeyListener(this);
  JLabel label=new JLabel(JMeterUtils.getResString("port"));
  label.setLabelFor(portField);
  httpsSpoof=new JCheckBox(JMeterUtils.getResString("proxy_httpsspoofing"));
  httpsSpoof.setSelected(false);
  httpsSpoof.addActionListener(this);
  httpsSpoof.setActionCommand(ENABLE_RESTART);
  httpsMatch=new JTextField(40);
  httpsMatch.addKeyListener(this);
  httpsMatch.setName(ENABLE_RESTART);
  httpsMatch.setEnabled(false);
  JLabel matchlabel=new JLabel(JMeterUtils.getResString("proxy_httpsspoofing_match"));
  matchlabel.setLabelFor(httpsMatch);
  HorizontalPanel panel=new HorizontalPanel();
  panel.add(label);
  panel.add(portField);
  panel.add(Box.createHorizontalStrut(10));
  panel.add(httpsSpoof);
  panel.add(matchlabel);
  panel.add(httpsMatch);
  return panel;
}
 

Example 47

From project jreepad, under directory /src/jreepad/.

Source file: JreepadViewer.java

  20 
vote

public void establishAutosaveDialogue(){
  Box vBox, hBox;
  autoSaveDialog=new JDialog(this,lang.getString("AUTOSAVE"),true);
  autoSaveDialog.setVisible(false);
  vBox=Box.createVerticalBox();
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveCheckBox=new JCheckBox(lang.getString("AUTOSAVE_EVERY"),getPrefs().autoSave));
  hBox.add(autoSavePeriodSpinner=new JSpinner(new SpinnerNumberModel(getPrefs().autoSavePeriod,1,1000,1)));
  hBox.add(new JLabel(lang.getString("AUTOSAVE_MINUTES")));
  vBox.add(hBox);
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveOkButton=new JButton(lang.getString("OK")));
  hBox.add(autoSaveCancelButton=new JButton(lang.getString("CANCEL")));
  autoSaveOkButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      getPrefs().autoSavePeriod=((Integer)(autoSavePeriodSpinner.getValue())).intValue();
      getPrefs().autoSave=autoSaveCheckBox.isSelected();
      autoSaveDialog.setVisible(false);
      if (getPrefs().autoSave && !(autoSaveThread.isAlive())) {
        autoSaveWarningMessage();
        autoSaveThread.start();
      }
      updateWindowTitle();
    }
  }
);
  autoSaveCancelButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      autoSaveDialog.setVisible(false);
    }
  }
);
  vBox.add(Box.createGlue());
  vBox.add(hBox);
  autoSaveDialog.getContentPane().add(vBox);
}
 

Example 48

From project Laserschein, under directory /src/laserschein/ui/.

Source file: BooleanTweaker.java

  20 
vote

public BooleanTweaker(String theTitle,boolean theDefault){
  super();
  this.setOpaque(false);
  _myLabel=new JLabel(theTitle);
  _myLabel.setFocusable(false);
  this.add(_myLabel);
  _myCheckbox=new JCheckBox();
  _myCheckbox.setSelected(theDefault);
  _myCheckbox.setFocusable(true);
  this.add(_myCheckbox);
  _myCheckbox.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      notifyListeners();
    }
  }
);
}
 

Example 49

From project lilith, under directory /lilith/src/main/java/de/huxhorn/lilith/swing/preferences/.

Source file: ColorChooserPanel.java

  20 
vote

private void createUI(){
  JPanel emptyPreview=new JPanel();
  emptyPreview.setMinimumSize(new Dimension(0,0));
  emptyPreview.setPreferredSize(new Dimension(0,0));
  emptyPreview.setMaximumSize(new Dimension(0,0));
  setLayout(new GridBagLayout());
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.anchor=GridBagConstraints.FIRST_LINE_START;
  gbc.fill=GridBagConstraints.BOTH;
  gbc.gridx=0;
  gbc.gridy=0;
  gbc.gridwidth=1;
  gbc.weightx=0.1;
  gbc.weighty=0.1;
  inheritCheckbox=new JCheckBox("Inherit");
  inheritCheckbox.setToolTipText("Select if color is undefined and will be derived from default or other condition.");
  inheritCheckbox.setSelected(false);
  inheritCheckbox.setMnemonic(KeyEvent.VK_I);
  inheritCheckbox.setVerticalAlignment(SwingConstants.TOP);
  inheritCheckbox.setHorizontalAlignment(SwingConstants.LEFT);
  inheritCheckbox.addActionListener(new InheritListener());
  add(inheritCheckbox,gbc);
  gbc.gridx=0;
  gbc.gridy=1;
  gbc.weightx=1.0;
  gbc.weighty=1.0;
  colorChooser=new JColorChooser();
  colorChooser.setPreviewPanel(emptyPreview);
  add(colorChooser,gbc);
}
 

Example 50

From project Pipeline, under directory /src/gui/figure/series/.

Source file: UnifiedConfigFrame.java

  20 
vote

public AutoFieldPanel(String label,double initVal){
  setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  JLabel lab=new JLabel(label);
  field=new JTextField("" + initVal);
  field.setEnabled(false);
  field.setPreferredSize(fieldSize);
  field.setMaximumSize(fieldSize);
  field.setMinimumSize(fieldSize);
  checkBox=new JCheckBox("Auto",true);
  checkBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent arg0){
      if (checkBox.isSelected())       field.setEnabled(false);
 else       field.setEnabled(true);
      repaint();
    }
  }
);
  this.add(lab);
  this.add(field);
  this.add(checkBox);
  this.setAlignmentX(RIGHT_ALIGNMENT);
}
 

Example 51

From project ps3mediaserver, under directory /src/main/java/net/pms/encoders/.

Source file: TSMuxerVideo.java

  20 
vote

@Override public JComponent config(){
  Locale locale=new Locale(configuration.getLanguage());
  ComponentOrientation orientation=ComponentOrientation.getOrientation(locale);
  String colSpec=FormLayoutUtil.getColSpec(COL_SPEC,orientation);
  FormLayout layout=new FormLayout(colSpec,ROW_SPEC);
  PanelBuilder builder=new PanelBuilder(layout);
  builder.setBorder(Borders.EMPTY_BORDER);
  builder.setOpaque(false);
  CellConstraints cc=new CellConstraints();
  JComponent cmp=builder.addSeparator(Messages.getString("TSMuxerVideo.3"),FormLayoutUtil.flip(cc.xyw(2,1,1),colSpec,orientation));
  cmp=(JComponent)cmp.getComponent(0);
  cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));
  tsmuxerforcefps=new JCheckBox(Messages.getString("TSMuxerVideo.2"));
  tsmuxerforcefps.setContentAreaFilled(false);
  if (configuration.isTsmuxerForceFps()) {
    tsmuxerforcefps.setSelected(true);
  }
  tsmuxerforcefps.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      configuration.setTsmuxerForceFps(e.getStateChange() == ItemEvent.SELECTED);
    }
  }
);
  builder.add(tsmuxerforcefps,FormLayoutUtil.flip(cc.xy(2,3),colSpec,orientation));
  muxallaudiotracks=new JCheckBox(Messages.getString("TSMuxerVideo.19"));
  muxallaudiotracks.setContentAreaFilled(false);
  if (configuration.isMuxAllAudioTracks()) {
    muxallaudiotracks.setSelected(true);
  }
  muxallaudiotracks.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      configuration.setMuxAllAudioTracks(e.getStateChange() == ItemEvent.SELECTED);
    }
  }
);
  builder.add(muxallaudiotracks,FormLayoutUtil.flip(cc.xy(2,5),colSpec,orientation));
  JPanel panel=builder.getPanel();
  panel.applyComponentOrientation(orientation);
  return panel;
}
 

Example 52

From project Supersonic, under directory /src/main/java/be/hehehe/supersonic/panels/.

Source file: KeyBindingPanel.java

  20 
vote

@PostConstruct public void init(){
  setLayout(new MigLayout("insets 0","[grow]","[][]"));
  JPanel bindings=new JPanel();
  bindings.setLayout(new MigLayout("","[][grow]","[][][][]"));
  bindings.setBorder(BorderFactory.createTitledBorder("Key Bindings"));
  add(bindings,"cell 0 0,growx");
  play=new BindingComponent(Type.PLAY);
  pause=new BindingComponent(Type.PAUSE);
  stop=new BindingComponent(Type.STOP);
  next=new BindingComponent(Type.FINISHED);
  components=new BindingComponent[]{play,pause,stop,next};
  bindings.add(new JLabel("Play"),"cell 0 0");
  bindings.add(new JLabel("Pause / unpause"),"cell 0 1");
  bindings.add(new JLabel("Stop"),"cell 0 2");
  bindings.add(new JLabel("Next song"),"cell 0 3");
  bindings.add(play,"cell 1 0,grow");
  bindings.add(pause,"cell 1 1,grow");
  bindings.add(stop,"cell 1 2,grow");
  bindings.add(next,"cell 1 3,grow");
  mediaKeys=new JCheckBox("Bind media keys");
  JPanel mediaKeysPanel=new JPanel();
  mediaKeysPanel.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
  mediaKeysPanel.setBorder(BorderFactory.createTitledBorder("Media Keys"));
  mediaKeysPanel.add(mediaKeys);
  add(mediaKeysPanel,"cell 0 1,growx");
}
 

Example 53

From project TraVis, under directory /src/travis/view/project/tree/.

Source file: CheckBoxTreeCellRenderer.java

  20 
vote

/** 
 * Create a per-tree instance of the checkbox renderer.
 */
public CheckBoxTreeCellRenderer(final JTree tree){
  this.tree=tree;
  this.tree.addKeyListener(new KeyAdapter(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.getKeyCode() == KeyEvent.VK_SPACE) {
        int[] rows=tree.getSelectionRows();
        if (rows == null)         return;
        for (        int i : rows) {
          toggleChecked(i);
        }
      }
    }
  }
);
  this.renderer=tree.getCellRenderer();
  checkedPaths=new HashSet<TreePath>();
  checkBox=new JCheckBox();
  checkBox.setOpaque(false);
  checkBox.setSize(checkBox.getPreferredSize());
  listenerList=new EventListenerList();
}
 

Example 54

From project uniquery, under directory /src/org/uniquery/gui/query/.

Source file: ResultTableCellRenderer.java

  20 
vote

@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int col){
  ResultSetTableModel model=(ResultSetTableModel)table.getModel();
  JComponent comp;
  if (value instanceof Boolean) {
    comp=new JCheckBox();
    ((JCheckBox)comp).setSelected((Boolean)value);
    ((JCheckBox)comp).setBorderPainted(true);
    ((JCheckBox)comp).setHorizontalAlignment(JCheckBox.CENTER);
    setForeground(Color.LIGHT_GRAY);
  }
 else {
    comp=(JComponent)super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,col);
  }
  Border b;
  if (model.valueChangedAt(row,col)) {
    b=BorderFactory.createMatteBorder(2,2,2,2,Color.RED);
    setBackground(Color.WHITE);
  }
 else {
    b=BorderFactory.createMatteBorder(0,0,0,0,(Color)null);
    setBackground(null);
  }
  if (isSelected) {
    comp.setBackground(Color.LIGHT_GRAY);
  }
  comp.setBorder(b);
  return comp;
}
 

Example 55

From project UniversalMediaServer, under directory /src/main/java/net/pms/encoders/.

Source file: FFMpegAudio.java

  20 
vote

@Override public JComponent config(){
  FormLayout layout=new FormLayout("left:pref, 0:grow","p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, 0:grow");
  PanelBuilder builder=new PanelBuilder(layout);
  builder.setBorder(Borders.EMPTY_BORDER);
  builder.setOpaque(false);
  CellConstraints cc=new CellConstraints();
  JComponent cmp=builder.addSeparator(Messages.getString("NetworkTab.5"),cc.xyw(2,1,1));
  cmp=(JComponent)cmp.getComponent(0);
  cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));
  noresample=new JCheckBox(Messages.getString("TrTab2.22"));
  noresample.setContentAreaFilled(false);
  noresample.setSelected(configuration.isAudioResample());
  noresample.addItemListener(new ItemListener(){
    @Override public void itemStateChanged(    ItemEvent e){
      configuration.setAudioResample(e.getStateChange() == ItemEvent.SELECTED);
    }
  }
);
  builder.add(noresample,cc.xy(2,3));
  return builder.getPanel();
}
 

Example 56

From project codjo-segmentation, under directory /codjo-segmentation-gui/src/main/java/net/codjo/segmentation/gui/settings/.

Source file: ClassificationStructureGui.java

  19 
vote

public void addActionListener(JComponent component,ActionListener actionListener){
  mapComponentListener.put(component,actionListener);
  if (component instanceof JComboBox) {
    ((JComboBox)component).addActionListener(actionListener);
  }
  if (component instanceof JCheckBox) {
    ((JCheckBox)component).addActionListener(actionListener);
  }
}
 

Example 57

From project Euclidean-Pattern-Generator, under directory /src/com/hisschemoller/sequencer/view/components/.

Source file: Controls.java

  19 
vote

public Controls(EPGSwingEngine swingEngine){
  _playButton=(JToggleButton)swingEngine.find("PLAY_BUTTON");
  _playButton.addActionListener(this);
  _allNotesOffButton=(JButton)swingEngine.find("ALL_NOTES_OFF_BUTTON");
  _allNotesOffButton.addActionListener(this);
  _tempoSlider=(JSlider)swingEngine.find("TEMPO_SLIDER");
  _tempoSlider.addChangeListener(this);
  _tempoInput=(JFormattedTextField)swingEngine.find("TEMPO_INPUT");
  _tempoInput.setPreferredSize(new Dimension(60,_tempoInput.getPreferredSize().height));
  _tempoInput.addActionListener(this);
  _midiOutBox=(JComboBox)swingEngine.find("MIDI_OUT_BOX");
  _midiOutBox.addActionListener(this);
  _midiCheckBox=(JCheckBox)swingEngine.find("MIDI_CHECKBOX");
  _midiCheckBox.addActionListener(this);
  _oscTextField=(JTextField)swingEngine.find("OSC_TEXTFIELD");
  _oscTextField.addActionListener(this);
  _oscCheckBox=(JCheckBox)swingEngine.find("OSC_CHECKBOX");
  _oscCheckBox.addActionListener(this);
}
 

Example 58

From project extension_libero_manufacturing, under directory /extension/eevolution/libero/src/main/java/org/eevolution/form/.

Source file: VProductConfigurationBOM.java

  19 
vote

/** 
 * Is Selection Selected
 * @param source CheckBox or RadioButton
 * @return true if selected
 */
private boolean isSelectionSelected(Object source){
  boolean retValue=false;
  if (source instanceof JCheckBox)   retValue=((JCheckBox)source).isSelected();
 else   if (source instanceof JRadioButton)   retValue=((JRadioButton)source).isSelected();
 else   log.log(Level.SEVERE,"Not valid - " + source);
  return retValue;
}
 

Example 59

From project FScape, under directory /src/main/java/de/sciss/fscape/session/.

Source file: DocumentFrame.java

  19 
vote

private void setCheckBoxQuiet(JCheckBox cb,boolean selected){
  final ActionListener[] al=cb.getActionListeners();
  for (int i=0; i < al.length; i++) {
    cb.removeActionListener(al[i]);
  }
  try {
    cb.setSelected(selected);
  }
  finally {
    for (int i=0; i < al.length; i++) {
      cb.addActionListener(al[i]);
    }
  }
}
 

Example 60

From project medsavant, under directory /medsavant/MedSavantClient/src/org/ut/biolab/medsavant/variant/.

Source file: UpdateWorker.java

  19 
vote

protected UpdateWorker(String activity,WizardDialog wizard,JLabel progressLabel,JProgressBar progressBar,JButton workButton,JCheckBox autoPublishCheck,JLabel publishProgressLabel,JProgressBar publishProgressBar,JButton publishButton){
  super(activity,wizard,progressLabel,progressBar,workButton);
  this.autoPublishCheck=autoPublishCheck;
  this.publishProgressLabel=publishProgressLabel;
  this.publishProgressBar=publishProgressBar;
  this.publishButton=publishButton;
  this.publishText=publishButton.getText();
  wizard.getCurrentPage().fireButtonEvent(ButtonEvent.DISABLE_BUTTON,ButtonNames.BACK);
}