Directory

← Back

Jcrop-Wrapper

Vaadin Wrapper for the jQuery image cropping plugin Jcrop

Author

Rating

Popularity

<100

The Jcrop-Component allows to easily provide an image cropper within Vaadin. Mainly it's a JavaScriptComponent that wrapps the jQuery plugin Jcrop.

Features:

  • listener for selection changes
  • setting of min/max size of the crop area
  • forcing an aspect ratio on the crop area
  • selecting in the true size coordinate system of scaled images
  • fitting the image within the provided layout size of component
  • added support for ConnectorResource by a RequestHandler

Sample code

package org.vaadin.jcrop;

import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.*;
import org.vaadin.jcrop.selection.JcropSelection;
import org.vaadin.jcrop.selection.JcropSelectionChanged;


public class JCropSampleUI extends UI {
    private Jcrop jcrop;

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        jcrop = new Jcrop();
        jcrop.setWidth(750, Unit.PIXELS);
        jcrop.setHeight(500, Unit.PIXELS);
        jcrop.setImageUrl("url to your image");
        jcrop.addListener(new JcropSelectionChanged() {
            @Override
            public void selectionChanged(JcropSelection selection) {
                System.out.println(selection.toString());
            }
        });

        final VerticalLayout layout = new VerticalLayout();
        layout.addComponent(jcrop);
        setContent(layout);
    }
}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • upgraded to vaadin-8
Released
2017-04-01
Maturity
STABLE
License
MIT License

Compatibility

Framework
Vaadin 8.0+
Vaadin 7.0+ in 1.0.0
Browser
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
Internet Explorer
Internet Explorer

Jcrop-Wrapper - Vaadin Add-on Directory

Vaadin Wrapper for the jQuery image cropping plugin Jcrop Jcrop-Wrapper - Vaadin Add-on Directory
The Jcrop-Component allows to easily provide an image cropper within Vaadin. Mainly it's a JavaScriptComponent that wrapps the jQuery plugin Jcrop. Features: - listener for selection changes - setting of min/max size of the crop area - forcing an aspect ratio on the crop area - selecting in the true size coordinate system of scaled images - fitting the image within the provided layout size of component - added support for ConnectorResource by a RequestHandler
Online Demo
Author Homepage
Source Code
Issue Tracker

Jcrop-Wrapper version 1.0.0
implemented all major features of the Jcrop plugin

Jcrop-Wrapper version 1.1.0
added support for ConnectorResource, so that you can use also StreamImages... Normally it's not possible in JavaScriptComponents, that's why I used a RequestHandler and simplified the use in Jcrop.

Jcrop-Wrapper version 1.1.1
fixed maven group id

Jcrop-Wrapper version 1.1.2
fixed maven problems

Jcrop-Wrapper version 1.2.0
- upgraded to vaadin-8

Online