Package simplesheet.style

Examples of simplesheet.style.CellBorder


        //background
        if(style.getBackground() != null) {
            res += "background:#" + Integer.toHexString(style.getBackground().getRGB()).substring(2) + ";";
        }
        //border
        CellBorder border = style.getBorder();
        if(border != null) {
            res = edgeToString(res, "top", border.top);
            res = edgeToString(res, "left", border.left);
            res = edgeToString(res, "right", border.right);
            res = edgeToString(res, "bottom", border.bottom);
View Full Code Here


        topInset.getDocument().addDocumentListener(new InsetChanged(topInset));
        bottomInset.getDocument().addDocumentListener(new InsetChanged(bottomInset));
        rightInset.getDocument().addDocumentListener(new InsetChanged(rightInset));
        leftInset.getDocument().addDocumentListener(new InsetChanged(leftInset));

        CellBorder border = style.getBorder();
        initEdgeControls(border == null ? null:border.top, topBorderCombo, topWidthField);
        initEdgeControls(border == null ? null:border.bottom, bottomBorderCombo, bottomWidthField);
        initEdgeControls(border == null ? null:border.left, leftBorderCombo, leftWidthField);
        initEdgeControls(border == null ? null:border.right, rightBorderCombo, rightWidthField);
    }
View Full Code Here

        });
    }

    private void updateBorder() {
        try {
            CellBorder border = null;
            if(allInOneBtn.isSelected()) {
                CellEdge edge = getEdge(topBorderCombo, topWidthField);
                border = new CellBorder(edge, edge, edge, edge);
            } else if(topBottomBtn.isSelected()) {
                CellEdge top = getEdge(topBorderCombo, topWidthField);
                CellEdge bottom = getEdge(bottomBorderCombo, bottomWidthField);
                border = new CellBorder(top, null, null, bottom);
            } else if(leftRightBtn.isSelected()) {
                CellEdge left = getEdge(leftBorderCombo, leftWidthField);
                CellEdge right = getEdge(rightBorderCombo, rightWidthField);
                border = new CellBorder(null, left, right, null);
            } else {
                CellEdge top = getEdge(topBorderCombo, topWidthField);
                CellEdge bottom = getEdge(bottomBorderCombo, bottomWidthField);
                CellEdge left = getEdge(leftBorderCombo, leftWidthField);
                CellEdge right = getEdge(rightBorderCombo, rightWidthField);
                border = new CellBorder(top, left, right, bottom);
            }
            if (border.isEmpty()) {
                style.setBorder(null);
            } else {
                style.setBorder(border);
            }
        } catch (NumberFormatException e) {
View Full Code Here

                loadMargin(element, TAG_RIGHT), loadMargin(element, TAG_BOTTOM));
        if(!m.isEmpty()) {
            style.setMargin(m);
        }

        CellBorder b = new CellBorder(loadBorder(element, TAG_TOP), loadBorder(element, TAG_LEFT),
                loadBorder(element, TAG_RIGHT), loadBorder(element, TAG_BOTTOM));
        if(!b.isEmpty()) {
            style.setBorder(b);
        }
    }
View Full Code Here

        if(style.getTextVAlign() != TextVAlign.undefined) {
            root.setAttribute(ATTR_TEXTVALIGN, style.getTextVAlign().name());
        }

        Margin margin = style.getMargin();
        CellBorder cellBorder = style.getBorder();
        saveBorder(root, TAG_TOP, margin == null ? 0:margin.top,
                cellBorder == null ? null: cellBorder.top);
        saveBorder(root, TAG_LEFT, margin == null ? 0:margin.left,
                cellBorder == null ? null: cellBorder.left);
        saveBorder(root, TAG_RIGHT, margin == null ? 0:margin.right,
View Full Code Here

TOP

Related Classes of simplesheet.style.CellBorder

Copyright © 2018 www.massapicom. 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.