Changeset 184:05561c86286e
- Timestamp:
- 09/28/2008 07:26:25 PM
(3 months ago)
- Author:
- marc@f1.local
- branch:
- default
- Message:
fixed bug in Swing on canvas support. Perhaps the end of #95 at long last?. Browser now supports templates in sub-dirs and doesn't reset after the load is complete
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r177 |
r184 |
|
| 218 | 218 | this(name, new File(SystemProperties.getDirProperty("versioning.dir"))); |
|---|
| 219 | 219 | } |
|---|
| | 220 | |
|---|
| 220 | 221 | public RepositoryRoot(String name, File dir) { |
|---|
| 221 | 222 | browser.super(); |
|---|
| … | … | |
| 256 | 257 | try { |
|---|
| 257 | 258 | if (!pathname.getName().startsWith(".") && pathname.isDirectory() && !new File(pathname.getCanonicalPath() + "/sheet.xml").exists()) { |
|---|
| 258 | | addChild(new RepositoryRoot("<b>directory</b> '"+pathname.getName()+"'",pathname)); |
|---|
| | 259 | addChild(new RepositoryRoot("<b>directory</b> '" + pathname.getName() + "'", pathname)); |
|---|
| 259 | 260 | } |
|---|
| 260 | 261 | } catch (IOException e) { |
|---|
| … | … | |
| 434 | 435 | boolean made = false; |
|---|
| 435 | 436 | |
|---|
| | 437 | private final File dir; |
|---|
| | 438 | |
|---|
| 436 | 439 | public TemplateRoot(String name) { |
|---|
| | 440 | this(name, new File(SystemProperties.getDirProperty("versioning.dir"))); |
|---|
| | 441 | } |
|---|
| | 442 | |
|---|
| | 443 | public TemplateRoot(String name, File dir) { |
|---|
| 437 | 444 | browser.super(); |
|---|
| 438 | 445 | this.name = name; |
|---|
| | 446 | this.dir = dir; |
|---|
| 439 | 447 | |
|---|
| 440 | 448 | setPayload(name); |
|---|
| … | … | |
| 467 | 475 | System.err.println(" making children <" + this + "> ------------ repository root"); |
|---|
| 468 | 476 | |
|---|
| 469 | | File dir = new File(SystemProperties.getDirProperty("versioning.dir")); |
|---|
| | 477 | { |
|---|
| | 478 | File[] files = dir.listFiles(new FileFilter() { |
|---|
| | 479 | public boolean accept(File pathname) { |
|---|
| | 480 | try { |
|---|
| | 481 | if (pathname.isDirectory() && !new File(pathname.getCanonicalPath() + "/sheet.xml").exists() && !pathname.getName().startsWith(".") && !pathname.getName().equals("internal")) |
|---|
| | 482 | return true; |
|---|
| | 483 | } catch (IOException e) { |
|---|
| | 484 | } |
|---|
| | 485 | return false; |
|---|
| | 486 | } |
|---|
| | 487 | }); |
|---|
| | 488 | for(File f : files) |
|---|
| | 489 | { |
|---|
| | 490 | this.addChild(new TemplateRoot("files in <b>"+f.getName()+"</b>", f)); |
|---|
| | 491 | } |
|---|
| | 492 | } |
|---|
| | 493 | |
|---|
| 470 | 494 | File[] files = dir.listFiles(new FileFilter() { |
|---|
| 471 | 495 | public boolean accept(File pathname) { |
|---|
| r177 |
r184 |
|
| 368 | 368 | |
|---|
| 369 | 369 | public void reload() { |
|---|
| | 370 | |
|---|
| | 371 | TreePath path = browser.getSelectionModel().getSelectionPath(); |
|---|
| | 372 | Object last = path.getLastPathComponent(); |
|---|
| | 373 | |
|---|
| 370 | 374 | model.payloadChanged(root, root.payload()); |
|---|
| | 375 | |
|---|
| | 376 | |
|---|
| | 377 | browser.getSelectionModel().setSelectionPath(path); |
|---|
| 371 | 378 | } |
|---|
| 372 | 379 | |
|---|
| r179 |
r184 |
|
| 93 | 93 | protected TriangleMesh triangles; |
|---|
| 94 | 94 | |
|---|
| 95 | | protected AribitraryComponent aribitraryComponent; |
|---|
| | 95 | private AribitraryComponent aribitraryComponent; |
|---|
| 96 | 96 | |
|---|
| 97 | 97 | protected iDynamicMesh labelTriangle; |
|---|
| … | … | |
| 113 | 113 | // this.isSelctedable = false; |
|---|
| 114 | 114 | |
|---|
| 115 | | aribitraryComponent = TextSystem.textSystem.new AribitraryComponent(getMaxDimension(), getMaxDimension()); |
|---|
| 116 | 115 | } |
|---|
| 117 | 116 | |
|---|
| … | … | |
| 326 | 325 | // (int) |
|---|
| 327 | 326 | // this.getBounds().h); |
|---|
| 328 | | aribitraryComponent.resetImage(componentToRender, backgroundR, backgroundG, backgroundB, backgroundA); |
|---|
| 329 | | } |
|---|
| 330 | | aribitraryComponent.drawIntoMesh(labelTriangle, 1, 1, 1, 1, (float) bounds.x, (float) bounds.y); |
|---|
| | 327 | getAribitraryComponent().resetImage(componentToRender, backgroundR, backgroundG, backgroundB, backgroundA); |
|---|
| | 328 | } |
|---|
| | 329 | getAribitraryComponent().drawIntoMesh(labelTriangle, 1, 1, 1, 1, (float) bounds.x, (float) bounds.y); |
|---|
| 331 | 330 | |
|---|
| 332 | 331 | BasicContextManager.gl.glActiveTexture(BasicContextManager.gl.GL_TEXTURE1); |
|---|
| 333 | | aribitraryComponent.on(); |
|---|
| | 332 | getAribitraryComponent().on(); |
|---|
| 334 | 333 | // BasicContextManager.gl.glBlendFunc(GL.GL_ZERO, |
|---|
| 335 | 334 | // GL.GL_SRC_COLOR); |
|---|
| … | … | |
| 337 | 336 | // BasicContextManager.gl.glBlendFunc(GL.GL_SRC_ALPHA, |
|---|
| 338 | 337 | // GL.GL_ONE_MINUS_SRC_ALPHA); |
|---|
| 339 | | aribitraryComponent.off(); |
|---|
| | 338 | getAribitraryComponent().off(); |
|---|
| 340 | 339 | BasicContextManager.gl.glActiveTexture(BasicContextManager.gl.GL_TEXTURE0); |
|---|
| 341 | 340 | dirty = false; |
|---|
| … | … | |
| 432 | 431 | } |
|---|
| 433 | 432 | } |
|---|
| | 433 | |
|---|
| | 434 | protected void setAribitraryComponent(AribitraryComponent aribitraryComponent) { |
|---|
| | 435 | this.aribitraryComponent = aribitraryComponent; |
|---|
| | 436 | } |
|---|
| | 437 | |
|---|
| | 438 | protected AribitraryComponent getAribitraryComponent() { |
|---|
| | 439 | if (aribitraryComponent==null) |
|---|
| | 440 | aribitraryComponent = TextSystem.textSystem.new AribitraryComponent(getMaxDimension(), getMaxDimension()); |
|---|
| | 441 | return aribitraryComponent; |
|---|
| | 442 | } |
|---|
| 434 | 443 | } |
|---|
| r145 |
r184 |
|
| 59 | 59 | return this; |
|---|
| 60 | 60 | } |
|---|
| 61 | | |
|---|
| | 61 | |
|---|
| 62 | 62 | boolean allwaysDirty = false; |
|---|
| 63 | | |
|---|
| | 63 | |
|---|
| 64 | 64 | public Base1ByteTexture setTextureRange(TextureRange in) { |
|---|
| 65 | 65 | this.in = in; |
|---|
| … | … | |
| 92 | 92 | if (allwaysDirty) |
|---|
| 93 | 93 | dirty = true; |
|---|
| 94 | | |
|---|
| | 94 | |
|---|
| 95 | 95 | if (dirty) { |
|---|
| 96 | 96 | System.out.println(" pixel buffer is <"+pixelBuffer+">"); |
|---|
| … | … | |
| 257 | 257 | return this; |
|---|
| 258 | 258 | } |
|---|
| 259 | | |
|---|
| | 259 | |
|---|
| 260 | 260 | boolean allwaysDirty = false; |
|---|
| 261 | | |
|---|
| | 261 | |
|---|
| 262 | 262 | @Override |
|---|
| 263 | 263 | public void post() { |
|---|
| … | … | |
| 284 | 284 | if (allwaysDirty) |
|---|
| 285 | 285 | dirty = true; |
|---|
| 286 | | |
|---|
| | 286 | |
|---|
| 287 | 287 | if (dirty) { |
|---|
| 288 | 288 | pixelBuffer.rewind(); |
|---|
| … | … | |
| 459 | 459 | return this; |
|---|
| 460 | 460 | } |
|---|
| 461 | | |
|---|
| | 461 | |
|---|
| 462 | 462 | boolean allwaysDirty = false; |
|---|
| 463 | | |
|---|
| | 463 | |
|---|
| 464 | 464 | |
|---|
| 465 | 465 | public void deallocate(TaskQueue atRenderTime) { |
|---|
| … | … | |
| 499 | 499 | if (allwaysDirty) |
|---|
| 500 | 500 | dirty = true; |
|---|
| 501 | | |
|---|
| | 501 | |
|---|
| 502 | 502 | if (dirty) gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_BGRA, gl.GL_UNSIGNED_INT_8_8_8_8_REV, from); |
|---|
| 503 | 503 | // if (dirty) gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_RGBA, gl.GL_UNSIGNED_INT_8_8_8_8, from); |
|---|
| r179 |
r184 |
|
| 150 | 150 | public void on() { |
|---|
| 151 | 151 | assert gl != null; |
|---|
| | 152 | |
|---|
| 152 | 153 | slow.setGL(gl); |
|---|
| 153 | 154 | if (first) { |
|---|