@Nullable
    public PrintStream out() {
        return _out;
    }

package com.analog.lyric.dimple.events;

import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.eclipse.jdt.annotation.Nullable;
import com.analog.lyric.dimple.environment.DimpleEnvironment;
import com.analog.lyric.dimple.environment.IDimpleEnvironmentHolder;

/**
 * Provides basic logging of dimple events.
 *

 * This class provides a simpler interface for than {@link DimpleEventListener} when
 * you only want to print the text of events to an output stream.
 *

 * For instance, to log all dimple events to stderr for a graph {@code fg}, you only need to write:
 *

 *     DimpleEventLogger logger = new DimpleEventLogger();
 *     logger.log(DimpleEvent.class, fg);
 *

 * and to write to a specified file instead, you just need to open the logger with the
 * given file, as in:
 *

 *     logger.open(new File("events.log"));
 *

 *
 * The event logger will use the existing {@link DimpleEventListener} that is associated
 * with the root graph of each event source, if it has been set. Otherwise, it will automatically
 * set the root graph to use the listener {@link DimpleEventListener#getDefault()}.
 *
 * @since 0.06
 * @author Christopher Barber
 */
@ThreadSafe
public class DimpleEventLogger implements Closeable, IDimpleEnvironmentHolder {

    private final DimpleEnvironment _env;

    /**
     * Events will be printed on this stream, if non-null.
     */
    @GuardedBy("this")
    @Nullable
    private volatile PrintStream _out;

    /**
     * The file used for {@link #_out}, if opened by {@link #open(File)}.
     */
    @GuardedBy("this")
    @Nullable
    private volatile File _file = null;

    private volatile int _verbosity;

    private final DimpleEventHandler<DimpleEvent> _handler = new EventPrinter();

    @GuardedBy("this")
    private final Set<LogEntry> _logEntries = new HashSet<LogEntry>();

    private class EventPrinter extends DimpleEventHandler<DimpleEvent> {

        @Override
        public void handleEvent(DimpleEvent event) {
            PrintStream out = _out;
            if (out != null) {
                event.println(out, _verbosity);
                out.flush();
            }
        }
    }

    /**
     * A simple pairing of event source and event type.
     *

     * @see DimpleEventLogger#logEntries()
     * @since 0.06
     */
    public static class LogEntry {

        private final Class<? extends DimpleEvent> _eventClass;

        private final IDimpleEventSource _eventSource;

        private LogEntry(Class<? extends DimpleEvent> eventType, IDimpleEventSource eventSource) {
            _eventClass = eventType;
            _eventSource = eventSource;
        }

        @Override
        public boolean equals(@Nullable Object other) {
            if (this == other) {
                return true;
            }
            if (other instanceof LogEntry) {
                LogEntry that = (LogEntry) other;
                return this._eventClass == that._eventClass && this._eventSource == that._eventSource;
            }
            return false;
        }

        @Override
        public int hashCode() {
            return _eventClass.hashCode() * 11 + _eventSource.hashCode();
        }

        public Class<? extends DimpleEvent> eventClass() {
            return _eventClass;
        }

        public IDimpleEventSource eventSource() {
            return _eventSource;
        }
    }

    /**
     * Constructs logger with output going to {@link System#err} and
     * {@link #verbosity()} set to zero.
     *

     * The {@linkplain #getEnvironment environment} will be set to the
     * {@linkplain DimpleEnvironment#active active environment}.
     *

     * @since 0.06
     */
    public DimpleEventLogger() {
        _env = DimpleEnvironment.active();
        _out = System.err;
        _verbosity = 0;
    }

    /**
     * Closes underlying stream.
     *

     * If {@link #out()} is non-null, closes it if not one of {@link System#out} or {@link System#err},
     * and then sets to null.
     */
    @Override
    public synchronized void close() {
        final PrintStream out = _out;
        if (out != null) {
            if (out != System.out && out != System.err) {
                out.close();
            }
            _out = null;
        }
    }

    @Override
    public DimpleEnvironment getEnvironment() {
        return _env;
    }

    /**
     * File last used by {@link #open(File)} or null if last opened by {@link #open(PrintStream)}.
     *
     * @since 0.06
     */
    @Nullable
    public File file() {
        return _file;
    }

    /**
     * True if object is known to not have any active log entries, no calls have been made
     * to {@link #log(Class, IDimpleEventSource...)} since object was created or last call
     * to {@link #clear()}.
     *
     * @since 0.06
     */
    public synchronized boolean isClear() {
        return _logEntries.isEmpty();
    }

