本文整理汇总了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();
}