Package javax.swing

Examples of javax.swing.JComponent$AccessibleJComponent$AccessibleFocusHandler


//        topPanel.add(datesBox, BorderLayout.CENTER);
        GPOptionGroup group = myIntervalsModel.getMaxIntervalLength()==1 ?
            new GPOptionGroup("", new GPOption[] {myStart}) :
            new GPOptionGroup("", new GPOption[] {myStart, myFinish});
        group.setTitled(false);
        JComponent datesBox = builder.buildPlanePage(new GPOptionGroup[] {group});
        topPanel.add(datesBox, BorderLayout.CENTER);
      //
        Box buttonBox = Box.createHorizontalBox();
        buttonBox.setBorder(BorderFactory.createEmptyBorder(3,0,3,0));
        buttonBox.add(new JButton(myAddAction));
View Full Code Here


        setResizable(false);
        panel = new GanttPanelDate(date);

        // Container contentPane = getContentPane();

        JComponent contentPane = Box.createVerticalBox();
        // contentPane.setLayout(new GridLayout(3,1, 5, 5));
        JPanel p = new JPanel();
        JButton ok = new JButton(language.getText("ok"));
        getRootPane().setDefaultButton(ok);
        p.add(ok);
        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                setVisible(false);
                value = OK;
            }
        });
        JButton cancel = new JButton(language.getText("cancel"));
        p.add(cancel);
        cancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                setVisible(false);
                panel.cancel();
            }
        });
        contentPane.add(panel);
        if (showFixedDateCheckBox) {
            final JCheckBox fixedDate = new JCheckBox(language
                    .getText("fixedDate"));
            fixedDate.setSelected(myFixedDate);
            fixedDate.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    myFixedDate = fixedDate.isSelected();
                }
            });
            contentPane.add(fixedDate);
        }
        contentPane.add(p);
        getContentPane().add(contentPane);

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent arg0) {
                panel.cancel();
View Full Code Here

    }
    private Component createDialogComponent() {
        OptionsPageBuilder builder = new OptionsPageBuilder();

        JPanel combinedPanel = new JPanel(new BorderLayout());
        JComponent comp = builder.buildPage(myGroups, "ganttChart");
        combinedPanel.add(comp, BorderLayout.CENTER);
        combinedPanel.setBorder(BorderFactory.createEmptyBorder(0,0,3,0));
        Component previewComponent = createPreviewComponent();
        if (previewComponent!=null) {
            JPanel previewPanel = new JPanel(new BorderLayout());
View Full Code Here

        result.setBorder(new EmptyBorder(0, 5, 0, 5));
        TopPanel topPanel = new TopPanel(myi18n.getPageTitle(pageID), myi18n
                .getPageDescription(pageID));
        topPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        result.add(topPanel, BorderLayout.NORTH);
        JComponent planePage = buildPlanePage(optionGroups);
        result.add(planePage, BorderLayout.CENTER);
        return result;
    }
View Full Code Here

        result.add(planePage, BorderLayout.CENTER);
        return result;
    }

    public JComponent buildPlanePage(GPOptionGroup[] optionGroups) {
        final JComponent optionsPanel = new JPanel(new SpringLayout());
        for (int i = 0; i < optionGroups.length; i++) {
            optionsPanel.add(createGroupComponent(optionGroups[i]));
        }
        SpringUtilities.makeCompactGrid(optionsPanel, optionGroups.length, 1,
                0, 0, 5, 5);
        JPanel resultPanel = new JPanel(new BorderLayout());
        resultPanel.add(optionsPanel, BorderLayout.NORTH);
        resultPanel.addFocusListener(new FocusAdapter() {
            public void focusGained(FocusEvent e) {
                optionsPanel.getComponent(0).requestFocus();
            }
           
        });
        return resultPanel;
    }
View Full Code Here

      public String getOptionLabel(GPOption option) {
        return getValue(option.getID());
      }
      };
      builder.setI18N(i18n);
      final JComponent mainPage = builder.buildPlanePage(new GPOptionGroup[] {myGroup});
      mainPage.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        tabbedPane = new JTabbedPane();
        tabbedPane.addTab(language.getText("general"), new ImageIcon(getClass()
                .getResource("/icons/properties_16.gif")), mainPage);
        tabbedPane.addTab(language.getText("daysOff"), new ImageIcon(getClass()
                .getResource("/icons/holidays_16.gif")),
                constructDaysOffPanel());
        //mainPage.requestDefaultFocus();