    public boolean isOpen() {
        return _out != null;
    }

    /**
     * Enable logging of given event type on specified targets.
     *

     * Enables logging by registering an event handler with the event listener of the
     * {@linkplain #getEnvironment() environment} creating a new one if necessary. It
     * is assumed that all of the listed {@code sources} have the same environment.
     *

     * @param eventType is the superclass of the type of events that will be logged. If {@code eventType}
     * is abstract then all subtypes will be logged, otherwise only that specific type will be logged.
     * @param sources lists the objects that should log events. This will affect both those objects and their
     * children unless blocked.
     * @since 0.06
     */
    public synchronized void log(Class<? extends DimpleEvent> eventType, IDimpleEventSource... sources) {
        final DimpleEventListener listener = _env.createEventListener();
        for (IDimpleEventSource source : sources) {
            listener.register(_handler, eventType, source);
            _logEntries.add(new LogEntry(eventType, source));
        }
    }

    /**
     * Returns newly created list of current log entries for this object in no particular order.
     *
     * @since 0.06
     */
    public synchronized List<LogEntry> logEntries() {
        return new ArrayList<LogEntry>(_logEntries);
    }

    /**
     * Removes log configuration of given event type on specified targets.
     *

     * Note that this will only remove logging set up for the same {@code eventType} and source combination.
     * It will not block logging when {@link #log(Class, IDimpleEventSource...)} was called on a parent
     * object of the source.
     *

     * @param eventType is type used in a previous call to {@link #log}.
     * @param sources are one or more sources previously used with {@code eventType} in a previous call
     * to {@link #log}.
     * @return the number of log entries that were removed by this call.
     * @since 0.06
     */
    public synchronized int unlog(Class<? extends DimpleEvent> eventType, IDimpleEventSource... sources) {
        int nRemoved = 0;
        DimpleEventListener listener = _env.getEventListener();
        if (listener != null) {
            for (IDimpleEventSource source : sources) {
                _logEntries.remove(new LogEntry(eventType, source));
                if (listener.unregister(_handler, eventType, source)) {
                    ++nRemoved;
                }
            }
            if (listener.isEmpty()) {
                // Remove the listener from the environment if it contains no more entries.
                _env.setEventListener(null);
            }
        }
        return nRemoved;
    }

    /**
     * Directs log output to append to file.
     *

     * Invokes {@link #close()} before opening new file.
     *

     * @param file is non-null file that will be opened in append mode.
     * @throws FileNotFoundException
     * @since 0.06
     * @see #open(File, boolean)
     */
    public void open(File file) throws FileNotFoundException {
        open(file, true);
    }

    /**
     * Directs log output to a file.
     *

     * Invokes {@link #close()} before opening new file.
     *

     * @param file is non-null file that will be opened in append mode.
     * @param append indicates whether to append to the file or overwrite the existing contents.
     * @throws FileNotFoundException
     * @since 0.06
     * @see #open(File)
     * @see #open(PrintStream)
     */
    public synchronized void open(File file, boolean append) throws FileNotFoundException {
        close();
        _out = new PrintStream(new FileOutputStream(file, append));
        _file = file;
    }

    /**
     * Directs log output to given stream.
     *
     * @param out
     * @since 0.06
     * @see #open(File)
     * @see #open(File, boolean)
     */
    public synchronized void open(PrintStream out) {
        close();
        _out = out;
        _file = null;
    }

    /**
     * Clears all logging handlers controlled by this object.
     *
     * @since 0.06
     */
    public synchronized void clear() {
        DimpleEventListener listener = _env.getEventListener();
        if (listener != null) {
            for (LogEntry entry : _logEntries) {
                listener.unregister(_handler, entry.eventClass(), entry.eventSource());
            }
            if (listener.isEmpty()) {
                _env.setEventListener(null);
            }
        }
        _logEntries.clear();
    }

    /**
     * The current stream used for logging. May be null.
     * @since 0.06
     */

    /**
     * The verbosity of logged events.
     * <p>
     * This is the value that will be passed to {@link DimpleEvent#println(PrintStream, int)}
     * when output an event.
     *
     * @since 0.06
     */
    public int verbosity() {
        return _verbosity;
    }

