Skip to content

Commit

Permalink
update EZUIStarterListener API with frameDisplayed method
Browse files Browse the repository at this point in the history
  • Loading branch information
pgdurand committed Dec 21, 2017
1 parent d13b8f9 commit 5c65ba5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/com/plealog/genericapp/api/EZUIStarterListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public interface EZUIStarterListener {
*/
public void postStart();

/**
* This method is called when the application frame has been displayed.
*/
public void frameDisplayed();

/**
* This method is called when application is going to install the user-defined
* component within the main frame.
Expand Down
4 changes: 4 additions & 0 deletions src/com/plealog/genericapp/api/test/EZUIStarterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,9 @@ public Component getApplicationComponent() {
public boolean isAboutToQuit() {
return true;
}

@Override
public void frameDisplayed() {
}
}
}
10 changes: 10 additions & 0 deletions src/com/plealog/genericapp/ui/starter/EZUIStarterImplem.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ public void run() {
EventQueue.invokeLater(runner);
}
}

private class UIStarterListenerDisplayedhandler extends Thread {
public void run() {
if(EZEnvironment.getUIStarterListener()!=null){
EZEnvironment.getUIStarterListener().frameDisplayed();
}
}
}

private void center(Window frame) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
Expand Down Expand Up @@ -154,6 +163,7 @@ public void componentMoved(ComponentEvent e) {
}
});
frame.setVisible(true);
EventQueue.invokeLater(new UIStarterListenerDisplayedhandler());
}
}
public void startApplication(String[] args){
Expand Down

0 comments on commit 5c65ba5

Please sign in to comment.