Field

Changeset 184:05561c86286e

Show
Ignore:
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
  • development/java/field/core/plugins/history/ElementFileSystemBrowser.java

    r177 r184  
    218218                        this(name, new File(SystemProperties.getDirProperty("versioning.dir"))); 
    219219                } 
     220 
    220221                public RepositoryRoot(String name, File dir) { 
    221222                        browser.super(); 
     
    256257                                                try { 
    257258                                                        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)); 
    259260                                                        } 
    260261                                                } catch (IOException e) { 
     
    434435                boolean made = false; 
    435436 
     437                private final File dir; 
     438 
    436439                public TemplateRoot(String name) { 
     440                        this(name, new File(SystemProperties.getDirProperty("versioning.dir"))); 
     441                } 
     442 
     443                public TemplateRoot(String name, File dir) { 
    437444                        browser.super(); 
    438445                        this.name = name; 
     446                        this.dir = dir; 
    439447 
    440448                        setPayload(name); 
     
    467475                        System.err.println(" making children <" + this + "> ------------ repository root"); 
    468476 
    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 
    470494                        File[] files = dir.listFiles(new FileFilter() { 
    471495                                public boolean accept(File pathname) { 
  • development/java/field/core/ui/BaseBrowser.java

    r177 r184  
    368368 
    369369        public void reload() { 
     370 
     371                TreePath path = browser.getSelectionModel().getSelectionPath(); 
     372                Object last = path.getLastPathComponent(); 
     373 
    370374                model.payloadChanged(root, root.payload()); 
     375 
     376 
     377                browser.getSelectionModel().setSelectionPath(path); 
    371378        } 
    372379 
  • development/java/field/core/windowing/components/SwingBridgeComponent.java

    r179 r184  
    9393        protected TriangleMesh triangles; 
    9494 
    95         protected AribitraryComponent aribitraryComponent; 
     95        private AribitraryComponent aribitraryComponent; 
    9696 
    9797        protected iDynamicMesh labelTriangle; 
     
    113113                // this.isSelctedable = false; 
    114114 
    115                 aribitraryComponent = TextSystem.textSystem.new AribitraryComponent(getMaxDimension(), getMaxDimension()); 
    116115        } 
    117116 
     
    326325                                // (int) 
    327326                                // 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); 
    331330 
    332331                        BasicContextManager.gl.glActiveTexture(BasicContextManager.gl.GL_TEXTURE1); 
    333                         aribitraryComponent.on(); 
     332                        getAribitraryComponent().on(); 
    334333                        // BasicContextManager.gl.glBlendFunc(GL.GL_ZERO, 
    335334                        // GL.GL_SRC_COLOR); 
     
    337336                        // BasicContextManager.gl.glBlendFunc(GL.GL_SRC_ALPHA, 
    338337                        // GL.GL_ONE_MINUS_SRC_ALPHA); 
    339                         aribitraryComponent.off(); 
     338                        getAribitraryComponent().off(); 
    340339                        BasicContextManager.gl.glActiveTexture(BasicContextManager.gl.GL_TEXTURE0); 
    341340                        dirty = false; 
     
    432431                } 
    433432        } 
     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        } 
    434443} 
  • development/java/field/graphics/core/AdvancedTextures.java

    r145 r184  
    5959                        return this; 
    6060                } 
    61                  
     61 
    6262                boolean allwaysDirty = false; 
    63                  
     63 
    6464                public Base1ByteTexture setTextureRange(TextureRange in) { 
    6565                        this.in = in; 
     
    9292                        if (allwaysDirty) 
    9393                                dirty = true; 
    94                          
     94 
    9595                        if (dirty) { 
    9696                                System.out.println(" pixel buffer is <"+pixelBuffer+">"); 
     
    257257                        return this; 
    258258                } 
    259                  
     259 
    260260                boolean allwaysDirty = false; 
    261                  
     261 
    262262                @Override 
    263263                public void post() { 
     
    284284                        if (allwaysDirty) 
    285285                                dirty = true; 
    286                          
     286 
    287287                        if (dirty) { 
    288288                                pixelBuffer.rewind(); 
     
    459459                        return this; 
    460460                } 
    461                  
     461 
    462462                boolean allwaysDirty = false; 
    463                  
     463 
    464464 
    465465                public void deallocate(TaskQueue atRenderTime) { 
     
    499499                        if (allwaysDirty) 
    500500                                dirty = true; 
    501                          
     501 
    502502                        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); 
    503503                        // 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); 
  • development/java/field/graphics/core/TextSystem.java

    r179 r184  
    150150                public void on() { 
    151151                        assert gl != null; 
     152 
    152153                        slow.setGL(gl); 
    153154                        if (first) {