本文整理了Java中javax.swing.JComponent.isShowing()
方法的一些代码示例,展示了JComponent.isShowing()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.isShowing()
方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:isShowing
暂无
代码示例来源:origin: org.netbeans.api/org-openide-awt
protected void prepare() {
comp.addPropertyChangeListener(new VisL());
if (comp.isShowing()) {
addNotify();
} else {
updateState(null);
}
}
代码示例来源:origin: com.jidesoft/jide-oss
@SuppressWarnings({"SimplifiableIfStatement"})
private boolean checkIsShowing(JComponent c) {
if (this.checkIsShowing) {
return c.isShowing();
}
else {
return true;
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public boolean isShowing() {
if (tableUI) {
return true;
} else {
return super.isShowing();
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public boolean isShowing() {
if (tableUI) {
return true;
} else {
return super.isShowing();
}
}
代码示例来源:origin: JetBrains/jediterm
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
if (myHorizontalSizeReferent != null && myHorizontalSizeReferent.isShowing()) {
size.width = Math.max(size.width, myHorizontalSizeReferent.getPreferredSize().width);
}
if (myVerticalSizeReferent != null && myVerticalSizeReferent.isShowing()) {
size.height = Math.max(size.height, myVerticalSizeReferent.getPreferredSize().height);
}
return size;
}
代码示例来源:origin: protegeproject/protege
@Nonnull
public Optional<BreadcrumbTrailProvider> getActiveProvider() {
return registeredProviders.stream()
.filter(prov -> prov.asJComponent().isShowing())
.findFirst();
}
代码示例来源:origin: stackoverflow.com
public class MyShowingListener {
private JComponent component;
public MyShowingListener(JComponent jc) { component=jc; }
public void hierarchyChanged(HierarchyEvent e) {
if((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED)>0 && component.isShowing()) {
System.out.println("Showing");
}
}
}
JTable t = new JTable(...);
t.addHierarchyListener(new MyShowingListener(t));
代码示例来源:origin: JetBrains/jediterm
public static void requestFocus(@NotNull final JComponent c) {
if (c.isShowing()) {
c.requestFocus();
} else {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
c.requestFocus();
}
});
}
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
public void show( JComponent editor, Rectangle offsetRectangle )
{
_editor = editor;
if( _editor.isShowing() )
{
show( _editor, offsetRectangle.x, offsetRectangle.y - 25 );
}
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
public void show( JComponent editor, Rectangle offsetRectangle )
{
_editor = editor;
if( _editor.isShowing() )
{
show( _editor, offsetRectangle.x, offsetRectangle.y - 25 );
}
}
代码示例来源:origin: JetBrains/jediterm
void _addRequest(@NotNull Runnable request, long delayMillis) {
synchronized (LOCK) {
checkDisposed();
final Request requestToSchedule = new Request(request, delayMillis);
if (myActivationComponent == null || myActivationComponent.isShowing()) {
_add(requestToSchedule);
} else if (!myPendingRequests.contains(requestToSchedule)) {
myPendingRequests.add(requestToSchedule);
}
}
}
代码示例来源:origin: stackoverflow.com
@Override
public void hierarchyChanged(HierarchyEvent e)
{
JComponent component = (JComponent)e.getSource();
if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0
&& component.isShowing())
{
// start the Timer
}
}
代码示例来源:origin: JetBrains/jediterm
/**
* @param component to check whether it can be focused or not
* @return {@code true} if component is not {@code null} and can be focused
* @see Component#isRequestFocusAccepted(boolean, boolean, sun.awt.CausedFocusEvent.Cause)
*/
public static boolean isFocusable(JComponent component) {
return component != null && component.isFocusable() && component.isEnabled() && component.isShowing();
}
代码示例来源:origin: stackoverflow.com
@Override
public void hierarchyChanged(HierarchyEvent e)
{
JComponent component = (JComponent)e.getSource();
if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0
&& component.isShowing())
{
// add code here
}
}
代码示例来源:origin: stackoverflow.com
@Override
public void hierarchyChanged(HierarchyEvent e)
{
JComponent component = (JComponent)e.getSource();
if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0
&& component.isShowing())
{
// add your code here
}
}
代码示例来源:origin: org.gephi/ui-components
public void showTooltip(JComponent component) {
if (component == null || !component.isShowing()) {
return;
}
showTooltip(component, component.getLocationOnScreen());
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public void run() {
InplaceEditor ied = getInplaceEditor();
ied = PropUtils.findInnermostInplaceEditor(ied);
JComponent c = ied.getComponent();
if (c instanceof JComboBox && c.isShowing()) {
((JComboBox) c).showPopup();
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public void run() {
InplaceEditor ied = getInplaceEditor();
ied = PropUtils.findInnermostInplaceEditor(ied);
JComponent c = ied.getComponent();
if (c instanceof JComboBox && c.isShowing()) {
((JComboBox) c).showPopup();
}
}
});
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private void updateForBirdViewPoint (Point birdViewPoint) {
JComponent view = scene.getView ();
if (view.isShowing () && isShowing ()) {
Point viewOrigin = view.getLocationOnScreen ();
Point birdViewOrigin = getLocationOnScreen ();
Dimension size = getSize ();
updateForViewPoint (new Point (birdViewPoint.x + birdViewOrigin.x - viewOrigin.x, birdViewPoint.y + birdViewOrigin.y - viewOrigin.y));
} else
updateForViewPoint (null);
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private void updateForBirdViewPoint (Point birdViewPoint) {
JComponent view = scene.getView ();
if (view.isShowing () && isShowing ()) {
Point viewOrigin = view.getLocationOnScreen ();
Point birdViewOrigin = getLocationOnScreen ();
Dimension size = getSize ();
updateForViewPoint (new Point (birdViewPoint.x + birdViewOrigin.x - viewOrigin.x, birdViewPoint.y + birdViewOrigin.y - viewOrigin.y));
} else
updateForViewPoint (null);
}
内容来源于网络,如有侵权,请联系作者删除!