當前位置: 首頁>>代碼示例>>Java>>正文


Java Theme類代碼示例

本文整理匯總了Java中me.ichun.mods.ichunutil.client.gui.Theme的典型用法代碼示例。如果您正苦於以下問題:Java Theme類的具體用法?Java Theme怎麽用?Java Theme使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Theme類屬於me.ichun.mods.ichunutil.client.gui包,在下文中一共展示了Theme類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawCompElement

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
public void drawCompElement(String name, int offY, boolean isSelected, boolean isHidden, boolean hover)
{
    RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementTreeItemBorder[0], parent.workspace.currentTheme.elementTreeItemBorder[1], parent.workspace.currentTheme.elementTreeItemBorder[2], 255, getPosX(), getPosY() + offY, buttonsWidth - 1, 13, 0);

    if(isSelected)
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementTreeItemBgSelect[0], parent.workspace.currentTheme.elementTreeItemBgSelect[1], parent.workspace.currentTheme.elementTreeItemBgSelect[2], 255, getPosX() + 1, getPosY() + offY + 1, buttonsWidth - 1 - 2, 13 - 2, 0);
    }
    else if(hover)
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementTreeItemBgHover[0], parent.workspace.currentTheme.elementTreeItemBgHover[1], parent.workspace.currentTheme.elementTreeItemBgHover[2], 255, getPosX() + 1, getPosY() + offY + 1, buttonsWidth - 1 - 2, 13 - 2, 0);
    }
    else
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementTreeItemBg[0], parent.workspace.currentTheme.elementTreeItemBg[1], parent.workspace.currentTheme.elementTreeItemBg[2], 255, getPosX() + 1, getPosY() + offY + 1, buttonsWidth - 1 - 2, 13 - 2, 0);
    }
    if(isHidden)
    {
        parent.workspace.getFontRenderer().drawString(parent.workspace.reString(name, buttonsWidth - 1), getPosX() + 4, getPosY() + offY + 2, Theme.getAsHex(parent.workspace.currentTheme.fontDim), false);
    }
    else
    {
        parent.workspace.getFontRenderer().drawString(parent.workspace.reString(name, buttonsWidth - 1), getPosX() + 4, getPosY() + offY + 2, Theme.getAsHex(parent.workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:26,代碼來源:ElementTimeline.java

示例2: drawText

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void drawText(int mouseX, int mouseY, boolean hover)
{
    GlStateManager.pushMatrix();
    for(int i = 0; i < text.size(); i++)
    {
        String msg = text.get(i);

        List list = parent.workspace.getFontRenderer().listFormattedStringToWidth(msg, width - 12);

        boolean onName = true;
        for(int j = 0; j < list.size(); j++)
        {
            String[] strings = ((String)list.get(j)).split(": ");
            parent.workspace.getFontRenderer().drawString(strings[0], getPosX() + (j == 0 ? 4 : 12), getPosY() + 4, onName ? getRandomColourForName(strings[0]) : Theme.getAsHex(parent.workspace.currentTheme.fontChat), false);
            if(strings.length > 1)
            {
                onName = false;
                parent.workspace.getFontRenderer().drawString(": " + strings[1], getPosX() + parent.workspace.getFontRenderer().getStringWidth(strings[0]) + 4, getPosY() + 4, Theme.getAsHex(parent.workspace.currentTheme.fontChat), false);
            }
            GlStateManager.translate(0F, parent.workspace.getFontRenderer().FONT_HEIGHT + 2, 0F);
        }
    }
    GlStateManager.popMatrix();
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:26,代碼來源:ElementTextWrapperChat.java

示例3: drawText

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
public void drawText(int mouseX, int mouseY, boolean hover)
{
    for(int i = 0; i < text.size(); i++)
    {
        String msg = text.get(i);

        List list = parent.workspace.getFontRenderer().listFormattedStringToWidth(msg, width - 12);

        for(int j = 0; j < list.size(); j++)
        {
            if(j == 0)
            {
                parent.workspace.getFontRenderer().drawString((String)list.get(j), getPosX() + 4, getPosY() + 4, Theme.getAsHex(parent.workspace.currentTheme.font), false);
            }
            else
            {
                parent.workspace.getFontRenderer().drawString((String)list.get(j), getPosX() + 12, getPosY() + 4, Theme.getAsHex(parent.workspace.currentTheme.font), false);
            }
            GlStateManager.translate(0F, parent.workspace.getFontRenderer().FONT_HEIGHT + 2, 0F);
        }
    }
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:23,代碼來源:ElementTextWrapper.java

示例4: ElementNumberInput

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
public ElementNumberInput(Window window, int x, int y, int w, int h, int ID, String tip, int fieldCount, boolean allowDec, double minn, double maxx, double... args)
{
    super(window, x, y, w, h, ID, false); //12 for height?

    for(int i = 0; i < fieldCount; i++)
    {
        GuiTextField textField = new GuiTextField(0, parent.workspace.getFontRenderer(), parent.posX + posX + 2 + ((width / fieldCount) * i), parent.posY + posY + 2, (width / fieldCount) - 18, parent.workspace.getFontRenderer().FONT_HEIGHT);
        textField.setMaxStringLength(20);
        textField.setEnableBackgroundDrawing(false);
        textField.setTextColor(Theme.getAsHex(parent.workspace.currentTheme.font));
        textField.setCanLoseFocus(false);
        if(i < args.length)
        {
            textField.setText(allowDec ? Double.toString(args[i]) : Integer.toString((int)args[i]));
        }

        textFields.add(textField);
    }
    allowDecimal = allowDec;
    tooltip = tip;
    spaceL = posX;
    spaceR = parent.width - posX - width;

    min = minn;
    max = maxx;
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:27,代碼來源:ElementNumberInput.java

示例5: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY, boolean hover)
{
    RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementButtonBorder[0], parent.workspace.currentTheme.elementButtonBorder[1], parent.workspace.currentTheme.elementButtonBorder[2], 255, getPosX(), getPosY(), width, height, 0);
    if(hover)
    {
        if(Mouse.isButtonDown(0))
        {
            RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementButtonClick[0], parent.workspace.currentTheme.elementButtonClick[1], parent.workspace.currentTheme.elementButtonClick[2], 255, getPosX() + 1, getPosY() + 1, width - 2, height - 2, 0);
        }
        else
        {
            RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementButtonBackgroundHover[0], parent.workspace.currentTheme.elementButtonBackgroundHover[1], parent.workspace.currentTheme.elementButtonBackgroundHover[2], 255, getPosX() + 1, getPosY() + 1, width - 2, height - 2, 0);
        }
    }
    else
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementButtonBackgroundInactive[0], parent.workspace.currentTheme.elementButtonBackgroundInactive[1], parent.workspace.currentTheme.elementButtonBackgroundInactive[2], 255, getPosX() + 1, getPosY() + 1, width - 2, height - 2, 0);
    }
    if(!(this instanceof ElementButtonTextured))
    {
        parent.workspace.getFontRenderer().drawString(I18n.translateToLocal(text), getPosX() + (width / 2) - (parent.workspace.getFontRenderer().getStringWidth(I18n.translateToLocal(text)) / 2), getPosY() + height - (height / 2) - (parent.workspace.getFontRenderer().FONT_HEIGHT / 2), Theme.getAsHex(parent.workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:25,代碼來源:ElementButton.java

示例6: drawTitle

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
public void drawTitle()
{
    if(hasTitle)
    {
        RendererHelper.drawColourOnScreen(workspace.currentTheme.windowBorder[0], workspace.currentTheme.windowBorder[1], workspace.currentTheme.windowBorder[2], 255, posX + 1, posY + 1, getWidth() - 2, 12, 0);
        String titleToRender = I18n.translateToLocal(titleLocale);
        while(titleToRender.length() > 1 && workspace.getFontRenderer().getStringWidth(titleToRender) > getWidth() - (BORDER_SIZE * 2) - workspace.getFontRenderer().getStringWidth("  _"))
        {
            if(titleToRender.startsWith("..."))
            {
                break;
            }
            if(titleToRender.endsWith("..."))
            {
                titleToRender = titleToRender.substring(0, titleToRender.length() - 4) + "...";
            }
            else
            {
                titleToRender = titleToRender.substring(0, titleToRender.length() - 1) + "...";
            }
        }
        workspace.getFontRenderer().drawString(titleToRender, posX + 4, posY + 3, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:25,代碼來源:Window.java

示例7: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.saveAs.confirmOverwrite"), posX + 15, posY + 40, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:10,代碼來源:WindowOverwrite.java

示例8: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newScene.name"), posX + 11, posY + 20, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:10,代碼來源:WindowNewScene.java

示例9: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newScene.name"), posX + 11, posY + 20, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.editScene.position"), posX + 11, posY + 55, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:11,代碼來源:WindowEditScene.java

示例10: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.name"), posX + 11, posY + 20, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.entityType"), posX + 11, posY + 55, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.preCreate"), posX + 23, posY + 90, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.persist"), posX + 23, posY + 110, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.playerName"), posX + 11, posY + 125, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:14,代碼來源:WindowNewAction.java

示例11: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY, boolean hover)
{
    WindowSceneSelection proj = (WindowSceneSelection)parent;
    if(id != proj.scenes.size() - 1)
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.tabSideInactive[0], parent.workspace.currentTheme.tabSideInactive[1], parent.workspace.currentTheme.tabSideInactive[2], 255, getPosX() + width - 1, getPosY() + 1, 1, height, 0);
    }
    if(proj.selectedScene == id)
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementProjectTabActive[0], parent.workspace.currentTheme.elementProjectTabActive[1], parent.workspace.currentTheme.elementProjectTabActive[2], 255, getPosX(), getPosY(), width - 1, height, 0);
    }
    else if(hover)
    {
        RendererHelper.drawColourOnScreen(parent.workspace.currentTheme.elementProjectTabHover[0], parent.workspace.currentTheme.elementProjectTabHover[1], parent.workspace.currentTheme.elementProjectTabHover[2], 255, getPosX(), getPosY(), width - 1, height, 0);
    }

    String titleToRender = info.name;
    while(titleToRender.length() > 1 && parent.workspace.getFontRenderer().getStringWidth(titleToRender) > width - 11)
    {
        if(titleToRender.startsWith("... "))
        {
            break;
        }
        if(titleToRender.endsWith("... "))
        {
            titleToRender = titleToRender.substring(0, titleToRender.length() - 5) + "... ";
        }
        else
        {
            titleToRender = titleToRender.substring(0, titleToRender.length() - 1) + "... ";
        }
    }
    parent.workspace.getFontRenderer().drawString(titleToRender, parent.posX + posX + 4, parent.posY + posY + 3, Theme.getAsHex(changed ? parent.workspace.currentTheme.elementProjectTabFontChanges : parent.workspace.currentTheme.elementProjectTabFont), false);
    parent.workspace.getFontRenderer().drawString("X", parent.posX + posX + width - 8, parent.posY + posY + 3, Theme.getAsHex(parent.workspace.currentTheme.elementProjectTabFont), false);
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:37,代碼來源:ElementSceneTab.java