    /**
     * Sets the value of {@link #verbosity()} to the specified value.
     * @since 0.06
     */
    public void verbosity(int verbosity) {
        _verbosity = verbosity;
    }
}


public ListISOsOptions isNotReady() {
        this.queryParameters.replaceValues("isready", FALSE);
        return this;
    }

package org.jclouds.cloudstack.options;

import java.util.Map;
import java.util.Set;
import org.jclouds.cloudstack.domain.ISO;
import com.google.common.collect.ImmutableSet;

/**
 * Options for the ISO listISOs method.
 *
 * @see org.jclouds.cloudstack.features.ISOApi#listISOs
 * @see org.jclouds.cloudstack.features.ISOApi#listISOs
 */
public class ListISOsOptions extends AccountInDomainOptions {

    public static final ListISOsOptions NONE = new ListISOsOptions();

    private static final Set<String> TRUE = ImmutableSet.of(Boolean.toString(true));

    private static final Set<String> FALSE = ImmutableSet.of(Boolean.toString(false));

    /**
     * the ISO is bootable
     */
    public ListISOsOptions bootable() {
        this.queryParameters.replaceValues("bootable", TRUE);
        return this;
    }

    /**
     * the ISO is bootable
     */
    public ListISOsOptions notBootable() {
        this.queryParameters.replaceValues("bootable", FALSE);
        return this;
    }

    /**
     * @param hypervisor the hypervisor for which to restrict the search
     */
    public ListISOsOptions hypervisor(String hypervisor) {
        this.queryParameters.replaceValues("hypervisor", ImmutableSet.of(hypervisor));
        return this;
    }

    /**
     * @param id list all isos by id
     */
    public ListISOsOptions id(String id) {
        this.queryParameters.replaceValues("id", ImmutableSet.of(id));
        return this;
    }

    /**
     * @param projectId list ISOs in the given project
     */
    public ListISOsOptions projectId(String projectId) {
        this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + ""));
        return this;
    }

    /**
     * @param isoFilter possible values are "featured", "self", "self-executable","executable", and "community".
     */
    public ListISOsOptions isoFilter(ISO.ISOFilter isoFilter) {
        this.queryParameters.replaceValues("isofilter", ImmutableSet.of(isoFilter.name()));
        return this;
    }

    /**
     * the ISO is publicly available to all users
     */
    public ListISOsOptions isPublic() {
        this.queryParameters.replaceValues("ispublic", TRUE);
        return this;
    }

    /**
     * the ISO is not publicly available to all users
     */
    public ListISOsOptions isPrivate() {
        this.queryParameters.replaceValues("ispublic", FALSE);
        return this;
    }

    /**
     * this ISO is ready to be deployed
     */
    public ListISOsOptions isReady() {
        this.queryParameters.replaceValues("isready", TRUE);
        return this;
    }

    /**
     * this ISO is not ready to be deployed
     */

    /**
     * @param keyword List by keyword
     */
    public ListISOsOptions keyword(String keyword) {
        this.queryParameters.replaceValues("keyword", ImmutableSet.of(keyword));
        return this;
    }

    /**
     * @param name list all isos by name
     */
    public ListISOsOptions name(String name) {
        this.queryParameters.replaceValues("name", ImmutableSet.of(name));
        return this;
    }

    /**
     * @param zoneId the ID of the zone
     */
    public ListISOsOptions zoneId(String zoneId) {
        this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId));
        return this;
    }

    /**
     * @param tags
     *           Key/value pairs for tags that need to be matched.
     */
    public ListISOsOptions tags(Map<String, String> tags) {
        int count = 0;
        for (Map.Entry<String, String> entry : tags.entrySet()) {
            this.queryParameters.replaceValues(String.format("tags[%d].key", count), ImmutableSet.of(entry.getKey()));
            this.queryParameters.replaceValues(String.format("tags[%d].value", count), ImmutableSet.of(entry.getValue()));
            count += 1;
        }
        return this;
    }

    public static class Builder {

        /**
         * @param account the account of the ISO file. Must be used with the domainId parameter.
         */
        public static ListISOsOptions accountInDomain(String account, String domainId) {
            return (ListISOsOptions) new ListISOsOptions().accountInDomain(account, domainId);
        }

        /**
         * the ISO is bootable
         */
        public static ListISOsOptions bootable() {
            return new ListISOsOptions().bootable();
        }

        /**
         * the ISO is bootable
         */
        public static ListISOsOptions notBootable() {
            return new ListISOsOptions().notBootable();
        }

        /**
         * @param domainId lists all available ISO files by ID of a domain. If used with the account parameter, lists all available ISO files for the account in the ID of a domain.
         */
        public static ListISOsOptions domainId(String domainId) {
            return (ListISOsOptions) new ListISOsOptions().domainId(domainId);
        }

        /**
         * @param hypervisor the hypervisor for which to restrict the search
         */
        public static ListISOsOptions hypervisor(String hypervisor) {
            return new ListISOsOptions().hypervisor(hypervisor);
        }

        /**
         * @param id list all isos by id
         */
        public static ListISOsOptions id(String id) {
            return new ListISOsOptions().id(id);
        }

        /**
         * @param projectId list ISOs in project
         */
        public static ListISOsOptions projectId(String projectId) {
            return new ListISOsOptions().projectId(projectId);
        }

        /**
         * @param isoFilter possible values are "featured", "self", "self-executable","executable", and "community".
         */
        public static ListISOsOptions isoFilter(ISO.ISOFilter isoFilter) {
            return new ListISOsOptions().isoFilter(isoFilter);
        }

        /**
         * the ISO is publicly available to all users
         */
        public static ListISOsOptions isPublic() {
            return new ListISOsOptions().isPublic();
        }

        /**
         * the ISO is not publicly available to all users
         */
        public static ListISOsOptions isPrivate() {
            return new ListISOsOptions().isPrivate();
        }

        /**
         * this ISO is ready to be deployed
         */
        public static ListISOsOptions isReady() {
            return new ListISOsOptions().isReady();
        }

        /**
         * this ISO is not ready to be deployed
         */
        public static ListISOsOptions isNotReady() {
            return new ListISOsOptions().isNotReady();
        }

        /**
         * @param keyword List by keyword
         */
        public static ListISOsOptions keyword(String keyword) {
            return new ListISOsOptions().keyword(keyword);
        }

        /**
         * @param name list all isos by name
         */
        public static ListISOsOptions name(String name) {
            return new ListISOsOptions().name(name);
        }

        /**
         * @param zoneId the ID of the zone
         */
        public static ListISOsOptions zoneId(String zoneId) {
            return new ListISOsOptions().zoneId(zoneId);
        }

        /**
         * @param tags
         */
        public static ListISOsOptions tags(Map<String, String> tags) {
            return new ListISOsOptions().tags(tags);
        }
    }
}


