本文整理汇总了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);
}
示例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;
}
示例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();
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
}
示例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");
}
示例10: UserWidget
import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
public UserWidget(ResourceLoader resources, ImageRepository<IUserType> skinRepository) {
this.skinRepository = skinRepository;
initComponents(resources);
}
示例11: shouldDownloadImage
import net.technicpack.launchercore.auth.IUserType; //导入依赖的package包/类
@Override
public boolean shouldDownloadImage(IUserType imageKey) {
return true;
}
示例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");
}