Package javax.swing

Examples of javax.swing.DefaultListSelectionModel$Segment


         
          String selectionAbove = (String) attributeNames.get(selection+1);
          attributeNames.set(selection+1, (String)attributeNames.get(selection));
          attributeNames.set(selection, selectionAbove);
          this.fireTableDataChanged();
          DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
          selectionModel.setSelectionInterval(selection+1, selection+1);
          orderTable.setSelectionModel(selectionModel);  
         
         
          if (listener != null)
            listener.handleNewAttributeOrder(attributeNames);
View Full Code Here


     * contain the first path currently selected.
     */
    protected void insureRowContinuity() {
        if(selectionMode == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION &&
           selection != null && rowMapper != null) {
            DefaultListSelectionModel lModel = listSelectionModel;
            int                       min = lModel.getMinSelectionIndex();

            if(min != -1) {
                for(int counter = min,
                        maxCounter = lModel.getMaxSelectionIndex();
                        counter <= maxCounter; counter++) {
                    if(!lModel.isSelectedIndex(counter)) {
                        if(counter == min) {
                            clearSelection();
                        }
                        else {
                            TreePath[] newSel = new TreePath[counter - min];
View Full Code Here

           selection == null || selectionMode ==
           TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION)
            return true;
        else {
            BitSet                       bitSet = new BitSet();
            DefaultListSelectionModel    lModel = listSelectionModel;
            int                          anIndex;
            int                          counter;
            int                          min = lModel.getMinSelectionIndex();
            int                          max = lModel.getMaxSelectionIndex();
            TreePath[]                   tempPath = new TreePath[1];

            if(min != -1) {
                for(counter = min; counter <= max; counter++) {
                    if(lModel.isSelectedIndex(counter))
                        bitSet.set(counter);
                }
            }
            else {
                tempPath[0] = paths[0];
View Full Code Here

   * .ListSelectionEvent)
   */
  @Override
  public void valueChanged( ListSelectionEvent lse )
  {
    DefaultListSelectionModel dlsm = ( ( DefaultListSelectionModel )lse.getSource() );
    if( securityScan instanceof BoundarySecurityScan )
    {
      ( ( BoundarySecurityScan )securityScan ).refreshRestrictionLabel( dlsm.getAnchorSelectionIndex() );
    }
    if( securityScan instanceof InvalidTypesSecurityScan )
    {
      ( ( InvalidTypesSecurityScan )securityScan ).refreshRestrictionLabel( dlsm.getAnchorSelectionIndex() );
    }
  }
View Full Code Here

    /**
     * Creates a new instance of DefaultTreeSelectionModel that is
     * empty, with a selection mode of DISCONTIGUOUS_TREE_SELECTION.
     */
    public DefaultTreeSelectionModel() {
  listSelectionModel = new DefaultListSelectionModel();
  selectionMode = DISCONTIGUOUS_TREE_SELECTION;
  leadIndex = leadRow = -1;
  uniquePaths = new Hashtable();
  lastPaths = new Hashtable();
  tempPaths = new TreePath[1];
View Full Code Here

     * contain the first path currently selected.
     */
    protected void insureRowContinuity() {
  if(selectionMode == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION &&
     selection != null && rowMapper != null) {
      DefaultListSelectionModel lModel = listSelectionModel;
      int                       min = lModel.getMinSelectionIndex();

      if(min != -1) {
    for(int counter = min,
      maxCounter = lModel.getMaxSelectionIndex();
            counter <= maxCounter; counter++) {
        if(!lModel.isSelectedIndex(counter)) {
      if(counter == min) {
          clearSelection();
      }
      else {
          TreePath[] newSel = new TreePath[counter - min];
View Full Code Here

     selection == null || selectionMode ==
     TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION)
      return true;
  else {
      BitSet                       bitSet = new BitSet();
      DefaultListSelectionModel    lModel = listSelectionModel;
      int                          anIndex;
      int                          counter;
      int                          min = lModel.getMinSelectionIndex();
      int                           max = lModel.getMaxSelectionIndex();
      TreePath[]                   tempPath = new TreePath[1];

      if(min != -1) {
    for(counter = min; counter <= max; counter++) {
        if(lModel.isSelectedIndex(counter))
      bitSet.set(counter);
    }
      }
      else {
    tempPath[0] = paths[0];
View Full Code Here

    return new ProgramRangeSelectionPanel(program, additonalProgramCount);
  }
 
  private ProgramRangeSelectionPanel(Program p, short additionalProgramCount) {
    setLayout(new FormLayout("default:grow","fill:default:grow"));
    DefaultListSelectionModel m = new DefaultListSelectionModel() {
      public void setSelectionInterval(int index0, int index1) {
        super.clearSelection();
        super.setSelectionInterval(0,index1);
      }
     
View Full Code Here

            // Add the table infos to the JTable of available tables.
            model.addRow(row);
        }
        // Select the first available table in the JTable.
        getJMainTable().getSelectedRow();
        final DefaultListSelectionModel selection = new DefaultListSelectionModel();
        selection.setSelectionInterval(0, 0);
       
        if ((model.getRowCount() > 0) && (getJMainTable().getSelectedRow() == -1))
        {
            getJMainTable().setSelectionModel(selection);
            allowJoinOrLeave();
View Full Code Here

            }
        }
        if (e.getSource() == table.getColumnModel().getSelectionModel())
            return;
        if (!ignoreRowChange) {
            DefaultListSelectionModel selectionModel = (DefaultListSelectionModel)e.getSource();
            if (!selectionModel.isSelectionEmpty() && selectionModel.getMinSelectionIndex() != -1) {
                //int rowEntry = selectionModel.getMinSelectionIndex();
                int rowEntry = e.getLastIndex();
                //int rowExit = e.getLastIndex();
                int rowExit = this.lastRow;
                if (rowExit == rowEntry)
View Full Code Here

TOP

Related Classes of javax.swing.DefaultListSelectionModel$Segment

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.