//        final FocusTraversalPolicy defaultPolicy = mainPage.getFocusTraversalPolicy();
//        FocusTraversalPolicy customPolicy = new FocusTraversalPolicy() {
//            public Component getComponentAfter(Container aContainer, Component aComponent) {
//                return defaultPolicy.getComponentAfter(aContainer, aComponent);
//            }
//
//            public Component getComponentBefore(Container aContainer, Component aComponent) {
//                return defaultPolicy.getComponentBefore(aContainer, aComponent);
//            }
//
//            public Component getFirstComponent(Container aContainer) {
//                return defaultPolicy.getFirstComponent(aContainer);
//            }
//
//            public Component getLastComponent(Container aContainer) {
//                return defaultPolicy.getLastComponent(aContainer);
//            }
//
//            public Component getDefaultComponent(Container aContainer) {
//                return mainPage;
//            }
//        };
//        //mainPage.setFocusCycleRoot(true);
//        mainPage.setFocusTraversalPolicy(customPolicy);
        tabbedPane.addFocusListener(new FocusAdapter() {
            boolean isFirstTime = true;
            public void focusGained(FocusEvent e) {
                if (isFirstTime) {
                    mainPage.requestFocus();
                    isFirstTime = false;
                }
                super.focusGained(e);
            }
           
View Full Code Here

            protected void onFileChosen(File file) {
              FileChooserPageBase.this.onFileChosen(file);
              super.onFileChosen(file);
            }
        };
        JComponent contentPanel = new JPanel(new BorderLayout());
        contentPanel.add(myChooser.getComponent(), BorderLayout.NORTH);
        contentPanel.add(mySecondaryOptionsComponent, BorderLayout.CENTER);
//        SpringUtilities.makeCompactGrid(contentPanel, 2, 1,
//                0, 0, 5, 5);
        myComponent.add(contentPanel, BorderLayout.NORTH);
        return myComponent;
    }
View Full Code Here

        this.toggle = toggle;
    }

    public void actionPerformed(ActionEvent evt) {
        if (evt.getSource() instanceof JComponent) {
            JComponent c = (JComponent) evt.getSource();
            // if (!popup.ignoreNextToggleAction) {
            if (!toggle.isSelected()) {
                popup.setVisible(false);
            } else {
                switch(edge) {
View Full Code Here

        final DefaultStringOption usernameOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.USERNAME_OPTION_ID);
        final DefaultStringOption servernameOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.SERVERNAME_OPTION_ID);
        final DefaultStringOption dirnameOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.DIRECTORYNAME_OPTION_ID);
        final DefaultStringOption passwordOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.PASSWORD_OPTION_ID);
        final JComponent optionsPane = builder.buildPage(project.getDocumentManager().getNetworkOptionGroups(), getPageID());
        final Action testConnectionAction = new AbstractAction() {
            {
                putValue(Action.NAME, GanttLanguage.getInstance().getText("testFTPConnection"));
                setEnabled(canEnableTestAction(ftpGroup));
            }
View Full Code Here

    this.tableModel = tableModel;
    this.tableSorter = tableSorter;
  }
 
  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row, int column) {
    JComponent renderer = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
   
    renderer.setOpaque(true);//!!!!
   
    //We don't want border in the cells
    renderer.setBorder(DEFAULT_BORDER);
   
    //Get the selected file
    File f = tableModel.getFileAt(tableSorter.modelIndex(row));
   
    //Null file ?? should not happen
    assert f != null;
 
    //A selected item
    if(isSelected) {
        if (table.hasFocus()) {
            renderer.setBackground(SELECTED);
        // If the current row is the lead selection of the table, add a border
        if (table.getSelectedRows().length > 1 &&
                row == table.getSelectionModel().getLeadSelectionIndex()) {
            renderer.setBorder(LEAD_SEL_BORDER);
        }
        }
        else
            renderer.setBackground(SELECTED_NOFOCUS);
    }
    //A directory
    else if( f.isDirectory() ) {
      //We have an unselected Directory
      //Default color for directories
      renderer.setBackground(DIRECTORIES);
      renderer.setForeground(Color.BLACK);
    }
    //A File
    else {
      if(f instanceof AudioFile) {
        //We have an audiofile
        Tag tag = ((AudioFile) f).getTag();
        if(PreferencesManager.getBoolean("tageditor.table.indexfiles"))
        {
          if (SqlProvider.FichierExist(f.getAbsolutePath()))
            renderer.setForeground(Color.GREEN);
          else
            renderer.setForeground(Color.RED);
        }
        if(!tag.isEmpty())
          renderer.setBackground(TAGGED);
        else
          renderer.setBackground(NO_TAG);
      } else {
        //A File that could not be read
        renderer.setBackground(READ_ERROR);
      }
    }
   
    return renderer;
  }
View Full Code Here

TOP

Related Classes of javax.swing.JComponent$AccessibleJComponent$AccessibleFocusHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.