當前位置: 首頁>>代碼示例>>Java>>正文


Java JViewport.getView方法代碼示例

本文整理匯總了Java中javax.swing.JViewport.getView方法的典型用法代碼示例。如果您正苦於以下問題:Java JViewport.getView方法的具體用法?Java JViewport.getView怎麽用?Java JViewport.getView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JViewport的用法示例。


在下文中一共展示了JViewport.getView方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Limpar_Campos_Tela

import javax.swing.JViewport; //導入方法依賴的package包/類
public static void Limpar_Campos_Tela(JPanel tela) {
    for (Component componente : tela.getComponents()) {
        if (componente instanceof JPanel) {
            Limpar_Campos_Tela((JPanel) componente);
        }
        if (componente instanceof JTextField) {
            ((JTextField) componente).setText("");
        }
        if (componente instanceof JFormattedTextField) {
            ((JFormattedTextField) componente).setText("");
        }
        if(componente instanceof JScrollPane){
            JViewport viewport = ((JScrollPane)componente).getViewport(); 
            JTable table = (JTable)viewport.getView();
            
            DefaultTableModel model = (DefaultTableModel) table.getModel();
            model.getDataVector().removeAllElements();
            model.fireTableDataChanged();
        }
    }
}
 
開發者ID:iuryamicussi,項目名稱:TrabalhoCrisParte2,代碼行數:22,代碼來源:Generica.java

示例2: configureEnclosingScrollPane

import javax.swing.JViewport; //導入方法依賴的package包/類
/** Overridden - JTable's implementation of the method will
 *  actually attach (and leave behind) a gratuitous border
 *  on the enclosing scroll pane. */
