[ 1707221 ] Windows are not showing when they are minimize
http://sourceforge.net/tracker/index.php?func=detail&aid=1707221&group_id=176962&atid=879332
This commit is contained in:
parent
9c866f255c
commit
2fa77ea831
|
@ -41,6 +41,21 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public final class AEnv
|
public final class AEnv
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Show window: de-iconify and bring it to front
|
||||||
|
* @author teo_sarca [ 1707221 ]
|
||||||
|
*/
|
||||||
|
public static void showWindow(Window window) {
|
||||||
|
window.setVisible(true);
|
||||||
|
if (window instanceof Frame) {
|
||||||
|
Frame f = (Frame)window;
|
||||||
|
int state = f.getExtendedState();
|
||||||
|
if ((state & Frame.ICONIFIED) > 0)
|
||||||
|
f.setExtendedState(state & ~Frame.ICONIFIED);
|
||||||
|
}
|
||||||
|
window.toFront();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show in the center of the screen.
|
* Show in the center of the screen.
|
||||||
* (pack, set location and set visibility)
|
* (pack, set location and set visibility)
|
||||||
|
@ -49,8 +64,7 @@ public final class AEnv
|
||||||
public static void showCenterScreen(Window window)
|
public static void showCenterScreen(Window window)
|
||||||
{
|
{
|
||||||
positionCenterScreen(window);
|
positionCenterScreen(window);
|
||||||
window.setVisible(true);
|
showWindow(window);
|
||||||
window.toFront();
|
|
||||||
} // showCenterScreen
|
} // showCenterScreen
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,8 +97,7 @@ public final class AEnv
|
||||||
public static void showScreen(Window window, int position)
|
public static void showScreen(Window window, int position)
|
||||||
{
|
{
|
||||||
positionScreen(window, position);
|
positionScreen(window, position);
|
||||||
window.setVisible(true);
|
showWindow(window);
|
||||||
window.toFront();
|
|
||||||
} // showScreen
|
} // showScreen
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,8 +177,7 @@ public final class AEnv
|
||||||
public static void showCenterWindow(Window parent, Window window)
|
public static void showCenterWindow(Window parent, Window window)
|
||||||
{
|
{
|
||||||
positionCenterWindow(parent, window);
|
positionCenterWindow(parent, window);
|
||||||
window.setVisible(true);
|
showWindow(window);
|
||||||
window.toFront();
|
|
||||||
} // showCenterWindow
|
} // showCenterWindow
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -382,7 +394,7 @@ public final class AEnv
|
||||||
}
|
}
|
||||||
else if (actionCommand.equals("Home"))
|
else if (actionCommand.equals("Home"))
|
||||||
{
|
{
|
||||||
Env.getWindow(0).toFront();
|
showWindow(Env.getWindow(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tools Menu ------------------------
|
// Tools Menu ------------------------
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class WindowMenu extends JMenu {
|
||||||
menu.addActionListener(new ActionListener() {
|
menu.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent ae) {
|
public void actionPerformed(ActionEvent ae) {
|
||||||
CFrame frame = ((ChildMenuItem)ae.getSource()).getWindow();
|
CFrame frame = ((ChildMenuItem)ae.getSource()).getWindow();
|
||||||
frame.toFront();
|
AEnv.showWindow(frame);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//menu.setIcon(array[i].getIconImage());
|
//menu.setIcon(array[i].getIconImage());
|
||||||
|
|
|
@ -1474,6 +1474,11 @@ public final class Env
|
||||||
s_hiddenWindows.remove(i);
|
s_hiddenWindows.remove(i);
|
||||||
s_log.info(hidden.toString());
|
s_log.info(hidden.toString());
|
||||||
hidden.setVisible(true);
|
hidden.setVisible(true);
|
||||||
|
// De-iconify window - teo_sarca [ 1707221 ]
|
||||||
|
int state = hidden.getExtendedState();
|
||||||
|
if ((state & CFrame.ICONIFIED) > 0)
|
||||||
|
hidden.setExtendedState(state & ~CFrame.ICONIFIED);
|
||||||
|
//
|
||||||
hidden.toFront();
|
hidden.toFront();
|
||||||
return hidden;
|
return hidden;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue