Examples of RelativePoint


Examples of com.intellij.ui.awt.RelativePoint

                        @Override
                        public void run() {
//                            System.out.println("results: " + results);

                            final int caretOffset = editor.getCaretModel().getOffset();
                            RelativePoint caretPoint = getPointFromVisualPosition(editor, editor.offsetToVisualPosition(caretOffset));
                            final Point cP = caretPoint.getOriginalPoint();
                            int lineNumber = document.getLineNumber(caretOffset);
                            final int lineStartOffset = document.getLineStartOffset(lineNumber);
                            final int lineEndOffset = document.getLineEndOffset(lineNumber);

View Full Code Here

Examples of com.intellij.ui.awt.RelativePoint

            final HashMap<Balloon, RelativePoint> balloonPointHashMap = new HashMap<Balloon, RelativePoint>();
            for (int i = start; i < end; i++) {

                int textOffset = results.get(i);
                RelativePoint point = getPointFromVisualPosition(editor, editor.offsetToVisualPosition(textOffset));
                Point originalPoint = point.getOriginalPoint();
                originalPoint.translate(0, -editor.getLineHeight() / 2);
//                System.out.println(originalPoint.getX() + " " + originalPoint.getY());

                JPanel jPanel = new JPanel(new GridLayout());
                jPanel.setBackground(new Color(255, 255, 255));
                int mnemoicNumber = i % ALLOWED_RESULTS;
                String text = String.valueOf(mnemoicNumber);
                if (i % ALLOWED_RESULTS == 0) {
                    text = "Enter";
                }

                JLabel jLabel = new JLabel(text);
//                Font jLabelFont = new Font(jLabel.getFont().getName(), Font.BOLD, 11);
                jLabel.setFont(font);
                jLabel.setBackground(new Color(192, 192, 192));
                jLabel.setHorizontalAlignment(CENTER);
                jLabel.setFocusable(false);
                jLabel.setSize(jLabel.getWidth(), 5);
                jPanel.setFocusable(false);
                jPanel.add(jLabel);

                if (text.equals("Enter")) {
                    jPanel.setPreferredSize(new Dimension(45, 13));

                } else {
                    jPanel.setPreferredSize(new Dimension(19, 13));

                }

                BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(jPanel);
                balloonBuilder.setFadeoutTime(0);
                balloonBuilder.setAnimationCycle(0);
                balloonBuilder.setHideOnClickOutside(true);
                balloonBuilder.setHideOnKeyOutside(true);
                balloonBuilder.setHideOnAction(true);
                balloonBuilder.setFillColor(new Color(221, 221, 221));
                balloonBuilder.setBorderColor(new Color(136, 136, 136));

                Balloon balloon = balloonBuilder.createBalloon();
                balloonPointHashMap.put(balloon, point);


                balloons.add(balloon);
                hashMap.put(mnemoicNumber, textOffset);
            }

            Collections.sort(balloons, new Comparator<Balloon>() {
                @Override
                public int compare(Balloon o1, Balloon o2) {
                    RelativePoint point1 = balloonPointHashMap.get(o1);
                    RelativePoint point2 = balloonPointHashMap.get(o2);

                    if (point1.getOriginalPoint().y < point2.getOriginalPoint().y) {
                        return 1;
                    } else if (point1.getOriginalPoint().y == point2.getOriginalPoint().y) {
                        return 0;
                    } else {
                        return -1;
                    }
                }
            });

            for (int i = 0, balloonsSize = balloons.size(); i < balloonsSize; i++) {
                Balloon balloon = balloons.get(i);
                RelativePoint point = balloonPointHashMap.get(balloon);
                balloon.show(point, Balloon.Position.above);
            }


        }
View Full Code Here

Examples of com.intellij.ui.awt.RelativePoint

    rowBounds.x += 20;
    return getPointForBounds(aTree, rowBounds);
  }

  private static RelativePoint getPointForBounds(JComponent aComponent, final Rectangle aBounds) {
    return new RelativePoint(aComponent, new Point(aBounds.x, (int)aBounds.getMaxY()));
  }
View Full Code Here

Examples of com.intellij.ui.awt.RelativePoint

  public static void showText(JTree tree, TreePath path, int direction, String text) {
    showText(TreeUtils.getPointForPath(tree, path), direction, text);
  }

  public static void showTextBelow(JComponent component, String text) {
    final RelativePoint calloutPoint = RelativePoint.getSouthWestOf(component);
    calloutPoint.getPoint().x += 5;
    Callout.showText(calloutPoint, Callout.SOUTH_EAST, text);
  }
View Full Code Here

Examples of com.intellij.ui.awt.RelativePoint

    final CalloutComponent callout = new CalloutComponent(label);
    callout.show(direction, aPoint);
  }

  public static void showText(JComponent component, int direction, String text) {
    final RelativePoint point = new RelativePoint(component, new Point(component.getWidth() / 2, component.getHeight() / 2));
    showText(point, direction, text);
  }
View Full Code Here

Examples of com.kurento.kmf.media.RelativePoint

        .build();

    List<RegionOfInterest> rois = newArrayList();
    List<RelativePoint> points = new ArrayList<RelativePoint>();

    points.add(new RelativePoint(0, 0));
    points.add(new RelativePoint((float) 0.5, 0));
    points.add(new RelativePoint((float) 0.5, (float) 0.5));
    points.add(new RelativePoint(0, (float) 0.5));

    RegionOfInterestConfig config = new RegionOfInterestConfig();

    config.setFluidityLevelMin(10);
    config.setFluidityLevelMed(35);
View Full Code Here

Examples of com.kurento.kmf.media.RelativePoint

      }

      else if (contentId != null && contentId.equalsIgnoreCase("crowd")) {
        // Crowd Detector Filter
        List<RelativePoint> points = new ArrayList<RelativePoint>();
        points.add(new RelativePoint(0, 0));
        points.add(new RelativePoint(1, 0));
        points.add(new RelativePoint(1, 1));
        points.add(new RelativePoint(0, 1));
        RegionOfInterestConfig config = new RegionOfInterestConfig();
        config.setFluidityLevelMin(10);
        config.setFluidityLevelMed(35);
        config.setFluidityLevelMax(65);
        config.setFluidityNumFramesToEvent(5);
View Full Code Here

Examples of com.kurento.kmf.media.RelativePoint

            float x = coordenate.getAsJsonPrimitive("x")
                .getAsFloat();
            float y = coordenate.getAsJsonPrimitive("y")
                .getAsFloat();

            points.add(new RelativePoint(x, y));
          }

          RegionOfInterestConfig config = new RegionOfInterestConfig();

          config.setFluidityLevelMin(roi.getAsJsonPrimitive(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.