public void clearLoadedMaps() {
        for (MapItemRenderer.Instance mapitemrenderer$instance : this.loadedMaps.values()) {
            this.textureManager.deleteTexture(mapitemrenderer$instance.location);
        }
        this.loadedMaps.clear();
    }

package net.minecraft.client.gui;

import com.google.common.collect.Maps;
import java.util.Map;
import net.minecraft.block.material.MapColor;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec4b;
import net.minecraft.world.storage.MapData;

public class MapItemRenderer {

    private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png");

    private final TextureManager textureManager;

    private final Map<String, MapItemRenderer.Instance> loadedMaps = Maps.<String, MapItemRenderer.Instance>newHashMap();

    public MapItemRenderer(TextureManager textureManagerIn) {
        this.textureManager = textureManagerIn;
    }

    /**
     * Updates a map texture
     */
    public void updateMapTexture(MapData mapdataIn) {
        this.getMapRendererInstance(mapdataIn).updateMapTexture();
    }

    public void renderMap(MapData mapdataIn, boolean p_148250_2_) {
        this.getMapRendererInstance(mapdataIn).render(p_148250_2_);
    }

    /**
     * Returns {@link net.minecraft.client.gui.MapItemRenderer.Instance MapItemRenderer.Instance} with given map data
     */
    private MapItemRenderer.Instance getMapRendererInstance(MapData mapdataIn) {
        MapItemRenderer.Instance mapitemrenderer$instance = (MapItemRenderer.Instance) this.loadedMaps.get(mapdataIn.mapName);
        if (mapitemrenderer$instance == null) {
            mapitemrenderer$instance = new MapItemRenderer.Instance(mapdataIn);
            this.loadedMaps.put(mapdataIn.mapName, mapitemrenderer$instance);
        }
        return mapitemrenderer$instance;
    }

    /**
     * Clears the currently loaded maps and removes their corresponding textures
     */

    class Instance {

        private final MapData mapData;

        private final DynamicTexture mapTexture;

        private final ResourceLocation location;

