Skip to content

Commit

Permalink
ImageBank->FileBank
Browse files Browse the repository at this point in the history
  • Loading branch information
systemed committed Mar 5, 2012
1 parent 8f6a150 commit 92736d1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 166 deletions.
146 changes: 0 additions & 146 deletions net/systemeD/halcyon/ImageBank.as

This file was deleted.

6 changes: 3 additions & 3 deletions net/systemeD/halcyon/MarkerUI.as
Expand Up @@ -10,7 +10,7 @@ package net.systemeD.halcyon {
import flash.geom.Point; import flash.geom.Point;
import net.systemeD.halcyon.styleparser.*; import net.systemeD.halcyon.styleparser.*;
import net.systemeD.halcyon.connection.*; import net.systemeD.halcyon.connection.*;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;


public class MarkerUI extends EntityUI { public class MarkerUI extends EntityUI {


Expand Down Expand Up @@ -100,9 +100,9 @@ package net.systemeD.halcyon {
icon.graphics.drawCircle(w,w,w); icon.graphics.drawCircle(w,w,w);
if (s.interactive) { maxwidth=Math.max(w,maxwidth); } if (s.interactive) { maxwidth=Math.max(w,maxwidth); }


} else if (ImageBank.getInstance().hasImage(s.icon_image)) { } else if (FileBank.getInstance().hasFile(s.icon_image)) {
// load icon from library // load icon from library
icon.addChild(ImageBank.getInstance().getAsDisplayObject(s.icon_image)); icon.addChild(FileBank.getInstance().getAsDisplayObject(s.icon_image));
// addHitSprite(icon.width); // ** check this - we're doing it below too // addHitSprite(icon.width); // ** check this - we're doing it below too
// loaded=true; updatePosition(); // ** check this // loaded=true; updatePosition(); // ** check this
if (s.interactive) { maxwidth=Math.max(icon.width,maxwidth); } if (s.interactive) { maxwidth=Math.max(icon.width,maxwidth); }
Expand Down
6 changes: 3 additions & 3 deletions net/systemeD/halcyon/NodeUI.as
Expand Up @@ -10,7 +10,7 @@ package net.systemeD.halcyon {
import flash.geom.Point; import flash.geom.Point;
import net.systemeD.halcyon.styleparser.*; import net.systemeD.halcyon.styleparser.*;
import net.systemeD.halcyon.connection.*; import net.systemeD.halcyon.connection.*;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;


/** The graphical representation of a Node (including POIs and nodes that are part of Ways). */ /** The graphical representation of a Node (including POIs and nodes that are part of Ways). */
public class NodeUI extends EntityUI { public class NodeUI extends EntityUI {
Expand Down Expand Up @@ -122,9 +122,9 @@ package net.systemeD.halcyon {
icon.graphics.drawCircle(w,w,w); icon.graphics.drawCircle(w,w,w);
if (s.interactive) { maxwidth=Math.max(w,maxwidth); } if (s.interactive) { maxwidth=Math.max(w,maxwidth); }


} else if (ImageBank.getInstance().hasImage(s.icon_image)) { } else if (FileBank.getInstance().hasFile(s.icon_image)) {
// load icon from library // load icon from library
icon.addChild(ImageBank.getInstance().getAsDisplayObject(s.icon_image)); icon.addChild(FileBank.getInstance().getAsDisplayObject(s.icon_image));
// addHitSprite(icon.width); // ** check this - we're doing it below too // addHitSprite(icon.width); // ** check this - we're doing it below too
loaded=true; updatePosition(); // ** check this loaded=true; updatePosition(); // ** check this
if (s.interactive) { maxwidth=Math.max(icon.width,maxwidth); } if (s.interactive) { maxwidth=Math.max(icon.width,maxwidth); }
Expand Down
4 changes: 2 additions & 2 deletions net/systemeD/halcyon/WayUI.as
Expand Up @@ -9,7 +9,7 @@ package net.systemeD.halcyon {


import net.systemeD.halcyon.connection.*; import net.systemeD.halcyon.connection.*;
import net.systemeD.halcyon.styleparser.*; import net.systemeD.halcyon.styleparser.*;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;


/** The graphical representation of a Way. */ /** The graphical representation of a Way. */
public class WayUI extends EntityUI { public class WayUI extends EntityUI {
Expand Down Expand Up @@ -296,7 +296,7 @@ package net.systemeD.halcyon {
fill=new Shape(); addToLayer(fill,FILLSPRITE,s.sublayer); fill=new Shape(); addToLayer(fill,FILLSPRITE,s.sublayer);
fill.graphics.moveTo(x0,y0); fill.graphics.moveTo(x0,y0);
if (s.fill_image) { if (s.fill_image) {
fill.graphics.beginBitmapFill(ImageBank.getInstance().getAsBitmapData(s.fill_image)); fill.graphics.beginBitmapFill(FileBank.getInstance().getAsBitmapData(s.fill_image));
} else { } else {
s.applyFill(fill.graphics); s.applyFill(fill.graphics);
} }
Expand Down
6 changes: 3 additions & 3 deletions net/systemeD/halcyon/styleparser/RuleSet.as
Expand Up @@ -6,7 +6,7 @@ package net.systemeD.halcyon.styleparser {
import net.systemeD.halcyon.ExtendedURLLoader; import net.systemeD.halcyon.ExtendedURLLoader;
import net.systemeD.halcyon.DebugURLRequest; import net.systemeD.halcyon.DebugURLRequest;
import net.systemeD.halcyon.connection.Entity; import net.systemeD.halcyon.connection.Entity;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;


import net.systemeD.halcyon.connection.*; import net.systemeD.halcyon.connection.*;


Expand Down Expand Up @@ -281,7 +281,7 @@ package net.systemeD.halcyon.styleparser {
/** Load all images referenced in the RuleSet (for example, icons or bitmap fills). */ /** Load all images referenced in the RuleSet (for example, icons or bitmap fills). */


private function loadImages():void { private function loadImages():void {
ImageBank.getInstance().addEventListener(ImageBank.IMAGES_LOADED,doIconCallback); FileBank.getInstance().addEventListener(FileBank.FILES_LOADED,doIconCallback);
var filename:String; var filename:String;
for each (var chooser:StyleChooser in choosers) { for each (var chooser:StyleChooser in choosers) {
for each (var style:Style in chooser.styles) { for each (var style:Style in chooser.styles) {
Expand All @@ -291,7 +291,7 @@ package net.systemeD.halcyon.styleparser {
else { continue; } else { continue; }


if (filename!='square' && filename!='circle') if (filename!='square' && filename!='circle')
ImageBank.getInstance().loadImage(filename); FileBank.getInstance().addFromFile(filename);
} }
} }
} }
Expand Down
6 changes: 3 additions & 3 deletions net/systemeD/halcyon/styleparser/StyleChooser.as
@@ -1,7 +1,7 @@
package net.systemeD.halcyon.styleparser { package net.systemeD.halcyon.styleparser {


import net.systemeD.halcyon.connection.Entity; import net.systemeD.halcyon.connection.Entity;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;


public class StyleChooser { public class StyleChooser {


Expand Down Expand Up @@ -67,8 +67,8 @@ package net.systemeD.halcyon.styleparser {
if (PointStyle(r).icon_width && !PointStyle(r).evals['icon_width']) { if (PointStyle(r).icon_width && !PointStyle(r).evals['icon_width']) {
// ** FIXME: we should check this is the bit being used for 'square', 'circle' etc. // ** FIXME: we should check this is the bit being used for 'square', 'circle' etc.
w=PointStyle(r).icon_width; w=PointStyle(r).icon_width;
} else if (PointStyle(r).icon_image && ImageBank.getInstance().hasImage(PointStyle(r).icon_image)) { } else if (PointStyle(r).icon_image && FileBank.getInstance().hasFile(PointStyle(r).icon_image)) {
w=ImageBank.getInstance().getWidth(PointStyle(r).icon_image); w=FileBank.getInstance().getWidth(PointStyle(r).icon_image);
} }
if (w>sl.maxwidth) { sl.maxwidth=w; } if (w>sl.maxwidth) { sl.maxwidth=w; }
} else if (r is InstructionStyle) { } else if (r is InstructionStyle) {
Expand Down
6 changes: 3 additions & 3 deletions net/systemeD/potlatch2/Preloader.as
Expand Up @@ -6,7 +6,7 @@ package net.systemeD.potlatch2 {
import flash.geom.Matrix; import flash.geom.Matrix;
import flash.text.TextField; import flash.text.TextField;
import flash.text.TextFormat; import flash.text.TextFormat;
import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;




public class Preloader extends net.systemeD.potlatch2.PreloaderDisplayBase { public class Preloader extends net.systemeD.potlatch2.PreloaderDisplayBase {
Expand Down Expand Up @@ -45,11 +45,11 @@ package net.systemeD.potlatch2 {


// request .zip files // request .zip files
if (loaderInfo.parameters['assets']) { if (loaderInfo.parameters['assets']) {
ImageBank.getInstance().addEventListener(ImageBank.ZIP_LOADED, zipLoaded); FileBank.getInstance().addEventListener(FileBank.ZIP_LOADED, zipLoaded);
for each (var file:String in loaderInfo.parameters['assets'].split(';')) { for each (var file:String in loaderInfo.parameters['assets'].split(';')) {
var asset:Array=file.split('='); var asset:Array=file.split('=');
assetscount++; assetscount++;
ImageBank.getInstance().loadFromZip(asset[0],asset[1]); FileBank.getInstance().addFromZip(asset[0],asset[1]);
} }
} }
} }
Expand Down
6 changes: 3 additions & 3 deletions net/systemeD/potlatch2/mapfeatures/Feature.as
Expand Up @@ -8,7 +8,7 @@ package net.systemeD.potlatch2.mapfeatures {
import mx.core.BitmapAsset; import mx.core.BitmapAsset;
import mx.graphics.codec.PNGEncoder; import mx.graphics.codec.PNGEncoder;


import net.systemeD.halcyon.ImageBank; import net.systemeD.halcyon.FileBank;
import net.systemeD.halcyon.connection.Entity; import net.systemeD.halcyon.connection.Entity;
import net.systemeD.potlatch2.utils.CachedDataLoader; import net.systemeD.potlatch2.utils.CachedDataLoader;


Expand Down Expand Up @@ -148,8 +148,8 @@ package net.systemeD.potlatch2.mapfeatures {
} }


if ( imageURL ) { if ( imageURL ) {
if (ImageBank.getInstance().hasImage(imageURL)) { if (FileBank.getInstance().hasFile(imageURL)) {
return ImageBank.getInstance().getAsByteArray(imageURL) return FileBank.getInstance().getAsByteArray(imageURL);
} else { } else {
return CachedDataLoader.loadData(imageURL, imageLoaded); return CachedDataLoader.loadData(imageURL, imageLoaded);
} }
Expand Down

0 comments on commit 92736d1

Please sign in to comment.