示例12: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.saveAs.fileName"), posX + 11, posY + 20, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:10,代碼來源:WindowSaveAs.java

示例13: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.notSaved.unsaved"), posX + 15, posY + 40, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.notSaved.save"), posX + 15, posY + 52, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:11,代碼來源:WindowSaveBeforeClosing.java

示例14: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.name"), posX + 11, posY + 20, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.entityType"), posX + 11, posY + 55, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.preCreate"), posX + 23, posY + 90, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.persist"), posX + 23, posY + 110, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.newAction.playerName"), posX + 11, posY + 125, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.editAction.actionPos"), posX + 11, posY + 160, Theme.getAsHex(workspace.currentTheme.font), false);
        workspace.getFontRenderer().drawString(I18n.translateToLocal("window.editAction.actionOffset"), posX + 11, posY + 195, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Keygrip,代碼行數:16,代碼來源:WindowEditAction.java

示例15: draw

import me.ichun.mods.ichunutil.client.gui.Theme; //導入依賴的package包/類
@Override
public void draw(int mouseX, int mouseY)
{
    super.draw(mouseX, mouseY);
    if(!minimized)
    {
        workspace.getFontRenderer().drawString(I18n.translateToLocal(waypoint == null ? "blocksteps.gui.confirmDeleteMap" : "blocksteps.gui.confirmDeleteWaypoint"), posX + 15, posY + 40, Theme.getAsHex(workspace.currentTheme.font), false);
    }
}
 
開發者ID:iChun,項目名稱:Blocksteps,代碼行數:10,代碼來源:WindowConfirmDelete.java


注:本文中的me.ichun.mods.ichunutil.client.gui.Theme類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。