Examples of LengthUnit


Examples of com.lightcrafts.ui.print.PrintLayoutModel.LengthUnit

        unit.addItemListener(
            new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        double oldDim = text.getDimension();
                        LengthUnit oldUnit = text.getUnit();
                        LengthUnit newUnit = unit.getSelectedUnit();
                        double newDim =
                            newUnit.fromPoints(oldUnit.toPoints(oldDim));
                        text.setUnit(newUnit);
                        text.setDimension(newDim);
                    }
                }
            }
View Full Code Here

Examples of com.lightcrafts.ui.print.PrintLayoutModel.LengthUnit

        return box;
    }

    private void updateTop() {
        double y = model.getImageRect().getY();
        LengthUnit unit = topUnit.getSelectedUnit();
        y = unit.fromPoints(y);
        topText.setUnit(unit);
        topText.setDimension(y);
    }
View Full Code Here

Examples of com.lightcrafts.ui.print.PrintLayoutModel.LengthUnit

        topText.setDimension(y);
    }

    private void updateLeft() {
        double x = model.getImageRect().getX();
        LengthUnit unit = leftUnit.getSelectedUnit();
        x = unit.fromPoints(x);
        leftText.setUnit(unit);
        leftText.setDimension(x);
    }
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

            throw new IllegalArgumentException("Value cannot be null.");
        }
        final Matcher matcher = LENGTH_PATTERN.matcher(stringValue);
        if (matcher.matches()) {
            final double value = Double.parseDouble(matcher.group(1));
            LengthUnit unit = LengthUnit.getUnitByName(matcher.group(2));
            return STYLE_VALUE_FACTORY.getLength(null, value, unit);
        }
        // invalid length values are ignored
        return null;
    }
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

            boolean percent = (attributeValue.charAt(length - 1) == '%');
            String numberStr =
                    percent ? attributeValue.substring(0, length - 1)
                            : attributeValue;
            double number = Double.parseDouble(numberStr);
            LengthUnit unit =
                    percent ? LengthUnit.PC : LengthUnit.PX;
            return new HTMLSizeAsAttribute(number, unit, attributeName);
        } else {
            StyleValue styleValue = element.getStyles().getPropertyValues()
                    .getStyleValue(property);
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

        }

        // javadoc inherited
        @Override
        public void updateElementSize(Element element, double newSize) {
            LengthUnit unit = getUnit();

            if (unit == LengthUnit.PC) {
                element.setAttribute(attributeName,
                        Integer.toString((int) newSize) + "%");
            } else if (unit == LengthUnit.PX) {
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

        }

        // javadoc inherited
        @Override
        public void updateElementSize(Element element, double newSize) {
            LengthUnit unit = getUnit();
            StyleValue value;

            if (unit == LengthUnit.PC) {
                value = StyleValueFactory.getDefaultInstance().getPercentage(
                                null, newSize);
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

        return getAsString(styles.getPropertyValues());
    }

    // Javadoc inherited.
    public void visit(StyleLength value, Object object) {
        LengthUnit units = value.getUnit();
        if (units == LengthUnit.PX) {
            total += (int) value.getNumber();
            count += 1;
        }
    }
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

public class PositivePixelLengthRenderer
    extends ValueRendererImpl {

    public void visit(StyleLength value, Object object) {
        LengthUnit units = value.getUnit();
        if (units == LengthUnit.PX) {
            int number = (int) value.getNumber();
            if (number > 0) {
                string = String.valueOf(number);
            }
View Full Code Here

Examples of com.volantis.mcs.themes.values.LengthUnit

*/
public class PositivePixelLengthChecker extends ValueCheckerImpl {

    // Javadoc inherited.
    public void visit(StyleLength value, Object object) {
        LengthUnit units = value.getUnit();
        if (units == LengthUnit.PX) {
            int number = (int) value.getNumber();
            significant = number > 0;
        }
    }
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.