        private final int[] mapTextureData;

        private Instance(MapData mapdataIn) {
            this.mapData = mapdataIn;
            this.mapTexture = new DynamicTexture(128, 128);
            this.mapTextureData = this.mapTexture.getTextureData();
            this.location = MapItemRenderer.this.textureManager.getDynamicTextureLocation("map/" + mapdataIn.mapName, this.mapTexture);
            for (int i = 0; i < this.mapTextureData.length; ++i) {
                this.mapTextureData[i] = 0;
            }
        }

        private void updateMapTexture() {
            for (int i = 0; i < 16384; ++i) {
                int j = this.mapData.colors[i] & 255;
                if (j / 4 == 0) {
                    this.mapTextureData[i] = (i + i / 128 & 1) * 8 + 16 << 24;
                } else {
                    this.mapTextureData[i] = MapColor.mapColorArray[j / 4].func_151643_b(j & 3);
                }
            }
            this.mapTexture.updateDynamicTexture();
        }

        private void render(boolean noOverlayRendering) {
            int i = 0;
            int j = 0;
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            float f = 0.0F;
            MapItemRenderer.this.textureManager.bindTexture(this.location);
            GlStateManager.enableBlend();
            GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1);
            GlStateManager.disableAlpha();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
            worldrenderer.pos((double) ((float) (i + 0) + f), (double) ((float) (j + 128) - f), -0.009999999776482582D).tex(0.0D, 1.0D).endVertex();
            worldrenderer.pos((double) ((float) (i + 128) - f), (double) ((float) (j + 128) - f), -0.009999999776482582D).tex(1.0D, 1.0D).endVertex();
            worldrenderer.pos((double) ((float) (i + 128) - f), (double) ((float) (j + 0) + f), -0.009999999776482582D).tex(1.0D, 0.0D).endVertex();
            worldrenderer.pos((double) ((float) (i + 0) + f), (double) ((float) (j + 0) + f), -0.009999999776482582D).tex(0.0D, 0.0D).endVertex();
            tessellator.draw();
            GlStateManager.enableAlpha();
            GlStateManager.disableBlend();
            MapItemRenderer.this.textureManager.bindTexture(MapItemRenderer.mapIcons);
            int k = 0;
            for (Vec4b vec4b : this.mapData.mapDecorations.values()) {
                if (!noOverlayRendering || vec4b.func_176110_a() == 1) {
                    GlStateManager.pushMatrix();
                    GlStateManager.translate((float) i + (float) vec4b.func_176112_b() / 2.0F + 64.0F, (float) j + (float) vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F);
                    GlStateManager.rotate((float) (vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F);
                    GlStateManager.scale(4.0F, 4.0F, 3.0F);
                    GlStateManager.translate(-0.125F, 0.125F, 0.0F);
                    byte b0 = vec4b.func_176110_a();
                    float f1 = (float) (b0 % 4 + 0) / 4.0F;
                    float f2 = (float) (b0 / 4 + 0) / 4.0F;
                    float f3 = (float) (b0 % 4 + 1) / 4.0F;
                    float f4 = (float) (b0 / 4 + 1) / 4.0F;
                    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
                    float f5 = -0.001F;
                    worldrenderer.pos(-1.0D, 1.0D, (double) ((float) k * -0.001F)).tex((double) f1, (double) f2).endVertex();
                    worldrenderer.pos(1.0D, 1.0D, (double) ((float) k * -0.001F)).tex((double) f3, (double) f2).endVertex();
                    worldrenderer.pos(1.0D, -1.0D, (double) ((float) k * -0.001F)).tex((double) f3, (double) f4).endVertex();
                    worldrenderer.pos(-1.0D, -1.0D, (double) ((float) k * -0.001F)).tex((double) f1, (double) f4).endVertex();
                    tessellator.draw();
                    GlStateManager.popMatrix();
                    ++k;
                }
            }
            GlStateManager.pushMatrix();
            GlStateManager.translate(0.0F, 0.0F, -0.04F);
            GlStateManager.scale(1.0F, 1.0F, 1.0F);
            GlStateManager.popMatrix();
        }
    }
}


package com.jkb.commonlib.base.frame;

/**
 * View基类
 * Created by yj on 2017/5/5.
 */
public interface BaseView<T extends BasePresenter> {

    boolean isActive();

    /**
     * 显示Toast
     */

    /**
     * 注入P层
     */
    void setPresenter(T presenter);
}