本文整理了Java中java.awt.Window.setEnabled()
方法的一些代码示例,展示了Window.setEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setEnabled()
方法的具体详情如下:
包路径:java.awt.Window
类名称:Window
方法名:setEnabled
暂无
代码示例来源:origin: org.netbeans.api/org-openide-dialogs
parentWindow.setEnabled (true);
代码示例来源:origin: org.jodd/jodd-wot
@Override
public void dispose() {
owner.setEnabled(true);
owner.setFocusableWindowState(true);
super.dispose();
}
代码示例来源:origin: GoldenGnu/jeveassets
private void hide() {
parent.setEnabled(true);
jWindow.setVisible(false);
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
public void dispose()
{
if( _window != null )
{
_window.setEnabled( true );
}
setVisible( false );
super.dispose();
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public void setVisible(boolean visible) {
if (!visible) {
TransparencyManager<Window> transparencyManager = resourceManager.getTransparencyManager();
transparencyManager.setAlphaModeRatio(this, 0.0f);
restoreOwner();
} else {
if (!isVisible()) {
synchronized (JModalFrame.this) {
if ((modalToWindow != null) && notifiedModalToWindow) {
modalToWindow.setEnabled(false);
notifiedModalToWindow = false;
}
}
}
}
super.setVisible(visible);
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public void propertyChange(PropertyChangeEvent evt) {
Content content = (Content) evt.getSource();
if (content.isMinimized())
return;
if (content.isDetached()) {
Window anchestor = SwingUtilities.windowForComponent(content.getComponent());
anchestor.setEnabled((Boolean) evt.getNewValue());
} else {
int index = tabbedContentPane.indexOfContent(content);
if (index != -1)
tabbedContentPane.setEnabledAt(index, (Boolean) evt.getNewValue());
else if (isContentManagerEnabled() && toolWindowManager.getMainContent() != content.getComponent())
throw new IllegalStateException("Invalid content ui state.");
}
}
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public void propertyChange(PropertyChangeEvent evt) {
Content content = (Content) evt.getSource();
if (content.isMinimized())
return;
if (content.isDetached()) {
Window anchestor = SwingUtilities.windowForComponent(content.getComponent());
anchestor.setEnabled((Boolean) evt.getNewValue());
} else {
for (Component c : multiSplitContainer.getTabbedComponents()) {
if (c instanceof JTabbedContentPane) {
JTabbedContentPane tabbedContentPane = ((JTabbedContentPane) c);
int index = tabbedContentPane.indexOfContent(content);
if (index != -1) {
tabbedContentPane.setEnabledAt(index, (Boolean) evt.getNewValue());
return;
}
}
if (c == content.getComponent())
return;
}
throw new IllegalStateException("Invalid content ui state.");
}
}
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
protected void restoreOwner() {
synchronized (JModalWindow.this) {
if ((modalToWindow != null) && !notifiedModalToWindow) {
modalToWindow.setEnabled(true);
modalToWindow.toFront();
notifiedModalToWindow = true;
}
if (returnFocus != null) {
Window owner = SwingUtilities.windowForComponent(returnFocus);
boolean stillBusy;
stillBusy = !owner.isEnabled();
if (!stillBusy) {
returnFocus.requestFocusInWindow();
}
}
}
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
protected void restoreOwner() {
synchronized (JModalFrame.this) {
if ((modalToWindow != null) && !notifiedModalToWindow) {
modalToWindow.setEnabled(true);
modalToWindow.toFront();
notifiedModalToWindow = true;
}
if (returnFocus != null) {
Window owner = SwingUtilities.windowForComponent(returnFocus);
boolean stillBusy;
stillBusy = !owner.isEnabled();
if (!stillBusy) {
returnFocus.requestFocusInWindow();
}
}
}
}
代码示例来源:origin: GoldenGnu/jeveassets
public void show(final String text, final LockWorker lockWorker) {
jLabel.setText(text);
jWindow.pack();
//Get the parent size
Dimension parentSize = parent.getSize();
//Calculate the frame location
int x = (parentSize.width - jWindow.getWidth()) / 2;
int y = (parentSize.height - jWindow.getHeight()) / 2;
//Set the new frame location
jWindow.setLocation(x, y);
jWindow.setLocationRelativeTo(parent);
parent.setEnabled(false);
jProgress.setIndeterminate(false);
jProgress.setIndeterminate(true);
jWindow.setVisible(true); //Does not block!
Wait wait = new Wait(lockWorker);
wait.execute();
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
public void show()
{
pack();
/*
if( getWidth() < 400 )
{
setSize( 400, getHeight() );
}
*/
EditorUtilities.centerWindowInFrame( this, getOwner() );
super.show();
_window = EditorUtilities.getActiveWindow();
if( _window != null )
{
_window.setEnabled( false );
}
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public void setVisible(boolean visible) {
if (!visible) {
TransparencyManager<Window> transparencyManager = resourceManager.getTransparencyManager();
transparencyManager.setAlphaModeRatio(this, 0.0f);
restoreOwner();
} else {
if (!isVisible()) {
synchronized (JModalWindow.this) {
if ((modalToWindow != null) && notifiedModalToWindow) {
modalToWindow.setEnabled(false);
notifiedModalToWindow = false;
}
}
}
}
super.setVisible(visible);
}
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
/**
* Uninstalls the sheet on the owner.
* This method is invoked immediately after the JSheet is hidden.
*/
protected void uninstallSheet() {
if (isInstalled) {
Window owner = getOwner();
if (owner != null) {
// Note: We mustn't change the windows focusable state because
// this also affects the focusable state of the JSheet.
//owner.setFocusableWindowState(true);
owner.setEnabled(true);
//((JFrame) owner).setResizable(true);
owner.removeComponentListener(ownerMovementHandler);
if (shiftBackLocation != null) {
owner.setLocation(shiftBackLocation);
}
if (oldFocusOwner != null) {
owner.toFront();
oldFocusOwner.requestFocus();
}
}
isInstalled = false;
}
}
代码示例来源:origin: org.jodd/jodd-wot
@Override
public void setVisible(boolean visible) {
boolean blockParent = (visible && modal);
owner.setEnabled(!blockParent);
owner.setFocusableWindowState(!blockParent);
super.setVisible(visible);
owner.removeWindowListener(parentWindowListener);
owner.setEnabled(true);
owner.setFocusableWindowState(true);
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
owner.setEnabled(false);
内容来源于网络,如有侵权,请联系作者删除!