Search in sources :

Example 76 with Override

use of java.lang.Override in project android_frameworks_base by ResurrectionRemix.

the class KeyguardSecurityViewFlipper method onTouchEvent.

@Override
public boolean onTouchEvent(MotionEvent ev) {
    boolean result = super.onTouchEvent(ev);
    mTempRect.set(0, 0, 0, 0);
    for (int i = 0; i < getChildCount(); i++) {
        View child = getChildAt(i);
        if (child.getVisibility() == View.VISIBLE) {
            offsetRectIntoDescendantCoords(child, mTempRect);
            ev.offsetLocation(mTempRect.left, mTempRect.top);
            result = child.dispatchTouchEvent(ev) || result;
            ev.offsetLocation(-mTempRect.left, -mTempRect.top);
        }
    }
    return result;
}
Also used : View(android.view.View) Override(java.lang.Override)

Example 77 with Override

use of java.lang.Override in project intellij-community by JetBrains.

the class TestClassSimpleBytecodeMapping method test.

public int test() {
    System.out.println("before");
    run(new Runnable() {

        @Override
        public void run() {
            System.out.println("Runnable");
        }
    });
    test2("1");
    if (Math.random() > 0) {
        System.out.println("0");
        return 0;
    } else {
        System.out.println("1");
        return 1;
    }
}
Also used : Runnable(java.lang.Runnable) Override(java.lang.Override)

Example 78 with Override

use of java.lang.Override in project android_frameworks_base by DirtyUnicorns.

the class KeyguardSecurityViewFlipper method onTouchEvent.

@Override
public boolean onTouchEvent(MotionEvent ev) {
    boolean result = super.onTouchEvent(ev);
    mTempRect.set(0, 0, 0, 0);
    for (int i = 0; i < getChildCount(); i++) {
        View child = getChildAt(i);
        if (child.getVisibility() == View.VISIBLE) {
            offsetRectIntoDescendantCoords(child, mTempRect);
            ev.offsetLocation(mTempRect.left, mTempRect.top);
            result = child.dispatchTouchEvent(ev) || result;
            ev.offsetLocation(-mTempRect.left, -mTempRect.top);
        }
    }
    return result;
}
Also used : View(android.view.View) Override(java.lang.Override)

Example 79 with Override

use of java.lang.Override in project intellij-community by JetBrains.

the class YYYYYYY method addPropertyChangeListener.

