Search in sources :

Example 1 with ZoomType

use of com.intellij.designer.designSurface.ZoomType in project intellij-community by JetBrains.

the class SelectionTool method handleKeyTyped.

protected void handleKeyTyped(KeyEvent event) {
    char keyChar = event.getKeyChar();
    switch(keyChar) {
        // Zoom
        case '-':
        case '+':
        case '0':
        case '1':
            ZoomType type;
            if (keyChar == '-') {
                type = ZoomType.OUT;
            } else if (keyChar == '+') {
                type = ZoomType.IN;
            } else if (keyChar == '0') {
                type = ZoomType.FIT;
            } else {
                // '1'
                type = ZoomType.ACTUAL;
            }
            if (myToolProvider.isZoomSupported()) {
                myToolProvider.zoom(type);
                event.consume();
                return;
            }
        // else: fall through
        default:
            if (Character.isLetterOrDigit(keyChar) && (event.getModifiers() & (InputEvent.ALT_MASK | InputEvent.CTRL_MASK | InputEvent.META_MASK)) == 0) {
                myToolProvider.startInplaceEditing(new InplaceContext(keyChar));
            }
    }
}
Also used : ZoomType(com.intellij.designer.designSurface.ZoomType) InplaceContext(com.intellij.designer.propertyTable.InplaceContext)

Aggregations

ZoomType (com.intellij.designer.designSurface.ZoomType)1 InplaceContext (com.intellij.designer.propertyTable.InplaceContext)1