Package simplesheet.style

Examples of simplesheet.style.Margin


            res = edgeToString(res, "left", border.left);
            res = edgeToString(res, "right", border.right);
            res = edgeToString(res, "bottom", border.bottom);
        }
        //margin
        Margin margin = style.getMargin();
        if(margin != null) {
            res += "margin:" + intToEm(margin.top) + intToEm(margin.right)
                    + intToEm(margin.bottom) + intToEm(margin.left) + ";";
        }
        //font
View Full Code Here


    public CellBorderPanel(Style style, TableListener tableListener) {
        this.style = style;
        this.tableListener = tableListener;
        initComponents();

        Margin insets = style.getMargin();
        if(insets != null) {
            topInset.setText(String.valueOf(insets.top));
            bottomInset.setText(String.valueOf(insets.bottom));
            leftInset.setText(String.valueOf(insets.left));
            rightInset.setText(String.valueOf(insets.right));
View Full Code Here

                    value = Integer.parseInt(txt);
                } catch (NumberFormatException ex) {
                    //do nothing
                }
            }
            Margin m = style.getMargin();
            if(m == null) {
                m = new Margin(0, 0, 0, 0);
            }
            if(field == topInset) {
                m = new Margin(m.left, m.right, value, m.bottom);
            } else if(field == bottomInset) {
                m = new Margin(m.left, m.right, m.top, value);
            } else if(field == leftInset) {
                m = new Margin(value, m.right, m.top, m.bottom);
            } else if(field == rightInset) {
                m = new Margin(m.left, value, m.top, m.bottom);
            }
            if(m.bottom == 0
                    && m.left == 0
                    && m.right == 0
                    && m.top == 0) {
View Full Code Here

        String textVAlignStr = XML.getStringAttribute(element, ATTR_TEXTVALIGN, null, false);
        if(textVAlignStr != null) {
             style.setTextVAlign(TextVAlign.valueOf(textVAlignStr));
        }

        Margin m = new Margin(loadMargin(element, TAG_TOP), loadMargin(element, TAG_LEFT),
                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));
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);
View Full Code Here

TOP

Related Classes of simplesheet.style.Margin

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.