Changeset 669
- Timestamp:
- 01/08/14 15:15:33 (10 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Navigation.java
r655 r669 77 77 public static void Goto(String frameName) { 78 78 FrameUtils.DisplayFrame(frameName); 79 } 80 81 /** 82 * Goto a frame without adding it to history 83 */ 84 public static void GotoQuiet(String frameName) { 85 FrameUtils.DisplayFrame(frameName, false, true); 79 86 } 80 87 -
trunk/src/org/expeditee/gui/FrameCreator.java
r655 r669 7 7 import org.expeditee.items.Text; 8 8 9 /**10 * TODO: merge with @see org.expeditee.settings.Settings.generateSettingsTree11 */12 9 public class FrameCreator { 13 10 public static final int INDENT_FROM_TITLE = 20; 11 12 // offset between items 13 private int y_offset = 2; 14 14 15 15 private int START_Y; … … 209 209 save(); 210 210 211 _lastY = toAdd.getY() + toAdd.getBoundsHeight() ;211 _lastY = toAdd.getY() + toAdd.getBoundsHeight() + y_offset; 212 212 _maxX = Math.max(toAdd.getX() + toAdd.getBoundsWidth(), _maxX); 213 213 … … 233 233 public void save() { 234 234 FrameIO.ForceSaveFrame(_current); 235 } 236 237 public int getLastY() { 238 return _lastY; 239 } 240 241 public void setLastY(int lastY) { 242 _lastY = lastY; 243 } 244 245 public Frame getCurrentFrame() { 246 return _current; 235 247 } 236 248 … … 267 279 Item previousButton = template.copy(); 268 280 previousButton.setID(current.getNextItemID()); 269 previousButton.setLink(link); 281 // don't store button navigation in history, 282 // since it's annoying to have to click back through all of it to get back to the profile frame 283 previousButton.setAction("gotoQuiet " + link); 270 284 current.addItem(previousButton); 271 285 -
trunk/src/org/expeditee/gui/FrameGraphics.java
r664 r669 39 39 40 40 // the maximum size that can be used to paint on 41 private static Dimension _MaxSize = new Dimension( 1000, 1000);41 private static Dimension _MaxSize = new Dimension(UserSettings.InitialWidth.get(), UserSettings.InitialHeight.get() - MessageBay.MESSAGE_BUFFER_HEIGHT); 42 42 43 43 // Final passes to renderering the current frame -
trunk/src/org/expeditee/items/Text.java
r663 r669 1392 1392 // makes items copy really slowly when there are lots of lines of text! 1393 1393 // This needs to be fixed!! 1394 p rivatevoid rebuild(boolean limitWidth) {1394 public void rebuild(boolean limitWidth) { 1395 1395 rebuild(limitWidth, true); 1396 1396 } -
trunk/src/org/expeditee/settings/Settings.java
r666 r669 10 10 import org.expeditee.gui.DisplayIO; 11 11 import org.expeditee.gui.Frame; 12 import org.expeditee.gui.FrameCreator; 12 13 import org.expeditee.gui.FrameIO; 13 14 import org.expeditee.gui.FrameUtils; … … 156 157 * 157 158 * Generates settings tree 158 * TODO: merge with @see FrameCreator159 159 * 160 160 */ 161 161 private static void generateSettingsTree(String page, Text text) { 162 Frame frame = FrameIO.CreateFrame(text.getParentOrCurrentFrame().getFramesetName(), page, null); 163 text.setLink(frame.getName()); 164 165 int x = 50, y = 100; 166 int dY = UserSettings.ItemTemplate.get().getPolygon().getBounds().height + 1; 167 int maxY = UserSettings.InitialHeight.get() - 150; 162 FrameCreator frames = new FrameCreator(text.getParentOrCurrentFrame().getFramesetName(), text.getParentOrCurrentFrame().getPath(), page, false, false); 163 // Frame frame = FrameIO.CreateFrame(text.getParentOrCurrentFrame().getFramesetName(), page, null); 164 text.setLink(frames.getName()); 168 165 169 166 // add subpages of the current page … … 175 172 } 176 173 System.out.println("Generating " + name); 177 generateSettingsTree(k, frame.addText(x, y, name.substring(0, 1).toUpperCase() + name.substring(1), null)); 178 y += dY; 179 if(y >= maxY) { 180 x += 300; 181 y = 100; 182 } 183 } 184 } 185 186 x += 200; 187 y = 100; 174 generateSettingsTree(k, frames.addText(name.substring(0, 1).toUpperCase() + name.substring(1), null, null, null, false)); 175 } 176 } 177 178 frames.setLastY(150); 188 179 189 180 // add settings of the current page … … 205 196 } 206 197 } 198 Text t; 207 199 if(key.equals("pass")) { 208 Text t = frame.addText(x, y, "iw: org.expeditee.items.widgets.Password", null);200 t = frames.addText("iw: org.expeditee.items.widgets.Password", null, null, null, false); 209 201 Password pw = new Password(t, null); 210 202 pw.setPassword((String) value); 211 frame.removeItem(t); 212 frame.addAllItems(pw.getItems()); 213 y += pw.getHeight(); 203 frames.getCurrentFrame().removeItem(t); 204 frames.getCurrentFrame().addAllItems(pw.getItems()); 214 205 } else if(s instanceof GenericSetting && ((GenericSetting) s).getType().equals(Text.class)) { 215 Textt = ((GenericSetting<Text>) s).get();206 t = ((GenericSetting<Text>) s).get(); 216 207 if(t == null) continue; 217 208 t = t.copy(); 218 int h = t.getPolygon().getBounds().height + 1; 219 t.setID(frame.getNextItemID()); 220 t.setX(x); 221 t.setY(y + h / 2); 209 t.setID(frames.getCurrentFrame().getNextItemID()); 222 210 t.setText(name); 223 t.setTooltip(s.getTooltip()); 224 frame.addItem(t); 225 y += h; 211 frames.addItem(t, false); 226 212 } else { 227 Text t = frame.addText(x, y + dY / 2, name + value, null); 228 t.setTooltip(s.getTooltip()); 229 y += dY; 230 } 231 if(y >= maxY) { 232 x += 300; 233 y = 100; 234 } 235 } 236 } 237 238 FrameIO.SaveFrame(frame); 213 t = frames.addText(name + value, null, null, null, false); 214 } 215 Text tt = frames.getCurrentFrame().addText(600, t.getY(), s.getTooltip(), null); 216 tt.setWidth(400); 217 // rebuild to get the correct height since setWidth() doesn't immediately rebuild 218 tt.rebuild(true); 219 if(tt.getY() + tt.getBoundsHeight() > frames.getLastY()) { 220 frames.setLastY(tt.getY() + tt.getBoundsHeight()); 221 } 222 } 223 } 224 225 frames.save(); 226 //FrameIO.SaveFrame(frame); 239 227 } 240 228 }
Note:
See TracChangeset
for help on using the changeset viewer.