コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void jobQueueTest() throws InterruptedException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void jobQueueTest()
        {
            MapViewPosition mapViewPosition = new MapViewPosition(new FixedTileSizeDisplayModel(256));
            JobQueue <Job>  jobQueue        = new JobQueue <Job>(mapViewPosition, new FixedTileSizeDisplayModel(256));

            Assert.assertEquals(0, jobQueue.size());

            Tile tile1 = new Tile(0, 0, (sbyte)1, TILE_SIZE);
            Tile tile2 = new Tile(0, 0, (sbyte)0, TILE_SIZE);
            Tile tile3 = new Tile(0, 0, (sbyte)2, TILE_SIZE);

            Job job1 = new Job(tile1, false);
            Job job2 = new Job(tile2, false);
            Job job3 = new Job(tile3, false);

            jobQueue.add(job1);
            jobQueue.add(job2);
            jobQueue.add(job3);
            Assert.assertEquals(3, jobQueue.size());

            jobQueue.add(job1);
            Assert.assertEquals(3, jobQueue.size());

            jobQueue.notifyWorkers();

            Assert.assertEquals(job2, jobQueue.get());
            Assert.assertEquals(job1, jobQueue.get());
            Assert.assertEquals(job3, jobQueue.get());

            Assert.assertEquals(0, jobQueue.size());

            jobQueue.remove(job1);
            jobQueue.remove(job2);
            jobQueue.remove(job3);
        }
コード例 #2
0
 public TileDownloadLayer(TileCache tileCache, MapViewPosition mapViewPosition, TileSource tileSource, IGraphicFactory graphicFactory) : base(tileCache, mapViewPosition, graphicFactory.CreateMatrix(), tileSource.HasAlpha())
 {
     this.tileCache       = tileCache;
     this.tileSource      = tileSource;
     this.cacheTimeToLive = tileSource.DefaultTimeToLive;
     this.graphicFactory  = graphicFactory;
 }
コード例 #3
0
        public LayerManager(MapView mapView, MapViewPosition mapViewPosition, IGraphicFactory graphicFactory) : base()
        {
            this.mapView         = mapView;
            this.mapViewPosition = mapViewPosition;

            this.drawingCanvas = graphicFactory.CreateCanvas();
            this.layers        = new Layers(this, mapView.Model.displayModel);
        }
コード例 #4
0
        public DefaultMapScaleBar(MapViewPosition mapViewPosition, MapViewDimension mapViewDimension, IGraphicFactory graphicFactory, DisplayModel displayModel) : base(mapViewPosition, mapViewDimension, displayModel, graphicFactory, BITMAP_WIDTH, BITMAP_HEIGHT)
        {
            this.scaleBarMode = ScaleBarMode.BOTH;
            this.secondaryDistanceUnitAdapter = ImperialUnitAdapter.INSTANCE;

            this.paintScaleBar        = CreateScaleBarPaint(Color.BLACK, STROKE_INTERNAL, Style.FILL);
            this.paintScaleBarStroke  = CreateScaleBarPaint(Color.WHITE, STROKE_EXTERNAL, Style.STROKE);
            this.paintScaleText       = CreateTextPaint(Color.BLACK, 0, Style.FILL);
            this.paintScaleTextStroke = CreateTextPaint(Color.WHITE, 2, Style.STROKE);
        }
コード例 #5
0
 /// <summary>
 /// Creates a TileRendererLayer. </summary>
 /// <param name="tileCache"> cache where tiles are stored </param>
 /// <param name="mapDataStore"> the mapsforge map file </param>
 /// <param name="mapViewPosition"> the mapViewPosition to know which tiles to render </param>
 /// <param name="isTransparent"> true if the tile should have an alpha/transparency </param>
 /// <param name="renderLabels"> true if labels should be rendered onto tiles </param>
 /// <param name="graphicFactory"> the graphicFactory to carry out platform specific operations </param>
 public TileRendererLayer(TileCache tileCache, MapDataStore mapDataStore, MapViewPosition mapViewPosition, bool isTransparent, bool renderLabels, IGraphicFactory graphicFactory) : base(tileCache, mapViewPosition, graphicFactory.CreateMatrix(), isTransparent)
 {
     this.graphicFactory = graphicFactory;
     this.mapDataStore   = mapDataStore;
     if (renderLabels)
     {
         this.tileBasedLabelStore = null;
         this.databaseRenderer    = new DatabaseRenderer(this.mapDataStore, graphicFactory, tileCache);
     }
     else
     {
         this.tileBasedLabelStore = new TileBasedLabelStore(tileCache.CapacityFirstLevel);
         this.databaseRenderer    = new DatabaseRenderer(this.mapDataStore, graphicFactory, tileBasedLabelStore);
     }
     this.textScale = 1;
 }
コード例 #6
0
ファイル: TileLayer.cs プロジェクト: tilemapjp/MapsforgeSharp
        public TileLayer(TileCache tileCache, MapViewPosition mapViewPosition, IMatrix matrix, bool isTransparent, bool hasJobQueue) : base()
        {
            if (tileCache == null)
            {
                throw new System.ArgumentException("tileCache must not be null");
            }
            else if (mapViewPosition == null)
            {
                throw new System.ArgumentException("mapViewPosition must not be null");
            }

            this.hasJobQueue     = hasJobQueue;
            this.tileCache       = tileCache;
            this.mapViewPosition = mapViewPosition;
            this.matrix          = matrix;
            this.isTransparent   = isTransparent;
        }
コード例 #7
0
        public MapScaleBar(MapViewPosition mapViewPosition, MapViewDimension mapViewDimension, DisplayModel displayModel, IGraphicFactory graphicFactory, int width, int height)
        {
            this.mapViewPosition  = mapViewPosition;
            this.mapViewDimension = mapViewDimension;
            this.displayModel     = displayModel;
            this.graphicFactory   = graphicFactory;
            this.mapScaleBitmap   = graphicFactory.CreateBitmap((int)(width * this.displayModel.ScaleFactor), (int)(height * this.displayModel.ScaleFactor));

            this.marginHorizontal = DEFAULT_HORIZONTAL_MARGIN;
            this.marginVertical   = DEFAULT_VERTICAL_MARGIN;
            this.scaleBarPosition = DEFAULT_SCALE_BAR_POSITION;

            this.mapScaleCanvas        = graphicFactory.CreateCanvas();
            this.mapScaleCanvas.Bitmap = this.mapScaleBitmap;
            this.distanceUnitAdapter   = MetricUnitAdapter.INSTANCE;
            this.visible      = true;
            this.redrawNeeded = true;
        }
コード例 #8
0
 public TileStoreLayer(TileCache tileCache, MapViewPosition mapViewPosition, IGraphicFactory graphicFactory, bool isTransparent) : base(tileCache, mapViewPosition, graphicFactory.CreateMatrix(), isTransparent, false)
 {
 }
コード例 #9
0
ファイル: TileLayer.cs プロジェクト: tilemapjp/MapsforgeSharp
 public TileLayer(TileCache tileCache, MapViewPosition mapViewPosition, IMatrix matrix, bool isTransparent) : this(tileCache, mapViewPosition, matrix, isTransparent, true)
 {
 }
コード例 #10
0
ファイル: JobQueue.cs プロジェクト: tilemapjp/MapsforgeSharp
 public JobQueue(MapViewPosition mapViewPosition, DisplayModel displayModel)
 {
     this.mapViewPosition = mapViewPosition;
     this.displayModel    = displayModel;
 }