Package org.apache.isis.viewer.dnd.drawing

Examples of org.apache.isis.viewer.dnd.drawing.Text


    @Override
    public void draw(final Canvas canvas) {
        super.draw(canvas);

        final Text titleStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
        final Text normalStyle = Toolkit.getText(ColorsAndFonts.TEXT_LABEL);
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);

        clearBackground(canvas, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
        canvas.drawRectangleAround(getBounds(), Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));

        if (showingImage()) {
            canvas.drawImage(image, margin, margin);
        }

        int line = margin + image.getHeight() + noticePadding + normalStyle.getAscent();

        // application details
        String text = AboutIsis.getApplicationName();
        if (text != null) {
            canvas.drawText(text, left, line, MAX_WIDTH, color, titleStyle);
            line += titleStyle.stringHeight(text, MAX_WIDTH) + titleStyle.getLineSpacing() + linePadding;
        }
        text = AboutIsis.getApplicationCopyrightNotice();
        if (text != null) {
            canvas.drawText(text, left, line, MAX_WIDTH, color, normalStyle);
            line += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
        }
        text = AboutIsis.getApplicationVersion();
        if (text != null) {
            canvas.drawText(text, left, line, MAX_WIDTH, color, normalStyle);
            line += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
            line += 2 * normalStyle.getLineHeight();
        }

        // framework details
        text = AboutIsis.getFrameworkName();
        canvas.drawText(text, left, line, MAX_WIDTH, color, titleStyle);
        line += titleStyle.stringHeight(text, MAX_WIDTH) + titleStyle.getLineSpacing() + linePadding;

        text = AboutIsis.getFrameworkCopyrightNotice();
        canvas.drawText(text, left, line, MAX_WIDTH, color, normalStyle);
        line += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;

        canvas.drawText(frameworkVersion(), left, line, MAX_WIDTH, color, normalStyle);

    }
View Full Code Here


        return image != null;
    }

    @Override
    public Size getRequiredSize(final Size availableSpace) {
        final Text titleStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
        final Text normalStyle = Toolkit.getText(ColorsAndFonts.TEXT_LABEL);

        int height = 0;

        String text = AboutIsis.getFrameworkName();
        height += titleStyle.stringHeight(text, MAX_WIDTH) + titleStyle.getLineSpacing() + linePadding;
        // height += normalStyle.getLineHeight();
        int width = titleStyle.stringWidth(text, MAX_WIDTH);

        text = AboutIsis.getFrameworkCopyrightNotice();
        height += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
        // height += normalStyle.getLineHeight();
        width = Math.max(width, normalStyle.stringWidth(text, MAX_WIDTH));

        text = frameworkVersion();
        height += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
        // height += normalStyle.getLineHeight();
        width = Math.max(width, normalStyle.stringWidth(text, MAX_WIDTH));

        text = AboutIsis.getApplicationName();
        if (text != null) {
            height += titleStyle.stringHeight(text, MAX_WIDTH) + titleStyle.getLineSpacing() + linePadding;
            // height += normalStyle.getLineHeight();
            width = Math.max(width, titleStyle.stringWidth(text, MAX_WIDTH));
        }
        text = AboutIsis.getApplicationCopyrightNotice();
        if (text != null) {
            height += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
            // height += normalStyle.getLineHeight();
            width = Math.max(width, normalStyle.stringWidth(text, MAX_WIDTH));
        }
        text = AboutIsis.getApplicationVersion();
        if (text != null) {
            height += normalStyle.stringHeight(text, MAX_WIDTH) + normalStyle.getLineSpacing() + linePadding;
            // height += normalStyle.getLineHeight();
            width = Math.max(width, normalStyle.stringWidth(text, MAX_WIDTH));
        }

        height += noticePadding;

        if (showingImage()) {
View Full Code Here

    private final TableAxis axis;

    public TableRowBorder(final Axes axes, final View wrappedRow) {
        super(wrappedRow);

        final Text text = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
        icon = new IconGraphic(this, text);
        title = new ObjectTitleText(this, text);
        baseline = icon.getBaseline();

        left = requiredTitleWidth() + BORDER;
View Full Code Here

    protected static Toolkit getInstance() {
        return instance;
    }

    public static Text getText(final String name) {
        final Text text = getInstance().colorsAndFonts.getText(name);
        if (text == null) {
            throw new IsisException("No such text style: " + name);
        }
        return text;
    }
View Full Code Here

        LOG.debug("  insets " + insets);
        internalDisplaySize.contract(insets.left + insets.right, insets.top + insets.bottom);
        LOG.debug("  internal " + internalDisplaySize);

        final Size rootViewSize = new Size(internalDisplaySize);
        final Text text = Toolkit.getText(ColorsAndFonts.TEXT_STATUS);
        statusBarHeight = text.getLineHeight() + text.getDescent();
        rootViewSize.contractHeight(statusBarHeight);
        statusBarArea = new Bounds(insets.left, insets.top + rootViewSize.getHeight(), rootViewSize.getWidth(), statusBarHeight);
        rootView.setSize(rootViewSize);
    }
View Full Code Here

    @Override
    public void draw(final Canvas canvas) {
        super.draw(canvas);
        int y = 0;
        final int height = (getSize().getHeight() - 5) / histogramAxis.getNoBars();
        final Text text = Toolkit.getText(ColorsAndFonts.TEXT_LABEL);
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1);
        canvas.drawText(getContent().title(), 0, height / 2 + text.getAscent() / 2, color, text);

        for (int i = 0; i < histogramAxis.getNoBars(); i++) {
            final double length = (getSize().getWidth() - 160) * histogramAxis.getLengthFor(getContent(), i);
            canvas.drawSolidRectangle(160, y, (int) length, height, Toolkit.getColor(colors[i % colors.length]));
            canvas.drawRectangle(160, y, (int) length, height, Toolkit.getColor(ColorsAndFonts.COLOR_BLACK));
View Full Code Here

    }

    @Override
    public void draw(final Canvas canvas) {
        final String debug = getView() + " " + getState();
        final Text text = Toolkit.getText(ColorsAndFonts.TEXT_DEBUG);
        final int baseline = wrappedView.getSize().getHeight() + text.getAscent();
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BASELINE);
        canvas.drawText(debug, 0, baseline, color, text);

        super.draw(canvas);
    }
View Full Code Here

        return requirement.isClosed() && requirement.isObject() && requirement.hasReference();
    }

    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
        final Icon icon = new Icon(content, this);
        icon.setTitle(new ObjectTitleText(icon, style));
        icon.setSelectedGraphic(new IconGraphic(icon, style));
        return icon;
    }
View Full Code Here

public class ImageViewSpecification implements ViewSpecification {

    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final Icon icon = new Icon(content, ImageViewSpecification.this);
        final Text textStyle = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
        icon.setTitle(new ObjectTitleText(icon, textStyle));
        icon.setSelectedGraphic(new IconGraphic(icon, 68));
        icon.setUnselectedGraphic(new IconGraphic(icon, 60));
        icon.setVertical(true);
View Full Code Here

        return requirement.isClosed() && requirement.isObject() && requirement.hasReference() && requirement.isSubview();
    }

    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
        final Icon icon = new Icon(content, this);
        icon.setTitle(new ObjectTitleText(icon, style));
        icon.setSelectedGraphic(new IconGraphic(icon, size));
        icon.setVertical(true);
        return new ObjectBorder(icon);
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.drawing.Text

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.