Changeset 7 for trunk/src/org/expeditee/gui/Browser.java
- Timestamp:
- 05/01/08 12:26:53 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r4 r7 37 37 // private static final JScrollPane scrollPane = new JScrollPane(); 38 38 39 public static Browser _theBrowser; 40 39 41 /** 40 42 * Constructs a new Browser object, then launches it … … 43 45 */ 44 46 public static void main(String[] args) { 45 Browser b= new Browser();47 _theBrowser = new Browser(); 46 48 // Why do we want to ignore repaint? 47 49 // b.setIgnoreRepaint(true); 48 b.requestFocus();50 _theBrowser.requestFocus(); 49 51 // FrameGraphics.ForceRepaint(); 50 52 } 51 53 52 54 public void setSizes(Dimension size) { 53 55 setSize(size); … … 63 65 .getHeight() / 2))); 64 66 65 FrameGraphics.setMaxSize( size);67 FrameGraphics.setMaxSize(this.getContentPane().getSize()); 66 68 } 67 69 … … 75 77 Frame profile = FrameIO.LoadProfile(UserSettings.Username); 76 78 if (profile == null) { 79 try{ 77 80 profile = FrameIO.CreateNewProfile(UserSettings.Username); 81 }catch(Exception e){ 82 //TODO fix this later 83 } 78 84 } 79 85 FrameUtils.ParseProfile(profile); … … 110 116 setVisible(true); 111 117 112 g = (Graphics2D) getGraphics(); 118 setupGraphics(); 119 120 // required to accept TAB key 121 setFocusTraversalKeysEnabled(false); 122 123 assert (UserSettings.FirstFrame != null); 124 Frame firstFrame = FrameIO.LoadFrame(UserSettings.FirstFrame); 125 126 DisplayIO.setCurrentFrame(firstFrame); 127 128 // Create the action handler for the 129 FrameMouseActions mouse = new FrameMouseActions(); 130 131 this.getContentPane().addMouseListener(mouse); 132 this.getContentPane().addMouseMotionListener(mouse); 133 this.addKeyListener(new FrameKeyboardActions()); 134 this.getContentPane().addMouseWheelListener(mouse); 135 } 136 137 private void setupGraphics() { 138 g = (Graphics2D) this.getContentPane().getGraphics(); 113 139 assert g != null; 114 140 g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, 115 141 RenderingHints.VALUE_TEXT_ANTIALIAS_ON); 116 142 g.setFont(g.getFont().deriveFont(40f)); 117 118 FrameGraphics.setDisplayGraphics((Graphics2D) getGraphics()); 119 120 // required to accept TAB key 121 setFocusTraversalKeysEnabled(false); 122 123 assert (UserSettings.FirstFrame != null); 124 Frame firstFrame = FrameIO.LoadFrame(UserSettings.FirstFrame); 125 126 DisplayIO.setCurrentFrame(firstFrame); 127 128 // Create the action handler for the 129 FrameMouseActions mouse = new FrameMouseActions(); 130 131 this.addMouseListener(mouse); 132 this.addMouseMotionListener(mouse); 133 this.addKeyListener(new FrameKeyboardActions()); 134 this.addMouseWheelListener(mouse); 135 136 // Rob: Why is all this being done???? 137 g.dispose(); 138 g = null; 143 FrameGraphics.setDisplayGraphics(g); 139 144 } 140 145 … … 158 163 */ 159 164 public void componentResized(ComponentEvent e) { 160 FrameGraphics.setMaxSize(this.getSize());161 // FrameGraphics.Repaint();165 setSizes(this.getSize()); 166 setupGraphics(); 162 167 repaint(); 163 168 //System.out.println("Resize"); … … 181 186 */ 182 187 public void componentHidden(ComponentEvent e) { 183 }184 185 public int getTitleBarHeight() {186 Rectangle contentbounds = getContentPane().getBounds();187 contentbounds = this.getGlassPane().getBounds();188 // contentbounds = this.getRootPane().getBounds();189 int titleheight = getSize().height - contentbounds.height;190 191 return titleheight;192 188 } 193 189
Note:
See TracChangeset
for help on using the changeset viewer.