1 18 19 package de.gulden.framework.amoda.environment.gui.component; 20 21 import de.gulden.framework.amoda.environment.gui.GUIApplicationEnvironment; 22 import de.gulden.framework.amoda.model.interaction.*; 23 import javax.swing.*; 24 import java.util.Stack ; 25 26 32 public class GUIFrame extends GUIFrameAbstract implements ErrorMessagePerformer { 33 34 38 protected Stack statusStack; 39 40 private JSplitPane mainSplitPane; 41 42 private JScrollPane desktopScrollPane; 43 44 private JPanel editorPanel; 45 46 private JDesktopPane desktopPane; 47 48 private JLabel statusLabel; 49 50 private JPanel treePanel; 51 52 private JMenuBar menuBar; 53 54 private JSplitPane editorSplitPane; 55 56 private JPanel statusPanel; 57 58 private JPanel toolbarsPanel; 59 60 61 65 public GUIFrame(GUIApplicationEnvironment environment) { 66 super(environment); 67 statusStack=new Stack (); 68 initComponents(); 69 getJMenuBar().setFont(environment.getFont(GUIApplicationEnvironment.FONT_MENU)); 70 } 71 72 73 77 public JDesktopPane getDesktopPane() { 78 return desktopPane; 79 } 80 81 public JPanel getTreePanel() { 82 return treePanel; 83 } 84 85 public JPanel getEditorPanel() { 86 return editorPanel; 87 } 88 89 public void setStatus(String text) { 90 statusLabel.setText(text); 91 } 92 93 public void resetStatus() { 94 String text; 95 text=" "; 96 statusLabel.setText(text); 97 } 98 99 104 public void doErrorMessage(ErrorMessage errorMessage) { 105 errorDialog.doErrorMessage(errorMessage); 106 } 107 108 private void initComponents() { 109 statusPanel = new javax.swing.JPanel (); 111 statusLabel = new javax.swing.JLabel (); 112 toolbarsPanel = new javax.swing.JPanel (); 113 mainSplitPane = new javax.swing.JSplitPane (); 114 treePanel = new javax.swing.JPanel (); 115 editorSplitPane = new javax.swing.JSplitPane (); 116 desktopScrollPane = new javax.swing.JScrollPane (); 117 desktopPane = new javax.swing.JDesktopPane (); 118 editorPanel = new javax.swing.JPanel (); 119 menuBar = new javax.swing.JMenuBar (); 120 121 setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); 122 addWindowListener(new java.awt.event.WindowAdapter () { 123 public void windowClosing(java.awt.event.WindowEvent evt) { 124 exitForm(evt); 125 } 126 }); 127 128 statusPanel.setLayout(new java.awt.BorderLayout ()); 129 130 statusPanel.setBorder(new javax.swing.border.EtchedBorder ()); 131 statusLabel.setFont(new java.awt.Font ("Dialog", 0, 12)); 132 statusLabel.setText("Initializing..."); 133 statusPanel.add(statusLabel, java.awt.BorderLayout.CENTER); 134 135 getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH); 136 137 getContentPane().add(toolbarsPanel, java.awt.BorderLayout.NORTH); 138 139 mainSplitPane.setDividerLocation(200); 140 mainSplitPane.setDividerSize(8); 141 mainSplitPane.setContinuousLayout(true); 142 mainSplitPane.setOneTouchExpandable(true); 143 treePanel.setLayout(new java.awt.BorderLayout ()); 144 145 mainSplitPane.setLeftComponent(treePanel); 146 147 editorSplitPane.setDividerLocation(800); 148 editorSplitPane.setDividerSize(8); 149 editorSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); 150 editorSplitPane.setContinuousLayout(true); 151 editorSplitPane.setOneTouchExpandable(true); 152 desktopScrollPane.setViewportView(desktopPane); 153 154 editorSplitPane.setLeftComponent(desktopScrollPane); 155 156 editorSplitPane.setRightComponent(editorPanel); 157 158 mainSplitPane.setRightComponent(editorSplitPane); 159 160 getContentPane().add(mainSplitPane, java.awt.BorderLayout.CENTER); 161 162 setJMenuBar(menuBar); 163 164 pack(); 165 } 166 167 private void exitForm(java.awt.event.WindowEvent evt) { 168 environment.getExitCommand().perform(); 170 } 171 172 } | Popular Tags |