当前位置: 首页>>代码示例>>Java>>正文


Java IUserType类代码示例

本文整理汇总了Java中net.technicpack.launchercore.auth.IUserType的典型用法代码示例。如果您正苦于以下问题:Java IUserType类的具体用法?Java IUserType怎么用?Java IUserType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IUserType类属于net.technicpack.launchercore.auth包,在下文中一共展示了IUserType类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UserCellEditor

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public UserCellEditor(Font font, ImageRepository<IUserType> skinRepo, Color textColor) {
    this.textFont = font;
    this.mSkinRepo = skinRepo;

    layout = new CardLayout();

    parentPanel = new JPanel();
    parentPanel.setLayout(layout);
    parentPanel.setOpaque(false);

    userLabel = new JLabel();
    userLabel.setOpaque(false);
    userLabel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
    userLabel.setFont(textFont);
    userLabel.setForeground(textColor);
    parentPanel.add(userLabel, USER);

    textField = new JTextField();
    textField.setOpaque(false);
    textField.setFont(textFont);
    textField.setBorder(null);
    textField.setForeground(textColor);
    textField.getDocument().addDocumentListener(this);
    textField.setCaretColor(textColor);
    parentPanel.add(textField, STRING);
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:27,代码来源:UserCellEditor.java

示例2: getListCellRendererComponent

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

    if (value instanceof IUserType) {
        IUserType mojangUser = (IUserType) value;
        this.setText(mojangUser.getDisplayName());
        this.setIconTextGap(8);

        if (!headMap.containsKey(mojangUser.getUsername())) {
            ImageJob<IUserType> job = mSkinRepo.startImageJob(mojangUser);
            job.addJobListener(this);
            headMap.put(mojangUser.getUsername(), new ImageIcon(ImageUtils.scaleImage(job.getImage(), ICON_WIDTH, ICON_HEIGHT)));
        }

        Icon head = headMap.get(mojangUser.getUsername());

        if (head != null) {
            this.setIcon(head);
        }
    } else if (value == null) {
        this.setText("Add New User");
        this.setIconTextGap(8);

        if (addUserIcon != null) {
            this.setIcon(addUserIcon);
        }
    } else {
        this.setIconTextGap(0);
        this.setText(value.toString());
    }

    return this;
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:35,代码来源:UserCellRenderer.java

示例3: jobComplete

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public void jobComplete(ImageJob<IUserType> job) {
    IUserType mojangUser = job.getJobData();
    if (headMap.containsKey(mojangUser.getUsername()))
        headMap.remove(mojangUser.getUsername());

    headMap.put(mojangUser.getUsername(), new ImageIcon(ImageUtils.scaleImage(job.getImage(), ICON_WIDTH, ICON_HEIGHT)));

    this.invalidate();
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:11,代码来源:UserCellRenderer.java

示例4: setItem

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public void setItem(Object anObject) {
    currentObject = anObject;

    if (anObject instanceof IUserType) {
        IUserType mojangUser = (IUserType)anObject;
        userLabel.setText(mojangUser.getDisplayName());
        userLabel.setIconTextGap(8);

        if (!headMap.containsKey(mojangUser.getUsername())) {
            ImageJob<IUserType> job = mSkinRepo.startImageJob(mojangUser);
            job.addJobListener(this);
            headMap.put(mojangUser.getUsername(), new ImageIcon(ImageUtils.scaleImage(job.getImage(), ICON_WIDTH, ICON_HEIGHT)));
        }

        Icon head = headMap.get(mojangUser.getUsername());
        userLabel.setIcon(head);

        layout.show(parentPanel, USER);
    } else {
        String newText = "";

        if (anObject != null) {
            newText = anObject.toString();
        }

        if (!textField.getText().equals(newText))
            textField.setText(newText);

        layout.show(parentPanel, STRING);
        textField.requestFocus();
    }
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:34,代码来源:UserCellEditor.java

示例5: jobComplete

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public void jobComplete(ImageJob<IUserType> job) {
    IUserType mojangUser = job.getJobData();
    if (headMap.containsKey(mojangUser.getUsername()))
        headMap.remove(mojangUser.getUsername());

    headMap.put(mojangUser.getUsername(), new ImageIcon(ImageUtils.scaleImage(job.getImage(), ICON_WIDTH, ICON_HEIGHT)));
    this.parentPanel.revalidate();
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:10,代码来源:UserCellEditor.java

示例6: LauncherFrame

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public LauncherFrame(final ResourceLoader resources, final ImageRepository<IUserType> skinRepository, final UserModel userModel, final TechnicSettings settings, final ModpackSelector modpackSelector, final ImageRepository<ModpackModel> iconRepo, final ImageRepository<ModpackModel> logoRepo, final ImageRepository<ModpackModel> backgroundRepo, final Installer installer, final ImageRepository<AuthorshipInfo> avatarRepo, final IPlatformApi platformApi, final LauncherDirectories directories, final IInstalledPackRepository packRepository, final StartupParameters params, final DiscoverInfoPanel discoverInfoPanel, final JavaVersionRepository javaVersions, final FileJavaSource fileJavaSource, final IBuildNumber buildNumber, final IDiscordApi discordApi) {
    setSize(FRAME_WIDTH, FRAME_HEIGHT);
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setTitle("Technic Launcher");

    this.userModel = userModel;
    this.skinRepository = skinRepository;
    this.settings = settings;
    this.modpackSelector = modpackSelector;
    this.iconRepo = iconRepo;
    this.logoRepo = logoRepo;
    this.backgroundRepo = backgroundRepo;
    this.installer = installer;
    this.avatarRepo = avatarRepo;
    this.platformApi = platformApi;
    this.directories = directories;
    this.packRepo = packRepository;
    this.params = params;
    this.discoverInfoPanel = discoverInfoPanel;
    this.fileJavaSource = fileJavaSource;
    this.javaVersions = javaVersions;
    this.buildNumber = buildNumber;
    this.discordApi = discordApi;

    //Handles rebuilding the frame, so use it to build the frame in the first place
    relocalize(resources);

    selectTab("discover");

    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            LauncherMain.consoleFrame.setVisible(settings.getShowConsole());
        }
    });

    setLocationRelativeTo(null);
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:39,代码来源:LauncherFrame.java

示例7: LoginFrame

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public LoginFrame(ResourceLoader resources, TechnicSettings settings, UserModel userModel, ImageRepository<IUserType> skinRepository) {
    this.skinRepository = skinRepository;
    this.userModel = userModel;
    this.settings = settings;

    setSize(FRAME_WIDTH, FRAME_HEIGHT);
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    getContentPane().setBackground(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);

    this.setFocusTraversalPolicy(new SortingFocusTraversalPolicy(new Comparator<Component>() {
        @Override
        public int compare(Component o1, Component o2) {
            //This long stupid stack of else/ifs enforces a tab order of
            //Username -> Password -> Remember me -> any buttons -> everything else who cares
            if (o1 == name || o1 == nameSelect)
                return -1;
            else if (o2 == name || o2 == nameSelect)
                return 1;
            else if (o1 == password)
                return -1;
            else if (o2 == password)
                return 1;
            else if (o1 == rememberAccount)
                return -1;
            else if (o2 == rememberAccount)
                return 1;
            else if (o1 instanceof AbstractButton)
                return -1;
            else if (o2 instanceof AbstractButton)
                return 1;
            else
                return 0;
        }
    }));

    //Handles rebuilding the frame, so use it to build the frame in the first place
    relocalize(resources);

    setLocationRelativeTo(null);
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:41,代码来源:LoginFrame.java

示例8: userChanged

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public void userChanged(IUserType user) {
    if (filterContents.getText().length() > 0)
        filterContents.setText("");
    else
        detectFilterChanges();

    if (user != null) {
        ArrayList<IPackSource> sources = new ArrayList<IPackSource>(1);
        sources.add(technicSolder);
        defaultPacks.addPassthroughContainer(this);
        packLoader.createRepositoryLoadJob(defaultPacks, sources, null, true);
    }
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:15,代码来源:ModpackSelector.java

示例9: UserCellRenderer

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public UserCellRenderer(ResourceLoader resources, ImageRepository<IUserType> skinRepo) {
    this.mSkinRepo = skinRepo;
    addUserIcon = resources.getIcon("add_user.png");
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:5,代码来源:UserCellRenderer.java

示例10: UserWidget

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public UserWidget(ResourceLoader resources, ImageRepository<IUserType> skinRepository) {
    this.skinRepository = skinRepository;

    initComponents(resources);
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:6,代码来源:UserWidget.java

示例11: shouldDownloadImage

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public boolean shouldDownloadImage(IUserType imageKey) {
    return true;
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:5,代码来源:TechnicFaceMapper.java

示例12: getImageLocation

import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public File getImageLocation(IUserType imageKey) {
    return new File(directories.getAssetsDirectory(), "avatars" + File.separator + imageKey.getDisplayName() + ".png");
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:5,代码来源:TechnicFaceMapper.java


注:本文中的net.technicpack.launchercore.auth.IUserType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。