本文整理汇总了Java中me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo类的典型用法代码示例。如果您正苦于以下问题:Java ProjectInfo类的具体用法?Java ProjectInfo怎么用?Java ProjectInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectInfo类属于me.ichun.mods.ichunutil.common.module.tabula.project包,在下文中一共展示了ProjectInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeProject
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void closeProject(String ident)
{
for(int i = projects.size() - 1; i >= 0; i--)
{
ProjectInfo info = projects.get(i);
if(info.identifier.equals(ident))
{
boolean flag = true;
Minecraft mc = Minecraft.getMinecraft();
if(mc.currentScreen instanceof GuiWorkspace)
{
GuiWorkspace workspace = (GuiWorkspace)mc.currentScreen;
flag = !workspace.wantToExit;
}
if(flag)
{
streamProjectClosure(ident);
}
projects.remove(i);
}
}
}
示例2: loadTexture
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void loadTexture(String ident, BufferedImage image, boolean updateDims)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(ident))
{
boolean changed = false;
info.bufferedTexture = image;
if(info.bufferedTexture != null && !(info.textureWidth == info.bufferedTexture.getWidth() && info.textureHeight == info.bufferedTexture.getHeight()) && updateDims)
{
changed = true;
info.textureWidth = info.bufferedTexture.getWidth();
info.textureHeight = info.bufferedTexture.getHeight();
}
if(changed)
{
streamProject(info);
}
streamProjectTexture(info.identifier, info.bufferedTexture);
}
}
}
示例3: setProjectMetadata
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void setProjectMetadata(String projIdent, String objIdent, ArrayList<String> meta, boolean isProjectMeta)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(projIdent))
{
if(isProjectMeta)
{
info.metadata = meta;
}
else
{
Object obj = info.getObjectByIdent(objIdent);
if(obj instanceof CubeInfo)
{
((CubeInfo)obj).metadata = meta;
}
else if(obj instanceof CubeGroup)
{
((CubeGroup)obj).metadata = meta;
}
}
streamProject(info);
}
}
}
示例4: editAnimation
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void editAnimation(String ident, String animIdent, String name, boolean loops)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(ident))
{
for(Animation anim : info.anims)
{
if(anim.identifier.equals(animIdent))
{
anim.name = name;
anim.loops = loops;
streamProject(info);
}
}
}
}
}
示例5: deleteAnimation
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void deleteAnimation(String ident, String animIdent)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(ident))
{
for(int i = info.anims.size() - 1; i >= 0; i--)
{
if(info.anims.get(i).identifier.equals(animIdent))
{
info.anims.remove(i);
streamProject(info);
}
}
}
}
}
示例6: createNewAnimComponent
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void createNewAnimComponent(String ident, String animIdent, String cubeIdent, String name, int animLength, int startPos)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(ident))
{
for(Animation anim : info.anims)
{
if(anim.identifier.equals(animIdent))
{
anim.createAnimComponent(cubeIdent, name, animLength, startPos);
streamProject(info);
}
}
}
}
}
示例7: toggleAnimComponentVisibility
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void toggleAnimComponentVisibility(String ident, String animIdent, String compIdent)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(ident))
{
for(Animation anim : info.anims)
{
if(anim.identifier.equals(animIdent))
{
for(Map.Entry<String, ArrayList<AnimationComponent>> e : anim.sets.entrySet())
{
for(AnimationComponent comp : e.getValue())
{
if(comp.identifier.equals(compIdent))
{
comp.hidden = !comp.hidden;
streamProject(info);
}
}
}
}
}
}
}
}
示例8: copyGroupTo
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void copyGroupTo(String projIdent, String groupIdent, boolean inPlace)
{
CubeGroup group = null;
ProjectInfo project = null;
for(ProjectInfo info : projects)
{
if(info.identifier.equals(projIdent))
{
project = info;
}
if(group == null)
{
group = (CubeGroup)info.getObjectByIdent(groupIdent);
}
}
if(project != null && group != null)
{
//can't just add, groups and cubes have unique identifiers.
CubeGroup group1 = new CubeGroup(group.name);
project.cubeGroups.add(group1);
cloneGroups(group, group1, inPlace);
streamProject(project);
}
}
示例9: setGroupVisibility
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public void setGroupVisibility(String projIdent, String groupIdent, boolean hidden)
{
for(ProjectInfo info : projects)
{
if(info.identifier.equals(projIdent))
{
CubeGroup group = (CubeGroup)info.getObjectByIdent(groupIdent);
if(group != null)
{
group.hidden = hidden;
}
streamProject(info);
}
}
}
示例10: updateProjectTexture
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void updateProjectTexture(String ident, BufferedImage image)
{
Minecraft mc = Minecraft.getMinecraft();
if(mc.currentScreen instanceof GuiWorkspace)
{
GuiWorkspace workspace = (GuiWorkspace)mc.currentScreen;
for(ProjectInfo project : workspace.projectManager.projects)
{
if(project.identifier.equals(ident))
{
if(project.ignoreNextImage)
{
project.ignoreNextImage = false; //received texture you've just set;
}
else if(project.textureFile != null)
{
project.textureFile = null; //texture file updated for other reasons.. no longer yours. Stop listening.
}
project.bufferedTexture = image;
}
}
}
}
示例11: elementTriggered
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
@Override
public void elementTriggered(Element element)
{
if(element.id == 0)
{
workspace.removeWindow(this, true);
}
if(element.id == 3)
{
if(workspace.windowDragged == this)
{
workspace.windowDragged = null;
}
if(ProjectInfo.saveProject(project, saveFile))
{
project.saveFile = saveFile;
project.saveFileMd5 = IOUtil.getMD5Checksum(saveFile);
parentWindow.shouldClose = true;
}
else
{
workspace.addWindowOnTop(new WindowPopup(workspace, 0, 0, 180, 80, 180, 80, "window.saveAs.failed").putInMiddleOfScreen());
}
workspace.removeWindow(this, true);
}
}
示例12: WindowEditProject
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public WindowEditProject(IWorkspace parent, int x, int y, int w, int h, int minW, int minH)
{
super(parent, x, y, w, h, minW, minH, "window.editProject.title", true);
ProjectInfo project = ((GuiWorkspace)workspace).projectManager.projects.get(((GuiWorkspace)workspace).projectManager.selectedProject);
ElementTextInput text1 = new ElementTextInput(this, 10, 30, width - 20, 12, 1, "window.newProject.projIdent");
text1.textField.setText(project.modelName);
elements.add(text1);
ElementTextInput text2 = new ElementTextInput(this, 10, 65, width - 20, 12, 2, "window.newProject.animName");
text2.textField.setText(project.authorName);
elements.add(text2);
ElementNumberInput nums = new ElementNumberInput(this, 10, 100, 80, 12, 3, "window.newProject.txDimensions", 2, false, 0, (int)Short.MAX_VALUE);
nums.textFields.get(0).setText(Integer.toString(project.textureWidth));
nums.textFields.get(1).setText(Integer.toString(project.textureHeight));
elements.add(nums);
ElementNumberInput scale = new ElementNumberInput(this, 10, 135, 120, 12, 4, "window.newProject.projectScale", 3, true, (int)Short.MIN_VALUE, (int)Short.MAX_VALUE);
scale.textFields.get(0).setText(String.format(Locale.ENGLISH, "%.2f", project.scale[0]));
scale.textFields.get(1).setText(String.format(Locale.ENGLISH, "%.2f", project.scale[1]));
scale.textFields.get(2).setText(String.format(Locale.ENGLISH, "%.2f", project.scale[2]));
elements.add(scale);
elements.add(new ElementButton(this, (width - 80) / 2, height - 55, 80, 12, -5, false, 2, 1, "window.metadata.titleShort"));
elements.add(new ElementButton(this, width - 140, height - 30, 60, 16, 100, false, 1, 1, "element.button.ok"));
elements.add(new ElementButton(this, width - 70, height - 30, 60, 16, 0, false, 1, 1, "element.button.cancel"));
}
示例13: elementTriggered
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
@Override
public void elementTriggered(Element element)
{
if(element.id == 1)
{
workspace.addWindowOnTop(new WindowLoadTexture(workspace, workspace.width / 2 - 130, workspace.height / 2 - 160, 260, 320, 240, 160));
}
if(element.id == 2)
{
if(!((GuiWorkspace)workspace).projectManager.projects.isEmpty())
{
ProjectInfo info = ((GuiWorkspace)workspace).projectManager.projects.get(((GuiWorkspace)workspace).projectManager.selectedProject);
if(info.bufferedTexture != null)
{
if(!((GuiWorkspace)workspace).remoteSession)
{
Tabula.proxy.tickHandlerClient.mainframe.clearTexture(info.identifier);
}
else if(!((GuiWorkspace)workspace).sessionEnded && ((GuiWorkspace)workspace).isEditor)
{
Tabula.channel.sendToServer(new PacketClearTexture(((GuiWorkspace)workspace).host, info.identifier));
}
}
}
}
}
示例14: WindowSaveAs
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
public WindowSaveAs(IWorkspace parent, int x, int y, int w, int h, int minW, int minH, boolean close)
{
super(parent, x, y, w, h, minW, minH, "window.saveAs.title", true);
ProjectInfo project = ((GuiWorkspace)workspace).projectManager.projects.get(((GuiWorkspace)workspace).projectManager.selectedProject);
ElementTextInputSaveAs text = new ElementTextInputSaveAs(this, 10, 30, width - 20, 12, 1, "window.saveAs.fileName");
String name = project.modelName;
name = name.replaceAll("[^A-Za-z0-9()\\[\\]]", "");
text.textField.setText(name);
elements.add(text);
elements.add(new ElementButton(this, width - 140, height - 30, 60, 16, 3, false, 1, 1, "element.button.ok"));
elements.add(new ElementButton(this, width - 70, height - 30, 60, 16, 0, false, 1, 1, "element.button.cancel"));
closeProject = close;
}
示例15: export
import me.ichun.mods.ichunutil.common.module.tabula.project.ProjectInfo; //导入依赖的package包/类
@Override
public boolean export(ProjectInfo info, Object... params)
{
if(info.bufferedTexture == null)
{
return false;
}
File file = new File(ResourceHelper.getExportsDir(), info.modelName + "-texture.png");
try
{
ImageIO.write(info.bufferedTexture, "png", file);
return true;
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
return false;
}
}