Examples of addTrait()


Examples of net.citizensnpcs.api.npc.NPC.addTrait()

    }

    public net.citizensnpcs.api.trait.trait.Inventory getInventoryTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(net.citizensnpcs.api.trait.trait.Inventory.class))
            npc.addTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
        return npc.getTrait(net.citizensnpcs.api.trait.trait.Inventory.class);
    }

    public LookClose getLookCloseTrait() {
        NPC npc = getCitizen();
View Full Code Here

Examples of net.citizensnpcs.api.npc.NPC.addTrait()

    }

    public LookClose getLookCloseTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(LookClose.class))
            npc.addTrait(LookClose.class);
        return npc.getTrait(LookClose.class);
    }

    public TriggerTrait getTriggerTrait() {
        NPC npc = getCitizen();
View Full Code Here

Examples of net.citizensnpcs.api.npc.NPC.addTrait()

    }

    public TriggerTrait getTriggerTrait() {
        NPC npc = getCitizen();
        if (!npc.hasTrait(TriggerTrait.class))
            npc.addTrait(TriggerTrait.class);
        return npc.getTrait(TriggerTrait.class);
    }

    public String action(String actionName, dPlayer player, Map<String, dObject> context) {
        if (getCitizen() != null)
View Full Code Here

Examples of org.apache.fop.area.Block.addTrait()

    public Block getRowArea(TableRow row) {
        if (row == null || !row.getCommonBorderPaddingBackground().hasBackground()) {
            return null;
        } else {
            Block block = new Block();
            block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
            block.setPositioning(Block.ABSOLUTE);
            return block;
        }
    }
View Full Code Here

Examples of org.apache.fop.area.Block.addTrait()

                    for (int x = 0; x < gridUnits.length; x++) {
                        GridUnit gu = gridUnits[x];
                        if (gu.hasBorders()) {
                            //Blocks for painting grid unit borders
                            Block block = new Block();
                            block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
                            block.setPositioning(Block.ABSOLUTE);
   
                            int bpd = spannedGridRowHeights[y - startRow];
                            bpd -= gu.getBorders().getBorderBeforeWidth(false) / 2;
                            bpd -= gu.getBorders().getBorderAfterWidth(false) / 2;
View Full Code Here

Examples of org.apache.fop.area.Block.addTrait()

        bpd -= (borderBefore.getRetainedWidth() + borderAfter.getRetainedWidth()) / 2;

        //generate the block area
        Block block = new Block();
        block.setPositioning(Block.ABSOLUTE);
        block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
        block.setIPD(ipd);
        block.setBPD(bpd);
        block.setXOffset(tclm.getXOffsetOfGridUnit(colIndex)
                + (borderStart.getRetainedWidth() / 2));
        block.setYOffset(getRowOffset(rowIndex)
View Full Code Here

Examples of org.apache.fop.area.Block.addTrait()

        bpd -= (borderBefore.getRetainedWidth() + borderAfter.getRetainedWidth()) / 2;

        //generate the block area
        Block block = new Block();
        block.setPositioning(Block.ABSOLUTE);
        block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
        block.setIPD(ipd);
        block.setBPD(bpd);
        block.setXOffset(tclm.getXOffsetOfGridUnit(colIndex, 1)
                + (borderStart.getRetainedWidth() / 2));
        block.setYOffset(getRowOffset(rowIndex)
View Full Code Here

Examples of org.apache.fop.area.LineArea.addTrait()

            LineArea lineArea
              = new LineArea((lbp.getLeafPos() < seq.size() - 1
                              ? textAlignment : textAlignmentLast),
                              lbp.difference, lbp.availableStretch, lbp.availableShrink);
            if (lbp.startIndent != 0) {
                lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
            }
            lineArea.setBPD(lbp.lineHeight);
            lineArea.setIPD(lbp.lineWidth);
            lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
            lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
View Full Code Here

Examples of org.apache.fop.area.LineArea.addTrait()

            if (lbp.startIndent != 0) {
                lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
            }
            lineArea.setBPD(lbp.lineHeight);
            lineArea.setIPD(lbp.lineWidth);
            lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
            lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
            alignmentContext.resizeLine(lbp.lineHeight, lbp.baseline);
           
            if (seq instanceof Paragraph) {
                Paragraph currPar = (Paragraph) seq;
View Full Code Here

Examples of org.apache.fop.area.LineArea.addTrait()

                lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
            }
            lineArea.setBPD(lbp.lineHeight);
            lineArea.setIPD(lbp.lineWidth);
            lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
            lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
            alignmentContext.resizeLine(lbp.lineHeight, lbp.baseline);
           
            if (seq instanceof Paragraph) {
                Paragraph currPar = (Paragraph) seq;
                // ignore the first elements added by the LineLayoutManager
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.