protected final void configureEnclosingScrollPane() {
    Container p = getParent();

    if (p instanceof JViewport) {
        Container gp = p.getParent();

        if (gp instanceof JScrollPane) {
            JScrollPane scrollPane = (JScrollPane) gp;
            JViewport viewport = scrollPane.getViewport();

            if ((viewport == null) || (viewport.getView() != this)) {
                return;
            }

            scrollPane.setColumnHeaderView(getTableHeader());
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:BaseTable.java

示例3: updateColumnSelectionMouseListener

import javax.swing.JViewport; //導入方法依賴的package包/類
/**
 * This method update mouse listener on the scrollPane if it is needed.
 * It also recomputes the model of searchCombo. Both actions are needed after
 * the set of visible columns is changed.
 */
void updateColumnSelectionMouseListener() {
    Container p = getParent();
    if (p instanceof JViewport) {
        Container gp = p.getParent();
        if (gp instanceof JScrollPane) {
            JScrollPane scrollPane = (JScrollPane)gp;
            // Make certain we are the viewPort's view and not, for
            // example, the rowHeaderView of the scrollPane -
            // an implementor of fixed columns might do this.
            JViewport viewport = scrollPane.getViewport();
            if (viewport == null || viewport.getView() != this) {
                return;
            }
            scrollPane.removeMouseListener(columnSelectionMouseListener);
            if (getColumnModel().getColumnCount() == 0) {
                scrollPane.addMouseListener(columnSelectionMouseListener);
            }
        }
    }
    if (searchCombo != null) {
        searchCombo.setModel(getSearchComboModel());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:ETable.java

示例4: unconfigureEnclosingScrollPane

import javax.swing.JViewport; //導入方法依賴的package包/類
@Override
protected void unconfigureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(null);
			scrollPane.setRowHeaderView(null);

			viewport.removeChangeListener(scrollListener);
			rowHeader.uninstall();
		}
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:23,代碼來源:ExactTable.java

示例5: unconfigureEnclosingScrollPane

import javax.swing.JViewport; //導入方法依賴的package包/類
@Override
protected void unconfigureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(null);
			scrollPane.setRowHeaderView(null);

			viewport.removeChangeListener(scrollListener);
			rowHeader.uninstall();
		}
	}

}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:24,代碼來源:ExactTable.java

示例6: restoreScrollPosition

import javax.swing.JViewport; //導入方法依賴的package包/類
/**
 * Restore stored scroll position.
 */
private void restoreScrollPosition(boolean delayScrollWithMarkingDirtyRegion) {
    if (visibleTreePosition != null) {
        JTree tree = getJTree();
        if (tree != null) {
            int row = tree.getRowForPath(visibleTreePosition.getPath());
            if (row != -1) {
                Rectangle bounds = tree.getRowBounds(row);
                if (bounds != null) {
                    int scrollY = bounds.y - visibleTreePosition.getOffset();
                    JViewport viewport = mainScrollPane.getViewport();
                    Rectangle rect = viewport.getViewRect();
                    rect.y = scrollY;
                    if (!rect.isEmpty()) {
                        JComponent view = (JComponent) viewport.getView();
                        if (delayScrollWithMarkingDirtyRegion) {
                            RepaintManager.currentManager(viewport).addDirtyRegion(
                                    view,
                                    rect.x, rect.x, rect.width, rect.height);
                        }
                        ignoreScrollAdjustment = true;
                        try {
                            view.scrollRectToVisible(
                                    rect);
                        } finally {
                            ignoreScrollAdjustment = false;
                        }
                    }
                }
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:36,代碼來源:DebuggingViewComponent.java

示例7: configureEnclosingScrollPane

import javax.swing.JViewport; //導入方法依賴的package包/類
/**
 * duplicated to avoid repeating the same checks multiple times
 */
@Override
protected void configureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(getTableHeader());
			Border border = scrollPane.getBorder();
			if (border == null || border instanceof UIResource) {
				scrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder"));
			}
			//rowHeader=new RowHeader(dataModel);
			rowHeader.setRowHeight(CommonConstants.ROW_HEIGHT);
			rowHeader.install(this, scrollPane);
			installLabels(scrollPane);
			installSelectAllButton(scrollPane);
			viewport.addChangeListener(scrollListener);
		}
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:32,代碼來源:ExactTable.java

示例8: configureEnclosingScrollPane

import javax.swing.JViewport; //導入方法依賴的package包/類
/**
 * duplicated to avoid repeating the same checks multiple times
 */
@Override
protected void configureEnclosingScrollPane() {
	Container p = getParent();
	if (p instanceof JViewport) {
		Container gp = p.getParent();
		if (gp instanceof JScrollPane) {
			JScrollPane scrollPane = (JScrollPane) gp;
			// Make certain we are the viewPort's view and not, for
			// example, the rowHeaderView of the scrollPane -
			// an implementor of fixed columns might do this.
			JViewport viewport = scrollPane.getViewport();
			if (viewport == null || viewport.getView() != this) {
				return;
			}
			scrollPane.setColumnHeaderView(getTableHeader());
			Border border = scrollPane.getBorder();
			if (border == null || border instanceof UIResource) {
				scrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder"));
			}
			//rowHeader=new RowHeader(dataModel);
			rowHeader.install(this, scrollPane);
			installLabels(scrollPane);
			installSelectAllButton(scrollPane);
			viewport.addChangeListener(scrollListener);
		}
	}
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:31,代碼來源:ExactTable.java

示例9: tabPaneStateChanged

import javax.swing.JViewport; //導入方法依賴的package包/類
private void tabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabPaneStateChanged

        JScrollPane sPane = (JScrollPane) tabPane.getSelectedComponent();
        if (sPane != null) {

            JViewport view = (JViewport) sPane.getComponent(0);
            selectedTable = (JTable) view.getView();

            // re-apply the filter to the current tab
            if (selectedTable.getRowSorter() != null) {
                ((TableRowSorter) selectedTable.getRowSorter()).sort();
            }

            if (tabManagers != null) {

                // Remove all toggle button listeners
                for (ChangeListener l : autoScrollToggleButton.getChangeListeners()) {

                    autoScrollToggleButton.removeChangeListener(l);
                }

                LogTableManager manager = tabManagers.get(tabPane.getSelectedIndex());

                // Add current listener
                autoScrollToggleButton.addChangeListener(manager);

                // Refresh buttons
                autoScrollToggleButton.setSelected(manager.isAutoFollowScroll());
            }
        }
    }
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:32,代碼來源:LogTopComponent.java


注:本文中的javax.swing.JViewport.getView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。