@Override
public void addPropertyChangeListener(@NotNull final PropertyChangeListener listener, @NotNull Disposable parentDisposable) {
    addPropertyChangeListener(listener);
    Disposer.register(parentDisposable, new Disposable() {

        @Override
        public void dispose() {
            removePropertyChangeListener(listener);
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) Override(java.lang.Override) Override(java.lang.Override)

Example 80 with Override

use of java.lang.Override in project intellij-community by JetBrains.

the class YYYYYYY method initComponent.

private void initComponent() {
    myPanel.setLayout(new BorderLayout());
    myPanel.add(myHeaderPanel, BorderLayout.NORTH);
    myGutterComponent.setOpaque(true);
    myScrollPane.setViewportView(myEditorComponent);
    //myScrollPane.setBorder(null);
    myScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    myScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    myScrollPane.setRowHeaderView(myGutterComponent);
    myEditorComponent.setTransferHandler(new MyTransferHandler());
    myEditorComponent.setAutoscrolls(true);
    if (mayShowToolbar()) {
        JLayeredPane layeredPane = new JBLayeredPane() {

            @Override
            public void doLayout() {
                final Component[] components = getComponents();
                final Rectangle r = getBounds();
                for (Component c : components) {
                    if (c instanceof JScrollPane) {
                        c.setBounds(0, 0, r.width, r.height);
                    } else {
                        final Dimension d = c.getPreferredSize();
                        final MyScrollBar scrollBar = getVerticalScrollBar();
                        c.setBounds(r.width - d.width - scrollBar.getWidth() - 30, 20, d.width, d.height);
                    }
                }
            }

            @Override
            public Dimension getPreferredSize() {
                return myScrollPane.getPreferredSize();
            }
        };
        layeredPane.add(myScrollPane, JLayeredPane.DEFAULT_LAYER);
        myPanel.add(layeredPane);
        new ContextMenuImpl(layeredPane, myScrollPane, this);
    } else {
        myPanel.add(myScrollPane);
    }
    myEditorComponent.addKeyListener(new KeyListener() {

        @Override
        public void keyPressed(@NotNull KeyEvent e) {
            if (e.getKeyCode() >= KeyEvent.VK_A && e.getKeyCode() <= KeyEvent.VK_Z) {
                myCharKeyPressed = true;
            }
            KeyboardInternationalizationNotificationManager.showNotification();
        }

        @Override
        public void keyTyped(@NotNull KeyEvent event) {
            myNeedToSelectPreviousChar = false;
            if (event.isConsumed()) {
                return;
            }
            if (processKeyTyped(event)) {
                event.consume();
            }
        }

        @Override
        public void keyReleased(KeyEvent e) {
            myCharKeyPressed = false;
        }
    });
    MyMouseAdapter mouseAdapter = new MyMouseAdapter();
    myEditorComponent.addMouseListener(mouseAdapter);
    myGutterComponent.addMouseListener(mouseAdapter);
    MyMouseMotionListener mouseMotionListener = new MyMouseMotionListener();
    myEditorComponent.addMouseMotionListener(mouseMotionListener);
    myGutterComponent.addMouseMotionListener(mouseMotionListener);
    myEditorComponent.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(@NotNull FocusEvent e) {
            myCaretCursor.activate();
            for (Caret caret : myCaretModel.getAllCarets()) {
                int caretLine = caret.getLogicalPosition().line;
                repaintLines(caretLine, caretLine);
            }
            fireFocusGained();
        }

        @Override
        public void focusLost(@NotNull FocusEvent e) {
            clearCaretThread();
            for (Caret caret : myCaretModel.getAllCarets()) {
                int caretLine = caret.getLogicalPosition().line;
                repaintLines(caretLine, caretLine);
            }
            fireFocusLost();
        }
    });
    UiNotifyConnector connector = new UiNotifyConnector(myEditorComponent, new Activatable.Adapter() {

        @Override
        public void showNotify() {
            myGutterComponent.updateSize();
        }
    });
    Disposer.register(getDisposable(), connector);
    try {
        final DropTarget dropTarget = myEditorComponent.getDropTarget();
        if (dropTarget != null) {
            // might be null in headless environment
            dropTarget.addDropTargetListener(new DropTargetAdapter() {

                @Override
                public void drop(@NotNull DropTargetDropEvent e) {
                }

                @Override
                public void dragOver(@NotNull DropTargetDragEvent e) {
                    Point location = e.getLocation();
                    getCaretModel().moveToLogicalPosition(getLogicalPositionForScreenPos(location.x, location.y, true));
                    getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
                }
            });
        }
    } catch (TooManyListenersException e) {
        LOG.error(e);
    }
    myPanel.addComponentListener(new ComponentAdapter() {

        @Override
        public void componentResized(@NotNull ComponentEvent e) {
            myMarkupModel.recalcEditorDimensions();
            myMarkupModel.repaint(-1, -1);
        }
    });
}
Also used : UiNotifyConnector(com.intellij.util.ui.update.UiNotifyConnector) EditorFragmentComponent(com.intellij.codeInsight.hint.EditorFragmentComponent) Override(java.lang.Override) DropTargetDragEvent(java.awt.dnd.DropTargetDragEvent) Activatable(com.intellij.util.ui.update.Activatable) DropTargetAdapter(java.awt.dnd.DropTargetAdapter) JBLayeredPane(com.intellij.ui.components.JBLayeredPane) DropTarget(java.awt.dnd.DropTarget) DropTargetDropEvent(java.awt.dnd.DropTargetDropEvent)

Aggregations

Override (java.lang.Override)177 StringBuilder (java.lang.StringBuilder)83 String (java.lang.String)36 NonNull (android.support.annotation.NonNull)24 ContentValues (android.content.ContentValues)12 ArrayList (java.util.ArrayList)11 View (android.view.View)10 Integer (java.lang.Integer)9 Long (java.lang.Long)9 HashMap (java.util.HashMap)9 Boolean (java.lang.Boolean)8 Double (java.lang.Double)8 Float (java.lang.Float)8 Short (java.lang.Short)8 Bitmap (android.graphics.Bitmap)5 Canvas (android.graphics.Canvas)5 Handler (android.os.Handler)5 HandlerThread (android.os.HandlerThread)5 SmallTest (android.test.suitebuilder.annotation.SmallTest)5 Map (java.util.Map)5