本文整理匯總了Java中javax.swing.JComponent.isVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java JComponent.isVisible方法的具體用法?Java JComponent.isVisible怎麽用?Java JComponent.isVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.isVisible方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: uninstall
import javax.swing.JComponent; //導入方法依賴的package包/類
/** Removes popup component from textComponent root pane
* @param popup popup component to be removed from
* root pane of the text component.
*/
public void uninstall(JComponent popup) {
JComponent oldPopup = this.popup;
if (oldPopup != null) {
if (oldPopup.isVisible()) {
oldPopup.setVisible(false);
}
removeFromRootPane(oldPopup);
this.popup = null;
}
if (popup != null && popup != oldPopup) {
if (popup.isVisible()) {
popup.setVisible(false);
}
removeFromRootPane(popup);
}
}
示例2: preferredLayoutSize
import javax.swing.JComponent; //導入方法依賴的package包/類
public Dimension preferredLayoutSize(Container parent) {
JComponent filter = filterPanel;
if (filter != null && !filter.isVisible()) filter = null;
JComponent search = searchPanel;
if (search != null && !search.isVisible()) search = null;
Dimension dim = new Dimension();
if (filter != null && search != null) {
Dimension dim1 = filter.getPreferredSize();
Dimension dim2 = search.getPreferredSize();
dim.width = dim1.width + dim2.width + 1;
dim.height = Math.max(dim1.height, dim2.height);
} else if (filter != null) {
dim = filter.getPreferredSize();
} else if (search != null) {
dim = search.getPreferredSize();
}
if ((filter != null || search != null) && hasBottomFilterFindMargin())
dim.height += 1;
return dim;
}
示例3: minimumLayoutSize
import javax.swing.JComponent; //導入方法依賴的package包/類
public Dimension minimumLayoutSize(Container parent) {
JComponent filter = filterPanel;
if (filter != null && !filter.isVisible()) filter = null;
JComponent search = searchPanel;
if (search != null && !search.isVisible()) search = null;
Dimension dim = new Dimension();
if (filter != null && search != null) {
Dimension dim1 = filter.getMinimumSize();
Dimension dim2 = search.getMinimumSize();
dim.width = dim1.width + dim2.width + 1;
dim.height = Math.max(dim1.height, dim2.height);
} else if (filter != null) {
dim = filter.getMinimumSize();
} else if (search != null) {
dim = search.getMinimumSize();
}
if ((filter != null || search != null) && hasBottomFilterFindMargin())
dim.height += 1;
return dim;
}
示例4: getCurrentComponent
import javax.swing.JComponent; //導入方法依賴的package包/類
private JComponent getCurrentComponent() {
int n = getComponentCount();
for (int i = 0; i < n; i++) {
JComponent comp = (JComponent) getComponent(i);
if (comp.isVisible()) {
return comp;
}
}
return null;
}
示例5: isAvailable
import javax.swing.JComponent; //導入方法依賴的package包/類
private boolean isAvailable(JComponent c) {
return c.isVisible() && c.isEnabled();
}