CPD Results

The following document contains the results of PMD's CPD 3.9.

Duplications

FileLine
net/sourceforge/jeuclid/elements/presentation/table/Mtable.java811
net/sourceforge/jeuclid/elements/presentation/table/Mtable.java912
        for (int col = 0; col < columnsCount; col++) {
            for (int row = 0; row < rowsCount; row++) {
                Mtd cell = null;
                try {
                    cell = this.getCell(row, col);
                } catch (final Exception e) {
                    cell = null;
                }

                if (cell != null) {
                    aligngroups = this.getAlignGroups(cell);
                    groupalignvalues = this.getGroupAlign(cell);
                    if (groupalignvalues.size() == 0) {
                        // values of alignment didn't mentioned, have to use
                        // default
                        groupalignvalues = new Vector<Mtable.AlignmentType>(
                                aligngroups.length);
                        for (final Maligngroup element : aligngroups) {
                            groupalignvalues.add(Mtable.AlignmentType.LEFT);
                        }
                    }
                    if (aligngroups.length == 0
                            || aligngroups.length < groupalignvalues.size()) {
                        continue;
                    }
                    for (int alignIndex = 0; alignIndex < groupalignvalues
                            .size(); alignIndex++) {

FileLine
net/sourceforge/jeuclid/elements/presentation/script/Mmultiscripts.java161
net/sourceforge/jeuclid/elements/presentation/script/Mmultiscripts.java176
            final JEuclidElement sup = this.presuperscripts.get(i);
            final float esubbaselineshift = ScriptSupport
                    .getSubBaselineShift(g, base, sub, sup);
            final float esupbaselineshift = ScriptSupport
                    .getSuperBaselineShift(g, base, sub, sup);
            this.subBaselineShift = Math.max(this.subBaselineShift,
                    esubbaselineshift);
            this.superBaselineShift = Math.max(this.superBaselineShift,
                    esupbaselineshift);
            maxSupAscent = Math.max(maxSupAscent, sup.getAscentHeight(g));
            maxSubDescent = Math.max(maxSubDescent, sub.getDescentHeight(g));
            this.width += Math.max(sub.getWidth(g), sup.getWidth(g));
        }

FileLine
net/sourceforge/jeuclid/elements/presentation/script/Msub.java86
net/sourceforge/jeuclid/elements/presentation/script/Msubsup.java90
        return this.caclulateAscentHeightWithSuper(g);
    }

    /** {@inheritDoc} */
    @Override
    public float calculateDescentHeight(final Graphics2D g) {
        return this.caclulateDescentHeightWithSub(g);
    }

    /** {@inheritDoc} */
    @Override
    public int getScriptlevelForChild(final JEuclidElement child) {
        if (child.isSameNode(this.getFirstChild())) {
            return this.getAbsoluteScriptLevel();
        } else {
            return this.getAbsoluteScriptLevel() + 1;
        }
    }

    /** {@inheritDoc} */
    @Override
    public boolean isChildBlock(final JEuclidElement child) {
        if (child.isSameNode(this.getFirstChild())) {
            return super.isChildBlock(child);
        } else {
            return false;
        }
    }

    /** {@inheritDoc} */
    public String getTagName() {
        return Msubsup.ELEMENT;

FileLine
net/sourceforge/jeuclid/elements/presentation/table/Mtable.java1236
net/sourceforge/jeuclid/elements/presentation/table/Mtd.java124
        this.setAttribute(Mtd.ATTR_COLUMNSPAN, columnspan);
    }

    /**
     * @return Row align
     */
    public String getRowalign() {
        return this.getMathAttribute(Mtable.ATTR_ROWALIGN);
    }

    /**
     * Sets property of the rowalign attribute.
     * 
     * @param rowalign
     *            new value.
     */
    public void setRowalign(final String rowalign) {
        this.setAttribute(Mtable.ATTR_ROWALIGN, rowalign);
    }

    /**
     * @return Column align
     */
    public String getColumnalign() {
        return this.getMathAttribute(Mtable.ATTR_COLUMNALIGN);
    }

    /**
     * Sets property of the columnalign attribute.
     * 
     * @param columnalign
     *            Value
     */
    public void setColumnalign(final String columnalign) {
        this.setAttribute(Mtable.ATTR_COLUMNALIGN, columnalign);
    }

    /**
     * @return Group align
     */
    public String getGroupalign() {
        return this.getMathAttribute(Mtable.ATTR_GROUPALIGN);
    }

    /**
     * Sets property of the groupalign attribute.
     * 
     * @param groupalign
     *            Groupalign
     */
    public void setGroupalign(final String groupalign) {
        this.setAttribute(Mtable.ATTR_GROUPALIGN, groupalign);
    }

    /** {@inheritDoc} */
    public String getTagName() {

FileLine
net/sourceforge/jeuclid/elements/presentation/table/Mtable.java1236
net/sourceforge/jeuclid/elements/presentation/table/Mtr.java53
        this.setDefaultMathAttribute(Mtable.ATTR_GROUPALIGN, "");
    }

    /**
     * Gets row alignment.
     * 
     * @return Alignment of the row.
     */
    public String getRowalign() {
        return this.getMathAttribute(Mtable.ATTR_ROWALIGN);
    }

    /**
     * Sets row alignment.
     * 
     * @param rowalign
     *            Value of row alignment.
     */
    public void setRowalign(final String rowalign) {
        this.setAttribute(Mtable.ATTR_ROWALIGN, rowalign);
    }

    /**
     * Gets alignment for group in column. (not implemented yet).
     * 
     * @return Alignment for group in column.
     */
    public String getColumnalign() {
        return this.getMathAttribute(Mtable.ATTR_COLUMNALIGN);
    }

    /**
     * Sets alignment for group in column. (not implemented yet).
     * 
     * @param columnalign
     *            Alignment for group in column.
     */
    public void setColumnalign(final String columnalign) {
        this.setAttribute(Mtable.ATTR_COLUMNALIGN, columnalign);
    }

    /**
     * Gets alignment of the group for the row. (not implemented yet).
     * 
     * @return Alifnment of the row.
     */
    public String getGroupalign() {
        return this.getMathAttribute(Mtable.ATTR_GROUPALIGN);
    }

    /**
     * Sets alignment of the group for the row. (not implemented yet).
     * 
     * @param groupalign
     *            Alignment.
     */
    public void setGroupalign(final String groupalign) {
        this.setAttribute(Mtable.ATTR_GROUPALIGN, groupalign);
    }