Examples of MapMode


Examples of java.nio.channels.FileChannel.MapMode

            if (!readOnly) {
                newBufferLength = largeBufferSize;
            }

            MapMode mapMode = readOnly ? FileChannel.MapMode.READ_ONLY
                                       : FileChannel.MapMode.READ_WRITE;

            if (!readOnly && file.length() < fileLength + newBufferLength) {
                file.seek(fileLength + newBufferLength - 1);
                file.writeByte(0);
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

            if (!readOnly) {
                newBufferLength = largeBufferSize;
            }

            MapMode mapMode = readOnly ? FileChannel.MapMode.READ_ONLY
                                       : FileChannel.MapMode.READ_WRITE;

            if (!readOnly && file.length() < fileLength + newBufferLength) {
                file.seek(fileLength + newBufferLength - 1);
                file.writeByte(0);
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

            if (!readOnly) {
                newBufferLength = largeBufferSize;
            }

            MapMode mapMode = readOnly ? FileChannel.MapMode.READ_ONLY
                                       : FileChannel.MapMode.READ_WRITE;

            if (!readOnly && file.length() < fileLength + newBufferLength) {
                file.seek(fileLength + newBufferLength - 1);
                file.writeByte(0);
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

  private synchronized void mapArray() throws IOException {
    if (map != null) {
      ByteArrayUtil.unmapByteBuffer(map);
      map = null;
    }
    MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
    map = file.getChannel().map(mode, headersize, recordsize * numrecs);
  }
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

   * @return additional header data
   * @throws IOException on IO errors
   */
  public synchronized ByteBuffer getExtraHeader() throws IOException {
    final int size = headersize - INTERNAL_HEADER_SIZE;
    final MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
    return file.getChannel().map(mode, INTERNAL_HEADER_SIZE, size);
  }
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

  private synchronized void mapArray() throws IOException {
    if (map != null) {
      ByteArrayUtil.unmapByteBuffer(map);
      map = null;
    }
    MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
    map = file.getChannel().map(mode, headersize, recordsize * numrecs);
  }
View Full Code Here

Examples of java.nio.channels.FileChannel.MapMode

   * @return additional header data
   * @throws IOException on IO errors
   */
  public synchronized ByteBuffer getExtraHeader() throws IOException {
    final int size = headersize - INTERNAL_HEADER_SIZE;
    final MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
    return file.getChannel().map(mode, INTERNAL_HEADER_SIZE, size);
  }
View Full Code Here

Examples of org.openstreetmap.josm.actions.mapmode.MapMode

     */
    public boolean selectMapMode(MapMode newMapMode, Layer newLayer) {
        if (newMapMode == null || !newMapMode.layerIsSupported(newLayer))
            return false;

        MapMode oldMapMode = this.mapMode;
        if (newMapMode == oldMapMode)
            return true;
        if (oldMapMode != null) {
            oldMapMode.exitMode();
        }
        this.mapMode = newMapMode;
        newMapMode.enterMode();
        lastMapMode.put(newLayer, newMapMode);
        fireMapModeChanged(oldMapMode, newMapMode);
View Full Code Here

Examples of org.openstreetmap.josm.actions.mapmode.MapMode

    @Override
    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
        boolean modeChanged = false;
        if (mapMode == null || !mapMode.layerIsSupported(newLayer)) {
            MapMode newMapMode = getLastMapMode(newLayer);
            modeChanged = newMapMode != mapMode;
            if (newMapMode != null) {
                selectMapMode(newMapMode, newLayer); // it would be nice to select first supported mode when layer is first selected, but it don't work well with for example editgpx layer
            } else if (mapMode != null) {
                mapMode.exitMode(); // if new mode is null - simply exit from previous mode
View Full Code Here

Examples of org.openstreetmap.josm.actions.mapmode.MapMode

        });
    }


    private MapMode getLastMapMode(Layer newLayer) {
        MapMode mode = lastMapMode.get(newLayer);
        if (mode == null) {
            // if no action is selected - try to select default action
            Action defaultMode = getDefaultButtonAction();
            if (defaultMode instanceof MapMode && ((MapMode)defaultMode).layerIsSupported(newLayer)) {
                mode = (MapMode) defaultMode;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.