Search in sources :

Example 1 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ActualSizeAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
    if (decorator != null) {
        ImageZoomModel zoomModel = decorator.getZoomModel();
        zoomModel.setZoomFactor(1.0d);
    }
}
Also used : ImageZoomModel(org.intellij.images.editor.ImageZoomModel) ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 2 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ZoomInAction method update.

public void update(AnActionEvent e) {
    super.update(e);
    if (ImageEditorActionUtil.setEnabled(e)) {
        ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
        ImageZoomModel zoomModel = decorator.getZoomModel();
        e.getPresentation().setEnabled(zoomModel.canZoomIn());
    }
}
Also used : ImageZoomModel(org.intellij.images.editor.ImageZoomModel) ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 3 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ZoomInAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
    if (decorator != null) {
        ImageZoomModel zoomModel = decorator.getZoomModel();
        zoomModel.zoomIn();
    }
}
Also used : ImageZoomModel(org.intellij.images.editor.ImageZoomModel) ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 4 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ZoomOutAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
    if (decorator != null) {
        ImageZoomModel zoomModel = decorator.getZoomModel();
        zoomModel.zoomOut();
    }
}
Also used : ImageZoomModel(org.intellij.images.editor.ImageZoomModel) ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 5 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ToggleFileSizeAction method setSelected.

public void setSelected(AnActionEvent e, boolean state) {
    ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
    if (decorator != null && decorator.isEnabledForActionPlace(e.getPlace())) {
        decorator.setFileSizeVisible(state);
        OptionsManager.getInstance().getOptions().getEditorOptions().setFileSizeVisible(state);
    }
}
Also used : ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Aggregations

ImageComponentDecorator (org.intellij.images.ui.ImageComponentDecorator)12 ImageZoomModel (org.intellij.images.editor.ImageZoomModel)6 Presentation (com.intellij.openapi.actionSystem.Presentation)1