| 1 | |
package org.jtheque.core.managers.view; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.Managers; |
| 20 | |
import org.jtheque.core.managers.view.able.IConfigView; |
| 21 | |
import org.jtheque.core.managers.view.able.ILicenceView; |
| 22 | |
import org.jtheque.core.managers.view.able.IMainView; |
| 23 | |
import org.jtheque.core.managers.view.able.IMessageView; |
| 24 | |
import org.jtheque.core.managers.view.able.IViewManager; |
| 25 | |
import org.jtheque.core.managers.view.able.components.TabComponent; |
| 26 | |
import org.jtheque.core.managers.view.able.update.IModuleView; |
| 27 | |
|
| 28 | |
import javax.annotation.Resource; |
| 29 | |
import javax.swing.JComponent; |
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | 0 | public final class WindowManager implements Views { |
| 37 | |
@Resource |
| 38 | |
private ILicenceView licenceView; |
| 39 | |
|
| 40 | |
@Resource |
| 41 | |
private IConfigView configView; |
| 42 | |
|
| 43 | |
@Resource |
| 44 | |
private IModuleView moduleView; |
| 45 | |
|
| 46 | |
@Resource |
| 47 | |
private IMessageView messageView; |
| 48 | |
|
| 49 | |
@Override |
| 50 | |
public void setSelectedView(TabComponent component) { |
| 51 | 0 | getMainView().setSelectedComponent(component.getComponent()); |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
@Override |
| 55 | |
public TabComponent getSelectedView() { |
| 56 | 0 | TabComponent selected = null; |
| 57 | |
|
| 58 | 0 | JComponent component = getMainView().getSelectedComponent(); |
| 59 | |
|
| 60 | 0 | for (TabComponent tab : Managers.getManager(IViewManager.class).getTabComponents()) { |
| 61 | 0 | if (tab.getComponent().equals(component)) { |
| 62 | 0 | selected = tab; |
| 63 | 0 | break; |
| 64 | |
} |
| 65 | |
} |
| 66 | |
|
| 67 | 0 | return selected; |
| 68 | |
} |
| 69 | |
|
| 70 | |
@Override |
| 71 | |
public IMainView getMainView() { |
| 72 | 0 | return SplashManager.getInstance().getMainView(); |
| 73 | |
} |
| 74 | |
|
| 75 | |
@Override |
| 76 | |
public ILicenceView getLicenceView() { |
| 77 | 0 | return licenceView; |
| 78 | |
} |
| 79 | |
|
| 80 | |
@Override |
| 81 | |
public IConfigView getConfigView() { |
| 82 | 0 | return configView; |
| 83 | |
} |
| 84 | |
|
| 85 | |
@Override |
| 86 | |
public IModuleView getModuleView() { |
| 87 | 0 | return moduleView; |
| 88 | |
} |
| 89 | |
|
| 90 | |
@Override |
| 91 | |
public IMessageView getMessagesView() { |
| 92 | 0 | return messageView; |
| 93 | |
} |
| 94 | |
} |